/* Reference-directed fantasy presentation. Layout still uses the viewport centre. */
:root{--gold:#efc25e;--paper:#fff0c9;--ink:#061c35}
#landscape{position:fixed;inset:0;background:url('../assets/fantasy-valley.png') center center/cover no-repeat;transition:filter 1.4s}
body[data-biome="STAGE 2"] #landscape{filter:sepia(.35) saturate(1.45) hue-rotate(327deg)}
body[data-biome="STAGE 3"] #landscape{filter:brightness(.35) saturate(.65) hue-rotate(45deg)}
body[data-biome="STAGE 4"] #landscape{filter:saturate(.38) brightness(1.15)}
body[data-biome="STAGE 5"] #landscape{filter:sepia(.6) saturate(2) hue-rotate(315deg) brightness(.65)}
body[data-biome="FINAL"] #landscape{filter:brightness(.4) saturate(1.6) hue-rotate(45deg)}
.vignette{background:linear-gradient(180deg,#00285915,transparent 55%,#03152a70)}
button{border:3px double #efc478;border-radius:12px;background:linear-gradient(120deg,#102a45,#031425);box-shadow:inset 0 0 0 1px #463317,0 3px 4px #02142aaa;color:#fffaf0;font-weight:800;text-shadow:0 2px 3px #000}
button:disabled{filter:none;opacity:.8}
#title{background:linear-gradient(90deg,#021d3b30,transparent 80%);padding-top:6vh}
.title-kicker{font-weight:bold;text-shadow:0 2px 5px #01254f}
.title-logo{margin-top:20px;filter:drop-shadow(0 4px 2px #05182e);position:relative;z-index:1}
.title-logo>span{font-size:clamp(40px,5vw,75px);letter-spacing:.11em;margin-left:.11em;background:linear-gradient(#fffbce 10%,#edc662 40%,#ae7123 52%,#fff1a8 70%,#d79a36);background-clip:text;color:transparent;-webkit-text-stroke:1px #a47b32;text-shadow:none}
.title-logo>strong{font-size:clamp(48px,7.2vw,110px);letter-spacing:-.035em;background:linear-gradient(#fffbce 10%,#edc662 40%,#ae7123 52%,#fff1a8 70%,#d79a36);background-clip:text;color:transparent;-webkit-text-stroke:1px #a47b32;text-shadow:none}
.title-logo small{color:#fff;text-shadow:0 2px 3px #001837,0 0 8px #001837;font-weight:800}
.title-divider{display:none}.title-copy{font-family:'Yu Mincho',serif;font-size:20px;font-weight:900;color:#fff;text-shadow:0 2px 5px #002c74;margin-top:25px}
.title-buttons{left:18%;bottom:17%;width:270px;display:flex;flex-direction:column;gap:13px}
.title-buttons button{height:54px;font-size:20px;border-radius:12px;border:4px double #f6d781}
.title-buttons #start{height:68px;background:linear-gradient(#2c2413,#060e16 55%,#2f210b);border:4px double #ffeeb4;box-shadow:0 0 14px #ffc42c,inset 0 0 12px #eab42b;color:#fff4bf;font-size:28px;border-radius:12px;text-shadow:0 0 8px #d4a132}
.title-footer{color:white;text-shadow:0 2px 3px #052f43}
.life-box{top:24px;left:24px;padding:8px 18px;background:linear-gradient(#062641,#03101d);border:3px double #e0b867;border-radius:12px;box-shadow:0 3px 4px #002c4c80;gap:12px}
.life-box small{font:900 18px Georgia;letter-spacing:0;color:#fff}.life-box>span{font-size:30px;color:#ff333f;letter-spacing:3px;text-shadow:0 2px 0 #800b20,0 0 8px #fc768c}
.quiz{top:24px;width:min(65vw,980px)}
#q-number{padding:9px 38px;font:bold 23px Georgia;border:3px double #edc985;border-radius:13px;background:linear-gradient(#092a48,#041729);color:#fff;text-shadow:0 2px 3px #000;box-shadow:0 2px 4px #082d54}
#question{position:relative;min-height:91px;margin:10px 0 18px;padding:15px 32px;border:5px double #ac7e31;border-radius:13px;background:radial-gradient(ellipse at center,#fff8e6 15%,#f7e3c1 75%,#d6b17c);box-shadow:inset 0 0 15px #a16e2444,0 3px 6px #061b4080;font-size:clamp(20px,1.8vw,29px);font-family:'Yu Gothic',sans-serif;font-weight:900;color:#141a21}
#question:before,#question:after{content:'❧';position:absolute;font:30px Georgia;color:#976823;top:4px}#question:before{left:4px}#question:after{right:4px;transform:scaleX(-1)}
.answers{grid-template-columns:1fr 135px 1fr;gap:20px}.answer{min-height:77px;border:4px double #f4d189;border-radius:9px;font-size:clamp(18px,1.65vw,26px);background:repeating-linear-gradient(0deg,transparent 0 17px,#33041344 18px 20px),linear-gradient(#bc1528,#e32a31 55%,#850915);box-shadow:inset 0 0 14px #3d0002,0 4px 7px #082849aa;color:white}.answer.right{background:repeating-linear-gradient(0deg,transparent 0 17px,#00244444 18px 20px),linear-gradient(#053b9e,#066fe2 55%,#002671);box-shadow:inset 0 0 15px #00093e,0 4px 7px #082849aa}
.answer.left{border-radius:28px 9px 9px 28px}.answer.right{border-radius:9px 28px 28px 9px}.arrow{font-size:25px;text-shadow:0 0 10px white}.answer.selected{outline:3px solid #fff2b3;box-shadow:0 0 25px #ffe375,inset 0 0 10px #ffed9e88;opacity:1;transform:scale(1.025)}
.distance-sign{border:4px ridge #98816b;border-radius:6px;background:repeating-linear-gradient(0deg,#6b3d21 0 19px,#301b13 20px 22px);padding:6px 3px 0;box-shadow:0 4px 6px #001a2aaa;color:white}.distance-sign small{font-size:14px;font-weight:bold;text-shadow:0 2px 2px #000}.distance-sign b{font-size:30px;text-shadow:0 3px 3px #000}.time-bar{height:4px;margin-top:4px;background:#27190f}.time-bar i{display:block;height:100%;width:100%;background:#ffdf6a;transition:width .08s linear}.urgent .time-bar i{background:#ff4343}.urgent .distance-sign{box-shadow:0 0 18px #ff3232}.urgent #answer-status{color:#fff;background:#921623e8}
#answer-status{margin:10px auto 0;width:max-content;max-width:100%;border:1px solid #e8c57e77;border-radius:20px;background:#041c39df;padding:5px 18px;font-size:12px;color:#fff3bf;text-shadow:0 1px 2px #000}
.progress{top:25px;right:25px;width:164px}.mini-logo{font-size:22px;color:#ffe39a;text-shadow:0 2px 1px #684211,0 0 5px #052e5f}.mini-logo b{font-size:18px}
#map{width:100%;gap:9px;padding:14px 9px 14px;margin:18px auto 12px;background:linear-gradient(100deg,#082139ef,#031221ef);border:3px double #d0aa5e;border-radius:11px;box-shadow:0 4px 7px #021b39aa}#map:before{top:51px;bottom:39px;left:20px;background:#eac276;width:3px}.goal{align-self:center;font-size:13px}.map-stop{gap:6px;font-size:10px;text-align:left;letter-spacing:0}.map-stop i{width:12px;height:12px;margin-left:5px;border-color:#b7dbff;background:#1457c7;box-shadow:0 0 5px #508cff}.map-stop.current i{background:#ff2828;border-color:#ffee9c;box-shadow:0 0 12px #ff9328}.map-stop b{display:block;font-size:11px}.map-stop small{display:block;max-width:70px;font-size:8px;margin-top:4px;line-height:1.4}.map-thumb{width:38px;height:40px;flex:none;background:url('../assets/fantasy-valley.png') 70% center/cover;border:1px solid #ffe588;border-radius:3px}.biome-1{filter:sepia(.5) saturate(2)}.biome-2{filter:brightness(.4) hue-rotate(45deg)}.biome-3{filter:saturate(.2) brightness(1.25)}.biome-4{filter:sepia(.8) saturate(2) hue-rotate(320deg)}.biome-5{filter:brightness(.45) hue-rotate(55deg)}
.stage-plaque{padding:12px 5px;background:#04172fea;border:3px double #d0aa5e;border-radius:8px}.stage-plaque strong{font:bold 20px Georgia}.stage-plaque span{font-size:12px;color:white}
.controls{bottom:24px;gap:50px}.key-hint{background:linear-gradient(#062543,#031627);border:3px double #d9b05f;border-radius:10px;padding:12px 25px;min-width:160px;font-size:16px;box-shadow:0 3px 5px #00112b}.key-hint kbd{background:linear-gradient(#e93b43,#a00012);border:1px solid #ff9e6e;padding:6px 12px;font:bold 20px Georgia;text-shadow:0 2px 2px #66000c}.key-hint:last-child kbd{background:linear-gradient(#2e93ff,#0044a8);border-color:#a5d9ff}.key-hint span{font-size:12px;color:#fff;margin-top:12px}
#go{width:105px;height:105px;border:7px double #fff2a8;background:radial-gradient(circle at 30% 20%,#fffcdc,#ffdc24 40%,#f3b100 65%,#b57912);color:#181700;font:bold 35px Georgia;box-shadow:0 0 15px #ffe77b,0 5px 0 #946124;text-shadow:none}#go.confirmed{background:radial-gradient(circle at 30% 20%,#eaffb8,#afd963 55%,#4d992d);color:#183014;opacity:1}.go-wrap small{background:#031a34e8;border:1px solid #c6a862;padding:6px 12px;border-radius:6px;color:white}
.speed-panel{left:25px;right:auto;bottom:35px;width:145px;padding:10px 14px;background:#03172eee;border:3px double #d7b364;border-radius:10px;box-shadow:0 3px 7px #001629}.speed-panel small{font:bold 15px Georgia;letter-spacing:0;text-align:center;color:#fff}.speed-panel b{font:bold 35px Georgia;color:white}.speed-panel>span{color:white}
#toast{top:34%;z-index:3}#toast strong{font:900 clamp(48px,5.2vw,83px) 'Yu Mincho',serif;color:#ffdd62;-webkit-text-stroke:1px #fff4b0;text-shadow:0 3px 0 #95250e,0 6px 0 #7f3918,0 0 20px #ffda63}.bad strong{color:#a3b5ff!important;-webkit-text-stroke:1px #def2ff!important;text-shadow:0 3px 0 #101462,0 6px 0 #15133c,0 0 18px #021b58!important}#toast span{display:block;width:max-content;max-width:95%;margin:12px auto;background:linear-gradient(#fff7de,#ebd1a5);border:4px double #b58430;border-radius:12px;color:#161a23;text-shadow:none;padding:12px 24px;font-weight:bold;font-size:16px}
#end{background:linear-gradient(#0b0327bb,#0e042544);align-items:start;padding-top:10vh}.end-card{background:#041529b0;border:3px double #d8ae60;backdrop-filter:blur(5px)}.end-card h1{font:bold 48px Georgia;color:#ffc4ff;text-shadow:0 3px #39136e,0 0 14px #ae51fd}.end-card p{background:#fff0cf;color:#1b1424;padding:12px;border:3px double #d8ae60;border-radius:8px;font-weight:bold}.end-card button{font-size:16px}
@media(max-width:1200px) and (min-width:760px){.progress{width:132px;right:12px}.map-thumb{width:28px}.map-stop small{font-size:7px}.map-stop b{font-size:10px}.quiz{width:65vw}.life-box{left:12px;padding:8px}.life-box small{font-size:12px}.life-box>span{font-size:24px}.answers{grid-template-columns:1fr 105px 1fr;gap:13px}.key-hint{min-width:125px;padding:10px 14px}.speed-panel{width:115px;left:15px}.controls{gap:22px}.title-buttons{left:18%;width:230px}}
@media(max-width:759px){
 #landscape{background-position:63% center}.life-box{top:14px;left:13px;padding:3px 10px;gap:7px;border-width:3px}.life-box small{font-size:12px}.life-box>span{font-size:22px}
 #mobile-stage{top:25px;font-weight:bold;color:#fff;text-shadow:0 2px 3px #052343;font-size:9px}.quiz{top:64px;width:calc(100% - 20px)}#q-number{font-size:17px;padding:6px 24px;border-radius:9px}#question{min-height:79px;font-size:17px;padding:13px 18px;margin:9px 0 13px;border-width:4px}#question:before,#question:after{font-size:19px}
 .answers{grid-template-columns:1fr 85px 1fr;gap:7px}.answer{min-height:67px;font-size:14px;border-width:3px;padding:8px 6px;line-height:1.4}.arrow{font-size:16px}.answer.left{border-radius:18px 6px 6px 18px}.answer.right{border-radius:6px 18px 18px 6px}.distance-sign{border-width:3px}.distance-sign small{font-size:11px}.distance-sign b{font-size:25px}.time-bar{height:3px}#answer-status{font-size:10px;padding:5px 10px;margin-top:10px}
 .controls{bottom:max(18px,env(safe-area-inset-bottom));gap:0}.go-wrap{gap:8px}#go{width:85px;height:85px;font-size:29px;border-width:6px}.go-wrap small{font-size:9px;padding:5px 8px}.speed-panel{bottom:45px;left:14px;width:86px;padding:7px 8px}.speed-panel small{font-size:12px}.speed-panel b{font-size:26px;margin-right:2px}.speed-panel>span{font-size:9px}
 #toast{top:38%}#toast strong{font-size:44px}#toast span{font-size:12px;padding:9px 12px;border-width:3px}
 #title{padding-top:7vh}.title-kicker{font-size:10px}.title-logo{margin-top:15px}.title-logo>span{font-size:37px}.title-logo>strong{font-size:clamp(34px,10.5vw,61px)}.title-logo small{font-size:11px;margin-top:13px;letter-spacing:0}.title-copy{font-size:14px;max-width:80%;margin:20px auto}.title-buttons{left:50%;bottom:6.5vh;width:255px;gap:9px}.title-buttons button{height:44px;font-size:17px}.title-buttons #start{height:55px;font-size:24px}.title-footer{bottom:2vh;font-size:7px}.end-card h1{font-size:32px}#end{padding-top:14vh}
}
@media(max-height:650px) and (min-width:760px){.quiz{top:12px}#question{min-height:60px;margin-bottom:10px;font-size:19px}#q-number{font-size:17px;padding:6px 28px}.answer{min-height:55px}.progress{top:15px}#map{gap:5px;margin:12px auto 8px}.map-thumb{height:29px}#go{width:83px;height:83px}.controls{bottom:12px}.title-logo>strong{font-size:65px}.title-logo>span{font-size:40px}}
@media(min-width:760px){.controls{width:100%;left:0;transform:none;justify-content:space-between;padding:0 25%;pointer-events:none}.controls>*{pointer-events:auto}.go-wrap{position:absolute;right:25px;bottom:0}.key-hint{padding:10px 20px}.speed-panel{bottom:26px}.title-logo{margin-top:15px}}
#map-rider{position:absolute;left:6px;width:28px;height:28px;line-height:28px;transform:translateY(-50%);font-size:25px;color:#fff6af;text-shadow:0 0 8px #ffad00,0 0 15px #ff5d00;z-index:2;transition:top .8s cubic-bezier(.2,.8,.2,1);pointer-events:none}
.map-stop.done{color:#fff1b0}.map-stop.done i{background:#ffd566;box-shadow:0 0 7px #ffc943}.map-stop.current{color:#fff}.map-stop.current .map-thumb{outline:2px solid #fff39c;box-shadow:0 0 12px #ffb000}.map-stop{transition:color .5s}.map-stop .map-thumb{transition:box-shadow .5s}
@media(prefers-reduced-motion:reduce){#map-rider{transition:none}}
/* Each stage now has its own generated landscape, shared with the map thumbnail. */
body[data-biome] #landscape{filter:none}
.map-thumb[class]{filter:none;background-position:center;background-size:cover}
#fall-scene{position:fixed;inset:0;background:#10132b url('../assets/fall-scene.png') center/cover no-repeat;z-index:1;pointer-events:none}
body.is-falling #world{visibility:hidden}
body.is-falling #hud{z-index:2}
body.is-falling #hud .quiz,body.is-falling #hud .controls,body.is-falling #hud .speed-panel{visibility:hidden}
body.is-falling #toast{top:13%}
body.is-falling #end{z-index:3;background:linear-gradient(#09031b88,transparent);padding-top:5vh}
body.is-falling .end-card{padding:20px 25px}
@media(max-width:759px){#fall-scene{background-size:auto 75%;background-position:center bottom;background-repeat:no-repeat}body.is-falling #toast{top:12%}body.is-falling #end{padding-top:6vh}body.is-falling .end-card h1{margin:12px 0}body.is-falling .end-card p{font-size:11px;padding:8px}}
/* Paint the outline behind the fill so small Japanese glyphs stay legible. */
#toast strong,.end-card h1{paint-order:stroke fill;-webkit-text-stroke:6px #241330!important;text-shadow:0 0 2px #fff4c1,0 4px 0 #fff4c1,3px 0 0 #fff4c1,-3px 0 0 #fff4c1,0 -3px 0 #fff4c1,0 7px 8px #000!important}
#toast.bad strong{color:#c5d6ff!important;-webkit-text-stroke-color:#131b50!important}
#toast strong{line-height:1.3}
@media(max-width:759px){#toast strong,.end-card h1{-webkit-text-stroke-width:4px!important}}
#run-score{position:absolute;left:25px;top:100px;background:#071a30e8;color:#ffe293;padding:8px 12px;border:1px solid #dec486;border-radius:8px;font-weight:bold}
#fork-warning{position:absolute;top:45%;left:50%;transform:translateX(-50%);font-size:22px;font-weight:bold;color:#fff6c9;text-shadow:2px 2px 3px #000;background:#291600b0;border-radius:20px;padding:4px 15px;pointer-events:none}#fork-warning:empty{display:none}
#review{position:fixed;inset:0;z-index:12;display:grid;place-items:center;background:#050d2480;padding:20px}#review[hidden]{display:none}#review>div{width:min(520px,95vw);background:#fff0d4;color:#17263a;border:5px double #bd913a;border-radius:16px;padding:24px;text-align:center;box-shadow:0 8px 40px #000}#review strong{font-size:24px}#review p{line-height:1.8}#review button{background:#123652;color:white;padding:12px 35px;border:2px solid #c59d51;border-radius:10px;font-size:18px}
#end{overflow:auto}.end-card{width:min(650px,94vw);margin-bottom:25px}.result-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.result-stats span{font-size:12px;background:#061629cc;border-radius:8px;padding:10px;color:#fff}.result-stats strong{display:block;font-size:26px;color:#ffe39a}#results ol{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:6px;text-align:left}#results li{background:#07172ee0;padding:8px;color:#fff;font-size:13px}#results b{color:#ffe293;margin:0 8px}#results small{display:block}#settings select{font:inherit;padding:8px;max-width:65%}
@media(max-width:759px){#run-score{top:105px;left:auto;right:12px;font-size:10px;padding:3px 7px}#fork-warning{top:40%;font-size:18px}.result-stats{grid-template-columns:1fr 1fr}.end-card h1{font-size:30px}#results ol{font-size:12px}#review strong{font-size:20px}}
#final-banner{display:none;position:absolute;top:7px;left:50%;transform:translateX(-50%);color:#ffe7a1;text-shadow:0 2px 2px #30143d,0 0 12px #ffb63c;font:bold 18px Georgia;letter-spacing:3px;white-space:nowrap;pointer-events:none}#final-banner small{font:10px sans-serif;letter-spacing:1px;margin-left:12px}
body[data-biome="FINAL"] #final-banner{display:block}body[data-biome="FINAL"] #q-number{margin-top:18px}body[data-biome="FINAL"] .stage-plaque,body[data-biome="FINAL"] #map{border-color:#ffe799;box-shadow:0 0 18px #ddb24c88,inset 0 0 22px #a781342b}body[data-biome="FINAL"] .quiz h1{box-shadow:0 0 20px #ffe09977}body[data-biome="FINAL"] .map-stop.current .map-thumb{outline:3px solid #fff1a3;box-shadow:0 0 22px #ffd05c}
#toast.final-intro{top:35%;width:100%;padding:20px 10px;background:linear-gradient(90deg,transparent,#171030ed 20%,#171030ed 80%,transparent);border-block:2px solid #e3bb5c}#toast.final-intro strong{font-family:Georgia,serif;letter-spacing:3px;color:#ffe68b;font-size:clamp(32px,6vw,86px)}#toast.final-intro span{font-size:clamp(12px,1.3vw,18px);max-width:92%;width:fit-content}
@media(max-width:759px){#final-banner{top:62px;font-size:14px;letter-spacing:2px}#final-banner small{display:none}body[data-biome="FINAL"] #q-number{margin-top:0}#toast.final-intro{top:38%}}
#game-pause{position:absolute;left:25px;top:148px;z-index:5;background:#071a30ed;color:#ffe6a4;border:1px solid #d4ae61;border-radius:8px;padding:9px 12px;font-size:12px;pointer-events:auto}
#earned-achievements h2{font-size:18px;color:#ffe6a4}#earned-achievements ul,#achievement-list{list-style:none;padding:0;display:grid;gap:8px}#earned-achievements li,#achievement-list li{padding:10px;border:1px solid #b8934a;border-radius:8px;background:#12223be8;color:#ffe5a3}#earned-achievements small,#achievement-list small{display:block;font-size:12px;margin-top:5px;color:#e6dfd3}#achievement-list .locked{opacity:.55}#achievements{max-height:85vh;overflow:auto}
@media(max-width:759px){#game-pause{top:auto;bottom:145px;left:12px;font-size:11px;padding:8px}.title-buttons{gap:7px}#earned-achievements h2{font-size:16px}}
/* Dedicated title composition keeps the rear-view party visible behind the menus. */
.title-cart{position:absolute;width:min(48vw,650px);height:auto;right:9%;bottom:-3%;pointer-events:none;filter:drop-shadow(0 14px 15px #07132aaa)}#title .title-buttons{z-index:2}#title .title-logo,#title .title-copy,#title .title-kicker{position:relative;z-index:1}body:has(#title:not([hidden])) #world{visibility:hidden}
@media(max-width:759px){.title-cart{width:86vw;right:7%;bottom:23%}#title .title-buttons{display:grid;grid-template-columns:1fr 1fr;width:86%;bottom:5vh;gap:7px}#title .title-buttons #start{grid-column:1/3}#title .title-buttons button{font-size:14px;height:40px}#title .title-logo{margin-top:8px}#title{padding-top:3vh}#title .title-copy{margin:10px auto;font-size:12px}}
@media(min-width:760px){.title-cart{width:min(39vw,570px);right:12%;bottom:-2%}}
/* Keep the rear-view cart unobstructed, and use the vacated question area for verdicts. */
@media(min-width:760px){.controls{padding:0 22px;justify-content:space-between}.controls .key-hint{min-width:125px;padding:8px 12px}.controls .key-hint:last-child{margin-right:160px}.speed-panel{bottom:125px}body[data-play-state="result"] .quiz,body[data-play-state="falling"] .quiz,body[data-play-state="clear"] .quiz{visibility:hidden}}
body[data-play-state="result"] #toast,body[data-play-state="falling"] #toast,body[data-play-state="clear"] #toast{top:85px;width:70%;padding:0;background:none;border:0}body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:clamp(30px,4vw,54px)}#toast span{margin-top:6px}
@media(max-width:759px){body[data-play-state="result"] .quiz,body[data-play-state="falling"] .quiz,body[data-play-state="clear"] .quiz{visibility:hidden}body[data-play-state="result"] #toast,body[data-play-state="falling"] #toast,body[data-play-state="clear"] #toast{top:120px;width:94%}body[data-play-state="clear"] #toast.final-intro strong{font-size:32px}}
#ending-scene{position:fixed;inset:0;z-index:15;overflow:hidden;background:linear-gradient(#09092488,#19144122),url('../assets/stage-stars.png') center/cover;text-align:center;color:#fff0bf;--arrival:0}#ending-scene[hidden]{display:none}.ending-heading{position:absolute;top:7%;width:100%;text-shadow:0 3px 6px #000}.ending-heading h1{font-size:clamp(30px,5vw,64px);margin:12px;color:#ffe39a}.ending-heading p{font-size:clamp(13px,2vw,21px)}.ending-station{position:absolute;top:42%;left:10%;width:80%;padding:18px;border:4px double #ffe195;background:#171431cc;font:bold clamp(14px,2vw,28px) Georgia;box-shadow:0 0 30px #eabb68}.ending-cart{position:absolute;width:min(48vw,490px);bottom:0;left:50%;transform:translateX(-50%) translateY(calc((1 - var(--arrival))*120px)) scale(calc(.6 + var(--arrival)*.4));filter:drop-shadow(0 0 20px #bfa0ff)}#ending-skip{position:absolute;right:22px;bottom:22px;padding:14px 22px;background:#101932e8;border:2px solid #e9c875;color:#fff0bf;border-radius:10px;z-index:2}.ending-stars{font-size:30px;letter-spacing:4vw;color:#ffe599}.ending-fireworks{position:absolute;inset:25% 10%;pointer-events:none;background:repeating-conic-gradient(from 0deg,transparent 0deg 27deg,#ffd86c 28deg 29deg,transparent 30deg 45deg);mask-image:radial-gradient(circle,transparent 10%,#000 11% 12%,transparent 13% 25%,#000 26% 27%,transparent 28%);animation:firework 2s ease-out infinite;opacity:.8}@keyframes firework{from{transform:scale(.3);opacity:1}to{transform:scale(1.4);opacity:0}}@media(max-width:759px){.ending-cart{width:90vw;bottom:10%}.ending-station{top:35%;left:5%;width:90%}.ending-heading{top:10%}}@media(prefers-reduced-motion:reduce){.ending-fireworks{animation:none}.ending-cart{transform:translateX(-50%)}}
/* Symmetric controls flank the cart; verdicts stay near the fork without dominating it. */
@media(min-width:760px){.controls{padding:0;justify-content:center;gap:clamp(340px,34vw,520px)}.controls .key-hint{width:135px;min-width:135px}.controls .key-hint:last-child{margin-right:0}.speed-panel{bottom:125px}}
body[data-play-state="result"] .quiz,body[data-play-state="falling"] .quiz,body[data-play-state="clear"] .quiz{visibility:visible}
body[data-play-state="result"] #toast,body[data-play-state="falling"] #toast,body[data-play-state="clear"] #toast{top:43%;width:70%}
body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:clamp(26px,3vw,40px)}
body[data-play-state="result"] #toast span,body[data-play-state="falling"] #toast span,body[data-play-state="clear"] #toast span{font-size:13px;padding:7px 16px;margin-top:4px}
@media(max-width:759px){body[data-play-state="result"] #toast,body[data-play-state="falling"] #toast,body[data-play-state="clear"] #toast{top:41%;width:94%}body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:28px}body[data-play-state="result"] #toast span,body[data-play-state="falling"] #toast span,body[data-play-state="clear"] #toast span{font-size:11px;padding:6px 10px}}
body.is-falling #hud .quiz{visibility:hidden}
/* Align speed and left/right control panels along the same bottom edge. */
@media(min-width:760px){.speed-panel{bottom:24px;min-height:84px}}
@media(max-height:650px) and (min-width:760px){.speed-panel{bottom:12px}}
/* Restore emphasis to verdict headings while retaining the adjusted position. */
body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:clamp(38px,4.5vw,62px)}
@media(max-width:759px){body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:38px}}
/* Clear, large verdicts: one dark outline behind the fill, without competing bright edges. */
body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-family:'Yu Gothic','Meiryo',sans-serif;font-weight:900;font-size:clamp(48px,5.8vw,80px);line-height:1.2;paint-order:stroke fill;-webkit-text-stroke:7px #101a32!important;color:#fff0a8;text-shadow:0 4px 6px #0009!important;letter-spacing:.03em}
body #toast.bad strong{color:#e1eaff!important;-webkit-text-stroke-color:#141d44!important}
@media(max-width:759px){body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{font-size:clamp(38px,11vw,48px);-webkit-text-stroke-width:5px!important}body[data-play-state="clear"] #toast strong{font-size:clamp(30px,8vw,40px)}}
/* Align verdict heading and caption with the central distance sign. */
#toast{left:50%;transform:translateX(-50%);text-align:center}
#toast strong{display:block;width:100%;margin-left:auto;margin-right:auto;text-align:center;text-indent:.03em}
#toast span{display:table;width:auto;max-width:100%;margin-left:auto;margin-right:auto;text-align:center}
#title .title-cart{left:50%;right:auto;transform:translateX(-50%);z-index:1;bottom:0;width:min(38vw,530px)}.title-rails{position:absolute;left:50%;transform:translateX(-50%);bottom:0;width:75%;height:58%;pointer-events:none}#title .title-kicker,#title .title-copy{color:#fff8df;font-weight:900;paint-order:stroke fill;-webkit-text-stroke:4px #102a4b;text-shadow:0 3px 5px #000a;z-index:2}
body[data-play-state="result"] #toast,body[data-play-state="falling"] #toast,body[data-play-state="clear"] #toast{top:var(--verdict-top,39%)}
body[data-play-state="result"] #toast span,body[data-play-state="falling"] #toast span,body[data-play-state="clear"] #toast span{margin-top:12px}body:not([data-play-state="running"]) #answer-status{visibility:hidden}
@media(max-width:759px){#title .title-cart{width:78vw;bottom:23%}.title-rails{width:100%;height:54%;bottom:12%}#title .title-kicker,#title .title-copy{-webkit-text-stroke-width:3px}}
#title-sound{position:absolute;right:20px;bottom:22px;z-index:3;background:#071a30e8;color:#ffedb6;border:1px solid #d8b66b;border-radius:9px;padding:10px 14px;font-size:12px} @media(max-width:759px){#title-sound{right:10px;bottom:auto;top:5px;font-size:10px;padding:6px}}
#quiz-setup select{font:inherit;max-width:68%;padding:10px;background:#fff3d6;color:#172237;border:1px solid #d8b668;border-radius:6px}#quiz-setup{max-height:90vh;overflow:auto}#quiz-begin{background:#f0ce7a;color:#172237;font-weight:bold}#skip-wrong{position:absolute;right:22px;bottom:130px;z-index:8;background:#071a30ee;border:2px solid #d5b16d;border-radius:9px;color:#fff0bc;padding:12px;pointer-events:auto}#skip-wrong[hidden]{display:none}@media(max-width:759px){#skip-wrong{right:10px;bottom:120px;font-size:11px;padding:10px}}
/* Keep skip above the controls and offer the same left / GO / right layout on touch screens. */
.key-hint .key-symbol{margin-top:0;font-size:inherit;letter-spacing:normal}
.key-hint.selected{outline:3px solid #fff1ad;outline-offset:3px;box-shadow:0 0 18px #ffdf78}
#skip-wrong{bottom:190px}
@media(max-width:759px){
 .controls{width:calc(100% - 28px);display:grid;grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr);gap:12px;align-items:start;bottom:calc(18px + env(safe-area-inset-bottom))}
 .controls .key-hint{display:flex!important;flex-direction:column;justify-content:center;align-items:center;min-width:0;width:100%;height:85px;padding:8px 4px;font-size:22px;background:linear-gradient(#e93540,#95091a)}
 .controls .key-hint:last-child{background:linear-gradient(#288aff,#034096)}
 .controls .key-symbol{font-size:0}
 .controls .key-symbol kbd{display:none}
 .controls .key-symbol kbd:first-child{display:inline-block;font-size:27px;border:0;background:none;padding:0}
 .controls .key-hint span:last-child{margin-top:5px;font-size:12px;letter-spacing:0}
 .speed-panel{bottom:calc(150px + env(safe-area-inset-bottom))}
 #game-pause{left:auto;right:14px;bottom:calc(150px + env(safe-area-inset-bottom))}
 #skip-wrong{left:50%;right:auto;transform:translateX(-50%);bottom:calc(215px + env(safe-area-inset-bottom));white-space:nowrap}
}
/* Readable genre cards, with a clear selected state and generous touch targets. */
#quiz-setup{width:min(94vw,620px);padding:26px;background:linear-gradient(145deg,#123650,#081e33);border:3px double #e6c782}
#quiz-setup h2{font-size:24px;margin-bottom:22px;color:#fff0be}
.quiz-choices{border:0;padding:0;margin:0 0 20px;min-width:0}
.quiz-choices legend{font-size:16px;font-weight:bold;color:#fff;margin-bottom:10px}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#quiz-setup .choice-grid button{margin:0;min-height:54px;padding:12px 9px;font-size:16px;font-weight:bold;line-height:1.45;border:1px solid #829bad;border-radius:9px;background:#173c55;color:#fff;text-shadow:none}
#quiz-setup .choice-grid button[aria-pressed=true]{background:#ffe5a2;border:2px solid #fff3cf;color:#182b40;box-shadow:0 0 0 2px #c2943c}
#quiz-setup .choice-grid button[aria-pressed=true]::before{content:'✓ ';font-weight:900}
.quiz-genre .choice-grid button:first-child,.quiz-genre .choice-grid button:last-child{grid-column:1/-1}
.quiz-level .choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#quiz-setup p{font-size:12px;line-height:1.7;color:#d8e4ee;margin:4px 0 16px}
#quiz-begin{min-height:52px;font-size:17px;padding:12px 25px}
@media(max-width:759px){#quiz-setup{padding:20px 16px;max-height:94dvh}#quiz-setup h2{font-size:21px;margin-bottom:18px}.quiz-choices{margin-bottom:16px}#quiz-setup .choice-grid button{font-size:14px;min-height:48px;padding:10px 6px}.choice-grid{gap:8px}}
/* Primary departure action stands apart from the secondary back action. */
#quiz-setup #quiz-begin{display:block;width:100%;min-height:62px;margin:20px 0 12px;padding:14px 20px;border:3px double #fff6cf;border-radius:12px;background:linear-gradient(180deg,#fff1ad 0%,#ffd15d 48%,#e5a52f 100%);color:#17283c;font-size:22px;font-weight:900;letter-spacing:.06em;text-shadow:0 1px #fff6cf;box-shadow:0 4px 0 #875716,0 0 20px #ffd66a55}
#quiz-setup #quiz-begin::before{content:'▶ ';font-size:.8em}
#quiz-setup #quiz-begin:hover{filter:brightness(1.08);box-shadow:0 4px 0 #875716,0 0 26px #ffd66a88}
#quiz-setup #quiz-begin:active{transform:translateY(2px);box-shadow:0 2px 0 #875716}
#quiz-setup button[data-close]{display:block;margin:0 auto;padding:8px 24px;min-height:42px;background:#102c43;color:#e1e9ef;border-color:#668399}
@media(max-width:759px){#quiz-setup #quiz-begin{min-height:58px;font-size:20px;margin-top:16px}}
/* Keep ending copy legible over the stars and fireworks. */
.ending-heading{padding:0 18px}
.ending-heading h1,.ending-heading small,#ending-line{paint-order:stroke fill;-webkit-text-stroke:4px #10152e;text-shadow:0 3px 4px #000c,0 0 12px #080b21;font-weight:900}
.ending-heading h1{-webkit-text-stroke-width:6px;line-height:1.35}
.ending-heading small{color:#fff3cf;letter-spacing:.08em;-webkit-text-stroke-width:3px}
#ending-line{color:#fff8df;font-size:clamp(16px,2vw,22px);line-height:1.8;max-width:760px;margin:12px auto;padding:8px 14px;border-radius:12px;background:#10152e66;text-wrap:balance}
@media(max-width:759px){.ending-heading h1{-webkit-text-stroke-width:5px}#ending-line{-webkit-text-stroke-width:3px;padding:8px 10px}}

button.pad-focus,input.pad-focus,select.pad-focus{outline:4px solid #fff!important;outline-offset:4px;box-shadow:0 0 20px #75d9ff!important}
/* Lift the title cart clear of the footer and departure buttons. */
#title .title-cart{bottom:7vh}
@media(max-width:759px){#title .title-cart{bottom:27%}}
/* Jewel-like verdict lettering; keep the established position and dark outline. */
body[data-play-state="result"] #toast strong,body[data-play-state="falling"] #toast strong,body[data-play-state="clear"] #toast strong{color:#ffe69a;letter-spacing:.045em;text-shadow:0 2px 0 #a66819,0 5px 0 #513315,0 8px 12px #000b,0 0 24px #ffc94d70!important}
#toast strong::after{content:'';display:block;width:clamp(110px,28vw,300px);height:3px;margin:8px auto 0;background:linear-gradient(90deg,transparent,#c58b34,#fff2b3,#c58b34,transparent);box-shadow:0 3px 8px #0007}
body #toast.bad strong{color:#dae7ff!important;text-shadow:0 2px 0 #6b85b9,0 5px 0 #253354,0 8px 12px #000c,0 0 22px #809aff88!important}
#toast.bad strong::after{background:linear-gradient(90deg,transparent,#7696e0,#e2eaff,#7696e0,transparent)}
#toast.final-intro strong{color:#fff0ba}
#toast span{border:1px solid #d3b36999;background:linear-gradient(135deg,#142740ef,#081426eb);box-shadow:0 4px 12px #0007;color:#fff4db}
/* Shared cover-style gold logo for title and in-game map. */
#title .title-logo .game-logo{display:block;width:min(64vw,760px);height:auto;max-height:25vh;object-fit:contain}
.mini-logo img{display:block;width:100%;height:auto;filter:drop-shadow(0 2px 3px #00132b)}
@media(max-width:759px){#title .title-logo .game-logo{width:92vw;max-height:19vh}#title .title-logo small{margin-top:9px}}
/* Expanded question picker and trophy collection. */
#quiz-setup{width:min(94vw,740px)}
.quiz-genre .choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.quiz-genre .choice-grid button:last-child{grid-column:auto}
#achievements{width:min(94vw,860px);max-height:90dvh;overflow:auto}
#trophy-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;list-style:none;padding:0}
#trophy-list .trophy-card{display:grid;grid-template-columns:35px 1fr;gap:9px;border:1px solid #668096;border-radius:12px;padding:14px;background:#10273d;color:#edf2fb;opacity:1}
.trophy-icon{font-size:29px}.trophy-card.gold.unlocked{border-color:#ffdd78;background:linear-gradient(130deg,#47381a,#13283e)}.trophy-card.silver.unlocked{border-color:#c6dcf1}.trophy-card.bronze.unlocked{border-color:#dc9d68}.trophy-card.locked .trophy-icon{color:#7890a3}
.trophy-card b{font-size:14px}.trophy-card p{font-size:12px;margin:8px 0;line-height:1.6}.trophy-card small{display:block;font-size:11px}.trophy-card progress{width:100%;height:10px;accent-color:#f2c45c}.trophy-card button{font-size:12px;padding:8px 12px}.trophy-card button[aria-pressed=true]{background:#efcc7e;color:#142438}
#trophy-title{color:#ffde87;font-weight:bold}.save-note{font-size:11px!important;color:#c5d6e3}
#practice-dialog{width:min(94vw,650px);max-height:90dvh;overflow:auto}.practice-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.practice-options button{min-height:64px;margin:0;padding:12px}.practice-options button:first-child{background:#87283d}.practice-options button:last-child{background:#145183}#practice-feedback{margin-top:18px}#practice-feedback strong{font-size:21px;color:#ffe29d}#practice-next{width:100%;background:#e9c675;color:#13253a;font-weight:bold}
#equipped-title{position:absolute;bottom:5vh;left:50%;transform:translateX(-50%);font-size:12px;color:#ffe9aa;text-shadow:0 2px 3px #000;z-index:3;white-space:nowrap}
@media(min-width:760px){#title .title-buttons{bottom:12%;gap:8px}#title .title-buttons button{height:46px}#title .title-buttons #start{height:60px}}
@media(max-width:759px){.quiz-genre .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#trophy-list{grid-template-columns:1fr}#equipped-title{bottom:1vh;font-size:10px}.title-footer{display:none}#title .title-buttons{gap:6px}#title .title-buttons button{font-size:13px}}

#quiz-setup .quiz-genre button[data-value="dqx"]{text-wrap:balance;word-break:keep-all;overflow-wrap:normal}
@media(max-width:759px){#quiz-setup .quiz-genre button[data-value="dqx"]{font-size:12px;letter-spacing:0}}
#achievements>.trophy-close{float:right;margin:0 0 12px 12px;padding:8px 14px}
#trophy-summary{clear:both;word-break:keep-all;font-size:12px;line-height:1.8}

/* Dedicated pause control and menu. */
#game-pause{width:48px;height:48px;padding:0;font:900 28px Georgia,serif;display:grid;place-items:center;border:2px solid #e3be73;box-shadow:0 3px 12px #0008}
#pause-menu{width:min(90vw,430px);padding:30px;text-align:center;border:3px double #edc879;border-radius:18px;background:linear-gradient(145deg,#183a50,#091a30);box-shadow:0 15px 70px #0009}
#pause-menu::backdrop{background:#031126aa;backdrop-filter:blur(5px)}
.pause-emblem{margin:auto;display:grid;place-items:center;width:58px;height:58px;border:2px solid #e4bd6e;border-radius:50%;color:#ffe4a0;font:900 32px Georgia,serif}
#pause-menu h2{margin:16px 0 10px;font:700 32px Georgia,serif;letter-spacing:.14em;color:#ffe7aa}
#pause-menu p{font-size:13px;line-height:1.8;color:#dbe6ef}
#pause-menu button{display:block;width:100%;min-height:54px;margin:14px 0;border-radius:9px;font-weight:700}
#pause-menu #pause-resume{background:linear-gradient(#ffe6a1,#d9a645);color:#152940;border:2px solid #fff0ba}
#pause-menu small{display:block;margin-top:20px;font-size:11px;color:#b9cbdc}
@media(max-width:759px){#game-pause{width:44px;height:44px;font-size:26px}#pause-menu{padding:24px 20px}}
#pause-menu button{text-shadow:none;-webkit-text-stroke:0}

/* Pause glyph drawn as two bars, independent of font appearance. */
.pause-bars{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:24px;height:26px}
.pause-bars::before,.pause-bars::after{content:"";display:block;width:7px;height:24px;border-radius:2px;background:currentColor;box-shadow:0 1px 2px #0005}

/* Classic RPG verdicts: engraved type, outer navy rim and metallic face. */
body #toast strong,body[data-play-state] #toast strong{position:relative;font-family:'Yu Mincho','Hiragino Mincho ProN','Noto Serif CJK JP','MS PMincho',serif;font-weight:900;letter-spacing:.035em;line-height:1.3;color:#ffce55!important;paint-order:stroke fill;-webkit-text-stroke:7px #101b32!important;text-shadow:0 -2px 0 #fff1bd,2px 0 0 #fff1bd,-2px 0 0 #fff1bd,0 3px 0 #b57522,0 6px 0 #58311a,0 9px 8px #000b!important;isolation:isolate}
body #toast strong::before{content:attr(data-title);position:absolute;inset:0 0 auto;pointer-events:none;color:transparent;-webkit-text-fill-color:transparent;-webkit-text-stroke:0!important;background:linear-gradient(180deg,#fff9db 5%,#ffeaaa 22%,#f8c442 45%,#fff1a3 49%,#d89022 56%,#ffcc58 76%,#a94d0e 100%);background-clip:text;-webkit-background-clip:text;text-shadow:none!important;filter:drop-shadow(0 1px 0 #9d5c22)}
body #toast.bad strong{color:#c6dcff!important;-webkit-text-stroke-color:#101936!important;text-shadow:0 -2px 0 #ebf6ff,2px 0 0 #c1d7ff,-2px 0 0 #c1d7ff,0 4px 0 #536fbb,0 7px 0 #282351,0 9px 8px #000b!important}
body #toast.bad strong::before{background-image:linear-gradient(180deg,#fff 6%,#e7f4ff 25%,#a9cfff 46%,#f0f6ff 49%,#7393e3 57%,#ada9ff 78%,#5950aa 100%);filter:drop-shadow(0 1px 0 #4d559b)}
body #toast strong.verdict-english{font-family:Georgia,'Times New Roman',serif;letter-spacing:.04em;font-size:clamp(34px,4.8vw,70px)}
body #toast strong.verdict-long{font-size:clamp(30px,3.5vw,52px)}
@media(max-width:759px){body #toast strong,body[data-play-state] #toast strong{-webkit-text-stroke-width:5px!important}body #toast strong.verdict-long{font-size:clamp(23px,6.1vw,34px)}body #toast strong.verdict-english{font-size:clamp(25px,7vw,38px)}}
/* Separate verdict lettering from bright, detailed scenery. */
body #toast strong,body[data-play-state] #toast strong{padding:8px 8px 5px;border-radius:18px;background:radial-gradient(ellipse at center,#061123db 0%,#061123a8 48%,#06112345 70%,transparent 85%);-webkit-text-stroke:10px #071020!important;text-shadow:0 2px 0 #070d19,0 5px 0 #070d19,0 8px 10px #000e,0 0 3px #000!important}
body #toast strong::before{inset:8px 8px auto}
body #toast.bad strong{-webkit-text-stroke-color:#060e22!important;text-shadow:0 2px 0 #060b1c,0 5px 0 #060b1c,0 8px 10px #000e,0 0 3px #000!important}
@media(max-width:759px){body #toast strong,body[data-play-state] #toast strong{-webkit-text-stroke-width:7px!important;padding:6px 5px 4px}body #toast strong::before{inset:6px 5px auto}}

/* Ending and victory headings share the RPG verdict treatment. */
body .ending-heading h1,body #end[data-result="win"] #end-title{position:relative;isolation:isolate;padding:8px;border-radius:18px;font-family:'Yu Mincho','Hiragino Mincho ProN','Noto Serif CJK JP','MS PMincho',serif;font-weight:900;letter-spacing:.035em;line-height:1.3;color:#ffce55;paint-order:stroke fill;-webkit-text-stroke:10px #071020!important;text-shadow:0 2px 0 #070d19,0 5px 0 #070d19,0 8px 10px #000e!important;background:radial-gradient(ellipse at center,#061123db 0%,#061123a8 48%,#06112345 70%,transparent 85%)}
body #end[data-result="win"] #end-title{font-family:Georgia,'Times New Roman',serif;font-size:clamp(26px,3.5vw,46px)}
body .ending-heading h1::before,body #end[data-result="win"] #end-title::before{content:attr(data-title);position:absolute;inset:8px;pointer-events:none;color:transparent;-webkit-text-fill-color:transparent;-webkit-text-stroke:0!important;background:linear-gradient(180deg,#fff9db 5%,#ffeaaa 22%,#f8c442 45%,#fff1a3 49%,#d89022 56%,#ffcc58 76%,#a94d0e 100%);background-clip:text;-webkit-background-clip:text;text-shadow:none!important;filter:drop-shadow(0 1px 0 #9d5c22)}
@media(max-width:759px){body .ending-heading h1,body #end[data-result="win"] #end-title{-webkit-text-stroke-width:7px!important}}

/* Matching RPG headings for defeat, collection and pause. */
body #end[data-result="lose"] #end-title,body #achievements .trophy-heading,body #pause-menu #pause-heading{position:relative;isolation:isolate;padding:6px;font-family:'Yu Mincho','Hiragino Mincho ProN','Noto Serif CJK JP','MS PMincho',serif;font-weight:900;line-height:1.35;letter-spacing:.035em;color:#ffce55;paint-order:stroke fill;-webkit-text-stroke:5px #071020!important;text-shadow:0 3px 0 #070d19,0 5px 6px #000b!important}
body #end[data-result="lose"] #end-title,body #pause-menu #pause-heading{font-family:Georgia,'Times New Roman',serif}
body #end[data-result="lose"] #end-title{color:#c6dcff;-webkit-text-stroke-width:7px!important}
body #achievements .trophy-heading{font-size:clamp(21px,2.4vw,29px)}
body #pause-menu #pause-heading{font-size:30px;letter-spacing:.12em}
body #end[data-result="lose"] #end-title::before,body #achievements .trophy-heading::before,body #pause-menu #pause-heading::before{content:attr(data-title);position:absolute;inset:6px;pointer-events:none;color:transparent;-webkit-text-fill-color:transparent;-webkit-text-stroke:0!important;background:linear-gradient(180deg,#fff9db 5%,#ffeaaa 22%,#f8c442 45%,#fff1a3 49%,#d89022 56%,#ffcc58 76%,#a94d0e 100%);background-clip:text;-webkit-background-clip:text;text-shadow:none!important}
body #end[data-result="lose"] #end-title::before{background-image:linear-gradient(180deg,#fff 6%,#e7f4ff 25%,#a9cfff 46%,#f0f6ff 49%,#7393e3 57%,#ada9ff 78%,#5950aa 100%)}

#games-link{position:absolute;left:18px;bottom:18px;z-index:5;padding:10px 16px;border:1px solid #d4ae61;border-radius:8px;background:#071a30ed;color:#ffe6a4;font-size:13px;text-shadow:none}
@media(max-width:759px){#games-link{left:10px;bottom:34px;padding:8px 10px;font-size:11px}}
/* Center START and its arrow together. */
#title .title-buttons #start{display:flex;align-items:center;justify-content:center;gap:14px}
#title .title-buttons #start span{position:static;inset:auto;display:inline-block;line-height:1;flex:none}

/* Lock touch zoom; keep trophy and settings menus scrollable. */
html,body{touch-action:pan-x pan-y;overscroll-behavior:none}
button,a,input,select{touch-action:manipulation}

/* Keep the return link in the menu flow so it cannot cover achievements. */
#title .title-buttons #games-link{position:static;inset:auto;grid-column:1/-1;order:10;width:100%;margin:0;height:36px;padding:6px 10px;font-size:12px}
@media(max-width:759px){#title .title-buttons{bottom:5vh}#title .title-buttons #games-link{height:34px;font-size:12px}}

/* Mobile gesture lock and deterministic menu rows, v1.0.3. */
#title,#hud,#ending-scene{touch-action:none}
#end{touch-action:pan-y;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
dialog{touch-action:pan-y;overscroll-behavior:contain}
@media(max-width:759px){dialog input,dialog select{font-size:16px}#title .title-buttons{grid-template-areas:"start start" "help settings" "trophies practice" "games games";grid-template-rows:44px 40px 40px 36px;gap:8px}#title .title-buttons #start{grid-area:start;height:44px}#help-button{grid-area:help}#settings-button{grid-area:settings}#achievement-button{grid-area:trophies}#practice-button{grid-area:practice}#title .title-buttons #games-link{grid-area:games;position:static!important;transform:none!important;height:36px}}
/* Shared menu palette; mobile geometry is deliberately unchanged. */
#title .title-buttons #start{background:linear-gradient(180deg,#fff7b7 0%,#ffe176 42%,#e5b13d 55%,#f8d56a 100%);color:#3b260c;border-color:#fff0ac;text-shadow:0 1px 0 #fff5c7;box-shadow:inset 0 0 0 1px #b38129,inset 0 0 15px #fff6bd88,0 3px 8px #06152a88,0 0 14px #ffd76066}
#title #help-button,#title #settings-button{background:linear-gradient(160deg,#125087,#073362 55%,#061b39);border-color:#efd389;color:#fff7df}
#title #achievement-button,#title #practice-button{background:linear-gradient(160deg,#703599,#411768 55%,#240e42);border-color:#efd389;color:#fff7df}
#title .title-buttons #games-link{background:linear-gradient(160deg,#496577,#2a445a 55%,#182d42);border-color:#b9cbd6;color:#f2f7fa}
@media(min-width:760px){
 #title{background:#143751 url('../assets/title-desktop-v1.png') center center/cover no-repeat;padding:0}
 #title .title-cart,#title .title-rails{display:none}
 #title .title-kicker{position:absolute;top:1.5vh;left:4vw;width:54vw;font-size:12px}
 #title .title-logo{position:absolute;left:4vw;top:5vh;width:54vw;margin:0}
 #title .title-logo .game-logo{width:100%;max-width:680px;max-height:29vh;object-fit:contain}
 #title .title-logo small{font-size:clamp(14px,1.5vw,23px);margin-top:8px}
 #title .title-copy{position:absolute;left:4vw;top:39vh;width:54vw;max-width:none;margin:0;font-size:clamp(14px,1.45vw,22px)}
 #title .title-buttons{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:'start start' 'help settings' 'trophies practice' 'games games';left:3vw;bottom:7vh;width:min(44vw,560px);transform:none;gap:12px}
 #title .title-buttons button{height:58px;min-width:0;font-size:clamp(16px,1.6vw,22px);padding:8px;border-width:4px;border-radius:12px}
 #title .title-buttons #start{grid-area:start;height:74px;font-size:36px;letter-spacing:.1em}
 #title #help-button{grid-area:help}#title #settings-button{grid-area:settings}#title #achievement-button{grid-area:trophies}#title #practice-button{grid-area:practice}
 #title .title-buttons #games-link{grid-area:games;height:52px;margin-top:12px;font-size:18px}
 #title .title-footer{left:auto;right:2vw;bottom:2vh;width:auto;font-size:9px}
 #title #equipped-title{left:25vw;bottom:2vh;font-size:12px}
}
@media(min-width:760px) and (max-height:650px){
 #title .title-buttons{gap:8px;bottom:6vh}#title .title-buttons button{height:44px;font-size:16px}#title .title-buttons #start{height:56px;font-size:29px}#title .title-buttons #games-link{height:40px;margin-top:6px;font-size:15px}
}

/* Answer controls must not become browser zoom or selection gestures. */
#hud [data-answer],#hud #go,#hud [data-answer] *,#hud #go *{touch-action:none!important;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#hud .controls,#hud .answers{touch-action:none}
