:root{--yellow:#f6cf1b;--red:#cf2433;--ink:#233447;--paper:#fffdf4;--green:#16825c;--shadow:0 5px 0 #172f421c;--safe:env(safe-area-inset-bottom)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background:#d5ecf5;color:var(--ink);font-family:"Yuanti SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;-webkit-user-select:none;user-select:none;-webkit-text-size-adjust:100%}button,a{touch-action:manipulation}button{font:inherit;color:inherit;font-weight:800;border:0;border-radius:18px;min-height:56px;padding:12px 20px;background:white;box-shadow:var(--shadow);cursor:pointer}button:active{transform:translateY(3px);box-shadow:none}button:focus-visible,a:focus-visible{outline:4px solid #149dce;outline-offset:4px}button:disabled{opacity:.6;cursor:default}button[hidden],[hidden]{display:none!important}h1,p{margin:0}a{color:inherit}#app,#scene{position:absolute;inset:0;width:100%;height:100%}#scene{display:block;touch-action:none;cursor:grab}#topbar{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:12px;padding:12px 22px;padding-top:max(12px,env(safe-area-inset-top));background:#fffdf4f5;border-bottom:5px solid var(--yellow);z-index:4}.brand{text-decoration:none;display:flex;align-items:center;gap:10px;font-weight:900;font-size:27px;line-height:1.1}.brand>span{font-size:18px}.brand small{display:block;font-size:11px;letter-spacing:2px;font-weight:700;margin-top:5px;color:#6a7782}#topbar button{font-size:14px;min-width:88px;background:#eaf0f2;box-shadow:none}#trip{flex:1;font-size:15px;text-align:center;font-weight:800}#hud{position:absolute;inset:0;pointer-events:none}#hud button{pointer-events:auto}.primary{background:var(--yellow);box-shadow:0 5px 0 #ceac14;color:#203143;font-size:19px}.overlay{position:absolute;inset:0;z-index:7;display:flex;align-items:center;justify-content:center;padding:100px 24px 24px;background:#1434485c;backdrop-filter:blur(5px);overflow:auto}.selection-card,.ticket-card,.map-card,.finish-card,.loading-card{width:min(800px,100%);padding:32px;border-radius:30px;background:var(--paper);box-shadow:0 20px 80px #17303c40}.intro h1,.loading-card h1,.ticket-card h1,.map-card h1,.finish-card h1{font-size:clamp(26px,4vw,40px);letter-spacing:-1px;margin:6px 0 10px}.eyebrow{font-size:12px;letter-spacing:3px;color:#587383;font-weight:900}.intro>p:last-child,.control-note{color:#6c7b86;font-size:15px}.pick-label{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:24px 0 10px;color:var(--green);font-size:15px}#stationPicker{display:grid;grid-template-columns:1fr 1fr;gap:12px}#stationPicker>div{display:grid;grid-template-columns:1fr 1fr;gap:9px}#stationPicker button{min-height:66px;text-align:left;font-size:18px;background:#ecf0ec;border:2px solid transparent;box-shadow:none;padding:12px}#stationPicker button small{display:block;font-size:11px;font-weight:600;margin-top:5px;color:#6b7779}#stationPicker button.selected{background:#fff1a1;border-color:#dcb419}#stationPicker button.selected:before{content:'● ';color:#b99200}.journey-preview{display:flex;justify-content:space-between;gap:12px;background:#e7f0e8;padding:13px 16px;border-radius:14px;margin:18px 0;color:var(--green);font-size:15px;font-weight:800}.control-note{margin-bottom:20px;font-size:13px}#start,#buyTicket,#restart,#closeMap{width:100%;min-height:64px}.loading-card{text-align:center;max-width:560px}.train-icon{font-size:60px;color:var(--yellow);text-shadow:0 5px var(--red);letter-spacing:7px;margin-bottom:28px}progress{width:100%;height:14px;margin:28px 0 10px;accent-color:var(--green)}#loadText{font-size:13px;color:#69808c}#objective{position:absolute;left:22px;right:22px;bottom:max(18px,var(--safe));display:flex;gap:14px;align-items:center;padding:20px 24px;background:#fffdf4f7;border:1px solid #ffffff;border-radius:24px;box-shadow:0 8px 40px #112e3e26;min-height:126px}#objective>div{flex:1;min-width:0}#objectiveTag{color:var(--green);font-size:12px;letter-spacing:2px;font-weight:900}#goal{font-size:24px;margin:6px 0}#detail{font-size:15px;color:#607383;line-height:1.5}#action{min-width:190px;max-width:280px;min-height:68px}#secondary{background:#e7eeeb}#phase{position:absolute;left:22px;top:104px;background:#fffdf4ec;display:flex;gap:10px;align-items:center;padding:10px 16px;border-radius:40px;font-size:13px;font-weight:800}#stepCount{background:var(--green);color:white;padding:5px 10px;border-radius:22px}#token{position:absolute;right:22px;top:104px;background:#fffdf4ec;display:flex;gap:10px;align-items:center;padding:9px 14px;border-radius:40px;font-size:12px;font-weight:800}.coin{display:inline-grid;place-items:center;width:32px;height:32px;background:#23a36a;border:4px solid #178450;border-radius:50%;box-shadow:inset 0 0 0 2px #70cf9b;color:white;font-weight:900}.ticket-illustration{display:flex;align-items:center;gap:26px;margin:30px 0;background:#e7f1e8;border-radius:22px;padding:24px}.ticket-illustration .coin{width:90px;height:90px;border-width:9px;font-size:24px}.ticket-illustration b{font-size:24px}.ticket-illustration p{color:#567868;margin-top:10px}.ticket-card>p:not(.eyebrow){margin-bottom:24px;line-height:1.6}.ticket-card{max-width:550px}#routeStrip{position:absolute;left:50%;top:104px;transform:translateX(-50%);display:flex;padding:12px 18px 8px;background:#fffdf4ef;border-radius:18px;gap:0;max-width:50%}#routeStrip span{width:100px;text-align:center;font-size:12px;font-weight:800;position:relative;padding-top:15px;color:#809095;border-top:4px solid var(--yellow)}#routeStrip span:before{content:'';width:10px;height:10px;background:#fff;border:3px solid var(--yellow);position:absolute;left:calc(50% - 8px);top:-10px;border-radius:50%}#routeStrip span.current{color:var(--red)}#routeStrip span.current:before{background:var(--red);border-color:var(--red)}#routeStrip span.next:before{animation:blink 1s infinite;background:var(--green);border-color:var(--green)}#routeStrip span.past{color:#bcc5c5;border-color:#bbc5c5}#worldTarget{position:absolute;transform:translate(-50%,-50%);padding:10px 18px;background:#fffbe5f2;border:3px solid #efc122;min-width:100px;z-index:2;box-shadow:0 7px 24px #2224}#worldTarget span{display:block;font-size:25px}#worldTarget b{font-size:14px;white-space:nowrap}#lookHint{position:absolute;bottom:165px;left:50%;transform:translateX(-50%);font-size:12px;letter-spacing:1px;color:#fff;background:#16394c94;padding:8px 14px;border-radius:20px;white-space:nowrap}#toast{position:absolute;left:50%;top:185px;transform:translateX(-50%);text-align:center;color:white;background:#133b4bea;padding:12px 20px;border-radius:16px;font-size:15px;max-width:70%;opacity:0;transition:opacity .2s}#toast.show{opacity:1}#seatControls{position:absolute;right:22px;bottom:172px;display:flex;gap:8px}#seatControls button{font-size:14px;padding:10px 16px}#timerBar{height:5px;margin-top:10px;background:#dce8e0;border-radius:4px;overflow:hidden}#timerBar i{display:block;height:100%;background:var(--green);width:0;transition:width .2s}#fade{position:absolute;inset:0;z-index:6;background:#e4f1ec;opacity:0;pointer-events:none;transition:opacity .25s}#fade.on{opacity:1}.finish-card{text-align:center;max-width:640px}.finish-badge{font-size:66px;color:#c6a312;background:#ffed92;border-radius:30px;display:inline-block;line-height:1.2;width:105px;padding:10px;margin-bottom:25px}.achievements{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:28px 0;color:var(--green);font-weight:800;font-size:13px}.achievements span{background:#e4eee5;padding:10px;border-radius:12px}.finish-card>a{display:inline-block;margin-top:24px;font-size:14px;color:#6b7d82}#mapStations{display:flex;justify-content:space-between;gap:5px;margin:36px 0;font-weight:800}#mapStations span{border-top:6px solid var(--yellow);padding:14px 6px;font-size:18px}#mapText{margin-bottom:25px;color:#5c7380}#chooseAgain{width:100%;margin-top:14px;background:#e7eeeb}.map-card{max-width:700px}#fatal{position:absolute;inset:0;z-index:20;background:var(--paper);display:grid;place-content:center;text-align:center;padding:24px}#fatalText{margin:20px;max-width:600px}@keyframes blink{50%{opacity:.3}}
@media(max-width:760px){#topbar{padding:8px 12px;gap:7px}.brand>span{font-size:14px}.brand small{font-size:9px}#topbar button{padding:8px;min-width:60px;font-size:12px}#trip{font-size:12px}.selection-card{padding:24px}.overlay{padding:85px 14px 20px}#objective{left:12px;right:12px;padding:16px;gap:10px;bottom:max(12px,var(--safe))}#goal{font-size:20px}#detail{font-size:13px}#action{min-width:130px;font-size:16px;padding:12px}#phase{top:92px;left:12px}#token{top:92px;right:12px}#routeStrip{top:153px;max-width:94%;width:94%}#routeStrip span{flex:1}#toast{top:219px;max-width:90%;width:max-content;font-size:13px}#worldTarget{padding:8px 12px}#lookHint{bottom:170px}#seatControls{right:12px;bottom:205px}#stationPicker button{font-size:16px}#stationPicker button small{font-size:10px}}
@media(max-width:480px){#topbar .brand{font-size:22px}#trip{display:none}#topbar button:first-of-type{margin-left:auto}.selection-card{padding:22px 18px}.pick-label{font-size:13px}#stationPicker>div{grid-template-columns:1fr}#stationPicker button{min-height:56px;font-size:15px;padding:8px 12px}#stationPicker button small{display:inline;margin-left:6px}.journey-preview{font-size:12px;padding:10px}.control-note{font-size:10px}#objective{flex-wrap:wrap;min-height:150px}#objective>div{flex-basis:100%}#action{flex:1;min-height:56px}#goal{font-size:18px}#lookHint{bottom:185px}#seatControls{bottom:221px}#mapStations span{font-size:14px}.ticket-card{padding:24px}.ticket-illustration{padding:18px;gap:16px}.ticket-illustration b{font-size:20px}.achievements{gap:5px;font-size:11px}}
@media(max-height:660px) and (min-width:600px){.overlay{padding-top:90px}.selection-card{padding:20px 28px}.intro h1{font-size:30px}.pick-label{margin-top:14px}#stationPicker button{min-height:56px}.journey-preview{margin:12px 0}.control-note{margin-bottom:12px}#objective{padding:15px 20px;min-height:110px}#goal{font-size:21px}#lookHint{bottom:139px}#seatControls{bottom:146px}}

/* Round 2: leave the world in view. Only the current sentence and action stay on screen. */
body.playing #topbar{background:none;border:0;padding:10px 14px;pointer-events:none}
body.playing #topbar .brand{display:none}
body.playing #trip{text-align:left;align-self:flex-start;width:max-content;flex:1;color:white;text-shadow:0 1px 4px #142a38;font-size:13px;padding:18px 8px}
body.playing #topbar button{pointer-events:auto;background:#163447b3;color:white;min-width:74px;border-radius:16px;backdrop-filter:blur(8px)}
#phase{display:none!important}
#objective{left:14px;right:14px;bottom:max(12px,var(--safe));min-height:76px;padding:10px 12px 10px 18px;border:1px solid #ffffff30;background:#152d3dd1;color:#fff;border-radius:18px;box-shadow:0 4px 20px #10233226;gap:12px;backdrop-filter:blur(8px);flex-wrap:nowrap}
#objectiveTag,#timerBar{display:none!important}
#goal{font-size:19px;margin:0 0 3px;line-height:1.25;letter-spacing:0}
#detail{font-size:12px;color:#d4e2e7;line-height:1.35}
#action{min-height:56px;min-width:142px;max-width:245px;font-size:16px;padding:10px 16px;border-radius:13px;box-shadow:none}
#secondary{position:absolute;right:0;bottom:88px;background:#163447ce;color:white;min-height:56px;font-size:14px;box-shadow:none}
#objective>div{flex:1;min-width:0;flex-basis:auto}
#lookHint{bottom:104px;font-size:11px;padding:6px 10px;background:#17384c80;transition:opacity 1s}
#seatControls{right:14px;bottom:104px}
#seatControls button{background:#163447bf;color:white;box-shadow:none;min-height:56px}
#token{top:13px;right:192px;padding:8px;background:#16344799;color:white;border-radius:16px}
#token>span:last-child{display:none}
#toast{top:82px;max-width:75%;font-size:14px;padding:10px 16px;pointer-events:none}
#worldTarget{min-width:68px;min-height:60px;padding:7px 10px;background:#182f3fc7;border:2px solid #ffda40;color:white;border-radius:17px;box-shadow:0 3px 14px #0003}
#worldTarget span{font-size:22px}#worldTarget b{font-size:12px}
#routeStrip{position:relative;left:auto;top:auto;transform:none;max-width:none;justify-content:center;background:none;margin-top:24px;padding:14px 0}
#routeStrip span{flex:1;width:auto}
#mapStations{display:none}
#interactionTarget{position:absolute;width:max-content;max-width:calc(100vw - 32px);transform:translate(-50%,-50%);min-width:78px;min-height:64px;padding:10px 15px;border:3px solid #ffde52;border-radius:17px;background:#153543dc;color:white;font-size:16px;box-shadow:0 0 0 7px #ffda3830,0 4px 18px #0003;z-index:3;animation:targetPulse 1.5s infinite}
#handCoin{position:absolute;right:24px;bottom:108px;background:#152e3ddd;color:white;display:flex;align-items:center;gap:12px;min-height:78px;padding:10px 16px;border:2px solid #ffffff40;z-index:4;box-shadow:none;touch-action:none}
#handCoin .coin,#coinFlight{width:54px;height:54px;border-width:5px;font-size:20px}
#handCoin.payment .coin,#coinFlight.payment{background:#efc54b;border-color:#bd8c20;box-shadow:inset 0 0 0 2px #ffe194;color:#755516}
#handCoin.held{border-color:#ffde52;transform:translateY(-5px)}
#handCoin b{font-size:14px}#coinFlight{position:absolute;z-index:12;pointer-events:none;transform:translate(-50%,-50%)}
@keyframes targetPulse{50%{box-shadow:0 0 0 11px #ffda3818,0 4px 18px #0003}}
@media(max-width:760px){#objective{left:10px;right:10px;padding:10px 12px;gap:10px;min-height:76px}#goal{font-size:17px}#detail{font-size:11px}#action{min-width:120px;font-size:14px;padding:10px}#seatControls{bottom:102px;right:10px}#lookHint{bottom:102px}#handCoin{bottom:103px;right:15px}#token{right:170px}#toast{top:80px}}
@media(max-width:480px){body.playing #trip{display:none}body.playing #sound{margin-left:auto}#objective{min-height:88px}#goal{font-size:15px}#detail{font-size:11px}#action{min-width:104px;flex:0;font-size:13px}#handCoin{bottom:116px}#secondary,#seatControls{bottom:112px}#token{right:auto;left:14px}#lookHint{bottom:116px;font-size:10px}#toast{max-width:90%;width:auto}}

/* Recover a world interaction after free head movement. */
#findInteraction{position:fixed;right:18px;bottom:calc(142px + env(safe-area-inset-bottom));min-height:56px;z-index:9;background:#fff5b9;border:2px solid #b99d28;color:#263c45;padding:12px 20px;box-shadow:0 3px 0 #988023;font-weight:800}
@media(max-width:700px){#findInteraction{right:12px;bottom:calc(170px + env(safe-area-inset-bottom));font-size:16px}}
#findInteraction{left:18px;right:auto;bottom:calc(108px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px)}
@media(max-width:760px){#findInteraction{left:12px;right:auto;bottom:calc(103px + env(safe-area-inset-bottom))}}
@media(max-width:480px){#findInteraction{bottom:calc(210px + env(safe-area-inset-bottom))}}

/* Auxiliary choices share one row above the measured objective; wrapping preserves touch areas. */
#travelControls{position:absolute;left:14px;right:14px;bottom:calc(var(--objective-height,76px) + 12px + max(12px,env(safe-area-inset-bottom)));display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;z-index:5;pointer-events:none}
#seatControls{position:static;right:auto;bottom:auto}
#secondary{position:static;right:auto;bottom:auto;margin-left:auto}
@media(max-width:760px){#travelControls{left:10px;right:10px}}

#perfBadge{position:fixed;left:8px;top:65px;z-index:30;padding:5px 8px;background:rgba(0,0,0,.72);color:#b8ffae;border-radius:5px;font:11px/1.4 monospace;pointer-events:none;max-width:96vw;}
