:root {
  color-scheme: dark;
  --night: #12182c; --navy: #181f35; --panel: #1e2740;
  --ink: #fff0d7; --muted: #c9bbad; --gold: #edbd77; --bright: #ffda96;
  --outline: #d8a86b42; --red: #9e4758; --blue: #4f6f8b;
  --display: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font: 100%/1.45 var(--sans);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--night); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); background: radial-gradient(ellipse at 79% 5%, #2c3757 0, transparent 51%), radial-gradient(ellipse at 9% 83%, #25233a 0, transparent 41%), var(--night); }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .52; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; }
h1:focus { outline: none; }
em { font-weight: inherit; color: var(--gold); }
:focus-visible { outline: 3px solid var(--bright); outline-offset: 4px; }
.icon { width: 1.25em; height: 1.25em; vertical-align: middle; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) max(clamp(18px, 3.55vw, 62px), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(clamp(18px, 3.55vw, 62px), env(safe-area-inset-left)); }
.topbar, .main-frame, .site-footer { width: 100%; max-width: 1400px; margin-inline: auto; }
.topbar { display: flex; min-height: 77px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--outline); }
.top-controls { display: flex; gap: 8px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 48px; background: none; border: 0; padding: 0 6px 0 0; color: var(--ink); text-align: left; font: 1.12rem/1.22 var(--display); }
.brand small { display: block; margin-top: 3px; color: var(--gold); font: 700 .62rem/1.25 var(--sans); letter-spacing: .19em; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #b55d5728; border: 1px solid #d994694f; color: var(--gold); font-size: 1.16rem; }
.icon-button, .button { display: inline-flex; min-width: 48px; min-height: 48px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background .14s ease, border-color .14s ease, box-shadow .14s ease; }
.icon-button { padding: 0; background: #27324880; border-color: var(--outline); font-size: 1.13rem; }
.icon-button:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #e5ba7b22; border-color: #efbd7770; }
.button { padding: 11px 19px; font-size: 1rem; font-weight: 700; text-align: center; line-height: 1.24; }
.primary { background: #f0bd72; color: #221a2d; border-color: #f6d39a; box-shadow: 0 5px 20px #120e2370, inset 0 1px 0 #fff2ca80; }
.primary:hover:not(:disabled) { background: #ffcf88; }
.secondary { background: #303a55; border-color: #a58a674f; }
.secondary:hover:not(:disabled), .choice:hover:not(:disabled) { background: #404961; border-color: var(--gold); }
.quiet { background: transparent; color: var(--gold); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font-size: .77rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.main-frame { flex: 1; }
.app-home .main-frame, .app-setup .main-frame { display: flex; flex-direction: column; justify-content: center; padding-block: clamp(20px, 4.3vh, 52px) 24px; }
.hero { display: grid; grid-template-columns: minmax(350px, .87fr) minmax(0, 1.13fr); gap: clamp(25px, 5.4vw, 84px); align-items: center; }
.hero-copy { padding-left: clamp(0px, 1.5vw, 24px); }
.hero h1 { margin-top: 13px; font-size: clamp(4rem, 7.65vw, 7.8rem); line-height: .91; letter-spacing: -.049em; }
.hero-text { color: var(--muted); font-size: clamp(1.075rem, 1.7vw, 1.34rem); line-height: 1.52; max-width: 34ch; margin-top: 24px; }
.hero-actions, .setup-buttons, .play-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.hero-actions { margin-top: 29px; }
.hero-actions .primary, .setup-buttons .primary, .wheel-copy .primary { min-height: 55px; }
.hero-art { border-radius: 24px; position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid #e4b57786; background: #242d48; box-shadow: 0 24px 60px #090d2077; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art::after { content: ''; position: absolute; inset: 9px; border: 1px solid #f0bf7377; border-radius: 17px; pointer-events: none; }
.art-ornament { display: grid; place-items: center; position: absolute; bottom: 20px; right: 20px; width: 37px; height: 37px; color: #f5c987; background: #252137e9; border: 1px solid #e7ad65a8; border-radius: 50%; }
.phase-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(22px, 4.2vh, 46px); gap: 14px; }
.phase-item { min-height: 87px; padding: 13px clamp(13px, 1.8vw, 24px); display: flex; align-items: center; gap: 13px; border: 1px solid var(--outline); background: #2530496e; border-radius: 15px; }
.phase-item div { flex: 1; min-width: 0; }
.phase-icon { width: 43px; height: 43px; color: var(--gold); display: grid; place-items: center; border: 1px solid #d8a86b54; border-radius: 12px; background: #b4765226; font-size: 1.05rem; flex-shrink: 0; }
.phase-item:nth-child(2) .phase-icon { background: #9e475833; }
.phase-item strong { display: block; font: 1.25rem var(--display); }
.phase-item div span { display: block; margin-top: 3px; color: var(--muted); font-size: .88rem; }
.site-footer { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--outline); color: var(--muted); font-size: .84rem; }
.connection { display: inline-flex; align-items: center; gap: 8px; }
.connection i { border-radius: 50%; width: 7px; height: 7px; background: var(--gold); }
.offline-ready i { background: #9bd3ad; box-shadow: 0 0 9px #9bd3ad60; }
.panel, .play-card { border: 1px solid var(--outline); border-radius: 21px; background: #1c263ce8; box-shadow: 0 12px 36px #090d2038; }
.setup-layout { display: grid; grid-template-columns: 1fr 1.12fr; gap: clamp(24px, 7vw, 92px); align-items: center; }
.setup-copy h1 { font-size: clamp(3.05rem, 5.1vw, 5.3rem); line-height: 1; margin-top: 12px; }
.setup-art { width: min(360px, 100%); max-height: 220px; object-fit: cover; object-position: center 41%; border: 1px solid var(--outline); border-radius: 18px; margin-top: 22px; }
.setup-panel { padding: clamp(18px, 3.2vw, 38px); }
.setup-panel h2 { font-size: 2rem; margin-bottom: 18px; }
.field-row, .count-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; font-weight: 650; }
.field span { font-size: .93rem; }
input:not([type=checkbox]), select { display: block; width: 100%; color: var(--ink); background: #151e33; border: 1px solid #988262a0; border-radius: 10px; min-height: 48px; padding: 9px 11px; }
select { appearance: none; padding-inline-end: 28px; background-image: linear-gradient(45deg, transparent 50%, #f4cc8a 50%), linear-gradient(135deg, #f4cc8a 50%, transparent 50%); background-position: calc(100% - 16px) 53%, calc(100% - 11px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
.check-label { display: flex; padding: 8px 10px; gap: 10px; align-items: center; min-height: 48px; margin-top: 10px; border-radius: 9px; color: var(--ink); background: #8a4d392c; }
input[type=checkbox] { width: 21px; height: 21px; flex-shrink: 0; accent-color: var(--gold); }
.settings-line, .settings-line span { display: flex; align-items: center; gap: 10px; }
.settings-line { margin-top: 16px; justify-content: space-between; border-top: 1px solid var(--outline); }
.settings-line .icon { color: var(--gold); }
.setup-buttons { margin-top: 16px; }
.subtle { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.message { max-width: 70ch; padding: 11px 13px; border: 1px solid #f0b68d69; border-radius: 10px; background: #62423759; color: #ffe1bd; margin: 10px 0; font-size: 1rem; }
.error { border-color: #efa18a; color: #ffe3d8; background: #693943; }
.play-frame { padding-block: 13px 18px; }
.ribbon { display: flex; min-height: 45px; gap: 14px; align-items: center; margin-bottom: 13px; }
.ribbon-step { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; font-weight: 650; white-space: nowrap; min-height: 36px; padding: 3px 8px; border: 1px solid transparent; border-radius: 20px; }
.ribbon-step.is-current { color: var(--bright); padding-inline: 13px; background: #edbd7721; border-color: var(--outline); }
.ribbon-divider { width: 24px; height: 1px; background: var(--outline); }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(207px, 23.5vw, 300px); gap: clamp(12px, 2.1vw, 30px); align-items: start; }
.play-card { min-height: clamp(460px, calc(100dvh - 158px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 850px); overflow: hidden; }
.table { padding: clamp(12px, 1.6vw, 22px); }
.table-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.table-heading h2 { font-size: clamp(1.48rem, 2.4vw, 2rem); line-height: 1.05; margin-top: 3px; }
.table-heading > .icon { color: var(--gold); font-size: 1.28rem; }
.pile { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 0 7px; border-radius: 11px; background: #e5a66123; border: 1px solid var(--outline); padding: 9px; margin-top: 15px; }
.pile .icon { grid-row: span 2; color: #edbc72; }
.pile strong { color: var(--bright); line-height: 1.15; }
.pile span { color: var(--muted); font-size: .78rem; }
.player-list { list-style: none; padding: 0; margin: 13px 0 0; display: grid; gap: 3px; }
.player-list li { display: flex; align-items: center; gap: 7px; padding: 4px 6px; min-height: 32px; border: 1px solid transparent; border-bottom-color: #f5d89f17; border-radius: 7px; }
.player-list li.active-player { background: #edbd7722; border-color: #c1976b66; color: var(--bright); }
.player-dot { width: 5px; height: 5px; border-radius: 50%; background: #bba58082; flex-shrink: 0; }
.active-player .player-dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.player-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .93rem; font-weight: 640; }
.gift-count { min-width: 22px; padding-inline: 4px; text-align: center; border-radius: 5px; font-variant-numeric: tabular-nums; color: var(--bright); background: #0f152d66; font-weight: 760; }
.mini-icon { color: var(--gold); font-size: .76rem; }
.joker-mark { color: #cbb088; }
.turn-board { display: grid; grid-template-columns: minmax(0, .37fr) minmax(0, .63fr); gap: clamp(12px, 2vw, 31px); align-items: stretch; min-height: min(540px, calc(100dvh - 238px)); }
.turn-dial, .turn-work { min-width: 0; border: 1px solid var(--outline); border-radius: 23px; }
.turn-dial { display: grid; grid-template-rows: auto 46px; position: sticky; top: max(10px, env(safe-area-inset-top)); align-self: start; place-items: center; isolation: isolate; padding: 12px 15px; background: radial-gradient(ellipse at 50% 40%, #53445d 0, #293650 49%, #121c32 83%); box-shadow: 0 12px 40px #09132666; }
.turn-dial::before { position: absolute; z-index: -1; inset: 10px; border: 1px solid #e9b67238; border-radius: 17px; content: ''; pointer-events: none; }
.turn-dial .wheel-box { width: min(100%, 50vh, 474px); }
.turn-board.is-docking .turn-dial { z-index: 3; }
.turn-board.is-docking .turn-work { animation: reveal-task 580ms 100ms cubic-bezier(.2,.7,.28,1) backwards; }
@keyframes reveal-task { from { opacity: 0; transform: translateX(24px); } }
.dial-cue, .dial-result { display: flex; align-items: center; justify-content: center; gap: 7px; max-width: 100%; padding: 6px 12px; color: #fff2cb; border-radius: 12px; font-weight: 750; text-align: center; }
.dial-cue { position: absolute; bottom: 13%; right: 5%; z-index: 3; background: #efbd76; color: #1f1c2a; box-shadow: 0 8px 22px #110d2466; pointer-events: none; animation: swipe-cue .8s ease-out .14s 2; }
.dial-result { min-height: 38px; border: 1px solid #e7b37759; background: #192540; color: var(--bright); }
.dial-result.placeholder { visibility: hidden; }
@keyframes swipe-cue { 45% { transform: translate(-7px, -5px) rotate(-5deg); } }
.turn-work { background: #1c263c; overflow: hidden; display: flex; flex-direction: column; }
.turn-work > section { flex: 1; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.turn-work .task-card, .turn-work .gift-action-card { padding: clamp(15px, 2.31vw, 31px); }
.turn-work .task-card { animation: action-arrive 350ms ease-out both; }
.turn-work .question { font-size: clamp(1.5rem, 2.52vw, 2.25rem); }
.turn-work .task-people { color: var(--ink); font-size: 1rem; font-weight: 720; }
.turn-work .gift-action-head h1 { font-size: clamp(1.9rem, 3vw, 3rem); }
.turn-work .gift-choices { grid-template-columns: repeat(auto-fit, minmax(min(100%, 181px), 1fr)); }
.turn-work .gift-choices:has(> :only-child) { grid-template-columns: minmax(0, 390px); }
.turn-work .gift-option { min-height: 52px; padding-block: 6px; }
.turn-work .transfer-rows:has(li:nth-child(5)) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 5px; }
.turn-work .transfer-rows:has(li:nth-child(5)) li { padding-block: 3px; }
@media (min-width: 900px) and (orientation: landscape) {
  .turn-work .transfer-rows:has(li:nth-child(5)) {
    max-height: max(150px, calc(100dvh - 487px));
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
    overscroll-behavior-y: contain;
    scrollbar-color: #b68755 #172136;
  }
}
.app-board .table { margin-top: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 9px 13px; flex-wrap: wrap; }
.app-board .table-heading > div > span, .app-board .table-heading > .icon { display: none; }
.app-board .table h2 { font: 750 .94rem var(--sans); margin: 0; }
.app-board .pile { display: flex; padding: 4px 7px; margin: 0; }
.app-board .pile .icon { width: 17px; }
.app-board .table .player-list { flex: 1 1 490px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; }
.app-board .table .player-list li { min-height: 29px; border: 1px solid #dcb2772e; padding-block: 2px; }
.app-board .table .player-list li.active-player { border-color: #ecb77394; }
.app-board .player-list .player-dot { display: none; }
.app-board .player-name { font-size: .83rem; }
.app-wheel-focus { position: relative; background: radial-gradient(ellipse at center, #383951 0%, #202a43 46%, #141b30 83%); }
.app-wheel-focus .ribbon, .app-wheel-focus .table, .app-wheel-focus .brand, .app-wheel-focus .dial-result,
.app-wheel-focus .top-controls > :not([data-do="sound"], [data-do="cmd-pause"]) { display: none; }
.app-wheel-focus .topbar { position: absolute; z-index: 3; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: auto; min-height: 0; border: 0; }
.app-wheel-focus .icon-button { color: var(--muted); background: #202a406b; }
.app-wheel-focus .play-frame { padding-block: 0; }
.app-wheel-focus .turn-board {
  height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 290px;
  grid-template: "heading" max(73px, 10dvh) "disc" minmax(0, 1fr) "actions" max(54px, 8dvh) / minmax(0, 1fr);
  gap: 0;
}
.app-wheel-focus .turn-dial {
  grid-area: disc; container-type: size; align-self: stretch; position: relative; top: auto;
  height: auto; min-height: 0; grid-template-rows: 1fr; padding: 0;
  background: none; border: 0; box-shadow: none;
}
.app-wheel-focus .turn-dial::before { content: none; }
.app-wheel-focus .turn-dial .wheel-box { width: min(100%, 81dvh); }
@supports (width: 1cqh) {
  .app-wheel-focus .turn-dial .wheel-box { width: min(100cqw, 100cqh); }
}
.app-wheel-focus .turn-work, .app-wheel-focus .wheel-message { display: contents; }
.wheel-heading { grid-area: heading; align-self: center; justify-self: center; padding-inline: 114px; text-align: center; }
.wheel-heading .eyebrow { display: block; font-size: clamp(.8rem, 1.35vw, 1.05rem); overflow-wrap: anywhere; }
.wheel-heading h1 { margin-top: 2px; font-size: clamp(1.7rem, 3.4vw, 3.35rem); line-height: 1.04; text-wrap: balance; }
.is-landed .wheel-heading h1 { color: var(--bright); }
.wheel-controls { grid-area: actions; display: flex; align-items: center; justify-content: center; }
.wheel-controls .button { min-height: 48px; padding: 7px 19px; border-radius: 999px; }
.app-wheel-focus .dial-cue { right: 5%; bottom: 16%; font-size: clamp(1rem, 2.1vw, 1.32rem); padding: 8px 15px; border-radius: 999px; }
.wheel-box { position: relative; width: min(83%, 53vh, 520px); margin-top: 0; display: grid; place-items: center; isolation: isolate; transform-origin: 0 0; }
.wheel-wheel { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.wheel-wheel.is-dragging { cursor: grabbing; }
.wheel-disc { width: 100%; display: block; overflow: visible; filter: drop-shadow(0 11px 19px #101329bf); }
.wheel-spinning .wheel-bulbs { animation: wheel-lights 650ms ease-in-out infinite alternate; }
@keyframes wheel-lights { from { opacity: .66; } to { opacity: 1; } }
#wheel-rotor { transform-origin: 250px 250px; }
.wheel-disc text { fill: #fff4e0; paint-order: stroke; stroke: #131b2c; stroke-width: 1px; font: 700 15px var(--sans); }
.pointer { position: absolute; top: 1%; left: 50%; width: 30px; height: 40px; background: linear-gradient(140deg, #fff0c5, #de9c58 75%); clip-path: polygon(6% 0, 94% 0, 72% 60%, 50% 100%, 28% 60%); transform: translateX(-50%); transform-origin: 50% 10%; z-index: 2; }
.wheel-landed .wheel-sector:not(.is-selected) { opacity: .72; }
.wheel-landed .wheel-sector.is-selected path { stroke: #ffe3a4; stroke-width: 4; }
.wheel-landed .pointer { background: #ffe2a2; animation: pointer-arrive 620ms ease-out both; }
.wheel-landed .wheel-sector.is-selected { animation: sector-arrive 650ms ease-out both; }
@keyframes pointer-arrive { 25% { transform: translateX(-50%) scale(1.24); } }
@keyframes sector-arrive { 30% { filter: brightness(1.54) saturate(1.1) drop-shadow(0 0 7px #ffc674ba); } }
.wheel-hub { position: absolute; display: grid; place-items: center; width: 22%; height: 22%; color: var(--gold); font-size: clamp(1.65rem, 3.5vw, 3.2rem); pointer-events: none; }
.stage-card { display: grid; place-items: center; padding: clamp(20px, 4.4vw, 55px); text-align: center; background: radial-gradient(ellipse at 48% 14%, #343d58, transparent 75%), #1c243c; }
.scene-inner { width: 100%; display: grid; justify-items: center; gap: 12px; }
.scene-emblem { display: grid; place-items: center; width: 70px; height: 70px; color: var(--gold); border: 1px solid #e7b17275; border-radius: 50%; background: #b078502e; margin-bottom: 3px; font-size: 1.9rem; }
.scene-inner h1 { color: var(--ink); font-size: clamp(2.35rem, 4.7vw, 5.3rem); line-height: .99; overflow-wrap: anywhere; text-wrap: balance; }
.scene-text { line-height: 1.44; color: var(--muted); font-size: clamp(1.04rem, 1.7vw, 1.4rem); max-width: 49ch; }
.scene-text p + p { margin-top: 8px; }
.scene-inner .play-actions { justify-content: center; margin-top: 8px; }
.scene-inner .play-actions .primary { min-height: 54px; }
.owner-result { padding: clamp(16px, 2.8vw, 38px); }
.owner-result h1 { font-size: clamp(2rem, 4.3vw, 4.2rem); line-height: 1.06; }
.owner-result .scene-text { width: 100%; max-width: 38rem; }
.owner-list { list-style: none; display: grid; gap: 6px; margin: 4px 0; padding: 0; text-align: left; }
.owner-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45em; border: 1px solid var(--outline); border-radius: 10px; padding: 8px 12px; background: #142037; overflow-wrap: anywhere; }
.owner-list strong { color: var(--bright); }
.owner-list span { color: var(--ink); }
.owner-list:has(li:nth-child(5)) { max-height: clamp(120px, 24dvh, 225px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.owner-result:has(.owner-list li:nth-child(5)) .scene-emblem { display: none; }
.history .owner-list { font-size: 1rem; }
.history details { margin-block-start: .5rem; }
.task-card { padding: clamp(17px, 3.2vw, 38px); }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--outline); }
.task-people { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .86rem; }
.task-people .icon { color: var(--gold); }
.task-title { font-size: clamp(1.7rem, 2.8vw, 2.8rem); line-height: 1.07; margin-top: 16px; color: var(--gold); }
.question { font: 600 clamp(1.65rem, 2.78vw, 2.55rem)/1.18 var(--display); margin-top: 10px; text-wrap: pretty; }
.task-card .subtle { margin-top: 10px; }
.task-card .play-actions { margin-top: 17px; }
.task-heading { padding-bottom: clamp(11px, 1.25vw, 19px); border-bottom: 1px solid var(--outline); }
.task-kicker { color: var(--gold); font: 750 clamp(.94rem, 1.4vw, 1.16rem)/1.28 var(--sans); }
.task-cast { margin-top: 4px; font: 700 clamp(2.1rem, 4.4vw, 4.3rem)/1.04 var(--display); color: var(--ink); letter-spacing: -.025em; overflow-wrap: anywhere; }
.task-cast.cast-team { font-size: clamp(1.85rem, 3.35vw, 3.25rem); }
.cast-link { display: inline-block; vertical-align: .12em; font: 700 .48em/1.1 var(--sans); letter-spacing: .015em; color: var(--gold); }
.task-content > .question { margin-top: 13px; }
.task-direction, .current-contestant, .confirm-cue { font: 720 clamp(1.02rem, 1.62vw, 1.25rem)/1.32 var(--sans); }
.task-direction, .current-contestant { margin-top: 14px; color: var(--bright); }
.task-direction + .play-actions, .task-direction + .choices { margin-top: 7px; }
.task-card[data-task="duel"] [data-do="result-player"], .task-card:has([data-do="cmd-draw"]) [data-do="result-player"] { color: var(--bright); border-color: #edbe769e; min-width: min(100%, 142px); }
.opening-help { color: var(--muted); font-size: .96rem; }
.opening-help summary { min-height: 48px; align-content: center; cursor: pointer; }
.confirm-cue { margin-top: 13px; color: var(--muted); font-size: 1rem; }
.confirm-cue + .action-footer { padding-top: 5px; border: 0; margin-top: 0; }
.transfer-rows:not(:has(li:nth-child(3))) li strong { font-size: clamp(1.4rem, 2.75vw, 2.3rem); line-height: 1.1; }
.transfer-rows:not(:has(li:nth-child(3))) li { padding-block: 10px; }
.reward-hint { display: flex; align-items: flex-start; gap: 10px; width: fit-content; max-width: 100%; margin-top: 12px; padding: 8px 13px; border: 1px solid #e9b77466; border-radius: 11px; color: var(--bright); background: #edbd771a; }
.reward-hint > .icon { margin-top: 2px; }
.reward-hint b, .reward-hint strong { display: block; }
.reward-hint b { color: var(--gold); font-size: .8rem; }
.reward-hint span { display: block; color: var(--muted); font-size: .91rem; }
.gift-action-card { padding: clamp(17px, 3.2vw, 38px); background: radial-gradient(ellipse at 5% 8%, #3b374b, transparent 62%), #1c263c; }
.gift-action-head { animation: action-arrive 320ms cubic-bezier(.18,.75,.24,1) both; }
.gift-action-head h1 { margin: 5px 0 9px; font-size: clamp(2.05rem, 3.8vw, 3.6rem); line-height: 1.02; overflow-wrap: anywhere; text-wrap: balance; }
.gift-action-head p { font-size: clamp(1.02rem, 1.6vw, 1.26rem); color: var(--muted); max-width: 55ch; }
.gift-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 184px), 1fr)); gap: 9px; margin-top: 17px; }
.gift-group { margin-top: 12px; }
.gift-group h2 { font: 750 clamp(1rem, 2vw, 1.28rem) var(--sans); color: var(--bright); }
.gift-group .gift-choices { margin-top: 6px; }
.turn-work .gift-group .gift-choices { grid-template-columns: repeat(auto-fit, minmax(min(100%, 127px), 1fr)); }
.physical-instruction { margin-top: 10px; font-size: clamp(1.07rem, 2vw, 1.37rem); font-weight: 650; color: var(--ink); }
.say-answer { margin-top: 13px; color: var(--ink); font-weight: 650; }
.gift-choices:has(> :only-child) { grid-template-columns: minmax(0, 390px); }
.gift-option { width: 100%; min-height: 64px; justify-content: flex-start; padding: 8px 11px; text-align: left; line-height: 1.2; animation: action-arrive 320ms cubic-bezier(.18,.75,.24,1) 50ms both; }
.gift-option:nth-child(3n + 2) { animation-delay: 90ms; }
.gift-option:nth-child(3n) { animation-delay: 130ms; }
.gift-option:active { scale: .98; }
.gift-option.secondary[data-kind="roof"] { background: #473046; border-color: #cd879b75; }
.gift-option.secondary[data-kind="roof"]:hover { background: #563a50; border-color: #edb3c4; }
.gift-option.secondary:is([data-kind="swap"],[data-kind="voluntary"],[data-kind="full"]) { border-color: #8eb9db87; }
.gift-option.secondary .icon { color: var(--gold); }
.gift-option small { display: block; margin-top: 4px; font-size: .8rem; font-weight: 500; }
.gift-option.secondary small { color: var(--muted); }
.gift-option strong, .transfer-rows strong { overflow-wrap: anywhere; }
.pair-choice { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-top: 16px; }
.pair-choice .field { flex: 1 1 240px; }
.transfer-rows { display: grid; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.transfer-rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, auto) minmax(0, 1fr); align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid #deae705e; border-radius: 10px; background: #304059; animation: action-arrive 360ms ease-out 55ms both; }
.transfer-rows li:nth-child(even) { animation-delay: 110ms; }
.transfer-rows:has(li:nth-child(5)) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 244px), 1fr)); }
.transfer-rows span { display: grid; align-content: center; }
.transfer-rows small { color: var(--muted); font-size: .81rem; }
.transfer-rows strong { font-size: clamp(1.01rem, 1.8vw, 1.22rem); }
.transfer-arrow { color: var(--gold); justify-items: center; font-weight: 700; text-align: center; }
.transfer-arrow small { color: var(--bright); }
.transfer-path { width: 64px; height: 27px; position: relative; justify-items: center; }
.transfer-rows .transfer-pulse { position: absolute; left: 0; top: 6px; width: 17px; height: 16px; color: var(--bright); filter: drop-shadow(0 0 4px #f4c674); opacity: 0; animation: pakje-doorgeven 800ms ease-out 220ms 2; }
.transfer-pulse .icon { width: 16px; height: 16px; }
.transfer-rows li:nth-child(even) .transfer-pulse { animation-delay: 440ms; }
.transfer-rows li > span:last-child { text-align: right; }
.joker-instruction { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 14px; padding: 7px 9px; border-left: 3px solid var(--gold); background: #e6b7751a; border-radius: 0 8px 8px 0; }
.joker-instruction p { color: var(--bright); font-weight: 650; }
.action-footer { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--outline); }
.gift-result .scene-emblem { animation: gift-confirm 540ms cubic-bezier(.13,.75,.25,1) both; }
.gift-result h1, .no-gift-result h1, .answer-box, .secret-box strong { animation: action-arrive 280ms ease-out both; }
@keyframes action-arrive { from { opacity: .45; transform: translateY(9px); } }
@keyframes gift-confirm {
  0% { transform: scale(.86); }
  48% { transform: scale(1.12); box-shadow: 0 0 0 10px #ffd79a35; }
  100% { transform: scale(1); box-shadow: 0 0 0 20px #ffd79a00; }
}
@keyframes pakje-doorgeven {
  0% { opacity: 0; transform: translateX(0); }
  26%, 64% { opacity: 1; }
  100% { opacity: 0; transform: translateX(47px); }
}
.task-support { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: start; gap: 2px 9px; }
.task-support details { color: var(--muted); }
.task-support summary { display: list-item; min-height: 48px; align-content: center; padding-inline: 3px; }
.task-support details p { max-width: 60ch; margin: 0 0 8px 4px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.choice { text-align: left; justify-content: flex-start; min-height: 52px; padding: 8px 12px; background: #2d3a55; border-color: var(--outline); }
.choice-letter { display: grid; place-items: center; min-width: 26px; height: 26px; color: var(--bright); border-radius: 5px; background: #162037; }
.answer-box, .secret-box, .timer-box, .battle-score { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; background: #2b3850; border: 1px solid #e1af6d59; border-radius: 11px; margin-top: 12px; padding: 9px 12px; }
.answer-box { display: block; }
.answer-box strong, .secret-box strong { color: var(--bright); font-size: clamp(1.2rem, 2.5vw, 2rem); }
.answer-box p { color: var(--muted); }
.secret-box { justify-content: space-between; }
.timer-box { justify-content: space-between; padding-block: 3px; }
.timer-value, .timer-buttons { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.timer-value { color: var(--gold); font-weight: 750; font-variant-numeric: tabular-nums; }
.timer-value output { font-size: 1.23rem; }
.timer-value output.expired { color: #ffb5a1; }
.timer-buttons .button { padding-inline: 9px; }
.battle-score { justify-content: flex-start; }
.battle-score span { min-width: 90px; color: var(--muted); }
.battle-score b { margin-left: 4px; color: var(--bright); }
.feedback { color: var(--bright); font-weight: 700; margin-top: 9px; }
.word-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.word-grid span { background: #34425a; padding: 4px 10px; border: 1px solid var(--outline); border-radius: 7px; }
.finale-stage { display: grid; position: relative; isolation: isolate; align-items: end; background: #202a44; }
.finale-stage img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 39%; }
.finale-stage::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 34%, #151b2be8 72%); }
.finale-copy { padding: clamp(18px, 4.25vw, 48px); }
.finale-copy h1 { font-size: clamp(2.35rem, 5vw, 5.4rem); line-height: .99; margin-top: 6px; text-wrap: balance; }
.finale-copy p { margin-block: 10px 15px; max-width: 44ch; color: var(--ink); font-size: 1.07rem; }
.phase-finale .play-card { border-color: #ecbd7775; }
.end-stage {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, #081329db 0%, #171a32cb 65%, #23182cda), url('./finale.svg') center / cover;
}
.end-stage .feestlucht { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.end-stage .scene-inner { position: relative; z-index: 1; text-shadow: 0 2px 9px #080e25; }
.end-stage .scene-emblem { color: #ffe4a6; background: #2c2944db; }
.end-stage .scene-text p { color: #fff3de; }
.end-stage .recap span, .end-stage .play-actions .secondary { background-color: #19243de8; }
.end-stage .play-actions { max-width: 680px; }
.end-stage .play-actions button { min-height: 44px; }
.recap { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; margin-top: 18px; }
.recap span { background: #15223b7c; border: 1px solid var(--outline); border-radius: 10px; padding: 7px 12px; font-size: .85rem; }
.recap b { display: block; color: var(--bright); font: 1.85rem/1.1 var(--display); }
.center-page { display: grid; place-items: center; padding: 24px; min-height: 100dvh; text-align: center; }
.feature { padding: 24px; max-width: 550px; }
.feature h1 { font-size: 2.2rem; line-height: 1.1; }
.feature p { margin-block: 12px; color: var(--muted); }
dialog { width: min(740px, calc(100% - 32px)); max-height: min(82dvh, 790px); padding: 0; overflow: hidden; border: 1px solid #edbd7785; border-radius: 19px; background: #1c253d; color: var(--ink); box-shadow: 0 32px 95px #080c20d1; }
dialog::backdrop { background: #0c1222c9; }
.dialog-frame { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(82dvh, 790px); }
.dialog-header, .dialog-footer { display: flex; align-items: center; gap: 10px; padding: 12px clamp(13px, 2.3vw, 27px); background: #26324b; }
.dialog-header { justify-content: space-between; border-bottom: 1px solid var(--outline); }
.dialog-header h2 { font-size: clamp(1.45rem, 3.4vw, 2.2rem); line-height: 1.06; }
.dialog-footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--outline); }
.dialog-body { padding: 16px clamp(13px, 2.3vw, 27px); overflow: auto; overscroll-behavior: contain; scroll-padding: 13px; }
.dialog-body p { color: var(--muted); margin-bottom: 10px; }
.dialog-body .error { color: #ffe3d8; }
.rules { margin: 0 0 15px; padding-inline-start: 26px; }
.rules li { margin-bottom: 11px; }
.seat-row { display: grid; grid-template-columns: 23px minmax(70px, 1.16fr) minmax(90px, .9fr) auto; gap: 7px; align-items: center; padding-block: 7px; border-bottom: 1px solid var(--outline); }
.seat-number { color: var(--gold); text-align: center; }
.seat-actions { display: flex; gap: 5px; }
.settings-group { margin-bottom: 17px; padding-bottom: 12px; border-bottom: 1px solid var(--outline); }
.settings-group:last-child { border: 0; margin-bottom: 0; padding-bottom: 0; }
.settings-group h3 { font: 1.4rem var(--display); margin-bottom: 6px; }
.settings-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.import-label { display: block; }
.import-label input { margin-top: 5px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 9px 0; border-bottom: 1px solid var(--outline); }
.history time { color: var(--gold); padding-right: 9px; }
@media (orientation: landscape) and (min-width: 900px) and (max-height: 960px) {
  .hero-art { max-height: min(53vh, 690px); }
  .wheel-box { width: min(78%, 51vh, 525px); }
}
@media (orientation: landscape) and (min-width: 840px) and (max-height: 740px) {
  .topbar { min-height: 63px; }
  .ribbon { min-height: 40px; margin-bottom: 8px; }
  .play-frame { padding-top: 8px; }
  .play-card { min-height: max(425px, calc(100dvh - 132px)); }
  .phase-item { min-height: 70px; }
  .site-footer { min-height: 40px; }
  .hero h1 { font-size: clamp(3rem, 7.5vw, 5.8rem); }
  .wheel-box { width: min(66%, 50vh); }
  .player-list { gap: 2px; }
  .player-list li { min-height: 28px; padding-block: 2px; }
}
@media (max-width: 890px) {
  .hero { grid-template-columns: minmax(270px, 1fr) minmax(0, 1fr); gap: 22px; }
  .hero h1 { font-size: clamp(3.3rem, 8vw, 5.2rem); }
  .phase-item { gap: 8px; }
}
@media (max-width: 680px) {
  .turn-board { grid-template-columns: 1fr; }
  .turn-dial { position: relative; top: auto; height: auto; grid-template-rows: auto 40px; }
  .turn-dial .wheel-box { width: min(90%, 35vh, 330px); }
  .wheel-heading { padding-inline: 4px; }
  .dial-cue { right: 1%; bottom: 12%; }
  .app-board .table .player-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-board .player-name { min-width: 48px; }
  .app { padding-inline: max(14px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .topbar { min-height: 62px; }
  .top-controls { gap: 4px; }
  .brand { min-width: 0; font-size: .92rem; gap: 6px; }
  .brand-mark { height: 35px; width: 35px; border-radius: 9px; }
  .brand small { font-size: .56rem; }
  .hero, .setup-layout { grid-template-columns: 1fr; }
  .hero-copy { padding: 6px 3px 0; }
  .hero h1 { font-size: clamp(3.65rem, 16vw, 6.25rem); }
  .hero-text { margin-top: 15px; }
  .hero-actions { margin-top: 15px; }
  .hero-art { max-height: 383px; }
  .phase-strip { grid-template-columns: 1fr; gap: 7px; margin-top: 13px; }
  .phase-item { min-height: 63px; padding-block: 9px; }
  .site-footer { font-size: .74rem; }
  .setup-art { display: none; }
  .setup-copy h1 { font-size: 3.25rem; }
  .settings-line { align-items: start; }
  .play-grid { display: grid; grid-template-columns: 1fr; }
  .play-card { min-height: 385px; }
  .table { padding: 12px; }
  .player-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ribbon { gap: 3px; }
  .ribbon-step { padding: 3px 5px; font-size: .73rem; }
  .ribbon-step.is-current { padding-inline: 6px; }
  .ribbon-divider { max-width: 13px; }
  .wheel-box { width: min(92%, 58vh); }
  .task-head { align-items: start; flex-wrap: wrap; }
  .scene-emblem { height: 57px; width: 57px; }
  .dialog-frame, dialog { max-height: 86dvh; }
  .seat-row { grid-template-columns: 18px minmax(94px, 1fr) minmax(100px, 1fr); }
  .seat-actions { grid-column: 2 / -1; }
  .seat-actions .icon-button { flex: 1; }
}
@media (max-width: 380px) {
  .brand > span:last-child { display: none; }
  .choices, .count-editor { grid-template-columns: 1fr; }
}
@media (orientation: portrait) {
  .app-wheel-focus .turn-board {
    grid-template-rows: auto min(95vw, 64dvh) auto;
    gap: min(2.4dvh, 21px); align-content: center;
  }
  .app-wheel-focus .wheel-heading { padding-inline: 8px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .app-wheel-focus .turn-board { grid-template-rows: 48px minmax(0, 1fr) 48px; }
  .wheel-heading { padding-inline: 105px; }
  .wheel-heading h1 { font-size: 1.45rem; }
  .wheel-heading .eyebrow { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
