:root {
  color-scheme: dark;
  --ink: #f6ecdc;
  --dim: #b09a7b;
  --gold: #e8b45a;
  --bad: #ff9a86;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 8%, #2a1d10 0%, #150e07 55%, #0b0704 100%);
  color: var(--ink);
  font: 16px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  padding:
    max(0.6rem, env(safe-area-inset-top))
    max(0.9rem, env(safe-area-inset-left))
    max(0.8rem, env(safe-area-inset-bottom))
    max(0.9rem, env(safe-area-inset-right));
}

#stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.65));
}

#wheel:active { cursor: grabbing; }

#pitch {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) auto;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

input {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(232, 180, 90, 0.22);
  border-radius: 0.6rem;
  background: rgba(255, 240, 214, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

input::placeholder { color: rgba(176, 154, 123, 0.75); }

input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 240, 214, 0.1);
}

button {
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 0.6rem;
  font: inherit;
  font-weight: 700;
  color: #23160a;
  background: linear-gradient(160deg, #f6cd7c, #d09433);
  cursor: pointer;
}

button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; }

#note {
  flex: none;
  margin: 0.4rem 0 0;
  min-height: 1.15rem;
  font-size: 0.78rem;
  color: var(--dim);
  text-align: center;
}

#note[data-tone="bad"] { color: var(--bad); }

#winner {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(90% 70% at 50% 50%, rgba(30, 20, 10, 0.86), rgba(6, 4, 2, 0.96));
  backdrop-filter: blur(4px);
  animation: fade 0.35s ease;
}

#winner[hidden] { display: none; }

.card { text-align: center; max-width: 22rem; }

.kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

#winner h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 8vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

#winner-who { margin: 0; color: var(--dim); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 620px) {
  #pitch { max-width: 34rem; margin-inline: auto; width: 100%; }
}
