/* Knowlinks UI system: 4px rhythm, architectural surfaces, one motion curve. */
:root{
 --ds-ink:#28263f;--ds-night:#151327;--ds-plum:#62558c;--ds-orchid:#b5a2df;--ds-peach:#f0b79f;--ds-amber:#edc264;--ds-mint:#85d3c3;--ds-ivory:#fff4e3;
 --ds-text:#f7f0e9;--ds-muted:#c5c4d4;--ds-border:#d5c2e044;--ds-surface:linear-gradient(145deg,#343147f5,#242c3dfa);
 --ds-dawn:linear-gradient(135deg,#f0b79f,#f6d79f 55%,#ece8be);--ds-aurora:linear-gradient(140deg,#62587d,#9281a5 48%,#a9d2c6);
 --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;
 --radius-control:16px;--radius-card:28px;--radius-pill:999px;
 --ds-shadow:0 8px 0 #070c1c55,0 24px 64px #03051733;--ds-shadow-small:0 4px 0 #080d1c44;
 --motion-ease:cubic-bezier(.65,0,.35,1);--ds-motion:700ms;--ds-crossfade:1200ms;
 --sans:Inter,system-ui,sans-serif;--serif:Kurale,Georgia,serif;
 --action-radius:var(--radius-control);--action-border:var(--ds-border);--action-text:var(--ds-text);--action-fill:#202c3c;
 --parchment-paper:#f3e8cf;--parchment-light:#fff8e7;--parchment-edge:#d2b988;--parchment-ink:#332e27;--parchment-muted:#675e4e;--parchment-line:#b7a17a;
 --parchment-option:#fff8e780;--parchment-hover:#fff8e7;--parchment-correct:#dce9cf;--parchment-success:#34572e;--parchment-wrong:#f1d9cc;--parchment-error:#87442f;
 --parchment-fill:linear-gradient(90deg,var(--parchment-edge),var(--parchment-paper) 4%,var(--parchment-light) 48%,var(--parchment-paper) 96%,var(--parchment-edge));
 --parchment-roll:linear-gradient(180deg,var(--parchment-edge),var(--parchment-light) 35%,var(--parchment-paper) 62%,var(--parchment-edge));
 --parchment-shadow:0 12px 36px #070c1c55;--parchment-fold-shadow:0 2px 4px #332e2726;
}
:where(button,input,select){font-family:var(--sans)}
/* Outgoing guide rings follow the existing next-action and suggested-window states. */
:root{--next-action-ring:var(--ds-amber);--next-action-pulse:2.8s}
:is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton){position:relative}
:is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#scene[data-phase=home]:not([data-onboarding=first-topic]) #startButton):not(:disabled):not([hidden]){overflow:visible}
:is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#scene[data-phase=home]:not([data-onboarding=first-topic]) #startButton):not(:disabled):not([hidden])::before,
:is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#scene[data-phase=home]:not([data-onboarding=first-topic]) #startButton):not(:disabled):not([hidden])::after{
 content:'';position:absolute;inset:-2px;border:1px solid var(--next-action-ring);border-radius:inherit;pointer-events:none;opacity:0;animation:next-action-outgoing var(--next-action-pulse) ease-out infinite;
}
:is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#scene[data-phase=home]:not([data-onboarding=first-topic]) #startButton):not(:disabled):not([hidden])::after{animation-delay:1.4s}
#scene .destination.suggested:not(.build-slot):not(:disabled)::after,
#scene[data-phase=home][data-onboarding=first-topic] .destination[data-floor="1"][data-slot="1"]:not(:disabled)::after{
 content:'';position:absolute;inset:5px;border:1px solid var(--next-action-ring);border-radius:50%;pointer-events:none;opacity:0;animation:next-action-outgoing var(--next-action-pulse) ease-out infinite;
}
@keyframes next-action-outgoing{0%{outline-offset:0;opacity:0;translate:0 0}12%{opacity:.75}85%,100%{inset:-14px;opacity:0}}
@media(prefers-reduced-motion:reduce){
 :is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#startButton,.destination)::before,
 :is(.welcome-next,.film-next,.tower-welcome>.ds-primary,.player-setup footer>.main-button,#confirmStorey,.editor-step-next,#nextButton.main-button,#retryAnswer,#nextTowerButton,#replayButton,#startButton,.destination)::after{animation:none!important}
}
.tower-welcome{position:fixed;inset:0;margin:auto;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;padding:28px;border:1px solid var(--ds-border);border-radius:var(--radius-control);background:var(--ds-surface);color:var(--ds-text);box-shadow:var(--ds-shadow)}
.tower-welcome::backdrop{background:var(--ds-night);opacity:.7}
.tower-welcome h2{margin:12px 0 20px;font:400 32px/1.2 var(--serif);letter-spacing:0;color:var(--ds-ivory)}
.tower-welcome>p:not(.ds-eyebrow){margin:0 0 16px;font:400 15px/1.65 var(--sans);letter-spacing:0;color:var(--ds-muted)}
.tower-welcome>button{width:100%;margin-top:8px}
:where(button,a,input,select,summary):focus-visible{outline:2px solid var(--ds-mint);outline-offset:4px;box-shadow:0 0 0 6px #9fd9ce18}
:where(button){-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.ds-eyebrow{font:500 10px/1.5 var(--sans);letter-spacing:.18em;text-transform:uppercase;color:var(--ds-peach)}
:is(.ds-primary,.ds-secondary,.login-methods button){min-height:56px;padding:var(--space-4) var(--space-6);border-radius:var(--radius-control);font:600 14px/1.5 var(--sans);cursor:pointer;transition:transform var(--ds-motion) var(--motion-ease),box-shadow var(--ds-motion) var(--motion-ease),background-color var(--ds-motion) var(--motion-ease)}
.ds-primary{background:var(--ds-dawn);color:var(--ds-ink);border:1px solid #fff0d2bb;box-shadow:var(--ds-shadow-small)}
.ds-secondary{background:#e7dce209;border:1px solid #ead9ed55;color:var(--ds-text)}
.ds-text-button{min-height:48px;border:0;background:transparent;color:var(--ds-muted);font:500 13px/1.5 var(--sans);cursor:pointer;padding:var(--space-3)}
@media(hover:hover){:is(.ds-primary,.ds-secondary):hover:not(:disabled){transform:translateY(-2px);box-shadow:0 6px 0 #080d1c55,0 12px 24px #cf6de014}.ds-text-button:hover{color:var(--ds-peach)}}
:where(button):disabled{cursor:default}
/* Shared game controls. Canvas art and player-selected skies keep their colours. */
:is(.panel,.sound-panel,.knowling-profile,.tower-editor){background:var(--ds-surface);border-color:var(--ds-border);box-shadow:var(--ds-shadow);border-radius:var(--radius-card)}
#scene .main-button,.film-actions .film-next,.player-setup footer .main-button{
 min-height:56px;border-radius:var(--radius-control);border:1px solid #fff2d0aa;background:var(--ds-dawn);color:var(--ds-ink);box-shadow:var(--ds-shadow-small);padding:var(--space-4) var(--space-6);font:600 14px/1.5 var(--sans);gap:var(--space-6);filter:none;
 transition:transform var(--ds-motion) var(--motion-ease),box-shadow var(--ds-motion) var(--motion-ease),filter var(--ds-motion) var(--motion-ease);
}
#scene .main-button span{font-size:22px}
:is(.home-button,.home-explore,.tower-view,.film-back,.setup-header button,.player-setup footer>button:not(.main-button)){
 min-height:48px;padding:var(--space-3) var(--space-5);border:1px solid var(--ds-border);border-radius:var(--radius-control);background:#1e2a3beF;color:var(--ds-text);font:500 13px/1.5 var(--sans);box-shadow:var(--ds-shadow-small);
}
.question-panel{padding:var(--space-8);border-radius:var(--radius-card)}
.question-panel h2{font:400 clamp(24px,3vw,34px)/1.35 var(--serif);letter-spacing:0;margin-bottom:var(--space-6);color:var(--ds-ivory)}
.question-meta{font-size:10px;line-height:1.5;letter-spacing:.08em;margin-bottom:var(--space-4);padding-right:var(--space-12);flex-wrap:wrap;gap:var(--space-2)}
.question-meta span+span{font-size:10px;text-align:left}
.options{gap:var(--space-3)}
.option{border-radius:var(--radius-control);min-height:60px;padding:var(--space-4);gap:var(--space-3);font:500 14px/1.5 var(--sans);border:1px solid #c6d7df33;background:#b7cbd607}
.option.correct{background:#9fd9ce22;border-color:#9fd9ceaa}.option.incorrect{background:#eaa7b41c;border-color:#edbac177}
.option-letter{font-size:10px;color:var(--ds-mint)}
.question-close,.profile-close{width:44px;height:44px;min-height:44px;border-radius:50%;box-shadow:none}
.feedback{margin-top:var(--space-6);padding-top:var(--space-5)}
.feedback p,.question-panel #potionStatus{font-size:13px;line-height:1.6}
.knowling-profile{padding:var(--space-8);width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px)}
.profile-account{margin:var(--space-8) 0;padding-top:var(--space-6);border-top:1px solid var(--ds-border)}
.profile-account button{display:block;margin:var(--space-4) 0;min-height:48px;padding:var(--space-3) var(--space-5);border:1px solid var(--ds-border);border-radius:var(--radius-control);background:#ead8eb09;color:var(--ds-text)}
.profile-account small{display:block;color:var(--ds-muted);font-size:12px;line-height:1.6}
#scene #sceneMessages :is(#homeNotice,#journeyHint,.narrator-caption,#milestoneNotice),#campaignGoal{border-radius:var(--radius-control);padding:var(--space-3) var(--space-4);border-color:var(--ds-border);background:var(--ds-surface);box-shadow:0 4px 20px #05051b1a}
#campaignGoal{background:linear-gradient(120deg,#37265ae8,#17293bef)}
#sceneMessages{gap:var(--space-2)}
.campaign-lights{gap:var(--space-3)}
.campaign-lights i{width:6px;height:6px}
.player-setup{border-color:var(--ds-border);border-radius:var(--radius-card);padding:var(--space-8);max-height:calc(100dvh - 32px);overflow:auto}
.player-setup h1{font:400 clamp(28px,4vw,40px)/1.25 var(--serif);letter-spacing:0}
.player-setup .setup-choice:not(.setup-sky-choice){border:1px solid var(--ds-border);border-radius:var(--radius-control);background:#cbb7e00a;box-shadow:none}
.player-setup .setup-choice:not(.setup-sky-choice):has(input:checked){border-color:var(--ds-peach);background:linear-gradient(135deg,#f3ccaa18,#cf6de014)}
.player-setup input[type=radio]{accent-color:var(--ds-peach)}
.player-setup footer{gap:var(--space-4)}
.film-frame{border-color:#f3ccaa55}
.film-intertitle .film-actions{gap:var(--space-3)}
.film-intertitle h1{font:400 clamp(28px,4vw,40px)/1.3 var(--serif);letter-spacing:0}
.film-intertitle .film-copy p{font:400 clamp(16px,1.8vw,21px)/1.7 var(--serif)}
/* Demo sign-in: a small architectural stage, built with existing game artwork. */
.login-screen{position:fixed;inset:0;box-sizing:border-box;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border:0;padding:0;overflow:auto;background:radial-gradient(ellipse at 18% 78%,#68748c44,transparent 48%),radial-gradient(ellipse at 85% 0%,#cf6de022,transparent 42%),var(--ds-night);color:var(--ds-text)}
.login-screen::backdrop{background:var(--ds-night)}
.login-shell{position:relative;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;gap:var(--space-8);width:min(1120px,100%);min-height:100%;margin:auto;padding:var(--space-10) var(--space-12)}
.login-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-6)}
.login-header>img{width:156px;height:auto;filter:brightness(0) invert(1)}
.login-demo{margin:0;padding:var(--space-2) var(--space-3);border:1px solid var(--ds-border);border-radius:var(--radius-pill);font-size:9px;color:var(--ds-muted)}
.login-layout{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-16);align-items:center;flex:1;padding:var(--space-8) 0}
.login-world{position:relative;display:grid;place-items:center;min-height:440px;isolation:isolate}
.login-world>img{position:relative;z-index:2;width:240px;height:300px;object-fit:contain;filter:drop-shadow(0 16px 28px #02031555);animation:login-float 7s var(--motion-ease) infinite}
.login-halo{position:absolute;inset:8% 0 15%;border-radius:50% 50% 8% 8%;background:linear-gradient(160deg,#e9b3c766,#cf6de036 42%,#b8e3d52b);transform:rotate(-8deg);box-shadow:inset 1px 1px 0 #ffe7da22}
.login-orbit{position:absolute;border:1px solid #f3ccaa24;pointer-events:none;border-radius:50%}
.orbit-one{width:calc(100% + 16px);aspect-ratio:1;transform:rotate(-22deg) scaleY(.5)}
.orbit-two{width:76%;aspect-ratio:1;transform:rotate(25deg) scaleX(.7)}
.login-plinth{position:absolute;bottom:12%;width:60%;height:70px;background:linear-gradient(125deg,#a7d3c2,#7d9dba);transform:rotate(-12deg) skewX(25deg);border-radius:8px;box-shadow:14px 16px 0 #5b5d80;opacity:.6;z-index:0}
.login-spark{position:absolute;top:12%;right:15%;color:var(--ds-peach);font-size:40px}
.login-card{position:relative;max-width:400px;padding:var(--space-6) 0}
.login-card .ds-eyebrow{margin:0 0 var(--space-5)}
.login-card h1{font:400 clamp(34px,4.3vw,52px)/1.18 var(--serif);letter-spacing:-.02em;margin:0 0 var(--space-5);color:var(--ds-ivory);outline:none}
.login-intro{font:400 16px/1.7 var(--sans);color:var(--ds-muted);margin:0 0 var(--space-8)}
.login-methods{display:grid;gap:var(--space-4)}
.login-methods>button{display:grid;grid-template-columns:24px 1fr 20px;gap:var(--space-3);align-items:center;width:100%;text-align:left}
.login-google-mark{font-size:21px;font-weight:700;line-height:1;color:#474b78}
.login-note{font:400 11px/1.7 var(--sans);color:#b7b2c4;text-align:center;margin:var(--space-6) 0 var(--space-2)}
.login-status:empty{display:none}.login-status{font:400 12px/1.6 var(--sans);color:var(--ds-peach);margin:var(--space-4) 0}
.login-guest{display:flex;gap:var(--space-3);justify-content:center;align-items:center;width:100%}
.login-email-form{display:grid;gap:var(--space-3)}
.login-email-form label{font:500 12px/1.5 var(--sans);color:var(--ds-muted)}
.login-email-form input{box-sizing:border-box;width:100%;min-width:0;min-height:56px;padding:var(--space-4);border-radius:var(--radius-control);border:1px solid #e7d7ef55;background:#ffffff09;color:var(--ds-text);font:400 16px/1.5 var(--sans)}
.login-email-form input::placeholder{color:#9f9ab2}.login-email-form button[type=submit]{margin-top:var(--space-2)}
.login-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--space-6);color:#ada7c1;font:500 9px/1.5 var(--sans);letter-spacing:.2em}
.login-footer>span:last-child{font-size:24px;color:var(--ds-mint)}
@keyframes login-float{0%,100%{translate:0 0}50%{translate:0 -12px}}
/* Phone layout: 16px margins, 8px gaps and controls at least 44px high. */
@media(max-width:760px){
 .question-panel{padding:var(--space-6);width:calc(100% - 32px);box-sizing:border-box}
 .question-panel h2{font-size:27px;line-height:1.3;margin-bottom:var(--space-5)}
 .option{min-height:56px;padding:var(--space-3);font-size:13px;gap:var(--space-2)}
 .options{gap:var(--space-3)}
 .question-meta{gap:var(--space-2);padding-right:var(--space-10)}
 .round-navigation{gap:var(--space-3)}
 .player-setup{width:calc(100% - 24px);padding:var(--space-6);max-height:calc(100dvh - 24px)}
 .setup-progress{gap:var(--space-2);margin-bottom:var(--space-6)}
 .setup-progress>span{gap:var(--space-2);font-size:10px}
 .setup-introduction{gap:var(--space-4);margin-bottom:var(--space-6)}
 .setup-introduction .setup-help{font-size:14px;line-height:1.7}
 .setup-header{gap:var(--space-3);margin-bottom:var(--space-6)}
 .setup-header img{max-width:140px}.setup-header button{font-size:12px;min-height:44px;padding:var(--space-3)}
 .player-setup .setup-choice{padding:var(--space-3);min-height:56px}
 .player-setup .setup-ages{gap:var(--space-3);grid-template-columns:repeat(2,minmax(0,1fr))}
 .player-setup .setup-interests{gap:var(--space-2)}
 .player-setup .setup-interests .setup-interest-chip{font-size:12px;min-height:44px;padding:var(--space-3) var(--space-4)}
 .knowling-profile{padding:var(--space-6);width:calc(100% - 24px);max-height:calc(100dvh - 24px);box-sizing:border-box}
 .login-shell{padding:var(--space-6);gap:var(--space-5)}
 .login-layout{grid-template-columns:1fr;gap:var(--space-4);padding:0;align-content:center}
 .login-world{min-height:180px;width:min(260px,100%);margin:auto}
 .login-world>img{width:144px;height:180px}.login-halo{inset:8% 16% 12%}.login-plinth{height:28px;bottom:9%;width:48%;box-shadow:8px 8px 0 #5b5d80}.orbit-one{width:90%}.orbit-two{width:66%}.login-spark{font-size:26px;top:10%;right:19%}
 .login-card{width:100%;max-width:400px;margin:auto;padding:var(--space-2) 0}
 .login-card h1{font-size:36px;margin-bottom:var(--space-4)}
 .login-card h1 br{display:none}.login-card .ds-eyebrow{font-size:9px;margin-bottom:var(--space-3)}
 .login-intro{margin-bottom:var(--space-6);font-size:15px}
 .login-header>img{width:128px}.login-methods{gap:var(--space-3)}
 .login-note{margin-top:var(--space-5);font-size:11px}
 .film-intertitle[data-chapter=prologue] .film-frame{padding:var(--space-6) var(--space-5);min-height:0;gap:var(--space-4)}
 .film-intertitle[data-chapter=prologue] .film-art-scene{width:100%;height:clamp(180px,34dvh,340px);min-height:0;object-fit:contain}
 .film-intertitle .film-copy p{font-size:17px;line-height:1.6}.film-intertitle h1{font-size:29px}
 .film-actions .film-next{min-width:0}.film-actions button{min-height:48px}
}
@media(max-width:480px){
 #campaignGoal{grid-template-columns:1fr auto;gap:var(--space-2);font-size:11px}
 #campaignGoal>span:not(.campaign-lights){font-size:10px;text-align:right}
 .campaign-lights{grid-column:1/-1}
 #scene #sceneMessages #homeNotice{font-size:12px;line-height:1.6}
 #scene[data-phase=home] #startButton{left:var(--space-4);right:var(--space-4);bottom:max(var(--space-4),env(safe-area-inset-bottom));width:calc(100% - 32px);min-height:56px;padding:var(--space-4) var(--space-5);min-width:0}
 .scene[data-phase=home] .tower-view{left:var(--space-4);bottom:88px;min-height:44px;padding:var(--space-3) var(--space-4)}
 .question-panel{padding:var(--space-5);border-radius:24px}
 .question-panel h2{font-size:25px}
 .question-close{top:var(--space-3);right:var(--space-3)}
 .question-panel .feedback{margin-top:var(--space-5)}
 .profile-badges .badge-collection{gap:var(--space-3)}
 .profile-campaign{padding:var(--space-5)}
 .player-setup .setup-introduction .setup-illustration{width:100px;max-width:30%}
}
@media(max-width:360px){
 .login-shell{padding:var(--space-5)}.login-world{min-height:132px}.login-world>img{width:106px;height:132px}.login-card h1{font-size:30px}.login-intro{margin-bottom:var(--space-5)}.login-card .ds-eyebrow{font-size:8px}
 .question-panel{padding:var(--space-4)}.question-panel h2{font-size:23px}.option{font-size:12px;padding:var(--space-3) var(--space-2)}
 .question-meta,.question-meta span+span{font-size:9px}
 #campaignGoal{grid-template-columns:1fr}#campaignGoal>span:not(.campaign-lights){text-align:left}
 .player-setup{padding:var(--space-5)}.player-setup h1{font-size:27px}.setup-progress>span{font-size:9px}.setup-progress i{width:24px;height:24px}
}
@media(max-height:680px) and (max-width:760px){
 .login-shell{gap:var(--space-4);padding-top:var(--space-4);padding-bottom:var(--space-4)}
 .login-layout{gap:var(--space-3)}.login-world{min-height:104px}.login-world>img{width:84px;height:104px}.login-card h1{font-size:28px}.login-intro{margin-bottom:var(--space-4)}.login-card .ds-eyebrow{margin-bottom:var(--space-2)}.login-note{margin-top:var(--space-4)}.login-footer{display:none}
 .film-intertitle[data-chapter=prologue] .film-art-scene{height:26dvh;min-height:120px}.film-intertitle[data-chapter=prologue] .film-frame{padding:var(--space-5) var(--space-4);gap:var(--space-3)}
 .film-intertitle h1{font-size:25px}.film-intertitle .film-copy p{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.login-world>img{animation:none}:is(.ds-primary,.ds-secondary,.main-button,.option){transition:none!important}}

/* Sky previews retain their own gradient in every selection and focus state. */
.player-setup .setup-skies .setup-sky-choice,
.player-setup .setup-skies .setup-sky-choice:has(input:checked){background:var(--sky-preview);min-height:112px;position:relative;overflow:visible;border-radius:var(--radius-control);border:1px solid #f3ccaa33;box-shadow:inset 0 1px 0 #ffffff12;padding:var(--space-3)}
.player-setup .setup-skies .setup-sky-choice>span{border-radius:var(--radius-pill);background:#12132dc9;color:#fff3dd;padding:4px 10px;font-size:11px;line-height:1.5;text-shadow:none}
.player-setup .setup-skies .setup-sky-choice:has(input:checked){border-color:var(--ds-peach);outline:2px solid var(--ds-peach);outline-offset:3px}
@media(max-width:760px){.player-setup .setup-skies .setup-sky-choice{min-height:96px}.player-setup .setup-skies .setup-sky-choice>span{padding:4px 8px;font-size:10px}}
/* A quiet, aligned toolbar; the profile is always the last control. */
#scene .masthead{left:32px;top:24px;height:48px;display:flex;align-items:center}
#scene .sound-controls{right:96px;top:24px;display:flex;gap:12px;align-items:center}
body>.profile-button{right:32px;top:24px;width:48px;height:48px;min-height:48px}
#scene #soundToggle,#scene #soundSettings{width:48px;height:48px;min-width:48px;min-height:48px;flex:0 0 48px;padding:0;border-radius:50%;display:grid;place-items:center;border:1px solid var(--ds-border);background:#202b3bd9;box-shadow:none}
#soundLabel{display:none!important}
#scene[data-phase=home] #homeBalance{top:24px;right:228px;min-height:48px;padding:12px 20px;border:1px solid var(--ds-border);border-radius:var(--radius-pill);background:linear-gradient(110deg,#28213be8,#152c37e8);font-size:13px;gap:12px;box-shadow:none}
#sceneMessages{left:32px;width:min(360px,calc(100% - 64px));gap:12px}
#scene[data-phase=home] #sceneMessages #homeNotice{background:linear-gradient(120deg,#24213be6,#172a36e6);font-size:13px;line-height:1.7;padding:16px 20px;border:1px solid #d5c2e026;border-left:2px solid #f3ccaa77;box-shadow:none;max-width:360px}
#scene[data-phase=home] .tower-view{left:32px;right:auto;bottom:32px;transform:none}
#scene[data-phase=home] #startButton{right:32px;bottom:32px;min-width:280px}
#scene[data-phase=home] #exploreButton{right:32px;bottom:104px;min-height:48px;padding:12px 20px;box-shadow:none;background:#162a36c9}
.window-editor-header{padding:16px!important;gap:12px!important;box-sizing:border-box;background:linear-gradient(120deg,#30283feF,#162b37ef)!important;border:1px solid var(--ds-border)!important;border-radius:20px!important}
.window-editor-header h3{font:500 13px/1.5 var(--sans);margin:0}
.window-topic-controls{display:block!important}.window-topic-controls select{box-sizing:border-box;width:100%;min-height:48px;padding:12px 16px;border:1px solid var(--ds-border);border-radius:16px;background:#1b2a3d;color:var(--ds-text);font-size:14px}
.window-editor-status{font-size:12px;line-height:1.6;color:var(--ds-peach);margin:8px 0}.window-editor-status:empty{display:none}
.tower-editor .editor-done{width:100%;min-height:52px;padding:12px 20px;border:1px solid #fff2d088;border-radius:16px;background:var(--ds-dawn);color:var(--ds-ink);font:600 14px/1.5 var(--sans);box-shadow:var(--ds-shadow-small)}
/* The opening and sign-in are one continuous, full-height introduction. */
.login-header-actions{display:flex;align-items:center;gap:16px}
.welcome-close{display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:1px solid var(--ds-border);border-radius:50%;background:#ece3ed08;color:var(--ds-text);font:400 24px/1 var(--sans);box-shadow:none;cursor:pointer}
.welcome-screen .login-layout{align-content:center;grid-template-rows:minmax(520px,1fr)}
.welcome-screen .login-card{box-sizing:border-box;min-height:500px;display:flex;flex-direction:column;justify-content:flex-start}
.welcome-screen .login-card h1{min-height:120px;margin:0 0 16px;display:flex;align-items:center}
.welcome-screen .login-intro{min-height:72px;margin:0 0 24px}
.welcome-screen .login-methods{min-height:128px;align-content:start}
.welcome-screen .login-world{height:500px;min-height:0}.welcome-screen .login-world>img{width:100%;height:100%;max-width:none;object-fit:contain;animation:none;mask-image:linear-gradient(transparent,#000 12%,#000 88%,transparent);border-radius:32px}
.welcome-screen .login-plinth{display:none}.welcome-screen .login-halo{opacity:.35}
.welcome-next,.welcome-back{display:block!important;text-align:center!important}
.welcome-dots{display:flex;align-items:center;gap:16px}.welcome-dots span{display:block;width:6px;height:6px;border-radius:50%;background:#e0b7d855;transition:background 1200ms var(--motion-ease)}.welcome-dots span[aria-current=true]{background:var(--ds-peach);box-shadow:0 0 12px #f3ccaa55}
/* Journal slides use identical rows, so navigation cannot move between slides. */
.film-intertitle[data-chapter=prologue]{inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:24px;box-sizing:border-box;overflow:auto}
.film-intertitle[data-chapter=prologue] .film-frame{box-sizing:border-box;width:100%;height:calc(100dvh - 48px);min-height:600px;padding:32px 40px;display:grid;grid-template-rows:56px 20px minmax(120px,1fr) 24px 52px 72px 32px 1px 56px;gap:12px;align-items:center;justify-items:center}
.film-intertitle[data-chapter=prologue] .film-topbar{grid-row:1;position:static;display:flex;justify-content:space-between;align-items:center;width:100%;margin:0;transform:none}
.film-intertitle[data-chapter=prologue] .film-logo{width:180px;max-width:60%;height:auto;margin:0}
.film-intertitle[data-chapter=prologue] .film-skip{position:static;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;display:grid;place-items:center;box-shadow:none}
.film-intertitle[data-chapter=prologue] .film-chapter{grid-row:2;margin:0}
.film-intertitle[data-chapter=prologue] .film-art-scene{grid-row:3;width:min(800px,100%);height:100%;max-height:100%;min-height:0;object-fit:contain;margin:0}
.film-intertitle[data-chapter=prologue] .film-ornament{grid-row:4;margin:0}
.film-intertitle[data-chapter=prologue] h1{grid-row:5;margin:0;font-size:36px;line-height:1.3}
.film-intertitle[data-chapter=prologue] .film-copy{grid-row:6;width:min(800px,100%);margin:0;align-self:center}
.film-intertitle[data-chapter=prologue] .film-copy p{margin:0;font-size:19px;line-height:1.7}
.film-intertitle[data-chapter=prologue] .film-dots{grid-row:7;margin:0;height:32px}
.film-intertitle[data-chapter=prologue] .film-rule{grid-row:8;margin:0}
.film-intertitle[data-chapter=prologue] .film-actions{grid-row:9;display:grid;grid-template-columns:1fr minmax(180px,240px) 1fr;gap:16px;width:100%;margin:0}
.film-intertitle[data-chapter=prologue] .film-back{grid-column:1;justify-self:start}.film-intertitle[data-chapter=prologue] .film-next{grid-column:2;width:100%;min-width:0}
@media(max-width:760px){
 #scene .masthead{left:16px;top:16px;height:44px}#scene .wordmark{width:110px}
 #scene .sound-controls{right:72px;top:16px;gap:8px}body>.profile-button,.scene:not([data-phase=home])~.profile-button{right:16px;top:16px;width:44px;height:44px;min-height:44px}
 #scene #soundToggle,#scene #soundSettings{width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px}
 #scene[data-phase=home] #homeBalance{left:16px;right:auto;top:100px;min-height:40px;padding:8px 16px;font-size:12px;max-width:calc(100% - 32px)}
 #sceneMessages{left:16px;width:min(360px,calc(100% - 32px))}#scene[data-phase=home] #sceneMessages #homeNotice{padding:12px 16px;font-size:12px}
 #scene[data-phase=home] .tower-view{left:16px;bottom:88px}#scene[data-phase=home] #exploreButton{right:16px;bottom:88px;max-width:calc(100% - 160px);font-size:12px}
 .welcome-screen .login-layout{grid-template-rows:160px auto;gap:16px;align-content:center}
 .welcome-screen .login-world{height:160px;min-height:0;width:100%;max-width:320px}.welcome-screen .login-world>img{width:100%;height:100%;border-radius:20px}
 .welcome-screen .login-card{min-height:390px;padding:0}.welcome-screen .login-card h1{font-size:32px;min-height:80px;margin-bottom:12px}.welcome-screen .login-intro{font-size:15px;line-height:1.7;min-height:66px;margin-bottom:20px}.welcome-screen .login-methods{min-height:124px}
 .login-header-actions{gap:12px}.welcome-screen .login-footer{display:flex;gap:12px}.welcome-screen .login-footer>span:first-child{font-size:7px;max-width:104px}
 .film-intertitle[data-chapter=prologue]{padding:12px}.film-intertitle[data-chapter=prologue] .film-frame{height:calc(100dvh - 24px);min-height:0;padding:20px;grid-template-rows:44px 16px minmax(80px,1fr) 16px 40px 72px 24px 0 48px;gap:8px}
 .film-intertitle[data-chapter=prologue] .film-logo{width:140px}.film-intertitle[data-chapter=prologue] h1{font-size:27px}.film-intertitle[data-chapter=prologue] .film-copy p{font-size:16px;line-height:1.5}.film-intertitle[data-chapter=prologue] .film-rule{display:none}
 .film-intertitle[data-chapter=prologue] .film-actions{grid-template-columns:1fr 1.5fr;gap:12px}
}
@media(max-width:360px){
 #scene .wordmark{width:94px}.welcome-screen .login-layout{grid-template-rows:100px auto;gap:12px}.welcome-screen .login-world{height:100px}.welcome-screen .login-card{min-height:370px}.welcome-screen .login-card h1{font-size:28px;min-height:72px}.welcome-screen .login-card .ds-eyebrow{font-size:8px}
 .film-intertitle[data-chapter=prologue] .film-frame{padding:16px;grid-template-rows:44px 16px minmax(80px,1fr) 16px 36px 72px 24px 0 48px;gap:8px}.film-intertitle[data-chapter=prologue] h1{font-size:24px}.film-intertitle[data-chapter=prologue] .film-copy p{font-size:15px}
}
#scene #soundControls{right:96px;top:24px;gap:12px}
#scene #soundSettings{max-width:48px;max-height:48px}
@media(max-width:760px){#scene #soundControls{right:72px;top:16px;gap:8px}#scene #soundSettings{max-width:44px;max-height:44px}}
.welcome-screen .login-note{min-height:20px}
.tower-editor .defense-slot{display:block;width:100%;min-width:0;box-sizing:border-box}
.tower-editor .window-more{width:100%;box-sizing:border-box}
.tower-editor .window-topic-controls{display:block;width:100%;box-sizing:border-box;padding:0 12px 12px}
.tower-editor .window-topic-controls select{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;font-size:14px}
/* Persistent navigation above the current tower sky. */
dialog.knowling-profile{position:fixed;inset:0;display:flex;flex-direction:column;box-sizing:border-box;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:32px max(32px,calc((100vw - 1040px)/2));overflow:hidden;border:0;border-radius:0;background:linear-gradient(180deg,#10112755,#101127b8),var(--profile-sky);box-shadow:none}
dialog.knowling-profile:not([open]){display:none}
.profile-header{display:flex;align-items:center;gap:24px;width:100%;flex:none;padding-bottom:24px}
.profile-header .profile-portrait{position:static;width:72px;height:72px;min-width:72px;margin:0;flex:none}
.profile-header>div:not(.profile-portrait){flex:1;min-width:0}
.profile-header .kicker{margin:0 0 8px;color:var(--ds-peach);font-size:9px;letter-spacing:.18em}
.profile-header #profileTitle{font:400 32px/1.2 var(--serif);margin:0}
.profile-header form{margin:0;flex:none}.profile-header .profile-close{position:static;display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:0;border:1px solid var(--ds-border);border-radius:50%;background:#ffffff08;box-shadow:none}
.profile-tabs{display:flex;gap:8px;flex:none;overflow:auto;border-bottom:1px solid var(--ds-border);padding:0 0 16px;scrollbar-width:none}
.profile-tabs button{position:relative;flex:1;min-height:48px;min-width:100px;padding:12px 16px;border:1px solid transparent;border-radius:16px;color:var(--ds-muted);background:transparent;font:500 13px/1.5 var(--sans);white-space:nowrap;box-shadow:none;transition:background 700ms var(--motion-ease),color 700ms var(--motion-ease),border-color 700ms var(--motion-ease)}
.profile-tabs button[aria-selected=true]{background:var(--ds-ivory);border-color:var(--ds-ivory);color:var(--ds-ink);font-weight:650}
.profile-tab-content{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:32px 0;scrollbar-width:thin}
.profile-tab-panel{width:100%;max-width:960px;box-sizing:border-box}.profile-tab-panel[hidden]{display:none!important}
.profile-tab-panel .profile-name input{min-height:52px;font-size:16px;padding:12px 16px;box-sizing:border-box;max-width:100%}
.profile-tab-panel .profile-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.knowling-profile>.profile-saved{flex:none;min-height:0;font-size:12px;line-height:1.6;margin:0;color:var(--ds-mint)}.knowling-profile>.profile-saved:not(:empty){padding:12px 0;border-top:1px solid var(--ds-border)}
/* Questions retain just their content, answer choices and useful potion actions. */
#questionPanel #question{text-align:center;padding:0 32px;margin-top:16px;margin-bottom:24px;outline:none}
#questionPanel .potion-status:empty{display:none}
#roundCount{display:none!important}
#gameUI .round-navigation #homeButton{width:48px;height:48px;min-width:48px;min-height:48px;padding:0;display:grid;place-items:center;border-radius:50%;font-size:0;box-shadow:none}
#homeButton>span{display:none}#homeButton>svg{width:20px;height:20px}
.scene[data-phase=departure] :is(.defense-builder,#towerStoreyControl,#homeBalance,#startButton,#exploreButton,#sceneMessages){display:none!important}
@media(max-width:760px){
 dialog.knowling-profile{padding:24px 16px}.profile-header{gap:16px;padding-bottom:20px}.profile-header .profile-portrait{width:56px;height:56px;min-width:56px}.profile-header #profileTitle{font-size:28px}.profile-header .profile-close{width:44px;height:44px;min-height:44px}
 .profile-tabs{gap:4px;padding-bottom:12px}.profile-tabs button{min-width:80px;min-height:44px;padding:12px 10px;font-size:12px}.profile-tab-content{padding:24px 0}.profile-tab-panel .profile-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
 #gameUI .round-navigation #homeButton{width:44px;height:44px;min-width:44px;min-height:44px}
 #questionPanel #question{padding:0 24px;margin-top:24px;font-size:26px}
}
@media(max-width:360px){.profile-header #profileTitle{font-size:25px}.profile-tabs button{min-width:76px;padding:10px 8px;font-size:11px}#questionPanel #question{font-size:23px;padding:0 16px}}
@media(prefers-reduced-motion:reduce){.profile-tabs button{transition:none}}
.welcome-screen[data-stage=story] .login-methods{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:12px;align-items:start;align-content:start}
.welcome-screen[data-stage=story] .login-methods>button{width:100%;min-width:0;min-height:56px;padding:16px 12px;font-size:13px;white-space:nowrap}
.player-setup{box-sizing:border-box;width:min(1040px,calc(100vw - 96px));max-width:1040px;max-height:calc(100dvh - 64px);padding:48px;margin:auto}
.setup-towers .setup-choice{min-width:0}.setup-towers img{max-width:100%;object-fit:contain}
@media(max-width:760px){.player-setup{width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:24px}.welcome-screen[data-stage=story] .login-methods>button{font-size:12px;padding:14px 10px;min-height:52px}}
@media(max-width:360px){.player-setup{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:20px}.welcome-screen[data-stage=story] .login-methods{grid-template-columns:minmax(0,1fr) minmax(0,1.7fr);gap:8px}.welcome-screen[data-stage=story] .login-methods>button{font-size:11px;padding:14px 8px}}
.welcome-screen[data-stage=story] .login-methods>button:hover{transform:none}
.player-setup{height:auto;min-height:0;inset:32px auto;left:50%;transform:translateX(-50%)}
.profile-reward-note{display:block;margin-top:20px;font:400 13px/1.7 var(--sans);color:var(--ds-muted)}
@media(max-width:760px){.player-setup{inset:16px auto;left:50%}}
@media(max-width:360px){.player-setup{inset:12px auto;left:50%}}
/* The scrollable profile body spans the viewport, including its outer margins. */
dialog.knowling-profile{padding:32px 0}
.profile-header,.profile-tabs{box-sizing:border-box;width:min(1040px,calc(100% - 64px));max-width:1040px;margin-left:auto;margin-right:auto}
.profile-tab-content{box-sizing:border-box;width:100%;padding:32px max(32px,calc((100vw - 1040px)/2));overflow-x:hidden;overflow-y:auto;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.knowling-profile>.profile-saved{box-sizing:border-box;width:min(1040px,calc(100% - 64px));margin-left:auto;margin-right:auto}
@media(max-width:760px){dialog.knowling-profile{padding:24px 0}.profile-header,.profile-tabs,.knowling-profile>.profile-saved{width:calc(100% - 32px)}.profile-tab-content{padding:24px 16px}}
.window-step-count{font:500 10px/1.5 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--ds-peach);margin:16px 4px 12px}
.tower-editor .defense-slot{position:relative;min-height:100px}
.window-step-panel{width:100%;min-width:0}.window-step-panel[hidden]{display:none!important}
.window-step-panel .window-more{margin:0!important;padding-top:12px!important}.window-step-panel .window-more>summary{display:none!important}
.tower-editor .window-editor-actions{display:flex;gap:12px;align-items:center;justify-content:stretch}
.tower-editor .window-editor-actions>button{flex:1;min-width:0;min-height:48px;padding:12px 16px;border-radius:14px;font:500 12px/1.5 var(--sans)}
.tower-editor .editor-step-back{background:#1d2b3f;border:1px solid var(--ds-border);color:var(--ds-text)}
.tower-editor .editor-step-next{background:var(--ds-dawn);border:1px solid #fff2d088;color:var(--ds-ink)}
/* Older compact-editor rules hid all direct paragraphs, including the step label. */
.tower-editor>.window-step-count{display:block!important}
.tower-editor .window-editor-actions>.editor-step-next{background:var(--ds-dawn);color:var(--ds-ink);border-color:#fff2d088}
dialog.knowling-profile[open]{display:flex}
/* Home overlay lets the scene receive gestures; its secondary action stays clickable. */
#introPanel #exploreButton{pointer-events:auto}
/* A landscape phone must use its real height rather than the old 540px canvas floor. */
#scene{height:100dvh;min-height:0}
/* Explicit dimensions prevent the horizontal key asset from expanding the header. */
#scene .masthead{gap:10px;width:max-content;max-width:45vw;right:auto}
#scene .masthead>.brand-key{display:block;width:38px;height:24px;min-width:38px;max-width:38px;object-fit:contain;flex:none}
#scene .masthead>.wordmark{display:block;width:192px;height:36px;max-width:192px;object-fit:contain;flex:none}
.game-icon{width:28px;height:28px;flex:none;vertical-align:middle;color:#edd5ae}
.hud-resource{display:inline-flex;align-items:center;gap:8px}.hud-resource b{font:600 14px var(--sans);font-variant-numeric:tabular-nums}
.resource-divider{height:20px;width:1px;background:#f3ccaa33;margin:0 4px}
#homeBalance{display:flex;align-items:center;gap:12px}
#knowledgeCount{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}#knowledgeCount b{font-weight:600;font-variant-numeric:tabular-nums}
#storeyDetails #storeyTitle{font:400 23px/1.25 var(--serif);color:#fff0d3;margin:0 0 12px}
#scene #storeyDetails #confirmStorey{gap:8px;min-height:48px}#confirmStorey .game-icon{width:23px;height:23px}
#scene #sceneMessages #homeNotice{position:relative;display:block;padding:16px 20px 16px 56px;text-align:left;background:linear-gradient(115deg,#40315bdf,#233f49df,#433756df);background-size:220% 220%;animation:guidance-tide 18s cubic-bezier(.65,0,.35,1) infinite;border:1px solid #c5b2e45c;box-shadow:0 4px 24px #070a1820}
#homeNotice:before{content:'';position:absolute;left:17px;top:17px;width:24px;height:24px;background:url('assets/icons/info.svg') center/contain no-repeat}
@keyframes guidance-tide{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
#scene .destination-icon .game-icon{width:22px;height:22px;display:block}
#scene #destinations .destination-label{font-size:11px}
#questionPanel{background:linear-gradient(145deg,#142731cf,#18233dc7);backdrop-filter:blur(8px)}
#questionPanel .option-letter{display:none}
#questionPanel .option{gap:0;justify-content:center;text-align:center}
#questionPanel .option>span{width:100%}
#questionPanel[data-urgency=high]{animation:none}
#closeQuestion{width:44px;height:44px;min-width:44px;min-height:44px;display:grid;place-items:center;padding:0;border:1px solid #d9d3ed55;border-radius:50%;background:#1c2d40e8;color:#f5ecdf;font:400 26px/1 var(--sans)}
@media(max-width:760px){
 #scene .masthead{max-width:46vw;gap:8px}
 #scene .masthead>.brand-key{width:26px;height:20px;min-width:26px;max-width:26px}
 #scene .masthead>.wordmark{width:128px;height:32px;max-width:128px}
 #gameUI .round-navigation>.round-hud{position:fixed;left:50%;right:auto;top:84px;transform:translateX(-50%);margin:0;min-width:112px;justify-content:center;gap:10px;max-width:calc(100vw - 160px)}
 #scene #homeBalance{gap:10px}#homeBalance .game-icon{width:24px;height:24px}
}
@media(max-width:360px){#scene .masthead>.wordmark{width:112px;max-width:112px}#scene .masthead>.brand-key{width:22px;min-width:22px;max-width:22px}#gameUI .round-navigation>.round-hud{max-width:calc(100vw - 140px)}}
@media(prefers-reduced-motion:reduce){#scene #sceneMessages #homeNotice{animation:none}}
/* Interaction changes should settle as gently as the world camera. */
button,select,input{transition-duration:450ms!important;transition-timing-function:cubic-bezier(.65,0,.35,1)!important}
.destination:before,.destination .destination-label{transition-duration:650ms!important;transition-timing-function:cubic-bezier(.65,0,.35,1)!important}
@media(prefers-reduced-motion:reduce){button,select,input,.destination:before,.destination .destination-label{transition-duration:0ms!important}}
#scene[data-phase=home] #sceneMessages #homeNotice{padding:16px 20px 16px 56px;background:linear-gradient(115deg,#40315bdf,#233f49df,#433756df);background-size:220% 220%;max-width:400px}
@media(max-width:760px){#scene[data-phase=home] #sceneMessages #homeNotice{padding:14px 16px 14px 52px}#homeNotice:before{left:15px;top:14px}}
#scene #homeBalance{pointer-events:auto;cursor:pointer;color:#f3d89f;line-height:1}
.profile-trading{margin:0 0 32px}.market-intro{font-size:14px;line-height:1.7;color:var(--ds-muted);max-width:640px;margin:12px 0 24px}
.market-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.market-card{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:28px;border:1px solid var(--ds-border);border-radius:24px;background:linear-gradient(140deg,#40315b55,#1a344255)}
.market-card>.game-icon{width:40px;height:40px}.market-card h4{font:400 23px/1.3 var(--serif);margin:0;color:#f7e7cb}.market-card p{font:400 13px/1.7 var(--sans);color:#c7d1df;margin:0 0 12px}.market-card .market-buy{margin-top:auto;min-height:48px;padding:12px 20px;border:1px solid #f1d79c77;border-radius:14px;background:linear-gradient(115deg,#edc9a8,#e8dda8);color:#18283b;font:600 13px var(--sans);width:100%}.market-buy:disabled{opacity:.45;cursor:default}
@media(max-width:600px){.market-grid{grid-template-columns:1fr;gap:16px}.market-card{padding:24px}}
@media(max-width:760px){.profile-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.profile-tabs button{min-width:0;height:52px;white-space:normal;line-height:1.25;padding:10px 6px}}
@media(max-width:360px){.profile-tabs button{font-size:11px}}
#scene:is([data-phase=question],[data-phase=feedback]) #sceneMessages .narrator-caption{display:none}
@media(max-width:760px){#scene:is([data-phase=question],[data-phase=feedback]) #sceneMessages{width:calc(100% - 96px);max-width:400px}#scene:is([data-phase=question],[data-phase=feedback]) #sceneMessages #milestoneNotice{font-size:11px;line-height:1.5}}

/* Compact reward announcements share the header's safe area. */
.achievement-toasts{position:fixed;z-index:100;transform:none;left:max(16px,env(safe-area-inset-left));bottom:max(16px,env(safe-area-inset-bottom));box-sizing:border-box;width:min(360px,calc(100vw - 32px));min-height:48px;display:flex;align-items:center;gap:12px;padding:8px 8px 8px 16px;border:1px solid #e8cb8870;border-radius:18px;background:linear-gradient(115deg,#30304beb,#19383aeb);box-shadow:0 12px 36px #0004;backdrop-filter:blur(16px);color:#fff4dc;animation:achievement-arrive 650ms cubic-bezier(.65,0,.35,1) both;}
.achievement-toasts[hidden]{display:none;}
.achievement-spark{font-size:28px;color:#edcf8b;}
.achievement-toasts>div{flex:1;min-width:0;display:grid;gap:3px;}
.achievement-toasts strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;}
.achievement-toasts>div>span{font-size:11px;color:#d9d1e7;}
.achievement-toasts button{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;border:0;background:transparent;color:inherit;font-size:24px;}
.achievement-visible #homeNotice{visibility:hidden;}
@keyframes achievement-arrive{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@media(max-width:759px){.achievement-toasts{width:min(360px,calc(100vw - 32px));min-height:44px;padding:4px 4px 4px 12px;gap:8px;}.achievement-toasts strong{font-size:12px}.achievement-toasts>div>span{font-size:10px}.achievement-spark{font-size:24px}}
@media(prefers-reduced-motion:reduce){.achievement-toasts{animation:none}}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;}

/* Keep every building resource and the market action visible together. */
#scene #homeBalance{gap:16px;white-space:nowrap}
#homeBalance .hud-trade-action{display:inline-flex;align-items:center;gap:8px;color:var(--ds-ivory);font-weight:600;font-size:13px}
#homeBalance .resource-divider{margin:0;height:22px;flex:none}
#homeBalance .hud-resource{flex:none}
@media(max-width:760px){
 #scene[data-phase=home] #homeBalance{gap:12px;padding:8px 12px;max-width:calc(100vw - 32px)}
 #homeBalance .hud-resource{gap:5px}
 #homeBalance .hud-trade-action{font-size:12px;gap:4px}
 #homeBalance .game-icon{width:22px;height:22px}
}
@media(max-width:360px){#scene[data-phase=home] #homeBalance{gap:9px}#homeBalance .game-icon{width:20px;height:20px}}
.resource-artefact .game-icon,#knowledgeCount>.game-icon{filter:drop-shadow(0 0 4px #d8b5ed88)}
.resource-gain{position:fixed;z-index:100;transform:translateX(-50%);pointer-events:none;color:#f5ddff;font-size:13px;font-weight:600;text-shadow:0 2px 8px #08091f}
.resource-mote{position:fixed;left:0;top:0;z-index:99;width:28px;height:28px;pointer-events:none;filter:drop-shadow(0 0 9px #e6bfff)}
.resource-mote svg{width:100%;height:100%}

.profile-storeys{padding:24px 0;border-top:1px solid var(--ds-border);scroll-margin-top:20px}
.profile-storeys>p{max-width:65ch;color:#c8c9d8;line-height:1.7}
.storey-role-card{padding:20px;margin:20px 0;border:1px solid var(--ds-border);border-radius:20px;background:linear-gradient(125deg,#37265a33,#16343c33)}
.storey-role-card h4{margin:0 0 18px}
.storey-role-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.storey-role-options button{display:flex;flex-direction:column;align-items:center;gap:12px;min-width:0;min-height:170px;padding:20px 12px;white-space:normal;text-align:center;border:1px solid var(--ds-border);background:#bfa3d509;border-radius:16px;line-height:1.5}
.storey-role-options button[aria-pressed=true]{opacity:1;border-color:#eacb8a;background:linear-gradient(145deg,#b5946b33,#9775b32b)}
.storey-role-options button:disabled:not([aria-pressed=true]){opacity:.42}
.storey-role-options .game-icon{width:32px;height:32px;color:#edcf9a}
.storey-role-options span{font-size:12px;color:#cfcede}
.storey-role-options small{margin-top:auto;color:#efce97}
#storeyBonusSummary{color:#cfb9e9;font-size:13px;line-height:1.7}
@media(max-width:600px){.storey-role-card{padding:16px}.storey-role-options{grid-template-columns:1fr}.storey-role-options button{min-height:110px;padding:16px}.profile-storeys>p{font-size:13px}}

/* Transparent tower cutouts let the shared sky gradient flow behind the story. */
.welcome-screen .login-world>img{width:82%;height:94%;margin:auto;mask-image:none;border-radius:0;background:transparent;filter:drop-shadow(0 18px 32px #02031544)}
.welcome-screen .login-halo{inset:0;transform:none;border-radius:50%;background:radial-gradient(ellipse,#d7a8e236,transparent 68%);box-shadow:none;opacity:1}
#finishPanel .finish-trade{width:100%;margin-top:10px;padding:12px 16px;border:1px solid #d8b6ee66;border-radius:14px;color:#f1dfff;background:#bfa3d50d;font-size:13px}
/* Stable setup navigation: only slide content scrolls. */
.player-setup[open]{display:flex;flex-direction:column;height:calc(100dvh - 64px);max-height:calc(100dvh - 64px);overflow:hidden}
.player-setup>.setup-header,.player-setup>.setup-progress{flex:none}
.player-setup>.setup-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 8px 12px 0}
.player-setup>footer{flex:none;margin-top:16px;padding-top:18px;padding-bottom:env(safe-area-inset-bottom,0px);background:transparent}
.game-tooltip[popover]{position:fixed;inset:auto;box-sizing:border-box;max-width:min(280px,calc(100vw - 24px));margin:0;padding:12px 16px;border:1px solid #d3b8e866;border-radius:12px;background:#171d32f5;color:#f2e9dc;box-shadow:0 10px 30px #0005;font:12px/1.6 var(--sans);pointer-events:none}
@media(max-width:760px){.player-setup[open]{height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);inset:12px auto}.player-setup>.setup-progress{margin-bottom:20px}.player-setup>footer{gap:12px}.player-setup footer .main-button{min-width:0}}

/* A quiet victory ceremony: one Sigil, eight lights, tangible rewards. */
#finishPanel{isolation:isolate;padding:24px;max-height:calc(100dvh - 116px);overflow-y:auto;overscroll-behavior:contain;border:1px solid #d4b78870;border-radius:28px;background:radial-gradient(ellipse at 50% 0,#69528655,transparent 60%),linear-gradient(155deg,#20243eea,#111e2bef);box-shadow:0 20px 70px #0006,0 0 36px #c0a0df12}
#finishPanel::before{content:'';position:absolute;top:12px;left:12px;right:12px;height:32px;border:1px solid #e5cba233;border-bottom:0;border-radius:18px 18px 0 0;pointer-events:none;z-index:-1}
.victory-crest{position:relative;display:grid;place-items:center;width:88px;height:88px;margin:0 auto 10px}
.victory-halo{position:absolute;inset:4px;border-radius:50%;border:1px solid #f3d79766;background:radial-gradient(circle,#ddc4f345,transparent 70%);box-shadow:0 0 28px #bca2dd44,inset 0 0 20px #f3d79722}
.victory-halo::after{content:'';position:absolute;inset:9px;border:1px solid #e5cc9b55;transform:rotate(45deg);border-radius:12px}
.victory-emblem{display:grid;place-items:center;filter:drop-shadow(0 0 12px #e4c4ff88)}
.victory-emblem>.game-icon{width:48px;height:48px;color:#f0d19d}
#finishPanel .victory-eyebrow{font:600 9px/1.5 var(--sans);letter-spacing:.22em;color:#d6bd94;margin:0 0 8px}
#finishPanel #finishTitle{font-size:30px;margin:0 0 18px}
#finishPanel #finishRewards{display:flex;justify-content:center;gap:12px;margin:0 0 20px}
.victory-reward{flex:1;max-width:160px;display:grid;grid-template-columns:30px auto;align-items:center;justify-content:center;gap:4px 8px;padding:12px 8px;border:1px solid #d4b78833;border-radius:16px;background:linear-gradient(130deg,#e4c5a311,#baa1e211)}
.victory-reward .game-icon{grid-row:span 2;width:30px;height:30px;color:#ebd0a1;filter:drop-shadow(0 0 7px #d2abe666)}
.victory-reward strong{font:600 24px/1 var(--sans);color:#f4daac;text-align:left;font-variant-numeric:tabular-nums}
.victory-reward span{font:11px/1.4 var(--sans);color:#d1c8df;text-align:left}
.victory-lights{display:flex;justify-content:center;gap:12px;margin:0 0 12px}
.victory-lights i{width:8px;height:8px;transform:rotate(45deg);border:1px solid #b8aac066;border-radius:2px;background:#b8aac00a}
.victory-lights .lit{background:#e8d3a4;border-color:#ffe8b6;box-shadow:0 0 9px #f3d29c77}
.victory-lights .new-light{animation:victory-light 2200ms cubic-bezier(.65,0,.35,1) both}
#finishPanel #finishSummary{font-size:12px;color:#b6c6d0;line-height:1.6}
#finishPanel #keeperSummary{font-size:11px;margin-bottom:18px;color:#d2bde9}
#scene #finishPanel #replayButton.finish-home{background:transparent;border:1px solid #c7c5dc33;color:#ddd9e8;box-shadow:none;min-height:42px}
#finishPanel #nextTowerButton{min-height:50px}
#finishPanel .finish-trade{margin-top:8px;padding:10px;font-size:12px}
.victory-spark{position:absolute;inset:0;transform:rotate(var(--angle));pointer-events:none}
.victory-spark::before{content:'';position:absolute;left:42px;top:8px;width:3px;height:3px;background:#f4dfa5;border-radius:50%;animation:victory-spark 2400ms cubic-bezier(.65,0,.35,1) var(--delay) both}
@keyframes victory-light{0%{opacity:.2;box-shadow:0 0 0 #f3d29c00}60%{opacity:1;box-shadow:0 0 20px #f3d29cbb}100%{opacity:1;box-shadow:0 0 9px #f3d29c77}}
@keyframes victory-spark{0%{opacity:0;translate:0 16px}35%{opacity:.8}100%{opacity:0;translate:0 -20px}}
@media(max-width:600px){#finishPanel{padding:20px;width:min(360px,calc(100vw - 32px))}.victory-crest{width:72px;height:72px}.victory-emblem>.game-icon{width:40px;height:40px}#finishPanel #finishTitle{font-size:27px}.victory-spark::before{left:34px}#finishPanel #finishRewards{margin-bottom:16px}}
@media(prefers-reduced-motion:reduce){.victory-spark{display:none}.victory-lights .new-light{animation:none}}

/* Brighter, readable editor interactions without abrupt movement. */
#scene .tower-editor :is(.editor-step-next,.editor-done,.editor-step-back,.window-style-carousel button){transition:filter 450ms cubic-bezier(.65,0,.35,1),box-shadow 450ms cubic-bezier(.65,0,.35,1),border-color 450ms cubic-bezier(.65,0,.35,1),background-color 450ms cubic-bezier(.65,0,.35,1)}
#scene .tower-editor .window-editor-actions :is(.editor-step-next,.editor-done):is(:hover,:focus-visible):not(:disabled){background:linear-gradient(120deg,#fff3d5,#ffebbb);color:#172436;border-color:#fff8e7;box-shadow:0 0 0 2px #f9ddb52b,0 5px 24px #f3ccaa33;filter:brightness(1.05)}
#scene .tower-editor :is(.editor-step-back,.window-style-carousel button):is(:hover,:focus-visible):not(:disabled){background:#dae5f12b;color:#fff5df;border-color:#e3d4bd99;box-shadow:0 0 0 2px #f9ddb518}
#scene .tower-editor button:focus-visible{outline:2px solid #f7dfb6;outline-offset:3px}
@media(prefers-reduced-motion:reduce){#scene .tower-editor button{transition:none!important}}
/* Purpose choice lives in the same floor-anchored editor as its final light. */
#scene .storey-role-editor{width:min(360px,calc(100vw - 28px));padding-bottom:14px}
.storey-role-editor .window-editor-header{gap:16px;margin-bottom:12px}
.storey-role-editor .inline-role-title{font:400 21px/1.4 var(--serif);margin:0}
.inline-role-copy{margin:0 0 16px;padding:0 12px;color:#d4cee0;font:12px/1.7 var(--sans)}
.inline-role-choices{display:grid;gap:8px}
#scene .inline-role-choices button{display:grid;grid-template-columns:34px 1fr auto;gap:4px 10px;align-items:center;min-height:72px;width:100%;padding:12px;border:1px solid #d3b8e83b;border-radius:14px;background:linear-gradient(120deg,#38334cc9,#15313bc9);text-align:left;color:#eee4d3}
.inline-role-choices svg{grid-row:span 2;width:28px;height:28px;color:#edce99}
.inline-role-choices strong{font-size:13px}
.inline-role-choices span{grid-column:2/4;font:11px/1.5 var(--sans);color:#c9c8d7}
.inline-role-choices small{grid-column:3;grid-row:1;color:#e5c79b;font-size:10px}
#scene .inline-role-choices button:hover:not(:disabled),#scene .inline-role-choices button:focus-visible:not(:disabled){background:#5c536a;color:#fff2d5;border-color:#efcda1}
#scene .inline-role-choices button:disabled{opacity:.4}
#scene .inline-role-later{position:static;width:100%;margin-top:12px;padding:10px;border:0;background:transparent;color:#c4c0d5;font-size:12px}
/* Purpose colours match the actual storey stonework. */
#scene .inline-role-choices button{border-left:4px solid var(--purpose-color,#d3b8e8)}
.inline-role-choices svg{color:var(--purpose-color,#edce99)}
/* Screen-resolution, transparent 3D intro artwork over the shared tower skies. */
.login-world>.intro-tower-canvas,.welcome-screen .login-world>.intro-tower-canvas{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:2;object-fit:contain;mask-image:none;border-radius:0;background:transparent}
.login-world>img[hidden]{display:none!important}
.login-screen .login-card{text-shadow:0 2px 12px #02031466}
.login-screen .login-footer{color:#ede0f0}
.setup-towers{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:760px){.setup-towers{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* The opening frames the real gameplay scene, without decorative model stand-ins. */
.welcome-screen .login-world :is(.login-orbit,.login-halo,.login-spark,.login-plinth){display:none}
.intro-preview-status{position:relative;z-index:3;margin:auto;color:var(--ds-muted);font:12px/1.6 var(--sans);text-align:center}
.intro-preview-status[hidden]{display:none}
.native-film-tower{position:relative;min-width:0;min-height:0}
.native-film-tower>.intro-tower-canvas{position:absolute;inset:0;display:block;width:100%;height:100%}
@media(max-width:760px){
 .welcome-screen[data-stage=story] .login-shell{box-sizing:border-box;height:100dvh;min-height:560px;padding:max(20px,env(safe-area-inset-top)) 24px max(16px,env(safe-area-inset-bottom));display:grid;grid-template-rows:44px minmax(0,1fr) 16px;gap:16px}
 .welcome-screen[data-stage=story] .login-header{gap:16px;min-width:0}.welcome-screen[data-stage=story] .login-header>img{width:144px;max-width:calc(100% - 124px)}
 .welcome-screen[data-stage=story] .login-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(180px,1fr) 300px;align-content:stretch;align-items:stretch;min-height:0;gap:12px;padding:0}
 .welcome-screen[data-stage=story] .login-world{width:100%;max-width:none;height:100%;min-height:0;margin:0}
 .welcome-screen[data-stage=story] .login-card{box-sizing:border-box;display:flex;flex-direction:column;width:100%;max-width:none;height:100%;min-height:0;margin:0;padding:0}
 .welcome-screen[data-stage=story] .login-card>.ds-eyebrow{font-size:9px;letter-spacing:.16em;margin:0 0 12px}
 .welcome-screen[data-stage=story] .login-card h1{display:block;font-size:clamp(30px,6.4vw,38px);line-height:1.18;min-height:2.36em;margin:0 0 12px}
 .welcome-screen[data-stage=story] .login-intro{font-size:16px;line-height:1.65;min-height:0;margin:0}
 .welcome-screen[data-stage=story] .login-methods{grid-template-columns:88px minmax(0,1fr);min-height:0;gap:12px;margin-top:auto;padding-top:16px}
 .welcome-screen[data-stage=story] .login-methods>button{min-height:52px;padding:14px 16px;font-size:14px}
 .welcome-screen[data-stage=story][data-slide="0"] .login-methods{grid-template-columns:minmax(0,1fr)}
 .welcome-screen[data-stage=story][data-slide="0"] .welcome-back{display:none}
 .welcome-screen[data-stage=story] :is(.login-note,.login-guest,.login-status:empty){display:none}
 .welcome-screen[data-stage=story] .login-footer{display:flex;min-width:0;gap:12px;align-items:center}
 .welcome-screen[data-stage=story] .login-footer>span:first-child{max-width:110px;font-size:7px;line-height:1.3;letter-spacing:.13em}
}
@media(max-width:380px){
 .welcome-screen[data-stage=story] .login-shell{padding-left:20px;padding-right:20px;gap:12px}
 .welcome-screen[data-stage=story] .login-header-actions{gap:8px}.welcome-screen[data-stage=story] .login-demo{padding:6px 8px}
 .welcome-screen[data-stage=story] .login-layout{grid-template-rows:minmax(140px,1fr) 280px;gap:8px}
 .welcome-screen[data-stage=story] .login-card h1{font-size:30px}.welcome-screen[data-stage=story] .login-intro{font-size:15px}
}
@media(max-width:760px) and (max-height:600px) and (min-width:560px){
 .welcome-screen[data-stage=story] .login-shell{min-height:360px;padding:12px 20px;gap:8px;grid-template-rows:40px minmax(0,1fr) 12px}
 .welcome-screen[data-stage=story] .login-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);grid-template-rows:minmax(0,1fr);gap:20px}
 .welcome-screen[data-stage=story] .login-card h1{font-size:28px;margin-bottom:8px}.welcome-screen[data-stage=story] .login-intro{font-size:14px;line-height:1.5}
 .welcome-screen[data-stage=story] .login-card>.ds-eyebrow{font-size:8px;margin-bottom:8px}
 .welcome-screen[data-stage=story] .login-methods{padding-top:8px}.welcome-screen[data-stage=story] .login-methods>button{min-height:44px;padding:10px 12px;font-size:12px}
}

/* Center the setup dialog without combining an auto inset with a half-width shift. */
.player-setup[open]{inset:0;margin:auto;transform:none;translate:none;isolation:isolate;width:min(1040px,calc(100vw - 48px));height:calc(100dvh - 48px);max-height:calc(100dvh - 48px)}
.player-setup::before{position:absolute}
.player-setup>.setup-scroll{min-width:0;width:100%;box-sizing:border-box;overflow-x:hidden}
.player-setup .setup-status:empty{display:none}
@media(max-width:760px){
 .player-setup[open]{inset:0;width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);padding:24px 20px}
 .player-setup .setup-header{min-width:0;gap:12px;margin-bottom:24px}
 .player-setup .setup-header>img{width:148px;max-width:calc(100% - 130px);height:auto}
 .player-setup .setup-header>button{flex:none;min-height:44px;padding:10px 14px;font-size:12px}
 .player-setup .setup-progress{width:100%;max-width:none;gap:12px;margin:0 0 24px}
 .player-setup .setup-progress>span{min-width:0;flex-direction:column;text-align:center;gap:6px;font-size:10px;line-height:1.3}
 .player-setup .setup-introduction{grid-template-columns:minmax(0,1fr) 96px;gap:12px;margin-bottom:24px}
 .player-setup .setup-introduction .setup-illustration{width:96px;max-width:100%;height:104px}
 .player-setup .setup-introduction h1{font-size:30px;margin-bottom:12px}
 .player-setup .setup-help{font-size:13px;line-height:1.6}
 .player-setup .setup-name input{box-sizing:border-box;min-width:0;max-width:100%;width:100%}
 .player-setup .setup-ages{grid-template-columns:repeat(2,minmax(0,1fr))}
 .player-setup .setup-choice{box-sizing:border-box;min-width:0;white-space:normal}
 .player-setup>footer{gap:12px;margin-top:12px;padding-top:16px}
 .player-setup>footer .main-button{flex:1;min-width:0;min-height:52px;padding:14px 16px}
 .player-setup>footer>button:not(.main-button){flex:none;min-height:52px;padding:14px 16px}
 /* Let the form set its own height so wrapped labels and the email fields can scroll together. */
 .welcome-screen[data-stage=signin] .login-shell{
  height:auto;min-height:100svh;display:grid;grid-template-rows:auto 1fr auto;gap:16px;
  padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))
 }
 .welcome-screen[data-stage=signin] .login-header{gap:12px}
 .welcome-screen[data-stage=signin] .opening-brand .opening-wordmark{min-width:0;width:clamp(88px,32vw,150px)}
 .welcome-screen[data-stage=signin] .login-header-actions{flex-shrink:0;gap:8px}
 .welcome-screen[data-stage=signin] .login-layout{
  display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:0
 }
 .welcome-screen[data-stage=signin] .login-world{width:100%;max-width:none;height:clamp(140px,36svh,360px);min-height:0;margin:0}
 .welcome-screen[data-stage=signin] .login-card{
  box-sizing:border-box;width:100%;max-width:480px;margin:0 auto;padding:clamp(16px,5vw,24px)
 }
 .welcome-screen[data-stage=signin] .login-card h1{font-size:clamp(26px,7vw,32px);line-height:1.18;overflow-wrap:anywhere}
 .welcome-screen[data-stage=signin] .login-intro{font-size:16px;line-height:1.5;margin:0 0 18px}
 .welcome-screen[data-stage=signin] .login-methods>button{min-height:48px;padding:12px 16px;font-size:14px}
 .welcome-screen[data-stage=signin] .login-note{min-height:0;margin:16px 0 8px;font-size:11px}
 .welcome-screen[data-stage=signin] .login-footer{display:flex}
 .welcome-screen[data-stage=signin] .login-footer>span:first-child{max-width:none}
 .welcome-screen[data-stage=signin]:has(.login-email-form) .login-world{display:none}
 .welcome-screen[data-stage=signin]:has(.login-email-form) .login-card{overflow:visible;max-height:none}
 .welcome-screen[data-stage=signin] .login-site-footer{position:static}
}
@media(max-width:380px){.player-setup .setup-introduction{grid-template-columns:minmax(0,1fr)}.player-setup .setup-introduction .setup-illustration{display:none}.player-setup .setup-introduction h1{font-size:28px}.player-setup .setup-skies{grid-template-columns:repeat(2,minmax(0,1fr))}.player-setup .setup-towers{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep the copy readable over every island sky, including the bright Aurora. */
.login-screen .login-card{isolation:isolate}
.login-screen .login-card::before{content:none}
.login-screen .login-card .login-intro{color:#f4ede3}
.login-screen .login-card .login-note{color:#e3dce1}
.welcome-screen[data-stage=story] .login-methods{grid-template-columns:52px minmax(0,1fr)}
.welcome-screen[data-stage=story] .welcome-back{display:grid;place-items:center;width:52px;height:52px;min-height:52px;padding:0;font-size:24px;line-height:1}
.welcome-screen[data-stage=story][data-slide="0"] .login-methods{grid-template-columns:minmax(0,1fr)}
.welcome-screen[data-stage=story][data-slide="0"] .welcome-back{display:none}
.login-screen{overflow-x:hidden}

/* Mobile panels fill the page between its gutters; no narrow inner card. */
@media(max-width:760px){
 .login-screen .login-shell{width:100%;max-width:none;margin:0;grid-template-columns:minmax(0,1fr)}
 .login-screen .login-layout{box-sizing:border-box;width:100%;max-width:none;min-width:0;justify-self:stretch;justify-items:stretch}
 .login-screen .login-card{box-sizing:border-box;width:100%;max-width:none;min-width:0;margin:0;justify-self:stretch;align-self:stretch;grid-column:1/-1}
 .login-screen .login-card :is(.login-methods,.login-email-form){box-sizing:border-box;width:100%;min-width:0}
 .login-screen .login-header,.login-screen .login-footer{box-sizing:border-box;width:100%;min-width:0}
}
#questionPanel .feedback.wrong .score-pill{color:#efbbb0}

/* Appearance belongs to profile Settings; it is optional after onboarding. */
.profile-appearance{margin:24px 0;padding-top:24px;border-top:1px solid var(--ds-border)}
.profile-appearance-choices{display:grid;gap:24px;min-width:0}
.profile-appearance-choices fieldset{min-width:0;margin:0;padding:0;border:0}
.profile-appearance-choices legend{margin-bottom:12px;font-size:14px;font-weight:600}
.profile-appearance-choices .setup-towers{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.profile-appearance-choices .setup-choice{box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;min-width:0;padding:12px;border:1px solid var(--ds-border);border-radius:var(--radius-control);background:#cbb7e00a;color:var(--ds-text);cursor:pointer}
.profile-appearance-choices .setup-choice:has(input:checked){border-color:var(--ds-peach);background:#f3ccaa18}
.profile-appearance-choices .setup-choice:has(input:focus-visible){outline:2px solid var(--ds-peach);outline-offset:3px}
.profile-appearance-choices .setup-towers img{width:100%;height:160px;object-fit:contain}
.profile-appearance-choices .setup-choice span{font-size:12px;line-height:1.5;text-align:center}
.profile-appearance-choices .setup-skies{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.profile-appearance-choices .setup-sky-choice{min-height:104px;align-items:flex-end;background:var(--sky-preview)}
.profile-appearance-choices .setup-sky-choice:has(input:checked){background:var(--sky-preview);outline:2px solid var(--ds-peach);outline-offset:3px}
.profile-appearance-choices .setup-sky-choice span{padding:4px 8px;border-radius:var(--radius-pill);background:#12132ddd;color:#fff3dd}
@media(max-width:760px){.profile-appearance-choices .setup-towers{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-appearance-choices .setup-skies{grid-template-columns:repeat(2,minmax(0,1fr))}}

#questionPanel .question-pool-note{grid-column:1/-1;margin:0 0 12px;color:var(--ds-text);font:14px/1.7 var(--sans)}

/* Short asides follow the real Knowling without blocking tower gestures. */
.knowling-speech{box-sizing:border-box;position:absolute;z-index:12;width:min(260px,calc(100% - 28px));padding:14px 18px;border:1px solid #e8d2a56b;border-radius:18px;background:#f7ecd5;color:#26333c;box-shadow:0 8px 26px #0003;pointer-events:none;opacity:1;transition:opacity .4s ease}
.knowling-speech[hidden]{display:none}
.knowling-speech[data-fading=true]{opacity:0}
.knowling-speech::after{content:'';position:absolute;left:var(--speech-tail-x,24px);bottom:-7px;width:12px;height:12px;background:#f7ecd5;border-right:1px solid #e8d2a56b;border-bottom:1px solid #e8d2a56b;transform:translateX(-50%) rotate(45deg)}
.knowling-speech[data-tail=top]::after{bottom:auto;top:-7px;transform:translateX(-50%) rotate(225deg)}
.knowling-speech p{margin:0;font:500 13px/1.6 var(--sans);text-wrap:pretty}
.knowling-speech:has(.knowling-speech-action){pointer-events:auto;padding:0}
.knowling-speech:has(.knowling-speech-action) p{padding:14px 18px 10px}
.knowling-speech-actions{display:grid}
.knowling-speech-actions:empty{display:none}
.knowling-speech .knowling-speech-action{
 box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:54px;padding:12px 18px;
 border:0;border-top:1px solid #d2c3a2;border-radius:0;background:#fffbf3;color:#005fcd;
 font:650 14px/1.45 var(--sans);text-align:start;overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:3px;cursor:pointer
}
.knowling-speech-action::after{content:'';flex:0 0 21px;height:18px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2 10h19m-7-7 7 7-7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
.knowling-speech-action:last-child{border-radius:0 0 17px 17px}
.knowling-speech .knowling-speech-action:hover,.knowling-speech .knowling-speech-action:focus-visible{background-color:#eef4fb}
.knowling-speech .knowling-speech-action:focus-visible{outline:2px solid currentColor;outline-offset:-4px}
.knowling-speech .knowling-speech-action:active{background-color:#dceafa}
.knowling-speech:has(.knowling-speech-action):not([data-tail=top])::after{background:#fffbf3;pointer-events:none}
@media (prefers-reduced-motion:no-preference){
 .knowling-speech .knowling-speech-action{
  background-image:linear-gradient(105deg,transparent 32%,rgb(96 175 255 / 16%) 50%,transparent 68%);
  background-size:250% 100%;background-repeat:no-repeat;background-position:100% 0;
  animation:speech-action-light 5s ease-out infinite backwards;
  transition:background-color 160ms ease,box-shadow 100ms ease;
 }
 .knowling-speech .knowling-speech-action:nth-child(2){animation-delay:110ms}
 .knowling-speech-action::after{transition:transform 180ms ease-out}
 .knowling-speech .knowling-speech-action:focus-visible::after{transform:translateX(4px)}
 @media (hover:hover){.knowling-speech .knowling-speech-action:hover::after{transform:translateX(4px)}}
 .knowling-speech .knowling-speech-action:active{box-shadow:inset 0 0 0 2px rgb(0 95 205 / 18%)}
 .knowling-speech .knowling-speech-action:active::after{transform:translateX(2px) scale(.91);transition-duration:80ms}
}
@keyframes speech-action-light{0%{background-position:100% 0}16.4%,100%{background-position:0% 0}}
[data-speech-proxied]{visibility:hidden!important;pointer-events:none!important}
/* Actions offered in the speech bubble take no space in the results panel. */
#scene #finishPanel .finish-navigation [data-speech-proxied],
#scene #finishPanel .finish-navigation:not(:has(button:not([hidden],[data-speech-proxied]))){display:none!important}
@media(prefers-reduced-motion:reduce){.knowling-speech{transition:none}}

/* The Knowling now delivers these action notices beside the character. */
#sceneMessages,#homeNotice,#journeyHint{display:none!important}

/* Keep unavailable building slots visible, with no active glow or hover lift. */
.scene[data-phase=home] .destination:disabled{opacity:.4;pointer-events:auto;cursor:not-allowed}
.scene[data-phase=home] .destination:disabled:before{inset:9px;border-color:#a6b4ba66;background:#20313b55;box-shadow:none;animation:none}
.scene[data-phase=home] .destination:disabled .destination-icon{filter:grayscale(1);color:#a7b3ba}
#scene[data-phase=home] #towerStoreyControl #upgradeButton:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}

#questionPanel[data-state=feedback] h2{font-size:clamp(21px,2.6vw,29px);margin-bottom:24px}
#questionPanel .feedback.wrong .answer-help{border:0;padding:0;display:flex;gap:12px;margin:22px 0 0}
#questionPanel .feedback.wrong #retryAnswer{flex:1;background:var(--ds-dawn);border-color:#ffe4b3;color:#172934;font-weight:600}
#questionPanel .feedback.wrong:not(.revealed) #nextButton{width:auto;min-width:0;display:block;margin:12px 0 0 auto;padding:10px 0;background:none;border:0;box-shadow:none;color:#c7d3da;font-size:13px}

/* Tall-storey editing keeps its header and actions inside the viewport. */
.defense-builder.tower-editor{overscroll-behavior:contain;scroll-padding:76px 0;transform:none;translate:none}
.tower-editor .window-editor-header{position:sticky;top:-22px;z-index:2;background:#152831;padding:12px 0}
.tower-editor .window-editor-actions{position:sticky;bottom:-22px;z-index:2;padding:12px 0;margin-bottom:0}

.daily-hub-button{position:absolute;left:32px;top:96px;z-index:6;padding:12px 18px;border:1px solid #d7c6e05c;border-radius:16px;background:#172e3aeb;color:#fae3b4;font:500 13px/1.5 var(--sans)}
.daily-hub-button:disabled{opacity:.45;cursor:not-allowed}
.scene:not([data-phase=home]) .daily-hub-button,.scene:has(.tower-editor:not([hidden])) .daily-hub-button{display:none}
.daily-hub{box-sizing:border-box;width:min(960px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:32px;border:1px solid #cab7de55;border-radius:26px;background:linear-gradient(#02031496,#02031496),var(--daily-sky);color:#f7eedb;overflow:auto;font-family:var(--sans)}
.daily-hub::backdrop{background:#030611c9;backdrop-filter:blur(8px)}
.daily-hub header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}
.daily-hub h2{font:400 clamp(28px,4vw,40px)/1.2 var(--serif);margin:8px 0}
.daily-hub h3{font:400 27px/1.3 var(--serif);margin:8px 0 16px}
.daily-hub p{font-size:14px;line-height:1.7}.daily-hub .kicker{font-size:10px;color:#e9c99b}
.daily-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.daily-grid>section{padding:24px;border:1px solid #d2c1df33;border-radius:20px;background:#ffffff04}
.daily-feature{background:linear-gradient(#02031496,#02031496),var(--daily-tower-sky)!important}
.daily-feature .main-button{width:100%;margin-top:24px;min-height:52px}
.daily-date{color:#bcc8d0;font-size:12px!important}
.daily-close{width:44px;height:44px;flex:none;border:1px solid #d9c3df66;border-radius:50%;background:transparent;color:inherit;font-size:25px}
.league-demo{display:inline-block;padding:5px 10px;border:1px solid #dfc69877;border-radius:20px;color:#f2d8a7;font-size:11px!important}
.daily-league ol{list-style:none;padding:0}
.daily-league li{display:flex;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid #cbbbd51f;font-size:13px}
.daily-league .league-rank{min-width:2ch;color:#f0d39d;font-variant-numeric:tabular-nums}
.daily-standing{display:flex;align-items:center;gap:4px 14px;flex-wrap:wrap;margin-top:12px;color:#f1dbb9;font:500 14px/1.5 var(--sans)}
.daily-result .daily-standing{justify-content:center}
.daily-standing button{background:transparent;border:0;color:#f3eafa;padding:8px 0;text-decoration:underline;text-underline-offset:3px;font:inherit;cursor:pointer}
.daily-league strong{margin-left:auto;white-space:nowrap;color:#f0d39d}
.daily-league .league-you{margin-top:12px;padding:14px;border:1px solid #9dc8bd66;border-radius:12px;background:#7bb9a710}
.daily-league small{font-size:11px;line-height:1.6;color:#bcc8d0}
.daily-sharing{grid-column:1/-1}.sharing-actions{display:flex;gap:12px;flex-wrap:wrap}
.sharing-actions button,.finish-share{min-height:48px;padding:12px 18px;border:1px solid #cfbddf66;border-radius:14px;background:#27334a;color:#f7e9ce;font:500 13px var(--sans)}
.finish-share{width:100%;margin-top:12px}.share-fallback{box-sizing:border-box;width:100%;min-height:110px;margin-top:16px;padding:16px;background:#111f30;color:#f7eedb;border:1px solid #cab7de55;border-radius:12px;font:14px/1.6 var(--sans)}
@media(max-width:760px){.daily-hub{padding:22px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.daily-grid{grid-template-columns:1fr}.daily-grid>section{padding:20px}.daily-hub-button{top:154px;left:20px;font-size:12px}.sharing-actions button{flex:1 1 140px}}
.daily-score-breakdown{width:100%;margin:0;font:12px/1.5 var(--sans)}.daily-score-breakdown>div{display:flex;justify-content:space-between;gap:16px;padding:5px 0;border-bottom:1px solid #d2c1df22}.daily-score-breakdown dt{color:#d3d9df}.daily-score-breakdown dd{margin:0;color:#f1d5a1;font-variant-numeric:tabular-nums}

.finish-panel{max-height:calc(100dvh - 120px);overflow-y:auto;overscroll-behavior:contain}

/* The Dispatch opens as a spacious page within the same island skies. */
.daily-hub{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:clamp(28px,5vw,72px) max(28px,calc((100vw - 1200px)/2));border:0;border-radius:0;background:linear-gradient(#02031496,#02031496),var(--daily-sky);background-attachment:fixed;scrollbar-gutter:stable;color:#fbf0dd}
.daily-hub>header{max-width:1200px;margin:0 auto 56px;padding-right:56px}
.daily-hub h2{font-size:clamp(34px,4.6vw,62px);line-height:1.14;max-width:720px;margin:16px 0}
.daily-hub .kicker{letter-spacing:.17em;color:#eecda4}
.daily-hub .daily-close{position:fixed;right:clamp(20px,3vw,48px);top:clamp(20px,3vw,40px);z-index:3;width:48px;height:48px;background:#142138ed;backdrop-filter:blur(12px)}
.daily-grid{max-width:1200px;margin:0 auto;gap:48px;grid-template-columns:1fr 1fr;align-items:start}
.daily-grid>section{min-width:0;border:0;padding:36px;border-radius:28px}
.daily-grid .daily-feature{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:center;overflow:hidden;position:relative;min-height:460px;padding:48px;background:linear-gradient(#02031496,#02031496),var(--daily-tower-sky)!important;box-shadow:inset 0 1px 0 #d6ede82b}
.daily-feature h3{font-size:clamp(32px,3.5vw,48px);line-height:1.2;margin:20px 0 24px;color:#fff0d0}
.daily-feature .daily-description{max-width:420px;color:#e0e7e6;font-size:16px;line-height:1.8}
.daily-feature .daily-growth{max-width:420px;color:#f1d9b5;font-size:14px;line-height:1.6}
.daily-feature .daily-date{max-width:420px;margin:24px 0;color:#c3d4d9}
.daily-feature .main-button{width:auto;min-width:240px;margin-top:12px;padding:16px 24px;background:var(--ds-dawn);color:#142638;border-color:#ffefc6}
.daily-tower-art{position:relative;display:grid;place-items:center;margin:0;min-width:0;isolation:isolate}
.daily-tower-art::before{content:'';position:absolute;inset:8% -15%;z-index:-1;border-radius:50%;background:transparent}
.daily-tower-art img{display:block;width:100%;max-width:360px;height:400px;object-fit:contain;filter:drop-shadow(0 20px 32px #030a1b66)}
.daily-grid .daily-league{position:relative;background:linear-gradient(#02031496,#02031496),var(--daily-league-sky);padding:36px;box-shadow:inset 0 1px 0 #dbc2f126}
.daily-league h3{font-size:30px;margin:20px 0}
.daily-league>p:not(.kicker):not(.league-demo){color:#d7d4e3;max-width:360px}
.daily-league-art{float:right;width:88px;height:88px;margin:-4px -4px 12px 20px;background:url('assets/badges/keeper-medallions.webp') 0 0/200% 200% no-repeat;filter:drop-shadow(0 6px 12px #100e263b)}
.daily-league ol{clear:both;margin:28px 0}
.daily-league li{padding:20px 0;font-size:14px}.daily-league strong{color:#f2d19a}
.daily-league .league-you{background:#122c35b3;border-color:#80c4ae66;padding:20px 16px}
.daily-grid .daily-sharing{grid-column:auto;background:linear-gradient(#02031496,#02031496),var(--daily-sharing-sky);padding:36px;box-shadow:inset 0 1px 0 #eed6b126}
.daily-sharing-art{display:block;width:min(260px,85%);height:175px;object-fit:contain;margin:0 auto 32px;filter:drop-shadow(0 10px 20px #06122440)}
.daily-sharing h3{font-size:32px;margin:20px 0}.daily-sharing>p:not(.kicker){color:#e0e2df}
.daily-sharing .sharing-actions{margin-top:28px;gap:12px}.daily-sharing .sharing-actions button{flex:1 1 140px;background:#243d4ac9;border-color:#a8c8c14d}
.daily-sharing .sharing-actions button:hover{background:#3b5963;border-color:#e8d5b2}
@media(max-width:760px){
 .daily-hub{padding:32px 20px 56px;scrollbar-gutter:auto}
 .daily-hub>header{margin-bottom:32px;padding-right:48px}.daily-hub h2{font-size:36px}
 .daily-grid{grid-template-columns:minmax(0,1fr);gap:28px}
 .daily-grid .daily-feature{grid-template-columns:minmax(0,1fr);gap:24px;padding:28px;min-height:0}
 .daily-tower-art{grid-row:1;min-height:250px}.daily-tower-art img{height:280px;max-width:260px}
 .daily-feature .main-button{width:100%;min-width:0}.daily-feature .daily-description{font-size:15px}
 .daily-grid .daily-league,.daily-grid .daily-sharing{padding:28px}.daily-league-art{width:72px;height:72px}
 .daily-sharing-art{margin-bottom:24px}.daily-feature h3{font-size:34px}
}

.player-setup{background:linear-gradient(#02031496,#02031496),var(--setup-palette);background-attachment:fixed}
.social-sharing-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:28px 0 16px}
.social-share-link{display:flex;align-items:center;justify-content:center;min-height:54px;padding:14px 10px;border:1px solid #c8ddd366;border-radius:14px;background:#14283abf;color:#fff3dd;font:600 14px/1.5 var(--sans);text-decoration:none;text-align:center}
.social-whatsapp{border-color:#7bc9a5;background:#164638c9}.social-facebook{border-color:#92b6e7;background:#213e65c9}.social-x{border-color:#c5cbd6;background:#17212dc9}
.social-share-link:hover:not(:disabled){filter:brightness(1.2)}.social-share-link:focus-visible{outline:2px solid #ffe0a3;outline-offset:3px}.social-share-link:disabled{opacity:.5;cursor:default}
.daily-sharing .social-sharing-note{font-size:12px;color:#d6dfe1;line-height:1.7}.daily-sharing .sharing-actions{padding-top:20px;border-top:1px solid #d7d3df33;margin-top:20px}
@media(max-width:380px){.social-sharing-actions{grid-template-columns:1fr}.social-share-link{min-height:48px}}
.opening-brand{display:flex;align-items:center;gap:14px;min-width:0}.login-header .opening-brand .opening-key{width:44px;height:30px;object-fit:contain;filter:none;flex:none}.login-header .opening-brand .opening-wordmark{width:240px;height:auto;object-fit:contain}
.opening-sound{min-height:44px;padding:10px 14px;border:1px solid #d2c1df66;border-radius:24px;background:#142338b3;color:#fff0d0;font:500 12px/1.4 var(--sans);white-space:nowrap}
#gameLoading>.opening-sound{position:absolute;top:24px;right:24px}.login-header-actions{flex-wrap:wrap;justify-content:flex-end}
@media(max-width:600px){.login-header .opening-brand .opening-key{width:28px;height:24px}.login-header .opening-brand .opening-wordmark{width:144px}.opening-brand{gap:8px}.opening-sound{font-size:11px;padding:8px 10px}.login-header-actions .login-demo{display:none}}
.runtime-recovery{position:fixed;z-index:9999;inset:auto;margin:0;box-sizing:border-box;left:50%;bottom:24px;transform:translateX(-50%);width:min(440px,calc(100vw - 32px));padding:20px;border:1px solid #f1d6a5;border-radius:18px;background:#142738f5;color:#fff0d3;font:14px/1.6 var(--sans);box-shadow:0 8px 36px #0006}.runtime-recovery p{margin:0 0 14px}.runtime-recovery button{width:100%;min-height:48px;border:1px solid #eed29d;border-radius:12px;background:var(--ds-dawn);color:#162b37;font:600 14px var(--sans)}

.opening-brand .opening-wordmark{filter:brightness(0) invert(1)}

.story-narration{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0;color:var(--ds-text)}
.story-narration[hidden]{display:none}
.story-narration .story-listen{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:auto;padding:10px 14px;font:500 14px/1.4 var(--sans);letter-spacing:0}
.story-narration .story-replay{display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;flex:none}
.story-narration progress{width:76px;height:4px;flex:1;min-width:36px;max-width:120px;accent-color:var(--ds-dawn)}
.story-narration-status{width:100%;font:400 12px/1.5 var(--sans);color:var(--ds-muted)}
.story-narration-status:empty{display:none}

/* The card is composed from the player's real model and earned achievements. */
.share-card-preview{margin:24px 0;color:var(--ds-text);font:500 13px/1.5 var(--sans)}
.share-card-preview summary{cursor:pointer;min-height:40px;padding:10px 0}
.share-card-preview img{display:block;width:min(100%,320px);height:auto;margin:12px auto 0;border:1px solid var(--ds-border);border-radius:18px;box-shadow:0 12px 32px #08091f33}
.share-card-preview img[hidden]{display:none}
.share-panel .social-sharing-actions{margin:16px 0 12px}.share-panel .social-sharing-note{font:400 12px/1.6 var(--sans);color:var(--ds-muted)}
.share-panel .share-status:empty{display:none}.share-panel .share-status{font:400 12px/1.6 var(--sans);color:var(--ds-peach);margin:12px 0 0}
.finish-sharing{margin-top:24px;padding-top:20px;border-top:1px solid var(--ds-border);text-align:left}
.finish-sharing>.kicker{font:600 10px/1.5 var(--sans);letter-spacing:.15em;color:var(--ds-peach)}
.finish-sharing .social-sharing-actions{gap:8px}.finish-sharing .social-share-link{min-height:44px;padding:10px 8px;font-size:12px}
.finish-sharing .sharing-actions{gap:8px}.finish-sharing .sharing-actions button{flex:1 1 100px;padding:10px 8px;min-height:44px;font-size:12px}
.finish-sharing .share-card-preview{position:relative;width:min(100%,320px);margin:0 auto;min-height:64px}
.finish-sharing .share-card-preview img{box-sizing:border-box;width:100%;margin:0}
.finish-results{min-width:0}
.finish-navigation{padding-top:16px}
@media(min-width:900px){
 .finish-results{align-self:stretch;display:flex;flex-direction:column}
 .finish-navigation{margin-top:auto}
}.finish-sharing .social-sharing-note{font-size:11px}
.share-panel button:disabled{opacity:.5}.share-panel button:not(:disabled){cursor:pointer}

@media (min-width: 900px) {
  #finishPanel:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 32px;
    width: min(860px, calc(100vw - 64px));
  }
  #finishPanel .finish-sharing {
    margin: 0;
    padding: 0 0 0 28px;
    border-top: 0;
    border-left: 1px solid var(--ds-border);
  }
}

.daily-result{width:100%;text-align:center}
.daily-result>img{display:block;object-fit:contain;margin:0 auto 6px}
.daily-result>strong{display:block;font:500 28px/1.25 var(--serif);color:var(--ds-ivory)}
.daily-result details{margin-top:8px}
.daily-result summary{padding:10px;cursor:pointer;font:500 13px/1.5 var(--sans)}
.daily-result dl{text-align:left}
.finish-sharing .sharing-actions{position:absolute;top:8%;right:8px;display:flex;justify-content:flex-end;gap:4px;margin:0;padding:0;border:0}
.finish-sharing .sharing-actions button{flex:none;width:44px;height:44px;padding:10px;border-radius:50%;background:#162134f2;border:1px solid #a9b6c599}
.finish-sharing .sharing-actions svg{width:21px;height:21px;vertical-align:middle}

.daily-result dt{display:flex;align-items:center;gap:9px}
.daily-result dt svg{width:18px;height:18px;color:var(--ds-peach)}
.daily-result>strong{font-variant-numeric:tabular-nums}

.opening-sound{display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border-radius:50%;flex:none}
.opening-sound[aria-pressed="true"] .sound-slash,.opening-sound[aria-pressed="false"] .sound-waves{display:none}
@media(max-width:760px) and (orientation:portrait){
 .welcome-screen[data-stage=story] .login-shell{height:auto;min-height:100dvh;grid-template-rows:auto 1fr auto}
 .welcome-screen[data-stage=story] .login-layout{grid-template-rows:minmax(140px,1fr) auto}
 .welcome-screen[data-stage=story] .login-card{height:auto;min-height:0}
 .welcome-screen[data-stage=story] .login-card h1{min-height:0}
 .welcome-screen[data-stage=story] .login-methods{margin-top:12px}
}

#scene .mobile-game-toggle{display:none}
#mobileGameMenu {
 position:fixed;inset:68px 16px auto auto;box-sizing:border-box;width:min(248px,calc(100vw - 32px));
 margin:0;padding:8px;border:1px solid var(--ds-border);border-radius:20px;
 background:linear-gradient(145deg,#2a263f,#162b37);color:var(--ds-ivory);box-shadow:none;
}
#mobileGameMenu button {
 display:block;width:100%;min-height:54px;padding:12px 16px;text-align:left;
 font:300 18px/1.4 system-ui,sans-serif;background:transparent;border:0;border-radius:12px;color:inherit;
 box-shadow:none;text-shadow:none;backdrop-filter:none;
}
#mobileGameMenu button:is(:hover,:focus-visible){background:#2b3445;box-shadow:none}
#mobileGameMenu button:focus-visible{outline:2px solid var(--ds-peach);outline-offset:-2px}
#mobileGameMenu button[hidden]{display:none}
@media(min-width:761px){
 #scene .mobile-game-toggle{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;padding:0}
 #scene #soundControls{right:32px}
 #scene #soundSettings,body>.profile-button{display:none}
 #mobileGameMenu{top:80px;right:32px}
}
.leaderboard-screen .daily-grid{display:block;max-width:680px;margin-inline:auto}
@media(max-width:760px){
 .profile-items .supply-card>button{grid-column:1/-1;justify-self:stretch;width:100%}
}
@media(max-width:760px){
 #scene .mobile-game-toggle{display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:50%}
 #scene #soundControls{right:16px}
 #scene #soundSettings,body>.profile-button{display:none}
 #scene #soundToggle{position:absolute;top:68px;right:0}
 #scene[data-phase=home] #soundToggle{top:56px}
 #scene[data-phase=home] #homeBalance{top:72px}
 #scene[data-phase=home] .daily-hub-button{top:124px;left:16px}
 #scene[data-phase=home] #startButton{bottom:max(20px,env(safe-area-inset-bottom));min-width:0}
 #scene[data-phase=home] :is(.tower-view,#exploreButton){bottom:calc(max(20px,env(safe-area-inset-bottom)) + 76px)}
}

.question-controls{position:absolute;z-index:25;display:flex;align-items:center;gap:10px;color:#e4d3b4;font:500 12px/1.5 var(--sans)}
.question-controls[hidden],.question-controls [hidden]{display:none}
.question-controls :is(.clock,#untimedNote){padding:5px 11px;border:1px solid #eddbb34d;border-radius:20px;background:#172638;font-variant-numeric:tabular-nums}
.question-controls #closeQuestion{position:static;pointer-events:auto}
.potion-art{position:relative;display:inline-flex;flex:none;margin-right:5px}
#questionPanel #tradePotions{align-self:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid #e2cda047;border-radius:50%;background:#ead09e0b;color:#f1d6a4}
#questionPanel #tradePotions:hover,#questionPanel #tradePotions:focus-visible{background:#ead09e20;border-color:#e2cda0aa}
#tradePotions .game-icon{width:24px;height:24px}
#questionPanel .potions .potion-count{position:absolute;top:-5px;right:-5px;box-sizing:border-box;display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 3px;border:1px solid #e4c6fd77;border-radius:10px;background:#453655;color:var(--ds-ivory);font:600 11px/1 var(--sans);font-variant-numeric:tabular-nums}

.tower-editor .window-editor-actions>button[hidden]{display:none}
.tower-editor .editor-price{display:inline-flex;align-items:center;gap:4px;vertical-align:middle}
.tower-editor .editor-price .game-icon{width:18px;height:18px}

/* Keep profile sections readable against each tab’s tower sky. */
.profile-tab-content .profile-tab-panel{
 display:grid;gap:28px;max-width:none;
}
.profile-tab-content .profile-tab-panel>section{
 min-width:0;margin:0;padding:clamp(16px,3vw,28px);
 border:1px solid var(--ds-border);border-radius:20px;background:#12152ab3;
}
.profile-tab-panel>section>h3{
 margin:0 0 16px;color:var(--ds-ivory);font:400 clamp(22px,3vw,28px)/1.2 var(--serif);
}
.profile-tab-panel>section>p{max-width:65ch}
.profile-overview .profile-name{display:grid;gap:8px;margin:0 0 20px;max-width:420px}
.profile-overview .profile-stats{gap:12px;margin-bottom:0}
.profile-tab-content .profile-tab-panel>section.profile-resource{
 max-width:none;flex-direction:row;text-align:left;gap:clamp(12px,3vw,24px);
 background:linear-gradient(125deg,#31283de8,#202538e0);
}
.profile-resource img{width:clamp(60px,14vw,104px);height:auto}
.profile-resource h3{margin:0 0 6px}
.profile-resource p{margin:8px 0 0;font-size:13px}
.profile-tab-content .profile-tab-panel>section:is(.profile-trading,.profile-items){
 padding:0;border:0;background:none;
}
.profile-tab-panel .profile-section-intro{margin:0;color:var(--ds-muted);font-size:14px}
.profile-tab-panel .profile-badges .badge-collection{max-width:none;grid-template-columns:repeat(4,minmax(0,1fr))}
.profile-tab-panel .collectible-badge{min-width:0;overflow-wrap:anywhere}
.profile-tab-panel .badge-art{max-width:100%}
.topic-milestone{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px}
.topic-milestone-art{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(145deg,#564465,#273343);box-shadow:inset 0 0 0 1px #ddc1ef33}
.topic-milestone-art .game-icon{width:30px;height:30px}
.profile-tab-panel .profile-topic-progress>div>p{grid-column:1/-1;margin:0}
.profile-tab-panel .profile-appearance>p{margin:0 0 16px}
@media(max-width:760px){
 .profile-tab-content .profile-tab-panel{gap:18px}
 .profile-tab-panel .profile-badges .badge-collection{grid-template-columns:repeat(2,minmax(0,1fr))}
 .profile-tab-panel .profile-overview .profile-stats{gap:10px}
}

.potion-copy{display:grid;gap:2px;text-align:left}
.potion-effect{color:#bfbdcf;font-size:10px;font-weight:400}

.favourite-topics{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}
.profile-preferences .favourite-topics button{min-height:44px;padding:8px 14px;border-radius:var(--radius-pill)}
.profile-preferences .favourite-topics button[aria-pressed=true]{background:var(--ds-peach);border-color:var(--ds-peach);color:var(--action-gold-ink,#172934)}
.profile-preferences .favourite-topics button:disabled{opacity:.45}

.feedback-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px}
.feedback-controls .feedback-reading{flex-wrap:nowrap;gap:10px;margin:0}
.feedback-controls .feedback-reading[hidden]{display:none}
#questionPanel .feedback-controls .next-button{width:auto;min-width:0;margin:0 0 0 auto}
@media(max-width:480px){
 .feedback-controls,.feedback-controls .feedback-reading{gap:6px}
 #questionPanel .feedback-controls button{padding:8px;font-size:12px}
 .feedback-controls #autoNextStatus{font-size:11px}
}

.home-question{box-sizing:border-box;width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:clamp(18px,4vw,32px);overflow:auto;color:var(--ds-ivory);border:1px solid #b5afce55;border-radius:24px;background:radial-gradient(ellipse at top right,#433452,transparent 65%),linear-gradient(145deg,#132834,#1c1c35)}
.home-question::backdrop{background:#030812a8}
.home-question header,.home-question footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.home-question .kicker{margin:0;color:#ead4ad}
.home-question-close{width:44px;height:44px;border-radius:50%;font-size:22px}
.home-question h2{margin:18px 0 24px;font:400 clamp(24px,5vw,32px)/1.25 var(--serif)}
.home-question h2:focus{outline:none}
.home-question .options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.home-question .option{justify-content:center;text-align:center;color:inherit}
.home-question-feedback{line-height:1.6}
.home-question-feedback:empty{display:none}
.home-question footer{margin-top:20px;flex-wrap:wrap}
.home-question-style{padding:10px 0;background:transparent;border:0;color:#dfccea;text-decoration:underline;text-underline-offset:3px}
.home-question footer button[hidden]{display:none}

.clock{position:relative;overflow:hidden;font-variant-numeric:tabular-nums}
.clock::after{content:'';position:absolute;inset:auto 0 0;height:2px;background:#acd8cd;transform-origin:left;transform:scaleX(var(--time-left,1));pointer-events:none}
.clock-bonus{font:600 10px/1 var(--sans);color:#d9eec6;margin-left:4px}
.clock-bonus[hidden],.home-question .clock[hidden]{display:none}
.clock[data-urgency=rising]::after,.clock[data-urgency=high]::after{background:#ffb283}
.clock[data-urgency=high]{color:#ffcfaa;border-color:#f1a97e}
@media(prefers-reduced-motion:no-preference){.clock[data-urgency=high] b{animation:clock-beat 1s ease-out infinite}.clock::after{transition:transform .2s linear}}
@keyframes clock-beat{0%,100%{opacity:1}50%{opacity:.65}}
.home-question .clock{margin-left:auto;flex:none;padding:6px 10px;border:1px solid #ddc3a35c;border-radius:16px;font:500 13px/1.3 var(--sans)}
.home-question-close{flex:none}

.profile-account .cloud-backup{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:16px}
.profile-account .cloud-backup[hidden],.profile-account button[hidden]{display:none}
.profile-account .cloud-backup label{flex-basis:100%;font-size:.875rem}

/* Language picker */
.language-picker{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid #e6c78366;border-radius:999px;background:#02031466;color:#f1ead9;font:500 14px Inter,sans-serif}
.language-picker select{appearance:none;background:transparent;border:0;color:inherit;font:inherit;cursor:pointer;padding-right:4px}
.language-picker select option{color:#101d27}
.settings-language{align-self:flex-start;margin-bottom:8px}
.login-email-form input[type=password]{width:100%}
.login-header-actions{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}
@media (max-width:520px){.login-header-actions .language-picker{padding:3px 8px;font-size:13px}.login-header-actions .language-picker span{display:none}.login-header .opening-wordmark{max-width:144px}}
.login-email-form .ds-text-button{font-size:14px}
@media (max-width:720px){
  .login-screen:has(.login-email-form) .login-world,
  .login-screen:has(.login-email-form) .login-intro,
  .login-screen:has(.login-email-form) .login-note,
  .login-screen:has(.login-email-form) .ds-eyebrow{display:none}
  .login-screen:has(.login-email-form) .login-card{overflow-y:auto;max-height:calc(100dvh - 140px)}
  .login-email-form{gap:8px}
  .login-email-form input{min-height:44px;padding-block:8px}
}
.legal-links{display:flex;flex-wrap:wrap;gap:6px 14px;font:400 12px/1.4 Inter,sans-serif;margin-top:10px}
.legal-links a,.legal-links button{color:#c0cdd1;text-decoration:underline;text-underline-offset:2px;background:none;border:0;padding:0;font:inherit;cursor:pointer;min-height:0}
.legal-links a:hover,.legal-links button:hover{color:#f1ead9}
.login-legal{justify-content:center;margin-top:14px}
.login-site-footer{box-sizing:border-box;width:100%;padding:18px 24px max(18px,env(safe-area-inset-bottom));border-top:1px solid #ffffff1f;background:#05061acc;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.login-site-footer .login-note{margin:0;min-height:0}
.login-site-footer .login-legal{margin-top:0}
.login-site-footer{position:sticky;bottom:0;z-index:5;padding:10px 16px max(10px,env(safe-area-inset-bottom))}
.login-screen .login-shell{padding-bottom:calc(var(--space-6) + 64px)}
@media (max-width:700px){.login-site-footer{position:static}.login-screen .login-shell{padding-bottom:revert-layer}}
.language-picker .language-code{display:none}
.login-header-actions .language-picker{position:relative;box-sizing:border-box;height:44px;min-width:44px;padding:0 14px;gap:6px;border:1px solid #ffffff;border-radius:24px;background:#ffffff;color:#142338;font:700 12px/1 var(--sans);letter-spacing:.06em;box-shadow:0 0 0 4px #ffffff33,0 6px 18px #0206184d;cursor:pointer;flex:none}
.login-header-actions .language-picker .language-icon{display:inline-grid!important;place-items:center}
.login-header-actions .language-picker .language-code{display:inline}
.login-header-actions .language-picker select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0}
.login-header-actions .language-picker:focus-within{outline:2px solid var(--ds-mint);outline-offset:3px}
@media (max-width:520px){.login-header-actions .language-picker{padding:0 10px;font-size:11px}}

/* Let the longer opening narrative determine its own journal rows. */
.film-intertitle[data-chapter=prologue] .film-frame{height:auto;min-height:calc(100dvh - 48px);grid-template-rows:56px 20px minmax(160px,35dvh) 24px auto auto 32px 1px 56px}
.film-intertitle[data-chapter=prologue] h1{max-width:100%;text-align:center}
@media(max-width:700px){.film-intertitle[data-chapter=prologue] .film-frame{min-height:calc(100dvh - 24px);grid-template-rows:44px 16px minmax(120px,24dvh) 16px auto auto 24px 0 48px}}
.player-setup footer{display:flex;gap:12px;align-items:center}
.player-setup footer>.main-button{flex:1}
.player-setup .setup-back{min-height:48px;padding:0 20px;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;font:inherit;font-weight:600;cursor:pointer;opacity:.85}
.player-setup .setup-back:hover,.player-setup .setup-back:focus-visible{opacity:1}

/* A softly worn scroll, scoped to the question sheet only. */
#scene #questionPanel{
 box-sizing:border-box;padding:34px 28px 30px;border:0;border-radius:4px 9px 6px 11px;
 background:var(--parchment-fill);color:var(--parchment-ink);backdrop-filter:none;
 box-shadow:var(--parchment-shadow);isolation:isolate;scrollbar-color:var(--parchment-line) var(--parchment-paper);
 clip-path:polygon(1% 0,99% 0,100% 2%,99.5% 17%,100% 31%,99.4% 47%,100% 64%,99.5% 81%,100% 98%,99% 100%,1% 100%,0 98%,.6% 82%,0 66%,.5% 49%,0 33%,.6% 18%,0 2%);
}
#questionPanel::before,#questionPanel::after{
 content:'';position:absolute;left:0;right:0;height:16px;pointer-events:none;
 border:1px solid var(--parchment-line);border-radius:50% / 25%;background:var(--parchment-roll);box-shadow:var(--parchment-fold-shadow);
}
#questionPanel::before{top:0}
#questionPanel::after{bottom:0;transform:rotate(180deg)}
#scene #questionPanel #question{color:var(--parchment-ink);margin-top:6px;padding:0 8px;letter-spacing:0}
#scene #questionPanel .option{background:var(--parchment-option);color:var(--parchment-ink);border-color:var(--parchment-line);border-radius:6px}
#scene #questionPanel .option:hover:not(:disabled){background:var(--parchment-hover);border-color:var(--parchment-muted)}
#scene #questionPanel .option.correct{background:var(--parchment-correct);color:var(--parchment-success);border-color:var(--parchment-success)}
#scene #questionPanel .option.incorrect{background:var(--parchment-wrong);color:var(--parchment-error);border-color:var(--parchment-error)}
#scene #questionPanel .potions button{color:var(--parchment-ink);border-color:var(--parchment-line);background:var(--parchment-option)}
#scene #questionPanel #tradePotions:hover,#scene #questionPanel #tradePotions:focus-visible{background:var(--parchment-hover);border-color:var(--parchment-muted)}
#scene #questionPanel .potions .potion-count{background:var(--parchment-ink);color:var(--parchment-light);border-color:var(--parchment-line)}
#scene #questionPanel :is(.potion-status,.question-pool-note,.feedback p,#autoNextStatus){color:var(--parchment-muted)}
#scene #questionPanel .feedback{border-color:var(--parchment-line)}
#scene #questionPanel :is(.feedback-title,.feedback-top,#answerSummary){color:var(--parchment-ink)}
#scene #questionPanel :is(.score-pill,.result-mark){color:var(--parchment-success)}
#scene #questionPanel .feedback.wrong :is(.score-pill,.result-mark){color:var(--parchment-error)}
#scene #questionPanel :is(#pauseFeedback,#nextButton,#retryAnswer){color:var(--parchment-ink);border-color:var(--parchment-line)}
#scene #questionPanel :is(#pauseFeedback,#retryAnswer){background:var(--parchment-option)}
#scene #questionPanel :is(button,a):focus-visible{outline-color:var(--parchment-success)}
@media(max-width:760px){
 #scene #questionPanel{padding:28px 18px 26px}
 #scene #questionPanel #question{padding:0;margin-top:6px}
}

/* Twilight scroll: the question sheet borrows the sky's dusk gradients. */
:root{
 --scroll-ink:#fff4e3;--scroll-muted:#d9cfe6;--scroll-line:#e8cf9c55;--scroll-gold:#edc264;
 --scroll-fill:radial-gradient(120% 80% at 50% -10%,#f0b79f38,transparent 60%),radial-gradient(90% 70% at 100% 110%,#85d3c32b,transparent 65%),linear-gradient(160deg,#3a3157f2,#243a4cf2 55%,#2c2a48f2);
 --scroll-roll:linear-gradient(180deg,#9c7a4a,#f6d79f 40%,#c49a5e 75%,#6e5233);
 --scroll-option:linear-gradient(180deg,#ffffff12,#ffffff06);
}
#scene #questionPanel{
 width:min(680px,calc(100% - 40px));padding:48px 44px 40px;
 background:var(--scroll-fill);color:var(--scroll-ink);
 box-shadow:0 24px 80px #0308198c,inset 0 0 0 1px #e8cf9c33,inset 0 0 60px #0b0a2066;
 backdrop-filter:blur(18px) saturate(1.1);-webkit-backdrop-filter:blur(18px) saturate(1.1);
}
#questionPanel::before,#questionPanel::after{height:20px;left:-4px;right:-4px;border-color:#6e5233;background:var(--scroll-roll);box-shadow:0 4px 10px #0007}
#scene #questionPanel #question{color:var(--scroll-ink);font:400 clamp(28px,3vw,36px)/1.25 var(--serif);text-wrap:balance;margin:8px 0 32px;padding:0 12px;text-shadow:0 2px 12px #0006}
#scene #questionPanel .options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#scene #questionPanel .option{min-height:72px;padding:16px 20px;font:500 17px/1.4 var(--sans);color:var(--scroll-ink);background:var(--scroll-option);border:1px solid var(--scroll-line);border-radius:14px;transition:transform .25s var(--motion-ease),background .25s,border-color .25s,box-shadow .25s}
#scene #questionPanel .option:hover:not(:disabled){background:linear-gradient(180deg,#f6d79f2e,#f0b79f14);border-color:var(--scroll-gold);color:#fff;transform:translateY(-2px);box-shadow:0 8px 24px #f0b79f26}
#scene #questionPanel .option.correct{background:linear-gradient(180deg,#85d3c340,#85d3c318);border-color:#85d3c3;color:#e6fff8}
#scene #questionPanel .option.incorrect{background:linear-gradient(180deg,#f0907f3d,#f0907f14);border-color:#f0a08f;color:#ffe6df}
#scene #questionPanel .potions{margin-top:32px;padding-top:22px;border-top:1px solid var(--scroll-line);gap:10px}
#scene #questionPanel .potions button{color:var(--scroll-ink);background:#ffffff0a;border:1px solid var(--scroll-line);font-size:14px;border-radius:999px;padding:10px 16px}
#scene #questionPanel #tradePotions:hover,#scene #questionPanel #tradePotions:focus-visible,#scene #questionPanel .potions button:hover:not(:disabled){background:#f6d79f22;border-color:var(--scroll-gold)}
#scene #questionPanel .potions .potion-count{background:var(--scroll-gold);color:#28263f;border-color:transparent}
#scene #questionPanel :is(.potion-status,.question-pool-note,.feedback p,#autoNextStatus){color:var(--scroll-muted);font-size:15px}
#scene #questionPanel .feedback{border-color:var(--scroll-line)}
#scene #questionPanel :is(.feedback-title,.feedback-top,#answerSummary){color:var(--scroll-ink);font-size:17px}
#scene #questionPanel :is(.score-pill,.result-mark){color:#85d3c3}
#scene #questionPanel .feedback.wrong :is(.score-pill,.result-mark){color:#f0a08f}
#scene #questionPanel :is(#pauseFeedback,#nextButton){color:var(--scroll-ink);border-color:var(--scroll-line);background:#ffffff0d}
#scene #questionPanel #retryAnswer{background:var(--ds-dawn);color:#28263f;border-color:transparent;font-weight:650}
#scene #questionPanel :is(button,a):focus-visible{outline-color:var(--scroll-gold)}
@media(max-width:760px){
 #scene #questionPanel{width:calc(100% - 24px);padding:40px 22px 30px}
 #scene #questionPanel #question{font-size:26px;margin-bottom:24px}
 #scene #questionPanel .option{min-height:60px;font-size:16px;padding:12px 14px}
 #scene #questionPanel .options{gap:10px}
}
@media(max-width:420px){#scene #questionPanel .options{grid-template-columns:1fr}}

/* Clean quiz card: bold left-aligned prompt, stacked pill answers with letter badges. */
:root{--quiz-paper:#fbfaf7;--quiz-ink:#1d2a2c;--quiz-muted:#19282a;--quiz-line:#dfe5e3;--quiz-teal:#2f6f68;--quiz-teal-soft:#d7ebe7;--quiz-wrong:#a4483a;--quiz-wrong-soft:#f6dfd9}
#scene #questionPanel{width:min(560px,calc(100% - 32px));padding:40px 36px 32px;border-radius:24px;clip-path:none;background:rgb(255 255 255 / 82%);color:var(--quiz-ink);border:1px solid rgb(255 255 255 / 70%);box-shadow:0 20px 60px rgb(3 8 25 / 32%);backdrop-filter:none;-webkit-backdrop-filter:none}
@supports ((backdrop-filter:blur(5px)) or (-webkit-backdrop-filter:blur(5px))){
 #scene #questionPanel{background:linear-gradient(150deg,rgb(255 255 255 / 68%),rgb(249 252 251 / 57%));-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
}
@media (prefers-reduced-transparency:reduce){
 #scene #questionPanel{background:var(--quiz-paper);-webkit-backdrop-filter:none;backdrop-filter:none}
}
#questionPanel::before,#questionPanel::after{display:none}
#scene #questionPanel #question{text-align:left;color:var(--quiz-ink);font:500 clamp(24px,2.6vw,30px)/1.3 var(--sans);letter-spacing:-.01em;text-shadow:none;margin:0 0 28px;padding:0 40px 0 0}
#scene #questionPanel .options{grid-template-columns:1fr;gap:12px}
#scene #questionPanel .option{justify-content:flex-start;text-align:left;gap:18px;min-height:56px;padding:10px 20px 10px 12px;border:1.5px solid var(--quiz-line);border-radius:999px;background:rgb(255 255 255 / 56%);color:var(--quiz-ink);font:500 17px/1.35 var(--sans);box-shadow:none;transform:none}
#scene #questionPanel .option .option-letter{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--quiz-teal-soft);color:var(--quiz-teal);font:600 15px/1 var(--sans)}
#scene #questionPanel .option>span:not(.option-letter){width:auto;flex:1}
#scene #questionPanel .option:hover:not(:disabled){background:var(--quiz-teal-soft);border-color:var(--quiz-teal);color:var(--quiz-ink);transform:none;box-shadow:none}
#scene #questionPanel .option:hover:not(:disabled) .option-letter{background:#fff}
#scene #questionPanel .option.correct{background:var(--quiz-teal-soft);border:2px solid var(--quiz-teal);color:var(--quiz-ink)}
#scene #questionPanel .option.correct .option-letter{background:var(--quiz-teal);color:#fff}
#scene #questionPanel .option.eliminated:disabled{opacity:.4;background:transparent;text-decoration:line-through;pointer-events:none}
#scene #questionPanel .option.incorrect{background:var(--quiz-wrong-soft);border:2px solid var(--quiz-wrong);color:var(--quiz-ink)}
#scene #questionPanel .option.incorrect .option-letter{background:var(--quiz-wrong);color:#fff}
#scene #questionPanel .potions{border-top:1px solid var(--quiz-line);margin-top:28px;padding-top:20px}
#scene #questionPanel .potions button{background:transparent;border:1px solid var(--quiz-line);color:var(--quiz-ink);font-size:14px}
#scene #questionPanel .potions button:hover:not(:disabled),#scene #questionPanel #tradePotions:hover{background:var(--quiz-teal-soft);border-color:var(--quiz-teal)}
#scene #questionPanel .potions .potion-count{background:var(--quiz-teal);color:#fff}
#scene #questionPanel :is(.potion-status,.question-pool-note,.feedback p,#autoNextStatus){color:var(--quiz-muted)}
#scene #questionPanel .feedback{border-color:var(--quiz-line)}
#scene #questionPanel :is(.feedback-title,.feedback-top,#answerSummary){color:var(--quiz-ink)}
#scene #questionPanel :is(.score-pill,.result-mark){color:#0e2923}
#scene #questionPanel .feedback.wrong :is(.score-pill,.result-mark){color:#411a16}
#scene #questionPanel :is(#pauseFeedback,#nextButton){background:#fff;color:var(--quiz-ink);border-color:var(--quiz-line)}
#scene #questionPanel #retryAnswer{background:var(--quiz-teal);color:#fff;border-color:var(--quiz-teal)}
#scene #questionPanel :is(button,a):focus-visible{outline-color:var(--quiz-teal)}
@media(max-width:760px){#scene #questionPanel{padding:32px 20px 24px}#scene #questionPanel #question{font-size:23px}#scene #questionPanel .option{font-size:16px;min-height:52px}}

/* Correct answers turn the prompt into a short reminder above the explanation. */
#scene #questionPanel[data-state="feedback"]:has(.feedback:not([hidden]):not(.wrong)) #question{
 font-size:16px;line-height:1.4;font-weight:500;color:var(--quiz-muted);margin:0 0 12px;padding:0;
}
#scene #questionPanel .feedback:not(.wrong) #answerSummary{
 font-size:16px;line-height:1.4;font-weight:600;margin:14px 0 6px;
}
#scene #questionPanel .feedback:not(.wrong) #feedbackText{
 margin:0 0 24px;color:var(--quiz-ink);font-size:clamp(20px,2.2vw,25px);font-weight:500;line-height:1.45;text-wrap:pretty;
}
@media(prefers-reduced-motion:no-preference){
 #scene #questionPanel[data-state="feedback"]:has(.feedback:not([hidden]):not(.wrong)) #question{
  transform-origin:left top;animation:quiz-question-settle 420ms ease-in-out;
 }
}
@keyframes quiz-question-settle{from{transform:scale(1.12);opacity:.7}to{transform:scale(1);opacity:1}}

/* Tower completion uses the same glass, ink and teal as the question card. */
#scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){
 background:rgb(255 255 255 / 82%);color:var(--quiz-ink);border:1px solid rgb(255 255 255 / 70%);
 border-radius:24px;box-shadow:0 20px 60px rgb(3 8 25 / 32%);font-family:var(--sans);
}
@supports ((backdrop-filter:blur(5px)) or (-webkit-backdrop-filter:blur(5px))){
 #scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){background:linear-gradient(150deg,rgb(255 255 255 / 68%),rgb(249 252 251 / 57%));-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
}
@media(prefers-reduced-transparency:reduce){
 #scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){background:var(--quiz-paper);-webkit-backdrop-filter:none;backdrop-filter:none}
}
#scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result))::before{display:none}
#scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){
 & .finish-results{text-align:left}
 & .victory-crest{margin:0 0 12px}
 & .victory-halo{background:var(--quiz-teal-soft);border-color:#8db8b1;box-shadow:none}
 & .victory-halo::after{border-color:#78a69f}
 & :is(.victory-eyebrow,.finish-sharing>.kicker){color:#204b46;letter-spacing:.12em}
 & #finishTitle{font:500 clamp(24px,2.6vw,30px)/1.3 var(--sans);letter-spacing:-.01em;color:var(--quiz-ink);text-shadow:none}
 & #finishRewards{justify-content:flex-start;flex-wrap:wrap}
 & .victory-reward{max-width:none;background:rgb(255 255 255 / 62%);border:1px solid var(--quiz-line);border-radius:18px;justify-content:start;padding:14px}
 & .victory-reward :is(strong,span){color:var(--quiz-ink)}
 & .victory-lights{justify-content:flex-start;margin:16px 0 8px}
 & .victory-lights i{border-color:#405d5b}
 & .victory-lights .lit{background:var(--quiz-teal);box-shadow:none}
 & :is(#finishSummary,#keeperSummary,#storeyBonusSummary,.social-sharing-note){color:var(--quiz-muted);text-align:left}
 & #finishSummary{font-size:15px}
 & #nextTowerButton{background:#285e58;color:white;border:1px solid transparent;border-radius:999px;box-shadow:none}
 & #replayButton.finish-home,& .social-share-link{background:rgb(255 255 255 / 72%);color:var(--quiz-ink);border:1px solid var(--quiz-line);border-radius:999px;box-shadow:none}
 & .finish-sharing{border-color:rgb(29 42 44 / 22%)}
 & :is(button,a):focus-visible{outline:3px solid var(--quiz-teal);outline-offset:2px}
}

#scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){
 & .finish-navigation{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding-top:20px}
 & .finish-navigation :is(#nextTowerButton,#replayButton):not([hidden]){
  box-sizing:border-box;display:flex;align-items:center;justify-content:center;text-align:center;
  position:relative;width:100%;min-width:0;min-height:48px;margin:0;padding:12px 42px;
  font:600 14px/1.4 var(--sans);overflow:hidden;
 }
 & .finish-navigation .main-button span{position:absolute;right:18px;top:50%;margin-top:-10px;font-size:19px;line-height:20px}
 & .finish-navigation .main-button::before,& .finish-navigation .main-button::after{content:none;animation:none}
 & .finish-sharing .share-card-preview,& .finish-sharing .social-sharing-actions{width:100%;max-width:320px;box-sizing:border-box;margin-inline:auto}
 & .finish-sharing .social-sharing-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 & .finish-sharing .social-share-link{margin:0;min-width:0;min-height:44px;padding:8px 3px;display:grid;place-items:center;line-height:1.2}
}
@media(prefers-reduced-motion:no-preference){
 #scene #finishPanel:is(:has(.victory-eyebrow:not([hidden])),:has(.daily-result)){
  & #nextTowerButton:not(:disabled){background-image:linear-gradient(110deg,transparent 34%,rgb(255 255 255 / 13%) 50%,transparent 66%);background-size:320% 100%;animation:finish-button-light 5s ease-in-out infinite}
  & #nextTowerButton:not(:disabled) span{animation:finish-arrow 5s ease-in-out infinite}
  & .finish-navigation .main-button:active:not(:disabled),& .social-share-link:active:not(:disabled){transform:scale(.98)}
 }
}
@keyframes finish-button-light{0%,55%{background-position:110% 0}88%,100%{background-position:-10% 0}}
@keyframes finish-arrow{0%,58%,88%,100%{translate:0 0}73%{translate:3px -2px}}

#finishPanel .finish-sharing>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;cursor:pointer;font:600 14px/1.4 var(--sans);list-style:none}
#finishPanel .finish-sharing>summary::-webkit-details-marker{display:none}
#finishPanel .finish-sharing>summary::after{content:'';width:8px;height:8px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);margin-inline-end:5px}
#finishPanel .finish-sharing[open]>summary{margin-bottom:12px}
#finishPanel .finish-sharing[open]>summary::after{transform:rotate(225deg)}
#finishPanel .finish-sharing>summary:focus-visible{outline:2px solid currentColor;outline-offset:2px}
@media(min-width:900px){
 #scene #finishPanel:not([hidden]):has(.finish-sharing:not([open])){display:block;width:min(460px,calc(100vw - 64px))}
 #scene #finishPanel .finish-sharing:not([open]){margin:16px 0 0;padding:8px 0 0;border-left:0;border-top:1px solid currentColor}
}

#scene #finishPanel #finishRewards .victory-reward{grid-template-columns:48px minmax(0,1fr);column-gap:10px;min-width:min(145px,100%);box-sizing:border-box}
#scene #finishPanel .victory-reward>.game-icon{display:block;box-sizing:border-box;width:48px;height:48px;padding:4px;border-radius:14px;background:#30263f;color:#f6dc99;stroke-width:1.8;filter:none}

/* A light veil lets each profile tab retain its own island sky. */
dialog.knowling-profile{
 --profile-line:#bbccc8;--profile-tint:#e2eeeb;--profile-muted:#435b58;
 --ds-muted:var(--profile-muted);--ds-ivory:var(--quiz-ink);--ds-border:var(--profile-line);
 background:linear-gradient(130deg,#eef7f4ef,#f9f7f0cf),var(--profile-sky);
 color:var(--quiz-ink);color-scheme:light;font-family:var(--sans);accent-color:var(--quiz-teal);
}
.knowling-profile .profile-header #profileTitle{font:500 clamp(24px,3vw,32px)/1.2 var(--sans);letter-spacing:-.025em;color:var(--quiz-ink)}
.knowling-profile .profile-tabs{box-sizing:border-box;border:1px solid var(--profile-line);background:#ffffff73;border-radius:20px;padding:4px;gap:4px}
.knowling-profile .profile-tabs button{color:var(--profile-muted);min-width:0;border-radius:16px}
.knowling-profile .profile-tabs button[aria-selected=true]{background:var(--quiz-teal);color:white;border-color:transparent;font-weight:600}
.knowling-profile .profile-tab-panel{gap:16px}
.knowling-profile .profile-tab-content .profile-tab-panel>section{
 background:rgb(255 255 255 / 76%);border:1px solid rgb(255 255 255 / 86%);border-radius:24px;
 padding:clamp(16px,2.6vw,28px);box-shadow:0 4px 18px #1738340a;
}
.knowling-profile .profile-tab-panel :is(h3,h4,.profile-rank,.profile-campaign>strong){
 font:500 clamp(19px,2vw,24px)/1.3 var(--sans);letter-spacing:-.015em;color:var(--quiz-ink)
}
.knowling-profile .profile-tab-panel h4{font-size:17px}
.knowling-profile .profile-tab-panel :is(p,small,label,dt,legend){color:var(--profile-muted)}
.knowling-profile .profile-tab-panel :is(dd,strong){color:var(--quiz-ink)}
.knowling-profile .profile-overview .profile-stats{border:0;padding:0;margin:20px 0 0;gap:8px}
.knowling-profile .profile-stats>div{flex-direction:column;justify-content:start;gap:5px;background:var(--profile-tint);padding:12px 14px;border-radius:14px}
.knowling-profile .profile-stats dd{font-size:19px;font-variant-numeric:tabular-nums}
.knowling-profile .profile-tab-panel progress{appearance:none;width:100%;height:7px;overflow:hidden;background:#d6e3df;color:var(--quiz-teal);border:0;border-radius:9px}
.knowling-profile progress::-webkit-progress-bar{background:#d6e3df;border-radius:9px}
.knowling-profile progress::-webkit-progress-value{background:var(--quiz-teal);border-radius:9px}
.knowling-profile progress::-moz-progress-bar{background:var(--quiz-teal);border-radius:9px}
.knowling-profile .profile-tab-panel :is(.collectible-badge,.topic-milestone,.market-card,.supply-card,.storey-role-card,.setup-towers .setup-choice){
 background:#f4f8f7;border:1px solid var(--profile-line);border-radius:16px;color:var(--quiz-ink);box-shadow:none
}
.knowling-profile .profile-tab-panel .collectible-badge.earned{border-color:#73a99f;background:#e4efec}
.knowling-profile .market-card>.game-icon{color:#285e58}
.knowling-profile .profile-tab-panel .profile-name input{background:white;color:var(--quiz-ink);border:1px solid #859f99;border-radius:12px}
.knowling-profile .profile-header .profile-close,.knowling-profile .profile-tab-panel :is(button:not(.collectible-badge),.backup-upload){
 background:#fff;color:var(--quiz-ink);border:1px solid #94aca6;border-radius:999px;box-shadow:none;min-height:44px
}
.knowling-profile .profile-tab-panel :is(.market-buy,.supply-card>button,.favourite-topics button[aria-pressed=true]):enabled{
 background:var(--quiz-teal);border-color:transparent;color:white
}
.knowling-profile .profile-tab-panel button:disabled{background:#e5ebe9;color:#546561;border-color:#c6d3cf;opacity:1}
.knowling-profile .profile-tab-panel .setup-choice:has(input:checked){outline:2px solid var(--quiz-teal);outline-offset:1px}
.knowling-profile .profile-saved:not(:empty){color:#214c45}
.knowling-profile :is(button,input,label,a):focus-visible{outline:3px solid #24645c;outline-offset:2px}
@media(hover:hover){.knowling-profile button:not(:disabled):hover{box-shadow:inset 0 0 0 1px var(--quiz-teal)}}
@media(prefers-reduced-motion:no-preference){
 .knowling-profile .profile-tab-panel:not([hidden]){animation:profile-tab-arrive 300ms ease-in-out}
}
@keyframes profile-tab-arrive{from{opacity:0;translate:0 4px}to{opacity:1;translate:0 0}}
@media(prefers-reduced-transparency:reduce){
 dialog.knowling-profile{background:#e9f0ed}
 .knowling-profile .profile-tab-content .profile-tab-panel>section{background:#fff}
}

/* Keep the purpose, its reward and its price distinct in the Knowling's offer. */
.knowling-speech .knowling-speech-action:has(.purpose-action-copy){text-decoration:none}
.purpose-action-copy{display:grid;gap:3px;min-width:0}
.purpose-action-copy strong{font:600 15px/1.3 var(--sans)}
.purpose-action-copy>span{color:#273e49;font:400 13px/1.4 var(--sans)}
.purpose-action-copy small{color:#445e58;font:500 12px/1.3 var(--sans)}

.story-sequence{position:fixed;z-index:2147483000;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(42rem,calc(100% - 32px));display:grid;justify-items:center;gap:8px;pointer-events:none}
.story-sequence .story-caption{box-sizing:border-box;max-width:100%;margin:0;padding:10px 16px;border-radius:14px;background:#13252bf2;color:white;text-align:center;text-wrap:pretty;font:500 clamp(15px,2vw,18px)/1.45 var(--sans)}
.story-caption[hidden]{display:none}
.story-sequence .story-sequence-stop{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;width:max-content}

/* Shared surfaces for the game's dialogs and in-scene panels. */
:root{
 --modal-paper:rgb(249 252 250 / 94%);
 --modal-line:#b8cbc6;
 --modal-muted:#405954;
 --modal-shadow:0 18px 56px rgb(7 24 28 / 23%);
}
@supports ((backdrop-filter:blur(8px)) or (-webkit-backdrop-filter:blur(8px))){
 :root{--modal-paper:linear-gradient(145deg,rgb(255 255 255 / 91%),rgb(239 248 245 / 84%))}
}
@media(prefers-reduced-transparency:reduce){:root{--modal-paper:#f8fbfa}}
dialog:is(.home-question,.tower-welcome,.campaign-moment,.player-setup),
dialog.login-screen .login-card,dialog.film-intertitle .film-frame,
#scene :is(#soundPanel,#mobileGameMenu,#storeyDetails,.tower-editor:not(.storey-role-editor):not(:has([data-speech-proxied]))){
 box-sizing:border-box;background:var(--modal-paper);color:var(--quiz-ink);
 border:1px solid rgb(255 255 255 / 80%);border-radius:24px;box-shadow:var(--modal-shadow);
 -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);color-scheme:light;text-shadow:none;
}
dialog.daily-hub{
 background:linear-gradient(140deg,#e8f2eff5,#f5f4e9df),var(--daily-sky,linear-gradient(#22363c,#756880));
 color:var(--quiz-ink);color-scheme:light
}
dialog.login-screen .login-card{padding:clamp(16px,2.4vw,30px)}
dialog.player-setup::before,dialog.film-intertitle .film-corner{display:none}
dialog.player-setup header>img,dialog.film-intertitle .film-logo{background:#203432;border-radius:12px;padding:8px 12px;box-sizing:border-box}
:is(dialog.home-question,dialog.player-setup,dialog.tower-welcome,dialog.campaign-moment,dialog.daily-hub,dialog.tower-menu,dialog.film-intertitle .film-frame,dialog.login-screen .login-card,#scene #soundPanel,#scene #storeyDetails){
 --ds-ivory:var(--quiz-ink);--ds-text:var(--quiz-ink);--ds-muted:var(--modal-muted);--ds-peach:#285e58;--ds-border:var(--modal-line);
 & :is(h1,h2,h3,h4){font-family:var(--sans);font-weight:500;letter-spacing:-.02em;color:var(--quiz-ink);text-shadow:none}
 & :is(.kicker,.ds-eyebrow,.map-eyebrow,.film-chapter,.campaign-sigil,.film-ornament,.league-rank){color:#285e58}
 & :is(.login-intro,.login-status,.setup-help,.setup-status,.daily-description,.daily-growth,.daily-date,.league-demo,.campaign-copy,.film-copy p,.daily-league small,.daily-league>p,.daily-standing,.storey-requirements){color:var(--modal-muted);text-shadow:none}
 & :is(input:not([type=checkbox],[type=radio],[type=range]),select,textarea){color:var(--quiz-ink);background:#fff;border-color:var(--modal-line)}
 & :is(input,progress){accent-color:var(--quiz-teal)}
 & :is(button,a,input,select,summary,textarea):focus-visible{outline:3px solid #22675e;outline-offset:2px}
}
dialog:is(.home-question,.tower-welcome,.campaign-moment,.player-setup)::backdrop{background:rgb(9 20 26 / 46%)}
dialog:is(.home-question,.tower-welcome,.campaign-moment,.player-setup,.daily-hub,.film-intertitle) :is(button,.setup-choice),
dialog.login-screen .login-card :is(button,.ds-secondary),dialog.tower-menu .tower-menu-close,
#scene :is(#soundPanel,#mobileGameMenu,#storeyDetails,.tower-editor:not(.storey-role-editor)) button{
 background:#f8fbfa;color:var(--quiz-ink);border:1px solid var(--modal-line);border-radius:999px;box-shadow:none;text-shadow:none;
}
dialog:is(.home-question,.tower-welcome,.campaign-moment,.player-setup,.daily-hub,.film-intertitle) :is(.main-button,.ds-primary,.film-next,.setup-choice:has(input:checked)),
dialog.campaign-moment>button,dialog.campaign-moment [data-cancel],dialog.login-screen .login-card .ds-primary,
#scene #storeyDetails #confirmStorey,#scene .tower-editor .editor-done{
 background:#285e58;color:#fff;border-color:transparent
}
dialog.campaign-moment [data-reset]{color:#90382e;border-color:#c99991}
dialog.home-question .options{grid-template-columns:1fr}
dialog.home-question .option{min-height:48px;justify-content:flex-start;text-align:start;padding:10px 18px}
dialog.home-question .option.correct{background:#d2eee1;border-color:#549e7e;color:#164a39}
dialog.home-question .option.incorrect{background:#f5dfda;border-color:#be776b;color:#73332a}
dialog.home-question .clock{background:#203432;color:#fff}
dialog.player-setup footer{background:transparent;border-color:var(--modal-line)}
dialog.player-setup :is(label,legend,small,.setup-introduction p){color:var(--modal-muted)}
dialog.player-setup .setup-choice:has(input:checked) span{color:white}
dialog.daily-hub .daily-grid>section{background:var(--modal-paper);border:1px solid white;border-radius:24px;box-shadow:var(--modal-shadow)}
dialog.daily-hub .daily-grid .daily-feature{background:var(--modal-paper)!important}
dialog.daily-hub .daily-league .league-you{background:#e0eee9;border-color:var(--modal-line)}
dialog.daily-hub :is(.daily-league strong,.daily-feature h3,.daily-sharing p,.daily-standing button,.share-status){color:var(--quiz-ink)}
dialog.daily-hub .daily-league li{border-color:var(--modal-line)}
dialog.tower-menu :is(.tower-menu-card,.tower-menu-select) .tower-choice-copy{
 background:rgb(250 253 251 / 94%);border-radius:14px;color:var(--quiz-ink);padding:10px 14px;text-shadow:none
}
dialog.tower-menu .tower-choice-copy :is(span,strong){color:var(--quiz-ink);font-family:var(--sans);text-shadow:none}
dialog.tower-menu .tower-choice[data-selected=true]{outline:3px solid var(--quiz-teal);outline-offset:-3px}
#scene #mobileGameMenu button{border-color:transparent;background:transparent}
#scene #mobileGameMenu button:is(:hover,:focus-visible){background:var(--quiz-teal-soft);color:var(--quiz-ink)}
#scene #soundPanel :is(label,small,p,strong),#scene .tower-editor :is(.inline-role-copy,.window-editor-status){color:var(--modal-muted)}
#scene #storeyDetails :is(#storeyTitle,#storeyRequirements){color:var(--quiz-ink)}
#scene .tower-editor .inline-role-choices button{background:#f6faf8;color:var(--quiz-ink);border-color:var(--modal-line);border-radius:16px}
#scene .tower-editor .inline-role-choices :is(span,small){color:var(--modal-muted)}
#scene #finishPanel .daily-result :is(strong,summary,dt,dd,.daily-standing,.daily-standing button){color:var(--quiz-ink)}
#scene #finishPanel .daily-result svg{color:var(--quiz-teal)}
@media(prefers-reduced-transparency:reduce){
 dialog.daily-hub{background:#e9f1ee}
}

#scene #mobileGameMenu button:not([hidden]){display:flex;align-items:center;gap:12px;border-radius:14px;font:500 15px/1.4 var(--sans)}
#scene #mobileGameMenu button>svg{flex:none;color:var(--quiz-teal)}

/* Keep text legible after the sky and translucent surfaces are composited. */
#scene #questionPanel .potion-effect,
#scene #finishPanel .share-panel .share-status{color:var(--quiz-muted)}
#scene #questionPanel .option.eliminated:disabled,
#scene #questionPanel .potions button:disabled{
 opacity:1;color:var(--quiz-muted);background:rgb(255 255 255 / 22%);border-style:dashed
}
#scene #questionPanel .potions button:disabled img{opacity:.55}
#scene #questionPanel .potions button:disabled .potion-count{background:#485754;color:white}

dialog.login-screen .login-card .login-note,
dialog.player-setup .setup-progress span{color:var(--modal-muted)}
dialog.login-screen .login-email-form input::placeholder{color:#526561;opacity:1}
dialog.player-setup .setup-progress span[data-active=true],
dialog.player-setup .setup-progress span::before{color:#20544e}
dialog.player-setup .setup-progress span::before{border-color:#67857e;background:#e4efeb}
dialog.player-setup .setup-choice:not(.setup-sky-choice):has(input:checked){background:#285e58;color:white}
:is(dialog.login-screen .login-card,dialog.knowling-profile) .legal-links :is(a,button){color:#22544f}
:is(dialog.login-screen .login-card,dialog.knowling-profile) .legal-links :is(a,button):hover{color:#153d37}

#scene #soundPanel .keeper-progress{background:#e2eeeb}
#scene #soundPanel .keeper-progress :is(strong,small,span),
#scene #soundPanel .volume-label output{color:var(--quiz-ink)}
#scene #soundPanel .keeper-progress progress{accent-color:#285e58}
#scene #soundPanel .keeper-progress progress::-webkit-progress-value{background:#285e58}
#scene .daily-hub-button:disabled{opacity:1;background:#263944;color:#cedcde;border-style:dashed}

/* The live storey buttons are the speech menu, including during camera movement. */
#scene .tower-editor.storey-role-editor:not([hidden]){
 width:min(260px,calc(100% - 28px));padding:0;border:0;border-radius:18px;background:#f7ecd5;
}
#scene .storey-role-editor .purpose-menu{position:relative;inset:auto;width:100%;border:0;box-shadow:none}
#scene .purpose-menu .inline-role-copy{color:#26333c}
#scene .purpose-menu button.knowling-speech-action{
 width:100%;margin:0;padding:12px 18px;border:0;border-top:1px solid #d2c3a2;border-radius:0;
 background-color:#fffbf3;color:#005fcd;text-align:start;box-shadow:none;
}
#scene .purpose-menu button.knowling-speech-action:is(:hover,:focus-visible){background-color:#eef4fb}
#scene .purpose-menu button:disabled{color:#54605f;opacity:1;cursor:default}
#scene .purpose-menu .window-editor-status:empty{display:none}

.welcome-screen[data-stage=signin] .login-card>.ds-eyebrow{display:none}
.welcome-screen[data-stage=signin] .login-card h1{min-height:0;margin:0 0 12px}
.welcome-screen[data-stage=signin] .login-intro,
.welcome-screen[data-stage=signin] .login-methods{min-height:0}
.welcome-screen[data-stage=signin] .login-card{min-height:0;align-self:center}
.welcome-screen[data-stage=signin] .login-methods{display:grid;gap:10px}
.welcome-screen[data-stage=signin] .login-methods>.login-guest{
 display:flex;justify-content:space-between;align-items:center;min-height:58px;padding-inline:22px;
 margin-bottom:6px;font-size:18px;font-weight:600
}
@media(min-width:761px){
 .welcome-screen[data-stage=signin] .login-world{height:clamp(500px,72dvh,800px)}
}

@media (min-width:560px) and (max-width:760px) and (max-height:500px){
 .welcome-screen[data-stage=signin] .login-layout:not(:has(.login-email-form)){
  display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);grid-template-rows:auto;align-items:center
 }
 .welcome-screen[data-stage=signin] .login-world{height:68svh}
 .welcome-screen[data-stage=signin] .login-card{grid-column:auto}
}
