/* Shared paper, citrus and forest-green interface, using the supplied artwork. */
:root{--gold:#daa132;--gold-bright:#fad991;--cream:#fff9ed;--ink:#321b24;--muted:#526654;--purple:#445b4c;--red:#b4473e;color:var(--ink);background:#fff8ec;color-scheme:light}
body{background:#fff8ec url('assets/ui/background.png') center center/cover fixed no-repeat;color:var(--ink)}
.spotlights,.curtain{display:none}header,main{max-width:880px}.wordmark,.wordmark b,.wordmark span,footer,.eyebrow,.small-copy,.note,.topic,.pill,.title,.text-link,.reader-home{color:var(--muted)}
button:focus-visible,a:focus-visible{outline-color:#415e4c}.icon-button{color:#455b4c;background:#fff9ed;border:1px solid #aa8a4d}
.marquee,.team-setup,.map-group,dialog,.reader-card{background:#fff9ed;border:12px solid transparent;border-image:url('assets/ui/panel.png') 70 fill / 22px / 0 stretch;box-shadow:none;color:var(--ink);border-radius:32px}
.marquee:before,.marquee:after{display:none}.hero h1{color:#435a4b;text-shadow:none;letter-spacing:normal}.hero .tag{color:#586550}.hero{padding:28px 20px}.home-actions{max-width:720px}.team-setup{padding:24px}.team-name-field,.team-name-row input,.name-dice{color:var(--ink)}.team-name-row input{background:#fff9ed;border-color:#b18a4e}.name-dice{background:#f9da90}.pool-values li{border-color:#b9b69e}.pool-values small{color:#59664e}
.primary,.secondary,.choice,.host-answer{border:2px solid #ae8c50;border-radius:999px;background:#fff9ed;color:#455c4d;box-shadow:none;padding:13px 19px;min-height:50px}
.primary{border:0;border-image:none;background:transparent url('assets/ui/next.png') center/100% 100% no-repeat;color:#fff9ed;padding:16px 22px;min-height:62px}.secondary:hover,.choice:hover{background:#f9dda0}.primary:hover{filter:brightness(1.05)}.secondary.selected,.tabs button.selected,.team-picker button.selected{background:#455b4c;color:#fff9ed}.tabs{background:#efe5cd;border:1px solid #b49b67}.tabs button{color:#455b4c}.text-link{border:0;box-shadow:none;border-radius:0;background:none}.score,.game-score{background:#f9d991;border:2px solid #d39c2e;box-shadow:none;color:#281c23}.score.white,.game-score.second{background:#455b4c;border-color:#a5b49b;color:#fff}.score .number,.score.white .number{color:inherit}.score.active,.game-score.active{outline:2px solid #da9e2b;outline-offset:2px;box-shadow:none}.map-group{padding:22px}.map-title h3,.map-intro,.level-legend,.team-picker,.level-button{color:#455b4c}.pause-overlay{background:#43564499}.audio-status{background:#fff9ed;color:#455b4c;border-color:#aa8a4d}.review-sentence{background:#f5ecd9;color:var(--ink)}
/* A single fixed geometry for every round phase. Only the card's RTL interior scrolls. */
body.game-screen{height:100dvh;min-height:0;overflow:hidden}
.game-screen>main{height:100dvh;max-width:860px;width:100%;padding:max(8px,env(safe-area-inset-top)) 12px max(9px,env(safe-area-inset-bottom));display:grid;grid-template-rows:76px minmax(0,1fr) 46px;gap:9px;overflow:hidden}
.game-scoreboard{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:none;margin:0;min-height:0}
.game-score{display:flex;align-items:center;justify-content:center;gap:10px;min-height:0;padding:8px 12px;border-radius:24px;position:relative}
.game-team-name{font-size:clamp(16px,2.6vw,23px);line-height:1.12;overflow-wrap:anywhere}.game-team-score{font-size:25px;flex:none}.game-team-score>span{font-size:20px}
.game-screen .stage-game{display:grid;grid-template-rows:16px 30px 12px minmax(0,1fr);gap:5px;min-height:0;max-width:none;width:100%;margin:0}
.stage-game .round-status{color:#4c614f;font-size:12px;line-height:16px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-game .stage-clock,.stage-clock-placeholder{height:30px;min-height:0;margin:0;color:#455b4c}.stage-clock .icon-button{height:28px;width:28px}.stage-clock .track{background:#e5d8bd}.stage-clock .track i{background:#d59c32}.stage-progress,.result-progress-space,.stage-progress-placeholder{height:12px;margin:0}.stage-progress span{background:#d8cfb8}.stage-progress span.active,.stage-progress span.done{background:#d69d31}
.game-screen .paper-stage.theater-stage{display:grid;grid-template-rows:clamp(85px,16dvh,150px) minmax(0,1fr) 72px;gap:9px;position:relative;isolation:isolate;min-height:0;max-height:none;height:100%;width:100%;margin:0;overflow:visible}
.game-screen .paper-stage .central-card{grid-row:2;position:relative;inset:auto;transform:none!important;width:100%;height:100%;min-height:0;max-height:none;margin:0;padding:24px 25px;background:#fff9ed;border:12px solid transparent;border-image:url('assets/ui/panel.png') 70 fill / 25px / 0 stretch;border-radius:30px;box-shadow:none;color:#321b24;overflow:hidden;z-index:3}
.paper-stage .stage-scroll,.paper-stage .stage-answer-scroll,.paper-stage .stage-result-scroll{height:100%;max-height:100%;min-height:0;overflow-y:scroll;overflow-x:hidden;direction:rtl;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#b28b48 #efe4cf;overscroll-behavior:contain;padding:6px 9px 18px 2px;transform:none}
.paper-stage .stage-scroll::-webkit-scrollbar,.paper-stage .stage-answer-scroll::-webkit-scrollbar,.paper-stage .stage-result-scroll::-webkit-scrollbar{width:6px}.paper-stage ::-webkit-scrollbar-thumb{background:#b28b48;border-radius:6px}
.paper-stage .stage-scroll .sentence{font-size:clamp(25px,4vw,35px);line-height:1.28;margin:0;text-align:center;color:#321b24}.paper-stage .parameter-hint{display:none}.paper-stage .stage-answer-scroll,.paper-stage .stage-result-scroll{display:flex;flex-direction:column;gap:15px}.paper-stage .stage-question{height:auto;min-height:0;flex:none;overflow:visible;animation:none;justify-content:flex-start}.paper-stage .stage-question .question-box{color:#321b24;font-size:clamp(25px,4vw,34px);line-height:1.25}.paper-stage .question-number{color:#766845;font-size:12px}.paper-stage .voice-panel{flex:1;min-height:85px;color:#455b4c;padding:8px 0;overflow:visible;justify-content:center}.paper-stage .voice-instruction{color:#455b4c}.paper-stage .host-answer{background:#f9dda0;color:#321b24;flex:none;border-radius:20px}.paper-stage .choices{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto;gap:9px;flex:none;margin:0}.paper-stage .choice{height:auto;min-height:64px;padding:12px;font-size:23px;border-radius:20px;background:#f9dda0;color:#321b24;box-shadow:none}.paper-stage .choice.long-answer{font-size:20px}.paper-stage .choice.very-long-answer{font-size:18px}
.paper-stage-action{grid-row:3;display:flex;gap:8px;align-items:stretch;min-height:0;z-index:4;padding:0 10px}.paper-stage-action>.primary{width:100%;height:100%;min-height:0;font-size:clamp(19px,3vw,25px)}.paper-stage-action .tabs{display:flex;flex:0 0 30%;min-width:0;margin:0;padding:3px;border-radius:25px}.paper-stage-action .tabs button{flex:1;padding:4px;font-size:16px;border-radius:20px}.paper-stage-action .host-verdict{display:flex;flex:1;gap:7px;margin:0;min-width:0}.paper-stage-action .host-verdict button{flex:1;min-height:0;padding:6px;font-size:22px}.paper-stage-action .yes{background:#455b4c;color:#fff9ed}.paper-stage-action .no{background:transparent url('assets/ui/wrong.png') center/100% 100% no-repeat;border:0;color:white}
.game-tools{display:flex;direction:rtl;gap:6px;width:100%;max-width:none;height:46px;margin:0}.game-tools .secondary{height:100%;min-height:44px;padding:5px 8px;font-size:clamp(13px,2.5vw,19px);flex:1}.game-tools .game-sound{background:transparent url('assets/ui/music.png') center/contain no-repeat;border:0;flex:0 0 45px;color:transparent!important}.game-tools [data-action="saveHome"]{order:1}.game-tools [data-action="map"]{order:0}.game-tools .game-sound{order:2}
/* Existing illustrated cast remains above the stationary panel. */
.paper-stage .round-answer-art{position:absolute;inset:0 0 auto;height:clamp(85px,16dvh,150px);display:grid;grid-template-columns:minmax(0,1fr) 68px minmax(0,1fr);gap:8px;pointer-events:none;z-index:2;overflow:hidden}.paper-stage .round-art-side{display:grid;grid-template-columns:repeat(var(--piece-count),minmax(0,1fr));min-width:0;align-items:end;height:100%;gap:4px;overflow:hidden}.paper-stage .round-art-side:last-child{grid-column:3}.paper-stage .round-answer-piece{width:100%;max-width:150px;height:100%;min-width:0;animation:round-piece-rise .65s ease both,round-piece-float 4.2s ease .65s infinite}.paper-stage .round-answer-piece img{width:100%;height:100%;object-fit:contain}.paper-stage .atlas-sprite{width:100%;height:auto;max-height:100%;aspect-ratio:var(--art-ratio)}
.paper-stage .round-candle,.reading-game .paper-stage .round-candle{position:absolute;inset:auto;left:50%;top:38px;bottom:auto;width:44px;height:calc(clamp(85px,16dvh,150px) - 35px);margin:0;transform:translateX(-50%);z-index:2;filter:drop-shadow(0 4px 4px #65512d33);animation:none}
.paper-stage .round-candle .big-candle,.paper-stage .round-candle .big-candle.off{position:relative;width:100%;height:100%;margin:0;border:2px solid #d9a24d;border-radius:9px;background:linear-gradient(90deg,#55350944,#ffffff66 35%,transparent 60%,#37160944),repeating-linear-gradient(142deg,#fff6dc 0 10px,var(--level-color) 11px 23px);box-shadow:inset 4px 0 6px #fff8}
.paper-stage .round-candle .big-candle:before{content:'';position:absolute;left:50%;top:-9px;width:3px;height:10px;background:#4c2a1b;transform:translateX(-50%)}.paper-stage .round-candle .big-candle:after{content:'';position:absolute;left:50%;top:-37px;width:23px;height:33px;transform:translateX(-50%);background:radial-gradient(ellipse at 50% 75%,#fffef5 0 20%,#ffe88b 37%,#ffa426 70%,#d85411 90%);border-radius:90% 5% 60% 60%;box-shadow:0 0 22px #ffc66099;opacity:1}.paper-stage .round-candle .big-candle.off:after{opacity:0;animation:none}.paper-stage .round-candle.candle-lit{animation:paper-candle-rise .65s ease both}.paper-stage .round-candle.candle-lit .big-candle:after{animation:paper-flame .6s .55s ease both,cake-flame .9s 1.1s ease-in-out infinite alternate}
.paper-stage .stage-result-copy{padding:0;min-height:0;height:auto;overflow:visible;flex:none;color:#321b24}.paper-stage .stage-result-copy h1{color:#435b4b;font-size:clamp(26px,4vw,37px);line-height:1.15}.paper-stage.stage-failure .stage-result-copy h1{color:#b4473e}.paper-stage .stage-result-copy p,.paper-stage .stage-result-copy .revealed-answer{color:#321b24;font-size:clamp(23px,3.5vw,29px)}.paper-stage details{color:#455b4c}.game-screen .fireworks{z-index:5;pointer-events:none}
@keyframes paper-candle-rise{from{opacity:0;transform:translate(-50%,90px)}to{opacity:1;transform:translate(-50%,0)}}@keyframes paper-flame{from{opacity:0;scale:.2}to{opacity:1;scale:1}}
/* The same materials and left-side scrolling in the uninterrupted story reader. */
.reading-only .reader-main{max-width:860px;margin:0 auto;padding:12px 16px;height:calc(100dvh - 85px);display:grid;grid-template-rows:30px minmax(0,1fr) auto 24px;gap:12px}.reader-heading,.reader-status{color:#455b4c;margin:0}.reader-card{min-height:0;overflow-y:scroll;direction:rtl;scrollbar-gutter:stable;scrollbar-color:#b28b48 #efe4cf;scrollbar-width:thin;padding:26px}.reader-card p{line-height:1.3}.reader-actions{position:static;background:none;padding:0}.reader-actions button{font-size:19px}.reader-meta{color:#75663e}
@media(max-height:650px){.game-screen>main{grid-template-rows:55px minmax(0,1fr) 44px;gap:5px}.game-screen .paper-stage.theater-stage{grid-template-rows:65px minmax(0,1fr) 52px;gap:5px}.paper-stage .round-answer-art{height:65px}.paper-stage .round-candle,.reading-game .paper-stage .round-candle{top:25px;height:42px;width:31px}.paper-stage .round-candle .big-candle:after{height:23px;top:-27px;width:17px}.game-screen .paper-stage .central-card{padding:17px 13px}.paper-stage .stage-scroll .sentence{font-size:23px}.game-team-score{font-size:21px}.paper-stage-action .tabs button{font-size:13px}}
@media(prefers-reduced-motion:reduce){.paper-stage .round-candle.candle-lit,.paper-stage .round-candle.candle-lit .big-candle:after,.paper-stage .round-answer-piece{animation:none!important}}
.game-screen .game-score{background:#f9d991;color:#281c23;border:5px solid transparent;border-image:url('assets/ui/team-gold.png') 38 / 16px stretch}.game-screen .game-score.second{background:#455b4c;color:#fff;border-image-source:url('assets/ui/team-green.png')}.game-screen .game-score.active{background:#f9d991;color:#281c23}.game-screen .game-score.second.active{background:#455b4c;color:#fff}.game-screen .game-team-name,.game-screen .game-team-score{color:inherit}.game-screen .stage-clock strong{color:#455b4c}.paper-stage .stage-scroll>.sentence{direction:rtl;transform:none}.paper-stage .stage-scroll{display:flex;flex-direction:column}.paper-stage .stage-scroll>.sentence{margin-block:auto}.paper-stage-action .host-verdict .no{color:transparent}.paper-stage-action [data-action="voiceMode"]{background:transparent url('assets/ui/voice.png') center/100% 100% no-repeat;color:transparent;border:0}.paper-stage-action [data-action="voiceMode"].selected{outline:2px solid #d49c32;outline-offset:-2px}
.game-screen .stage-game,.game-screen .paper-stage.theater-stage{grid-template-columns:minmax(0,1fr);justify-content:stretch;justify-items:stretch}
.game-tools [data-action="saveHome"]{background:transparent url('assets/ui/save.png') center/100% 100% no-repeat;border:0;color:transparent}.game-tools [data-action="map"]{background:transparent url('assets/ui/topics.png') center/100% 100% no-repeat;border:0;color:transparent}
.team-picker button{background:#fff9ed;color:#455b4c;border:1px solid #ae8c50;border-radius:20px}.team-picker button.selected{background:#455b4c;color:#fff9ed}.team-picker button:nth-child(2){background:#f9d991;color:#321b24}.answer-clock-stopped{color:#455b4c}
/* Focused round: no moving cast; one edge-to-edge reading surface. */
.game-screen .round-answer-art,.game-screen .round-candle,.game-screen .fireworks,.game-screen .card-cast,.game-screen .stage-scenery{display:none!important}
.game-screen .stage-game{grid-template-rows:22px 12px minmax(0,1fr);gap:7px}
.game-screen .stage-clock-placeholder,.game-screen .legacy-clock{display:none!important}
.stage-game .round-status{font-size:16px;line-height:22px;text-align:center;color:#455b4c;margin:0;letter-spacing:0;font-variant-numeric:tabular-nums}
.game-screen .stage-progress{height:12px;margin:0;align-items:center}.stage-progress span{width:32px;height:5px;background:#d6cdb8}.stage-progress span.on{background:#d69f35}
.game-screen .paper-stage.theater-stage{grid-template-rows:minmax(0,1fr) 54px;gap:12px}
.game-screen .paper-stage .central-card{grid-row:1;padding:0;border:7px solid transparent;border-image:url('assets/ui/panel.png') 70 fill / 20px / 0 stretch;border-radius:28px;isolation:isolate;overflow:hidden}
.paper-stage .stage-scroll,.paper-stage .stage-answer-scroll,.paper-stage .stage-result-scroll{height:100%;max-height:100%;width:100%;margin:0;direction:rtl;transform:none;padding:24px 22px 28px 14px;border:0;border-radius:0;box-shadow:none;background:none;scrollbar-gutter:stable;overflow-y:scroll;mask-image:linear-gradient(to bottom,transparent 0,#000 22px,#000 calc(100% - 24px),transparent 100%);-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 22px,#000 calc(100% - 24px),transparent 100%)}
.paper-stage .stage-scroll>.sentence{direction:rtl;text-align:right;transform:none;margin-block:auto;font-size:clamp(25px,4vw,35px);line-height:1.3}
.paper-stage .stage-answer-scroll .stage-question .question-box{text-align:right}.paper-stage .stage-answer-scroll>.tabs{display:flex;align-self:center;gap:5px;width:min(100%,280px);margin-top:auto;flex:none;padding:3px;border-radius:24px}.paper-stage .tabs button{flex:1;min-height:38px;padding:6px 12px;font-size:17px;border-radius:20px}.paper-stage .tabs button.selected{background:#455b4c;color:#fff9ed}
.paper-stage-action{grid-row:2;direction:rtl;display:flex;align-items:center;gap:10px;padding:0 8px;height:54px;min-height:0}
.paper-stage-action .round-pause{display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;min-height:46px;border-radius:50%;border:2px solid #ac8a4b;background:#fff9ed;color:#455b4c;font-size:21px;box-shadow:none;padding:0}
.round-controls{flex:1;min-width:0;height:100%;display:flex;align-items:stretch;gap:8px}.round-controls>.primary{width:100%;height:100%;min-height:0;padding:8px 16px;font-size:clamp(18px,3vw,24px)}
.paper-stage.has-timer .round-controls>.primary,.choice-time-bar{position:relative;isolation:isolate;overflow:hidden;background:#eee1c7;border:2px solid #d5ab59;border-radius:999px;box-shadow:0 3px 0 #b29b7655;color:#321b24}
.paper-stage.has-timer .round-controls>.primary:before,.choice-time-bar:before{content:'';position:absolute;inset:0 0 0 auto;width:var(--time-left,100%);background:#d65330;z-index:-1;transition:width .2s linear;pointer-events:none}
.timed-label{position:relative;z-index:1}.paper-stage.has-timer .round-controls>.primary:hover{filter:brightness(1.04)}.choice-time-bar{height:100%;width:100%}
.round-controls .host-verdict{width:100%;height:100%;display:flex;margin:0;gap:10px}.round-controls .host-verdict button{flex:1;height:100%;min-height:0;padding:8px;font-size:22px}
/* Single clean frames around both teams, including the active team. */
.game-screen .game-score,.game-screen .game-score.active{border-image:none;border:2px solid #d39c2e;border-radius:23px;outline:0;box-shadow:none;background:#f9d991;color:#281c23;padding:10px 14px}
.game-screen .game-score.second,.game-screen .game-score.second.active{border-image:none;border:2px solid #a5b49b;background:#455b4c;color:#fff9ed;outline:0;box-shadow:none}
.game-screen .game-score.active:after{content:'';position:absolute;bottom:5px;left:calc(50% - 14px);width:28px;height:3px;border-radius:3px;background:currentColor;opacity:.6}
@media(max-width:480px){.game-screen>main{padding-inline:10px;gap:8px;grid-template-rows:68px minmax(0,1fr) 44px}.game-scoreboard{gap:12px}.game-screen .game-score{padding:8px 10px}.game-team-name{font-size:17px}.game-team-score{font-size:21px}.paper-stage .stage-scroll,.paper-stage .stage-answer-scroll,.paper-stage .stage-result-scroll{padding-inline:17px 9px}.paper-stage-action{padding:0 3px;gap:8px}.paper-stage-action .round-pause{width:43px;height:43px;flex-basis:43px;min-height:43px}.paper-stage .stage-scroll>.sentence{font-size:27px}}
@media(max-height:650px){.game-screen .paper-stage.theater-stage{grid-template-rows:minmax(0,1fr) 46px;gap:8px}.paper-stage-action{height:46px}.paper-stage-action .round-pause{height:42px;width:42px;min-height:42px;flex-basis:42px}.paper-stage .stage-scroll>.sentence{font-size:23px}}
@media(prefers-reduced-motion:reduce){.paper-stage.has-timer .round-controls>.primary:before,.choice-time-bar:before{transition:none}}

.game-team-name{display:flex;flex-direction:column;gap:4px}.game-team-name .team-difficulty{font-size:12px;font-weight:600;line-height:1.1;opacity:.8}.game-screen .game-score{gap:9px}.score .team-label{opacity:1}@media(max-width:480px){.game-team-name .team-difficulty{font-size:11px}.game-team-name{gap:3px}}

/* Untimed review of the live formula registry. */
.sequence-view{width:min(100%,850px);margin:0 auto;display:flex;flex-direction:column;gap:10px;min-height:calc(100dvh - 155px)}
.sequence-view .stage-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.sequence-position,.sequence-title{text-align:center;margin:0;color:#455b4c}.sequence-title{font-weight:700}
.sequence-card{flex:1;min-height:290px;max-height:65dvh;display:flex;border:4px solid #dca433;border-radius:35px;background:#fff9ed;box-shadow:inset 0 0 0 2px #ffdf94;padding:10px}
.sequence-scroll{direction:rtl;text-align:right;overflow-y:auto;width:100%;padding:20px 22px;scrollbar-color:#dca433 transparent;scrollbar-width:thin;mask-image:linear-gradient(to bottom,transparent,#000 12px,#000 calc(100% - 12px),transparent)}
.sequence-story{font-size:clamp(25px,4.5vw,38px);line-height:1.5;margin:0;white-space:normal}.sequence-scroll h2{font-size:clamp(24px,4vw,33px);line-height:1.4}
.sequence-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.sequence-actions button{font-size:20px;padding:12px 10px;min-width:0}
.sequence-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.sequence-options button{white-space:normal;font-size:23px}.sequence-options .sequence-correct{background:#455b4c;color:#fff}.sequence-options .sequence-incorrect{background:#b8483c;color:#fff}.sequence-answer{font-size:24px;color:#455b4c;font-weight:700}.sequence-options button:disabled{opacity:1}
@media(max-width:480px){.sequence-view{min-height:calc(100dvh - 155px)}.sequence-card{border-radius:27px;max-height:61dvh}.sequence-scroll{padding:16px 10px}.sequence-actions button{font-size:17px;padding:10px 6px}.sequence-options{grid-template-columns:1fr}.sequence-options button{font-size:21px}}
