*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101a13;color:#f8e8bc;font-family:system-ui,"Microsoft YaHei",sans-serif;touch-action:none;user-select:none}canvas{display:block;width:100%;height:100%}button{font:inherit;cursor:pointer;color:#ffebbe;border:1px solid #b69651;background:linear-gradient(#51472c,#282c23);border-radius:7px;min-width:44px;min-height:38px;padding:5px 10px;touch-action:manipulation}button:active{filter:brightness(1.3)}#hud{position:absolute;top:max(5px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));height:46px;display:flex;align-items:center;gap:clamp(9px,2vw,38px);padding:0 10px;border:1px solid #a8884c;border-radius:7px;background:#131e18ed;box-shadow:0 3px 12px #0007;font-size:clamp(12px,1.5vw,21px)}#hud .title{font-weight:700;letter-spacing:1px;margin-right:auto}small{font-size:11px;color:#c2b895}.title small{display:inline-block;margin-left:8px}.gold{color:#ffd878}#goal{position:absolute;right:max(8px,env(safe-area-inset-right));top:65px;width:clamp(45px,5vw,85px);border:1px solid #ac8b4c;border-radius:7px;background:#142019e6;text-align:center;padding:9px 3px;font-size:clamp(10px,1vw,15px)}#gems{display:flex;flex-direction:column;align-items:center;gap:clamp(8px,2vh,20px);padding:14px 0}.gem{width:22px;height:29px;background:var(--gem);clip-path:polygon(50% 0,94% 24%,85% 77%,50% 100%,15% 77%,6% 24%);opacity:.2;position:relative}.gem:after{content:"";position:absolute;inset:3px 7px;border:1px solid #fffc}.gem.delivered{opacity:1;filter:drop-shadow(0 0 7px var(--gem))}.gem.carried{opacity:.65;animation:pulse 1.3s infinite}#progress{font-size:20px}#toast{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);border-radius:20px;background:#112319dc;padding:7px 16px;font-size:13px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .2s}#toast.show{opacity:1}#warning{position:absolute;bottom:48px;left:50%;transform:translateX(-50%);padding:7px 18px;border:1px solid #fa9665;border-radius:8px;background:#542517eb;color:#ffe6b5;font-size:14px;pointer-events:none}#overlay{position:absolute;inset:0;display:grid;place-items:center;background:#07150a75;backdrop-filter:blur(3px)}#overlay[hidden],#warning[hidden],button[hidden]{display:none}.panel{max-width:540px;text-align:center;background:linear-gradient(135deg,#213a2df5,#111f19f8);border:1px solid #bba263;border-radius:14px;padding:22px 30px;box-shadow:0 20px 70px #0007}.panel h1{font-size:32px;letter-spacing:5px;margin:8px}.panel p{font-size:14px;line-height:1.9;margin:8px 0 12px}.panel .sub{color:#bdbba4;font-size:11px}.panel button{min-width:145px;padding:11px 15px;margin:3px}.panel #start{background:linear-gradient(#bc9853,#7c602f);color:#fff8d9;font-weight:700}#portrait{display:none;position:absolute;inset:0;z-index:10;background:#15251af5;place-items:center;text-align:center;font-size:34px}#portrait h2{font-size:22px}#portrait p{font-size:14px}@keyframes pulse{50%{opacity:1}}@media(orientation:portrait){#portrait{display:grid}}@media(max-height:430px){#hud{height:39px;font-size:12px;gap:12px}#hud button{min-height:32px;padding:2px 8px}#goal{top:53px;padding:5px 2px}#gems{padding:10px 0;gap:12px}.gem{width:17px;height:22px}#progress{font-size:16px}.panel{padding:12px 24px}.panel h1{font-size:24px}.panel p{font-size:12px;line-height:1.7}}@media(max-width:720px){.score{display:none}.title small{display:none}}
 #goal>span{white-space:nowrap;font-size:clamp(9px,.8vw,13px)}
 #goal{border-color:#a58b4855;background:linear-gradient(90deg,#15231b44,#112018dc);box-shadow:0 4px 18px #0004}#gems{gap:15px}.gem{width:24px;height:32px}.shape-0{clip-path:polygon(50% 0,88% 20%,88% 78%,50% 100%,12% 78%,12% 20%);transform:rotate(11deg);margin-left:-5px}.shape-1{clip-path:polygon(45% 0,85% 27%,73% 86%,25% 100%,5% 53%,18% 16%);transform:rotate(-17deg);margin-left:7px}.shape-2{clip-path:polygon(50% 0,100% 32%,79% 91%,20% 91%,0 32%);transform:rotate(9deg);margin-left:-3px}.shape-3{clip-path:polygon(48% 4%,80% 15%,100% 46%,76% 86%,28% 100%,0 58%,9% 22%);transform:rotate(-10deg);margin-left:8px}.shape-4{clip-path:polygon(50% 0,90% 22%,100% 66%,54% 100%,8% 80%,0 30%);transform:rotate(14deg);margin-left:-6px}
 #levels{display:flex;justify-content:center;gap:8px;margin:10px 0}#levels button{min-width:38px;width:38px;padding:6px}#levels button.active{background:#ac8641;color:#fff5cf}#levels button:disabled{opacity:.35;cursor:default}.goal-item{display:flex;flex-direction:column;align-items:center}.goal-item small{font-size:10px;margin-top:2px;color:#c8c8ad}#gems{gap:10px}.gem.shape-0,.gem.shape-1,.gem.shape-2,.gem.shape-3,.gem.shape-4{width:22px;height:27px}#wallet{min-height:16px}@media(max-height:430px){#levels{margin:5px 0}#levels button{min-height:30px}.panel .sub{margin:4px 0}.panel h1{font-size:23px;margin:4px}.panel p{margin:5px 0}.panel button{padding:8px 12px}#gems{gap:7px}.gem.shape-0,.gem.shape-1,.gem.shape-2,.gem.shape-3,.gem.shape-4{width:17px;height:22px}}
.goal-crystal{width:27px;height:31px;display:block}.goal-item span{font-size:9px;color:#dfd6b7}.goal-item small{font-size:8px;white-space:nowrap}.goal-item{min-width:55px;border-radius:5px;padding:2px 0}.goal-item.aboard{box-shadow:inset 0 0 0 1px #dfb860}.goal-item.complete{background:#4dad7040}.goal-item.flash{animation:goalFlash .5s 4}#goal{width:74px}#gems{gap:4px;padding:5px 0}.goal-help{display:block;font-size:8px;color:#e4d699}@keyframes goalFlash{50%{background:#ffd37b77;box-shadow:0 0 12px #e7c77c}}@media(max-height:430px){.goal-crystal{width:24px;height:28px}#goal{width:68px}.goal-item{padding:0}#gems{gap:2px}}
@media(max-height:430px){.goal-item{line-height:10px}.goal-item small{margin-top:0;line-height:9px}.goal-item span{line-height:10px}.goal-crystal{width:23px;height:25px}#gems{gap:1px;padding:3px 0}}
/* Landscape reference layout: left operations, square board, gemstone column. */
#hud{left:calc(var(--layout-x) + 18px * var(--layout-s));top:calc(24px * var(--layout-s));right:auto;width:calc(340px * var(--layout-s));height:calc(756px * var(--layout-s));display:flex;flex-direction:column;justify-content:space-between;gap:4px;padding:10px 8px;font-size:12px;background:linear-gradient(130deg,#203b2cf0,#112119f5);border:1px solid #b69a5d;box-shadow:0 6px 20px #0008}#hud .title{margin:0;font-size:14px;text-align:center;letter-spacing:0}#hud .title small{display:block;margin:3px 0;font-size:10px}#hud .score{display:flex;flex-direction:column;text-align:center}#hud .score b{font-size:21px;color:#ffe2a0}#hud>span{display:block;text-align:center}#mini-map{width:88px;height:88px;border:1px solid #9e8959;border-radius:7px;background:#12251a}#hud #map{font-size:11px;min-height:30px;width:100%}.trip-status{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;font-size:11px}.function-buttons{display:grid;grid-template-columns:1fr 1fr;gap:4px;width:100%}.function-buttons button{font-size:11px;min-width:0;min-height:30px;padding:3px}.function-buttons #reset-level{grid-column:1/3}#goal{left:calc(var(--layout-x) + 1100px * var(--layout-s));right:auto;top:calc(55px * var(--layout-s));width:calc(86px * var(--layout-s));min-width:48px;background:#12251bec}#gems{gap:2px}.goal-item{min-width:0}.goal-item small{font-size:7px}.goal-item span{font-size:8px}.goal-crystal{width:23px;height:25px}#goal>span{font-size:9px}#progress{font-size:16px}#toast{font-size:11px;max-width:70vw;white-space:normal;text-align:center;left:62%;bottom:8px}#warning{left:62%;font-size:11px}@media(max-height:370px){#hud{padding:6px;font-size:10px}#hud .title{font-size:12px}#mini-map{width:65px;height:65px}.function-buttons button{min-height:26px}#hud .score b{font-size:18px}.trip-status{gap:6px;font-size:10px}.goal-crystal{width:20px;height:23px}}
#goal .goal-help{white-space:nowrap;font-size:7px}#goal .goal-item small{font-size:7px}#goal{overflow:visible}
/* Size every piece of the operations panel in the same coordinate system. */
#hud{justify-content:flex-start;gap:calc(15px * var(--layout-s));padding:calc(24px * var(--layout-s));font-size:clamp(12px,calc(27px * var(--layout-s)),32px);border:2px solid #b59b60;border-radius:12px;background:linear-gradient(145deg,#214937f7,#102b22fa 55%,#0b1d18fa);box-shadow:inset 0 0 0 3px #101f17,inset 0 0 35px #7c9d6940,0 6px 20px #0008}#hud .title{font-size:clamp(15px,calc(32px * var(--layout-s)),40px);line-height:1.25;color:#ffebb8;text-shadow:0 2px 2px #000;letter-spacing:1px;padding-bottom:calc(12px * var(--layout-s));border-bottom:1px solid #b99f6066;width:100%}#hud .title small{font-size:clamp(10px,calc(22px * var(--layout-s)),26px);color:#cabd96;margin:calc(7px * var(--layout-s)) 0 0}#hud .score{width:100%;padding:calc(12px * var(--layout-s));font-size:clamp(12px,calc(25px * var(--layout-s)),30px);border:1px solid #af955b;border-radius:7px;background:linear-gradient(#081b16,#254735);box-shadow:inset 0 2px 8px #0009;color:#c9c9ab}#hud .score b{font-size:clamp(25px,calc(53px * var(--layout-s)),64px);line-height:1.1;margin-top:4px;letter-spacing:2px}#hud>span:not(.title):not(.score){font-size:clamp(12px,calc(27px * var(--layout-s)),32px);color:#ded9bc}#remaining{color:#ffdf8e;font-size:clamp(19px,calc(40px * var(--layout-s)),48px);margin-left:5px}#mini-map{width:calc(190px * var(--layout-s));height:calc(190px * var(--layout-s));min-width:70px;min-height:70px;flex-shrink:0;border:2px solid #9e8959;box-shadow:0 2px 8px #0008,inset 0 0 10px #0008}#hud #map{font-size:clamp(11px,calc(24px * var(--layout-s)),29px);height:calc(55px * var(--layout-s));min-height:28px;flex-shrink:0}.trip-status{font-size:clamp(11px,calc(25px * var(--layout-s)),29px);gap:calc(14px * var(--layout-s));width:100%;padding:calc(9px * var(--layout-s)) 0;border-top:1px solid #b99f6055}.function-buttons{margin-top:auto;gap:calc(10px * var(--layout-s))}.function-buttons button{font-size:clamp(12px,calc(27px * var(--layout-s)),32px);min-height:32px;height:calc(62px * var(--layout-s));border:1px solid #d4b474;background:linear-gradient(#79633b,#463c29 50%,#283d30);box-shadow:inset 0 1px 0 #ffedb466,0 2px 4px #0006;border-radius:6px;color:#ffedc5;font-weight:600}#hud #reset-level{background:linear-gradient(#355544,#173b2c)}
#hud{gap:calc(8px * var(--layout-s));padding:calc(16px * var(--layout-s))}#hud .title{padding-bottom:calc(5px * var(--layout-s))}#hud .score{padding:calc(8px * var(--layout-s))}#hud .score b{font-size:clamp(21px,calc(46px * var(--layout-s)),58px)}#mini-map{width:calc(140px * var(--layout-s));height:calc(140px * var(--layout-s));min-width:56px;min-height:56px}.trip-status{padding:calc(6px * var(--layout-s)) 0}.function-buttons{gap:calc(7px * var(--layout-s));flex-shrink:0}.function-buttons button{white-space:nowrap;font-size:clamp(11px,calc(23px * var(--layout-s)),28px);height:calc(54px * var(--layout-s));min-height:30px}
#countdown{position:absolute;left:calc(var(--layout-x) + 746px * var(--layout-s));top:46%;transform:translate(-50%,-50%);font-size:clamp(70px,15vh,140px);font-weight:800;color:#fff0b6;text-shadow:0 4px 0 #785329,0 0 25px #ffd476;background:#102019b5;border:2px solid #bba36a;border-radius:50%;width:1.5em;height:1.5em;text-align:center;line-height:1.5;pointer-events:none}#countdown[hidden]{display:none}

/* Keep transport status legible on small landscape phones. */
#goal .goal-item small{white-space:pre-line;font-size:9px;line-height:1.15;color:#f0e6c7;margin-top:1px}#goal .goal-item span{font-size:10px;line-height:1.2}#goal .goal-help{font-size:8px}#gems{gap:3px}.goal-item.complete small{color:#afffc5}

#goal{min-width:60px}#goal .goal-item small{width:100%;overflow-wrap:normal}

#goal{min-width:78px;padding:6px 4px;border:2px solid #d9bc75;background:linear-gradient(#20452f,#122a20);box-shadow:0 0 12px #0009,inset 0 0 12px #88b95133}#goal>span{font-size:12px;font-weight:700}.goal-item{width:100%;position:relative}#goal .goal-item small{font-size:9px;line-height:10px}#goal .goal-item span{font-size:10px}.goal-crystal{width:26px;height:27px}#gems{gap:2px;padding:3px 0}.goal-item.aboard .goal-crystal,.goal-item.complete .goal-crystal{filter:drop-shadow(0 0 4px #fff3a5);animation:gemShimmer 1.8s infinite}.goal-item.aboard:after,.goal-item.complete:after{content:"✦";position:absolute;right:7px;top:5px;color:#fff2a5;animation:gemShimmer 1.5s infinite}@keyframes gemShimmer{50%{filter:drop-shadow(0 0 7px #fff4b7);opacity:.75}}

/* Dedicated wider mission column, bounded by the landscape height. */
#goal{width:calc(160px * var(--layout-s));min-width:96px;top:calc(55px * var(--layout-s));bottom:calc(24px * var(--layout-s));display:flex;flex-direction:column;padding:5px 4px;overflow:hidden}
#goal>span{font-size:13px;line-height:18px;flex-shrink:0}#gems{flex:1;min-height:0;justify-content:space-around;gap:0;padding:1px 0}.goal-item{flex:1;min-height:0;justify-content:center;border-bottom:1px solid #d9bf6833}.goal-crystal{width:32px;height:28px;flex-shrink:1;min-height:17px}#goal .goal-item span{font-size:12px;line-height:13px}#goal .goal-item small{font-size:10px;line-height:11px;margin:0}#progress{font-size:19px;line-height:22px;flex-shrink:0}#goal .goal-help{font-size:9px;line-height:11px;flex-shrink:0}

#hud{width:calc(300px * var(--layout-s))}#hud .title{font-size:clamp(13px,calc(28px * var(--layout-s)),35px)}#goal{left:calc(var(--layout-x) + 1040px * var(--layout-s))}#countdown{left:calc(var(--layout-x) + 686px * var(--layout-s))}

#goal .goal-crystal{height:26px;width:28px;flex-shrink:0}#goal .goal-item small{white-space:nowrap;font-size:10px;line-height:12px}#goal .goal-item span{line-height:12px}

#tutorial{position:absolute;z-index:6;left:35%;right:18%;bottom:12px;padding:10px 14px;border:2px solid #d5b16a;border-radius:9px;background:#102b24f5;box-shadow:0 4px 25px #000b;font-size:12px}#tutorial[hidden]{display:none}#tutorial strong{font-size:16px;color:#ffe2a2}#tutorial p{line-height:1.5;margin:6px 0}#tutorial button{min-height:30px;font-size:12px;padding:4px 12px;margin-right:5px}.tutorial-focus{outline:3px solid #fff0a4;box-shadow:0 0 20px #ffe481!important}

#challenge-progress{font-size:9px;line-height:12px;color:#f4d28a;flex-shrink:0}#goal .goal-crystal{height:24px}

/* Compact frame, larger content at phone AND tablet scale. */
#goal{width:calc(108px * var(--layout-s));min-width:74px;padding:calc(10px * var(--layout-s)) 3px;border-radius:14px 5px 14px 5px;background:linear-gradient(135deg,#35583b,#18382c 55%,#574632);border-color:#d4b46d}
#goal>span{font-size:clamp(11px,calc(24px * var(--layout-s)),30px);line-height:1.25}#goal .goal-crystal{width:clamp(30px,calc(64px * var(--layout-s)),88px);height:clamp(27px,calc(66px * var(--layout-s)),92px)}#goal .goal-item span{font-size:clamp(10px,calc(20px * var(--layout-s)),25px);line-height:1.2}#goal .goal-item small{font-size:clamp(8px,calc(14px * var(--layout-s)),18px);line-height:1.25}#goal .goal-help,#challenge-progress{font-size:clamp(8px,calc(14px * var(--layout-s)),18px);line-height:1.25;white-space:normal}#progress{font-size:clamp(18px,calc(34px * var(--layout-s)),44px);line-height:1.25}#gems{justify-content:center;gap:calc(8px * var(--layout-s))}.goal-item{flex:0 1 auto;padding:calc(4px * var(--layout-s)) 0;border-radius:8px;background:linear-gradient(110deg,#ffdfa00c,#101c1740);border-bottom:1px solid #dec18d44}.goal-item:nth-child(odd) .goal-crystal{transform:rotate(8deg)}.goal-item:nth-child(even) .goal-crystal{transform:rotate(-8deg)}#goal .goal-item.aboard{background:#bf975a33}#goal .goal-item.complete{background:#67b77944}
#hud{border-radius:14px 5px 14px 5px;background:radial-gradient(ellipse at top left,#58704a77,transparent 60%),linear-gradient(145deg,#314b32fa,#183d30fa 55%,#52422afa)}#hud:before,#hud:after{content:"●";position:absolute;color:#ddba6a;font-size:9px;top:3px;text-shadow:0 1px 2px #000}#hud:before{left:5px}#hud:after{right:5px}#hud .score b,#remaining,#progress{font-family:Georgia,"Microsoft YaHei",serif;font-variant-numeric:tabular-nums;text-shadow:0 2px 0 #514127,0 0 8px #ffe7a329}.function-buttons button{border-radius:9px 3px 9px 3px}#goal .goal-item.complete:after,#goal .goal-item.aboard:after{right:1px}

#hud .title{background:linear-gradient(135deg,#866640,#4a3924);border:2px solid #cbb075;border-radius:25% 25% 8px 8px;padding:8px 2px;box-shadow:inset 0 0 0 2px #3c3426,0 3px 6px #0005}#hud .title:before{content:"🚂 ◆";display:block;font-size:.7em;color:#ffe1a1;letter-spacing:5px}#hud .score{border-radius:28% 28% 16% 16%;border:2px solid #c3a465;background:radial-gradient(ellipse,#efddb9,#bfaa7b);color:#594b31;box-shadow:inset 0 0 0 3px #695139,inset 0 0 14px #62472866}#hud .score b{color:#47351f;text-shadow:0 1px 0 #ffefbb}
#hud:before,#hud:after{content:"";top:8%;bottom:8%;width:5px;border-left:1px solid #d8c190;border-right:1px solid #d8c190;background:repeating-linear-gradient(0deg,transparent 0 7px,#8d7759 7px 9px)}#hud:before{left:3px}#hud:after{right:3px}
#tutorial{background:linear-gradient(110deg,#faedcb,#d8bd87);color:#4b3925;border:2px solid #9b7140;border-radius:16px 4px 16px 4px;box-shadow:inset 0 0 15px #a5773b55,0 4px 20px #0007}#tutorial strong{color:#674624;font-family:Georgia,"Microsoft YaHei",serif}#tutorial strong:before{content:"◆ ";color:#a67837}.panel{background:radial-gradient(ellipse at top,#486a49,#182e25);border:3px double #ddba71;border-radius:22px 7px 22px 7px}.panel h1{color:#ffe6a7;font-family:Georgia,"Microsoft YaHei",serif}

#hud .title{font-size:clamp(11px,calc(24px * var(--layout-s)),30px);padding:4px 2px;letter-spacing:0}#hud .title:before{display:none}#hud .title small{margin-top:2px}#hud{gap:calc(5px * var(--layout-s))}#goal .goal-help,#challenge-progress{line-height:1.1}
/* Campaign selection remains usable with all original configurations. */
.panel{width:min(540px,94vw);max-height:94vh;overflow-y:auto;touch-action:pan-y}#levels{flex-wrap:wrap;max-height:112px;overflow-y:auto;touch-action:pan-y;align-content:flex-start}#levels button{margin:0;flex:0 0 38px}#modes{display:flex;justify-content:center;gap:8px}#modes button{min-width:100px;padding:6px 12px}#modes button.active{background:linear-gradient(#bc9853,#7c602f);color:#fff8d9}@media(max-height:430px){#levels{max-height:66px;gap:5px}#modes button{min-height:30px;padding:4px 10px}.panel{max-height:96vh}}#gems{overflow-y:auto;touch-action:pan-y;justify-content:flex-start}.goal-item{flex-shrink:0}
/* Four-character control labels stay inside compact landscape buttons. */
@media(max-width:720px){.function-buttons button{font-size:10px;padding:2px 1px}}
/* Readable notices use screen pixels, independently of the scaled playfield. */
#toast,#warning,#capacity-warning{left:62%;width:max-content;max-width:calc(54vw - 16px);box-sizing:border-box;white-space:normal;text-align:center;line-height:1.4;font-size:clamp(18px,2.2vw,24px);font-weight:700;padding:10px 16px;border:2px solid #ffd584;box-shadow:0 3px 14px #0009;text-shadow:0 1px 2px #0008;pointer-events:none}
#toast{bottom:max(12px,env(safe-area-inset-bottom));background:#193d2bf5;color:#fff5cf;border-radius:12px;z-index:7}
#warning{bottom:100px;background:#8a2f16fa;color:#fff5d8;border-radius:12px;z-index:7}
#capacity-warning{position:absolute;top:max(12px,env(safe-area-inset-top));transform:translateX(-50%);background:linear-gradient(#80521b,#472b12);color:#fff5cf;border-radius:14px;z-index:7}
#capacity-warning strong{display:block;font-size:clamp(22px,2.7vw,30px);color:#ffe18a}
#capacity-warning span{display:block;margin-top:3px;font-size:clamp(16px,1.8vw,21px)}
#capacity-warning[hidden]{display:none}
#toast,#warning,#capacity-warning{left:calc(var(--layout-x,0px) + 686px * var(--layout-s,1));max-width:calc(672px * var(--layout-s,1) - 16px)}
#tutorial{font-size:16px;line-height:1.45;max-height:65vh;overflow-y:auto}
#tutorial strong{font-size:21px}
#tutorial button{font-size:16px;min-height:36px}
.panel p{font-size:clamp(16px,2vw,20px);line-height:1.5}
@media(max-height:430px){#toast,#warning,#capacity-warning{padding:7px 10px}#tutorial{left:32%;right:15%;padding:8px 10px}}
#mission{position:fixed;inset:0;z-index:12;display:grid;place-items:center;background:#081711d9;padding:12px;box-sizing:border-box}
#mission[hidden]{display:none}.mission-panel{width:min(540px,85vw);box-sizing:border-box;border:3px solid #eac77b;background:linear-gradient(145deg,#244b36,#102c25);box-shadow:0 8px 40px #0009;max-height:94vh;overflow-y:auto}
.mission-panel h2{font-size:clamp(20px,3vw,30px);margin:6px 0}.mission-panel p{font-size:16px;line-height:1.4;margin:8px 0}.mission-amount{display:flex;align-items:center;justify-content:center;gap:16px;background:#f4e2b9;color:#523c24;border-radius:24px 6px;padding:7px 20px;margin:10px 0}.mission-amount strong{font-size:52px;line-height:1}.mission-amount span{font-size:20px;font-weight:bold}
.coin-flight{position:fixed;left:0;top:0;z-index:15;width:26px;height:26px;box-sizing:border-box;border:2px solid #fff1a6;border-radius:50%;background:radial-gradient(circle at 30% 25%,#fff5b4,#e4ab28 60%,#9a5e12);box-shadow:0 0 14px #ffde6099;color:#7d4b14;font:bold 18px/22px serif;text-align:center;pointer-events:none;will-change:transform}
.coin-plus{position:fixed;z-index:15;color:#ffe478;font:bold 24px sans-serif;text-shadow:0 2px 3px #392408;pointer-events:none;animation:coin-plus 1s ease-out forwards}.coin-arrival{animation:coin-arrival .55s ease-out}@keyframes coin-plus{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-32px)}}@keyframes coin-arrival{40%{color:#fff7ba;text-shadow:0 0 14px #ffca28;filter:brightness(1.6)}100%{filter:brightness(1)}}
@media(max-height:430px){.mission-panel{padding:12px 20px}.mission-amount{margin:6px 0;padding:4px 16px}.mission-amount strong{font-size:42px}.mission-panel button{font-size:18px;min-height:36px;padding:6px 16px}}

#coin-reward{padding:8px 10px;border:2px solid #d6ad57;border-radius:16px 4px;background:linear-gradient(120deg,#f3dfaa,#b18d4c);color:#36270f;display:grid;gap:3px;text-align:center;font-size:14px;box-shadow:0 3px 8px #0005}#coin-reward strong{font-size:18px}#coin-reward span{font-weight:bold}#coin-reward small{font-size:12px}#coin-meter{width:100%;height:10px;accent-color:#417b46}#challenge-progress{white-space:pre-line;line-height:1.4;font-size:14px!important}#coin-reward-progress{font-size:16px}@media(max-height:430px){#coin-reward{padding:4px 6px;gap:1px;font-size:12px}#coin-reward strong,#coin-reward-progress{font-size:14px}#coin-reward small{font-size:11px}}

@media(max-height:430px){#hud{gap:3px;padding:6px}#hud .title{padding:3px 1px}#hud .title:before{display:none}#hud .score{padding:3px}#mini-map{min-width:36px;min-height:36px;width:36px;height:36px}#hud #map{height:27px;min-height:27px}#coin-reward{gap:0;padding:3px;flex-shrink:0}#coin-reward strong{font-size:12px}#coin-reward-progress{font-size:12px}#coin-reward small{font-size:10px}#coin-reward span{font-size:11px}.function-buttons button{height:27px;min-height:27px}.function-buttons{gap:3px}#challenge-progress{font-size:11px!important}}

#region-preview{position:fixed;top:8px;left:50%;transform:translateX(-50%);z-index:9;background:#4b2d16f2;border:2px solid #ffcf72;border-radius:10px;padding:9px 14px;color:#fff1c8;font-size:18px;font-weight:bold;pointer-events:none;max-width:80vw;text-align:center}#region-preview[hidden]{display:none}

/* Rotation state follows the visible viewport, including Android fullscreen changes. */
#portrait{display:none;position:fixed;z-index:30;padding:24px}html.game-portrait #portrait{display:grid}#portrait p{max-width:340px;line-height:1.7}#portrait button{font-size:18px}

html,body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden}#game{position:absolute;left:0;top:0}
