/* Village art layer. All artwork stays outside the interaction geometry. */
:root{--rpg-panel:linear-gradient(180deg,#24324a,#101b33 45%,#121e36);--rpg-edge:url('./art/panel.svg') 16 stretch;--rpg-gold:url('./art/panel-gold.svg') 16 stretch}
body{background:#284a25}.game-title{display:none}
.home,.playing{background:#426d2e url('./art/village-wide.webp') center/cover no-repeat}
.home .topbar{background:#111d36ed;border:0;box-shadow:0 3px #b8bcb0,0 6px #182335}
.home #intro,.home #setup{background:#111d36f2;border:9px solid transparent;border-image:var(--rpg-edge);padding:16px;box-shadow:0 6px 12px #10201b66}
.home #intro{top:108px}.home #intro h1{font-size:48px}.home #setup{top:390px}.home{min-height:1200px}
.home #stage-wrap{background:none}.home #stage{background:transparent!important;border:0;box-shadow:none}
.playing .topbar{height:44px;flex-basis:44px;margin:7px 10px 2px;padding:0;background:transparent;border:0;box-shadow:none}
.playing .game-title{display:block;position:absolute;left:50%;top:0;transform:translateX(-50%);font:bold 23px/28px Georgia,serif;letter-spacing:.5px;color:#fff2cb;text-shadow:2px 2px #060d1c;background:var(--rpg-panel);border:7px solid transparent;border-image:var(--rpg-edge);padding:0 20px;white-space:nowrap;pointer-events:none}
.playing #hud{height:44px;gap:8px}.playing #hud>span:nth-child(2){min-width:64px;padding:2px 9px;background:var(--rpg-panel);border:6px solid transparent;border-image:var(--rpg-edge);font-family:Georgia,serif;text-align:center}.playing #hud b{font-family:Georgia,serif;font-size:20px;color:#ffedbf;text-shadow:1px 2px #091427}.playing #hud .icon-button{height:40px;width:42px;padding:4px;background:var(--rpg-panel);border:7px solid transparent;border-image:var(--rpg-edge);box-shadow:none}
.playing #scene-buffer{background:transparent;flex-basis:66px;height:66px;padding:3px 10px 0;overflow:visible}#scene-tabs{height:51px;gap:8px}
.scene-tab,.scene-slot{border:7px solid transparent;border-image:var(--rpg-edge);background:var(--rpg-panel);border-radius:0;box-shadow:0 3px #11211e66;padding:0 5px;color:#fff0cc}
.scene-tab.selected{border:7px solid transparent;border-image:var(--rpg-gold);background:linear-gradient(#714713,#3c280d);padding:0 5px;box-shadow:0 0 7px #ffce4a77}
.scene-tab>span{display:inline;font-size:8px;letter-spacing:.5px;margin-right:6px}.scene-tab>strong{display:inline;font:bold 19px/23px Georgia,serif}.scene-tab i{height:6px;margin-top:2px;background:#4c5b6c;border-radius:0;box-shadow:0 1px #030c18,inset 0 1px #a8bdc4}.scene-tab i b,.scene-tab.selected i b{border-radius:0;background:linear-gradient(#fff087 0 25%,#ffc025 25% 70%,#d8830f 70%);box-shadow:inset 0 1px #ffef9e}#arrival-label{color:#fff6cb;text-shadow:1px 1px #142924;font-size:8px;line-height:12px}.scene-slot{background:#14253bc9;color:#b9c7bf}
.playing #cue{margin:0 10px 3px;padding:6px 8px 5px;flex-basis:139px;height:139px;overflow:visible;border:7px solid transparent;border-image:var(--rpg-edge);background:var(--rpg-panel);box-shadow:0 4px #0a1c2299}
.playing #cue-line,.playing #cue-line[lang^=zh]{font-size:23px;line-height:26px;color:#fff2d1;text-shadow:1px 2px #050e20;font-weight:600;max-height:52px;margin:2px 0}
.playing .cue-meta{height:17px;min-height:17px;flex-basis:17px}.playing .speaker-chip b{background:#315a78;border:1px solid #c7d1cd;box-shadow:1px 1px #090d20;color:#fff0c9}.playing #selected-scene-label{color:#afbdc7}
.playing .cue-bottom{flex-basis:42px;min-height:42px;margin-top:3px}.playing .cue-bottom>div{gap:8px}
.playing .cue-bottom #replay-control,.playing .cue-bottom #meaning-button{height:42px;min-height:42px;background:linear-gradient(#233551,#111c34);border:6px solid transparent;border-image:var(--rpg-edge);border-radius:0;box-shadow:none;color:#fff2ce;padding:0;font-family:Georgia,serif;font-size:15px}
.playing .cue-bottom #replay-control #repeat-button{height:30px;min-height:30px;font:600 14px Georgia,serif;color:#fff2ce;padding:0 3px;gap:5px}.playing #repeat-button .icon{height:24px;width:24px;fill:#ead69c;stroke:#f8e8bc}.playing #replay-speed-button{font:bold 14px Georgia,serif;min-width:52px;padding:0 3px;border-color:#a8afa9}.playing .translation-icon{color:#f9d47d;font-size:23px}.playing #cue-translation{background:#13243b;border:2px solid #e4c77b;inset:22px 0 45px;font-size:16px;z-index:3}
.playing #stage-wrap{padding:7px 10px 9px;background:transparent;min-height:0}.playing #stage{background:transparent!important;border:0!important;box-shadow:none;overflow:visible}
.pixel-board{box-sizing:content-box;border:4px solid #465348;box-shadow:0 0 0 2px #e6d7b5,0 0 0 5px #77816c,0 0 0 7px #1a352d,0 8px 10px #11291c88;background:#ceb992}
.pixel-board:before{content:'';position:absolute;inset:-6px;pointer-events:none;border:3px solid transparent;border-image:repeating-linear-gradient(90deg,#e5d7b7 0 10px,#74755c 10px 12px) 3;z-index:5}
.pixel-board .grid-floor{image-rendering:pixelated}.pixel-board .grid-floor [data-x]:hover{fill:#fff5ba44}.pixel-board .grid-floor .drop-cell{fill:#59f4e254!important;stroke:#145c67!important;stroke-width:3}
.pixel-board .world-object.actor .object-img{inset:9px;width:58px;height:58px;filter:drop-shadow(0 2px 0 #4c462a66)!important}.pixel-board .world-object.prop .object-img{inset:5px;width:66px;height:66px;filter:drop-shadow(0 2px 0 #4c462a66)!important}
.pixel-board .world-object.actor .role-badge{bottom:0!important;height:13px;font:700 11px/11px Georgia,'Noto Serif',serif;letter-spacing:0;background:#102137;border:1px solid #d0caa7;color:#fff3c5;box-shadow:0 1px #243121}.pixel-board .world-object.actor .role-me{background:#684712;border-color:#ffe297}.pixel-board .world-object.actor .role-you{background:#16536a;border-color:#91f1ef}
.pixel-board .world-object.actor.controlled .selection-ring{border:3px solid #5ffff3;box-shadow:inset 0 0 0 2px #fff6ce,0 0 0 1px #174b65;background:#7ef8ee18}.pixel-board .world-object.carried{border-color:#ffe9ab;background:#173451;box-shadow:1px 2px #3c4a35}.endpoint-ghost{background:#0f627a22;border-color:#5ffff3;box-shadow:0 0 0 1px #153951,inset 0 0 0 1px #e7ffe477;border-radius:0}
.playing #queue-panel{margin:3px 10px 7px;background:var(--rpg-panel);border:7px solid transparent;border-image:var(--rpg-edge);height:calc(74px + env(safe-area-inset-bottom,0px));min-height:calc(74px + env(safe-area-inset-bottom,0px));max-height:calc(74px + env(safe-area-inset-bottom,0px));padding:2px 44px 2px 5px;box-shadow:0 4px #10232188}
.playing #queue-list .queue-card{background:#20334b;border:1px solid #c0c6b8;box-shadow:inset 0 0 0 2px #0f1b30;border-radius:0}.playing #queue-list .queue-card.accepted{background:#254742;border-color:#c2d49b}.playing .empty-queue{font-size:11px;color:#dfdfc2}.playing #queue-toggle{background:var(--rpg-panel);border:5px solid transparent;border-image:var(--rpg-edge);border-radius:0;right:0;bottom:3px}.playing .queue-tools button:last-child{background:#923b32;color:#fff1d1;border:1px solid #e59c78}.queue-pictures img{filter:drop-shadow(1px 1px #0a1321)}
#context-menu,.playing #context-menu,dialog,#replay-speed-menu{border:9px solid transparent;border-image:var(--rpg-edge);background:var(--rpg-panel);border-radius:0;box-shadow:0 7px 0 #08162688}.action-button{background:linear-gradient(#344962,#1b2d46);border:2px solid #9ea99f;color:#fff0c9;box-shadow:inset 0 0 0 2px #122137}.action-button:hover{background:#405a6c;border-color:#ffdd86}.playing .mini-button{background:var(--rpg-panel);border:5px solid transparent;border-image:var(--rpg-edge);box-shadow:none}.playing #view-tools{opacity:.95;bottom:12px;right:14px}
@media(min-width:701px){.playing #cue,.playing #scene-buffer{width:min(100% - 20px,1000px);margin-left:auto;margin-right:auto}.playing .topbar,.playing #queue-panel{width:min(100% - 20px,1000px);margin-left:auto;margin-right:auto}.playing #stage-wrap{padding-inline:20px}.playing #cue-line{text-align:center}.playing .cue-meta{justify-content:center}.playing #cue{flex-basis:139px}.playing .cue-bottom>div{max-width:700px;margin:0 auto}.playing #hud>span:nth-child(3){background:#132137d9;padding:4px 8px}.playing .game-title{font-size:25px}}
@media(max-width:700px){.home,.playing{background-image:url('./art/village-tall.webp');background-size:100% 100%}.home{min-height:0;background-attachment:fixed}.home #intro,.home #setup{position:relative;top:auto;left:auto;width:auto;margin:14px 14px;padding:13px}.home #intro h1{font-size:46px}.home #stage-wrap{height:390px;margin:0 8px}.playing .game-title{font-size:18px;padding:0 9px;line-height:25px}.playing .topbar{margin:5px 9px 2px;height:40px;flex-basis:40px}.playing #hud{height:40px}.playing #hud b{font-size:16px}.playing #hud>span:nth-child(2){min-width:45px;padding:2px 4px}.playing #hud>span:nth-child(3){font-size:13px;background:#132137d9;padding:3px}.playing #hud>span:nth-child(3) b{font-size:13px}.playing #hud{gap:3px}.playing #hud .icon-button{width:34px;height:36px}.playing #scene-buffer{padding-inline:8px}.playing #cue{margin-inline:8px}.playing #cue-line,.playing #cue-line[lang^=zh]{font-size:20px;line-height:23px}.scene-tab>span{font-size:7px;margin-right:3px}.scene-tab>strong{font-size:17px}.playing #queue-panel{margin-inline:8px}.playing #stage-wrap{padding-inline:11px}.playing .cue-bottom #meaning-button{font-size:13px}.playing .cue-bottom #replay-control #repeat-button{font-size:12px}.playing #replay-speed-button{font-size:12px;min-width:44px}.playing #cue{flex-basis:139px}}
@media(max-height:650px){.playing .topbar{height:32px;flex-basis:32px;margin-top:2px}.playing .game-title{font-size:17px;line-height:18px}.playing #hud,.playing #hud .icon-button{height:30px}.playing #scene-buffer{height:52px;flex-basis:52px}#scene-tabs{height:43px}.scene-tab>strong{font-size:16px;line-height:18px}.playing #cue{height:118px;flex-basis:118px}.playing #cue-line{font-size:18px;line-height:20px}.playing .cue-bottom,.playing .cue-bottom #replay-control,.playing .cue-bottom #meaning-button{height:36px;min-height:36px;flex-basis:36px}.playing #stage-wrap{padding-block:4px}.playing #queue-panel{height:60px;min-height:60px;max-height:60px}}
/* Reserve two readable lines; long localized cues can scroll within this area. */
.playing #cue{height:151px;flex-basis:151px}.playing #cue-line,.playing #cue-line[lang^=zh]{min-height:46px;flex:1 1 46px}.playing #cue-pinyin:empty{display:none}.playing #cue-pinyin{min-height:13px;flex-basis:13px}.playing #cue:has(#cue-pinyin:not(:empty)){height:164px;flex-basis:164px}
@media(max-height:650px){.playing #cue{height:137px;flex-basis:137px}.playing #cue-line,.playing #cue-line[lang^=zh]{min-height:40px;line-height:20px}.playing #cue:has(#cue-pinyin:not(:empty)){height:150px;flex-basis:150px}}
/* Run-only earnings: fixed HUD footprint and a nonblocking payout cue. */
.playing #hud>span:nth-child(2){min-width:76px;max-width:115px;white-space:nowrap}.playing #score{display:inline-block;font-variant-numeric:tabular-nums;font-size:17px}.earnings-pop{position:absolute;left:8px;top:39px;z-index:30;pointer-events:none;background:#182b22;border:2px solid #f4d16f;box-shadow:0 2px #101d22;padding:5px 9px;color:#ffe784;font:bold 17px Georgia,serif;animation:earnings-rise 1.6s ease-out forwards}.earnings-label{color:#efda9b;text-transform:uppercase;font-size:13px;letter-spacing:1.4px;text-align:center;margin-top:12px}.earnings-note{text-align:center;font-size:12px!important;line-height:1.5}.result-old-score{text-align:center;color:#bfcdbf;font-size:12px}.result-score{font-variant-numeric:tabular-nums;font-size:clamp(35px,10vw,60px);overflow-wrap:anywhere}@keyframes earnings-rise{0%{opacity:0;transform:translateY(5px)}15%,75%{opacity:1}100%{opacity:0;transform:translateY(-13px)}}@media(max-width:700px){.playing #hud>span:nth-child(2){min-width:64px;max-width:96px;padding-inline:3px}.playing #score{font-size:14px}.playing .game-title{font-size:16px;padding-inline:5px}}@media(prefers-reduced-motion:reduce){.earnings-pop{animation:none}}
/* Every scene's final ten seconds: red, readable and gently breathing. */
.scene-tab.urgent,.scene-tab.selected.urgent{border-image:url('./art/panel-red.svg') 16 stretch;background:linear-gradient(#702c38,#3c192b);color:#ffe4d5;animation:deadline-breathe 1.25s ease-in-out infinite;box-shadow:0 0 0 1px #ff9b83,0 0 8px #e3464870}
.scene-tab.urgent>strong,.scene-tab.selected.urgent>strong{color:#fff0e3;text-shadow:0 0 5px #ff6358;font-size:21px}
.scene-tab.urgent>span{color:#ffc9b9}.scene-tab.urgent>i>b,.scene-tab.selected.urgent>i>b{background:linear-gradient(#ffd0ac 0 25%,#ff7761 25% 70%,#d93b49 70%);box-shadow:inset 0 1px #ffe5c9}
.scene-tab.selected.urgent{outline:2px solid #ffe49b;outline-offset:1px}
@keyframes deadline-breathe{0%,100%{box-shadow:0 0 0 1px #ff9b83,0 0 5px #e3464850;filter:brightness(1)}50%{box-shadow:0 0 0 1px #ffc2a5,0 0 13px #ff5b638c;filter:brightness(1.17)}}
@media(max-width:700px){.scene-tab.urgent>strong,.scene-tab.selected.urgent>strong{font-size:19px}}
@media(max-height:650px){.scene-tab.urgent>strong,.scene-tab.selected.urgent>strong{font-size:17px}}
@media(prefers-reduced-motion:reduce){.scene-tab.urgent,.scene-tab.selected.urgent{animation:none;filter:none;box-shadow:0 0 0 1px #ff9b83,0 0 8px #e3464870}}
.pixel-board .field-payout{z-index:12;white-space:nowrap;pointer-events:none;font-size:calc(17px / var(--board-scale,1));padding:calc(4px / var(--board-scale,1)) calc(8px / var(--board-scale,1));border-color:#ffe79d;background:#243321ed;color:#ffe88a;text-shadow:1px 1px #172019;transform:translate(-50%,-100%);animation:field-payout-rise 1.8s ease-out forwards}
@keyframes field-payout-rise{0%{opacity:0;transform:translate(-50%,-80%)}15%,70%{opacity:1}100%{opacity:0;transform:translate(-50%,-150%)}}
@media(prefers-reduced-motion:reduce){.pixel-board .field-payout{animation:none;transform:translate(-50%,-100%)}}

/* Reading support stays attached to each glyph; it never expands the board. */
#cue-pinyin:empty{display:none}
#cue-line{overflow:visible;line-height:1.7}
.sentence-word{cursor:help;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;border-radius:3px;outline-offset:3px}
.sentence-word:focus-visible{outline:2px solid #ffd67a}
.sentence-word ruby,.study-row ruby{display:inline-flex;flex-direction:column-reverse;align-items:center;vertical-align:bottom;line-height:1.25;min-width:1.05em}
.sentence-word rt,.study-row rt{display:block;font-family:system-ui,sans-serif;font-weight:500;font-size:17px;line-height:1.4;color:#ffe5a3;padding:0 2px;text-transform:none;letter-spacing:0}
.word-meaning{position:fixed;z-index:2000;max-width:min(300px,calc(100vw - 16px));padding:12px 16px;background:#101f36;color:#fff5d8;border:2px solid #e8c680;box-shadow:0 4px 0 #07101e,0 8px 24px #0008;border-radius:6px;pointer-events:none;font:16px/1.45 system-ui,sans-serif;display:grid;gap:5px}
.word-meaning strong{color:#ffdb87;font-size:19px}
.study-table{margin:18px 0;}
.study-heading,.study-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center}
.study-heading{font-size:13px;opacity:.75;padding:8px 0;border-bottom:1px solid #9ba596}
.study-table h3{font:700 15px/1.4 system-ui,sans-serif;margin:24px 0 8px;color:inherit}
.study-row{border-bottom:1px solid #8b987a55;padding:5px 0;min-width:0}
.study-row button{display:flex;align-items:center;gap:8px;min-width:0;min-height:48px;padding:9px 8px;text-align:left;font:600 17px/1.5 system-ui,sans-serif;background:#e7e9d8;color:#233e35;border:1px solid #9baa88;border-radius:5px;box-shadow:none}
.study-row button>span{min-width:0;overflow-wrap:anywhere}
.study-row button svg{width:19px;height:19px;flex-shrink:0}
.study-row>span{font:15px/1.5 system-ui,sans-serif;overflow-wrap:anywhere}
.study-row rt{color:#35584a;font-size:16px}
.study-row button.is-speaking{background:#ffdda0;outline:2px solid #b07a2e}
.study-actions{position:sticky;bottom:-1px;background:var(--paper,#f5f0df);padding:12px 0 0}
#study-open{display:flex;align-items:center;justify-content:center;gap:8px}#study-open svg{width:22px;height:22px}
#study-status:empty{display:none}
@media(max-width:480px){#cue-line:has(ruby){font-size:23px;line-height:1.7}.sentence-word rt{font-size:16px}.study-row{gap:10px}.study-row button{font-size:16px}}
.playing #cue-line,.playing #cue-line[lang^=zh]{max-height:none;min-height:0;flex:1 1 auto;overflow-y:auto;line-height:1.5;padding:2px 0 4px}
.playing #cue-line:has(ruby){font-size:23px;line-height:1.55;letter-spacing:0}
/* Fixed obstacles remain within their own tile and are never action targets. */
.bush-layer{position:absolute;inset:0;pointer-events:none;z-index:1}.field-bush{position:absolute;width:80px;height:80px;image-rendering:pixelated;pointer-events:none}
.scene-time-setting{border:0;padding:0;margin:20px 0}.scene-time-setting legend{font:600 14px/1.4 system-ui,sans-serif;margin-bottom:8px}.time-inputs{display:flex;align-items:end;gap:12px}.time-inputs label{flex:1;font-size:12px}.time-inputs input{display:block;width:100%;min-height:46px;margin-top:6px;padding:8px 12px;border:1px solid #99b2b5;background:#243e51;color:#fff4d2;font:600 22px/1.2 system-ui,sans-serif;border-radius:3px}.time-inputs>span{font-size:24px;padding-bottom:10px}.map-note{font-size:12px!important;color:#d7deb9}
.field-payout{display:flex;flex-direction:column;gap:4px;align-items:center;white-space:nowrap;min-width:110px}.field-payout>strong{font:inherit}.payout-badges{display:flex;gap:5px}.payout-badges>span,.bonus-badge{background:#172b43;border:2px solid #f4ce60;border-radius:4px;color:#fff0b0;padding:3px 6px;font:700 14px/1.15 system-ui,sans-serif;text-shadow:none}.streak-summary{text-align:center;font-weight:700;margin:16px 0}.streak-summary .bonus-badge{margin-left:8px;display:inline-block}
.show-report{border-top:1px solid #8e9d97;padding-top:16px;text-align:left}.show-report h3{font:700 22px/1.3 Georgia,serif}.show-report h4{font:700 16px/1.4 system-ui,sans-serif;margin:20px 0 8px;color:#ffdb83}.show-report p{font:13px/1.6 system-ui,sans-serif}.show-report ul{padding:0;list-style:none;margin:8px 0}.show-report li{padding:10px 0;border-bottom:1px solid #8caaad44;font-size:14px}.show-report small{display:block;font:12px/1.7 system-ui,sans-serif;margin-top:4px;color:#c4d1d4}.report-totals{display:grid;grid-template-columns:1fr 1fr;gap:9px}.report-totals>div{background:#2b455a;border:1px solid #88a0a3;padding:10px}.report-totals strong{display:block;font-size:24px;color:#ffe2a1}.report-totals span{font-size:12px}.report-context{color:#bacad0}
.pixel-board .payout-badges>span{font-size:calc(12px / var(--board-scale,1));padding:calc(2px / var(--board-scale,1)) calc(4px / var(--board-scale,1))}.pixel-board .field-payout{animation-duration:2.2s}
/* Identity labels remain inside the existing tile; never add a drag target. */
.pixel-board .world-object.actor .role-badge{height:auto;min-height:16px;max-height:28px;line-height:12px;font-size:11px;white-space:normal;text-overflow:clip;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:1px 2px}
.pronoun-badge{display:none;pointer-events:none}
.pixel-board .actor .pronoun-badge:not(:empty){display:block;position:absolute;left:3px;top:1px;padding:1px 3px;background:#182b42ed;border:1px solid #d0caa7;color:#fff3c5;font:700 10px/12px Georgia,serif;pointer-events:none}
.endpoint-ghost .ghost-badge{white-space:normal;line-height:11px;max-height:24px;padding:1px}
#stage-toast.visible{background:#182b42;color:#fff3d1;border:1px solid #dbc48e;box-shadow:0 2px 8px #07152688}
.storage-badge{position:absolute;right:1px;bottom:1px;background:#183249;color:#fff0bb;border:1px solid #d6bb80;padding:1px 3px;font:700 12px/14px sans-serif;pointer-events:none}.storage-badge:empty{display:none}
.word-meaning .verb-form{display:block;font-size:13px;line-height:1.5;color:#c5e4df;border-top:1px solid #718895;padding-top:7px}.show-report .verb-form{font-size:12px;line-height:1.5;color:#c5e4df}.expired-scenes{list-style:none;margin:0;padding:0}.expired-scenes li{padding:12px 0;border-bottom:1px solid #637b89}.expired-scenes strong,.expired-scenes small{display:block}.expired-scenes strong{font-size:16px;line-height:1.5;margin-top:5px}.expired-scenes p{margin:5px 0;line-height:1.5}
#credit-notice{position:absolute;z-index:25;top:8px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);padding:10px 14px;display:grid;gap:5px;background:#17273bf2;color:#fff2d5;border:2px solid #e1b66a;box-shadow:0 3px 0 #07101e,0 5px 14px #0006;font:13px/1.4 system-ui,sans-serif;pointer-events:none}
#credit-notice strong,.credit-word-warning{color:#ffd58c}
#credit-notice span{font-weight:600}#credit-notice small{font-size:11px;max-width:520px;color:#e0e8eb}
.credit-word-warning{border-top:1px solid #93805e;padding-top:6px;font-size:12px}
.credit-reference-notice{padding:12px;margin:0 0 16px;background:#243147;border-left:3px solid #e1b66a;color:#ffdda2}
.credit-reference-notice summary{cursor:pointer;font-weight:650;line-height:1.5}
.credit-reference-notice p,.credit-reference-notice small{line-height:1.5;color:#f1e8d6}
.credit-report>p,.credit-count-help{font-size:13px!important;line-height:1.6!important;color:#c6d4dc}
.credit-report details{margin:14px 0}.credit-report summary{cursor:pointer;line-height:1.5;font-weight:600}
.credit-results{list-style:none!important;padding:0!important;margin:12px 0!important}
.credit-results li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid #50687b}
.credit-results li>span{min-width:0;overflow-wrap:anywhere}.credit-results li>b{color:#85e3bc;text-align:right;flex-shrink:0;font-size:20px}
.credit-results small{display:block;font-size:12px!important;font-weight:400;color:#c7d5dd!important;margin-top:4px}
@media(max-width:700px){#credit-notice{font-size:12px;padding:8px 10px;top:6px}#credit-notice small{font-size:10px}.credit-results li{gap:10px}.credit-results li>b{font-size:18px}}
@media(min-width:701px){.home{display:grid;grid-template-columns:minmax(300px,370px) minmax(0,1fr);grid-template-rows:auto auto 1fr;gap:22px;height:auto;min-height:100vh;padding:0 24px 30px;overflow:visible}.home .topbar{grid-column:1/-1;margin:0 -24px}.home #intro,.home #setup{position:relative;inset:auto;width:auto;margin:0;grid-column:1}.home #intro{grid-row:2}.home #setup{grid-row:3}.home #stage-wrap{grid-column:2;grid-row:2/4;position:sticky;inset:auto;top:20px;height:min(900px,90vh);width:100%;align-self:start}.home #intro h1{font-size:42px}.home .career-toolbar label{min-width:160px}}
/* Parallel reading / listening progress shares the existing compact catalogue. */
.catalogue-tracks{display:flex;gap:8px;margin:6px 0 10px}.catalogue-tracks button{flex:1;min-height:44px;background:#23394f;color:#cbdbe4;border:2px solid #647f93;padding:8px 12px;font-weight:650}.catalogue-tracks button[aria-pressed=true]{border-color:#ebcc7c;background:#354b58;color:#ffe4a5}
.pack-track-status{display:flex!important;gap:14px;font:12px/1.2 system-ui,sans-serif!important;color:#c8dbdf!important}.pack-track-status>span{white-space:nowrap}.pack-track-title{font:600 14px/1.4 system-ui,sans-serif!important;color:#ebcc7c!important;margin:0 0 10px!important}
.career-credit-hint{font:600 13px/1.5 system-ui,sans-serif!important;color:#e8cf8e!important;margin:8px 0!important}.career-pinyin-hint{display:block;font:12px/1.5 system-ui,sans-serif;color:#c6d7dd;margin-bottom:12px}.career-migration{display:flex;align-items:flex-start;gap:8px;border:1px solid #8a9eab;padding:10px;margin:12px 0}.career-migration p{margin:0!important;font:12px/1.5 system-ui,sans-serif!important}.career-migration button{flex:0 0 40px;height:40px;background:#344b5d;color:#fff;font-size:22px}
.credit-results .credit-track-label{color:#f0d896!important;font-weight:650;margin:0 0 4px}.credit-results li>b{max-width:52%}.credit-results li>b small{font-size:11px!important}
@media(max-width:700px){.catalogue-tracks{margin:0 0 7px;gap:6px}.catalogue-tracks button{min-height:40px;padding:6px;font-size:13px}.pack-track-status{font-size:11px!important}.career-credit-hint{font-size:12px!important}}
#voice-reward-badge{background:#14283b;color:#ffe4a5;border:1px solid #b9a574;border-radius:4px;padding:3px 6px;white-space:nowrap;font:600 11px/1.2 system-ui,sans-serif}#voice-reward-badge[hidden]{display:none}.normal-credit{display:block;color:#a9e3d2!important;font-size:10px;line-height:1.5;margin-top:3px}.speed-result-note{font-size:12px!important;line-height:1.5}#replay-speed-menu [data-speed] b{font-size:11px;white-space:nowrap}#voice-reward-help{line-height:1.5}

#replay-speed-menu:has([data-speed] b:not(:empty)){width:250px}#replay-speed-menu [data-speed]{gap:8px}

/* The same hue identifies each actor on the stage, queued endpoint and cast sheet. */
.pixel-board .world-object.actor .role-badge{border-color:var(--route-color,#d0caa7)}
.actor .role-badge:before,.endpoint-ghost .ghost-badge:before,.cast-card strong:before{content:'';display:inline-block;width:10px;height:8px;margin-right:4px;vertical-align:baseline;background:var(--route-color);clip-path:polygon(0 0,100% 50%,0 100%)}
.endpoint-ghost:not(.invalid),.endpoint-ghost.controlled:not(.invalid){border-color:var(--route-color,#5ffff3)}
.cast-card[data-cast]{border-bottom:4px solid var(--route-color)}
/* Live set: clap-judged scenes, Stand by, performer pauses and Action! */
.clapper{display:inline-block;width:18px;height:15px;position:relative;vertical-align:-2px;margin-right:5px;background:#1b1b1f;border-radius:2px;box-shadow:inset 0 -2px #39393f}
.clapper::before{content:'';position:absolute;left:-1px;right:-1px;top:-6px;height:5px;background:repeating-linear-gradient(115deg,#f6f0dc 0 4px,#1b1b1f 4px 8px);border-radius:1px;transform:rotate(-12deg);transform-origin:left bottom}
.scene-tab>span .clapper{width:12px;height:9px;margin-right:4px;vertical-align:-1px}.scene-tab>span .clapper::before{top:-4px;height:3px}
.scene-tab.missed>span::after{content:' ✗';color:#ff9d7c}
.playing .cue-bottom #clap-button{flex:1;min-width:0;height:42px;min-height:42px;display:flex;align-items:center;justify-content:center;gap:4px;padding:0 8px;border:6px solid transparent;border-image:var(--rpg-gold);border-radius:0;background:linear-gradient(#7a4d16,#3e270b);color:#fff2ce;font-family:Georgia,serif;font-size:15px;font-weight:700;cursor:pointer}
.playing .cue-bottom #clap-button:active{transform:translateY(1px)}
.playing .cue-bottom #clap-button:disabled{filter:grayscale(.75) brightness(.8);cursor:default}
.playing .cue-bottom #clap-button[hidden]{display:none}
.standby-toggle{align-self:center;margin-left:auto;margin-right:6px;padding:6px 9px;font-size:12px;font-weight:700;border-radius:4px;border:2px solid #9ab0ae;background:#203750;color:#fff1cf;white-space:nowrap}
.standby-toggle::before{content:'⏸ '}
.standby-toggle[aria-pressed=true]{background:#d9a740;color:#2a1c06;border-color:#ffe08a}
#action-call{position:absolute;left:10px;bottom:10px;z-index:4;padding:9px 16px;border:6px solid transparent;border-image:var(--rpg-gold);border-radius:0;background:linear-gradient(#a3361f,#5d1b10);color:#fff2ce;font-family:Georgia,serif;font-size:16px;font-weight:800;letter-spacing:.3px;box-shadow:0 3px #0006;animation:action-pulse 1.4s ease-in-out infinite}
#action-call[hidden]{display:none}
@keyframes action-pulse{50%{filter:brightness(1.18)}}
@media(prefers-reduced-motion:reduce){#action-call{animation:none}}
.queue-card.standby{outline:2px dashed #e0b54f;outline-offset:-3px}
/* Thoughts: Imagine & Want. Bubbles live in the stage layer (layer px). */
.thought-bubble{position:absolute;transform:translate(-50%,calc(-100% - 34px));display:flex;align-items:center;gap:4px;padding:4px 10px;background:#fffbea;color:#2b2a35;border:3px solid #9c84dc;border-radius:22px;box-shadow:0 3px 0 #0004;white-space:nowrap;pointer-events:none;z-index:9;font:800 22px/1 system-ui}
.thought-bubble[hidden]{display:none}
.thought-bubble::after{content:'';position:absolute;left:50%;bottom:-12px;width:10px;height:10px;border-radius:50%;background:#fffbea;border:3px solid #9c84dc;transform:translateX(-50%)}
.thought-bubble img{width:34px;height:34px;object-fit:contain;image-rendering:pixelated}
.thought-bubble svg{width:24px;height:24px}
.thought-step{display:inline-flex;align-items:center;gap:2px;padding:0 4px;border-left:2px dotted #9c84dc}.thought-step:first-of-type{border-left:0}
.thought-mark{font-style:normal;color:#7b5cc7;margin-right:2px}.thought-mark.want{color:#c74c76}
.mind-tabs{display:flex;gap:6px;margin:6px 0 8px}
.mind-tabs button{flex:1;padding:7px 4px;border-radius:4px;border:2px solid #9ab0ae;background:#203750;color:#fff1cf;font-weight:700;font-size:13px}
.mind-tabs button[aria-pressed=true]{background:#7b5cc7;border-color:#d6c6ff;color:#fff}
.mind-tabs button[data-mind=want][aria-pressed=true]{background:#b8466d;border-color:#ffc6d8}
/* Acts in progress: the performer works, the thing reacts. */
.world-object.acting .object-img{animation:act-work .38s ease-in-out infinite}
.world-object.acted-on .object-img{animation:act-react .3s ease-in-out infinite}
.world-object.acting::after{content:'';position:absolute;left:50%;bottom:4px;width:60%;height:5px;transform:translateX(-50%);border-radius:4px;background:#ffd76a;box-shadow:0 0 8px #ffd76a}
@keyframes act-work{50%{transform:translateY(-6px) scale(1.04)}}
@keyframes act-react{25%{transform:rotate(-9deg)}75%{transform:rotate(9deg)}}
@media(prefers-reduced-motion:reduce){.world-object.acting .object-img,.world-object.acted-on .object-img{animation:none;filter:drop-shadow(0 0 6px #ffd76a)}}
/* Performer timeline (replaces the card queue). Lanes slide under a fixed now line. */
.playing #queue-panel,.playing #queue-panel{height:calc(150px + env(safe-area-inset-bottom,0px));min-height:calc(150px + env(safe-area-inset-bottom,0px));max-height:calc(150px + env(safe-area-inset-bottom,0px))}
.playing #queue-list.timeline{position:relative;display:block;height:142px;min-height:142px;padding:0;overflow-x:hidden;overflow-y:auto;touch-action:pan-y}
.tl-lanes{position:relative;display:flex;flex-direction:column;gap:3px;padding:3px 0}
.tl-lane{position:relative;height:25px;flex:0 0 25px}
.tl-head{position:absolute;left:0;top:0;z-index:3;width:44px;height:25px;padding:0;border:2px solid var(--lane-color);border-radius:6px;background:#1d3249;display:flex;align-items:center;justify-content:center;gap:1px;color:#fff1cf;font-size:11px}
.tl-head img{width:21px;height:21px;object-fit:contain;image-rendering:pixelated}
.tl-head:disabled{opacity:1;border-style:dashed}
.tl-paused{color:#8fd0ff}.tl-mind{color:#c9b6ff}.thought .tl-mind{font-style:normal}
.tl-track{position:absolute;inset:0;clip-path:inset(0 0 0 46px)}
.tl-now{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background:#ffd76a;box-shadow:0 0 6px #ffd76a;z-index:2;pointer-events:none}
.tl-empty{position:absolute;left:12px;right:52px;top:50%;transform:translateY(-50%);font-size:12px;color:#bdd1cd;pointer-events:none}
.tl-empty[hidden]{display:none}
.tl-bar{position:absolute;top:1px;left:0;height:23px;border-radius:5px;display:flex;align-items:center;overflow:visible;background:color-mix(in srgb,var(--lane-color) 55%,#1d3249);border:1px solid color-mix(in srgb,var(--lane-color) 80%,#fff);color:#fff6dc;will-change:transform}
.tl-walk{position:absolute;left:0;top:0;bottom:0;border-radius:5px 0 0 5px;background:repeating-linear-gradient(90deg,#ffffff22 0 5px,transparent 5px 10px)}
.tl-label{position:relative;display:flex;align-items:center;gap:2px;padding:0 4px;font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;pointer-events:none}
.tl-label img{width:18px;height:18px;object-fit:contain;image-rendering:pixelated}
.tl-label svg{width:13px;height:13px}
.tl-bar.queued{opacity:.85}
.tl-bar.held{background:repeating-linear-gradient(135deg,#3b4a5c 0 6px,#2b3848 6px 12px);border-color:#9ab0ae}
.tl-bar.running.acting{background:var(--lane-color);color:#1b1b1f;box-shadow:0 0 8px var(--lane-color)}
.tl-bar.frozen{background:repeating-linear-gradient(135deg,#2e5662 0 6px,#244753 6px 12px);border-color:#8fd0ff}
.tl-bar.done{opacity:.4}
.tl-bar.accepted{border-style:double}
.tl-bar.imagined{background:#2a2242;border:1px dashed #b9a4e6;color:#efe6ff}.tl-bar.imagined.want{border-color:#ff9fbf}
.tl-tools{display:none;position:absolute;right:-2px;top:-14px;gap:2px;z-index:4}
.tl-bar.armed{outline:2px solid #ffd76a;z-index:3}
.tl-bar.armed .tl-tools{display:flex}
.tl-tools button{width:26px;height:22px;padding:0;border-radius:4px;border:1px solid #ffd76a;background:#122641;color:#fff2bf;font-size:12px;font-weight:800}
.tl-is-empty .tl-now{display:none}
.playing #queue-toggle{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;width:42px;height:54px;font-size:0}
.playing #queue-toggle small{font-size:9px;font-weight:800;line-height:1;letter-spacing:.2px}
.playing #queue-toggle.action-mode{background:linear-gradient(#a3361f,#5d1b10);color:#fff2ce;box-shadow:0 0 8px #ff8a5c99;animation:action-pulse 1.4s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.playing #queue-toggle.action-mode{animation:none}}
/* ---- Compact play layout: slim bar, fixed scene cards, 7 × 9 set, 36 px lanes ---- */
html .playing .topbar{height:38px;flex-basis:38px;margin:4px 8px 2px}
html .playing .game-title{display:none}
html .playing #hud,html .playing #hud .icon-button{height:36px}
html .playing #cue{display:none!important}
html .playing #arrival-label{display:none}
html .playing #scene-buffer{flex:0 0 138px;height:138px;padding:6px 8px;overflow:visible}
html #scene-tabs{display:flex;flex-direction:column;gap:4px;height:126px}
.scene-card{position:relative;display:flex;align-items:stretch;flex:none;height:30px;background:#1d3249;border:1px solid #4d6576;border-radius:8px;overflow:hidden;color:#fff2ce;cursor:pointer}
.scene-card.selected{height:60px;border-color:#efbd4f;box-shadow:0 0 0 1px #c8953366}
.scene-card.empty{border-style:dashed;justify-content:center;align-items:center;background:#1d324999;font:600 11px system-ui;color:#b9c8c6;cursor:default;letter-spacing:.03em}
.scene-card .slate{flex:none;width:60px;display:flex;align-items:center;justify-content:center;gap:5px;border-right:1px solid #4d6576;font:700 11px system-ui;color:#b9c8c6}
.scene-card.selected .slate{width:42px;flex-direction:column;gap:1px}
.scene-card .timer{font:700 13px Georgia,serif;color:#fff2ce;font-variant-numeric:tabular-nums}
.scene-card.urgent .timer{color:#ffb08c}
.scene-card.missed .slate>span::after{content:' ✗';color:#ff9d7c}
.scene-card .ln{flex:1;min-width:0;display:flex;align-items:center;padding:0 8px 2px;overflow:hidden}
.scene-card .ln-text{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:15px/1.2 Georgia,'Noto Serif',serif;color:#f3e6c4}
html .playing .scene-card #cue-line,html .playing .scene-card #cue-line[lang^=zh]{display:block;width:100%;margin:0;padding:0;min-height:0;max-height:52px;overflow:hidden;font-family:Georgia,'Noto Serif',serif;color:#fff0ca;flex:1 1 auto}
.scene-card #cue-line ruby rt{font-size:10px}
.scene-more{flex:none;width:32px;border:0;border-left:1px solid #4d6576;background:transparent;color:#b9c8c6;font:800 17px/1 system-ui;cursor:pointer}
.scene-more[aria-expanded=true]{background:#2e5662;color:#fff2ce}
.scene-clap{position:relative;flex:none;width:44px;border:0;border-left:1px solid #8a6a2a;background:linear-gradient(#7a4d16,#3e270b);display:grid;place-items:center;cursor:pointer}
.scene-clap .clapper{margin:4px 0 0}
.scene-clap:disabled{filter:grayscale(.7) brightness(.8);cursor:default}
.scene-clap .cool{position:absolute;right:3px;bottom:4px;font:700 10px system-ui;color:#fff2ce}
.scene-card .timebar{position:absolute;left:0;right:0;bottom:0;height:3px;background:#33475c}
.scene-card .timebar b{display:block;height:100%;background:#e5c47f}
.scene-card.urgent .timebar b{background:#c45c3c}
#scene-menu{position:fixed;z-index:60;min-width:210px;background:#122641;border:2px solid #e5c47f;border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:4px;box-shadow:0 8px 24px #0009}
#scene-menu[hidden]{display:none}
#scene-menu strong{padding:2px 4px;font:700 11px system-ui;letter-spacing:.08em;text-transform:uppercase;color:#b9c8c6}
#scene-menu>button{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border:1px solid #4d6576;border-radius:6px;background:#1d3249;color:#fff2ce;font:600 14px system-ui;text-align:left;cursor:pointer}
#scene-menu svg{width:16px;height:16px}
.scene-speeds{display:flex;gap:4px}
.scene-speeds button{flex:1;min-height:34px;border:1px solid #4d6576;border-radius:6px;background:#172a3f;color:#fff2ce;font:700 12px system-ui;cursor:pointer}
.scene-speeds button[aria-pressed=true]{background:#e5c47f;color:#1b1b1f}
html .playing #cue-translation{position:absolute;inset:8px 10px auto 10px;z-index:25;padding:8px 12px;background:#fffbea;color:#2b2a35;border:2px solid #e5c47f;border-radius:8px;font:italic 14px/1.35 system-ui;box-shadow:0 6px 16px #0007;cursor:pointer;overflow:visible;height:auto}
html .playing #cue-translation[hidden]{display:none}
/* One readable tag per performer (≈12 px on a phone: the board is scaled ~0.66). */
html .pixel-board .world-object.actor .role-badge{height:auto;min-height:0;max-height:none;padding:1px 6px;font:700 18px/21px Georgia,'Noto Serif',serif;white-space:nowrap;overflow:visible;text-overflow:clip}
html .pixel-board .actor .pronoun-badge{display:none}
html .playing #view-tools{top:6px;bottom:auto;right:8px}
html .playing #zoom-reset{display:none}
/* Timeline: three 36 px lanes. */
html .playing #queue-panel{height:calc(124px + env(safe-area-inset-bottom,0px));min-height:calc(124px + env(safe-area-inset-bottom,0px));max-height:calc(124px + env(safe-area-inset-bottom,0px))}
html .playing #queue-list.timeline{height:116px;min-height:116px}
.tl-lane{height:36px;flex-basis:36px}
.tl-head{width:46px;height:36px}.tl-head img{width:28px;height:28px}
.tl-bar{top:2px;height:32px}.tl-label{font-size:12px}.tl-label img{width:24px;height:24px}.tl-label svg{width:15px;height:15px}
/* Labels may be wider than their tile: centre them and let them overflow. */
html .pixel-board .world-object.actor{overflow:visible}
html .pixel-board .world-object.actor .role-badge{left:50%!important;right:auto!important;width:max-content;max-width:none;translate:-50% 0;z-index:3}
.scene-speeds{display:grid;grid-template-columns:repeat(4,1fr)}
html .playing .tl-empty{font-size:12px}
