/* Shared colours keep both themes in the same editorial identity. */
:root{--surface:#ebeee4;--soft-ink:#526d2a;--hover:#e8ebdf}
:root[data-theme=dark]{--paper:#171b18;--white:#202620;--ink:#f0f1e8;--muted:#a6afa0;--line:#353e34;--surface:#252e26;--hover:#303a30;--orange:#ff805b;--soft-ink:#b9d888;color-scheme:dark}
body{transition:background-color .25s,color .25s;background:var(--paper)}
.icon-button{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);transition:background .2s,transform .2s;flex:none}
.icon-button:hover{background:var(--hover);transform:translateY(-1px)}
.icon-button svg{width:20px;height:20px}.sun-icon{display:none}[data-theme=dark] .sun-icon{display:block}[data-theme=dark] .moon-icon{display:none}
body:not(.is-playing) .site-header nav,.site-header nav{gap:8px}body:not(.is-playing) .nav-button svg{display:block}.nav-button{min-height:40px}.nav-button span{white-space:nowrap}
body.is-playing #leaderboard-open{display:none}.site-header .nav-button{padding-right:13px}
[data-theme=dark] .universe-card{color:#1b1d19;filter:saturate(.75);box-shadow:none}[data-theme=dark] .universe-card:hover{filter:saturate(1)}
[data-theme=dark] .topic-card,[data-theme=dark] .mode-card{background:var(--white);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .mode-card.selected{background:var(--accent);color:#1b1d19;border-color:var(--accent)}[data-theme=dark] .mode-card.selected small{color:#3e4838}
[data-theme=dark] .topic-card:hover{background:var(--surface);border-color:#738364}[data-theme=dark] .choice-check{border-color:#798471}
[data-theme=dark] .mode-card.selected .choice-check{border-color:#1b1d19;background:#1b1d19}
[data-theme=dark] .secondary,[data-theme=dark] select,[data-theme=dark] .stats-grid>div{background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .primary{color:#1b1d19}[data-theme=dark] .primary:disabled{background:#333e31;color:#9ba895}
[data-theme=dark] .button.secondary:hover{background:var(--hover)}[data-theme=dark] .setup-steps button[aria-current=step] b{color:var(--orange)}
[data-theme=dark] .setup-steps button:disabled{color:#84907e}[data-theme=dark] .setup-steps .step-line:after{color:#64705e}
[data-theme=dark] .launch-panel p,[data-theme=dark] .mode-card small{color:var(--muted)}
[data-theme=dark] dialog .close{color:var(--muted)}[data-theme=dark] .copy-area{background:var(--surface);color:var(--ink);border-color:var(--line)}
.setup-heading{position:relative}.join-link{display:flex;align-items:center;gap:9px;background:none;border:0;padding:10px 0;font-size:14px;color:var(--muted);position:absolute;right:0;bottom:-2px;min-height:44px}.join-link:hover{color:var(--ink)}.join-link span{transition:transform .25s var(--ease)}.join-link:hover span{transform:translate(2px,-2px)}
.mode-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.mode-card{min-height:227px;padding:24px 20px}.mode-card>strong{font-size:22px}.mode-symbol svg{width:45px;height:45px;stroke-width:1.6}.mode-card>span:not(.mode-symbol){font-size:14px}.mode-card small{font-size:12px}
/* A single open canvas, without the old surrounding frame. */
.play-board{border:0;border-radius:0;background:transparent;overflow:visible}.game-toolbar{min-height:54px;padding:0 0 10px;gap:16px}.leave-button{display:flex;align-items:center;gap:4px;border:0;min-height:40px;padding:8px 10px 8px 0;background:none;color:var(--muted);font-size:12px}.leave-button svg{width:18px;height:18px}.leave-button:hover{background:none;color:var(--ink)}
.game-context{gap:9px;flex:1}.game-context>span{font-size:12px;font-weight:600;border:0;padding:0;color:var(--ink)}.game-context>strong{font-size:13px}.game-context>strong:before{content:'/';margin-right:9px;color:var(--muted)}.game-mode{font-size:12px}.timer{min-width:58px;padding-left:18px;border-left:1px solid var(--line)}.timer>span{font-size:26px;font-weight:600}.timer>small{font-size:12px}.game-score{margin-left:0;min-width:112px;justify-content:end}.game-score>span{font-size:12px}.game-score>strong{font-size:27px}.game-score>small{font-size:11px}
.question-area{padding:17px 0 21px;justify-content:start;gap:19px;min-height:88px}.question-copy{max-width:1000px}.question-copy h1{font-size:clamp(22px,2vw,29px);letter-spacing:-.65px;font-weight:600;line-height:1.2}.question-index{align-self:center;font-size:12px;color:var(--muted)}.question-index>span:first-child{font-size:23px}.timer-track{height:2px;background:var(--line);bottom:7px}.map-panel{margin:0;border-radius:10px;box-shadow:0 1px 0 #00000010}.action-bar{padding:14px 0 0;min-height:70px}.placement-help{color:var(--muted)}.placement-help p{font-size:14px}.feedback #answer-points,.review-points{color:var(--soft-ink)}.action-bar .primary{min-width:190px;min-height:46px;font-size:14px}.results-area{padding:15px 0 24px}.result-actions{padding:15px 0 0}
.preference-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 0;border-bottom:1px solid var(--line)}.preference-row strong{font-weight:500;font-size:15px;display:block}.preference-row small{font-size:12px;color:var(--muted);display:block;margin-top:5px}.sound-switch{position:relative;width:46px;height:27px;border:0;border-radius:20px;background:var(--line);flex:none;padding:3px;transition:background .2s}.sound-switch span{display:block;width:21px;height:21px;border-radius:50%;background:var(--paper);transition:transform .22s var(--ease)}.sound-switch[aria-pressed=true]{background:var(--orange)}.sound-switch[aria-pressed=true] span{transform:translateX(19px);background:#1b1d19}.settings-scores{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:48px;background:none;border:0;border-bottom:1px solid var(--line);font-size:14px;padding:10px 0}.settings-scores:hover{color:var(--orange)}#help-dialog h3{font-size:15px;margin:24px 0 10px}#help-dialog ol{margin-top:0}#help-dialog ol li,#help-dialog p{font-size:14px}
.duel-opponent{font-size:13px;margin-left:auto;color:var(--muted);white-space:nowrap}.duel-opponent b{color:var(--ink);margin-left:8px}.live-status{display:block!important;font-size:12px;color:var(--muted);margin:8px 0 0;line-height:1.25}.live-status[hidden]{display:none!important}.game-screen[data-live=true] .game-mode{display:none}.game-screen[data-live=true] .question-area{min-height:98px}.game-screen[data-live=true] .game-score{min-width:70px}.game-screen[data-live=true] .game-score>small{display:none}
.universe-card,.topic-card,.mode-card{transition:transform .3s var(--ease),background .25s,border-color .25s,box-shadow .3s var(--ease)}.topic-card:hover{transform:translateY(-2px)}.mode-card:hover{transform:translateY(-2px)}.button{transition:transform .25s var(--ease),background .2s,box-shadow .2s}.button.primary:hover:not(:disabled){box-shadow:0 4px 14px #ff63351c}.button:active:not(:disabled){transform:scale(.97)}.question-index>span:first-child,.game-score>strong{font-variant-numeric:tabular-nums}.feedback{animation:feedback-in .35s var(--ease) both}@keyframes feedback-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1050px){.mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mode-card{min-height:205px}.game-toolbar{gap:12px}.game-score{min-width:100px}.game-mode{display:none}}
@media(max-width:700px){.site-header,.site-header nav,body:not(.is-playing) .site-header nav{gap:4px}.site-header .nav-button{padding:0;width:36px;min-width:36px;justify-content:center}.site-header .nav-button span{display:none}.site-header .nav-button svg,body:not(.is-playing) .nav-button svg{display:block;width:19px;height:19px}.icon-button{width:36px;height:40px}.icon-button svg{width:18px;height:18px}.brand-wordmark{font-size:24px}.brand-emblem{width:28px;height:32px}.join-link{position:static;margin-top:8px;padding:4px 0;font-size:13px;min-height:32px}.mode-grid{grid-template-columns:1fr}.mode-card{min-height:110px;padding:19px 18px}.mode-card>strong{font-size:22px}.mode-card>span:not(.mode-symbol){font-size:14px}.mode-card small{font-size:12px}.mode-symbol svg{width:39px;height:39px}.game-toolbar{min-height:49px;padding-bottom:7px;gap:8px}.leave-button{min-width:28px;padding:5px 5px 5px 0}.leave-button span{display:none}.game-context{gap:3px;min-width:0;flex:1}.game-context>span{font-size:10px}.game-context>strong{font-size:11px;line-height:1.1}.game-context>strong:before{display:none}.timer{padding-left:0;border:0;min-width:43px;gap:2px}.timer>span{font-size:24px}.timer>small{font-size:10px}.game-score{min-width:44px;margin-left:auto;gap:0}.game-score>span,.game-score>small{display:none}.game-score>strong{font-size:24px}.question-area{min-height:84px;padding:13px 0 17px;gap:12px}.question-index{align-self:start;margin-top:2px}.question-index>span:first-child{font-size:20px}.question-copy h1{font-size:20px;letter-spacing:-.4px}.map-panel{margin:0;border-radius:8px}.action-bar{padding:11px 2px 0;min-height:67px;gap:12px}.action-bar .primary{min-width:0;min-height:44px;font-size:13px;max-width:48%;padding:11px 13px}.placement-help p{font-size:12px}.feedback #answer-name{font-size:15px}.feedback #answer-points{font-size:16px}.feedback .text-button{font-size:11px}.results-area{padding:14px 0 18px}.result-actions{padding:11px 0 0}.duel-opponent{font-size:10px;max-width:85px;overflow:hidden;text-overflow:ellipsis;line-height:1.3;display:flex;flex-direction:column;text-align:right}.duel-opponent b{font-size:16px;margin:0}.game-screen[data-live=true] .game-score{min-width:35px}.game-screen[data-live=true] .game-context{max-width:100px}.game-screen[data-live=true] .question-area{min-height:98px}.live-status{font-size:11px;margin-top:6px}}
@media(max-width:360px){.brand-wordmark{font-size:22px}.brand-emblem{width:25px;height:29px}.brand{gap:6px}.icon-button,.site-header .nav-button{width:34px;min-width:34px}.question-copy h1{font-size:18px}.game-toolbar{gap:7px}.timer{min-width:40px}.game-context>strong{max-width:115px}.duel-opponent{max-width:65px}.game-screen[data-live=true] .game-context{max-width:86px}}
@media(prefers-reduced-motion:reduce){.feedback{animation:none}.topic-card:hover,.mode-card:hover,.icon-button:hover,.join-link:hover span{transform:none}}

[data-theme=dark] .timer.urgent{color:var(--orange)}
@media(max-width:360px){.social-code-box{flex-wrap:wrap}.social-code-box>button{width:100%}}
@media(max-width:700px){.game-screen[data-live=true] .game-score>span{display:block;font-size:9px}.game-screen[data-live=true] .game-score{flex-direction:column;align-items:flex-end}}

/* A quiet way back replaces the numbered setup navigation. */
.setup-heading .setup-back{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:6px 0;background:none;border:0;border-radius:0;cursor:pointer}
.setup-back:before{content:'←';font-size:18px;font-weight:400;color:var(--muted);transition:transform .2s var(--ease)}
.setup-back:hover:before{transform:translateX(-3px)}

/* The final duel has breathing room; the map becomes an optional detail. */
body.is-duel-result{height:auto;min-height:100dvh;overflow:auto}
body.is-duel-result main{display:block;flex:none;max-width:1280px;padding-bottom:40px}
body.is-duel-result #leaderboard-open{display:flex}
body.is-duel-result .game-screen{display:block}
body.is-duel-result .game-toolbar{margin-bottom:12px}
body.is-duel-result .play-board{display:flex;flex-direction:column;gap:0}
body.is-duel-result #duel-recap{order:1}
body.is-duel-result #result-actions{order:2;display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:12px;padding:25px 0 4px;width:100%;max-width:1120px;margin:0 auto}
body.is-duel-result #replay{order:1}
body.is-duel-result #share{order:2}
body.is-duel-result #review-open{order:3;margin-left:auto}
body.is-duel-result #recap-map-toggle{order:4;margin-left:12px}
body.is-duel-result #result-actions .text-button{min-height:44px;font-size:13px}
body.is-duel-result #result-actions .button{min-height:48px;font-size:14px}
body.is-duel-result #share-status{order:5;flex-basis:100%;text-align:left}
body.is-duel-result .map-panel{order:3;height:clamp(300px,45vh,460px);flex:none;width:100%;max-width:1120px;margin:26px auto 0}
@media(max-width:700px){
 body.is-duel-result main{padding:0 18px 30px}
 body.is-duel-result .game-toolbar{margin-bottom:2px}
 body.is-duel-result .game-screen[data-live=true] .game-context{max-width:none;flex-direction:row;gap:8px}
 body.is-duel-result .game-context>strong:before{display:inline;margin-right:8px}
 body.is-duel-result #result-actions{display:grid;align-items:stretch;grid-template-columns:1fr 1fr;gap:8px;padding-top:22px}
 body.is-duel-result #result-actions .button{font-size:12px;padding:12px 8px;gap:6px}
 body.is-duel-result #result-actions .button svg{width:17px;height:17px}
 body.is-duel-result #review-open{grid-row:2;grid-column:1;margin:0;text-align:left}
 body.is-duel-result #recap-map-toggle{grid-row:2;grid-column:2;margin:0;text-align:right}
 body.is-duel-result #share-status{grid-column:1/-1}
 body.is-duel-result .map-panel{height:340px;margin-top:18px}
}
@media(prefers-reduced-motion:reduce){.setup-back:hover:before{transform:none}}

/* Two additional universes share the same simple, recognisable card grammar. */
.cinema{--tint:#f1d581}.nature{--tint:#9cd3ba}
.map-hint-touch{display:none}
@media(pointer:coarse){.map-hint-desktop{display:none}.map-hint-touch{display:inline}}
@media(min-width:1100px){.universe-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.universe-card{padding:25px 24px 22px;min-height:190px}.universe-word{font-size:clamp(28px,2.55vw,38px);letter-spacing:-1.5px}.universe-card>svg{width:30px;height:30px}}
@media(max-width:700px){.map-hint-desktop{display:none}.map-hint-touch{display:inline}}
