/* Dungeon HUD: the canvas is primary; Haru's controls form one compact deck. */
.game-topbar{display:contents}
body[data-scene="dungeon"] .game{display:grid;width:100%;max-width:1680px;height:100dvh;min-height:620px;grid-template-rows:72px minmax(280px,1fr) 156px;padding:0;gap:0;overflow:hidden;background:#080b0a}
body[data-scene="dungeon"] .game-topbar{display:grid;grid-template-columns:290px minmax(0,1fr) minmax(290px,360px) auto;align-items:center;gap:18px;min-height:0;padding:5px 20px;border:3px solid #9b743a;border-inline-width:1px;background:linear-gradient(#2a2723,#100f10 55%,#252018);box-shadow:inset 0 0 0 2px #d0a45755,0 3px 10px #000}
body[data-scene="dungeon"] .game-header{display:contents}
body[data-scene="dungeon"] .game-brand{grid-column:1;grid-row:1;gap:9px;padding-right:18px;border-right:1px solid #9d7c45}
body[data-scene="dungeon"] .game-brand b{color:#f0d58d;font-family:BoardLabel,sans-serif;font-size:25px;letter-spacing:.03em}
body[data-scene="dungeon"] .game-brand small,body[data-scene="dungeon"] #journalOpen,body[data-scene="dungeon"] #locationCopy{display:none}
body[data-scene="dungeon"] .scene-heading{grid-column:2 / 4;grid-row:1;display:flex;align-items:center;min-width:0;margin:0}
body[data-scene="dungeon"] .location{min-width:0;flex:1}
body[data-scene="dungeon"] .location h1{margin:0;color:#f5e7bf;font-family:BoardLabel,sans-serif;font-size:clamp(20px,2vw,29px);line-height:1.1}
body[data-scene="dungeon"] #chapterLabel{margin:0 0 3px;color:#d5aa60;font:14px/1.3 BoardLabel,sans-serif}
body[data-scene="dungeon"] .header-actions{grid-column:4;grid-row:1;gap:6px}
body[data-scene="dungeon"] .header-actions button{min-width:48px;min-height:48px;padding:5px;border-color:#a67e40;background:#1c1a18}

body[data-scene="dungeon"] .vitals{display:grid;flex:0 1 350px;width:min(350px,48%);grid-template-columns:1fr auto;gap:2px 12px;padding:0;border:0;background:none;box-shadow:none}
body[data-scene="dungeon"] .vitals::after,body[data-scene="dungeon"] .vitals>b,body[data-scene="dungeon"] :is(#characterXp,#heroTrait,#executionCounts){display:none}
body[data-scene="dungeon"] .vitals>div{grid-column:1;display:grid;grid-template-columns:22px minmax(70px,1fr) 50px;gap:6px;align-items:center;color:#f5e7bf;font-weight:700;font-variant-numeric:tabular-nums}
body[data-scene="dungeon"] .vitals meter{height:13px;border:1px solid #0a0908;box-shadow:0 0 0 1px #bb8c48}
body[data-scene="dungeon"] #turnCount{grid-column:2;grid-row:1 / span 2;display:flex;align-items:center;gap:6px;padding-left:14px;border-left:1px solid #987543;color:#f0d582;font:20px/1.3 BoardLabel,sans-serif;white-space:nowrap}
body[data-scene="dungeon"] #turnCount .ui-icon{width:25px;height:25px;color:#f1d278}
body[data-scene="dungeon"] #runProgress{grid-column:1 / -1;grid-row:auto;min-height:0}
body[data-scene="dungeon"] #runProgress:empty,body[data-scene="dungeon"] #runProgress[hidden]{display:none}
body[data-scene="dungeon"] #runProgress .status-pill{padding:1px 5px;border:0;background:transparent;color:#d5b77c;font-size:10px}

body[data-scene="dungeon"] .scene-area{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:0;margin:0;border:0;box-shadow:inset 0 0 80px #000c;background:radial-gradient(ellipse,#3a4030,#090b0a 78%)}
body[data-scene="dungeon"] .scene-area #world{position:static;flex:1;width:100%;height:0;min-height:0;aspect-ratio:auto}
body[data-scene="dungeon"] .mission-bar{position:absolute;z-index:2;top:0;left:50%;display:flex;width:max-content;max-width:calc(100% - 24px);min-height:42px;align-items:center;justify-content:center;gap:8px;padding:7px 24px;transform:translateX(-50%);border:2px solid #d29f45;border-radius:0 0 10px 10px;background:linear-gradient(#4b3216,#1d1711);box-shadow:0 3px 10px #0009,inset 0 0 0 2px #825c29;color:#f8d980;font:18px/1.3 BoardLabel,sans-serif;text-align:center;cursor:pointer}
body[data-scene="dungeon"] .mission-bar :is(#missionTitle,#missionStatus){display:none}
body[data-scene="dungeon"] .mission-bar #missionDescription{color:inherit;font:inherit}
body[data-scene="dungeon"] .mission-bar:not([data-threat="true"]){font-size:13px}
body[data-scene="dungeon"] .mission-bar:not([data-threat="true"]) #missionTitle,body[data-scene="dungeon"] .mission-bar:not([data-threat="true"]) #missionStatus{display:inline}

body[data-scene="dungeon"] .battle-dock{position:relative;display:grid;grid-template-columns:182px minmax(230px,.95fr) minmax(260px,1.15fr) minmax(220px,.8fr);align-items:center;gap:14px;min-height:0;padding:9px 20px;border:3px solid #a3783c;border-bottom-width:1px;background:linear-gradient(90deg,#382513,#1b1610 35%,#2c1c0e);box-shadow:inset 0 0 0 2px #dcaf6055,0 -6px 16px #000b}
body[data-scene="dungeon"] .battle-dock::before{content:'';position:absolute;inset:5px;border:1px solid #d7a65455;pointer-events:none}
body[data-scene="dungeon"] .battle-dock .gamer-card{display:contents}
body[data-scene="dungeon"] .battle-dock .gamer-avatar--small{grid-column:1;grid-row:1;align-self:end;z-index:1;width:210px;height:190px;margin:-53px 0 -9px -20px;background-position:bottom left}
body[data-scene="dungeon"] .battle-dock .gamer-identity{grid-column:1;grid-row:1;align-self:end;z-index:2;width:fit-content;min-width:100px;margin:0 0 -2px 1px;padding:5px 12px;border:2px solid #a4773a;border-radius:4px;background:linear-gradient(#3c2613,#140e0a);box-shadow:inset 0 0 0 1px #d5a65c66}
body[data-scene="dungeon"] .battle-dock .gamer-identity h2{margin:0;color:#ffe5a3;font:23px/1.3 BoardLabel,sans-serif}
body[data-scene="dungeon"] .battle-dock .gamer-identity>span{display:none}
body[data-scene="dungeon"] details#gamerMoment{grid-column:2;grid-row:1;position:relative;min-width:0;margin:0;padding:0;border:0;background:none;box-shadow:none}
body[data-scene="dungeon"] details#gamerMoment>summary{display:block;min-height:94px;padding:16px 18px;list-style:none;border:1px solid #b28d58;border-radius:14px 4px 14px 4px;background:url('/assets/preparation/paper-frame.png') center / 100% 100% no-repeat,#f4e4ba;box-shadow:0 4px 10px #0008;color:#4c2c18;cursor:pointer}
body[data-scene="dungeon"] details#gamerMoment>summary::-webkit-details-marker{display:none}
body[data-scene="dungeon"] #gamerMomentLabel{display:block;color:#9a7040;font:13px/1.3 BoardLabel,sans-serif}
body[data-scene="dungeon"] #gamerSpeech{display:-webkit-box;margin:5px 0 0;overflow:hidden;color:#422819;font:700 clamp(16px,1.5vw,22px)/1.35 BoardHand,sans-serif;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-break:keep-all}
body[data-scene="dungeon"] .speech-more{color:#9a7040;font:14px/1.3 BoardLabel,sans-serif}
body[data-scene="dungeon"] details#gamerMoment[open] .gamer-reason{position:absolute;z-index:6;bottom:calc(100% + 10px);left:0;width:min(540px,calc(100vw - 40px));max-height:min(46dvh,360px);overflow:auto;padding:15px;border:2px solid #b98c4c;background:#17130eed;box-shadow:0 10px 30px #000c;color:#eadcc0;overscroll-behavior:contain}
body[data-scene="dungeon"] .gamer-reason>p{margin:0 0 12px;line-height:1.6}
body[data-scene="dungeon"] .gamer-reason #battleCommand{display:grid;grid-template-columns:52px minmax(0,1fr);gap:8px;margin:0 0 12px;padding:9px;border:1px solid #7e693e;background:#252017}
body[data-scene="dungeon"] .gamer-reason .command-art{width:48px;height:48px}
body[data-scene="dungeon"] .gamer-reason .command-target,body[data-scene="dungeon"] .gamer-reason .decision-context{display:none}
body[data-scene="dungeon"] .gamer-reason #decisionHistory{display:flex;gap:6px;overflow-x:auto}
body[data-scene="dungeon"] .battle-dock .command-deck{grid-column:3;grid-row:1;min-width:0}
.battle-skills-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

body[data-scene="dungeon"] .battle-dock .skill-bar{display:flex;min-width:0;gap:9px;overflow-x:auto;padding:3px 2px 6px;scrollbar-width:thin}
body[data-scene="dungeon"] .battle-dock .skill-token{position:relative;display:flex;flex-direction:column;align-items:center;flex:0 0 90px;gap:7px;min-height:106px;padding:0;border:0;background:transparent;color:#f4dec0;box-shadow:none}
body[data-scene="dungeon"] .battle-dock .skill-token>.skill-thumb{width:78px;height:78px;border:2px solid #b4884a;border-radius:4px;background:#17130e;box-shadow:inset 0 0 0 2px #5b3c1d,0 3px 7px #0009}
body[data-scene="dungeon"] .battle-dock .skill-token .skill-thumb img{width:100%;height:100%;object-fit:cover}
body[data-scene="dungeon"] .skill-mana{position:absolute;top:-4px;right:-6px;display:flex;align-items:center;gap:1px;padding:2px 3px;border:1px solid #72b8dc;border-radius:5px;background:#12384e;color:#e1f7ff;font-size:11px}
.skill-mana .ui-icon{width:13px;height:13px}
body[data-scene="dungeon"] .battle-dock .skill-token>b{max-width:90px;overflow:hidden;color:#f6e0b8;font:16px/1.3 BoardLabel,sans-serif;text-align:center;text-overflow:ellipsis;white-space:nowrap}
body[data-scene="dungeon"] .battle-dock .skill-token>small{display:none}
body[data-scene="dungeon"] .battle-dock .skill-token[data-commanded="true"]>.skill-thumb{border-color:#fff0a3;box-shadow:0 0 10px #f3c459aa,inset 0 0 0 2px #fff4b688}
body[data-scene="dungeon"] .battle-dock .game-controls{grid-column:4;grid-row:1;min-width:0;margin:0;padding:0}
body[data-scene="dungeon"] .battle-dock .battle-controls{display:block}
body[data-scene="dungeon"] .battle-dock .playback{display:grid;grid-template-columns:minmax(100px,1.5fr) repeat(2,minmax(44px,.6fr));gap:7px;margin:0;padding:0;border:0;background:none;box-shadow:none}
body[data-scene="dungeon"] .battle-dock .playback button{display:inline-flex;min-height:44px;align-items:center;justify-content:center;gap:6px;padding:6px 8px;border-color:#b98d4d;background:linear-gradient(#382816,#17120d);color:#f4dfae;font:16px/1.3 BoardLabel,sans-serif}
body[data-scene="dungeon"] .battle-dock #pauseButton{grid-column:1;grid-row:1 / span 2;min-height:95px;color:#432710;--button-surface:url("/assets/preparation/button-primary-v3.png");font-size:25px}
body[data-scene="dungeon"] .battle-dock #pauseButton .ui-icon{width:30px;height:30px}
body[data-scene="dungeon"] .battle-dock #speedButton{grid-column:2;grid-row:1}
body[data-scene="dungeon"] .battle-dock #battleJournal{grid-column:3;grid-row:1}
body[data-scene="dungeon"] .battle-dock #battleInfoOpen{grid-column:2 / -1;grid-row:2}
body[data-scene="dungeon"] .battle-dock :is(#retryRun,#freshRun,#returnCamp){grid-column:auto;grid-row:auto}
body[data-scene="dungeon"] .battle-dock .control-hint,body[data-scene="dungeon"] .camp-footer{display:none}

.choice-stage{position:absolute;z-index:3;inset:10px max(16px,calc((100% - 1020px) / 2));overflow-y:auto;overscroll-behavior:contain}
.choice-stage .choice-panel{margin:0;padding:20px;border:1px solid #a9905d;background:#142019f5;box-shadow:0 12px 40px #000b}
.battle-outcome{position:absolute;z-index:2;top:14%;left:50%;width:min(520px,90%);padding:18px;transform:translateX(-50%);border-block:1px solid #c1a16a;background:#0c1716ed;box-shadow:0 8px 40px #000a;text-align:center}
.battle-outcome h2{margin:0;color:#ead6a7;font-size:30px}
.battle-outcome p{margin:7px 0 0;font-size:14px}
#battleInfoDialog{width:min(660px,calc(100vw - 20px))}

body[data-scene="dungeon"] .battle-dock .command-deck { width: max-content; max-width: 100%; justify-self: center; }
body[data-scene="dungeon"] .battle-dock .playback { position: static; inset: auto; width: 100%; }
body[data-scene="dungeon"] .battle-dock .playback:has(#returnCamp:not([hidden])) { grid-template-columns: repeat(2,minmax(0,1fr)); }
body[data-scene="dungeon"] .battle-dock .playback:has(#returnCamp:not([hidden])) #battleJournal { grid-column: auto; grid-row: auto; }
body[data-scene="dungeon"] :is(.playback button,#settingsOpen,#gamerReasonClose) { border: 7px solid transparent; border-image: url('/assets/preparation/button-icon-v3.png') 22% / 10px stretch; border-radius: 0; background-image: var(--button-surface,url('/assets/preparation/button-secondary-v3.png')); background-position: center; background-size: 112% 260%; background-origin: padding-box; background-clip: padding-box; box-shadow: none; }
body[data-scene="dungeon"] :is(.game-topbar,.battle-dock) { border-image: url('/assets/preparation/button-icon-v3.png') 22% / 12px stretch; background-image: linear-gradient(#1e160ddd,#1e160ddd),url('/assets/preparation/button-secondary-v3.png'); background-size: auto,112% 260%; background-position: center; }
body[data-scene="dungeon"] .playback button:hover { filter: brightness(1.14); }
body[data-scene="dungeon"] .playback button:active { transform: translateY(1px); }
body[data-scene="dungeon"] #hpMeter::-webkit-meter-optimum-value { background: linear-gradient(#ff887c,#d64c43); }
body[data-scene="dungeon"] #mpMeter::-webkit-meter-optimum-value { background: linear-gradient(#6ed3f0,#278daa); }
body[data-scene="dungeon"] #hpMeter::-moz-meter-bar { background: #de5d51; }
body[data-scene="dungeon"] #mpMeter::-moz-meter-bar { background: #46b6d8; }

@media(max-width:1000px){body[data-scene="dungeon"] .game{grid-template-rows:64px minmax(250px,1fr) 148px}
body[data-scene="dungeon"] .game-topbar{grid-template-columns:minmax(0,1fr) minmax(250px,330px) auto;gap:12px;padding-inline:12px}
body[data-scene="dungeon"] .game-brand{display:none}
body[data-scene="dungeon"] .scene-heading{grid-column:1 / 3}
body[data-scene="dungeon"] .battle-dock{grid-template-columns:120px minmax(190px,.9fr) minmax(210px,1fr) minmax(165px,.7fr);gap:9px;padding-inline:12px}
body[data-scene="dungeon"] .battle-dock .gamer-avatar--small{width:142px;height:150px;margin:-35px 0 -8px -12px}
body[data-scene="dungeon"] .battle-dock .skill-token{flex-basis:62px}
body[data-scene="dungeon"] .battle-dock .skill-token>.skill-thumb{width:56px;height:56px}
body[data-scene="dungeon"] .battle-dock .skill-token>b{font-size:13px}
}

@media(max-width:760px){body[data-scene="dungeon"] .game{min-height:680px;grid-template-rows:auto minmax(240px,1fr) auto}
body[data-scene="dungeon"] .game-topbar{grid-template-columns:minmax(0,1fr) auto;gap:7px;padding:7px 10px}
body[data-scene="dungeon"] .scene-heading{grid-column:1}
body[data-scene="dungeon"] .header-actions{grid-column:2}
body[data-scene="dungeon"] .location h1{font-size:18px}
body[data-scene="dungeon"] #chapterLabel{display:none}
body[data-scene="dungeon"] .vitals{flex-basis:148px;min-width:112px;gap:1px}
body[data-scene="dungeon"] .vitals>div{grid-template-columns:18px minmax(22px,1fr) 33px;gap:3px;font-size:11px}
body[data-scene="dungeon"] #turnCount{padding-left:7px;font-size:15px}
body[data-scene="dungeon"] #turnCount .ui-icon{width:20px}
body[data-scene="dungeon"] .mission-bar{min-height:34px;padding:5px 12px;font-size:14px}
body[data-scene="dungeon"] .battle-dock{grid-template-columns:66px minmax(0,1fr);gap:7px 10px;padding:10px max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
body[data-scene="dungeon"] .battle-dock .gamer-avatar--small{grid-column:1;grid-row:1;align-self:end;width:72px;height:92px;margin:0 0 -2px -9px}
body[data-scene="dungeon"] .battle-dock .gamer-identity{grid-column:1;grid-row:1;min-width:58px;padding:3px 6px}
body[data-scene="dungeon"] .battle-dock .gamer-identity h2{font-size:16px}
body[data-scene="dungeon"] details#gamerMoment{grid-column:2;grid-row:1}
body[data-scene="dungeon"] details#gamerMoment>summary{min-height:76px;padding:10px 11px}
body[data-scene="dungeon"] #gamerMomentLabel{font-size:11px}
body[data-scene="dungeon"] #gamerSpeech{font-size:16px;-webkit-line-clamp:2}
body[data-scene="dungeon"] details#gamerMoment[open] .gamer-reason{position:fixed;z-index:20;right:10px;bottom:10px;left:10px;width:auto;max-height:min(55dvh,410px)}
body[data-scene="dungeon"] .battle-dock .command-deck{grid-column:1 / -1;grid-row:2;width:100%}
body[data-scene="dungeon"] .battle-dock .skill-bar{gap:7px}
body[data-scene="dungeon"] .battle-dock .skill-token{flex-basis:calc((100% - 14px) / 3);min-height:66px}
body[data-scene="dungeon"] .battle-dock .skill-token>.skill-thumb{width:48px;height:48px}
body[data-scene="dungeon"] .battle-dock .skill-token>b{max-width:100%;font-size:13px}
body[data-scene="dungeon"] .battle-dock .game-controls{grid-column:1 / -1;grid-row:3}
body[data-scene="dungeon"] .battle-dock .playback{grid-template-columns:repeat(4,minmax(0,1fr))}
body[data-scene="dungeon"] .battle-dock .playback button,body[data-scene="dungeon"] .battle-dock #pauseButton{grid-column:auto;grid-row:auto;min-height:44px;padding:5px 3px;font-size:12px}
body[data-scene="dungeon"] .battle-dock #pauseButton .ui-icon{width:22px;height:22px}
body[data-scene="dungeon"] .battle-dock :is(#battleInfoOpen,#speedButton,#battleJournal){grid-column:auto;grid-row:auto}
.choice-stage .choice-panel{padding:10px}
.choice-stage .reward-option{display:grid;grid-template-columns:52px minmax(0,1fr);gap:5px 8px;padding:10px}
.choice-stage .reward-option>.skill-art{grid-column:1;grid-row:1 / span 2;width:52px;height:52px;margin:0;border:0}
.choice-stage .reward-option>.skill-art img{width:40px;height:40px}
.choice-stage .reward-option>:is(small,h4){grid-column:2;margin:0}
.choice-stage .reward-option>p{grid-column:1 / -1;margin:0;font-size:12px}
}

@media(max-width:360px) and (orientation:portrait){body[data-scene="dungeon"] .game-topbar{padding-inline:7px}
body[data-scene="dungeon"] .vitals{flex-basis:126px;min-width:100px}
body[data-scene="dungeon"] .battle-dock{grid-template-columns:60px minmax(0,1fr);padding-inline:7px}
body[data-scene="dungeon"] .battle-dock .gamer-avatar--small{width:66px;height:84px}
}
@media(max-height:500px) and (min-width:560px) and (orientation:landscape){body[data-scene="dungeon"] .game{min-height:0;grid-template-rows:48px minmax(0,1fr) 116px}
body[data-scene="dungeon"] .game-topbar{padding:3px 10px}
body[data-scene="dungeon"] .location h1{font-size:16px}
body[data-scene="dungeon"] .vitals{width:190px;min-width:150px}
body[data-scene="dungeon"] .battle-dock{grid-template-columns:58px minmax(150px,1fr) minmax(170px,1fr) 184px;gap:8px;padding:6px 10px}
body[data-scene="dungeon"] .battle-dock .gamer-avatar--small{width:62px;height:72px;margin:0 0 -2px -8px}
body[data-scene="dungeon"] .battle-dock .gamer-identity{min-width:58px;padding:2px 4px}
body[data-scene="dungeon"] details#gamerMoment>summary{min-height:74px;padding:7px 9px}
body[data-scene="dungeon"] #gamerMomentLabel{display:none}
body[data-scene="dungeon"] #gamerSpeech{font-size:14px}
body[data-scene="dungeon"] .battle-dock .skill-token{flex-basis:47px;min-height:54px}
body[data-scene="dungeon"] .battle-dock .skill-token>.skill-thumb{width:44px;height:44px}
body[data-scene="dungeon"] .battle-dock .skill-token>b{display:none}
body[data-scene="dungeon"] .battle-dock .playback{grid-template-columns:repeat(4,minmax(44px,1fr));gap:4px}
body[data-scene="dungeon"] .battle-dock .playback button,body[data-scene="dungeon"] .battle-dock #pauseButton{min-height:44px;font-size:11px}
body[data-scene="dungeon"] .battle-dock .pause-label,body[data-scene="dungeon"] .battle-dock .speed-label,body[data-scene="dungeon"] .battle-dock #battleInfoOpen>span:last-child{display:none}
}
@media(prefers-reduced-motion:reduce){.battle-dock *,.battle-dock *::before{animation:none!important}
}

body[data-scene="dungeon"] .battle-dock .game-controls { grid-row: 1; }
body[data-scene="dungeon"] details#gamerMoment::before, body[data-scene="dungeon"] details#gamerMoment > summary::before { display: none; }
body[data-scene="dungeon"] .gamer-reason .decision-context { display: flex; grid-column: 1 / -1; flex-wrap: wrap; font-size: 12px; }
body[data-scene="dungeon"] #gamerReasonClose { float: right; position: sticky; top: 0; width: 44px; height: 44px; padding: 0; margin: -5px -5px 6px 8px; font: 25px BoardLabel, sans-serif; }
@media (min-width: 761px) and (max-width: 1000px) { body[data-scene="dungeon"] .header-actions { grid-column: 3; } }
@media (max-width: 760px) { body[data-scene="dungeon"] .battle-dock .game-controls { grid-row: 3; } }
body[data-scene="dungeon"] #speedButton .ui-icon { display: none; }
body[data-scene="dungeon"] .mission-bar { pointer-events: auto; cursor: pointer; }
body[data-scene="dungeon"] .game { min-height: 0; }
body[data-scene="dungeon"] #turnText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-scene="dungeon"]:not([data-phase="combat"]) #turnCount { font-size: 14px; }
body[data-scene="dungeon"]:not([data-phase="combat"]) #turnCount .ui-icon { display: none; }
body[data-scene="dungeon"] .error-notice { position: fixed; z-index: 20; left: 12px; bottom: 12px; width: min(600px,calc(100% - 24px)); }
#battleInfoDialog { width: min(660px,calc(100vw - 20px)); }
#battleInfoDialog .decision { display: block; width: 100%; padding: 12px; margin-top: 12px; }
#battleInfoDialog .adventure-info { width: 100%; margin-top: 12px; }
#battleInfoDialog > .dialog-header { position: sticky; top: 0; z-index: 2; background: #19201d; }
#battleInfoDialog #gamerPlan { font-size: 14px; }
#battleInfoDialog #gamerRules { color: #bcc8b9; }
body[data-scene="dungeon"] #speedLabel { display: inline; white-space: nowrap; font-size: 15px; }
body[data-scene="dungeon"] #settingsOpen { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; line-height: 1; }
body[data-scene="dungeon"] #settingsOpen .ui-icon { width: 24px; height: 24px; }
body[data-scene="dungeon"] .gamer-reason > p { font-size: 14px; }
body[data-scene="dungeon"] .battle-dock .gamer-identity { max-width: 100%; }
body[data-scene="dungeon"] .battle-dock .gamer-identity h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-scene="dungeon"] .vitals > div:nth-of-type(1) { grid-row: 1; }
body[data-scene="dungeon"] .vitals > div:nth-of-type(2) { grid-row: 2; }
@media (max-width: 760px) {
  body[data-scene="dungeon"]:not([data-phase="combat"]) #turnCount { font-size: 12px; }
  body[data-scene="dungeon"] .game-topbar { grid-template-columns: minmax(0,1fr) 44px; gap: 7px; }
  body[data-scene="dungeon"] .scene-heading { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; justify-items: stretch; }
  body[data-scene="dungeon"] .location { width: 100%; }
  body[data-scene="dungeon"] .header-actions { align-self: start; }
  body[data-scene="dungeon"] .header-actions button { min-width: 44px; min-height: 44px; }
  body[data-scene="dungeon"] .vitals { flex: none; width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr) 66px; grid-template-rows: 16px 16px auto; gap: 2px 8px; }
  body[data-scene="dungeon"] .vitals > div { grid-template-columns: 20px minmax(0,1fr) 40px; gap: 4px; }
  body[data-scene="dungeon"] #runProgress { grid-row: 3; }
  body[data-scene="dungeon"] .battle-dock .playback button { white-space: nowrap; }
}
@media (max-width: 760px) and (orientation: portrait) {
  body[data-scene="dungeon"] .game { min-height: 0; grid-template-rows: auto minmax(160px,1fr) auto; }
}
@media (max-height: 500px) and (min-width: 560px) and (orientation: landscape) {
  body[data-scene="dungeon"] .game { grid-template-rows: 56px minmax(0,1fr) 116px; }
  body[data-scene="dungeon"] .game-topbar { grid-template-columns: minmax(0,1fr) 44px; gap: 8px; padding-block: 2px; }
  body[data-scene="dungeon"] .scene-heading { grid-column: 1; display: flex; flex-direction: row; align-items: center; gap: 8px; }
  body[data-scene="dungeon"] .header-actions { grid-column: 2; }
  body[data-scene="dungeon"] #chapterLabel { display: none; }
  body[data-scene="dungeon"] .vitals { flex: 0 1 270px; width: 270px; min-width: 190px; grid-template-columns: minmax(0,1fr) 64px; grid-template-rows: 14px 14px; gap: 2px 8px; }
  body[data-scene="dungeon"] .vitals > div { grid-template-columns: 20px minmax(0,1fr) 38px; font-size: 11px; }
  body[data-scene="dungeon"] #runProgress { display: none; }
  body[data-scene="dungeon"] #turnCount { font-size: 15px; padding-left: 7px; gap: 4px; }
  body[data-scene="dungeon"] #turnCount .ui-icon { width: 18px; height: 18px; }
  body[data-scene="dungeon"] .battle-dock { grid-template-rows: minmax(0,1fr); }
  body[data-scene="dungeon"] .battle-dock :is(.gamer-avatar--small,.gamer-identity) { grid-column: 1; grid-row: 1; }
  body[data-scene="dungeon"] details#gamerMoment { grid-column: 2; grid-row: 1; }
  body[data-scene="dungeon"] .battle-dock .command-deck { grid-column: 3; grid-row: 1; width: 100%; }
  body[data-scene="dungeon"] .battle-dock .game-controls { grid-column: 4; grid-row: 1; }
  body[data-scene="dungeon"] .battle-dock .playback :is(#pauseButton,#speedButton,#battleJournal,#battleInfoOpen) { grid-column: auto; grid-row: auto; min-height: 44px; padding: 3px; }
}

body[data-scene="dungeon"] #gamerSpeech { line-height:1.4;overflow-wrap:anywhere; }
body[data-scene="dungeon"] :is(.gamer-reason,.decision-context,.vitals) { font-family:var(--font-copy); }
body[data-scene="dungeon"] .battle-dock .skill-token > b { font-family:var(--font-copy);font-size:13px;line-height:1.4;overflow-wrap:anywhere; }
body[data-scene="dungeon"] .error-notice { overflow-wrap:anywhere; }
@media(min-width:961px) and (min-height:501px) {
  body[data-scene="dungeon"] .game { grid-template-rows:auto minmax(0,1fr)156px; }
  body[data-scene="dungeon"] .game-topbar { padding-block:11px; }
}
@media(max-width:560px) and (orientation:portrait) {
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock { grid-template-rows:auto 44px auto; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .gamer-avatar--small { width:56px;height:64px;margin:0; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) details#gamerMoment > summary { min-height:64px;padding:7px 10px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) details#gamerMoment:not([open]) #gamerSpeech { -webkit-line-clamp:1; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .skill-token { flex-basis:44px;min-width:44px;min-height:44px;height:44px;padding:2px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .skill-token > .skill-thumb { width:34px;height:34px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .skill-token > b { display:none; }
}
@media(max-height:500px) and (min-width:560px) and (orientation:landscape) {
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .game { grid-template-rows:56px minmax(0,1fr)64px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock { grid-template-columns:44px auto minmax(0,1fr);grid-template-rows:1fr;padding:4px 10px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) :is(details#gamerMoment,.command-deck) { display:none; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .game-controls { grid-column:3;grid-row:1; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .gamer-avatar--small { width:40px;height:44px;margin:0;align-self:center; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .gamer-identity { grid-column:2;grid-row:1;align-self:center;min-width:0;max-width:160px;margin:0;padding:4px 8px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .playback { display:flex;justify-content:flex-end;align-items:center; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .playback button { min-width:62px;font-size:14px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .playback #pauseButton { min-width:110px;font-size:16px; }
  body[data-scene="dungeon"]:is([data-phase="reward"],[data-phase="route"],[data-phase="camp"]) .battle-dock .pause-label { display:inline; }
}
