#mainMenuDialog{position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;box-sizing:border-box;border:0;border-radius:0;padding:clamp(20px,4vw,58px);color:#edf0df;background:radial-gradient(ellipse at 25% 30%,#29424a 0%,#142a32 44%,#0c1b23 100%);overflow:auto;box-shadow:none}
#mainMenuDialog::backdrop{background:#0c1b23}
.menu-layout{max-width:1120px;min-height:calc(100dvh - 116px);margin:auto;display:grid;grid-template-columns:1.15fr 1fr;gap:clamp(32px,6vw,90px);align-items:center}
.menu-kicker{display:flex;align-items:center;gap:10px;font:10px var(--mono);letter-spacing:3px;color:#b8bda1}.menu-kicker i{width:7px;height:7px;background:#f2ba77;border-radius:50%;box-shadow:0 0 18px #efb673}
.menu-intro h2{font:300 clamp(44px,5.5vw,76px)/.98 var(--sans);letter-spacing:-3px;margin:30px 0 18px}.menu-intro h2 b{font-weight:650;color:#edbd83}.menu-intro>p{font:14px/1.8 var(--sans);color:#acbdb8;max-width:360px;margin:0}
.menu-illustration{margin:20px -20px 0;position:relative}.menu-illustration canvas{display:block;width:100%;height:auto;border-radius:5px;mask-image:linear-gradient(to right,transparent,#000 5%,#000 95%,transparent)}.menu-illustration figcaption{font:9px var(--mono);letter-spacing:2px;color:#8daba7;position:absolute;bottom:6px;left:20px}
.menu-actions{display:grid;gap:11px}.menu-section-label{font:10px var(--mono);letter-spacing:2px;color:#91a7a5;margin-bottom:4px}
.menu-choice{width:100%;display:grid;grid-template-columns:42px 1fr 20px;align-items:center;text-align:left;gap:16px;min-height:91px;padding:18px 23px;border:1px solid #637b776b;background:#21394173;border-radius:8px;color:#eef1e6;transition:background .15s,border-color .15s,transform .15s}
.menu-choice:hover{background:#304c50;border-color:#bfc6a7;transform:translateX(3px)}.menu-choice:focus-visible,#resumeGame:focus-visible{outline:2px solid #ffcf93;outline-offset:4px}.menu-choice svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;color:#afcbc4}
.menu-choice strong{display:block;font:500 23px var(--sans);letter-spacing:-.5px}.menu-choice small{display:block;color:#a7bdb8;font:12px var(--sans);margin-top:5px}.menu-choice>i{font:22px var(--sans);font-style:normal;color:#d6bf90}.menu-choice.primary{background:#ddb47f;color:#16292d;border-color:#ecc993}.menu-choice.primary svg,.menu-choice.primary>i{color:#263b39}.menu-choice.primary small{color:#42534a}.menu-choice.primary:hover{background:#f1cd98}.menu-choice:disabled{opacity:.45;cursor:default;transform:none}
#resumeGame{width:100%;min-height:45px;text-align:left;padding:0 3px;margin:4px 0 2px;color:#8fddda;background:none;border:0;font:15px var(--sans)}#resumeGame[hidden],#menuSessionNote[hidden]{display:none}#menuSessionNote{font:11px/1.6 var(--sans);color:#c9bc95;margin:2px 0}
.menu-bottom{display:flex;justify-content:space-between;gap:10px;margin-top:18px;font:9px var(--mono);letter-spacing:1px;color:#8b9f9b}.menu-bottom span:last-child{color:#c1ba98}
#optionsDialog{width:min(570px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box;padding:26px;border-radius:12px;background:#152a31}.options-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.options-head h2{margin:5px 0 0}.options-head button{min-width:44px;min-height:44px;font-size:27px;background:none;border:1px solid #637b77;border-radius:6px;color:#e9eadc}.options-head small{font:9px var(--mono);letter-spacing:2px;color:#d8bc8a}.options-toggles{display:flex;gap:10px;margin-top:20px}.options-toggles button{flex:1;min-height:46px;border:1px solid #5b7777;border-radius:6px;background:#0f242c;color:#dde8dd;font-size:13px}.options-toggles button[aria-pressed=true]{border-color:#a9c3a0;background:#2b4640;color:#d7eac2}
#optionsDialog .audio-mix{margin-top:18px;padding:0;border:0}#optionsDialog .audio-mix h3{font:11px var(--mono);letter-spacing:1px;color:#d5b587;margin:22px 0 14px}#optionsDialog .audio-mix input[type=range]{width:100%;min-height:28px;margin:4px 0 14px}#optionsDialog .audio-mix label{font-size:13px}#optionsDialog .check-row{margin:20px 0;line-height:1.5;font-size:13px;gap:10px}#optionsDialog .check-row input{width:19px;height:19px;flex-shrink:0}.options-note{font:11px/1.6 var(--sans)!important;color:#9dafaa!important}.options-fullscreen{width:100%;justify-content:center;min-height:44px}.music-credit{font-size:11px!important;line-height:1.6!important}
.arena-shell:fullscreen:after{content:none}.battle-footer{display:none}#onlineLocal{display:block;width:100%;margin-top:22px;justify-content:center;min-height:44px}
@media(max-width:700px){#mainMenuDialog{padding:24px 22px}.menu-layout{min-height:calc(100dvh - 48px);grid-template-columns:1fr;gap:20px;align-content:center;max-width:440px}.menu-intro h2{font-size:49px;margin:18px 0 12px}.menu-intro>p{font-size:12px;max-width:300px}.menu-illustration{margin:4px 0 0;max-height:125px;overflow:hidden}.menu-illustration canvas{transform:translateY(-58px)}.menu-illustration figcaption{display:none}.menu-kicker{font-size:8px;letter-spacing:2px}.menu-choice{min-height:72px;padding:14px 17px;grid-template-columns:33px 1fr 15px;gap:13px}.menu-choice strong{font-size:20px}.menu-choice small{font-size:11px}.menu-choice svg{width:29px;height:29px}.menu-actions{gap:9px}.menu-bottom{font-size:8px;margin-top:9px}.menu-section-label{font-size:8px}}
@media(max-height:580px) and (min-width:600px){#mainMenuDialog{padding:20px 32px}.menu-layout{min-height:calc(100dvh - 40px);grid-template-columns:1.05fr 1fr;gap:35px}.menu-intro h2{font-size:49px;margin:17px 0 12px}.menu-intro>p{font-size:11px;line-height:1.6}.menu-illustration{max-height:125px;overflow:hidden;margin:4px -10px 0}.menu-illustration canvas{transform:translateY(-20px)}.menu-illustration figcaption{display:none}.menu-choice{min-height:58px;padding:9px 14px;grid-template-columns:29px 1fr 15px;gap:12px}.menu-choice svg{width:27px;height:27px}.menu-choice strong{font-size:18px}.menu-choice small{font-size:10px;margin-top:3px}.menu-actions{gap:8px}.menu-kicker{font-size:8px;letter-spacing:1px}.menu-bottom{font-size:8px;margin-top:8px}.menu-section-label{font-size:8px;margin-bottom:0}#resumeGame{min-height:34px;font-size:12px}}
@media(max-width:360px){#mainMenuDialog{padding:20px 16px}.menu-intro h2{font-size:40px}.menu-illustration{max-height:85px}.menu-illustration canvas{transform:translateY(-50px)}.menu-layout{gap:16px;min-height:calc(100dvh - 40px)}.menu-choice{min-height:65px}.menu-choice strong{font-size:18px}.menu-bottom{letter-spacing:0}}

/* Compact menus: keep touch targets while showing only the first decisions. */
.menu-layout{max-width:960px;gap:clamp(28px,5vw,65px)}
.menu-intro h2{font-size:clamp(40px,4.6vw,63px);margin-top:22px}
.menu-choice{min-height:76px;padding:13px 19px;grid-template-columns:33px 1fr 18px;gap:13px}
.menu-choice strong{font-size:20px}.menu-choice svg{width:29px;height:29px}.menu-actions{gap:9px}
#settingsDialog{width:min(490px,calc(100vw - 24px));padding:20px;box-sizing:border-box;max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
#settingsDialog h2{font-size:27px;margin:9px 0 8px}#settingsDialog .battle-intro{font-size:12px;margin:0 0 14px;line-height:1.5}
#settingsDialog label{display:block;font-size:12px;color:#b9c5bd;margin-top:12px}
#settingsDialog select{min-height:44px;box-sizing:border-box;padding:8px 10px;margin-top:5px;font:14px var(--sans)}
.battle-basic{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;align-items:start}.battle-basic>label{min-width:0}.battle-basic #challengeLabel,.battle-basic .difficulty-hint{grid-column:1/-1}.battle-basic #challengeLabel[hidden]{display:none}
#settingsDialog .difficulty-hint{min-height:0;padding:8px 10px;font-size:11px!important;line-height:1.5!important;margin:10px 0 0}
#settingsDialog .hangar{margin-top:13px;padding:0 12px}#settingsDialog .hangar summary{font-size:12px;min-height:44px;display:flex;align-items:center}
#settingsDialog .hangar summary{padding:0;gap:7px}#settingsDialog .hangar summary::before{content:'▸';color:var(--amber)}#settingsDialog .hangar[open] summary::before{content:'▾'}
.battle-advanced{border:1px solid #415854;border-radius:6px;padding:0 12px;margin-top:14px}
.battle-advanced summary{min-height:44px;display:list-item;align-content:center;cursor:pointer;color:#bacdc6;font:12px var(--sans)}
#settingsDialog .battle-advanced label{margin:8px 0 14px}#settingsDialog .check-row{display:flex;gap:8px;align-items:center;min-height:44px;line-height:1.4}#settingsDialog .check-row input{width:17px;height:17px;flex-shrink:0}
#settingsDialog .dialog-actions{position:sticky;bottom:-20px;background:#192427;padding:13px 0 7px;margin-top:15px;border-top:1px solid #40534f;gap:10px;z-index:3}#settingsDialog .dialog-actions button{min-height:44px;padding:9px 14px;font-size:12px}
#optionsDialog{width:min(490px,calc(100vw - 24px));padding:20px}#optionsDialog h2{font-size:27px}.options-toggles{margin-top:14px}.options-toggles button{min-height:44px}
#optionsDialog .audio-mix h3{margin:17px 0 10px}#optionsDialog .audio-mix label{font-size:12px;margin-top:9px}#optionsDialog .audio-mix input[type=range]{min-height:28px;margin:2px 0 5px;background-size:100% 4px;background-repeat:no-repeat;background-position:center}
#optionsDialog .check-row{margin:12px 0;font-size:12px}.options-note{font-size:10px!important}.music-credit{font-size:10px!important}
#onlineDialog{width:min(560px,calc(100vw - 24px));padding:20px}.online-head h2{font-size:23px;margin:5px 0 15px}.online-forms{gap:13px;margin-top:15px}.online-forms form{gap:10px}.online-forms h3{font-size:15px}#onlineDialog label{font-size:12px}
#helpDialog{padding:24px;box-sizing:border-box}#helpDialog h2{font-size:26px}.help-grid{gap:8px 18px;margin-top:18px}
@media(max-width:700px){#mainMenuDialog{padding:20px}.menu-layout{gap:14px;max-width:400px;min-height:calc(100dvh - 40px)}.menu-intro h2{font-size:40px;margin:14px 0 9px}.menu-intro>p{font-size:11px;line-height:1.6}.menu-illustration{max-height:85px;margin-top:3px}.menu-illustration canvas{transform:translateY(-57px)}.menu-choice{min-height:62px;padding:10px 15px;grid-template-columns:28px 1fr 15px}.menu-choice strong{font-size:18px}.menu-choice small{font-size:10px;margin-top:4px}.menu-choice svg{width:26px;height:26px}.menu-actions{gap:8px}.menu-bottom{margin-top:6px;font-size:8px}}
@media(max-width:520px){.battle-basic{grid-template-columns:1fr}#settingsDialog{padding:17px}#settingsDialog .eyebrow{font-size:8px}#settingsDialog h2{font-size:25px}#settingsDialog label{margin-top:10px}#settingsDialog .dialog-actions{bottom:-17px}#optionsDialog,#onlineDialog{padding:17px}.online-head h2{font-size:22px}#helpDialog{padding:20px}.help-grid{grid-template-columns:1fr}.menu-bottom{letter-spacing:.4px}}
@media(max-height:580px) and (min-width:600px){#mainMenuDialog{padding:16px 28px}.menu-layout{min-height:calc(100dvh - 32px);gap:30px}.menu-intro h2{font-size:43px;margin:14px 0 10px}.menu-illustration{max-height:105px}.menu-choice{min-height:53px;padding:7px 13px}.menu-choice strong{font-size:17px}.menu-choice small{font-size:10px}.menu-actions{gap:7px}.menu-choice svg{width:25px;height:25px}}
@media(max-width:360px){#mainMenuDialog{padding:17px 15px}.menu-intro h2{font-size:35px}.menu-illustration{max-height:65px}.menu-illustration canvas{transform:translateY(-54px)}.menu-layout{gap:11px;min-height:calc(100dvh - 34px)}.menu-choice{min-height:59px;padding:9px 13px}.menu-choice small{font-size:9px}}

.quality-control{display:grid;gap:7px;margin:16px 0;font-size:14px}.quality-control select{width:100%;min-height:44px;padding:10px 12px;background:#102329;color:#f6e5bd;border:1px solid #526366;border-radius:7px;font:inherit}.quality-control small{color:#9bafaf;font-size:11px;line-height:1.5}
.menu-layout{padding-bottom:18px}.menu-version{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));padding:4px 6px;border-radius:3px;background:#0c1b23e6;color:#9cafaa;font:9px var(--mono);letter-spacing:.6px;pointer-events:none}

/* Help: show the first turn immediately, keep reference material optional. */
#helpDialog{width:min(690px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:22px;overflow-y:auto;overscroll-behavior:contain;border-radius:12px;background:#19282d;color:#e6ebe1;scroll-padding-block:16px 76px}
#helpDialog h2{font-size:26px;line-height:1.2;margin:12px 0}
#helpDialog h3{font:600 15px/1.4 var(--sans);color:#f3d3a0;margin:0 0 10px}
#helpDialog p,#helpDialog li,#helpDialog dd{font:14px/1.65 var(--sans);color:#bfcfc9}
#helpDialog p{margin:10px 0}#helpDialog b{color:#edf0e3;font-weight:600}
#helpDialog .help-lead{margin-bottom:18px}
.help-start{padding:16px;border:1px solid #77836a;border-radius:8px;background:#243b3b}
#helpDialog ol,#helpDialog ul{padding-left:21px;margin:10px 0}
#helpDialog li+li{margin-top:9px}#helpDialog li::marker{color:#f1c68c;font-weight:600}
.help-move{padding:18px 2px 12px}
.help-section{border-top:1px solid #435854}
.help-section:last-of-type{border-bottom:1px solid #435854}
.help-section summary{min-height:48px;padding:10px 4px;box-sizing:border-box;cursor:pointer;color:#f1d0a0;font:600 14px/1.4 var(--sans);align-content:center}
.help-section summary::marker{color:#bdc9ac}
.help-section summary:hover{color:#fff0ce}
.help-section summary:focus-visible,#helpDialog button:focus-visible{outline:2px solid #f7c88b;outline-offset:2px;border-radius:3px}
.help-section[open] summary{color:#f8e2bd}
.help-section-body{padding:0 4px 14px}
#helpDialog .help-section-body h3{margin-top:16px}
.help-weapons{margin:15px 0;display:grid;grid-template-columns:126px 1fr;column-gap:16px}
.help-weapons dt{font:600 14px/1.65 var(--sans);color:#f3d3a0;padding:12px 0;border-top:1px solid #354b4a}
.help-weapons dd{margin:0;padding:12px 0;border-top:1px solid #354b4a}
.help-keys{display:grid;grid-template-columns:90px 1fr;gap:8px 14px;margin:14px 0}
.help-keys dt{font:12px/1.9 var(--mono);color:#f3d3a0}.help-keys dd{margin:0}
#helpDialog .help-caution{border-left:2px solid #d1a46e;padding:8px 12px;background:#0f212559}
.help-footer{position:sticky;bottom:-22px;z-index:1;margin:12px -2px -22px;padding:10px 2px 14px;background:#19282df7;border-top:1px solid #435854}
#helpDialog #closeHelp{min-height:44px;margin:0;font-size:14px;padding:11px 16px}
@media(max-width:520px){#helpDialog,.mobile #helpDialog{padding:17px;max-height:calc(100dvh - 20px);width:calc(100vw - 20px)}#helpDialog h2{font-size:23px}.help-start{padding:13px}.help-weapons{display:block}.help-weapons dt{padding:12px 0 2px}.help-weapons dd{border-top:0;padding:0 0 12px}.help-footer{bottom:-17px;margin-bottom:-17px;padding-bottom:12px}}
