/* Railway-only shell. The existing train, tunnel and station own their tracks. */
html.game-document:has(body.railway-exemplar),
body.game-first.railway-exemplar { background:#efe5c7; color:#2e4e42; }
body.game-first.railway-exemplar #gameShell .top-bar h1,
body.game-first.railway-exemplar #gameShell #gamesButton,
body.game-first.railway-exemplar #rocketParents { color:#2e4e42; }
body.game-first.railway-exemplar #gameShell .top-controls { width:auto; }
body.game-first.railway-exemplar #gameShell #previousGameButton { display:none; }
body.game-first.railway-exemplar #gameShell .playboard { background:#526c4d; }
body.game-first.railway-exemplar #gameShell .scene-art { background:#efe5c7; }
body.game-first.railway-exemplar .train-world::after { content:''; position:absolute; inset:0; background:linear-gradient(#efe5c7 0%,#efe5c799 14%,transparent 30%,transparent 78%,#526c4d); }
body.game-first.railway-exemplar #gameShell .mission { color:#2e4e42; text-align:center; }
body.game-first.railway-exemplar #gameShell .mission strong { color:#2e4e42; font-size:16px; font-weight:650; }
body.game-first.railway-exemplar #gameShell #missionHint { color:#465f46; margin-top:4px; font:400 12px/1.35 system-ui,sans-serif; }
body.game-first.railway-exemplar #gameShell .phrase-bubble { top:70px; padding:7px 14px; font-size:16px; pointer-events:none; }
body.game-first.railway-exemplar :is(.train-canvas,.tunnel-canvas,.station-canvas) { bottom:7%; max-width:none; }
body.game-first.railway-exemplar #gameShell #phraseGrid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
body.game-first.railway-exemplar #gameShell #phraseGrid .phrase-button { background:#fff3d3; border-color:#fff4d85c; color:#2e4e42; }
body.game-first.railway-exemplar #gameShell #phraseGrid .tone-blue { background:#d8e8e1; }
body.game-first.railway-exemplar #gameShell #phraseGrid .tone-yellow { background:#f2d38b; }
body.game-first.railway-exemplar #gameShell #phraseGrid .phrase-icon { position:relative; }
body.game-first.railway-exemplar #gameShell #regulationRow { background:#2e4e42; }
body.game-first.railway-exemplar #gameShell #regulationRow :is(.is-last-used,[aria-pressed='true']) { background:#456b56; border-color:#b0c5a4; }
body.game-first.railway-exemplar #gameShell #regulationRow .regulation-button:active { background:#456b56; }
body.game-first.railway-exemplar #gameShell #actionRow { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
body.game-first.railway-exemplar #gameShell #actionRow button { font-size:14px; padding:5px; gap:5px; }
body.game-first.railway-exemplar #gameShell #actionRow :is(.replay-picture,.next-picture) { width:36px; height:40px; flex:0 0 36px; }
.railway-help-example { position:absolute; z-index:6; top:68px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:16px; padding:7px 18px; border:1px solid #8caa88; border-radius:18px; background:#fff8e4; color:#2e4e42; pointer-events:none; box-shadow:0 4px 16px #2e4e4218; }
.railway-help-example[hidden] { display:none; }
.railway-help-example span { display:grid; justify-items:center; font:600 12px system-ui,sans-serif; }
.railway-help-example svg { width:58px; height:44px; }
.railway-help-example i { font:600 24px system-ui,sans-serif; }
body.game-first.railway-exemplar.mission-active #gameShell .stage { display:grid; grid-template-rows:60px auto minmax(170px,1fr); }
body.game-first.railway-exemplar.mission-active #gameShell .mission { position:static; padding:7px 12px; }
body.game-first.railway-exemplar.mission-active #gameShell .scene-art { min-height:170px; }
body.game-first.railway-exemplar.mission-active .optional-mission-progress { background:#dee4c8; color:#2e4e42; border:0; border-radius:0; padding:4px 12px; }
body.game-first.railway-exemplar.mission-active .optional-mission-step { min-height:44px; padding-block:2px; }
body.game-first.railway-exemplar.mission-active #optionalMissionContinue { min-height:48px; }
body.game-first.railway-exemplar.mission-active .railway-help-example,
body.game-first.railway-exemplar.mission-active #gameShell .phrase-bubble { top:6px; }
@media(orientation:landscape) and (max-height:550px) {
 body.game-first.railway-exemplar #gameShell #phraseGrid,
 body.game-first.railway-exemplar #gameShell #phraseGrid:has(>button:nth-child(3)) { grid-template-columns:1fr; gap:6px; padding:6px 14px; }
 body.game-first.railway-exemplar #gameShell #phraseGrid .phrase-button,
 body.game-first.railway-exemplar #gameShell #phraseGrid:has(>button:nth-child(3)) .phrase-button { flex-direction:row; min-height:54px; height:58px; font-size:14px; gap:8px; }
 body.game-first.railway-exemplar #gameShell #phraseGrid .phrase-icon { width:44px; height:40px; flex:0 0 44px; }
 body.game-first.railway-exemplar #gameShell #actionRow { height:auto; grid-template-columns:1fr; gap:6px; padding:6px 14px; }
 body.game-first.railway-exemplar #gameShell #actionRow button { height:58px; min-height:58px; }
 body.game-first.railway-exemplar #gameShell .mission { top:0; }
 body.game-first.railway-exemplar #gameShell .phrase-bubble { top:56px; padding:5px 12px; font-size:14px; }
 .railway-help-example { top:54px; padding:4px 14px; }
 .railway-help-example svg { height:30px; }
 body.game-first.railway-exemplar.mission-active #gameShell .stage { grid-template-rows:48px auto minmax(170px,1fr); }
 body.game-first.railway-exemplar.mission-active #gameShell .playboard { min-height:270px; }
}
/* Static invitation stays attached to the engine, never asks for a timed tap. */
body.game-first.railway-exemplar .railway-tap-cue { position:absolute; left:45%; top:-24px; display:flex; align-items:center; gap:3px; white-space:nowrap; padding:3px 7px 3px 3px; border:1px solid #769982; border-radius:16px; background:#fff5d7; color:#2e4e42; font:650 12px system-ui,sans-serif; pointer-events:none; }
.railway-tap-cue svg { width:23px; height:23px; }
body.game-first.railway-exemplar [data-train-motion='moving'] .railway-tap-cue,
body.game-first.railway-exemplar [data-train-arrived='true'] .railway-tap-cue,
body.game-first.railway-exemplar .train-tap-target:disabled .railway-tap-cue { display:none; }
body.game-first.railway-exemplar :is(.train-canvas,.tunnel-canvas,.station-canvas)::before { content:''; position:absolute; left:0; right:0; bottom:9%; height:24%; background:linear-gradient(transparent,#fff1c842,transparent); pointer-events:none; }
body.game-first.railway-exemplar :is(.train-vehicle,.station-vehicle,.tunnel-vehicle) { filter:drop-shadow(0 1px 1px #fff0c5); }
body.game-first.railway-exemplar.mission-active #gameShell .mission { background:#efe5c7; }

/* SVG shadows inflate WebKit accessibility bounds beyond the train button. */
body.game-first.railway-exemplar .train-vehicle { filter:none; }
