/* One landscape control layout for mouse and touch. */
.mobile-round{--tool-size:56px;--edge:max(10px,env(safe-area-inset-left));touch-action:none}
.mobile-round .round-top{inset:8px auto auto var(--edge);height:36px;width:max-content;padding:0;gap:10px;background:none;border:0;box-shadow:none;pointer-events:none}
.mobile-round .round-counter{display:flex;align-items:center;gap:7px;height:36px;padding:3px 9px;background:#143d4dc9;border:1px solid #dbf5e080;border-radius:12px;color:#fff7d3;text-shadow:0 2px #17384a;font-size:22px;font-weight:900;font-variant-numeric:tabular-nums}
.mobile-round .round-counter .icon{width:29px;height:29px;flex:none}
.mobile-round .round-clock{font-size:19px;color:#fff}
.mobile-round .round-clock .icon{width:22px;height:22px;color:#d7f6ff}
.mobile-round #board{inset:0}
.mobile-round .hud-tool{width:var(--tool-size);height:var(--tool-size);min-height:48px;padding:5px;border-radius:12px;touch-action:manipulation}
.mobile-round [data-round="speed"]{font-size:22px;font-weight:900}
.mobile-round .hud-tool .icon{width:29px;height:29px;justify-self:center}
.mobile-round .side-tools,.mobile-round .hud-boosters{position:absolute;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:12px;z-index:7;margin:0}
.mobile-round .side-tools{left:var(--edge);right:auto;top:50px;bottom:6px;transform:none;justify-content:center}
.mobile-round .hud-boosters{right:max(12px,env(safe-area-inset-right));left:auto}
.mobile-round .hud-boosters>.eyebrow{display:none}
.mobile-round .tool-label{font-size:10px;line-height:12px;text-shadow:0 1px #15394e;font-weight:800}
.mobile-round .side-tools .icon{width:26px;height:26px}
.mobile-round .hud-tool .stock{font-size:13px;min-width:23px}
.mobile-round .round-bottom{display:none;pointer-events:none;left:85px;right:85px;bottom:8px;height:auto;min-height:28px;padding:5px 10px;border:1px solid #b4d8de70;border-radius:10px;background:#113d51e8;font-size:12px}
.mobile-round .round-bottom.show-hint{display:flex}
.mobile-round .preparation-pill{top:8px;padding:6px 12px;pointer-events:none}
.mobile-round .preparation-pill b{font-size:27px}
.mobile-round .field-control.switch-control,.mobile-round .field-control.signal-control{width:48px;height:48px}
.mobile-round .field-control.train-target{width:48px;height:48px}
.mobile-round .field-control.cancel-control,.mobile-round .field-control.wreck-control{width:44px;height:44px}
.train-picker{position:absolute;z-index:8;left:50%;bottom:12px;transform:translateX(-50%);padding:12px;display:flex;gap:8px;align-items:center;background:#123953f5;border:2px solid #addce5;border-radius:14px;box-shadow:0 5px 15px #1238}
.train-picker[hidden]{display:none}.train-picker b{font-size:12px}.train-picker .game-btn{min-height:48px;font-size:12px;border-top:4px solid var(--train-color)}
.mobile-round .round-overlay{padding:65px 80px 10px}
.mobile-round .round-overlay .panel{max-height:100%;overflow:auto}
.mobile-round .round-overlay.tutorial-overlay{padding:65px 85px 10px}
.mobile-round .round-overlay .tutorial-panel{width:min(700px,100%)}
.mobile-round.tutorial-prompt .hud-boosters{z-index:21;pointer-events:none}
.mobile-round .hud-boosters .tutorial-point::after{top:30%;left:-20px;transform:rotate(90deg);animation:side-finger 1s ease-in-out infinite}
@keyframes side-finger{50%{transform:translateX(-7px) rotate(90deg)}}
@media(max-height:420px){
 .mobile-round{--tool-size:48px}
 .mobile-round .side-tools,.mobile-round .hud-boosters{gap:6px}
 .mobile-round .tool-label{font-size:9px}
 .mobile-round .hud-tool{border-radius:10px}
 .mobile-round .hud-tool .icon{width:26px;height:26px}
 .mobile-round .side-tools .icon{width:22px;height:22px}
 .mobile-round .round-bottom{font-size:10px;bottom:4px;padding:3px 7px;min-height:23px}
 .mobile-round .preparation-pill{font-size:10px;padding:3px 10px}
 .mobile-round .preparation-pill small{display:none}
 .mobile-round .round-overlay .tutorial-panel{gap:12px;padding:12px;grid-template-columns:.8fr 1.2fr}
 .mobile-round .tutorial-copy .game-btn{min-height:48px}
 .mobile-round .round-overlay .tutorial-copy p{font-size:11px;line-height:1.4}
 .mobile-round .round-overlay .tutorial-copy h2{font-size:18px}
 .mobile-round .round-overlay .actions .game-btn{min-height:48px}
}
@media(prefers-reduced-motion:reduce){.mobile-round .hud-boosters .tutorial-point::after{animation:none}}
.mobile-round .train-picker{max-width:calc(100% - 160px);width:max-content;flex-wrap:wrap;justify-content:center}
.mobile-round .train-picker>b{flex-basis:100%;text-align:center}
@media(max-height:420px){.mobile-round .round-overlay .panel:not(.tutorial-panel){width:min(580px,100%);padding:12px 18px}.mobile-round .round-overlay .panel:not(.tutorial-panel) .actions{flex-direction:row;flex-wrap:wrap;justify-content:center}.mobile-round .round-overlay .panel:not(.tutorial-panel) h2{margin:8px 0}}

@media(max-height:340px){.mobile-round .side-tools{gap:4px}}
.mobile-round .result-panel{width:min(500px,100%)}
.mobile-round .result-totals{display:flex;justify-content:center;gap:16px;margin:14px 0}
.mobile-round .result-total{display:flex;align-items:center;justify-content:center;gap:10px;min-width:125px;padding:10px 16px;border-radius:13px;background:#113856aa;border:1px solid #a5dce76b}
.mobile-round .result-total b{font-size:32px;font-variant-numeric:tabular-nums}
.mobile-round .result-total .icon{width:36px;height:36px;color:#d6f5ff}
.mobile-round .result-bonus,.mobile-round .result-energy,.mobile-round .result-life{display:flex;justify-content:center;align-items:center;gap:7px;font-size:15px;margin:8px 0}
.mobile-round .result-bonus{color:#fff0ad}
.mobile-round .result-bonus .icon,.mobile-round .result-energy .icon,.mobile-round .result-life .icon{width:25px;height:25px}
.mobile-round .result-failure{border-color:#eda38a;background:linear-gradient(#713f58,#3e304a);box-shadow:0 6px #29273f}
.mobile-round .result-failure h2{color:#fff0d4}
.mobile-round .result-failure p{max-width:370px;margin:12px auto;line-height:1.45}
.mobile-round .failure-emblem{display:flex;justify-content:center;margin:8px}
.mobile-round .failure-emblem .icon{width:54px;height:54px;color:#ffb299}
.mobile-round .result-life .icon{color:#ff8e99}
@media(max-height:420px){
 .mobile-round .round-overlay .result-panel{padding:12px 20px}
 .mobile-round .result-totals{margin:8px 0}
 .mobile-round .result-total{padding:6px 12px}
 .mobile-round .result-total b{font-size:27px}
 .mobile-round .result-panel .stars .icon{width:29px;height:29px}
 .mobile-round .result-panel .stars{margin:6px 0}
 .mobile-round .result-panel .actions{margin-top:10px}
 .mobile-round .result-failure .failure-emblem{display:none}
 .mobile-round .result-bonus,.mobile-round .result-energy{font-size:13px;margin:5px 0}
}

.mobile-round .tool-label{white-space:nowrap}
.mobile-round .round-overlay.result-overlay{padding:8px 80px}
@media(max-height:340px){
 .mobile-round .round-overlay.result-overlay{padding:6px 80px}
 .mobile-round .round-overlay .panel.result-panel{padding:8px 20px}
 .mobile-round .round-overlay .panel.result-panel h2{font-size:21px;margin:4px 0}
 .mobile-round .result-panel .stars{margin:4px 0}
 .mobile-round .result-panel .stars .icon{width:25px;height:25px}
 .mobile-round .result-totals{margin:6px 0}
}
.mobile-round.tutorial-prompt .side-tools{z-index:21;pointer-events:none}
.mobile-round.tutorial-prompt .side-tools .hud-tool:not(.tutorial-highlight){opacity:.25}
.mobile-round .hud-tool.tutorial-highlight{opacity:1!important}
.mobile-round .side-tools .tutorial-point::after{left:calc(100% + 12px);top:28%;transform:rotate(-90deg);animation:tool-finger 1s ease-in-out infinite}
@keyframes tool-finger{50%{transform:translateX(6px) rotate(-90deg)}}
.mobile-round .field-control.tutorial-rail-target{position:absolute;width:48px;height:48px;border:3px solid #fff0a0;border-radius:50%;background:#d87150;color:#fff;font-size:28px}
.tutorial-speed-demo{display:block;font-size:25px;color:#ffeb9e;margin-top:12px}
@media(max-height:420px){.mobile-round .round-overlay .tutorial-panel{grid-template-columns:.65fr 1.35fr}.mobile-round .round-overlay.tutorial-overlay{padding-top:50px}}
@media(prefers-reduced-motion:reduce){.mobile-round .side-tools .tutorial-point::after{animation:none}}
/* With a floating HUD, lessons can use the whole height, even at browser zoom. */
.mobile-round .round-overlay.tutorial-overlay{padding:10px 85px}
.mobile-round.tutorial-prompt .round-top{z-index:7}
@media(max-height:300px){
 .mobile-round{--tool-size:44px}
 .mobile-round .hud-tool{min-height:44px}
 .mobile-round .side-tools{top:44px;bottom:4px;gap:3px}
 .mobile-round .tool-label{font-size:8px}
 .mobile-round .round-top{top:5px}
 .mobile-round .round-counter{height:32px}
 .mobile-round .round-overlay .tutorial-panel{padding:10px;gap:10px}
}
.demo-demolish-track{animation:demolish-track 4s linear infinite}
.demo-demolish-finger{animation:demolish-finger 4s ease-in-out infinite;transform:translate(250px,50px)}
@keyframes demolish-track{0%,55%{opacity:1}65%,95%{opacity:0}100%{opacity:1}}
@keyframes demolish-finger{0%,15%{transform:translate(340px,100px);opacity:0}35%,55%{transform:translate(250px,50px);opacity:1}65%,100%{transform:translate(250px,40px);opacity:0}}
@media(prefers-reduced-motion:reduce){.demo-demolish-track,.demo-demolish-finger{animation:none}}

/* New transport: teaser in loadout, actual game model on a paused introduction. */
.level-summary>div:nth-child(2){min-width:0;flex:1}
.new-train-badge{flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;align-self:center;text-align:center;margin-left:auto;color:#ffe18b;font-size:13px;white-space:nowrap}
.new-train-badge>span{display:grid;place-items:center;width:54px;height:56px;border:3px solid #fff0a3;border-radius:14px;background:linear-gradient(#ffe775,#efa72c);box-shadow:0 4px #aa691d,inset 0 2px #fff6c4;color:white;font-size:38px;font-weight:900;text-shadow:0 2px #855117;-webkit-text-stroke:1px #855117;transform:rotate(5deg)}
.train-model-preview{width:100%;height:240px;background:radial-gradient(ellipse,#77cde066,transparent 70%);border-radius:20px}
.train-model-preview canvas{display:block;width:100%;height:100%}
.train-preview-caption{display:block;text-align:center;font-weight:900;color:#ffde7d;margin-top:5px}
.train-intro-panel .train-intro-gift{color:#ffe28d}
@media(max-height:500px){.train-model-preview{height:155px}.new-train-badge{font-size:10px;gap:5px}.new-train-badge>span{width:38px;height:40px;font-size:29px}.train-preview-caption{font-size:12px}}
@media(max-width:550px){.new-train-badge{font-size:10px}.new-train-badge>span{width:34px;height:38px;font-size:27px}.level-summary{gap:10px}}

.fullscreen-button{flex:none;width:48px;height:48px;min-height:48px;padding:9px;touch-action:manipulation}
.fullscreen-button .icon{width:26px;height:26px}
.fullscreen-button:disabled{opacity:.45;cursor:default}
.menu-fullscreen{position:absolute;z-index:3;left:max(16px,env(safe-area-inset-left));top:max(16px,env(safe-area-inset-top))}
.mobile-round .round-fullscreen{position:absolute;z-index:8;right:max(12px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));width:44px;height:44px;min-height:44px;border-radius:12px;padding:7px}
html:fullscreen,html:-webkit-full-screen{width:100%;height:100%;background:#123c60}

.language-picker{display:flex;align-items:center;gap:12px;font-size:13px;color:#e2f4ff;font-weight:700}
.language-picker select{font:inherit;color:#173c58;background:#e9f6fb;border:2px solid #73acc5;border-radius:8px;min-height:44px;padding:7px 26px 7px 10px;cursor:pointer}
.settings-row>.language-picker{width:100%;justify-content:space-between;color:inherit}
html[lang="en"] .booster-card b{overflow-wrap:normal}
html[lang="en"] .tool-label{font-size:9px}
@media(max-height:420px){.language-picker{font-size:11px}.language-picker select{min-height:40px}.settings-row{gap:10px}}

/* Short presentation-only transitions; never transform the interactive board. */
@keyframes screen-arrive{from{opacity:0}to{opacity:1}}
@keyframes menu-arrive{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes panel-arrive{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes backdrop-arrive{from{opacity:0}to{opacity:1}}
@keyframes backdrop-leave{from{opacity:1}to{opacity:0}}
.screen-enter{animation:screen-arrive 240ms ease-out}
.scene.screen-enter .welcome-layout>*,.scene.screen-enter .map-heading,.scene.screen-enter .journey{animation:menu-arrive 260ms cubic-bezier(.2,.7,.2,1)}
#app>.boot{animation:screen-arrive 180ms ease-out}
#modal[open]{animation:panel-arrive 200ms cubic-bezier(.2,.7,.2,1)}
#modal[open]::backdrop{animation:backdrop-arrive 180ms ease-out}
#modal.is-closing::backdrop{animation:backdrop-leave 140ms ease-in forwards}
.round-overlay:not([hidden])>.panel{animation:panel-arrive 200ms cubic-bezier(.2,.7,.2,1)}
@media(prefers-reduced-motion:reduce){
 .screen-enter,.scene.screen-enter .welcome-layout>*,.scene.screen-enter .map-heading,.scene.screen-enter .journey,#app>.boot,#modal[open],#modal[open]::backdrop,.round-overlay:not([hidden])>.panel{animation:none!important}
}
