:root {
  --bg-0: #050608;
  --bg-1: #0c0e12;
  --bg-2: #14171c;
  --card: #181b21;
  --card-2: #1f242c;
  --line: #2a2f38;
  --text: #f3f5f8;
  --text-dim: #9ba2ad;
  --text-mute: #5b6270;
  --accent: #ff7a1f;
  --accent-2: #ffa05a;
  --accent-glow: rgba(255,122,31,.45);
  --steel: #8a93a1;
  --steel-2: #c6ccd6;
  --green: #4ade80;
  --red: #f25555;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --shadow-soft: 0 18px 60px -20px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.4);
  --font-display: "Bebas Neue", "Oswald", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

/* Dark gaming background — Valorant/CS2 moody aesthetic */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(15,14,30,.0) 30%, rgba(0,0,0,.5) 100%),
    linear-gradient(160deg, #0a0b14 0%, #0f0e1e 40%, #141020 60%, #0a0b14 100%);
}
.bg-animated__stripes {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -55deg,
      transparent 0px,
      transparent 78px,
      rgba(255,255,255,.02) 78px,
      rgba(255,255,255,.02) 80px,
      transparent 80px,
      transparent 158px,
      rgba(255,255,255,.015) 158px,
      rgba(255,255,255,.015) 160px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 3px,
      rgba(255,255,255,.008) 3px,
      rgba(255,255,255,.008) 4px
    );
}
.bg-animated__glow {
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  top: -30vmax;
  left: -30vmax;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255,122,31,.07) 0%,
    rgba(255,80,20,.03) 30%,
    transparent 60%
  );
  animation: glowDrift 30s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(25vw, 15vh); }
  66%  { transform: translate(-10vw, 30vh); }
  100% { transform: translate(20vw, -5vh); }
}
.bg-animated__glow--2 {
  background: radial-gradient(
    circle,
    rgba(120,50,200,.06) 0%,
    rgba(80,30,160,.02) 30%,
    transparent 55%
  );
  animation: glowDrift2 35s ease-in-out infinite alternate;
  top: auto;
  bottom: -30vmax;
  left: auto;
  right: -30vmax;
}
@keyframes glowDrift2 {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-20vw, -10vh); }
  66%  { transform: translate(15vw, -25vh); }
  100% { transform: translate(-10vw, 5vh); }
}
.bg-animated__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 20%,
    rgba(0,0,0,.35) 70%,
    rgba(0,0,0,.6) 100%
  );
}
#app { position: relative; z-index: 1; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

#app { min-height: 100vh; min-height: 100dvh; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: screenIn .35s ease-out both;
}
.screen[hidden] { display: none; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============== AUDIO BAR ============== */
.audio-bar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(12,14,18,.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 8px;
}
.audio-bar__music,
.audio-bar__fx {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20,23,28,.7);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), color .15s, background .15s, border-color .15s;
  backdrop-filter: blur(8px);
}
.audio-bar__music:hover,
.audio-bar__fx:hover {
  color: var(--text);
  background: rgba(30,34,42,.85);
  transform: scale(1.08);
}
.audio-bar__music:active,
.audio-bar__fx:active {
  transform: scale(0.92);
  transition-duration: 80ms;
}
.audio-bar__music svg { width: 18px; height: 18px; }
.audio-bar__music.is-muted {
  color: var(--text-mute);
  opacity: 0.5;
}
.audio-bar__fx {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.audio-bar__fx.is-muted {
  color: var(--text-mute);
  text-decoration: line-through;
  opacity: 0.5;
}

.audio-bar__track {
  display: flex;
  align-items: center;
  width: 120px;
  height: 36px;
  padding: 0 12px;
  background: rgba(20,23,28,.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transform: scaleX(0);
  transform-origin: right center;
  opacity: 0;
  pointer-events: none;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), opacity 150ms ease;
}
.audio-bar:hover .audio-bar__track,
.audio-bar__track:focus-within {
  transform: scaleX(1);
  opacity: 1;
  pointer-events: auto;
}
.audio-bar__slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-bar__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
}
.audio-bar__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
}

/* Inline variant for in-game headers */
.audio-bar--inline {
  position: static;
  display: flex;
  align-items: center;
  gap: 6px;
}
.audio-bar--inline .audio-bar__music,
.audio-bar--inline .audio-bar__fx {
  width: 36px;
  height: 36px;
}
.audio-bar--inline .audio-bar__fx {
  font-size: 11px;
}
.audio-bar--inline .audio-bar__track {
  width: 80px;
  height: 30px;
  padding: 0 8px;
}

/* ============== HERO (Party Game Menu) ============== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 80px;
  text-align: center;
  gap: 20px;
}

/* --- Game Logo Title --- */
.hero__title--logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 0.88;
  animation: logoEntry .7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes logoEntry {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.hero__title-logo {
  height: clamp(28px, 5vw, 48px);
  width: auto;
  object-fit: contain;
  margin-bottom: 8px;
  opacity: 0.85;
  animation: fadeUp .5s .15s cubic-bezier(0.22, 1, 0.36, 1) both;
  user-select: none;
  -webkit-user-drag: none;
}
.hero__title-main {
  font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 140px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 2px 0 rgba(0,0,0,.3),
    0 4px 20px rgba(0,0,0,.25),
    0 0 60px rgba(255,255,255,.08);
}
.hero__title-accent {
  font-family: var(--font-display);
  font-size: clamp(52px, 12vw, 120px);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--accent) 0%, #ff5533 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)) drop-shadow(0 4px 20px var(--accent-glow));
}
.hero__sub {
  color: rgba(255,255,255,.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
  animation: fadeUp .5s .25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Big Juicy Play Button --- */
.play-btn {
  --btn-enter: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(380px, 85vw);
  padding: 22px 40px;
  margin-top: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.15);
  background: linear-gradient(180deg, var(--accent), #d65a08);
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 6px 30px -6px var(--accent-glow),
    0 2px 0 rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,.25);
  transition:
    transform 140ms var(--btn-enter),
    box-shadow 200ms ease;
  animation: fadeUp .5s .35s var(--btn-enter) both;
  text-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.play-btn__icon {
  display: flex;
  align-items: center;
}
.play-btn__icon svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.play-btn:hover {
  transform: scale(1.04);
  box-shadow:
    0 10px 40px -6px var(--accent-glow),
    0 2px 0 rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,.3);
}
.play-btn:active {
  transform: scale(0.96);
  box-shadow:
    0 3px 16px -4px var(--accent-glow),
    0 1px 0 rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,.15);
  transition-duration: 80ms;
}

/* ============== MODE PICKER ============== */
.mode-pick {
  display: flex;
  gap: 14px;
  width: min(420px, 90vw);
  animation: fadeUp .4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mode-pick[hidden] { display: none; }
.mode-pick__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(20,23,28,.6);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), border-color .2s, background .2s;
}
.mode-pick__btn:hover {
  transform: scale(1.04);
  border-color: var(--accent);
  background: rgba(30,34,42,.8);
}
.mode-pick__btn:active {
  transform: scale(0.96);
  transition-duration: 80ms;
}
.mode-pick__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mode-pick__btn:disabled:hover {
  transform: none;
  border-color: rgba(255,255,255,.1);
}
.mode-pick__icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}
.mode-pick__btn:disabled .mode-pick__icon {
  color: var(--text-mute);
}
.mode-pick__label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mode-pick__soon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: rgba(255,255,255,.06);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ============== ROUND SHELL ============== */
.round-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 50px;
  gap: 14px;
}

.round-top {
  width: min(560px, 96vw);
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-top__center {
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  color: var(--text-dim);
  font-size: 13px;
  text-transform: uppercase;
}
.round-top__num strong {
  color: var(--accent);
  font-weight: 800;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); background: var(--card); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* ============== CARD ============== */
.card {
  width: min(560px, 96vw);
  background: linear-gradient(180deg, var(--card), #15181d);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-soft);
  animation: cardIn .4s ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============== STUDY ============== */
.study-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.study-head__name {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.study-head__meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.skin-stage {
  width: 100%;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, rgba(255,122,31,.06), transparent 60%);
}
.skin-stage--result { height: 220px; }
.skin-stage__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  animation: skinIn .5s cubic-bezier(.2,.7,.3,1.2) both;
}
@keyframes skinIn {
  from { opacity: 0; transform: scale(.85) translateY(8px); filter: blur(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.skin-fade {
  position: absolute;
  inset: 0;
  background: var(--card);
  animation: skinOut .45s ease-in forwards;
}
@keyframes skinOut {
  from { opacity: 0; backdrop-filter: blur(0); }
  to   { opacity: 1; backdrop-filter: blur(12px); }
}

/* ============== TIMER BAR ============== */
.timer-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.timer-bar__track {
  width: 100%;
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.timer-bar__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transform-origin: left;
  transition: transform .1s linear, background .2s;
}
.timer-bar__fill.warn { background: linear-gradient(90deg, var(--red), #ff8a4a); }
.timer-bar__count {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.timer-bar__hint {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  text-transform: uppercase;
}

/* ============== COUNTDOWN ============== */
.screen--countdown {
  align-items: center;
  justify-content: center;
}
.countdown { text-align: center; }
.countdown__label {
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.countdown__num {
  font-family: var(--font-display);
  font-size: 220px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  margin-top: 6px;
  animation: countPulse .9s ease-out both;
}
.countdown__num.go { color: var(--accent); }
@keyframes countPulse {
  0%   { transform: scale(0.6); opacity: 0; filter: blur(8px); }
  40%  { transform: scale(1.1); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============== GUESS / WHEEL ============== */
.guess-head { text-align: center; }
.guess-head__title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  font-weight: 800;
  text-transform: uppercase;
}
.guess-head__name {
  margin-top: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.guess-head__meta {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.guess-head__sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-dim);
}
.guess-head__count {
  color: var(--accent);
  font-weight: 700;
}

.guess-preview {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, rgba(255,122,31,.05), transparent 65%),
    var(--bg-1);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.guess-preview__canvas {
  max-width: 100%;
  max-height: 100%;
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}
.guess-preview__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-mute);
  text-transform: uppercase;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}
.guess-preview__hint[hidden] { display: none; }

.wheel-area {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.wheel {
  position: relative;
  width: 280px;
  height: 280px;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.55));
  animation: wheelIn .55s cubic-bezier(.2,.7,.3,1.2) both;
  touch-action: none;
}
@keyframes wheelIn {
  from { opacity: 0; transform: scale(0.85) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
.wheel__ring {
  width: 100%;
  height: 100%;
  display: block;
}
.wheel__hue-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.55), 0 0 10px rgba(0,0,0,.5);
  top: 50%; left: 50%;
}
.wheel__grid {
  position: absolute;
  top: 50%; left: 50%;
  width: 138px;
  height: 138px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.25)),
    #1a1d23;
  cursor: crosshair;
  touch-action: none;
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
/* cross dividing the grid into 4 quadrants */
.wheel__grid::before,
.wheel__grid::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,.16);
  pointer-events: none;
  z-index: 1;
}
.wheel__grid::before { left: 0; right: 0; top: 50%; height: 1px; }
.wheel__grid::after  { top: 0; bottom: 0; left: 50%; width: 1px; }

.wheel__grid-icon {
  position: absolute;
  width: 16px;
  height: 16px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.wheel__grid-icon svg { width: 100%; height: 100%; }
.wheel__grid-icon--top    { top: 6px;    left: 50%; transform: translateX(-50%); }
.wheel__grid-icon--bottom { bottom: 6px; left: 50%; transform: translateX(-50%); }
.wheel__grid-icon--left   { left: 6px;   top: 50%; transform: translateY(-50%); }
.wheel__grid-icon--right  { right: 6px;  top: 50%; transform: translateY(-50%); }
.wheel__sl-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.6);
  top: 50%; left: 50%;
}

/* ============== RESULT SPLIT STAGE (before/after slider) ============== */
.result-stage {
  position: relative;
  width: 100%;
  height: 230px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, rgba(255,122,31,.05), transparent 65%),
    var(--bg-1);
  border: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.result-stage__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.result-stage__layer--guess {
  /* clipped on the right based on the slider position */
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
  -webkit-clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
}
.result-stage__divider {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: var(--split, 50%);
  width: 2px;
  margin-left: -1px;
  background: rgba(255,255,255,.6);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0,0,0,.5);
}
.result-stage__handle {
  position: absolute;
  top: 50%;
  left: var(--split, 50%);
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.95);
  background: rgba(20,23,28,.85);
  color: #fff;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  transition: transform .12s ease, background .12s ease;
}
.result-stage__handle:hover { background: rgba(20,23,28,.95); transform: scale(1.05) translate(0,0); }
.result-stage__handle:active { transform: scale(0.95); }
.result-stage__handle svg { width: 18px; height: 18px; }
.result-stage__labels {
  position: absolute;
  inset: auto 12px 10px 12px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  font-weight: 700;
  pointer-events: none;
}

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .2s, border-color .2s;
}
.btn--full { width: 100%; }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), #d65a08);
  color: #fff;
  box-shadow:
    0 12px 24px -10px var(--accent-glow),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--card-2); }
.btn--validate { padding: 16px 22px; font-size: 15px; }
.btn__icon { width: 18px; height: 18px; }
.btn__arrow { margin-left: 4px; font-size: 18px; }

/* ============== RESULT ============== */
.result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.result-head__pct {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
}
.result-head__msg {
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.result-head__msg.tier-great { color: var(--accent-2); }
.result-head__msg.tier-perfect { color: var(--green); }
.result-head__msg.tier-bad { color: var(--text-mute); }
.result-head__points {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.accuracy-bar__track {
  width: 100%;
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.accuracy-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 1s cubic-bezier(.3,.7,.3,1);
}

/* ============== FINAL ============== */
.card--final {
  align-items: center;
  text-align: center;
  padding: 36px 22px;
}
.final__eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.final__big {
  font-family: var(--font-display);
  font-size: 110px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 4px;
}
.final__total {
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
}
.final__msg {
  color: var(--text);
  margin: 18px 0 18px;
  font-size: 16px;
  font-weight: 600;
}
.final__rounds {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.final__round {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 108px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.final__round-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  font-weight: 700;
}
.final__round-name {
  width: 100%;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  color: var(--text);
  font-weight: 600;
  /* Wrap long skin names onto up to 2 lines so they stay readable */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-height: 24px; /* keeps cards aligned even when name is one line */
}
.final__round-stage {
  --split: 50%;
  position: relative;
  width: 80px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-1);
  user-select: none;
  cursor: ew-resize;
  touch-action: none;
}
.final__round-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
/* Left half = user's guess (recolored), right half = original */
.final__round-img--guess {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  -webkit-clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
.final__round-divider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: rgba(255,255,255,.7);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0,0,0,.6);
}
.final__round-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: 1.5px solid rgba(20,23,28,.85);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.final__round-pct {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.final__round-pct strong {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text);
  font-weight: 800;
}
.final__round-pct span {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-top: 2px;
}
.final__round-pct.is-perfect strong {
  color: var(--accent);
}
.final__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

/* ============== OVERLAY ============== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,6,8,.85);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.overlay[hidden] { display: none; }
.overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.overlay__spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255,122,31,.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay__label {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ============== RESPONSIVE ============== */

/* Tablet portrait (768–1024): roomier wheel and stages */
@media (min-width: 700px) and (max-width: 1024px) {
  .card { width: min(620px, 92vw); padding: 26px; }
  .wheel { width: 320px; height: 320px; }
  .wheel__grid { width: 158px; height: 158px; }
  .skin-stage,
  .guess-preview { height: 260px; }
  .result-stage { height: 280px; }
  .hero__title-main { font-size: 100px; }
  .meta-pill { min-width: 110px; padding: 12px 22px; }
}

/* Mobile (≤520px): tighter spacing, smaller wheel, larger touch handles */
@media (max-width: 520px) {
  .hero { padding: 36px 16px 48px; gap: 18px; }
  .hero__sub { font-size: 14px; }
  .mode-stack { width: min(360px, 94vw); }
  .mode { padding: 16px 20px; font-size: 15px; }
  .mode-pick { width: min(380px, 94vw); gap: 10px; }
  .mode-pick__btn { padding: 18px 12px; gap: 8px; }
  .mode-pick__icon { width: 28px; height: 28px; }
  .mode-pick__label { font-size: 14px; }
  .meta-pill { min-width: 80px; padding: 8px 14px; }
  .meta-pill strong { font-size: 20px; }

  .card { width: min(440px, 96vw); padding: 18px; gap: 16px; }
  .round-shell { padding: 18px 14px 50px; gap: 12px; }

  .wheel { width: 240px; height: 240px; }
  .wheel__grid { width: 120px; height: 120px; }
  .wheel__grid-icon { width: 14px; height: 14px; }
  .wheel__hue-handle { width: 26px; height: 26px; }
  .wheel__sl-handle { width: 20px; height: 20px; }

  .skin-stage,
  .guess-preview { height: clamp(160px, 35vw, 200px); }
  .result-stage { height: clamp(160px, 35vw, 200px); }

  .timer-bar__count { font-size: clamp(20px, 5vw, 26px); }
  .countdown__num { font-size: clamp(120px, 35vw, 150px); }
  .final__big { font-size: clamp(64px, 20vw, 84px); }

  .study-head__name { font-size: 15px; }
  .guess-head__title { font-size: 18px; }
  .result-head__pct { font-size: clamp(36px, 10vw, 46px); }

  .btn { padding: 14px 18px; font-size: 15px; }
  .btn--validate { padding: 16px 18px; font-size: 16px; }

  .picker-bar { padding: 8px 10px; gap: 10px; }
  .palette-strip { min-height: 50px; padding: 8px; }

  .result-stage__handle { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .result-stage__labels { font-size: 9px; letter-spacing: 0.16em; }

  /* Final-screen round cards: shrink so 3 fit per row on narrow phones */
  .final__round { width: 96px; padding: 6px; }
  .final__round-stage { width: 80px; height: 48px; }
  .final__round-name { font-size: 9.5px; min-height: 22px; }
  .final__round-pct strong { font-size: 14px; }
  .final__round-pct span { font-size: 8px; }
}

/* Very small phones (≤360px) */
@media (max-width: 360px) {
  .hero { padding: 28px 12px 40px; gap: 16px; }
  .hero__title-main { font-size: 56px; }
  .hero__title-accent { font-size: 46px; }
  .hero__title-pre { font-size: 14px; letter-spacing: 0.3em; }
  .wheel { width: 220px; height: 220px; }
  .wheel__grid { width: 108px; height: 108px; }
  .countdown__num { font-size: 100px; }
  .final__big { font-size: 60px; }
  .card { padding: 14px; gap: 14px; }
  .round-shell { padding: 14px 10px 40px; }
  .meta-pill { min-width: 70px; padding: 7px 10px; }
  .study-head__name { font-size: 14px; }
  .guess-head__title { font-size: 16px; }
}

/* Short landscape phones — keep guess card scrollable, shrink hero */
@media (max-height: 600px) and (orientation: landscape) {
  .hero { padding: 24px 18px; gap: 14px; }
  .hero__title-main { font-size: 56px; }
  .hero__sub { font-size: 13px; }
  .countdown__num { font-size: 120px; }
  .wheel { width: 200px; height: 200px; }
  .wheel__grid { width: 100px; height: 100px; }
  .skin-stage,
  .guess-preview { height: 160px; }
  .timer-bar__count { font-size: 22px; }
  .round-shell { padding: 14px 14px 30px; }
  .card { padding: 16px; gap: 12px; }
}

/* Touch devices: bigger handles + chunkier validate button for finger taps */
@media (pointer: coarse) {
  .wheel__hue-handle { width: 28px; height: 28px; border-width: 3px; }
  .wheel__sl-handle  { width: 22px; height: 22px; border-width: 3px; }
  .result-stage__handle { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .result-stage__divider { width: 3px; margin-left: -1.5px; }
  .final__round-divider { width: 3px; margin-left: -1.5px; }
  .final__round-divider::after { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
  .btn { min-height: 48px; font-size: 15px; }
  .btn--validate { min-height: 52px; font-size: 16px; }
  .icon-btn { width: 48px; height: 48px; }
  .icon-btn svg { width: 22px; height: 22px; }
  .audio-bar__music,
  .audio-bar__fx { width: 46px; height: 46px; }
  /* Suppress sticky-hover artifacts after a tap */
  .mode:not(:disabled):hover { transform: none; }
  .btn--primary:hover { transform: none; }
  .play-btn:hover { transform: none; }
  .mode-pick__btn:hover { transform: none; }
}

/* ============== REWARD OVERLAYS ============== */
.reward-confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 60;
}

.reward-stamp {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4) rotate(-12deg);
  z-index: 61;
  pointer-events: none;
  text-align: center;
  opacity: 0;
}
.reward-stamp.is-in {
  animation: stampIn .5s cubic-bezier(.2,.8,.3,1.3) forwards;
}
@keyframes stampIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-12deg); }
  50%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(-6deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
}
.reward-stamp__top,
.reward-stamp__bottom {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  color: var(--green);
  text-shadow: 0 4px 20px rgba(74,222,128,.4), 0 0 40px rgba(74,222,128,.2);
}
.reward-stamp__top { font-size: 52px; letter-spacing: 0.08em; }
.reward-stamp__bottom { font-size: 36px; letter-spacing: 0.22em; }

.reward-streak {
  position: fixed;
  top: 16%;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
  z-index: 61;
  pointer-events: none;
  opacity: 0;
}
.reward-streak.is-in {
  animation: streakIn .45s cubic-bezier(.2,.8,.3,1.2) forwards;
}
@keyframes streakIn {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.5); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
.reward-streak__num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  background: var(--bg-2);
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 6px 18px;
  text-shadow: 0 2px 12px var(--accent-glow);
}

.reward-best {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
  z-index: 61;
  pointer-events: none;
  opacity: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 2px 16px var(--accent-glow);
}
.reward-best.is-in {
  animation: streakIn .45s cubic-bezier(.2,.8,.3,1.2) forwards;
}

.reward-float {
  position: fixed;
  pointer-events: none;
  z-index: 62;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  transform: translateX(-50%);
  animation: floatUp 1.4s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

.is-perfect-glow {
  text-shadow: 0 0 20px rgba(74,222,128,.5), 0 0 40px rgba(74,222,128,.25);
  color: var(--green) !important;
}
.is-great-glow {
  text-shadow: 0 0 16px var(--accent-glow);
  color: var(--accent) !important;
}
