/* ==========================================================================
   Flying Home for Christmas — studio stage styles
   ========================================================================== */
:root {
  --purple-900: #0d0218;
  --purple-800: #1a0530;
  --purple-700: #2e0c55;
  --purple-600: #4a1480;
  --purple-500: #5a1a9a;
  --purple-300: #b36bff;
  --gold-100: #fff4c4;
  --gold-300: #f7d36b;
  --gold-500: #e2a92f;
  --gold-700: #8a5506;
  --silver: #d8dbe6;
  --ink: #fff7e0;
  --floor-y: 79vh;
  --cx: 50vw;
  --cy: 45vh;
  --wheel-d: 70vh;
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --font-show: "Lilita One", "Arial Black", "Segoe UI Black", Impact, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--purple-900);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; }

.stage {
  position: fixed; inset: 0;
  overflow: hidden;
}

/* ---------- the set ---------- */
.set, .set > * { position: absolute; pointer-events: none; }
.set { inset: 0; z-index: 0; }

.backdrop {
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at var(--cx) var(--cy), rgba(140, 60, 220, .55) 0%, rgba(90, 26, 154, .25) 45%, rgba(0, 0, 0, 0) 75%),
    radial-gradient(ellipse 120% 90% at 50% 0%, #2a0a4f 0%, #170430 50%, #0b0115 100%);
}
/* faint vertical studio panels */
.backdrop::after {
  content: ""; position: absolute; inset: 0 0 calc(100% - var(--floor-y)) 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 9vw);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 35%, #000 85%, transparent 100%);
}

.rays {
  width: 190vmax; height: 190vmax;
  left: calc(var(--cx) - 95vmax); top: calc(var(--cy) - 95vmax);
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, .075) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .6) 22%, transparent 48%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .6) 22%, transparent 48%);
  animation: spinSlow 160s linear infinite;
  will-change: transform;
  opacity: .9;
  transition: opacity .8s;
}
body.is-spinning .rays { animation-duration: 24s; opacity: 1; }

.halo span {
  position: absolute; border-radius: 50%;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.halo { left: var(--cx); top: var(--cy); width: 0; height: 0; transition: opacity .8s; opacity: 0; }
.halo span:nth-child(1) {
  width: calc(var(--wheel-d) * 1.18); height: calc(var(--wheel-d) * 1.18);
  border: 2px solid rgba(247, 211, 107, .28);
  box-shadow: 0 0 40px rgba(179, 107, 255, .25), inset 0 0 40px rgba(179, 107, 255, .18);
}
.halo span:nth-child(2) {
  width: calc(var(--wheel-d) * 1.36); height: calc(var(--wheel-d) * 1.36);
  border: 1px solid rgba(247, 211, 107, .14);
}
body.layout-wheel .halo { opacity: 1; }

/* light towers either side of the stage */
.tower {
  top: 12vh; bottom: calc(100% - var(--floor-y));
  width: clamp(18px, 2.6vw, 46px);
  border-radius: 999px;
  background: linear-gradient(90deg, #170430, #3b1068 45%, #1a0533);
  box-shadow: inset 0 0 0 2px rgba(226, 169, 47, .55), 0 0 30px rgba(120, 40, 200, .35);
}
.tower-left { left: clamp(8px, 1.6vw, 34px); }
.tower-right { right: clamp(8px, 1.6vw, 34px); }
.tower-bulbs { position: absolute; inset: 0; }
body.is-portrait .tower { top: auto; height: 34vh; width: 14px; }

/* moving spotlights */
.beam {
  top: -10vh; width: 34vw; height: 120vh;
  background: linear-gradient(to bottom, rgba(255, 236, 190, .26), rgba(255, 220, 150, .08) 60%, transparent 85%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  mix-blend-mode: screen;
  opacity: .55;
  will-change: transform;
}
.beam-left { left: -6vw; animation: beamSwayL 11s ease-in-out infinite; }
.beam-right { right: -6vw; animation: beamSwayR 13s ease-in-out infinite; }
body.is-spinning .beam-left { animation-duration: 2.2s; opacity: .8; }
body.is-spinning .beam-right { animation-duration: 2.6s; opacity: .8; }
@keyframes beamSwayL { 0%, 100% { transform: rotate(-26deg); } 50% { transform: rotate(-12deg); } }
@keyframes beamSwayR { 0%, 100% { transform: rotate(26deg); } 50% { transform: rotate(12deg); } }

/* polished stage floor */
.floor {
  left: 0; right: 0; top: var(--floor-y); bottom: 0;
  background:
    linear-gradient(to bottom, rgba(179, 107, 255, .16), transparent 30%),
    linear-gradient(to bottom, #22073d 0%, #12031f 55%, #07010d 100%);
}
.floor::before { /* glossy reflection streaks */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 7vw, rgba(255, 255, 255, .025) 7vw 7.2vw);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.floor-pool {
  position: absolute; left: 50%; top: 0;
  width: 80vw; height: 36vh; transform: translate(-50%, -30%);
  background: radial-gradient(ellipse at center, rgba(255, 205, 120, .2), rgba(179, 107, 255, .08) 45%, transparent 70%);
}
.stage-lip {
  position: absolute; left: 0; right: 0; top: -3px; height: 6px;
  background: linear-gradient(to bottom, #fff2b6, #d9a12a 50%, #6b4100);
  box-shadow: 0 0 18px rgba(247, 211, 107, .45);
}
.lip-bulbs { position: absolute; left: 0; right: 0; top: 50%; height: 0; }

/* ---------- bulbs (shared) ---------- */
.bulb {
  position: absolute;
  width: var(--bs, 12px); height: var(--bs, 12px);
  margin: calc(var(--bs, 12px) / -2) 0 0 calc(var(--bs, 12px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fffef2 0 16%, #ffe596 38%, #eaa625 70%, #8a5300 100%);
  box-shadow: 0 0 calc(var(--bs, 12px) * .7) rgba(255, 205, 90, .75);
  animation: bulbAlt 1.6s steps(1, end) infinite;
  animation-delay: calc(var(--odd) * -0.8s);
}
.tower-bulbs .bulb { --bs: clamp(7px, 1.1vw, 16px); }
.lip-bulbs .bulb { --bs: clamp(5px, .7vw, 10px); }
.wheel-bulbs .bulb { --bs: calc(var(--wheel-px, 600px) * .036); }
.panel-bulbs .bulb { --bs: clamp(9px, 1.3vmin, 16px); animation: bulbAlt .5s steps(1, end) infinite; animation-delay: calc(var(--odd) * -0.25s); }

@keyframes bulbAlt { 0% { opacity: 1; } 50% { opacity: .3; } }
@keyframes bulbChase { 0% { opacity: 1; } 22% { opacity: .28; } 100% { opacity: .28; } }

body.is-spinning .bulb { animation: bulbChase .55s linear infinite; animation-delay: calc(var(--i) / var(--n) * -0.55s); }
body.is-spinning.is-slowing .bulb { animation-duration: 1.3s; animation-delay: calc(var(--i) / var(--n) * -1.3s); }
.wheel.is-winning .bulb { animation: bulbAlt .3s steps(1, end) infinite; animation-delay: calc(var(--odd) * -0.15s); }
body.lights-up .set .bulb { animation: none; opacity: 1; }

/* ---------- logo & host ---------- */
.logo {
  position: absolute; z-index: 3;
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .5));
  transition: left .9s cubic-bezier(.6, 0, .25, 1), top .9s cubic-bezier(.6, 0, .25, 1), width .9s cubic-bezier(.6, 0, .25, 1);
  user-select: none; -webkit-user-drag: none;
}
body:not(.is-ready) .logo, body:not(.is-ready) .host { transition: none; }

.host {
  position: absolute; z-index: 7;
  pointer-events: none;
}
.host.is-hidden { visibility: hidden; }
.host-img {
  position: relative; display: block; width: 100%; height: 100%;
  transform-origin: 48% 94%;
  animation: hostIdle 5.5s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(179, 107, 255, .35)) drop-shadow(0 12px 18px rgba(0, 0, 0, .45));
  will-change: transform;
  user-select: none; -webkit-user-drag: none;
}
@keyframes hostIdle {
  0%, 100% { transform: rotate(0deg) scale(1, 1); }
  30% { transform: rotate(.35deg) scale(1.004, 1.008); }
  60% { transform: rotate(-.25deg) scale(1, 1.003); }
}
.host-shadow {
  position: absolute; left: 18%; width: 62%; top: 91.5%; height: 7%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .65), transparent 70%);
}
.host-spot {
  position: absolute; left: -25%; width: 150%; top: -40%; height: 140%;
  background: linear-gradient(to bottom, rgba(255, 238, 190, 0), rgba(255, 238, 190, .22) 60%, rgba(255, 220, 150, .05));
  clip-path: polygon(42% 0, 58% 0, 92% 100%, 8% 100%);
  opacity: 0; transition: opacity .6s;
  mix-blend-mode: screen;
}
.host.is-highlight .host-spot { opacity: 1; }
.host.is-highlight .host-img { filter: drop-shadow(0 0 22px rgba(247, 211, 107, .55)) drop-shadow(0 12px 18px rgba(0, 0, 0, .45)) brightness(1.08); }
body:not(.is-portrait) .host.is-front { z-index: 16; }

/* ---------- present ---------- */
.present-layer { position: absolute; transform-origin: 52% 92.5%; }
.present-layer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.present-back { z-index: 4; }
.present-front { z-index: 8; }
.present-layer.is-gone { visibility: hidden; }

/* ---------- wheel ---------- */
.wheel {
  position: absolute; z-index: 6;
  visibility: hidden;
  will-change: transform;
}
.wheel.is-visible { visibility: visible; }
.wheel > * { position: absolute; }
.wheel-shadow {
  left: 8%; right: 8%; top: 92%; height: 12%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 70%);
}
.wheel-frame { inset: 0; width: 100%; height: 100%; }
.wheel-disc-wrap { left: 5.75%; top: 5.75%; width: 88.5%; height: 88.5%; }
.wheel-disc { width: 100%; height: 100%; display: block; will-change: transform; }
.wheel-highlight { left: 5.75%; top: 5.75%; width: 88.5%; height: 88.5%; opacity: 0; transition: opacity .5s; pointer-events: none; }
.wheel-highlight .hl-dim { fill: rgba(10, 0, 22, .55); }
.wheel-highlight .hl-wedge { fill: rgba(255, 236, 170, .2); stroke: #ffe28a; stroke-width: 2.2; stroke-linejoin: round; animation: wedgePulse .8s ease-in-out infinite alternate; }
.wheel.has-winner .wheel-highlight { opacity: 1; }
@keyframes wedgePulse { from { fill: rgba(255, 236, 170, .08); stroke-width: 1.4; } to { fill: rgba(255, 236, 170, .32); stroke-width: 3; } }
.wheel-gloss {
  left: 5.75%; top: 5.75%; width: 88.5%; height: 88.5%; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 34% 22%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, .25) 100%);
}
.wheel-bulbs { inset: 0; }
.wheel-hub { left: 41%; top: 41%; width: 18%; height: 18%; }
.wheel-hub svg, .wheel-pointer svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wheel-pointer {
  left: 44.5%; width: 11%; height: 16.5%; top: -5.2%;
  transform-origin: 50% 26.7%;
  will-change: transform;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4));
}

/* ---------- lighting overlays ---------- */
.dimmer {
  position: absolute; inset: 0; z-index: 9; pointer-events: none;
  --spot-x: 50%; --spot-y: 55%; --spot-r: 30vh;
  background: radial-gradient(circle var(--spot-r) at var(--spot-x) var(--spot-y), rgba(8, 0, 18, 0) 0%, rgba(8, 0, 18, 0) 62%, rgba(8, 0, 18, .78) 100%);
  opacity: 0; transition: opacity .7s ease;
}
.dimmer.on { opacity: 1; }
.flash {
  position: absolute; inset: 0; z-index: 10; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at var(--cx) var(--cy), rgba(255, 244, 210, .9), rgba(255, 214, 120, .35) 40%, rgba(255, 214, 120, 0) 75%);
  mix-blend-mode: screen;
}

/* ---------- show buttons ---------- */
.cta-wrap { position: absolute; z-index: 11; transform: translateX(-50%); }
.btn-show {
  position: relative;
  font-family: var(--font-show);
  font-size: clamp(18px, min(3.4vh, 2.5vw), 46px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #3a0a5e;
  padding: .55em 1.5em .5em;
  min-height: 48px;
  border: 0; border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6c8 0%, #f8d466 28%, #dc9d22 64%, #f3c64c 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .8),
    inset 0 -3px 0 rgba(120, 70, 0, .35),
    0 0 0 3px #7a4a05,
    0 0 0 6px rgba(247, 211, 107, .55),
    0 7px 0 3px #4a2a00,
    0 14px 30px rgba(0, 0, 0, .55);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .12s, filter .2s, box-shadow .12s;
}
.btn-show::after { /* soft breathing glow */
  content: ""; position: absolute; inset: -14px; border-radius: inherit; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(247, 211, 107, .55), transparent 70%);
  animation: ctaGlow 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ctaGlow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.btn-show:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-2px); }
.btn-show:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), inset 0 -3px 0 rgba(120, 70, 0, .35), 0 0 0 3px #7a4a05, 0 0 0 6px rgba(247, 211, 107, .55), 0 2px 0 3px #4a2a00, 0 6px 14px rgba(0, 0, 0, .5);
}
.btn-show:disabled { cursor: default; filter: saturate(.5) brightness(.8); }
.btn-show:disabled::after { animation: none; opacity: 0; }
.btn-show:focus-visible { outline: 3px solid #fff; outline-offset: 8px; }
.btn-small { font-size: clamp(16px, 2.4vh, 26px); }

/* ---------- prize panel ---------- */
.prize-overlay {
  position: fixed; inset: 0; z-index: 15;
  display: grid; place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(13, 2, 24, .35), rgba(13, 2, 24, .7));
}
.prize-overlay[hidden] { display: none; }
.prize-card {
  position: relative;
  width: min(760px, 62vw);
  padding: clamp(10px, 1.6vmin, 18px);
  border-radius: clamp(18px, 3vmin, 32px);
  background: linear-gradient(145deg, #fff2b6, #d9a12a 30%, #7a4a05 55%, #f2c95a 80%, #a46d0c);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(247, 211, 107, .35);
}
.panel-bulbs { position: absolute; inset: clamp(5px, .8vmin, 9px); pointer-events: none; }
.prize-inner {
  position: relative;
  border-radius: clamp(12px, 2.2vmin, 24px);
  padding: clamp(22px, 4.5vmin, 52px) clamp(18px, 4vmin, 48px) clamp(20px, 4vmin, 42px);
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(179, 107, 255, .45), transparent 70%),
    radial-gradient(ellipse at center, #4a1480, #240646 75%);
  box-shadow: inset 0 0 0 2px rgba(255, 242, 182, .5), inset 0 0 40px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.prize-inner > * { margin: 0; }
.prize-congrats {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(24px, min(6.2vh, 4.6vw), 68px);
  line-height: 1.1; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden;
  padding: .05em .1em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff8d6 0%, #f7d36b 45%, #c78a17 70%, #f7d36b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #4a2a00) drop-shadow(0 8px 14px rgba(0, 0, 0, .5));
}
.prize-won {
  margin-top: clamp(6px, 1.4vh, 16px);
  font-family: var(--font-show); text-transform: uppercase;
  letter-spacing: .3em; font-size: clamp(14px, 2.6vh, 26px);
  color: var(--silver);
  white-space: nowrap; overflow: hidden;
}
.prize-name {
  margin-top: clamp(8px, 1.6vh, 18px);
  font-family: var(--font-show);
  font-size: clamp(30px, min(9vh, 9.5vw), 104px);
  line-height: 1.02;
  color: #fff;
  white-space: nowrap; overflow: hidden;
  text-shadow: 0 4px 0 #3a0a5e, 0 0 26px rgba(247, 211, 107, .65);
  padding: 0 .1em .08em;
}
.prize-img {
  display: block; margin: clamp(10px, 2vh, 20px) auto 0;
  max-width: min(60%, 340px); max-height: 24vh; object-fit: contain;
  border-radius: 12px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5));
}
.prize-img[hidden] { display: none; }
.prize-desc {
  margin: clamp(8px, 1.4vh, 14px) auto 0; max-width: 34em;
  font-size: clamp(14px, 2.1vh, 21px); line-height: 1.4; color: #eadcff;
}
.prize-desc[hidden] { display: none; }
.prize-inner .btn-show { margin-top: clamp(16px, 3vh, 32px); }
.prize-test {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  background: #1d1d26; color: #9fe7c4; border: 1px solid #3c6;
}
.prize-test[hidden] { display: none; }

/* ---------- confetti, HUD ---------- */
.confetti { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

.hud { position: fixed; top: 12px; right: 12px; z-index: 30; display: flex; gap: 8px; }
.hud-btn, .manager-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(247, 211, 107, .5);
  background: rgba(26, 5, 48, .65);
  color: var(--gold-300);
  cursor: pointer; padding: 0;
  transition: background .2s, opacity .2s;
}
.hud-btn svg { width: 22px; height: 22px; }
.hud-btn .slash { opacity: 0; }
.hud-btn.is-off { color: #9a8bb0; }
.hud-btn.is-off .slash { opacity: 1; }
.hud-btn.is-off .wave { opacity: 0; }
.hud-btn:hover { background: rgba(74, 20, 128, .85); }
.hud-btn:focus-visible, .manager-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.manager-toggle {
  position: fixed; left: 10px; bottom: 10px; z-index: 30;
  width: 36px; height: 36px; opacity: .28;
  border-color: rgba(255, 255, 255, .2); color: #ccc;
}
.manager-toggle svg { width: 18px; height: 18px; }
.manager-toggle:hover, .manager-toggle:focus-visible { opacity: .9; }

/* Manager panel: intentionally plain and utilitarian, separate from the show */
.manager {
  position: fixed; left: 12px; bottom: 56px; z-index: 40;
  width: min(330px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 10px;
  background: #15151c; color: #e7e7ee;
  border: 1px solid #3a3a48;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  font: 13px/1.4 var(--font-ui);
}
.manager[hidden] { display: none; }
.manager header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.manager header strong { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #9fe7c4; }
.mgr-close { background: none; border: 0; color: #aaa; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.mgr-note { margin: 0 0 8px; color: #9a9aaa; font-size: 12px; }
.mgr-state { margin: 0 0 10px; color: #bbb; }
.mgr-state span { font-family: ui-monospace, Consolas, monospace; color: #fff; }
.mgr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.manager button:not(.mgr-close), .manager select {
  min-height: 36px; padding: 6px 10px;
  border-radius: 6px; border: 1px solid #44445a;
  background: #23232e; color: #f0f0f5; cursor: pointer;
  font: 13px var(--font-ui);
}
.manager button:not(.mgr-close):hover:not(:disabled) { background: #30303f; border-color: #6a6a88; }
.manager button:disabled { opacity: .4; cursor: not-allowed; }
.mgr-label { display: block; margin: 12px 0 4px; color: #bbb; }
.mgr-row { display: flex; gap: 6px; }
.mgr-row select { flex: 1; min-width: 0; }
.mgr-reset { width: 100%; margin-top: 12px; }

/* ---------- responsive tweaks ---------- */
body.is-portrait .prize-card { width: min(560px, 94vw); }
body.is-portrait .beam { width: 60vw; }
@media (max-height: 520px) {
  .btn-show { min-height: 40px; }
  .hud-btn { width: 38px; height: 38px; }
}

@keyframes spinSlow { to { transform: rotate(360deg); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rays, .beam, .host-img, .btn-show::after { animation: none !important; }
  .bulb, body.is-spinning .bulb { animation: none !important; opacity: .9; }
  .wheel-highlight .hl-wedge { animation: none; fill: rgba(255, 236, 170, .25); }
  .logo, .host { transition-duration: .3s !important; }
}

/* ==========================================================================
   Session flow: receipt confirmation, staff name, greeting, player chip,
   spin again / continue, winner announcement
   ========================================================================== */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* nothing of the present is on stage until the player is ready */
body[data-state="receipt-confirmation"] .present-layer,
body[data-state="staff-name"] .present-layer { visibility: hidden; }

/* the logo, restrained lighting once it sits beside the wheel */
body.layout-wheel .logo {
  filter: drop-shadow(0 0 22px rgba(247, 211, 107, .25)) drop-shadow(0 10px 24px rgba(0, 0, 0, .5));
}

.greeting {
  position: absolute; z-index: 11; margin: 0;
  transform: translate(-50%, -50%);
  width: min(92vw, 900px);
  text-align: center;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(20px, min(4.2vh, 3.4vw), 46px);
  line-height: 1.15; letter-spacing: .02em;
  background: linear-gradient(180deg, #fff8d6 0%, #f7d36b 50%, #d79d27 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #3a0a5e) drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
  pointer-events: none;
}
.greeting[hidden] { display: none; }

.player-chip {
  position: absolute; z-index: 11;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 2px;
  padding: 10px 26px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(74, 20, 128, .92), rgba(36, 6, 70, .92));
  box-shadow: inset 0 0 0 2px rgba(247, 211, 107, .75), 0 10px 26px rgba(0, 0, 0, .45);
  text-align: center; white-space: nowrap;
  width: max-content; max-width: min(30vw, 360px);
}
.player-chip[hidden] { display: none; }
.player-chip .chip-label { font: 700 11px/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--silver); }
.player-chip strong {
  font-family: var(--font-show); font-weight: 400; font-size: clamp(20px, 3.2vh, 34px); line-height: 1.1;
  color: #fff; text-shadow: 0 2px 0 #3a0a5e, 0 0 14px rgba(247, 211, 107, .5);
  max-width: 100%; white-space: normal; overflow-wrap: break-word;
}
.player-chip span:last-child { font: 600 13px/1.2 var(--font-ui); color: var(--gold-300); }
.player-chip.is-left {
  transform: none; padding: 6px 14px 7px; border-radius: 12px; max-width: calc(100vw - 130px);
  grid-template-columns: auto auto; column-gap: 10px; align-items: baseline;
}
.player-chip.is-left .chip-label { display: none; }
.player-chip.is-left strong { font-size: 18px; }
.player-chip.is-left span:last-child { font-size: 12px; }

/* pre-game screens sit on the stage, below the logo */
.screen {
  position: fixed; inset: 0; z-index: 15;
  display: flex; justify-content: center; align-items: flex-start;
  padding: var(--form-top, 30vh) 16px 24px;
  overflow-y: auto;
}
.screen[hidden] { display: none; }
.screen-card {
  width: min(680px, 100%);
  padding: clamp(22px, 4vmin, 44px) clamp(18px, 4vmin, 44px);
  border-radius: clamp(16px, 2.6vmin, 28px);
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(179, 107, 255, .4), transparent 70%),
    radial-gradient(ellipse at center, #4a1480, #240646 80%);
  box-shadow: inset 0 0 0 2px rgba(255, 242, 182, .55), 0 0 0 6px rgba(138, 85, 6, .9), 0 0 0 8px rgba(247, 211, 107, .6), 0 24px 60px rgba(0, 0, 0, .6);
}
.screen-kicker {
  margin: 0 0 8px; font: 700 13px/1 var(--font-ui); letter-spacing: .28em; text-transform: uppercase; color: var(--silver);
}
.screen-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(20px, min(3.6vh, 3.4vw), 34px); line-height: 1.25;
  color: var(--gold-100);
  text-shadow: 0 2px 0 #3a0a5e, 0 0 18px rgba(247, 211, 107, .35);
}
.screen-title-big { font-size: clamp(30px, min(7vh, 7vw), 64px); letter-spacing: .03em; text-transform: uppercase; }

.check {
  display: flex; align-items: flex-start; gap: 14px;
  margin: clamp(18px, 3.4vh, 30px) auto clamp(18px, 3.4vh, 30px);
  max-width: 520px; padding: 14px 16px;
  border-radius: 14px;
  background: rgba(13, 2, 24, .45);
  box-shadow: inset 0 0 0 1px rgba(247, 211, 107, .35);
  text-align: left; cursor: pointer;
  font-size: clamp(16px, 2.2vh, 20px); line-height: 1.4; color: #f3e9ff;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: none; width: 32px; height: 32px; margin-top: 1px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 2px var(--gold-300);
  display: grid; place-items: center;
  transition: background .15s;
}
.check-box::after {
  content: ""; width: 9px; height: 17px; margin-top: -4px;
  border: solid #3a0a5e; border-width: 0 4px 4px 0;
  transform: rotate(45deg) scale(0); transition: transform .15s;
}
.check input:checked + .check-box { background: linear-gradient(180deg, #fff6c8, #f3c64c 60%, #d99a1e); }
.check input:checked + .check-box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check-box { outline: 3px solid #fff; outline-offset: 3px; }

.name-input {
  display: block; width: 100%;
  margin: clamp(18px, 3.4vh, 30px) 0 10px;
  padding: .45em .6em;
  border: 0; border-radius: 14px;
  background: #fffaf0; color: #2a0845;
  font-family: var(--font-show); font-size: clamp(26px, 5vh, 46px); text-align: center;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .25), 0 0 0 4px rgba(247, 211, 107, .8);
}
.name-input::placeholder { color: #9a86b4; }
.name-input:focus { outline: none; box-shadow: inset 0 3px 8px rgba(0, 0, 0, .25), 0 0 0 4px #fff, 0 0 24px rgba(247, 211, 107, .7); }
.field-error { margin: 0 0 6px; color: #ffb4c4; font-weight: 600; }
.field-error[hidden] { display: none; }
.screen-card .btn-show { margin-top: clamp(12px, 2.4vh, 22px); }

/* purple secondary show button */
.btn-alt {
  color: var(--gold-100);
  background: linear-gradient(180deg, #a15ee8 0%, #6a24b0 40%, #3d0d72 100%);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .35),
    inset 0 -3px 0 rgba(0, 0, 0, .3),
    0 0 0 3px #e2a92f,
    0 0 0 6px rgba(247, 211, 107, .35),
    0 7px 0 3px #24063f,
    0 14px 30px rgba(0, 0, 0, .55);
}
.btn-alt::after { background: radial-gradient(ellipse at center, rgba(179, 107, 255, .5), transparent 70%); }
.btn-alt:active:not(:disabled) {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 0 0 3px #e2a92f, 0 0 0 6px rgba(247, 211, 107, .35), 0 2px 0 3px #24063f, 0 6px 14px rgba(0, 0, 0, .5);
}

.prize-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px;
  margin-top: clamp(18px, 3vh, 32px);
}
.prize-inner .prize-actions .btn-show { margin-top: 0; }

/* winner announcement */
.screen-results {
  align-items: center; padding-top: 24px;
  background: radial-gradient(ellipse at center, rgba(13, 2, 24, .45), rgba(13, 2, 24, .8));
}
.results-card { width: min(720px, 100%); margin: auto 0; }
body:not(.is-portrait) .screen-results .results-card { width: min(720px, 56vw); }
.results-heading {
  margin: 0;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(22px, min(5vh, 4.6vw), 50px); letter-spacing: .04em;
  background: linear-gradient(180deg, #fff8d6 0%, #f7d36b 45%, #c78a17 70%, #f7d36b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #4a2a00);
}
.results-name {
  margin: 6px 0 0;
  font-family: var(--font-show); text-transform: uppercase;
  font-size: clamp(34px, min(9vh, 10vw), 92px); line-height: 1.05;
  color: #fff; text-shadow: 0 4px 0 #3a0a5e, 0 0 26px rgba(247, 211, 107, .6);
  overflow-wrap: anywhere;
}
.results-sub { margin: 10px 0 8px; font-size: clamp(16px, 2.4vh, 22px); color: #eadcff; font-weight: 600; }
.results-list {
  list-style: none; margin: 0 auto; padding: 4px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
  max-height: 22vh; overflow-y: auto;
}
.results-list[hidden] { display: none; }
.results-list li {
  padding: .3em .9em .35em;
  border-radius: 999px;
  font-family: var(--font-show); font-size: clamp(17px, 2.6vh, 26px);
  color: #3a0a5e;
  background: linear-gradient(180deg, #fff6c8, #f3c64c 60%, #d99a1e);
  box-shadow: 0 0 0 2px #7a4a05, 0 4px 10px rgba(0, 0, 0, .35);
}
.results-label {
  display: block; margin: clamp(16px, 2.6vh, 26px) 0 6px; text-align: left;
  font: 700 12px/1 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--silver);
}
.chat-message {
  display: block; width: 100%; resize: vertical; min-height: 92px;
  padding: 12px 14px; border: 0; border-radius: 12px;
  background: #fffaf0; color: #2a0845;
  font: 500 clamp(16px, 2.2vh, 20px)/1.45 var(--font-ui);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 3px rgba(247, 211, 107, .7);
}
.chat-message:focus { outline: none; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2), 0 0 0 3px #fff; }
.results-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px;
  margin-top: 18px;
}
.results-actions .btn-show { margin-top: 0; }
.copy-status { min-height: 1.4em; font-weight: 700; font-size: 15px; }
.copy-status:empty { display: none; }
.copy-status.is-ok { color: #9fe7c4; }
.copy-status.is-error { color: #ffb4c4; }
.results-card > .btn-alt { margin-top: 22px; }

@media (max-width: 480px) {
  .btn-small { font-size: 17px; }
  .prize-actions { gap: 14px; }
}

body.is-portrait .manager-toggle { left: auto; right: 10px; }
body.is-portrait .manager { left: auto; right: 12px; }

.mgr-sync { margin: 10px 0 0; padding: 8px 10px; border-radius: 6px; background: #1d1d26; color: #bbb; font-size: 12px; }
.mgr-sync span { color: #fff; }
.mgr-sync span[data-state="saved"] { color: #9fe7c4; }
.mgr-sync span[data-state="waiting"] { color: #ffd38a; }
.mgr-sync a { color: #c9a8ff; }
