/* Previous rounds live in a read-only scroll, leaving the army command rail intact. */
.command-history-open{display:flex;align-items:center;gap:9px;flex:none;width:100%;min-height:55px;padding:9px 11px;border:1px solid #a78c56;border-radius:7px;background:linear-gradient(120deg,#eee1bd,#d6c298);box-shadow:inset 0 1px #fff2d6,0 2px 4px #6d512218;color:#355239;text-align:left;cursor:pointer}
.command-history-open>.command-icon{display:block;width:22px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.history-open-copy{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.history-open-copy>b{font-size:12px;font-weight:750;line-height:1.35}
.history-label-short{display:none}
.history-open-copy>small{font-size:10px;line-height:1.3;color:#786947}
.history-round-count{display:grid;place-items:center;flex:none;min-width:30px;height:30px;padding:4px 6px;border:1px solid #9d9669;border-radius:6px;background:#e9ddb9;color:#355239;font-size:15px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.history-round-count>small{font-size:8px;font-weight:650}
.command-history-open:hover:not(:disabled){background:linear-gradient(120deg,#f8edce,#e5d3a7);border-color:#537448}
.command-history-open:focus-visible,.history-round-tabs>button:focus-visible{outline:3px solid #466a42;outline-offset:2px}
.command-history-open:disabled{opacity:.55;cursor:default}
.modal.battle-history-modal{display:flex;flex-direction:column;gap:13px;max-width:820px;max-height:calc(100dvh - 40px);overflow:hidden;padding:25px;color:#40533b;background:linear-gradient(110deg,#f4e9cb,#e4d2a9);border:2px solid #bda063;box-shadow:inset 0 0 0 2px #fff4d16e,0 20px 70px #061a1370}
.history-modal-heading{flex:none;padding-right:35px}
.history-modal-heading h2{font-size:23px;line-height:1.25;margin:0;color:#314e34}
.history-modal-heading p{font-size:12px;line-height:1.5;margin:7px 0 5px;color:#786849}
.history-modal-heading>[data-history-clock]{display:block;color:#476b3e;font-weight:750;font-size:11px;line-height:1.4;font-variant-numeric:tabular-nums}
.history-round-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;flex:none}
.history-round-tabs>button{min-width:0;min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:6px;border:1px solid #a8915e;border-radius:6px;color:#645638;background:linear-gradient(#f4e6c4,#d8c195);cursor:pointer}
.history-round-tabs>button b{font-size:13px;line-height:1.3}.history-round-tabs>button span{font-size:10px;line-height:1.2}
.history-round-tabs>button[aria-selected="true"]{color:#fff0cf;border-color:#325436;background:linear-gradient(#567349,#314e35);box-shadow:inset 0 1px #a3b483,0 0 0 1px #d2b065}
.history-round-result{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:2px 10px 2px 0;scrollbar-color:#a99566 #e7d6b0;scrollbar-width:thin;overscroll-behavior:contain}
.history-round-result .battle-result-title{flex-wrap:wrap;gap:5px;margin-bottom:10px}.history-round-result .battle-result-title b{font-size:15px}
.history-round-result .battle-result-teams{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.history-round-result .battle-result-team{padding:11px 12px;border:1px solid #a9946b;border-left:3px solid #ad704b;border-radius:6px;background:#f7edd0}
.history-round-result .battle-result-team.player{border-left-color:#5b814b;background:#e5e9ce}
.history-round-result .battle-result-team>div{display:flex;flex-direction:row;gap:8px;align-items:baseline;flex-wrap:wrap;margin-bottom:8px}
.history-round-result .battle-result-team small{font-size:10px;letter-spacing:.3px}.history-round-result .battle-result-team>div>b{font-size:15px;overflow-wrap:anywhere}
.history-round-result .battle-result-team dl{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 12px}
.history-round-result .battle-result-team dt{font-size:10px;line-height:1.3}.history-round-result .battle-result-team dd{font-size:16px;line-height:1.3;overflow-wrap:anywhere}
.history-round-result .replay-all-abilities{font-size:12px;line-height:1.5;margin-top:12px}
.history-round-result .replay-all-abilities>summary{font-size:13px;padding:8px 0}
.history-round-result .replay-all-abilities>section{margin:8px 0 14px;padding:10px 12px;border:1px solid #b6a27d;border-radius:6px;background:#fff1d2}
.history-round-result .replay-team-heading{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline;margin-bottom:8px}
.history-round-result .replay-team-heading>small{font-size:10px;letter-spacing:.3px;color:#80704e}.history-round-result .replay-team-heading>b{font-size:15px;color:#38543a;overflow-wrap:anywhere}
.history-round-result .replay-arithmetic{font-size:12px;line-height:1.6;overflow-wrap:anywhere;margin-bottom:10px}.history-round-result .replay-arithmetic p{margin:3px 0}
.history-round-result .replay-ability-description,.history-round-result .replay-ability-impact{font-size:13px;line-height:1.4}.history-round-result .replay-ability-reason{font-size:12px;line-height:1.5}
.history-resume{flex:none;align-self:center}
@media(min-width:761px) and (max-height:790px){.command-history-open{min-height:44px;padding:6px 9px}.history-open-copy>b{font-size:11px}.history-open-copy>small{font-size:9px}}
@media(max-width:760px){
 /* Use the existing middle footer slot so the complete 250px command panel still fits. */
 .battle-board>.command-panel{position:static}
 .command-panel>.command-history-open{position:absolute;left:calc(33.333% + 5px);bottom:7px;width:calc((100% - 32px)/3);min-height:24px;height:24px;padding:2px 3px;gap:3px;border-radius:5px;background:#193525;color:#e4d0a3;z-index:7}
 .command-panel>.command-history-open>.command-icon{display:none}
 .command-panel>.command-history-open .history-open-copy>b{font-size:9px;line-height:1.2;text-align:center;white-space:nowrap}
 .command-panel>.command-history-open .history-label-full{display:none}.command-panel>.command-history-open .history-label-short{display:inline}
 .command-panel>.command-history-open .history-open-copy>small{display:none}
 .command-panel>.command-history-open .history-round-count{height:17px;min-width:15px;padding:2px;font-size:9px;color:#e4d0a3;background:#294936;border-color:#a594635c}
 .command-panel>.command-history-open .history-round-count>small{display:none}
 .battle-board:has(>.command-panel)>.battle-result-drawer{display:none}
 .battle-finished .command-history-open{min-height:35px;padding:5px 8px}.battle-finished .history-open-copy>small{display:none}.battle-finished .history-open-copy>b{font-size:11px}.battle-finished .history-round-count{height:25px;font-size:12px}
 .modal.battle-history-modal{max-height:calc(100dvh - 24px);padding:17px 12px;gap:9px}
 .history-modal-heading{padding-right:33px}.history-modal-heading h2{font-size:19px}.history-modal-heading p{font-size:11px;margin:6px 0 4px}.history-modal-heading>[data-history-clock]{font-size:10px}
 .history-round-tabs{gap:4px}.history-round-tabs>button{min-height:42px;padding:5px 2px}.history-round-tabs>button b{font-size:11px}.history-round-tabs>button span{font-size:9px}
 .history-round-result{padding-right:5px}.history-round-result .battle-result-title b{font-size:13px}.history-round-result .battle-result-title span{font-size:10px}
 .history-round-result .battle-result-team{padding:9px 8px}.history-round-result .battle-result-team>div>b{font-size:13px}.history-round-result .battle-result-team small{font-size:9px}.history-round-result .battle-result-team dl{gap:7px}.history-round-result .battle-result-team dt{font-size:9px}.history-round-result .battle-result-team dd{font-size:13px}
 .history-round-result .replay-all-abilities>section{padding:9px 8px}.history-round-result .replay-team-heading>b{font-size:13px}.history-round-result .replay-arithmetic{font-size:11px;line-height:1.6}
 .history-round-result .replay-ability-description,.history-round-result .replay-ability-impact{font-size:12px}.history-round-result .replay-ability-reason{font-size:11px}
}
