.in-battle{height:100dvh;overflow:hidden;background:#182220}
.in-battle #app{height:100%}
.in-battle .header,.in-battle .sidebar,.in-battle .mobile-nav{display:none}
.in-battle .layout{display:block;height:100%;max-width:1240px;padding:0 20px}
.in-battle .battle-main{display:flex;flex-direction:column;height:100%;max-width:none;padding:12px 0;min-height:0;position:relative}
.in-battle .battle-heading{flex:none;gap:12px;margin:0 0 10px;min-height:44px}
.in-battle .battle-heading>div{flex:1}.in-battle .battle-heading h2{font-size:18px;line-height:1.3}
.in-battle .battle-heading .eyebrow{font-size:8px;letter-spacing:1.6px;margin-bottom:3px}
.battle-settings{position:relative;z-index:30;font-size:11px}.battle-settings summary{cursor:pointer;padding:12px;list-style:none;border:1px solid #546052}
.battle-settings>div{position:absolute;right:0;top:44px;padding:10px;background:#20302b;border:1px solid #68735d;display:grid;gap:8px;min-width:140px;box-shadow:0 8px 25px #0008}
.in-battle .battle-shell{flex:1;min-height:0;border:1px solid #6e7660;overflow:hidden;background:#28352e}
.battle-workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;height:100%;min-height:0}
.map-stage{min-width:0;min-height:0;display:flex;flex-direction:column;background:#303e3a}
.in-battle .turn-bar{padding:11px 14px;font-size:10px;flex:none;align-items:center;gap:8px;background:#3a4939}
.in-battle .turn-bar>span:last-child{color:#c3ccb5;font-size:9px;letter-spacing:0}
.in-battle .battle-objective{padding:8px 12px;background:#293930;font-size:9px;flex:none;gap:8px}
.battle-objective>span:last-child{color:#aab79e;font-size:8px;text-align:right}
.map-viewport{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-width:thin;scrollbar-color:#99a48a #26372e;cursor:grab;user-select:none;background:#303e3a}
.map-viewport:active{cursor:grabbing}.map-viewport .battle-map{display:block;width:100%;max-width:none;height:auto;margin:0 auto;background:transparent}
.map-cell{transition:fill .12s}.map-cell:hover{fill:#f3d48844;filter:none}
.planned-cell{filter:drop-shadow(0 0 3px #e0c881)}
.move-route{fill:none;stroke:#fff0bc;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:5 4;filter:drop-shadow(0 1px 1px #25352d)}
.map-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:42px;padding:3px 8px;background:#293930;flex:none;border-top:1px solid #6b71544d}
.map-toolbar .map-legend{padding:0;background:none;font-size:9px;gap:10px;flex-wrap:wrap;color:#d0d3ba}
.map-zoom{display:flex;align-items:center;gap:3px}.map-zoom button{border:1px solid #64705a;min-width:38px;min-height:36px;font-size:16px;background:#3c4b3c;color:#efe1b3;padding:4px 8px}
.map-zoom button:nth-child(2){font-size:10px;min-width:48px}
.battle-guidance{padding:9px 12px;background:#202f29;color:#c9d5bd;font-size:11px;line-height:1.6;min-height:36px;flex:none;border-top:1px solid #7a826144}
.battle-guidance.confirming{background:#675f3a;color:#fff0bb}
.battle-console{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;background:#1f2d26;border-left:1px solid #66725a}
.in-battle .battle-roster{position:sticky;top:0;z-index:4;background:#2b3b2d}
.in-battle .battle-roster button{min-height:52px;padding:5px 2px;background:#2b3b2d}.in-battle .battle-roster button.active{background:#4d593b}
.in-battle .battle-roster small{margin-top:3px;color:#d0d5be}
.in-battle .command-panel{padding:12px}
.in-battle .selected-unit{margin-bottom:10px;gap:8px}.in-battle .selected-unit b{font-size:14px}.in-battle .selected-unit small{font-size:9px;margin-top:3px}.in-battle .selected-unit span{font-size:10px}
.in-battle .command-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.in-battle .command-grid button{min-height:61px;padding:9px;display:grid;grid-template-columns:1fr auto;gap:3px}
.in-battle .command-grid b{font-size:12px;letter-spacing:0}.in-battle .command-grid small{grid-column:1/3;font-size:9px;margin-top:0}.in-battle .command-grid em{grid-column:2;grid-row:1;font-size:8px;margin-top:1px}
.in-battle .attack-preview{padding:10px;margin:10px 0;min-height:48px;gap:8px}
.in-battle .attack-preview>div>b{font-size:20px;margin-top:4px}.in-battle .attack-preview p{font-size:11px}
.in-battle .attack-actions{width:100%;display:flex;gap:6px}.in-battle .attack-actions .btn{min-height:44px;flex:1;font-size:12px}
.in-battle .tactical-gauge{padding:8px 0;margin-bottom:8px;gap:10px}.in-battle .tactical-gauge b{font-size:13px}.in-battle .tactical-gauge>span:first-child{font-size:8px}
.in-battle .turn-actions{gap:8px}.in-battle .turn-actions .btn{min-height:44px;font-size:11px;flex:1;padding:9px 5px}
.move-confirm{padding:12px;background:#545638;border:1px solid #c4ad66;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0 12px}
.move-confirm>div{width:100%;font-size:14px;color:#fce8ad}.move-confirm small{display:block;color:#ded6b0;margin-top:6px;font-size:10px}
.move-confirm .btn{flex:1;min-height:44px}
.enemy-detail{background:#403c2f;font-size:10px;border-top:1px solid #90745666}
.enemy-detail>summary{cursor:pointer;display:flex;justify-content:space-between;gap:8px;padding:10px 12px;color:#f0cfac;list-style:none}
.enemy-detail summary span{font-size:9px;color:#c8b292}.enemy-detail .enemy-info{padding:10px 12px;font-size:10px}
.in-battle .battle-log{flex:none;padding:7px 10px;margin-top:7px;font-size:9px;background:#202c25}
.in-battle .battle-log summary span{display:inline;margin:0 0 0 8px;font-size:9px}
.in-battle .battle-log[open]{position:absolute;left:0;right:0;bottom:12px;max-height:45dvh;overflow:auto;z-index:20;background:#25362e;border-color:#819070;box-shadow:0 -5px 25px #0006}
.in-battle .toast{bottom:20px}
@media(max-width:800px){
 .in-battle .layout{padding:0 8px}.in-battle .battle-main{padding:7px 0;max-width:700px;margin:auto}
 .in-battle .battle-heading{gap:8px;min-height:38px;margin-bottom:7px}.in-battle .battle-heading .btn{min-height:38px;padding:8px;font-size:10px}
 .in-battle .battle-heading h2{font-size:15px}.in-battle .battle-heading .eyebrow{font-size:7px}
 .battle-settings summary{padding:10px;font-size:10px}
 .battle-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
 .map-viewport{flex:none;height:min(32dvh,calc((100vw - 18px)*.63));min-height:150px}
 .battle-console{border-left:0;border-top:1px solid #6e775e}
 .in-battle .turn-bar{padding:8px 10px;font-size:9px}.in-battle .battle-objective{padding:6px 9px;font-size:8px}
 .battle-objective>span:last-child{font-size:7px}.map-toolbar{min-height:38px;padding:2px 6px}
 .map-toolbar .map-legend{font-size:8px;gap:8px}.map-zoom button{min-height:34px;min-width:36px}
 .battle-guidance{min-height:31px;font-size:10px;padding:7px 9px}
 .in-battle .battle-roster button{min-height:45px}.in-battle .battle-roster svg{width:31px;height:31px}.in-battle .battle-roster b{font-size:10px}.in-battle .battle-roster small{font-size:8px}
 .in-battle .command-panel{padding:8px 10px}.in-battle .selected-unit{margin-bottom:7px}.in-battle .selected-unit b{font-size:12px}.in-battle .selected-unit small{font-size:8px}
 .in-battle .command-grid button{min-height:48px;padding:7px 9px;gap:1px}.in-battle .command-grid b{font-size:11px}
 .in-battle .attack-preview{margin:7px 0;min-height:38px;padding:8px}.in-battle .attack-preview p{font-size:10px}
 .in-battle .attack-preview>div>b{font-size:18px}.in-battle .tactical-gauge{padding:6px 0;margin-bottom:6px}
 .in-battle .turn-actions .btn{min-height:42px}.in-battle .battle-log{padding:6px 8px;margin-top:5px}
 .in-battle .battle-log summary span{font-size:8px}.move-confirm{margin:5px 0 8px;padding:9px}
}
@media(max-height:620px) and (max-width:800px){.map-viewport{height:29dvh;min-height:120px}.battle-objective{display:none}.battle-guidance{font-size:9px;padding:5px 8px;min-height:26px}}
/* A fixed action dock: no vertical scrolling during ordinary battle input. */
.map-zoom button:nth-child(2){font-size:16px;min-width:38px}
.map-zoom button[ data-action="map-reset"]{font-size:10px}
@media(max-width:800px){
 .in-battle .battle-main{padding:4px 0 max(4px,env(safe-area-inset-bottom))}
 .in-battle .battle-heading{min-height:34px;margin-bottom:4px}
 .in-battle .battle-heading .eyebrow{display:none}
 .battle-workspace{grid-template-rows:minmax(0,1fr) auto}
 .map-stage{overflow:hidden}
 .map-viewport{flex:1;height:auto;min-height:0}
 .in-battle .turn-bar{padding:5px 8px}
 .in-battle .battle-objective{display:flex;padding:4px 8px}
 .map-toolbar{min-height:44px;gap:2px;padding:0 3px}
 .map-toolbar .map-legend{gap:3px;font-size:8px}
 .map-toolbar .map-legend span:last-child{display:none}
 .map-zoom{gap:2px}.map-zoom button,.map-zoom button:nth-child(2){min-height:42px;min-width:40px;padding:4px}
 .battle-guidance{padding:3px 8px;min-height:22px;font-size:10px}
 .battle-console{overflow:visible;position:relative}
 .in-battle .battle-roster{position:static}
 .in-battle .battle-roster button{min-height:44px;padding:2px}
 .in-battle .battle-roster svg{height:28px;width:28px}
 .in-battle .command-panel{padding:5px 7px}
 .in-battle .selected-unit{margin:0 0 4px;height:24px;align-items:center}
 .in-battle .selected-unit>div{display:flex;gap:5px;align-items:center}
 .in-battle .selected-unit small{font-size:8px;margin:0}
 .in-battle .selected-unit>div:last-child small{display:none}
 .in-battle .command-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 .in-battle .command-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:52px;padding:3px;gap:3px;text-align:center}
 .in-battle .command-grid b{font-size:10px;letter-spacing:-.3px}
 .in-battle .command-grid small{display:none}
 .in-battle .command-grid em{font-size:8px}
 .in-battle .attack-preview{height:80px;min-height:0;margin:4px 0;padding:4px 6px;display:flex;flex-wrap:nowrap;align-items:center;gap:6px}
 .in-battle .attack-preview>div:first-child{flex:1;min-width:0}
 .in-battle .attack-preview>div>b{font-size:16px;margin-top:3px}
 .in-battle .attack-preview>div>span{font-size:9px}
 .in-battle .attack-preview .hp-after{display:block;font-size:10px}
 .in-battle .attack-preview .attack-actions{flex:0 0 110px;width:110px;flex-direction:column;gap:3px}
 .in-battle .attack-actions .btn{min-height:34px;padding:6px;font-size:11px}
 .in-battle .attack-actions .btn:only-child{min-height:44px}
 .in-battle .tactical-gauge{padding:2px 0;margin-bottom:4px;height:18px}
 .in-battle .turn-actions{gap:4px}.in-battle .turn-actions .btn{min-height:42px;font-size:10px;padding:4px}
 .enemy-detail{position:absolute;right:5px;bottom:100%;z-index:8;border:1px solid #90745666;max-width:95%;background:#403c2ff2}
 .enemy-detail>summary{padding:5px 8px;min-height:28px;align-items:center}.enemy-detail:not([open])>summary{font-size:0}.enemy-detail summary span{font-size:9px}
 .enemy-detail[open]{max-height:220px;overflow:auto}
 .in-battle .move-confirm{height:136px;margin:4px 0;padding:8px}
 .in-battle .battle-log{margin:3px 0 0;padding:3px 8px;min-height:20px}
 .in-battle .battle-log summary span{display:none}
}
@media(max-width:800px) and (max-height:620px){
 .in-battle .selected-unit{display:none}
 .battle-guidance{position:absolute;width:1px;height:1px;min-height:0;overflow:hidden;clip-path:inset(50%);padding:0}
 .in-battle .command-grid button{min-height:44px}
 .in-battle .move-confirm{height:128px}
}
.target-status{font-size:8px;font-weight:bold;stroke:#172620;stroke-width:2.5px;paint-order:stroke}.map-toolbar .map-legend .attack-legend{display:inline!important}@media(max-width:800px){.map-toolbar .map-legend{max-width:70px}.map-zoom button,.map-zoom button:nth-child(2){min-width:34px}.battle-guidance{font-size:9px}}
.initiative-bar{display:flex;align-items:center;gap:5px;overflow-x:auto;flex:none;padding:5px 8px;background:#14231d;border-bottom:1px solid #667254;min-height:45px;max-width:100%}.initiative-bar>span{font-size:10px;white-space:nowrap;color:#d1d9c0}.initiative-slot{flex:0 0 auto;display:grid;gap:2px;background:#253529;border:1px solid #657554;padding:4px 8px;min-height:35px;color:#d9e5c7}.initiative-slot.enemy{background:#422b24;border-color:#936553;color:#efc2a3}.initiative-slot.current{outline:2px solid #eed089;outline-offset:-2px}.initiative-slot b{font-size:10px}.initiative-slot small{font-size:9px}.initiative-current{display:flex;align-items:center;justify-content:center;font-size:11px;color:#d9cca1}.in-battle .battle-roster button:disabled{opacity:.45}.in-battle .initiative-bar button{cursor:pointer}
@media(max-width:800px){.initiative-bar{min-height:43px;padding:3px 6px}.initiative-slot{padding:3px 6px}.initiative-current{font-size:10px}}
.initiative-slot.next-round{opacity:.65;border-style:dashed}.stats-row{grid-template-columns:repeat(6,minmax(0,1fr))}@media(max-width:600px){.stats-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
.move-confirm{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) 44px;height:190px;gap:6px}.move-confirm>div{grid-column:1/-1}.move-confirm .move-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.move-heading small{margin:0}.move-confirm .move-outlook{overflow:auto;min-height:0;background:#18261d88;padding:4px 7px;font-size:12px;color:#e4e8d1;line-height:1.65}.move-outlook p{margin:0}.move-outlook .outlook-warning{color:#ffd2aa}.move-outlook small{font-size:10px;margin-top:3px;color:#c1c7b4}.move-outlook:focus-visible{outline:2px solid #f1d594}
@media(max-width:800px){.in-battle .move-confirm{grid-template-rows:18px minmax(0,1fr) 40px;gap:4px;height:136px}.move-confirm .btn{min-height:40px}.move-confirm .move-heading{font-size:12px}.move-confirm .move-outlook{font-size:10px;padding:3px 5px}.move-heading small{font-size:9px}}
@media(max-width:800px) and (max-height:620px){.in-battle .move-confirm{height:128px}}
.move-confirm .move-outlook{height:100%;max-height:100%;align-self:stretch}.move-confirm .btn{height:40px;min-height:40px}
.attack-preview .preview-copy{flex:1;min-width:0;overflow:auto;max-height:130px}.preview-copy>small{display:block;margin:0 0 5px;line-height:1.5}.preview-copy>div>span{display:block;font-size:11px;color:#bdc7b0}.preview-copy>div>b{display:block;font-size:20px;color:#ecc572;margin-top:4px}.preview-copy .area-targets{font-size:10px;line-height:1.5;margin-top:5px}.preview-copy:focus-visible{outline:2px solid #ecc572;outline-offset:-2px}@media(max-width:800px){.in-battle .attack-preview{height:100px;display:flex;flex-wrap:nowrap;gap:8px}.in-battle .attack-preview .preview-copy{height:100%;max-height:100%;padding:4px 2px}.in-battle .preview-copy>small{font-size:10px}.in-battle .preview-copy>div>b{font-size:16px}.in-battle .preview-copy>div>span{font-size:10px}.in-battle .attack-preview .attack-actions{flex:0 0 112px;width:112px}.in-battle .attack-actions .btn{min-height:44px;padding:5px}.in-battle .attack-preview p{font-size:11px;line-height:1.6;word-break:normal}}
.rare-recovery-marker text{fill:#ffe091;font-size:10px;font-weight:bold;stroke:#372712;stroke-width:3px;paint-order:stroke}.rare-recovery-marker path{filter:drop-shadow(0 0 5px #e8bd5e)}
