body.unified-games{overflow:hidden!important;padding-bottom:0!important;}
body.unified-games #mfStartBar,body.unified-games #menuToggleBtn{display:none!important;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen.unified-game-active{
 position:fixed!important;z-index:10020!important;top:var(--game-view-top,2px)!important;left:50%!important;transform:translateX(-50%)!important;
 width:min(100%,960px)!important;height:var(--game-view-height,calc(100dvh - 4px))!important;min-height:0!important;max-height:none!important;
 display:flex!important;flex-direction:column!important;gap:8px!important;margin:0!important;padding:10px 12px!important;box-sizing:border-box;overflow:hidden!important;
 background:var(--paper,#fff);color:var(--ink,#222);font-family:system-ui,'Noto Sans KR',sans-serif;box-shadow:0 0 0 100vmax var(--paper,#fff);
}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.game-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.meaning-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.bus-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.rail-bar{display:flex;justify-content:space-between;align-items:center;flex:none;gap:8px;margin:0!important;padding:0 2px 6px!important;font-size:14px!important;border:0;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.game-bar b{font-family:inherit;font-size:19px!important;font-weight:600;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #gameField,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #defenseField,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #meaningBoard,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #busBoard,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #railBoard{
 flex:1 1 0!important;min-height:0!important;max-height:none!important;height:auto!important;width:100%!important;box-sizing:border-box;margin:0!important;border:1px solid var(--muted,#999);border-radius:12px;overflow:hidden;
}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #meaningBoard,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #railBoard,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #busBoard{overflow:auto!important;overscroll-behavior:contain;padding:12px!important;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen #defenseCanvas{width:100%;height:100%!important;display:block;aspect-ratio:auto!important;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.game-entry-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;width:100%!important;align-self:stretch!important;gap:6px!important;flex:none;grid-row:auto!important;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .game-entry-row>.action-row{display:flex;gap:6px!important;flex:0 0 auto;margin:0!important;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.meaning-entry,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.bus-entry,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.rail-entry{display:flex!important;gap:6px!important;flex:none;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .game-input,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .meaning-entry input,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .bus-entry input,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .rail-entry input{
 flex:1;min-width:0;width:0!important;height:44px!important;min-height:44px;box-sizing:border-box;margin:0!important;padding:6px 10px!important;border:2px solid var(--brass,#b38b34);border-radius:6px;background:var(--paper,#fff);color:var(--ink);caret-color:var(--ink);font-family:inherit;font-size:22px!important;line-height:1.4;
}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen input::placeholder{font-family:inherit;font-size:16px!important;color:var(--muted,#777);opacity:1;}
body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .game-entry-row button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .meaning-entry button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .bus-entry button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .rail-entry button{
 flex:0 0 64px!important;width:64px!important;min-width:0!important;height:44px!important;min-height:44px!important;box-sizing:border-box;margin:0!important;padding:4px!important;border:1px solid var(--muted,#999);border-radius:5px;background:var(--paper,#fff);color:var(--ink);font-family:inherit;font-size:12px!important;line-height:1.3!important;white-space:normal!important;box-shadow:none;
}
body.unified-games #gameHint,body.unified-games #defenseHint{display:none!important;}
body.unified-games #meaningClue,body.unified-games #railTarget,body.unified-games #busClue{font-size:32px!important;line-height:1.7!important;font-weight:400;color:var(--ink);}
body.unified-games #meaningTopic,body.unified-games #meaningHint,body.unified-games #meaningTime,body.unified-games #railPrompt,body.unified-games #busNext{font-size:16px!important;line-height:1.6;color:var(--ink);}
body.unified-games #railRouteTitle,body.unified-games #busJourneyTitle{font-size:20px!important;line-height:1.5;}
body.unified-games .word{font-family:system-ui,'Noto Sans KR',sans-serif;font-size:22px!important;color:var(--ink);}
body.unified-games #stageNotice{z-index:10040;}
body.unified-games #meaningHintBtn[hidden],body.unified-games #busHint[hidden],body.unified-games #railHint[hidden]{display:none!important;}
/* The dodge game retains its canvas and controls within the same 960px frame. */
body.dodge-playing #dodgeGame{width:min(100%,960px);left:50%;right:auto;transform:translateX(-50%);padding:10px 12px;gap:8px;background:var(--paper);box-shadow:0 0 0 100vmax var(--paper);}
body.dodge-playing #dodgeGame .dodge-hud,body.dodge-playing #dodgeGame .dodge-buttons,body.dodge-playing #dodgeGame .dodge-typing-panel{max-width:none;font-family:system-ui,'Noto Sans KR',sans-serif;}
body.dodge-playing #dodgeGame .dodge-hud{font-size:14px;padding:0 2px 6px;}
body.dodge-playing #dodgeGame .dodge-field{max-width:650px;}
body.dodge-playing #dodgeGame .dodge-word-row{font-size:24px;line-height:1.5;}
body.dodge-playing #dodgeGame.dodge-typing .dodge-buttons{grid-template-columns:minmax(0,1fr) 64px 64px;}
body.dodge-playing #dodgeGame .dodge-buttons button{height:44px;min-height:44px;font-size:12px;border-radius:5px;}
body.dodge-playing #dodgeGame [data-input]{height:44px;font-size:22px;border-radius:6px;}
#journeyPlanner .jp-shell{width:min(100%,960px);padding:10px 12px;}
#journeyPlanner .jp-entry input{min-height:44px;font-size:22px;border-radius:6px;}
#journeyPlanner .jp-entry button{flex:0 0 64px;width:64px;min-height:44px;font-size:12px;border-radius:5px;}
#journeyPlanner #jp-word{font-size:32px;line-height:1.7;}
@media(max-width:820px){
 body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen.unified-game-active,body.dodge-playing #dodgeGame,#journeyPlanner .jp-shell{padding:6px!important;gap:5px!important;}
 body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.game-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.meaning-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.bus-bar,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen>.rail-bar{font-size:12px!important;}
 body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen input,body.dodge-playing #dodgeGame [data-input],#journeyPlanner .jp-entry input{font-size:18px!important;}
 body.unified-games #meaningClue,body.unified-games #railTarget,body.unified-games #busClue,#journeyPlanner #jp-word{font-size:24px!important;}
 body.unified-games #meaningTopic,body.unified-games #meaningHint,body.unified-games #meaningTime,body.unified-games #railPrompt,body.unified-games #busNext{font-size:13px!important;}
 body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .game-entry-row button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .meaning-entry button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .bus-entry button,body.unified-games :is(#gameScreen,#defenseScreen,#meaningScreen,#busScreen,#railScreen).unified-game-screen .rail-entry button,#journeyPlanner .jp-entry button{width:52px!important;flex-basis:52px!important;font-size:11px!important;}
 body.dodge-playing #dodgeGame.dodge-typing .dodge-buttons{grid-template-columns:minmax(0,1fr) 52px 52px;}
}

/* Fill the input column even when legacy mobile alignment is active. */
body.unified-games :is(#gameScreen,#defenseScreen).unified-game-screen .game-entry-row>.game-input{width:100%!important;max-width:none!important;justify-self:stretch!important;}

/* v199: station target anchored above the entry; clear typing contrast. */
body #railBoard{display:flex!important;flex-direction:column;}
body #railBoard>#railRouteTitle,body #railBoard>.rail-track,body #railBoard>#railProgress,body #railBoard>#railStations,body #railBoard>#railPrompt,body #railBoard>#railTarget,body #railBoard>#railFeedback{flex-shrink:0;}
body #railBoard>#railStations{margin-top:12px;}
body #railBoard>#railPrompt{margin-top:auto!important;padding-top:8px;}

/* Fixed row placement applies at every viewport width. */
body.rail-playing #railScreen #railBoard{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 60px auto auto minmax(0,1fr) auto auto auto;align-content:stretch!important;}
body.rail-playing #railScreen #railBoard>#railPrompt{margin-top:8px!important;}
body.rail-playing #railScreen #railBoard>#railSceneSpace{min-height:0;}



/* v201: shared .ch rules in index.html own status colors and effects. */
body :is(#busClue,#railTarget,#jp-word)>span.ch{font-weight:inherit;}

/* v206: PC quiz problem position and controls share the input row. */
.quiz-position{display:none!important;}
@media(min-width:821px){
 body.unified-games #meaningScreen #meaningBoard{display:flex!important;flex-direction:column;justify-content:safe center;}
 body.unified-games[data-quiz-position="top"] #meaningScreen #meaningBoard{justify-content:flex-start;}
 body.unified-games[data-quiz-position="bottom"] #meaningScreen #meaningBoard{justify-content:safe flex-end;}
 body.unified-games #meaningScreen #meaningBoard>*{flex-shrink:0;}
 body.unified-games #meaningScreen .meaning-entry .quiz-position{display:inline-block!important;flex:0 0 54px!important;width:54px!important;}
 body.unified-games #meaningScreen .meaning-entry .quiz-position.active{background:var(--brass,#b38b34);color:var(--paper,#fff);border-color:var(--brass,#b38b34);}
}
