@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&display=swap");

:root {
  --bg-1: #f8fafc;
  --bg-2: #e2e8f0;
  --ink: #0f172a;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --card: #ffffff;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at top left, var(--bg-1), var(--bg-2));
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(32px, 4vw, 42px);
}

h2 {
  font-size: clamp(24px, 3vw, 32px);
}

h3 {
  font-size: 22px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 19px;
  font-weight: 700;
  background: #d1d5db;
  color: #111827;
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-large {
  width: 100%;
  margin-top: 14px;
  padding: 16px 22px;
  font-size: 20px;
}

.roulette-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.roulette-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  cursor: pointer;
}

.roulette-card h3 {
  margin-bottom: 8px;
}

.roulette-card p {
  margin: 0 0 12px;
  font-size: 18px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.card-actions .btn {
  width: auto;
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
}

.btn-muted {
  background: #d1d5db;
  color: #1f2937;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-x {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wheel-wrap {
  width: min(90vw, 540px);
  margin: 0 auto;
  position: relative;
}

.wheel-wrap-admin {
  margin-bottom: 16px;
}

#wheelCanvas,
#adminWheelCanvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.15);
  touch-action: manipulation;
  cursor: pointer;
}

.pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid #dc2626;
  z-index: 2;
}

.result-box {
  margin-top: 20px;
  text-align: center;
  min-height: 52px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.result-label {
  color: #dc2626;
}

.admin-layout {
  display: grid;
  gap: 14px;
}

.admin-layout label {
  display: grid;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}

input {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  font-size: 18px;
}

.options-block {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.option-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.option-row input {
  flex: 1;
}

.option-row .option-prob {
  flex: 0 0 120px;
}

.option-row button {
  border-radius: 10px;
}

dialog {
  border: none;
  border-radius: 18px;
  width: min(92vw, 410px);
}

.dialog-form {
  display: grid;
  gap: 12px;
}

.dialog-form h3 {
  font-size: 26px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    flex-direction: column;
  }

  .container {
    padding: 14px;
  }

  .btn {
    width: 100%;
  }

  h1 {
    font-size: 30px;
  }
}
