:root {
  color-scheme: dark;
  --ink: #08030f;
  --glass: rgba(13, 7, 28, .82);
  --muted: #b9aec6;
  --pink: #ff4ba8;
  --violet: #9b5cff;
  --cyan: #31e9df;
  --line: rgba(208, 118, 255, .38);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--ink); }
body { color: #fffaff; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { border: 0; font: inherit; font-weight: 900; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.96); }

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 0, #361142 0, #10051e 42%, #06020b 100%);
}

.game-screen {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: #09050e;
}

.video-stage { position: absolute; inset: 0; display: grid; overflow: hidden; place-items: center; background: radial-gradient(ellipse at 50% 24%, #42205d 0, #160a29 42%, #06020b 100%); }
.video-stage::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(rgba(48, 235, 222, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 75, 168, .10) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 92%, rgba(253, 70, 171, .34), transparent 43%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  content: "";
}
.video-stage::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 3, 16, .56), transparent 32%, rgba(8, 3, 16, .88)), linear-gradient(118deg, rgba(255, 67, 164, .1), transparent 42%, rgba(45, 239, 223, .08));
  pointer-events: none;
  content: "";
}
.video-stage video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; filter: contrast(1.04) saturate(1.05); }
.camera-offline {
  position: absolute;
  z-index: 3;
  top: 42%;
  right: 28px;
  left: 28px;
  display: grid;
  gap: 7px;
  place-items: center;
  color: #e4d9ee;
  text-align: center;
}
.camera-offline[hidden] { display: none; }
.camera-offline span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--cyan); background: #110f1eaa; box-shadow: 0 0 20px #26dcd066; }
.camera-offline strong { font-size: 15px; }
.camera-offline small { max-width: 250px; color: #b8adbf; font-size: 11px; line-height: 1.42; }

.top-bar {
  position: absolute;
  z-index: 3;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-badge, .metric {
  min-height: 31px;
  padding: 0 9px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: .02em;
}
.live-badge { color: #fff; background: linear-gradient(135deg, #fd498c, #cc296c); box-shadow: 0 5px 18px #f12e8a77; }
.metric { color: #ede5f0; background: rgba(12, 7, 24, .67); backdrop-filter: blur(8px); }
.queue-metric { margin-left: auto; }
.connection-state {
  position: absolute;
  z-index: 3;
  top: max(85px, calc(env(safe-area-inset-top) + 71px));
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 99px;
  color: #d7cbe0;
  background: rgba(12, 7, 24, .67);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 800;
}
.connection-state i { width: 8px; height: 8px; border-radius: 50%; background: #eabe48; box-shadow: 0 0 9px currentColor; }
.connection-state.online i { color: var(--cyan); background: var(--cyan); }.connection-state.offline i { color: #fa6384; background: #fa6384; }
.connection-state { display: none; }
.turn-hud { position: absolute; z-index: 4; top: max(119px, calc(env(safe-area-inset-top) + 105px)); right: 14px; left: 14px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; text-shadow: 0 2px 8px rgba(0, 0, 0, .82); }.turn-hud[hidden] { display: none; }.turn-hud span { padding: 6px 8px; border: 1px solid rgba(131, 255, 247, .42); border-radius: 7px; color: #65fff4; background: rgba(8, 35, 38, .25); font-size: 10px; font-weight: 900; letter-spacing: .06em; }.turn-hud b { color: var(--cyan); font-size: 22px; text-shadow: 0 0 12px #2deee4; }
.winner-ticker { position: absolute; z-index: 3; top: max(53px, calc(env(safe-area-inset-top) + 39px)); right: 14px; left: 14px; display: flex; align-items: center; min-height: 24px; overflow: hidden; border: 1px solid rgba(223, 169, 64, .32); border-radius: 8px; color: #eed8a0; background: rgba(10, 6, 22, .48); box-shadow: 0 5px 18px rgba(0, 0, 0, .2); backdrop-filter: blur(7px); font-size: 8px; pointer-events: none; }.winner-ticker[hidden] { display: none; }.winner-ticker-label { position: relative; z-index: 1; flex: 0 0 auto; align-self: stretch; display: inline-flex; align-items: center; padding: 0 8px; color: #1e1000; background: linear-gradient(135deg, #ffd76c, #d99526); font-size: 7px; font-weight: 950; letter-spacing: .06em; }.winner-ticker-window { min-width: 0; flex: 1; overflow: hidden; }.winner-ticker-track { display: flex; width: max-content; align-items: center; gap: 27px; padding: 0 14px; white-space: nowrap; }.winner-ticker-track.is-scrolling { animation: winner-scroll 32s linear infinite; }.winner-ticker-track span { display: inline-flex; gap: 3px; align-items: baseline; }.winner-ticker-track b { color: #fbf5ff; }.winner-ticker-track strong { color: var(--cyan); }.winner-flash { position: absolute; z-index: 9; top: 31%; right: 22px; left: 22px; display: grid; justify-items: center; padding: 22px 18px 20px; border: 1px solid rgba(255, 208, 91, .76); border-radius: 20px; color: #fff9e9; background: radial-gradient(circle at 50% 0, rgba(255, 205, 70, .33), transparent 48%), linear-gradient(145deg, rgba(47, 22, 70, .9), rgba(10, 5, 22, .82)); box-shadow: 0 0 0 1px rgba(255, 229, 150, .18), 0 20px 55px rgba(0, 0, 0, .55), 0 0 44px rgba(255, 184, 44, .34); backdrop-filter: blur(10px); opacity: 0; transform: scale(.86) translateY(12px); transition: opacity .24s ease, transform .24s ease; pointer-events: none; }.winner-flash[hidden] { display: none; }.winner-flash.visible { opacity: 1; transform: scale(1) translateY(0); }.winner-flash-trophy { margin-bottom: 4px; font-size: 47px; filter: drop-shadow(0 0 13px rgba(255, 199, 58, .8)); }.winner-flash p { margin: 0; color: #ffde7a; font-size: 9px; font-weight: 950; letter-spacing: .16em; }.winner-flash h2 { margin: 6px 0 3px; font-size: 27px; letter-spacing: -.7px; text-align: center; }.winner-flash strong { color: #6ef7ed; font-size: 14px; text-align: center; }
.brand-stamp {
  position: absolute;
  z-index: 3;
  top: max(85px, calc(env(safe-area-inset-top) + 71px));
  left: 19px;
  display: grid;
  transform: skew(-7deg);
  color: white;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -.09em;
  line-height: .85;
  text-shadow: 2px 2px 0 #501788, 0 0 12px #ea52c9;
  pointer-events: none;
}
.brand-stamp span { color: #72f0ed; font-size: 10px; letter-spacing: .14em; }.brand-stamp b { font-size: 22px; }

.overlay { position: absolute; z-index: 4; right: 14px; bottom: 73px; left: 14px; }
.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(26, 10, 43, .89), rgba(9, 5, 19, .91));
  box-shadow: 0 15px 35px rgba(0, 0, 0, .35), inset 0 1px rgba(255, 255, 255, .12);
  backdrop-filter: blur(9px);
}
.panel h1 { margin: 5px 0 7px; font-size: 25px; line-height: 1.04; letter-spacing: -.8px; text-align: center; }
#spectator-panel { padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
#spectator-panel h1, #spectator-panel .description, #spectator-panel .fair-note { text-shadow: 0 2px 8px rgba(0, 0, 0, .82); }
#spectator-panel .queue-summary { justify-content: center; gap: 14px; padding: 0; background: transparent; text-shadow: 0 2px 7px rgba(0, 0, 0, .82); }
#spectator-panel .primary { display: block; width: min(100%, 286px); margin: 0 auto; }
.eyebrow { margin: 0; color: #e692ff; font-size: 10px; font-weight: 900; letter-spacing: .1em; text-align: center; }.eyebrow.cyan { color: var(--cyan); }
.description { max-width: 285px; margin: 0 auto 15px; color: var(--muted); font-size: 12px; line-height: 1.44; text-align: center; }
.queue-summary { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 11px; padding: 10px 11px; border-radius: 10px; color: #cdbed8; background: rgba(0, 0, 0, .23); font-size: 11px; }.queue-summary b { color: #fff; }
.primary, .secondary { width: 100%; min-height: 45px; border-radius: 9px; font-size: 11px; }.primary { color: white; background: linear-gradient(135deg, #f246a7, #7e37dc); box-shadow: 0 8px 19px #6b219c8a; }.secondary { color: #f8a4d1; border: 1px solid #e75eab9a; background: rgba(31, 7, 36, .37); }.fair-note { margin: 10px 0 0; color: #b9a5c1; font-size: 9px; text-align: center; }

/* The turn controls intentionally float over the camera; there is no enclosing card or border. */
.playing-panel { padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.controls { display: flex; align-items: center; justify-content: center; gap: 43px; }
.direction-pad { position: relative; width: 130px; height: 130px; border: 1px solid rgba(147, 104, 222, .14); border-radius: 50%; background: radial-gradient(circle, rgba(49, 233, 223, .055) 0 24%, rgba(32, 14, 51, .10) 25% 58%, rgba(8, 3, 17, .045) 59%); box-shadow: 0 6px 17px rgba(0, 0, 0, .18), inset 0 0 20px rgba(88, 43, 210, .08); backdrop-filter: blur(2px); }
.direction-pad button { position: absolute; z-index: 1; width: 36px; height: 36px; min-height: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; color: #fff; background: rgba(11, 6, 23, .14); box-shadow: 0 2px 7px rgba(0, 0, 0, .20); font-size: 16px; touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }.direction-pad button.is-pressed, .direction-pad button:active { color: #071b20; background: var(--cyan); box-shadow: 0 0 0 3px rgba(49, 233, 223, .25), 0 0 23px rgba(49, 233, 223, .88), inset 0 2px 7px rgba(0, 0, 0, .32); transform: scale(.82); }.direction-pad button:nth-child(1) { top: 4px; left: 47px; }.direction-pad button:nth-child(2) { top: 47px; left: 4px; }.direction-pad button:nth-child(4) { top: 47px; right: 4px; }.direction-pad button:nth-child(5) { bottom: 4px; left: 47px; }.direction-pad i { position: absolute; top: 47px; left: 47px; width: 36px; height: 36px; border-radius: 50%; background: rgba(49, 233, 223, .45); box-shadow: 0 0 22px rgba(47, 249, 226, .35); }
.drop { width: 98px; height: 98px; min-height: 0; padding: 0; border: 1px solid rgba(225, 253, 255, .42); border-radius: 50%; color: #fff; background: linear-gradient(145deg, rgba(48, 217, 210, .20), rgba(82, 100, 215, .16) 68%, rgba(169, 78, 234, .14)); box-shadow: 0 5px 15px rgba(20, 43, 119, .14), inset 0 1px rgba(255, 255, 255, .36), inset 0 -10px 20px rgba(37, 21, 94, .06); backdrop-filter: blur(4px) saturate(1.18); font-size: 11px; line-height: 1.03; text-shadow: 0 1px 4px rgba(0, 0, 0, .72); touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }.drop.is-pressed, .drop:active { box-shadow: 0 0 0 3px rgba(49, 233, 223, .26), 0 0 29px rgba(145, 102, 255, .8), inset 0 3px 11px rgba(0, 0, 0, .33); transform: scale(.91); filter: brightness(.9) saturate(1.2); }.drop span { display: block; margin-bottom: 3px; font-size: 25px; line-height: .85; }
.playing-panel #control-feedback { display: none; }
.starting-panel { border-color: rgba(49, 233, 223, .45); }.result-panel { border-color: rgba(255, 192, 78, .55); text-align: center; }.result-panel.no-win { border-color: rgba(255, 88, 161, .56); }.result-panel .eyebrow { color: #ffd260; }.result-panel.no-win .eyebrow { color: #ff87bd; }.result-prize-image { width: 86px; height: 86px; margin: 4px auto 11px; overflow: hidden; border-radius: 12px; background: #1a1024; }.result-prize-image img { width: 100%; height: 100%; object-fit: cover; }.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.result-actions .primary { grid-column: span 2; }.result-actions .secondary:not([hidden]) + .primary { grid-column: auto; }.result-actions [hidden] { display: none; }
.claim-form { display: grid; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid rgba(205, 122, 255, .28); text-align: left; }.claim-form[hidden] { display: none; }.claim-copy { margin: -1px 0 3px; color: #cbb9d7; font-size: 10px; line-height: 1.35; text-align: center; }.claim-form label { display: grid; gap: 4px; color: #e9dff0; font-size: 9px; font-weight: 850; }.claim-form label small { color: #9f8cac; font-weight: 600; }.claim-form input,.claim-form select { width: 100%; height: 34px; padding: 0 9px; border: 1px solid rgba(206, 128, 255, .38); border-radius: 7px; outline-color: var(--cyan); color: #fff; background: rgba(3, 2, 9, .65); font: inherit; font-size: 11px; }.claim-city-row { display:grid; grid-template-columns: 1.1fr .65fr .65fr; gap: 7px; }.claim-form button { margin-top: 3px; }.claim-message { min-height: 13px; margin: 0; color: #ffe079; font-size: 10px; line-height: 1.35; text-align: center; }

.bottom-bar { position: absolute; z-index: 4; right: 14px; bottom: max(13px, env(safe-area-inset-bottom)); left: 14px; display: flex; align-items: center; gap: 8px; color: #c8bbcf; font-size: 9px; }.camera-switcher { display: flex; gap: 5px; padding: 4px; border: 1px solid rgba(154, 109, 227, .43); border-radius: 12px; background: rgba(11, 6, 21, .72); box-shadow: 0 6px 19px rgba(0, 0, 0, .28); backdrop-filter: blur(8px); }.camera-switcher button { min-width: 84px; min-height: 39px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 8px; color: #e2d8e8; background: rgba(53, 24, 78, .38); font-size: 10px; letter-spacing: .04em; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }.camera-switcher button.active { color: #061e22; border-color: rgba(156, 255, 248, .82); background: linear-gradient(135deg, rgba(49, 233, 223, .92), rgba(105, 205, 242, .78)); box-shadow: 0 0 16px rgba(49, 233, 223, .38), inset 0 1px rgba(255, 255, 255, .48); text-shadow: none; }.camera-switcher button:active { transform: scale(.94); }.music-toggle { min-height: 30px; padding: 0 9px; border-radius: 7px; color: #efb6ff; background: rgba(62, 20, 81, .5); font-size: 9px; }.music-toggle[aria-pressed="true"] { color: var(--cyan); background: rgba(19, 102, 98, .46); }.music-toggle:disabled { color: #837587; background: rgba(22, 16, 27, .5); }.bottom-bar > span { margin-left: auto; white-space: nowrap; }

.welcome-overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 15%, rgba(166, 67, 235, .25), transparent 38%), rgba(5, 2, 13, .76); backdrop-filter: blur(7px); }
.welcome-overlay[hidden] { display: none; }
.welcome-card { width: min(100%, 382px); padding: 25px 21px 21px; border: 1px solid rgba(202, 117, 255, .7); border-radius: 20px; background: linear-gradient(150deg, rgba(37, 14, 64, .96), rgba(9, 5, 23, .98)); box-shadow: 0 26px 65px #000c, 0 0 32px rgba(189, 73, 231, .28), inset 0 1px rgba(255, 255, 255, .14); }
.welcome-kicker { margin: 0 0 8px; color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-align: center; }
.welcome-card h1 { max-width: 310px; margin: 0 auto 11px; color: #fff; font-size: 27px; line-height: 1.02; letter-spacing: -1px; text-align: center; }
.welcome-lede { max-width: 285px; margin: 0 auto 18px; color: #cdbdd8; font-size: 13px; line-height: 1.45; text-align: center; }
.welcome-steps { display: grid; gap: 9px; margin: 0 0 17px; padding: 0; list-style: none; counter-reset: intro; }
.welcome-steps li { position: relative; min-height: 44px; padding: 7px 8px 7px 43px; border-radius: 10px; background: rgba(255, 255, 255, .055); color: #afa1b9; font-size: 10px; line-height: 1.3; }
.welcome-steps li::before { position: absolute; top: 9px; left: 10px; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; counter-increment: intro; content: counter(intro); color: #151025; background: linear-gradient(135deg, var(--cyan), #99e9ff); font-size: 11px; font-weight: 950; }
.welcome-steps b, .welcome-steps span { display: block; }.welcome-steps b { color: #fbf7ff; font-size: 11px; }.welcome-audio { margin: 0 0 13px; color: #e7a9ff; font-size: 10px; line-height: 1.4; text-align: center; }.welcome-accept { min-height: 48px; }
.welcome-accept:disabled { cursor: wait; opacity: .64; }

@media (min-width: 650px) { .app-shell { padding: 20px; }.game-screen { width: min(100%, 430px); height: min(900px, calc(100svh - 40px)); border-radius: 28px; box-shadow: 0 24px 70px #000a, 0 0 0 1px #be65eeaa; } }
@media (orientation: landscape) and (max-height: 600px) { .app-shell { padding: 8px; }.game-screen { width: min(100%, 820px); height: calc(100svh - 16px); min-height: 0; border-radius: 18px; }.video-stage { right: 42%; }.top-bar { right: calc(42% + 12px); top: 11px; left: 11px; }.connection-state { right: calc(42% + 12px); top: 11px; }.brand-stamp { display: none; }.overlay { top: 50px; right: 12px; bottom: 52px; left: 62%; display: flex; align-items: center; }.panel { width: 100%; max-height: calc(100svh - 102px); overflow: auto; }.bottom-bar { right: calc(42% + 12px); bottom: 9px; left: 11px; }.bottom-bar > span { display: none; } }
@keyframes winner-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Winner UI is deliberately independent of the queue and welcome cards. */
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
