:root {
  --night: #2a0610;     /* deep theatre-curtain burgundy */
  --night-2: #4a0b1b;
  --pine: #6b1024;      /* lighter velvet red for highlights */
  --berry: #b3242b;
  --berry-2: #d33a3f;
  --gold: #e8c47a;
  --cream: #f7efe1;
  --muted: #e0c7bd;
  --card: rgba(247, 239, 225, 0.06);
  --line: rgba(247, 239, 225, 0.14);
  --radius: 16px;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ar: 4 / 3;  /* updated from the video itself; 2880×2160 = 4:3 */
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html { background: var(--night-2); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font: 16px/1.55 var(--body);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 196, 122, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(107, 16, 36, 0.45), transparent 60%),
    /* soft vertical velvet folds, like a stage curtain */
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0px, rgba(255, 255, 255, 0.035) 38px, rgba(0, 0, 0, 0.22) 76px),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  -webkit-font-smoothing: antialiased;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
header, main, footer { position: relative; z-index: 1; }

.masthead { text-align: center; padding: clamp(28px, 6vw, 56px) 20px 18px; }
.eyebrow {
  margin: 0 0 6px; color: var(--gold); letter-spacing: 0.22em; text-transform: uppercase; font-size: 12px; font-weight: 600;
}
h1 {
  margin: 0; font-family: var(--display); font-weight: 600;
  font-size: clamp(34px, 6.5vw, 64px); line-height: 1.05; letter-spacing: -0.01em;
  text-shadow: 0 2px 30px rgba(232, 196, 122, 0.25);
}
.tagline { margin: 10px auto 0; max-width: 34rem; color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- stage ---------- */
.stage-wrap { width: min(100%, calc(76vh * (var(--ar)))); margin: 0 auto; }
.stage {
  position: relative; aspect-ratio: var(--ar); width: 100%;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 60px -10px rgba(232, 196, 122, 0.15);
}
.stage video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.stage:fullscreen { border-radius: 0; width: 100%; height: 100%; aspect-ratio: auto; }

.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 6px;
  background:
    radial-gradient(600px 300px at 50% 40%, rgba(232, 196, 122, 0.10), transparent 70%),
    linear-gradient(160deg, rgba(107, 16, 36, 0.94), rgba(42, 6, 16, 0.97));
  background-size: cover; background-position: center;
}
.overlay[hidden] { display: none; }
#ov-join { background: rgba(0, 0, 0, 0.45); }
.ov-kicker { margin: 0; color: var(--gold); letter-spacing: 0.2em; text-transform: uppercase; font-size: clamp(11px, 1.6vw, 14px); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.ov-title { margin: 4px 0; font-family: var(--display); font-size: clamp(24px, 4.4vw, 42px); font-weight: 600; }
.ov-when { margin: 6px 0 0; color: var(--muted); max-width: 30rem; font-size: clamp(13px, 1.9vw, 16px); }
.ov-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: clamp(10px, 2.5vw, 22px); }
.seated { color: var(--gold); margin: 12px 0 0; }

.countdown { display: flex; gap: clamp(8px, 2vw, 22px); margin: 8px 0 2px; }
.countdown .unit { display: flex; flex-direction: column; align-items: center; min-width: clamp(54px, 11vw, 110px); }
.countdown .num {
  font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: clamp(34px, 8.5vw, 84px); line-height: 1;
}
.countdown .lbl { margin-top: 6px; font-size: clamp(10px, 1.4vw, 12px); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.countdown.small .num { font-size: clamp(30px, 6.5vw, 64px); }

.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--berry-2); box-shadow: 0 0 0 0 rgba(211, 58, 63, 0.7); animation: pulse 1.6s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(211,58,63,0.7); } 70% { box-shadow: 0 0 0 9px rgba(211,58,63,0); } 100% { box-shadow: 0 0 0 0 rgba(211,58,63,0); } }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font: 600 15px/1 var(--body);
  color: #fff; background: linear-gradient(180deg, var(--berry-2), var(--berry));
  box-shadow: 0 6px 20px -6px rgba(179, 36, 43, 0.7), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .ctl:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn.ghost { background: rgba(247, 239, 225, 0.08); box-shadow: inset 0 0 0 1px var(--line); color: var(--cream); }
.btn.big { padding: 15px 28px; font-size: 17px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- player controls ---------- */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px;
  padding: 28px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  opacity: 1; transition: opacity 0.3s ease;
}
.controls[hidden] { display: none; }
.stage.idle .controls { opacity: 0; }
.stage.idle { cursor: none; }
.ctl {
  appearance: none; border: 0; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer;
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 999px; font: 600 14px/1 var(--body);
}
.ctl:hover { background: rgba(255,255,255,0.22); }
.ctl.text { font-size: 13px; }
.ctl[aria-pressed="true"] { background: var(--gold); color: #1a1a1a; }
.spacer { flex: 1; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font: 700 12px/1 var(--body); letter-spacing: 0.12em; background: var(--berry); padding: 7px 10px; border-radius: 6px; }
.live-badge.behind { background: rgba(255,255,255,0.18); }
.live-badge.behind .dot { background: #999; animation: none; }
.vol { width: 90px; accent-color: var(--gold); }
@media (max-width: 560px) { .vol { display: none; } }

.reactions-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float {
  position: absolute; bottom: 60px; font-size: clamp(22px, 3.5vw, 34px);
  animation: floatUp 3.2s ease-out forwards; will-change: transform, opacity;
}
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  12% { opacity: 1; transform: translate(0, -20px) scale(1.1); }
  100% { transform: translate(var(--dx, 0px), -260px) scale(1); opacity: 0; }
}

.livebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 4px 0; }
.livebar[hidden] { display: none; }
.viewers { color: var(--muted); font-size: 14px; }
.viewers b { color: var(--cream); font-variant-numeric: tabular-nums; }
.react-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.react-buttons button {
  appearance: none; border: 0; cursor: pointer; font-size: 20px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.1s ease;
}
.react-buttons button:hover { transform: scale(1.12); }
.react-buttons button:active { transform: scale(0.92); }

/* ---------- gift form ---------- */
.gift { margin-top: clamp(28px, 6vw, 56px); display: flex; justify-content: center; }
.gift-card {
  width: 100%; max-width: 560px; padding: clamp(22px, 5vw, 36px);
  background: linear-gradient(180deg, rgba(247,239,225,0.08), rgba(247,239,225,0.03));
  border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(6px);
}
.gift-card h2 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(24px, 4vw, 32px); line-height: 1.15; font-weight: 600; }
.gift-note { margin: 0 0 20px; color: var(--muted); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input:not([type="checkbox"]) {
  width: 100%; padding: 13px 14px; font: 16px var(--body); color: var(--cream);
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 10px;
}
.field input::placeholder { color: rgba(184, 195, 207, 0.55); }
.field input[aria-invalid="true"] { border-color: var(--berry-2); }
.field.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; margin-bottom: 4px; }
.field.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--berry-2); flex: none; }
.field.check label { font-weight: 400; font-size: 13.5px; color: var(--muted); margin: 0; }
.err { color: #ff9a9e; font-size: 13px; margin: 5px 0 0; min-height: 0; }
.err:empty { display: none; }
.form-err { text-align: center; margin-top: 10px; }
#f-submit { margin-top: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-locked { padding: 18px; border-radius: 12px; background: rgba(0,0,0,0.2); border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.form-locked p { margin: 0; }
.form-done { text-align: center; padding: 10px 0; }
.form-done h3 { font-family: var(--display); font-size: 26px; margin: 4px 0; }
.form-done p { color: var(--muted); margin: 0; }
.done-emoji { font-size: 48px; margin: 0; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 20px 40px; }

@media (max-width: 560px) {
  main { padding: 0 0 32px; }
  .stage-wrap { width: 100%; }
  .stage { border-radius: 0; }
  .livebar { padding: 10px 12px 0; }
  .gift { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, .done-emoji, .spinner { animation: none; }
  html { scroll-behavior: auto; }
}

/* Small screens: keep overlay content inside the 16:9 frame */
@media (max-width: 560px) {
  .overlay { padding: 10px 14px; gap: 2px; }
  .ov-title { font-size: 21px; margin: 2px 0; }
  .ov-when { font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
  .ov-actions { margin-top: 8px; gap: 6px; }
  .overlay .btn { padding: 8px 13px; font-size: 13px; }
  .overlay .btn.big { padding: 11px 20px; font-size: 15px; }
  #ov-countdown .ov-actions .btn.ghost { padding: 7px 11px; font-size: 12.5px; }
  .countdown .unit { min-width: 52px; }
  .countdown .lbl { margin-top: 3px; }
}

/* ---------- presenter credit ---------- */
.eyebrow.presenter { letter-spacing: 0.14em; max-width: 40rem; margin-left: auto; margin-right: auto; line-height: 1.5; }

/* ---------- TV / casting ---------- */
.ctl.cast { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.ctl.cast[hidden] { display: none; }
.ctl.cast svg { width: 18px; height: 18px; }
.ctl.cast span { font-size: 13px; }
.ctl.cast.active { background: var(--gold); color: #1a1a1a; }
@media (max-width: 560px) { .ctl.cast span { display: none; } }
.test-badge { font: 700 12px/1 var(--body); letter-spacing: 0.12em; background: var(--gold); color: #1a1a1a; padding: 7px 10px; border-radius: 6px; }
.test-badge[hidden] { display: none; }

.tv-overlay { background: linear-gradient(160deg, rgba(107, 16, 36, 0.97), rgba(42, 6, 16, 0.99)); z-index: 2; padding-bottom: 70px; }
.tv-icon { font-size: clamp(38px, 7vw, 64px); margin: 0; line-height: 1; }
.stage .controls { z-index: 3; }

.test-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  margin-bottom: 10px; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  background: rgba(42, 6, 16, 0.85); border: 1px solid rgba(232, 196, 122, 0.45);
}
.test-bar[hidden] { display: none; }
.test-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.test-text b { color: var(--gold); }
.test-text span { color: var(--cream); }
.test-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-ic { font-weight: 700; color: var(--gold); }
.btn.small { padding: 8px 12px; font-size: 13px; }
@media (max-width: 560px) {
  .test-bar { padding: 10px 12px; font-size: 13px; margin: 0 10px 10px; }
  .btn.small { padding: 7px 10px; font-size: 12px; }
}

.tv-help {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.tv-help summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.tv-help summary::-webkit-details-marker { display: none; }
.tv-help summary::after { content: '＋'; color: var(--gold); font-weight: 700; }
.tv-help[open] summary::after { content: '－'; }
.tv-help-body { padding: 0 18px 18px; }
.tv-lead { margin: 0 0 14px; color: var(--muted); }
.tv-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .tv-ways { grid-template-columns: 1fr; } }
.tv-ways > div { background: rgba(0, 0, 0, 0.2); border-radius: 12px; padding: 14px; }
.tv-ways h3 { margin: 0 0 6px; font-size: 15px; font-family: var(--display); }
.tv-ways p { margin: 0; color: var(--muted); font-size: 14px; }
.tv-ways b { color: var(--cream); }
.tv-note { margin: 14px 0 0; font-size: 14px; color: var(--cream); }
.linkish { appearance: none; border: 0; background: none; padding: 0; color: var(--gold); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 560px) { .tv-help { margin: 12px 12px 0; } }
/* While on Chromecast the phone is only a remote: hide the local player buttons. */
.stage.casting-cc #ctl-play, .stage.casting-cc #ctl-golive, .stage.casting-cc #ctl-mute,
.stage.casting-cc #ctl-vol, .stage.casting-cc #ctl-cc, .stage.casting-cc #ctl-fs { display: none; }

/* Title artwork (public/title.png) replaces the text title when present */
.title-img { display: block; margin: 4px auto 0; max-width: min(92vw, 760px); max-height: 32vh; width: auto; height: auto; filter: drop-shadow(0 6px 30px rgba(232, 196, 122, 0.25)); }
.has-title-img #title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.fine-print { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* On the burgundy curtain, main buttons are gold so they stand out */
.btn:not(.ghost) { color: #2a0610; background: linear-gradient(180deg, #f2d28e, #d9ae5c); box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.4); }
.live-badge { background: #c4202f; }
.tagline:empty { display: none; }
.fine-print:has(span:empty + span:empty) { display: none; }

/* Before the show, if a poster is set: show the whole poster, with the countdown panel right underneath it */
.stage:has(video[poster]):has(#ov-countdown:not([hidden])),
.stage:has(video[poster]):has(#ov-doors:not([hidden])) { aspect-ratio: auto; height: auto; background: #000; }
.stage:has(video[poster]):has(#ov-countdown:not([hidden])) video,
.stage:has(video[poster]):has(#ov-doors:not([hidden])) video { height: auto; aspect-ratio: var(--ar); }
.stage:has(video[poster]) #ov-countdown,
.stage:has(video[poster]) #ov-doors {
  position: static; padding: clamp(14px, 3vw, 26px) 16px clamp(16px, 3vw, 26px);
  background: linear-gradient(180deg, #5a0d1f, #2a0610);
  border-top: 1px solid rgba(232, 196, 122, 0.35);
}
.stage-wrap:has(video[poster]):has(#ov-countdown:not([hidden])),
.stage-wrap:has(video[poster]):has(#ov-doors:not([hidden])) { width: min(100%, calc(50vh * (var(--ar)))); }

/* Reactions turned off */
.react-buttons, .reactions-layer { display: none !important; }
