/* Android owns system insets; web browsers retain CSS safe-area support. */
body.android{--safe-top:0px;--safe-bottom:0px}
.toy-gui .world-header{padding-top:calc(var(--safe-top) + 12px);padding-bottom:12px}
.toy-gui .home-screen.world-home{max-width:500px}
.toy-gui .world-departure{justify-content:center;padding:16px var(--screen-gutter) calc(var(--safe-bottom) + 20px)}
.toy-gui .world-home #start-btn{width:min(100%,320px);height:62px;font-size:25px;gap:16px}
.toy-gui .world-home #start-btn .entry-cost{font-size:19px}
.toy-gui .world-home #home-lives{min-width:100px;justify-content:center;gap:6px;padding:4px 10px}
.toy-gui .world-home #life-timer{font-size:16px;font-weight:900;line-height:1}
.toy-gui .world-home #home-lives [data-lives][hidden],.toy-gui .world-home .wallet-plus[hidden]{display:none!important}
/* Only the route title and pause remain in the play header. */
.toy-gui .game-shell{max-height:none;padding-top:calc(var(--safe-top) + 10px);padding-bottom:calc(var(--safe-bottom) + 18px)}
.toy-gui .game-top{display:flex;height:52px;min-height:52px;gap:12px;margin:0 0 12px}
.toy-gui .level-badge{flex:1;min-width:0;max-width:none;margin:0;padding:0;height:52px;display:grid;place-items:center;border-radius:16px;border-width:2px;border-bottom-width:5px}
.toy-gui .level-badge:before,.toy-gui .level-badge:after{display:none}
.toy-gui .game-top h2{font-size:23px;line-height:1.2}
.toy-gui .game-top .icon-button{width:52px;min-width:52px;height:52px;min-height:52px;margin:0}
.toy-gui .game-shell .board-panel{padding:10px;min-height:150px}
.toy-gui .game-shell .picture-heading{display:none!important}
.toy-gui .tutorial-cue{margin:0 0 8px;padding:4px 8px;min-height:26px;font-size:12px}
.toy-gui .game-shell .board-stage{width:100%;flex:1;min-height:0}
.toy-gui .game-shell .pixel.front{outline:none;filter:none}
.toy-gui .game-shell .pixel.next-cargo:after,.toy-gui .game-shell .pixel.route-target:after{display:none}
.toy-gui .game-shell .pixel.route-target{outline:none;box-shadow:none}
.toy-gui .game-shell .tools-deck{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:20px 4px 0;padding:0 0 6px;flex-shrink:0}
.toy-gui .game-shell .tools-deck button.item-button{position:relative;isolation:isolate;display:grid;place-items:center;width:100%;height:76px;min-height:64px;padding:5px;border-radius:22px;border:3px solid #ffe5a2;border-bottom:6px solid #88602d;background:radial-gradient(ellipse at 50% 15%,#fff4bd 0%,#eabe67 68%,#cb9144 100%);box-shadow:inset 0 2px #fffce4,inset 0 -3px #ac722944,0 4px #433b3c,0 7px 9px #07182e77;overflow:visible}
.toy-gui .game-shell .tools-deck button.item-button:before{content:'';position:absolute;inset:5px 5px 10px;border-radius:15px;background:radial-gradient(ellipse,#ffffffb0,#fee5ad00);z-index:-1}
.toy-gui .game-shell .tools-deck .gui-item-art{display:block;width:62px;height:62px;max-width:100%;margin:0;background-image:url('art/items-v10.png');background-size:200% 200%;background-position:var(--item-position);filter:drop-shadow(0 2px 1px #584b2966)}
.toy-gui .tools-deck button.item-button .item-stock{position:absolute;right:-6px;bottom:-8px;min-width:30px;height:30px;display:grid;place-items:center;padding:0 5px;border:2px solid #fff1b6;border-bottom:4px solid #564236;border-radius:10px;background:linear-gradient(#f9efcb,#ead59b);color:#4f3825;font-size:19px;font-weight:950;line-height:1;text-shadow:none;box-shadow:0 2px 3px #06172b88}
.toy-gui .tools-deck button.item-button.is-empty .item-stock{background:linear-gradient(#a4dd54,#42994b);color:#fff;border-color:#e3ff9b;border-bottom-color:#2a6539;font-size:26px}
.toy-gui .tools-deck button.item-button:disabled{opacity:1;filter:saturate(.55);background:linear-gradient(#d7d5b9,#adb7b5);border-color:#ecedd7;border-bottom-color:#5d757d}
.toy-gui .tools-deck button.item-button:disabled .gui-item-art{opacity:.65}
.toy-gui .tools-deck button.item-button.item-coach{outline:3px solid #ffffdd;outline-offset:4px;animation:item-pulse 1.3s ease-in-out infinite}
.toy-gui .tools-deck button.item-button.is-active:after{content:'✓';position:absolute;left:-3px;top:-5px;background:#418757;color:#fff8d8;border:2px solid #e6f8ad;border-radius:50%;width:23px;height:23px;font-size:16px;line-height:20px}
@keyframes item-pulse{50%{box-shadow:0 0 18px #fff1af,0 4px #433b3c}}
/* Item dialogs use the same large icon as the button; purchases add inventory only. */
.toy-gui #booster-dialog .gui-item-hero{background-image:url('art/items-v10.png');background-size:200% 200%;width:120px;height:120px;margin:0 auto;flex-shrink:0}
#booster-dialog[data-item='radar'] .gui-item-hero{background-position:0% 0%}
#booster-dialog[data-item='bay'] .gui-item-hero{background-position:100% 0%}
#booster-dialog[data-item='priority'] .gui-item-hero{background-position:0% 100%}
#booster-dialog[data-item='thaw'] .gui-item-hero{background-position:100% 100%}
.toy-gui #booster-dialog :is(#booster-description,#booster-balance){text-align:center;margin:0}
.toy-gui #booster-balance{font-size:14px}
.toy-gui #booster-options:empty{display:none}
.toy-gui #booster-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:220px;overflow:auto;padding:4px 4px 8px;flex-shrink:1;min-height:0}
.toy-gui #booster-options button.priority-option{position:relative;height:66px;min-height:60px;padding:3px;background:#294d66;border:2px solid #99bac1;border-bottom:4px solid #142f46;border-radius:14px}
.priority-ship{position:absolute;inset:0;background:url('art/motherships-v4.png') var(--sx) var(--sy)/300% 200%}
.toy-gui .priority-option b{position:absolute;right:4px;bottom:2px;padding:1px 5px;background:#fff0c4;color:#4b3322;border:1px solid #bd9d62;border-radius:5px;font-size:17px}
/* A shared character vignette connects title and message without more copy. */
.popup-scene{position:relative;width:180px;height:108px;margin:0 auto;flex-shrink:0;isolation:isolate}
.popup-scene:before{content:'';position:absolute;inset:25px 0 0;background:radial-gradient(ellipse,#fff7cdaa,transparent 68%);z-index:-1}
.popup-ship{position:absolute;left:0;top:0;width:155px;height:108px;background:url('art/motherships-v4.png') 100% 0%/300% 200%;filter:drop-shadow(0 5px 3px #87613444)}
.popup-worker{position:absolute;right:0;bottom:2px;width:50px;height:64px;background:url('art/worker-v4.png') center/contain no-repeat;filter:drop-shadow(0 3px 2px #87613444)}
.toy-gui #confirm-dialog #confirm-text{text-align:center;font-size:15px;word-break:keep-all}
.toy-gui #settings-dialog .popup-scene{height:72px;width:136px}.toy-gui #settings-dialog .popup-ship{width:110px;height:74px}.toy-gui #settings-dialog .popup-worker{width:36px;height:48px}
.toy-gui #settings-dialog .toggle{min-height:44px;font-size:15px}
.toy-gui #settings-dialog .account-card{font-size:14px}
.toy-gui #settings-dialog .account-card p{font-size:12px}
.toy-gui #settings-dialog{gap:12px}
.pause-options{display:flex;gap:16px;justify-content:center;padding-top:0}.toy-gui .pause-options .icon-button{width:52px;height:52px;min-height:52px;font-size:26px}
@media(max-height:700px){
 .toy-gui .game-shell{padding-top:calc(var(--safe-top) + 8px);padding-bottom:calc(var(--safe-bottom) + 16px)}
 .toy-gui .game-top{height:48px;min-height:48px;margin-bottom:10px}.toy-gui .game-top .icon-button,.toy-gui .level-badge{height:48px;min-height:48px}.toy-gui .game-top h2{font-size:21px}
 .toy-gui .game-shell .board-panel{padding:7px;min-height:150px}
 .toy-gui .game-shell .tools-deck{margin-top:14px;gap:12px}
 .toy-gui .game-shell .tools-deck button.item-button{height:62px;min-height:62px;border-radius:18px;padding:2px}
 .toy-gui .game-shell .tools-deck .gui-item-art{width:50px;height:50px}
 .toy-gui .tools-deck button.item-button .item-stock{height:27px;min-width:27px;right:-5px;bottom:-7px;font-size:17px}
 .toy-gui .world-departure{padding-top:12px;padding-bottom:calc(var(--safe-bottom) + 18px)}
 .toy-gui .world-home #start-btn{height:56px;min-height:56px;font-size:23px}
 .popup-scene{height:86px;width:160px}.popup-ship{width:135px;height:90px}.popup-worker{width:42px;height:54px}
 .toy-gui #booster-dialog .gui-item-hero{width:88px;height:88px}
 .toy-gui #booster-options{max-height:130px}.toy-gui #booster-dialog{gap:12px}
}
@media(prefers-reduced-motion:reduce){.item-coach{animation:none!important}}.reduced .item-coach{animation:none!important}
