:root { color-scheme:dark; --bg:#101a16; --panel:#192821; --ink:#f6efdf; --soft:#c6c9b7; --gold:#eec277; --red:#a23642; --border:#425046; font:16px/1.5 system-ui, sans-serif; background:var(--bg); color:var(--ink); }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; display:flex; flex-direction:column; background:radial-gradient(ellipse at 65% 12%,#23382c,transparent 60%); }
.masthead,footer { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.25rem max(5vw,1rem); border-bottom:1px solid var(--border); }
footer { margin-top:auto; border-top:1px solid var(--border); border-bottom:0; color:var(--soft); font-size:.8rem; }
footer b { color:var(--gold); padding:0 .45rem; }
.brand { display:flex; align-items:center; gap:.65rem; font:700 1.2rem Georgia,serif; color:var(--ink); text-decoration:none; }
.brand-tree,.tree { clip-path:polygon(50% 0,68% 36%,61% 36%,79% 61%,70% 61%,96% 87%,56% 87%,56% 100%,44% 100%,44% 87%,4% 87%,30% 61%,21% 61%,39% 36%,32% 36%); background:var(--gold); }
.brand-tree { width:1.2rem; height:1.45rem; }
.mast-label,.eyebrow { font-size:.75rem; text-transform:uppercase; letter-spacing:.17em; color:var(--gold); font-weight:750; }
main { width:min(90%,1120px); margin:2.6rem auto 4rem; }
.hero { position:relative; overflow:hidden; isolation:isolate; display:grid; grid-template-columns:1.25fr 1fr; align-items:center; min-height:400px; padding:clamp(2rem,5vw,4.5rem); background:linear-gradient(115deg,#242d23,#16291e 65%,#14251c); border:1px solid var(--border); border-radius:1.4rem; }
.hero h1 { font-size:clamp(3.2rem,7.2vw,6.7rem); line-height:.94; letter-spacing:-.07em; margin:.65rem 0 1rem; }
.hero h1 em { font-weight:inherit; color:var(--gold); }
.hero p { color:var(--soft); max-width:39ch; }
h1,h2,h3 { font-family:Georgia,serif; line-height:1.1; margin:.4rem 0 1rem; }
h1 { font-size:clamp(2.35rem,5vw,4.5rem); }
h2 { font-size:clamp(1.6rem,3vw,2.65rem); }
h3 { font-size:1.25rem; }
.art { position:relative; display:grid; place-items:center; min-height:290px; background:radial-gradient(ellipse at center,#d0a66338,transparent 68%); }
.art .tree { position:absolute; width:47%; height:65%; background:linear-gradient(140deg,#ffe1a1,#b67b3d); top:21%; }
.art b { position:absolute; top:5%; color:var(--gold); font-size:2.6rem; text-shadow:0 0 25px #ffcd7b; }
.art i { position:absolute; color:#f7d79d; font-style:normal; }
.art i:nth-of-type(1) { left:14%; top:29%; }
.art i:nth-of-type(2) { right:16%; top:40%; }
.art i:nth-of-type(3) { left:23%; bottom:15%; }
.art i:nth-of-type(4) { right:11%; bottom:15%; }
.art i:nth-of-type(5) { right:28%; top:9%; }
.grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:1rem; }
.panel { background:var(--panel); border:1px solid var(--border); border-radius:1.15rem; padding:clamp(1.15rem,3vw,2.25rem); }
.narrow { max-width:650px; margin-inline:auto; }
.row { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; }
.stack { display:grid; gap:.85rem; }
p { margin:.45rem 0 1rem; }
small,.muted { color:var(--soft); }
button,input,select { font:inherit; border-radius:.65rem; border:1px solid #687568; padding:.72rem .95rem; background:#142019; color:var(--ink); }
input:not([type=checkbox]),select { min-width:0; width:100%; }
label { display:block; }
label input:not([type=checkbox]),label select { margin-top:.3rem; }
button { cursor:pointer; font-weight:700; }
button.primary { background:var(--gold); border-color:var(--gold); color:#21160d; }
button:hover { filter:brightness(1.15); }
button:disabled { opacity:.5; cursor:default; }
:focus-visible { outline:3px solid #f5d898; outline-offset:3px; }
a { color:var(--gold); }
.error { color:#ffc1bf; margin:.6rem 0; }
.details { margin-top:1rem; }
summary { cursor:pointer; color:var(--gold); }
.room-code { display:block; color:var(--gold); font-family:monospace; font-weight:800; font-size:clamp(2rem,6vw,4rem); letter-spacing:.14em; }
canvas { display:block; width:min(100%,255px); height:auto; border-radius:.5rem; }
.players { padding-left:1.4rem; }
.players li { padding:.2rem 0; }
.score { float:right; color:var(--gold); margin-left:1rem; }
.stage { text-align:center; }
.stage video { display:block; margin:1rem auto; width:min(100%,900px); max-height:58vh; background:#000; border-radius:.75rem; }
.youtube-stage { width:min(100%,900px); margin:1rem auto; }
.youtube-stage iframe { width:100%; aspect-ratio:16 / 9; height:auto; min-height:200px; max-height:58vh; border:0; background:#000; border-radius:.75rem; }
.stage .row { justify-content:center; }
.stage .question { margin:1.4rem auto; max-width:30ch; }
.choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin:1rem 0; text-align:left; }
.choice { display:flex; align-items:center; gap:.65rem; padding:.85rem; border:1px solid var(--border); border-radius:.65rem; overflow-wrap:anywhere; text-align:left; }
.choice b { display:grid; place-items:center; flex:0 0 2rem; height:2rem; border-radius:.4rem; background:#293c30; color:var(--gold); }
.choice.correct { border-color:#a9c58f; background:#2a4530; }
.choice.selected { border-color:var(--gold); opacity:1; }
.timer { font-size:1.4rem; font-variant-numeric:tabular-nums; color:var(--gold); }
.podium { list-style:none; padding:0; display:flex; flex-wrap:wrap; gap:1rem; justify-content:center; }
.podium li { border-radius:.75rem; background:#253b2d; padding:1rem 1.5rem; min-width:130px; }
.podium strong { display:block; color:var(--gold); font-size:1.4rem; }
.clip-list { list-style:none; padding:0; }
.clip-list li { display:flex; justify-content:space-between; align-items:center; gap:.7rem; margin:.5rem 0; }
@media (max-width:670px) { .grid,.hero,.choices { grid-template-columns:1fr; } .hero { min-height:0; } .art { min-height:175px; width:190px; margin:auto; } main { margin-top:1.2rem; } .mast-label,footer span:first-child { display:none; } }

/* Cinema opening and living-room controls */
body {
  background: radial-gradient(ellipse at 50% 0%, #264435 0, transparent 57%), #0d1713;
}
.opening {
  position: fixed; inset: 0; z-index: 10; overflow: hidden; isolation: isolate;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse at 50% 45%, #263c32 0, #0e1d19 48%, #080f0e 100%);
  animation: opening-out .5s ease 3.2s both;
}
.opening-logo {
  position: relative; display: grid; justify-items: center; width: min(90vw, 780px);
  animation: logo-in 1.85s cubic-bezier(.18,.75,.31,1) both;
}
.opening-logo .tree {
  width: clamp(108px, 18vw, 235px); height: clamp(116px, 24vh, 290px);
  background: linear-gradient(145deg, #fce9b6, #ba7b39 88%);
}
.opening-star { font-size: clamp(28px, 4vw, 62px); color: #f9d990; text-shadow: 0 0 35px #f7c97c91; line-height: 1; }
.opening-logo p {
  margin: .25em 0 0; font: 700 clamp(2.2rem, 7vw, 6.6rem)/.98 Georgia, serif;
  letter-spacing: -.055em; color: #fff3dd; text-wrap: balance;
}
.opening-logo em { color: var(--gold); }
.opening-snow { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.opening-snow i {
  position: absolute; top: -10px; left: var(--x); height: var(--size); width: var(--size);
  background: #f5f5e7; border-radius: 50%; box-shadow: 0 0 7px #f7f7ed60;
  animation: snow-fall var(--duration) linear var(--delay) infinite;
}
#skip-intro { position: absolute; right: max(4vw, 1rem); bottom: max(5vh, 1rem); }
@keyframes snow-fall { from { transform: translate(-22px,0); opacity: .18; } 30% { opacity: .8; } to { transform: translate(42px,105vh); opacity: .24; } }
@keyframes logo-in { from { opacity: 0; transform: scale(.93) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes opening-out { from { opacity: 1; } to { opacity: 0; } }
.setup-header { margin: 0 0 clamp(1.3rem,3vw,2.25rem); }
.setup-header h1 { margin: .25rem 0 0; letter-spacing: -.045em; }
.setup-header h1:focus { outline: none; }
.setup-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); align-items: start; gap: clamp(1rem,2.5vw,1.75rem); }
.panel {
  background: linear-gradient(155deg, #21342a, #17251e 90%);
  border-color: #445a4b; box-shadow: 0 20px 54px #050c084d;
}
.stage { min-height: 54vh; }
.stage .question { text-wrap: balance; }
button, select, input:not([type=radio],[type=checkbox]) { min-height: 48px; }
button {
  border-color: #5c7264; background: #243a2e;
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
button:not(:disabled):hover { border-color: #f5d898; }
button.primary { background: linear-gradient(110deg,#f4d093,#e2aa5d); box-shadow: 0 4px 20px #eec27720; }
button.action { display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; padding-inline: 1.15rem; }
button.action span { font-size: 1.3em; line-height: 1; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #ffe0a1; outline-offset: 4px;
}
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { margin: 0 0 .45rem; padding: 0; font-weight: 700; }
.segments { display: flex; flex-wrap: wrap; gap: .5rem; }
.segments label { position: relative; min-width: 52px; flex: 1; }
.segments label input { position: absolute; opacity: 0; margin: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.segments label span {
  display: grid; min-height: 48px; place-items: center; padding: .25rem;
  border: 1px solid #617866; border-radius: .68rem; background: #14261d; font-weight: 750;
}
.segments input:checked + span { background: #f2ca84; color: #2e2011; border-color: #f4d8a6; }
.segments input:focus-visible + span { outline: 3px solid #ffe0a1; outline-offset: 3px; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; vertical-align: middle; margin-right: .5rem; accent-color: var(--gold); }
#auto { margin-block: .5rem; }
.details summary { padding-block: .6rem; }
.clip-list li { padding-block: .5rem; border-bottom: 1px solid var(--border); }
.clip-list .row { flex: none; }
.clip-list button { min-height: 40px; padding: .4rem .6rem; font-size: .85rem; }
@media (min-width: 1200px) {
  .setup-grid { font-size: 1.1rem; }
  .stage button, .setup-grid button { min-height: 52px; }
  .stage .choices { font-size: 1.25rem; }
}
@media (max-width: 670px) {
  .setup-grid { grid-template-columns: 1fr; }
  .segments label { min-width: 40px; }
  .clip-list li { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
