:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial,sans-serif;background:#0b1726;color:#eaf1f4;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 80% 0%,#19344b 0%,#0b1726 58%)}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:10px;padding:12px 16px;font-weight:700;transition:.15s}button:hover:not(:disabled){filter:brightness(1.13)}button:disabled{opacity:.38;cursor:not-allowed}.primary{background:#f4bd68;color:#152130;box-shadow:0 5px 24px #f4bd6822}.ghost{background:#213448;color:#d9e6ed;border:1px solid #395266}.small{padding:8px 11px;font-size:12px}.hidden{display:none!important}.masthead{height:73px;padding:12px clamp(16px,3vw,48px);border-bottom:1px solid #355064;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#0d1c2bd9}.brand{display:flex;align-items:center;gap:13px;letter-spacing:.1em}.brand strong{font-family:Georgia,serif;font-size:19px;letter-spacing:.08em}.brand small{display:block;font-size:9px;color:#96aebd;letter-spacing:.17em;margin-top:4px}.brand-icon{color:#f4bd68;font-size:35px}.header-right{display:flex;align-items:center;gap:14px}#saved{font-size:11px;color:#a5b9bf}.landing{max-width:780px;margin:60px auto 70px;text-align:center;padding:0 18px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.2em;color:#e4b778}.landing h1{font-family:Georgia,serif;font-size:clamp(35px,6vw,66px);line-height:1.1;margin:15px 0}.landing h1 em{color:#f1be72;font-weight:400}.landing>p{max-width:560px;margin:18px auto 26px;color:#aabcc9;line-height:1.7}.setup-panel{text-align:left;border:1px solid #385066;border-radius:19px;background:#152738;padding:27px;box-shadow:0 25px 60px #0003}.setup-panel h2{margin:0 0 24px;font:26px Georgia,serif}.setup-panel label{display:flex;justify-content:space-between;color:#bdd1dc;font-size:13px}.setup-panel input[type=range]{width:100%;accent-color:#e9b86c;margin:16px 0 22px}.players-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}.player-row{display:grid;grid-template-columns:18px minmax(0,1fr) 110px;align-items:center;gap:8px;border:1px solid #344e63;border-radius:11px;padding:9px;background:#192d40}.dot{width:13px;height:13px;border-radius:50%}.player-row input,.player-row select{min-width:0;width:100%;background:#0f2030;border:1px solid #35526b;color:#e5eff4;padding:10px 7px;border-radius:7px;font-size:13px}.menu-bottom{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.fine{font-size:12px!important;color:#819caa!important}.game{padding:24px clamp(12px,2.5vw,34px) 40px;max-width:1900px;margin:auto}.game-top{display:flex;justify-content:space-between;align-items:center;margin:0 0 17px;gap:14px}.game-top h2{font:31px Georgia,serif;margin:6px 0}.subtitle{font-size:12px;color:#abc1c9}.top-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:16px;align-items:start}.map-wrap{position:relative;border:1px solid #35526a;background:#143246;border-radius:16px;overflow:hidden;box-shadow:0 20px 70px #0004}#mapViewport{overflow:hidden;touch-action:pan-x pan-y}#world{width:100%;height:auto;display:block;transition:transform .2s;transform-origin:center center}.gridlines path{stroke:#376070;stroke-width:.7;fill:none;opacity:.5}.land-shape{fill:#486b66;stroke:#8ba18b;stroke-width:1.2;stroke-linejoin:round;opacity:.81}.connection{stroke:#9fc3bb;stroke-width:.95;opacity:.22;stroke-dasharray:4 4}.connection.sea{stroke:#e7c688;stroke-width:1.8;opacity:.55}.token{cursor:pointer;outline:none}.token .ring{stroke:#f4eddd;stroke-width:1.2;fill-opacity:.97}.token.selected .ring{stroke:#fff0a1;stroke-width:4;filter:drop-shadow(0 0 7px #f6ce6b)}.token.valid .ring{stroke:#fff3c5;stroke-width:3;stroke-dasharray:5 3}.token text{pointer-events:none;font-size:12px;fill:white;font-weight:850;paint-order:stroke;stroke:#122434;stroke-width:2.2;stroke-linejoin:round}.token .name{font-size:7.6px;font-weight:650;stroke-width:1.8}.token:hover .ring{stroke:#fff3bf;stroke-width:3}.map-legend{padding:10px 15px;border-top:1px solid #355368;color:#c2d6da;font-size:11px}.map-tip{background:#0a1b2dcc;border-radius:9px;position:absolute;top:12px;left:12px;font-size:11px;color:#ccdde0;padding:10px;max-width:260px;pointer-events:none}.sidebar{display:flex;flex-direction:column;gap:13px}.panel{border:1px solid #355066;background:#152738;border-radius:15px;padding:18px}.panel h3{font:24px Georgia,serif;margin:9px 0}.panel p{color:#a8c0cb;font-size:12px;line-height:1.55}.selection{margin:15px 0 12px;padding:12px;border:1px solid #36536a;border-radius:10px;font-size:12px;line-height:1.6;color:#d6e5ec;min-height:46px}.controls{display:flex;flex-direction:column;gap:8px}.controls button{width:100%;font-size:13px}.controls label{font-size:12px;color:#bfd3dc}.controls input{width:100%;accent-color:#f4bd68}.feedback{font-size:12px;line-height:1.5;color:#f2c385;margin-top:8px;min-height:15px}.score-row{display:flex;align-items:center;gap:8px;margin:12px 0;font-size:12px}.score-row .score-name{flex:1}.score-row strong{font-size:12px}.score-row.dim{opacity:.35}.history{max-height:260px;overflow-y:auto}.history #history{font-size:11px;color:#afc3d0;line-height:1.6}.history #history > .legacy-event{border-bottom:1px solid #2c455a;padding:6px 0}.overlay{position:fixed;inset:0;background:#07111ce8;display:grid;place-items:center;z-index:20;padding:15px}.overlay-card{border:1px solid #536b78;border-radius:19px;padding:35px;max-width:440px;width:100%;text-align:center;background:#182e41}.overlay-card h2{font:32px Georgia,serif}.overlay-card p{font-size:14px;color:#acbfce;margin-bottom:25px}footer{text-align:center;padding:20px 8px;color:#7792a3;font-size:10px;letter-spacing:.1em}@media(max-width:1000px){.game-layout{grid-template-columns:1fr}.sidebar{display:grid;grid-template-columns:1fr 1fr}.sidebar .history{grid-column:1/-1}}@media(max-width:620px){.masthead{padding:10px 12px}.brand strong{font-size:15px}.brand small{font-size:7px}.header-right{gap:5px}.header-right button{padding:9px}.header-right #saved{display:none}.players-form{grid-template-columns:1fr}.setup-panel{padding:17px}.landing{margin:30px auto}.game{padding:12px}.game-top h2{font-size:23px}.game-top{align-items:flex-start;flex-direction:column}.sidebar{grid-template-columns:1fr}.map-tip{top:5px;left:5px;font-size:9px;padding:6px}.map-legend{font-size:10px}.top-actions{align-self:stretch}.panel{padding:15px}}

.setup-actions{display:flex;gap:6px;flex-wrap:wrap}.setup-actions button{flex:1;min-width:46px}.setup-summary{font-size:1.1rem;font-weight:700;padding:10px 0}

/* Attack phase UX: clear source/target/available moves */
.token.valid .ring{stroke:#f4e7bb;stroke-width:3;stroke-dasharray:5 3;filter:drop-shadow(0 0 5px #f4e7bb)}
.token.attack-target .ring{stroke:#ffbd4a;stroke-width:5;stroke-dasharray:none;filter:drop-shadow(0 0 12px #ffd26d)}
.token.attack-capable:not(.selected):not(.attack-target) .ring{stroke:#b4e3fb;stroke-width:2.3}
.attack-route{stroke:#ffd16d;stroke-width:3;stroke-dasharray:8 5;fill:none;pointer-events:none;filter:drop-shadow(0 0 3px #dd9d33)}
.attack-summary{padding:11px;background:#0c2235;border:1px solid #50718a;border-radius:10px;font-weight:750;font-size:13px;line-height:1.5}
.dice-choices{display:flex;gap:7px}.dice-choices button{flex:1;padding:12px 5px}
.battle-details{padding:12px;background:#0c2335;border:1px solid #48657a;border-radius:11px;margin-top:12px;font-size:12px}
.battle-details strong{display:block;margin-bottom:11px;line-height:1.4}
.battle-dice{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.battle-dice small{display:block;margin-bottom:7px;color:#bacbd5}
.rolls{display:flex;gap:4px;flex-wrap:wrap}
.die{display:grid;place-items:center;width:31px;height:31px;border-radius:6px;background:#f2eee2;color:#142638;font-size:17px;font-weight:900;box-shadow:0 2px 0 #b8b8b2}
.turn-panel{position:sticky;top:12px;z-index:3}
@media(max-width:620px){
 body.combat-active .game{padding-bottom:55vh}
 body.combat-active .turn-panel{position:fixed;bottom:0;left:0;right:0;top:auto;z-index:12;border-radius:18px 18px 0 0;box-shadow:0 -12px 48px #02080bdc;max-height:47vh;overflow-y:auto;overscroll-behavior:contain;padding:13px 16px}
 body.combat-active .turn-panel .eyebrow{display:none}
 body.combat-active .turn-panel h3{font-size:18px;margin:2px 0 4px}
 body.combat-active .turn-panel #hint{margin:3px 0 6px}
 body.combat-active .turn-panel .selection{margin:5px 0;padding:7px;min-height:0}
 body.combat-active .turn-panel .controls{gap:6px}
 body.combat-active .turn-panel .controls button{padding:10px}
 body.combat-active .turn-panel .battle-details{margin-top:7px;padding:8px}
}

/* Alpha v4 — single-viewport game scene, contextual HUD */
body.in-game{height:100dvh;overflow:hidden}
body.in-game .masthead,body.in-game footer{display:none}
body.in-game main{height:100dvh;min-height:0}
body.in-game .game{position:fixed;inset:0;max-width:none;margin:0;padding:0;height:100dvh;overflow:hidden}
body.in-game .game-layout{display:block;position:absolute;inset:0}
body.in-game .map-wrap{position:absolute;inset:0;border:0;border-radius:0;box-shadow:none;overflow:hidden;background:#143246}
body.in-game #mapViewport{position:absolute;inset:0;display:grid;place-items:center;touch-action:pan-x pan-y}
body.in-game #world{height:100%;width:100%;object-fit:contain;min-width:0;min-height:0}
body.in-game .map-legend{display:none}
body.in-game .map-tip{top:100px;left:18px;z-index:3;max-width:200px}
body.in-game .game-top{position:absolute;z-index:5;top:0;left:0;right:0;margin:0;pointer-events:none;align-items:flex-start;padding:14px 20px 28px;background:linear-gradient(180deg,#061321eb 0%,#061321b5 60%,transparent 100%)}
body.in-game .game-top h2{font-size:clamp(19px,2.3vw,27px);margin:3px 0}
body.in-game .game-top .top-actions{pointer-events:auto}
body.in-game .game-top .subtitle{font-size:11px}
body.in-game .sidebar{display:block;position:absolute;z-index:6;left:14px;bottom:14px;width:min(350px,calc(100vw - 28px));pointer-events:none}
body.in-game .sidebar .turn-panel{pointer-events:auto;position:static;max-height:min(42vh,360px);overflow:auto;overscroll-behavior:contain;padding:13px 16px;background:#0c2130ec;box-shadow:0 8px 30px #0008}
body.in-game .turn-panel .eyebrow{font-size:9px}
body.in-game .turn-panel h3{font-size:20px;margin:5px 0}
body.in-game .turn-panel p{margin:6px 0;font-size:11px}
body.in-game .turn-panel .selection{margin:7px 0;padding:8px;min-height:0}
body.in-game .turn-panel .controls{gap:6px}
body.in-game .turn-panel .controls button{padding:10px}
body.in-game .score-panel{pointer-events:auto;position:fixed;bottom:14px;right:14px;width:240px;max-height:36vh;overflow-y:auto;background:#0c2130e8;padding:12px 14px;box-shadow:0 8px 30px #0008}
body.in-game .score-panel .score-row{margin:8px 0}
body.in-game .history{pointer-events:auto;position:fixed;right:14px;top:76px;width:min(320px,calc(100vw - 28px));max-height:min(65vh,480px);overflow:auto;background:#0c2130fa;box-shadow:0 10px 45px #000a;z-index:9}
.panel-close{float:right}
.battle-overlay{z-index:18;background:#07111ac2;backdrop-filter:blur(5px)}
.battle-modal{width:min(460px,100%);max-height:calc(100dvh - 34px);overflow-y:auto;overscroll-behavior:contain;background:#142a3b;border:1px solid #678094;box-shadow:0 24px 80px #000b;border-radius:20px;padding:22px}
.modal-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:17px}
.modal-heading h2{font:clamp(19px,3.5vw,26px) Georgia,serif;margin:7px 0 0}
.modal-combat{display:flex;flex-direction:column;gap:12px}
.modal-combat label{font-size:12px;color:#d0dbe3;font-weight:700}
.modal-combat button{width:100%}
.battle-match{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#0a2030;border:1px solid #385a71;border-radius:12px;padding:14px}
.battle-match>div{display:flex;flex-direction:column;gap:5px}
.battle-match>div:last-child{text-align:right}
.battle-match small{font-size:9px;letter-spacing:.13em;color:#acc4d1}
.battle-match strong{font-size:15px}
.battle-match>span{color:#f4bd68;font-size:21px}
.battle-modal .battle-details{margin-top:15px}
.battle-modal .feedback{margin-top:10px}
@media(max-width:700px){
 body.in-game .game-top{padding:calc(10px + env(safe-area-inset-top)) 10px 30px;gap:5px;flex-direction:row;align-items:flex-start}
 body.in-game .game-top .top-actions{align-self:auto;justify-content:flex-end;gap:3px}
 body.in-game .game-top .top-actions button{padding:7px;font-size:10px}
 body.in-game .game-top h2{font-size:18px}
 body.in-game .game-top .subtitle{display:none}
 body.in-game .game-top .eyebrow{font-size:8px}
 body.in-game .map-tip{top:90px;left:8px;max-width:150px;font-size:10px}
 body.in-game .sidebar{left:8px;bottom:calc(8px + env(safe-area-inset-bottom));width:calc(100vw - 16px)}
 body.in-game .turn-panel{max-height:31dvh!important;padding:10px 12px!important}
 body.in-game .turn-panel h3{font-size:16px}
 body.in-game .turn-panel .selection{display:none}
 body.in-game .turn-panel .eyebrow{display:none}
 body.in-game .score-panel{display:none;position:fixed;right:8px;left:auto;top:75px;bottom:auto;width:min(260px,calc(100vw - 16px));max-height:35dvh}
 body.in-game .score-panel.score-open{display:block}
 body.in-game .history{top:80px;right:8px}
 body.in-game .battle-modal{max-height:calc(100dvh - 16px);border-radius:16px;padding:16px}
}
body.in-game #mapViewport{touch-action:none;cursor:grab}
body.in-game #mapViewport.dragging{cursor:grabbing}

/* Alpha 4.2: prominent active player identity / phase and balanced combat sides */
body.in-game .game-top{padding:0 15px 0 0;min-height:76px;align-items:center;background:linear-gradient(180deg,#081724f5,#0a1b2de8 78%,#0a1b2d00);border-top:5px solid var(--active-player-color,#f4bd68);gap:8px}
body.in-game .hud-current{display:flex;align-items:center;min-width:0;gap:12px;padding:10px 15px;background:linear-gradient(90deg,color-mix(in srgb,var(--active-player-color,#e65b50) 24%,#0b1b2b),transparent);border-left:5px solid var(--active-player-color,#e65b50);border-radius:0 0 12px 0;pointer-events:none}
.hud-dot{width:15px;height:15px;border-radius:50%;flex:none;box-shadow:0 0 0 4px #ffffff18,0 0 14px var(--active-player-color,#e65b50)}
.hud-identity{min-width:0}.hud-current-label{display:block;color:#d8e6eb;font-size:9px;letter-spacing:.16em;font-weight:850}
body.in-game .game-top h2{color:#f5f7fa!important;font-family:Georgia,serif;font-size:clamp(21px,2.2vw,28px);margin:2px 0;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hud-status{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:850;letter-spacing:.08em;color:#f8c477;white-space:nowrap}
.hud-status #hudPhase{color:#e8f1f5}.hud-divider{color:#9aadb9}
body.in-game .game-top .top-actions{margin-left:auto}
.battle-match-v42{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:7px;padding:0;background:transparent;border:0;align-items:stretch}
.battle-match-v42 .battle-side{min-width:0;display:flex;flex-direction:column;text-align:left!important;gap:8px;padding:13px 11px;border:1px solid #3a5266;border-top:4px solid var(--battle-player);border-radius:10px;background:#0b2334}
.battle-match-v42 .battle-side>small{letter-spacing:.12em;color:#b2c8d3;font-size:9px}
.battle-player-name{display:flex;align-items:center;gap:7px;min-width:0}
.battle-player-name strong{font-size:13px;overflow-wrap:anywhere;color:#f6f8fa}
.battle-player-dot{width:10px;height:10px;flex:none;border-radius:50%;background:var(--battle-player)}
.battle-territory-name{font-size:11px;color:#acc2d1;overflow-wrap:anywhere}
.battle-army-count{font-size:18px;font-weight:850;color:#f7fafc}
.battle-versus{align-self:center;text-align:center;color:#f4bd68;font-size:18px}
.conquest-banner{border-left:4px solid #f4bd68;background:#0c2535;border-radius:8px;padding:12px;color:#fff;font-weight:800}
@media(max-width:700px){body.in-game .game-top{min-height:66px;padding:0 7px 10px 0;gap:3px;align-items:flex-start}body.in-game .hud-current{gap:7px;padding:8px 7px 9px;border-left-width:4px;max-width:54vw}body.in-game .hud-dot{width:10px;height:10px}body.in-game .game-top h2{font-size:16px}.hud-current-label{font-size:7px}.hud-status{font-size:9px;gap:4px}body.in-game .game-top .top-actions{gap:3px;padding-top:8px}body.in-game .game-top .top-actions button{padding:6px 7px}body.in-game .map-tip{top:102px}.battle-match-v42 .battle-side{padding:9px 7px}.battle-player-name strong{font-size:11px}.battle-army-count{font-size:15px}}

/* Alpha v4.3 — fit map below HUD and content-sized phase panel */
body.in-game{--game-hud-clearance:108px;--game-bottom-space:14px}
body.in-game #mapViewport{top:var(--game-hud-clearance);bottom:0;height:auto;min-height:0}
body.in-game .map-tip{top:calc(var(--game-hud-clearance) + 12px)}
body.in-game .sidebar{bottom:var(--game-bottom-space)}
body.in-game .sidebar .turn-panel,body.in-game .turn-panel{
  position:static; height:auto; min-height:0;
  max-height:calc(100dvh - var(--game-hud-clearance) - var(--game-bottom-space) - 14px);
  overflow-y:auto;overscroll-behavior:contain;
}
body.in-game .turn-panel .controls{min-height:0}
@media(max-width:700px){
 body.in-game{--game-hud-clearance:94px;--game-bottom-space:calc(8px + env(safe-area-inset-bottom))}
 body.in-game .turn-panel{max-height:calc(100dvh - var(--game-hud-clearance) - var(--game-bottom-space) - 12px)!important}
 body.in-game .turn-panel .selection{display:block}
 body.in-game .turn-panel .eyebrow{display:block}
 body.in-game .map-tip{top:calc(var(--game-hud-clearance) + 8px)}
}
@media(max-height:480px){
 body.in-game{--game-hud-clearance:72px}
 body.in-game .sidebar .turn-panel{max-height:calc(100dvh - var(--game-hud-clearance) - var(--game-bottom-space) - 8px)}
}

/* v4.4 — transitions and opponent turn report */
.phase-steps{display:flex;gap:4px;margin-top:7px;max-width:470px}.phase-step{border:1px solid #35566b;background:#142c3d;color:#99afbe;border-radius:6px;padding:5px 8px;font-size:10px;font-weight:750;flex:1;text-align:center;white-space:nowrap}.phase-step.active{color:#ffe1a9;border-color:#f0bb68;background:#3c392e}.phase-step.done{color:#c3d5d8;border-color:#577568}.phase-toast{position:fixed;z-index:14;top:108px;left:50%;transform:translateX(-50%);background:#102637ed;border:1px solid #e5b86c;color:#f4e2c4;border-radius:12px;padding:13px 21px;text-align:center;font-weight:750;box-shadow:0 12px 35px #0009;pointer-events:none;max-width:calc(100vw - 25px)}
.bot-overlay{z-index:25;background:#07131fdc;backdrop-filter:blur(7px)}.bot-card{background:#142b3d;border:1px solid #48667a;border-radius:18px;padding:22px;width:min(490px,100%);max-height:calc(100dvh - 32px);overflow-y:auto;box-shadow:0 25px 90px #000b}.bot-topline{font-size:10px;letter-spacing:.18em;font-weight:850;color:#f4bd68;display:flex;justify-content:space-between}.bot-identity{display:flex;align-items:center;gap:14px;padding:18px 0 15px}.bot-identity h2{margin:0 0 5px;font:26px Georgia,serif}.bot-identity small{color:#a5bac7}.bot-player-dot{width:42px;height:42px;border-radius:50%;border:3px solid #bfcad0;flex-shrink:0}.bot-track{height:5px;background:#30485c;border-radius:99px;overflow:hidden}.bot-track div{height:100%;width:0;background:#f3ba65;transition:width .28s}.bot-event-list{display:flex;flex-direction:column;gap:9px;margin:17px 0;min-height:75px;max-height:36dvh;overflow-y:auto;overscroll-behavior:contain}.bot-event{padding:10px 12px;background:#203c51;border-left:3px solid #e5b369;border-radius:8px;font-size:13px;line-height:1.5}.bot-event small{display:block;font-size:10px;letter-spacing:.1em;color:#f4be71;font-weight:800;margin-bottom:3px}.bot-summary{padding:12px;border:1px solid #4c6c80;background:#0b2133;border-radius:9px;font-weight:700;font-size:13px}.bot-actions{display:flex;gap:8px}.bot-actions button{flex:1}.bot-overlay .bot-card:focus{outline:none}
@media(max-width:700px){.phase-steps{max-width:260px}.phase-step{font-size:9px;padding:5px 3px}.phase-toast{top:100px;font-size:12px}.bot-card{padding:16px}.bot-event-list{max-height:33dvh}.bot-identity h2{font-size:22px}}
@media(prefers-reduced-motion:reduce){.bot-track div{transition:none}}


/* Alpha v4.5 — native, slim scrollbars themed for World Dominion.
   Applies only to internal scroll containers; never to the page or map. */
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list) {
  scrollbar-width: thin;
  scrollbar-color: #b99360 #132b3b;
  -webkit-overflow-scrolling: touch;
}
/* Chromium / Safari browsers using the legacy scrollbar pseudo-elements. */
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list)::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list)::-webkit-scrollbar-track {
  background: #132b3b;
  border-radius: 100px;
}
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list)::-webkit-scrollbar-thumb {
  background: #b99360;
  border-radius: 100px;
  border: 1px solid #132b3b;
}
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list)::-webkit-scrollbar-thumb:hover {
  background: #e3b96f;
}
/* Subtle bottom-edge cue when overflow exists; scroll position and touch behavior remain native. */
:where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list).has-scroll-more {
  box-shadow: inset 0 -12px 12px -14px #e3b96f, 0 8px 30px #0005;
}
@media (pointer: coarse) {
  :where(.turn-panel, .score-panel, .history, .battle-modal, .bot-card, .bot-event-list) {
    scrollbar-width: thin;
  }
}

/* Alpha v5: territory-based map. Labels use map-space coordinates, not screen px. */
#world{width:100%;height:100%;max-height:100%;object-fit:contain;user-select:none}
.territory-area{fill:#5d8790;stroke:#122d3b;stroke-width:2.2;stroke-linejoin:round;cursor:pointer;transition:fill .14s,stroke .13s,filter .13s;outline:none}
.territory-area:hover,.territory-area:focus-visible{stroke:#fff0bc;stroke-width:4;filter:brightness(1.16)}
.territory-area.selected{stroke:#ffd16a;stroke-width:6;filter:brightness(1.11)}
.territory-area.legal-target{stroke:#ffedbd;stroke-width:4;stroke-dasharray:9 5}
.territory-area.attack-target{stroke:#ffc15d;stroke-width:7;filter:brightness(1.2)}
.sea-route{fill:none;stroke:#d3c8a8;stroke-width:2.1;stroke-dasharray:6 8;opacity:.7;pointer-events:none}
.sea-route.sea-route-active{stroke:#ffdd87;stroke-width:4;opacity:1}
#tokens .army-marker{cursor:pointer;outline:none}
#tokens .marker-bg{fill:#102637;stroke:var(--marker-owner);stroke-width:3;filter:drop-shadow(0px 2px 3px #051625a8)}
#tokens .army-marker.is-selected .marker-bg{stroke:#ffd476;stroke-width:4}
#tokens .army-marker.is-target .marker-bg{stroke:#ffebaf;stroke-width:4;stroke-dasharray:5 3}
#tokens .army-value{fill:#fff;font:800 16px Inter,system-ui,sans-serif;paint-order:stroke;stroke:#0b2433;stroke-width:2.2;pointer-events:none}
#tokens .army-marker:hover .marker-bg{stroke:#fff4c9;stroke-width:4}
#tokens .attack-route{fill:none;stroke:#ffdb84;stroke-width:4;stroke-linecap:round;stroke-dasharray:9 6;pointer-events:none}
/* The map is intentionally large, and mobile pinch-to-zoom handles its small territories. */

/* v6.2: direct free-pan response while dragging; map stays independently navigable. */
body.in-game #mapViewport.dragging #world{transition:none!important}
body.in-game #mapViewport{overscroll-behavior:contain}
@media(max-width:620px){#zoomFit{padding:8px 9px;font-size:11px}}

/* Alpha v6.3 — fixed report geometry, combat participants, and conquest presets */
.bot-card{width:min(740px,calc(100vw - 24px));height:min(650px,calc(100dvh - 24px));display:flex;flex-direction:column;overflow:hidden;padding:22px;min-height:0}
.bot-identity{flex:0 0 auto;padding:14px 0 12px}.bot-track,.bot-topline{flex:0 0 auto}
.bot-event-list{flex:1 1 auto;min-height:0;max-height:none;overflow:auto;margin:12px 0;gap:11px;padding-right:8px;overscroll-behavior:contain}
.bot-event{flex:0 0 auto}.bot-footer{flex:0 0 auto;display:flex;flex-direction:column;gap:16px;border-top:1px solid #355268;padding-top:16px;min-height:70px}
.bot-summary{margin:0;padding:12px 14px;line-height:1.5}.bot-actions{flex-shrink:0;min-height:48px;align-items:stretch}.bot-actions button{min-height:46px}
.report-match{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin:7px 0 5px;color:#f0f5f9;font-weight:700;font-size:12px}
.report-side{display:inline-flex;align-items:center;gap:7px}.report-dot{width:10px;height:10px;flex-shrink:0;border-radius:50%;box-shadow:0 0 0 2px #ffffff20}.report-losses{font-size:11px;color:#ecc07d;margin-top:5px}
.conquest-presets{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.conquest-presets button{padding:10px;background:#28455b;color:#f4e1c6;border:1px solid #50718a}
@media(max-width:700px){.bot-card{width:min(100%,calc(100vw - 16px));height:min(740px,calc(100dvh - 16px));padding:15px}.bot-event-list{max-height:none}.bot-identity h2{font-size:21px}.report-match{font-size:11px}}

/* Alpha v6.4: accessible tiny targets and final-game summary */
.target-shortcuts{display:flex;flex-direction:column;gap:6px;max-height:150px;overflow-y:auto;padding:9px 0;margin:8px 0;border-top:1px solid #345468}.target-shortcut{text-align:left;min-height:38px;font-size:12px;padding:9px!important}
.victory-overlay{z-index:1200;overflow:hidden;padding:12px}.victory-card{box-sizing:border-box;width:min(730px,100%);max-height:calc(100dvh - 24px);overflow:hidden;display:flex;flex-direction:column;gap:12px;background:#112b3c;color:#ecf3f8;border:1px solid #52728a;border-radius:20px;padding:clamp(14px,2.5vw,26px);box-shadow:0 25px 90px #0009}.victory-hero{text-align:center;flex-shrink:0}.victory-hero h2{font-size:clamp(22px,3vw,32px);margin:6px 0}.victory-trophy{font-size:35px}.victory-winner{display:flex;gap:8px;justify-content:center;align-items:center}.victory-winner i{width:12px;height:12px;border-radius:50%}.victory-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.victory-stats>div{min-width:0;display:flex;flex-direction:column;align-items:center;gap:5px;background:#203d50;padding:10px 5px;border-radius:10px;text-align:center}.victory-stats b{font-size:clamp(13px,2vw,20px);overflow-wrap:anywhere}.victory-stats small{color:#a8c1d2}.victory-card h3{font-size:13px;color:#f0c078;margin:3px 0 0}.victory-rows{overflow:auto;min-height:55px;flex:1 1 auto}.victory-row{display:flex;flex-wrap:wrap;gap:4px 12px;padding:10px;border-bottom:1px solid #365164}.victory-row span{color:#c9d9e4;font-size:12px;flex:1 1 250px}.victory-row small{color:#c8b188}.victory-eliminations{max-height:83px;min-height:0;overflow:auto;flex:0 1 auto;font-size:12px;color:#b9cfdd}.victory-eliminations p{margin:3px 0}.victory-actions{display:flex;flex-wrap:wrap;gap:8px;flex-shrink:0;padding-top:12px;border-top:1px solid #355166}.victory-actions button{flex:1 1 160px;min-height:43px}.victory-reopen{position:fixed;right:16px;top:95px;z-index:990;background:#ebbc73;color:#102637;border:0;border-radius:12px;padding:12px;font-weight:bold}.victory-reopen:not(.hidden){display:block}
@media(max-height:620px){.victory-card{gap:6px}.victory-hero h2{margin:2px 0}.victory-trophy{font-size:23px}.victory-eliminations{max-height:50px}.victory-card h3{margin:0}.victory-stats>div{padding:6px 3px}}

/* World Dominion v6.5 — battle, continent and report presentation */
.bot-card{width:min(760px,calc(100vw - 24px))}
.bot-summary{padding:0;background:transparent;border:0}
.bot-balance-title{font-size:10px;font-weight:800;letter-spacing:.15em;color:#efbb71;margin-bottom:9px}
.bot-balance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.bot-balance-tile{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 5px;border-radius:11px;background:#263f51}
.bot-balance-tile strong{font-size:23px;line-height:1.2;color:#fff}.bot-balance-tile small{font-size:11px;color:#c5d4dc}
.bot-balance-tile.gain{background:#183d35}.bot-balance-tile.gain strong{color:#8fdfac}.bot-balance-tile.loss{background:#452c35}.bot-balance-tile.loss strong{color:#f0a19a}
.bot-balance-note{font-size:11px;color:#acc3d2;margin-top:10px;line-height:1.4}
.bot-footer{gap:18px}.bot-actions{padding-top:3px}
.battle-modal{width:min(620px,calc(100vw - 20px));padding:24px;scrollbar-gutter:stable}
.conquest-banner{border-left:4px solid #dfbc7b;background:#102a3b;border-radius:10px;padding:14px 15px;font-weight:750;line-height:1.5}
.conquest-description{color:#b8cbd9;font-size:13px;line-height:1.55}
.conquest-quantity{background:#182f42;padding:16px;border-radius:12px;display:flex;flex-direction:column;gap:11px}
.quantity-head,.quantity-limits{display:flex;justify-content:space-between;align-items:center;gap:9px}.quantity-head strong{font-size:13px}.quantity-head output{font-size:23px;font-weight:800;color:#f4be73}
.conquest-quantity input[type=range]{width:100%;accent-color:#f4bd68;min-height:28px;margin:0}
.quantity-limits{font-size:11px;color:#9db6c6}.conquest-forecast{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.conquest-forecast>div{background:#203b4e;border:1px solid #38566d;padding:12px 8px;border-radius:11px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:5px}
.conquest-forecast strong{font-size:25px}.conquest-forecast small{font-size:11px;color:#afc7d6}
.conquest-confirm{position:sticky;bottom:0;z-index:2;box-shadow:0 0 14px #102638;padding:14px!important}
.reinforcement-breakdown{background:#173144;border:1px solid #36566c;border-radius:10px;padding:10px 12px;color:#c4d6e2;font-size:12px}
.reinforcement-breakdown summary{cursor:pointer;color:#f2be75;font-weight:700}.reinforcement-breakdown>div{padding:7px 0;border-bottom:1px solid #355064}.reinforcement-breakdown>strong{display:block;margin-top:10px}
#regionsToggle{width:100%;margin-bottom:9px}.regions-panel{max-height:40dvh;overflow:auto;display:grid;gap:12px;margin:5px 0 8px}.region-row{display:grid;gap:5px}.region-row-top{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:11px;color:#dbe8ee}.region-row-top span:last-child{color:#a9bece}.region-track{height:5px;border-radius:20px;background:#314a5e;overflow:hidden}.region-track div{background:#d6ad70;height:100%;border-radius:20px}.region-track div.complete{background:#70bd91}
.dev-tools{position:fixed;right:10px;bottom:10px;z-index:90;background:#102638f5;border:1px solid #f3b96f;padding:8px;border-radius:12px;display:flex;gap:5px;flex-wrap:wrap;max-width:min(480px,96vw)}.dev-tools strong{font-size:10px;color:#efbc73}.dev-tools button{font-size:11px;padding:6px 9px}
@media(max-width:550px){.battle-modal{padding:15px!important}.bot-balance-tile strong{font-size:20px}.bot-balance-tile small{font-size:10px}.bot-footer{gap:10px}.conquest-forecast small{font-size:10px}}


/* Alpha v6.7 - mobile-first portrait/landscape layouts and clearer low-height modals */
:root{--mobile-panel-gap:8px;--mobile-safe-bottom:max(8px,env(safe-area-inset-bottom));}
@media (orientation: portrait) and (max-width: 820px){
  body.in-game .game-top{padding:calc(8px + env(safe-area-inset-top)) 8px 12px;min-height:58px;gap:8px;align-items:flex-start}
  body.in-game .hud-current{gap:9px;padding:9px 12px;max-width:calc(100vw - 16px)}
  body.in-game .hud-current-label{font-size:8px}
  body.in-game .hud-dot{width:12px;height:12px}
  body.in-game .game-top h2{font-size:18px;line-height:1.1}
  body.in-game .hud-status{gap:6px;flex-wrap:wrap}
  body.in-game .top-actions{gap:4px;flex-wrap:nowrap;overflow:auto;max-width:100%}
  body.in-game .top-actions button{padding:8px 9px;font-size:11px;white-space:nowrap}
  body.in-game .map-tip{top:76px;left:8px;max-width:140px;font-size:10px;padding:7px 8px}
  body.in-game .sidebar{left:0;right:0;bottom:0;width:auto;padding:0 8px calc(var(--mobile-safe-bottom));display:block}
  body.in-game .sidebar .turn-panel{border-radius:18px 18px 0 0;max-height:min(34dvh,270px);padding:12px 14px;background:#0b2130f3;backdrop-filter:blur(10px)}
  body.in-game .score-panel{display:none;position:fixed;left:8px;right:8px;bottom:calc(min(34dvh,270px) + 16px + var(--mobile-safe-bottom));top:auto;width:auto;max-height:26dvh;z-index:8}
  body.in-game .score-panel.score-open{display:block}
  body.in-game .history{right:8px;left:8px;top:auto;bottom:calc(min(34dvh,270px) + 16px + var(--mobile-safe-bottom));width:auto;max-height:30dvh}
  .battle-overlay,.bot-overlay{place-items:end center;padding:8px 8px calc(8px + var(--mobile-safe-bottom))}
  .battle-modal,.bot-card{width:min(100%,620px);max-height:min(74dvh,620px);border-radius:18px 18px 0 0}
  .victory-overlay{padding:8px}
  .victory-card{width:min(100%,680px);max-height:calc(100dvh - 16px)}
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 980px){
  body.in-game .game-top{padding:calc(6px + env(safe-area-inset-top)) 8px 6px 8px;min-height:52px;gap:6px;align-items:flex-start}
  body.in-game .hud-current{gap:8px;padding:8px 10px;max-width:calc(100vw - min(38vw,320px) - 24px)}
  body.in-game .hud-current-label{font-size:8px}
  body.in-game .hud-dot{width:11px;height:11px}
  body.in-game .game-top h2{font-size:17px;line-height:1.05;margin:0}
  body.in-game .hud-status, .phase-steps{margin-top:3px}
  body.in-game .phase-steps{gap:3px;max-width:320px}
  body.in-game .phase-step{padding:4px 6px;font-size:9px}
  body.in-game .top-actions{gap:3px;flex-wrap:nowrap;overflow:auto}
  body.in-game .top-actions button{padding:6px 8px;font-size:10px;white-space:nowrap}
  body.in-game .map-tip{display:none}
  body.in-game .sidebar{left:auto;right:8px;top:calc(58px + env(safe-area-inset-top));bottom:8px;width:min(320px,38vw);display:flex;flex-direction:column;gap:8px}
  body.in-game .sidebar .turn-panel{position:static;flex:1 1 auto;min-height:0;max-height:none;padding:10px 12px;background:#0b2130f5;backdrop-filter:blur(10px)}
  body.in-game .turn-panel h3{font-size:18px;margin:4px 0}
  body.in-game .turn-panel p{font-size:11px;margin:4px 0}
  body.in-game .turn-panel .selection{margin:6px 0;padding:7px 8px;font-size:11px}
  body.in-game .turn-panel .controls button{padding:9px 10px;font-size:12px}
  body.in-game .score-panel{display:none;position:static;width:auto;max-height:26dvh;padding:10px 12px}
  body.in-game .score-panel.score-open{display:block}
  body.in-game .history{position:fixed;right:8px;top:calc(58px + env(safe-area-inset-top));width:min(340px,40vw);max-height:calc(100dvh - 74px)}
  .battle-overlay,.bot-overlay,.victory-overlay{align-items:stretch;justify-items:end;padding:8px}
  .battle-modal,.bot-card{width:min(420px,46vw);height:calc(100dvh - 16px);max-height:none;border-radius:18px;padding:16px 18px}
  .battle-modal{scrollbar-gutter:stable}
  .battle-modal .modal-heading{margin-bottom:12px}
  .battle-modal .modal-heading h2{font-size:21px}
  .battle-modal .modal-combat{gap:10px}
  .battle-modal .battle-details{margin-top:10px}
  .battle-match{padding:10px;gap:8px}
  .battle-match small{font-size:8px}
  .battle-match strong{font-size:13px}
  .battle-match>span{font-size:18px}
  .bot-card{padding:16px 18px}
  .bot-topline{font-size:9px}
  .bot-identity{padding:10px 0 8px;gap:10px}
  .bot-identity h2{font-size:21px}
  .bot-player-dot{width:32px;height:32px}
  .bot-event-list{margin:10px 0;padding-right:5px}
  .bot-summary{margin-top:0}
  .bot-balance-grid{gap:7px}
  .bot-balance-tile{padding:8px 4px}
  .bot-balance-tile strong{font-size:18px}
  .bot-balance-tile small,.bot-balance-note,.report-losses{font-size:10px}
  .bot-actions button{min-height:42px;padding:10px}
  .victory-card{width:min(470px,50vw);height:calc(100dvh - 16px);max-height:none;gap:8px}
  .victory-hero{padding-top:2px}
  .victory-trophy{font-size:24px}
  .victory-hero h2{font-size:24px;margin:2px 0 4px}
  .victory-stats{gap:6px}
  .victory-stats>div{padding:8px 4px}
  .victory-rows{min-height:0}
  .victory-eliminations{max-height:24dvh}
  .victory-actions{gap:6px;padding-top:8px}
  .victory-actions button{min-height:40px;flex:1 1 100%}
}
@media (max-width: 700px){
  .conquest-banner{padding:12px 13px;font-size:14px}
  .conquest-description{font-size:12px;margin:0 0 2px}
  .conquest-quantity{padding:14px;gap:9px}
  .quantity-head output{font-size:20px}
  .conquest-presets{gap:7px}
  .conquest-forecast strong{font-size:22px}
}

/* v6.8 WIP — Tactical Bar + Floating HUD, single-line strategic status */
body.in-game{
  --game-hud-clearance:64px;
  --hud-ink:#eaf2f6;
}
body.in-game .game-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:14px;
  height:60px;
  min-height:0;
  padding:0 16px;
  border-top:3px solid var(--active-player-color,#e9b96a);
  border-bottom:1px solid #3c60721a;
  background:linear-gradient(180deg,#0b1c2aF7 0%,#0b2030E8 75%,#0b2030d7 100%);
  box-shadow:0 7px 24px #020e1e2b;
  z-index:11;
  pointer-events:auto;
}
body.in-game .hud-current{
  min-width:0;max-width:100%;
  display:flex;align-items:center;gap:10px;
  padding:0;background:none;border:0;border-radius:0;
  pointer-events:none;
}
body.in-game .hud-dot{
  flex:none;width:10px;height:10px;border-radius:50%;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--active-player-color,#da554a) 18%,transparent);
}
body.in-game .hud-identity{min-width:0;display:flex;flex-direction:column;gap:2px;}
body.in-game .hud-current-label{
  color:#99b4c3;font-size:8px;font-weight:800;letter-spacing:.13em;
  line-height:1.2;
}
body.in-game .game-top h2{
  font:700 clamp(16px,1.5vw,20px)/1.12 Inter,ui-sans-serif,system-ui,sans-serif!important;
  color:#f2f7f9!important;margin:0;
  max-width:clamp(132px,29vw,390px);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.in-game .hud-status{
  justify-self:center;display:flex;align-items:center;gap:10px;
  background:#182f40df;border:1px solid #365368;
  border-radius:10px;padding:9px 13px;margin:0;
  font:750 12px/1 Inter,ui-sans-serif,system-ui,sans-serif;
  letter-spacing:.01em;color:#e7edf1;white-space:nowrap;
}
body.in-game .hud-status #hudRound{color:#eabd75;font:inherit;}
body.in-game .hud-status #hudPhase{color:#f4f7f9;font:inherit;}
body.in-game .hud-status .hud-divider{
  display:block;width:1px;height:16px;border-radius:1px;background:#527083;opacity:.85;
}
body.in-game .hud-phase-detail{display:inline-flex;align-items:center;gap:7px;}
body.in-game .hud-phase-detail small{font-size:10px;font-weight:800;color:#d1aa6c;letter-spacing:.04em;}
body.in-game .top-actions{
  justify-self:end;display:flex;align-items:center;flex-wrap:nowrap;gap:7px;
  margin:0;padding:0;max-width:100%;pointer-events:auto;
}
body.in-game .top-actions button.hud-icon-button{
  min-width:36px;width:36px;height:36px;min-height:36px;
  display:grid;place-items:center;
  border:1px solid #3a5367;border-radius:10px;
  background:#20374aeb;color:#e6edf2;
  padding:7px;box-shadow:none;
}
.hud-icon-button svg,.map-tool svg{
  display:block;width:18px;height:18px;
  fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
}
.hud-icon-button svg circle{fill:currentColor;stroke:none;}
body.in-game .hud-mobile-only{display:none!important;}
.hud-menu-container{position:relative;pointer-events:auto;}
body.in-game .hud-dropdown{
  position:absolute;right:0;top:calc(100% + 10px);z-index:50;
  width:min(250px,calc(100vw - 16px));display:flex;flex-direction:column;
  padding:7px;gap:3px;border:1px solid #46667a;
  border-radius:12px;background:#112a3deF;box-shadow:0 15px 42px #000a;
  backdrop-filter:blur(12px);
}
body.in-game .hud-dropdown.hidden{display:none!important;}
body.in-game .hud-dropdown button{
  width:100%;min-height:39px;padding:9px 11px;
  background:transparent;color:#e6eff4;text-align:left;font-size:12px;font-weight:650;
  border:0;border-radius:8px;
}
body.in-game .hud-dropdown button:hover{background:#28465a;}
body.in-game .map-tools{
  position:absolute;right:14px;top:calc(var(--game-hud-clearance) + 13px);
  z-index:7;display:flex;flex-direction:column;gap:5px;
  padding:5px;border:1px solid #406175a0;border-radius:12px;
  background:#0c2332da;box-shadow:0 6px 24px #0005;
  backdrop-filter:blur(10px);pointer-events:auto;
}
body.in-game .map-tool{
  display:grid;place-items:center;width:37px;height:35px;min-height:35px;
  padding:0;border:1px solid transparent;border-radius:8px;
  background:#233d50;color:#eaf1f6;box-shadow:none;
  font-size:19px;font-weight:700;line-height:1;
}
body.in-game .map-tool-value{font-size:10px;font-weight:800;letter-spacing:-.02em;}
body.in-game .map-tool-fit svg{width:17px;height:17px;}
body.in-game .map-tip{top:calc(var(--game-hud-clearance) + 12px)}
body.in-game .history{top:calc(var(--game-hud-clearance) + 8px)}
body.in-game .phase-toast{top:calc(var(--game-hud-clearance) + 10px)}
body.in-game :is(.map-tool,.hud-icon-button,.hud-dropdown button):focus-visible{outline:2px solid #f2c27c;outline-offset:2px}
@media (orientation:portrait) and (max-width:820px){
 body.in-game{--game-hud-clearance:66px}
 body.in-game .game-top{
  height:64px;min-height:0;
  padding:0 9px;
  grid-template-columns:minmax(0,1fr) auto;
  gap:4px;
 }
 body.in-game .hud-current{gap:8px;align-self:center;align-items:flex-start;}
 body.in-game .hud-dot{width:9px;height:9px;margin-top:3px;}
 body.in-game .hud-current-label{display:none}
 body.in-game .hud-identity{gap:0;}
 body.in-game .game-top h2{font-size:16px!important;max-width:calc(100vw - 150px)}
 body.in-game .hud-status{
  position:absolute;left:26px;bottom:7px;
  border:0;background:transparent;
  padding:0;gap:6px;
  height:15px;font-size:10px;justify-self:auto;
 }
 body.in-game .hud-status .hud-divider{height:10px;}
 body.in-game .hud-phase-detail{gap:4px;}
 body.in-game .hud-phase-detail small{font-size:9px;}
 body.in-game .top-actions{justify-self:end;gap:5px;overflow:visible;}
 body.in-game .top-actions button.hud-icon-button{width:33px;min-width:33px;height:34px;min-height:34px;padding:6px;}
 body.in-game .hud-mobile-only{display:grid!important;}
 body.in-game .map-tools{right:8px;top:calc(var(--game-hud-clearance) + 9px);gap:4px;padding:4px;}
 body.in-game .map-tool{width:34px;height:33px;min-height:33px;}
 body.in-game .map-tip{top:calc(var(--game-hud-clearance) + 8px);max-width:145px;}
 body.in-game .phase-toast{top:calc(var(--game-hud-clearance) + 7px)}
}
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
 body.in-game{--game-hud-clearance:54px}
 body.in-game .game-top{
  height:50px;min-height:0;
  grid-template-columns:minmax(0,1fr) auto;gap:5px;
  padding:0 8px;
 }
 body.in-game .hud-current{gap:7px;align-items:flex-start;align-self:center;}
 body.in-game .hud-dot{width:9px;height:9px;margin-top:4px;}
 body.in-game .hud-current-label{display:none;}
 body.in-game .game-top h2{font-size:15px!important;max-width:calc(100vw - 165px)}
 body.in-game .hud-status{
  position:absolute;left:24px;bottom:5px;
  border:0;background:transparent;padding:0;gap:6px;
  font-size:10px;height:13px;
 }
 body.in-game .hud-status .hud-divider{height:10px;}
 body.in-game .hud-phase-detail small{font-size:9px;}
 body.in-game .top-actions{gap:4px;justify-self:end;}
 body.in-game .top-actions button.hud-icon-button{width:33px;min-width:33px;height:32px;min-height:32px;padding:6px;}
 body.in-game .hud-mobile-only{display:grid!important;}
 body.in-game .map-tools{
  right:calc(min(320px,38vw) + 18px);top:calc(var(--game-hud-clearance) + 10px);
  flex-direction:row;padding:4px;gap:4px;
 }
 body.in-game .map-tool{width:32px;height:31px;min-height:31px;}
 body.in-game .sidebar{top:calc(var(--game-hud-clearance) + 6px);}
 body.in-game .history{top:calc(var(--game-hud-clearance) + 6px)}
 body.in-game .phase-toast{top:calc(var(--game-hud-clearance) + 5px);font-size:11px;}
}

/* World Dominion Alpha v6.9 — contextual command deck */
body.in-game .sidebar .turn-panel{
 display:flex;flex-direction:column;min-height:0;
 height:auto;max-height:calc(100dvh - var(--game-hud-clearance) - var(--game-bottom-space) - 12px);
 overflow:hidden;overscroll-behavior:contain;
 border:1px solid #3a596d;border-radius:17px;
 padding:0;background:#102737f5;
 box-shadow:0 13px 48px #0009;
 backdrop-filter:blur(14px);
}
.command-head{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:14px 15px 12px;border-bottom:1px solid #345266;flex:none;min-width:0}
.command-head-info{min-width:0;display:flex;flex-direction:column;gap:4px}
body.in-game .turn-panel .command-head .eyebrow{display:block;margin:0;color:#efbb70;font-size:9px;letter-spacing:.14em}
body.in-game .turn-panel .command-head h3{margin:0;font:600 22px/1.14 Georgia,serif;color:#f4f7f9;overflow-wrap:anywhere}
.command-summary{font-size:12px;font-weight:650;color:#b9d0dc;min-height:15px;line-height:1.3}
.command-head-right{display:flex;gap:5px;align-items:center;flex:none}
.command-phase-icon{display:grid;place-items:center;min-width:38px;width:38px;height:38px;border-radius:12px;background:#274356;color:#edbf79;font-size:22px}
.command-toggle{display:none;min-width:42px;height:42px;padding:0;background:#28485a;color:#f2f7f9;border:1px solid #4a6577;font-size:25px;line-height:1}
.command-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden}
.command-scroll{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 15px;scrollbar-width:thin;scrollbar-color:#b99360 #142b3b}
body.in-game .turn-panel .selection{display:none}
body.in-game .turn-panel .controls{display:flex;flex-direction:column;gap:12px;min-height:0}
body.in-game .turn-panel .controls button{width:auto;font-size:12px;min-height:42px;padding:9px 11px}
.command-instruction{margin:0!important;color:#bad0dc!important;font-size:12px!important;line-height:1.55!important;background:#183447;border:1px solid #345469;border-radius:11px;padding:12px}
.command-metrics{padding:13px 14px 14px;background:#1b3547;border:1px solid #37576a;border-radius:12px;display:flex;flex-direction:column;gap:11px}
.command-metrics-top{display:flex;align-items:end;justify-content:space-between;gap:8px}
.command-metrics-copy{display:flex;flex-direction:column;gap:5px}
.command-metrics-copy small{font-size:10px;font-weight:750;letter-spacing:.1em;color:#b8ced9}
.command-metrics-value{font-size:29px;line-height:1;color:#fff;font-weight:800;font-variant-numeric:tabular-nums}
.command-metrics-total{font-size:12px;color:#e4bd79;font-weight:700;white-space:nowrap}
.command-progress{height:7px;border-radius:999px;background:#35566a;overflow:hidden}
.command-progress-fill{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#d6a45d,#f1c787);transition:width .18s}
.command-territory{border:1px solid #3b5c70;border-left:4px solid var(--territory-player,#e7bd7b);background:#1d394b;border-radius:11px;padding:11px 13px;min-width:0}
.command-territory-text{display:flex;flex-direction:column;gap:4px}
.command-territory-text small{font-weight:800;letter-spacing:.1em;color:#abc5d4;font-size:9px}
.command-territory-text strong{color:#fff;font-size:13px;overflow-wrap:anywhere}
.command-territory-text span{font-size:11px;color:#b6d0db}
.command-group{display:flex;flex-direction:column;gap:8px;min-width:0}
.command-group-title{font-size:10px;font-weight:800;letter-spacing:.11em;color:#e7bc7d}
.command-step-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
body.in-game .turn-panel .controls button.command-step-button{width:100%;min-width:0;min-height:42px;padding:8px 3px;border-radius:9px;background:#29495c;border:1px solid #4b6a7b;color:#f4f6f7;font-size:13px}
.command-range{display:flex;flex-direction:column;gap:8px;padding:12px;background:#1b3547;border:1px solid #36556a;border-radius:11px}
.command-range-label{display:flex;justify-content:space-between;align-items:center;gap:6px;color:#d3e1e8;font-size:11px;font-weight:700}
.command-range-label output{color:#efbd73;font-size:24px;font-weight:850;font-variant-numeric:tabular-nums}
.command-range input[type=range]{width:100%;margin:2px 0 5px;min-height:28px;accent-color:#f0c078}
.command-secondary-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.command-secondary-row button{background:#254154;color:#dbe9ef;border:1px solid #3b5a6d}
.command-target-list{display:flex;flex-wrap:wrap;gap:6px;max-height:160px;overflow:auto}
body.in-game .turn-panel .command-target-list button{border:1px solid #41647a;background:#213e51;border-radius:9px;font-size:11px;min-height:37px;padding:7px 10px;width:auto;text-align:left}
body.in-game .turn-panel .command-target-list button.is-active{border-color:#efbf7a;background:#473e30;color:#ffdfaa}
.command-valid{font-size:11px;color:#91d5aa;font-weight:700}
.command-actions{display:flex;flex-direction:column;gap:7px;padding:12px 15px 14px;border-top:1px solid #36546a;flex:none;background:#102838;box-shadow:0 -7px 23px #0919247a}
body.in-game .turn-panel .command-actions button{width:100%;min-height:45px;font-size:13px;padding:11px 12px}
body.in-game .turn-panel .command-actions .command-primary{background:#f1bc72;color:#162a38;border:0}
body.in-game .turn-panel .command-actions .command-secondary{background:#244257;color:#d9e6ec;border:1px solid #3c6075}
body.in-game .turn-panel .feedback{margin:0;min-height:0;font-size:11px}
body.in-game .turn-panel .feedback:empty{display:none}
body.in-game .turn-panel .battle-details{margin-top:0;padding:10px}
body.in-game .turn-panel .reinforcement-breakdown{font-size:11px;margin:0}
/* Turn handoff uses the incoming empire color, while preserving text contrast. */
.handoff-overlay{z-index:40;background:radial-gradient(ellipse at 50% 38%,color-mix(in srgb,var(--handoff-player,#e6b972) 15%,#071521) 0%,#071521f5 75%);padding:max(15px,env(safe-area-inset-top)) 15px max(15px,env(safe-area-inset-bottom))}
.handoff-card{position:relative;overflow:hidden;display:flex;flex-direction:column;align-items:center;gap:10px;width:min(480px,100%);max-height:calc(100dvh - 30px);overflow-y:auto;text-align:center;background:linear-gradient(155deg,color-mix(in srgb,var(--handoff-player,#e6b972) 20%,#152d40),#102535 62%);border:1px solid color-mix(in srgb,var(--handoff-player,#e6b972) 65%,#516879);border-radius:22px;padding:40px 27px 25px;box-shadow:0 25px 85px #000b,0 0 40px color-mix(in srgb,var(--handoff-player,#e6b972) 12%,transparent)}
.handoff-ribbon{position:absolute;top:0;left:0;right:0;height:6px;background:var(--handoff-player,#e6b972)}
.handoff-crest{display:grid;place-items:center;width:70px;height:70px;border-radius:20px;font-size:34px;color:#fff;background:color-mix(in srgb,var(--handoff-player,#e6b972) 66%,#102c3a);box-shadow:0 0 30px color-mix(in srgb,var(--handoff-player,#e6b972) 25%,transparent);margin-bottom:4px}
.handoff-card .eyebrow{color:#b4c9d7;font-size:10px}
.handoff-caption{font-size:11px;letter-spacing:.12em;color:#f2c88f;font-weight:800}
.handoff-player{display:flex;align-items:center;justify-content:center;gap:11px;max-width:100%;margin-top:0}
.handoff-card .handoff-player h2{font:600 clamp(24px,4vw,36px)/1.2 Georgia,serif;color:#fff;margin:0;overflow-wrap:anywhere}
.handoff-dot{width:14px;height:14px;flex:none;border-radius:50%;box-shadow:0 0 0 5px #ffffff20,0 0 15px var(--handoff-player,#e6b972)}
.handoff-meta{font-size:13px;font-weight:700;color:#d0e1e9;background:#203d51;border:1px solid #446275;padding:9px 16px;border-radius:10px}
.handoff-card p{font-size:13px;line-height:1.6;color:#b8cdda;margin:3px 0 9px;max-width:360px}
.handoff-button{background:#f1c17d;color:#152a37;width:100%;min-height:49px;flex:none}
@media (orientation:portrait) and (max-width:820px){
 body.in-game .sidebar .turn-panel{max-height:min(65dvh,570px)!important;border-radius:18px 18px 0 0;}
 body.in-game .turn-panel .command-head{padding:10px 12px;}
 body.in-game .turn-panel .command-head h3{font-size:18px}
 body.in-game .turn-panel .command-head .eyebrow{display:block;font-size:8px}
 body.in-game .turn-panel .command-summary{font-size:11px}
 body.in-game .turn-panel .command-phase-icon{width:32px;min-width:32px;height:32px;font-size:18px}
 body.in-game .turn-panel .command-toggle{display:block;width:42px;min-width:42px;height:42px}
 body.in-game .turn-panel .command-scroll{padding:12px}
 body.in-game .turn-panel .command-actions{padding:10px 12px calc(10px + env(safe-area-inset-bottom));}
 body.in-game .turn-panel.is-collapsed{max-height:96px!important;min-height:0}
 body.in-game .turn-panel.is-collapsed .command-head{border:0}
 body.in-game .turn-panel.is-collapsed .command-content{display:none}
 body.in-game .turn-panel .command-head-right{gap:3px}
}
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
 body.in-game .sidebar{min-height:0}
 body.in-game .sidebar .turn-panel{height:100%;max-height:none!important;flex:1 1 auto;min-height:0;padding:0!important;}
 body.in-game .turn-panel .command-head{padding:9px 11px}
 body.in-game .turn-panel .command-head h3{font-size:17px}
 body.in-game .turn-panel .command-head .eyebrow{font-size:8px}
 body.in-game .turn-panel .command-summary{font-size:10px}
 body.in-game .turn-panel .command-phase-icon{width:29px;min-width:29px;height:29px;font-size:17px}
 body.in-game .turn-panel .command-scroll{padding:10px 11px}
 body.in-game .turn-panel .command-actions{padding:8px 11px 9px}
 body.in-game .turn-panel .command-actions button{min-height:41px;padding:8px 10px}
 body.in-game .turn-panel .command-metrics{padding:10px}
 body.in-game .turn-panel .command-metrics-value{font-size:24px}
 body.in-game .turn-panel .command-territory{padding:8px 10px}
 body.in-game .turn-panel .command-metrics-copy small{font-size:9px}
 .handoff-card{padding:24px 22px 17px;gap:7px;width:min(500px,75vw)}
 .handoff-crest{width:45px;height:45px;font-size:24px;border-radius:12px;margin-bottom:0}
 .handoff-card .handoff-player h2{font-size:24px}
 .handoff-card p{margin:1px 0;font-size:11px;line-height:1.45}
 .handoff-button{min-height:42px}
}
@media (prefers-reduced-motion:reduce){.command-progress-fill{transition:none}}

/* Alpha v6.9.1: contextual instruction replaces legacy #hint; summary only for collapsed portrait sheet. */
body.in-game .turn-panel .command-summary{display:none}
@media (orientation:portrait) and (max-width:820px){
 body.in-game .turn-panel.is-collapsed .command-summary:not(:empty){display:block;min-height:0}
}

/* Alpha v6.9.2 — strategic-event cards in opponent turn report.
 * The report header and footer remain fixed; cards alone scroll inside .bot-event-list.
 */
.bot-event-list .report-card{
  position:relative;display:block;min-width:0;flex:0 0 auto;
  padding:14px 15px;background:#1b374a;border:1px solid #39596d;
  border-left:3px solid #789ab0;border-radius:12px;
  color:#eff5f8;line-height:1.4;box-shadow:0 5px 14px #07142124;
}
.bot-event-list .report-card--conquest{
  border-color:#477763;border-left:3px solid #83cc9c;
  background:linear-gradient(125deg,#1a3d3c 0%,#193549 61%,#19364a 100%);
  box-shadow:inset 0 1px 0 #9de0b815,0 8px 22px #07142135;
}
.bot-event-list .report-card--battle{border-left-color:#c69c77}
.bot-event-list .report-card-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 11px}
.bot-event-list .report-type{font-size:10px;font-weight:850;letter-spacing:.15em;color:#f0bd77;line-height:1.2}
.bot-event-list .report-card--conquest .report-type{color:#acdabb}
.bot-event-list .report-card-outcome{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:4px 9px;border-radius:50px;background:#423639;color:#edc7bb;font-size:11px;font-weight:750;letter-spacing:0;line-height:1.2}
.bot-event-list .report-card--conquest .report-card-outcome{background:#265345;color:#b8ecc8}
.bot-event-list .report-card-outcome::before{content:'●';font-size:8px}
.bot-event-list .report-participants{display:grid;grid-template-columns:minmax(0,1fr) 26px minmax(0,1fr);align-items:center;gap:9px;margin-bottom:10px}
.bot-event-list .report-participant{display:flex;flex-direction:column;gap:5px;min-width:0}
.bot-event-list .report-participant:last-child{text-align:right;align-items:flex-end}
.bot-event-list .report-participant-role{font-size:9px;font-weight:750;letter-spacing:.10em;color:#a8c1cf;line-height:1.2}
.bot-event-list .report-participant-name{display:flex;gap:7px;align-items:center;min-width:0;max-width:100%}
.bot-event-list .report-participant-name strong{font-size:12px;font-weight:800;color:#f3f6f9;line-height:1.25;overflow-wrap:anywhere}
.bot-event-list .report-participant-dot{display:inline-block;flex:0 0 10px;width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 2px #e3f3fb19}
.bot-event-list .report-versus{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#112b3c;color:#f0bc75;font-size:14px}
.bot-event-list .report-route{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:8px;row-gap:3px;padding:10px 11px;margin:0 0 10px;border:1px solid #3c5c70;border-radius:9px;background:#0d293b;font-size:13px;text-align:center;line-height:1.35}
.bot-event-list .report-route-source{color:#d7e4eb;overflow-wrap:anywhere}
.bot-event-list .report-route-arrow{color:#f2bd74;font-size:16px;line-height:1}
.bot-event-list .report-route-target{color:#fff;font-weight:850;overflow-wrap:anywhere}
.bot-event-list .report-conquest-title{font-family:inherit;margin:0 0 12px;font-size:clamp(14px,1.9vw,18px);font-weight:850;line-height:1.3;color:#d9f7e4;overflow-wrap:anywhere}
.bot-event-list .report-card-explanation{margin:0 0 10px;color:#afc5d3;font-size:11px;line-height:1.4}
.bot-event-list .report-casualties{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.bot-event-list .report-casualty{min-width:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px;padding:10px 12px;background:#142c3d;border:1px solid #365568;border-left:3px solid var(--report-owner,#7796a6);border-radius:9px}
.bot-event-list .report-casualty-role{font-size:10px;font-weight:650;color:#b8cdd7;line-height:1.25;overflow-wrap:anywhere}
.bot-event-list .report-casualty-value{font-size:21px;line-height:1.05;font-weight:850;color:#fff;font-variant-numeric:tabular-nums;white-space:nowrap}
.bot-event-list .report-roll-count{display:block;margin:8px 1px 0;text-align:right;font-size:10px;color:#8ea8b9;letter-spacing:0;font-weight:500}
.bot-event-list .report-card--info{display:flex;align-items:center;gap:12px;min-height:63px;padding:12px 14px;background:#173248;border-left-color:#6c90a8;box-shadow:none}
.bot-event-list .report-info-icon{display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:10px;background:#2a485a;color:#f2c37e;font-size:19px;font-weight:700}
.bot-event-list .report-info-content{min-width:0}
.bot-event-list .report-info-text{margin:5px 0 0;font-size:12px;color:#dbe7ee;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:700px){
 .bot-event-list .report-card{padding:12px;border-radius:10px}
 .bot-event-list .report-card-heading{margin-bottom:9px}
 .bot-event-list .report-participants{gap:6px}
 .bot-event-list .report-participant-name strong{font-size:11px}
 .bot-event-list .report-route{padding:9px;font-size:12px}
 .bot-event-list .report-casualty{padding:9px;gap:4px}
 .bot-event-list .report-casualty-value{font-size:19px}
}
@media(max-width:380px){
 .bot-event-list .report-participants{grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr)}
 .bot-event-list .report-versus{width:20px;height:20px;font-size:12px}
 .bot-event-list .report-casualty{flex-direction:column;align-items:flex-start}
}
@media(orientation:landscape) and (max-height:560px) and (max-width:980px){
 .bot-event-list .report-card{padding:10px 11px}
 .bot-event-list .report-card-heading{margin-bottom:7px}
 .bot-event-list .report-participants{margin-bottom:7px}
 .bot-event-list .report-route{margin-bottom:7px;padding:7px 8px}
 .bot-event-list .report-casualties{gap:6px}
 .bot-event-list .report-casualty{padding:7px 8px}
 .bot-event-list .report-casualty-value{font-size:17px}
 .bot-event-list .report-card--info{min-height:54px}
}
/* In landscape, reserve more of the compact report for the actual battle cards. */
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
 .bot-card{padding:10px 14px}
 .bot-topline{line-height:1.2}
 .bot-identity{padding:6px 0 5px;gap:8px}
 .bot-identity h2{font-size:17px;line-height:1.15;margin:0}
 .bot-identity small{font-size:9px}
 .bot-player-dot{width:26px;height:26px;border-width:2px}
 .bot-event-list{margin:6px 0;gap:6px}
 .bot-footer{gap:6px;padding-top:6px;min-height:0}
 .bot-balance-title{font-size:8px;margin-bottom:4px}
 .bot-balance-tile{padding:5px 3px;gap:1px;border-radius:7px}
 .bot-balance-tile strong{font-size:16px}
 .bot-balance-tile small{font-size:9px}
 .bot-balance-note{font-size:9px;line-height:1.25;margin-top:5px}
 .bot-actions{min-height:36px;padding:0}
 .bot-actions button{min-height:36px;padding:7px}
}

/* Alpha v6.9.3 — Journal and genuinely split landscape gaming canvas. */
body.in-game .journal-heading{display:flex;flex-direction:column;gap:8px;flex:0 0 auto}
body.in-game .journal-heading h3{font:600 20px/1.2 Georgia,serif;margin:0;color:#f5f8fa}
body.in-game .journal-heading .eyebrow{font-size:9px}
body.in-game .side-back{display:none;align-self:flex-start;min-height:35px;padding:7px 11px;font-size:12px}
body.in-game .journal-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;min-height:35px}
body.in-game .journal-tabs button{color:#c4d8e3;background:#203d50;border:1px solid #416076;padding:8px;border-radius:8px;font-size:12px}
body.in-game .journal-tabs button.is-selected{color:#182a38;background:#f0bd73;border-color:#f0bd73}
body.in-game .journal-events{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#b99360 #18364b;gap:10px;margin:0;padding:3px 4px 10px 0}
body.in-game .journal-round{position:sticky;top:0;background:#102737;z-index:2;display:flex;align-items:center;justify-content:center;min-height:28px;color:#f0c27f;font-size:10px;font-weight:850;letter-spacing:.13em;border-bottom:1px solid #365267}
body.in-game .journal-empty{color:#b4c9d5;font-size:12px;line-height:1.6;padding:15px 4px}
body.in-game #historyPanel{gap:11px;min-height:0}
body.in-game #historyPanel .report-card{max-width:100%;width:100%}
body.in-game #scorePanel .side-back{margin-bottom:10px}
@media (orientation:portrait) and (max-width:820px){
 body.in-game .sidebar.is-journal-open .turn-panel,
 body.in-game .sidebar.is-players-open .turn-panel{display:none}
 body.in-game .sidebar.is-journal-open #historyPanel,
 body.in-game .sidebar.is-players-open #scorePanel{
  display:flex!important;position:static;inset:auto;width:100%;max-height:min(69dvh,620px);
  padding:14px;overflow:hidden;flex-direction:column;background:#102737f7;
  border-radius:18px 18px 0 0;box-shadow:0 -8px 30px #0009;
 }
 body.in-game .sidebar.is-players-open #scorePanel{overflow:auto}
 body.in-game .side-back{display:inline-flex;align-items:center}
}
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
 body.in-game{--wd-side-width:min(340px,39vw);--game-hud-clearance:46px}
 body.in-game .map-wrap{right:calc(var(--wd-side-width) + 6px);}
 body.in-game .game-top{
  inset:0 auto auto 0;width:calc(100vw - var(--wd-side-width) - 6px);
  height:44px;min-height:44px;padding:0 8px;display:grid;
  grid-template-columns:minmax(0,1fr) auto;background:#081e2df0;
  border-bottom:1px solid #38566a;border-top-width:3px;box-shadow:0 8px 16px #0003;
 }
 body.in-game .game-top h2{font-size:14px!important;max-width:calc(100vw - var(--wd-side-width) - 116px)}
 body.in-game .hud-status{position:static;justify-self:end;margin:0;background:transparent;border:0;padding:0;font-size:10px;gap:5px;line-height:1.2}
 body.in-game .hud-status .hud-divider{height:12px}
 body.in-game .top-actions{display:none!important}
 body.in-game .map-tip{display:none}
 body.in-game .map-tools{top:54px;right:8px;flex-direction:row;padding:3px;gap:3px}
 body.in-game .map-tool{height:30px;min-height:30px;width:30px}
 body.in-game .sidebar{
   position:absolute;top:0;right:0;left:auto;bottom:0;width:var(--wd-side-width);
   display:flex;flex-direction:column;gap:0;padding:0;
   border-left:1px solid #486479;background:#0b2030;z-index:13;pointer-events:auto;
 }
 body.in-game .sidebar .turn-panel{
   height:100%;flex:1 1 auto;min-height:0;max-height:none!important;
   border-radius:0;border:0;padding:0!important;background:#102737;
 }
 body.in-game .turn-panel .command-head{min-height:58px;padding:7px 8px 6px 11px;gap:8px}
 body.in-game .turn-panel .command-head h3{font-size:16px;margin:2px 0}
 body.in-game .turn-panel .command-head-right{gap:5px}
 body.in-game .turn-panel .command-phase-icon{width:27px;min-width:27px;height:27px}
 body.in-game .hud-menu-container{display:block;z-index:30;min-width:34px}
 body.in-game .hud-menu-container .hud-icon-button{
   display:grid;place-items:center;width:36px;height:35px;min-width:36px;min-height:35px;
   background:#213d50;color:#fff;border:1px solid #47657a;border-radius:10px;padding:8px;
 }
 body.in-game .hud-menu-container .hud-icon-button svg{width:18px;height:18px}
 body.in-game .hud-dropdown{position:absolute;top:calc(100% + 6px);right:0;width:min(270px,calc(100vw - 20px));max-height:calc(100dvh - 55px);overflow:auto;gap:3px}
 body.in-game .command-scroll{padding:9px 11px}
 body.in-game .command-actions{padding:8px 11px max(8px,env(safe-area-inset-bottom))}
 body.in-game .sidebar .score-panel,
 body.in-game .sidebar #historyPanel{display:none;position:static;inset:auto;width:100%;height:100%;min-height:0;max-height:none;border:0;border-radius:0;background:#102737;box-shadow:none;padding:12px 11px}
 body.in-game .sidebar.is-journal-open .turn-panel,
 body.in-game .sidebar.is-players-open .turn-panel{display:none!important}
 body.in-game .sidebar.is-journal-open #historyPanel{display:flex!important;flex-direction:column;overflow:hidden;}
 body.in-game .sidebar.is-players-open #scorePanel{display:block!important;overflow-y:auto}
 body.in-game .side-back{display:inline-flex;align-items:center;gap:5px}
 body.in-game #historyPanel .journal-heading{gap:6px}
 body.in-game .journal-heading h3{font-size:17px}
 body.in-game .journal-tabs{min-height:31px}
 body.in-game .journal-tabs button{padding:6px}
 body.in-game .journal-events{padding-right:3px;gap:7px}
 body.in-game .journal-events .report-card{padding:9px 8px}
 body.in-game .journal-events .report-casualty{padding:6px}
 body.in-game .journal-events .report-route{font-size:11px}
 body.in-game .phase-toast{top:53px;left:calc((100vw - var(--wd-side-width))/2);max-width:calc(100vw - var(--wd-side-width) - 15px)}
}
@media (prefers-reduced-motion:reduce){body.in-game .journal-tabs button{transition:none}}


/* Alpha v6.9.3.1 — journal scroll is exclusive to the event list, at every breakpoint.
   Header, filter controls and return button never move when browsing long history. */
body.in-game .sidebar #historyPanel:not(.hidden){
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  overscroll-behavior:contain;
}
body.in-game #historyPanel .journal-heading{
  flex:0 0 auto;
}
body.in-game #historyPanel .journal-events{
  display:flex;
  flex-direction:column;
  flex:1 1 0;
  min-height:0;
  height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
  scrollbar-width:thin;
  scrollbar-color:#bd995f #1b3447;
}
body.in-game #historyPanel .journal-events::-webkit-scrollbar{width:5px}
body.in-game #historyPanel .journal-events::-webkit-scrollbar-track{background:#1b3447;border-radius:8px}
body.in-game #historyPanel .journal-events::-webkit-scrollbar-thumb{background:#bd995f;border-radius:8px}
/* Explicit panel heights prevent the journal from stretching past its visible area. */
@media (orientation:portrait) and (max-width:820px){
 body.in-game .sidebar.is-journal-open #historyPanel{height:min(69dvh,620px);max-height:min(69dvh,620px)}
}
@media (orientation:landscape) and (max-height:560px) and (max-width:980px){
 body.in-game .sidebar.is-journal-open #historyPanel{height:100%;max-height:100dvh}
}
@media (min-width:981px), (orientation:landscape) and (min-height:561px){
 body.in-game .sidebar.is-journal-open #historyPanel{
  height:min(65dvh,480px);
  max-height:min(65dvh,480px);
 }
}

/* v6.9.3.1: desktop journal scrollbar on the inner/left edge, away from map tools. */
@media (min-width:981px){
  body.in-game .sidebar #historyPanel:not(.hidden){
    right:78px;
    width:min(340px,calc(100vw - 96px));
  }
  body.in-game #historyPanel .journal-events{
    direction:rtl; /* Browser renders vertical scrollbar on the left. */
    scrollbar-gutter:stable;
    padding:3px 2px 10px 8px;
  }
  body.in-game #historyPanel .journal-events > *{
    direction:ltr; /* Card copy and numbers stay in normal reading order. */
    text-align:left;
  }
}


/* World Dominion v6.9.3.1 — portrait gaming UI.
   Desktop and split-screen landscape keep their existing layouts. */
body.in-game .portrait-view-switch{display:none}
@media (orientation:portrait) and (max-width:820px){
 body.in-game{--game-hud-clearance:57px;--game-bottom-space:0px}
 body.in-game .game-top{
  height:55px;min-height:55px;padding:0 10px;gap:6px;
  grid-template-columns:minmax(0,1fr) auto;
  background:#0a1f30f5;border-bottom:1px solid #345163;
 }
 body.in-game .hud-current{gap:8px;padding:0;max-width:min(50vw,210px)}
 body.in-game .game-top h2{font-size:15px!important;max-width:45vw}
 body.in-game .hud-status{position:static;justify-self:start;align-self:center;grid-column:1/2;grid-row:2;
  display:none} /* phase is always visible in the command sheet */
 body.in-game .top-actions{grid-column:2;grid-row:1;align-self:center;justify-self:end;padding:0}
 body.in-game .top-actions #toggleScore,body.in-game .top-actions #toggleLog{display:none!important}
 body.in-game .top-actions .hud-icon-button{width:40px;min-width:40px;height:40px;min-height:40px}
 body.in-game .hud-dropdown{width:min(280px,calc(100vw - 20px));max-height:calc(100dvh - 68px);overflow:auto}
 body.in-game #mapViewport{top:var(--game-hud-clearance);bottom:0}
 body.in-game .map-tip{display:none}
 body.in-game .map-tools{top:calc(var(--game-hud-clearance) + 8px);right:9px;left:auto;
  flex-direction:row;align-items:center;gap:4px;padding:4px;background:#0b2535ea}
 body.in-game .map-tools #zoomReset,body.in-game .map-tools #zoomFit{display:none}
 body.in-game .portrait-view-switch{display:grid;place-items:center;min-width:79px;width:auto;
  padding:0 8px;font-size:11px;white-space:nowrap;font-weight:750}
 body.in-game .map-tool{width:38px;min-width:38px;height:39px;min-height:39px}
 body.in-game .sidebar{position:absolute;top:auto;left:0;right:0;bottom:0;width:100%;
   padding:0;pointer-events:none;display:block;z-index:12}
 body.in-game .sidebar .turn-panel{pointer-events:auto;width:100%;margin:0;
  max-height:min(60dvh,540px)!important;min-height:0;border:1px solid #496277;
  border-radius:18px 18px 0 0;background:#102737f8;overflow:hidden;
  box-shadow:0 -10px 32px #0009}
 body.in-game .turn-panel .command-head{position:relative;cursor:pointer;touch-action:pan-y;
  padding:17px 14px 9px;border-bottom:1px solid #344f62;min-height:69px}
 body.in-game .turn-panel .command-head:before{content:'';position:absolute;top:7px;left:50%;
  transform:translateX(-50%);width:35px;height:4px;background:#7695a5;border-radius:10px}
 body.in-game .turn-panel .command-head h3{font-size:18px;line-height:1.15}
 body.in-game .turn-panel .command-head .eyebrow{font-size:9px}
 body.in-game .turn-panel .command-summary{font-size:11px}
 body.in-game .turn-panel .command-phase-icon{width:32px;min-width:32px;height:32px}
 body.in-game .turn-panel .command-toggle{display:grid;place-items:center;width:42px;min-width:42px;
  height:42px;min-height:42px;font-size:24px;padding:0}
 body.in-game .turn-panel .command-scroll{padding:12px 14px;overscroll-behavior:contain}
 body.in-game .turn-panel .command-actions{padding:9px 14px max(11px,env(safe-area-inset-bottom))}
 body.in-game .turn-panel.is-collapsed{max-height:91px!important}
 body.in-game .turn-panel.is-collapsed .command-head{border-bottom:0;min-height:85px}
 body.in-game .turn-panel.is-collapsed .command-content{display:none}
 body.in-game .sidebar.is-journal-open .turn-panel,body.in-game .sidebar.is-players-open .turn-panel{display:none!important}
 body.in-game .sidebar.is-journal-open #historyPanel{
  display:flex!important;flex-direction:column;position:static;inset:auto;width:100%;
  height:min(86dvh,760px);max-height:min(86dvh,760px);min-height:0;
  border-radius:18px 18px 0 0;padding:14px 13px max(12px,env(safe-area-inset-bottom));
  background:#102737fa;overflow:hidden;pointer-events:auto}
 body.in-game #historyPanel .journal-heading{position:relative;flex:none;gap:8px;padding-top:6px}
 body.in-game #historyPanel .journal-tabs{flex:none;min-height:42px}
 body.in-game #historyPanel .journal-tabs button{min-height:42px;font-size:13px}
 body.in-game #historyPanel .journal-events{min-height:0;height:0;flex:1 1 0;
  overflow-y:auto;overscroll-behavior-y:contain;padding:3px 5px 14px 0;direction:ltr}
 body.in-game .sidebar.is-players-open #scorePanel{
  display:flex!important;flex-direction:column;position:static;inset:auto;width:100%;
  height:min(86dvh,760px);max-height:min(86dvh,760px);overflow-y:auto;
  padding:16px 14px max(12px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0;
  background:#102737fa;pointer-events:auto}
 body.in-game #scorePanel .side-back,body.in-game #historyPanel .side-back{display:inline-flex;min-height:44px}
 body.in-game .phase-toast{top:calc(var(--game-hud-clearance) + 50px);font-size:11px;max-width:calc(100vw - 26px)}
 .battle-overlay,.bot-overlay{padding:8px 8px max(8px,env(safe-area-inset-bottom));align-items:end;justify-items:center}
 .battle-modal,.bot-card{max-height:min(88dvh,790px);width:min(100%,620px);border-radius:18px 18px 0 0}
 .battle-modal{padding:16px 15px;overflow:auto}
 .bot-card{height:min(86dvh,740px);min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .bot-event-list{min-height:0;flex:1 1 auto;overflow-y:auto}
 .bot-footer{flex:none}
 .handoff-card{max-height:calc(100dvh - 30px);overflow-y:auto}
}
@media (orientation:portrait) and (max-width:380px){
 body.in-game .map-tools .map-tool{width:35px;min-width:35px}
 body.in-game .portrait-view-switch{min-width:75px;padding:0 6px}
 body.in-game .turn-panel .command-head h3{font-size:17px}
}
/* Portrait HUD final polish: retain round/phase, do not clip the map-mode button. */
@media (orientation:portrait) and (max-width:820px){
 body.in-game .game-top .hud-current{align-self:start;margin-top:8px}
 body.in-game .game-top .hud-status{
  display:flex!important;position:absolute;left:26px;top:35px;bottom:auto;
  grid-column:auto;grid-row:auto;align-items:center;justify-content:flex-start;
  width:auto;max-width:calc(100vw - 90px);height:13px;
  padding:0;margin:0;border:0;background:transparent;
  font-size:9px;line-height:1.2;gap:6px;white-space:nowrap;
 }
 body.in-game .game-top .hud-status .hud-phase-detail{font-size:9px}
 body.in-game .map-tools .portrait-view-switch{width:85px;min-width:85px;height:39px;min-height:39px}
}

/* Alpha v6.9.3.2 — automatic command sheet responses to legal map selections. */
@media (orientation:portrait) and (max-width:820px){
 body.in-game .sidebar .turn-panel{
   transition:max-height 200ms ease,box-shadow 200ms ease;
 }
 body.in-game .turn-panel .command-summary{overflow-wrap:anywhere}
}
@media (prefers-reduced-motion:reduce){
 body.in-game .sidebar .turn-panel{transition:none!important}
}

body.in-game .turn-panel .command-summary.is-feedback{color:#f2c17f;line-height:1.35}


/* Alpha v6.9.3.3 - concise reinforcement controls & premium sheet chevron */
.command-pool-compact{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:5px 1px 2px;font-size:12px;color:#a8c4d4;
}
.command-pool-compact strong{
  color:#f0be73;font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;
}
.command-toggle{display:none;align-items:center;justify-content:center;
  background:#203d50;border:1px solid #45667b;border-radius:11px;
  color:#f3cb87;box-shadow:inset 0 1px 0 #ffffff12;}
.command-toggle .command-chevron{display:block;flex:none;width:21px;height:21px;
  transition:transform 180ms ease,color 180ms ease;}
body.in-game .turn-panel.is-collapsed .command-toggle .command-chevron{transform:rotate(180deg)}
.command-toggle:hover:not(:disabled),.command-toggle:focus-visible{
  background:#2b4b60;border-color:#d4a866;color:#ffe1a4;}
.command-toggle:focus-visible{outline:2px solid #f0be73;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.command-toggle .command-chevron{transition:none}}
@media (orientation:portrait) and (max-width:820px){
  body.in-game .turn-panel .command-pool-compact{padding:0 2px 0;font-size:11px}
  body.in-game .turn-panel .command-pool-compact strong{font-size:13px}
  body.in-game .turn-panel .command-toggle{display:flex;padding:0}
}


/* Alpha v6.9.3.4 — shared reinforcement / initial deployment interaction */
.command-undo{display:block;width:100%;background:transparent!important;border:1px solid #456579!important;color:#bfd4df!important;min-height:39px;font-size:12px!important;padding:8px 10px!important;text-align:center;}
.command-undo:hover{border-color:#e3b775!important;color:#ffdf9f!important;}

/* Multiplayer is additive — the original local setup remains fully visible. */
.online-mode-entry{display:flex;flex-direction:column;align-items:center;gap:9px;margin:20px auto 22px}
.online-mode-link{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:13px 18px;border-radius:12px;text-decoration:none;font-size:14px;max-width:100%;text-align:center}
.online-mode-caption{color:#adc2cd;font-size:11px!important;margin:0!important;line-height:1.55}

/* Main site navigation in the LOCAL SETUP ONLY */
.landing .site-back-link{display:inline-flex;margin-bottom:18px;color:#e6bd80;font-size:12px;font-weight:700;text-decoration:none}.landing .site-back-link:hover{text-decoration:underline}
