/* Multiplayer Alpha 2.0 · navy / brass visual language shared with local v6.9.3.4. */
:root{--wd-dark:#0b1d2c;--wd-surface:#132d40;--wd-raised:#1a394d;--wd-border:#3d5d72;--wd-gold:#edbc75;--wd-copy:#dae8ed}
body{background:radial-gradient(circle at 80% 0,#18374b,#071725 74%);}
.masthead{min-height:53px;padding:7px clamp(9px,2vw,26px);background:#081b29ed}
.brand strong{font-size:14px}.brand .star{font-size:21px}
#matchView{height:calc(100dvh - 53px);min-height:430px;display:flex;flex-direction:column;overflow:hidden}
.game-hud{min-height:60px;padding:8px 17px;gap:11px;flex:none;box-shadow:0 5px 25px #0003}
.online-turn-info{display:flex;align-items:center;min-width:0;gap:10px;flex:1}
.online-turn-info .player-dot{width:16px;height:16px;box-shadow:0 0 0 4px #fff1}
.online-turn-info>div{min-width:0}
.game-hud .eyebrow{font-size:9px;letter-spacing:.13em}
.game-hud h2{font-size:17px;margin:3px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.game-clock{background:#1b3648;border:1px solid #3b576b;border-radius:10px;padding:5px 12px;min-width:94px;gap:2px}
.game-clock span{font-size:8px}.game-clock strong{font-size:17px}
.game-hud-actions{align-items:center}.game-hud-actions button{padding:9px 10px;font-size:11px}
.connection-chip{font-size:10px;color:#9ed5b0;white-space:nowrap;font-weight:700}.connection-chip.is-offline{color:#efc078}
.game-layout{flex:1;min-height:0;padding:12px;gap:12px;grid-template-columns:minmax(0,1fr) minmax(290px,330px);align-items:stretch}
.map-holder{min-height:0;height:100%;border-radius:16px;background:linear-gradient(180deg,#102c3f,#092131);box-shadow:0 12px 36px #0004}
.map-holder #mapArea{height:100%;min-height:0;overflow:hidden;touch-action:none}
.map-holder #mapArea svg{height:100%;max-height:none;width:100%;min-height:0;object-fit:contain;touch-action:none;user-select:none}
.map-toolbar{position:absolute;right:10px;top:10px;z-index:3;display:flex;gap:5px}
.map-toolbar button{min-width:38px;min-height:38px;font-size:18px;padding:5px 10px;background:#0d293dda;backdrop-filter:blur(10px)}
#mapTip{top:auto;bottom:12px;left:12px;border:1px solid #31556b;font-size:11px;max-width:70%;padding:7px 10px}
#world .territory-area.attack-available:not(.enemy-selected){stroke:#ecc67c;stroke-width:1.8;stroke-opacity:.95}
#world .territory-area.enemy-selected{stroke:#ffd3b0;stroke-width:3.1;filter:drop-shadow(0 0 6px #faab71)}
.game-aside{height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:9px}
.game-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;background:#132b3c;border:1px solid #35546a;border-radius:11px;padding:4px;flex:none}
.game-tab{padding:10px 2px;font-size:10px;line-height:1.2;border-radius:8px;border:1px solid transparent;color:#b5cbd6;background:transparent;min-height:38px}
.game-tab.is-active{background:#2c4555;color:#f1c586;border-color:#5a665d}
.game-tab-panel{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#856f56 #163044}
.game-aside .card.game-tab-panel{padding:15px;background:#102a3bf5;border:1px solid #385c70;box-shadow:0 8px 29px #0007}
.command-card{position:static;display:flex;flex-direction:column;overflow:hidden!important;padding:0!important}
.command-head{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:15px 15px 12px;border-bottom:1px solid #36566b;flex:none}
.command-head h2{font:600 21px Georgia,serif;margin:5px 0 0!important;color:#f0f4f7}
.command-summary{margin:4px 0 0;font-size:11px;color:#b9cbd5;display:none}
.command-chevron{display:none;min-width:42px;height:42px;font-size:24px;padding:3px 10px}
.command-interior{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.command-content-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding:12px 15px;scrollbar-width:thin;scrollbar-color:#80694d #142d3f;overscroll-behavior:contain}
.command-buttons{flex:none;display:flex;flex-direction:column;gap:7px;margin:0;padding:12px 14px 14px;background:#102739;border-top:1px solid #355166;box-shadow:0 -6px 18px #0003}
.command-buttons button{min-height:44px;padding:9px 12px}
.command-card #commandMessage:empty{display:none}
.wd-metric{padding:12px 14px;background:#1b364a;border-radius:12px;border:1px solid #355a70;margin:0 0 11px}
.wd-metric-top{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:12px}
.wd-metric-top>div{display:flex;flex-direction:column;gap:5px}.wd-metric small{font-size:9px;font-weight:850;letter-spacing:.1em;color:#b5cbd6}
.wd-metric strong{font-size:29px;line-height:1;color:#fff;font-variant-numeric:tabular-nums}.wd-metric-top>span{font-size:11px;color:#eac087;font-weight:700}
.wd-rail{height:7px;background:#324d60;border-radius:30px;overflow:hidden}.wd-rail-fill{height:100%;background:linear-gradient(90deg,#d6a25c,#f4c983);border-radius:30px;transition:width .16s}
.wd-territory{background:#1d394b;border:1px solid #406276;border-left:4px solid var(--empire,#e8bf81);border-radius:11px;padding:10px 12px;margin:0 0 10px}
.wd-territory-copy{display:flex;flex-direction:column;gap:3px}.wd-territory-copy small{font-size:9px;font-weight:800;letter-spacing:.09em;color:#adc7d4}.wd-territory-copy strong{color:white;font-size:13px}.wd-territory-copy span{font-size:11px;color:#b8cbd6}
.wd-note{background:#1a374a;border:1px solid #36576d;border-radius:11px;padding:11px 12px;color:#c5d9e2;line-height:1.5;font-size:12px;margin:0 0 10px}
.wd-step-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0 0 11px}
.wd-step-row button{padding:9px 3px;min-width:0;min-height:43px;border:1px solid #4a6980;background:#2a4658;color:#edf1f3;font-size:12px}
.wd-tools{display:flex;gap:7px;flex-wrap:wrap}.wd-tools button{flex:1;font-size:11px;padding:10px 8px}
.wd-range{background:#1a3649;border:1px solid #355b6e;border-radius:12px;padding:12px;margin:10px 0}
.wd-range-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:#d4e4eb}
.wd-range-head output{font-weight:850;font-size:24px;color:#edc083;font-variant-numeric:tabular-nums}
.wd-range input[type=range]{width:100%;min-height:30px;accent-color:#f0be75;cursor:pointer}
.wd-targets{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}.wd-targets button{border:1px solid #456578;background:#254355;color:#e9f0f4;font-size:11px;min-height:38px;padding:8px 9px}
.wd-targets button.selected{border-color:#edbb76;background:#4a4030;color:#ffdfaa}
.wd-report-card{padding:13px;border:1px solid #406078;border-left:3px solid #d4ad6f;background:#1c3a4f;border-radius:12px;margin-bottom:10px;overflow:hidden}
.wd-report-card.wd-conquest{border-color:#43836d;border-left:3px solid #6bd19e;background:linear-gradient(135deg,#1c453e,#1c3647 65%)}
.wd-report-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:11px}
.wd-event-tag{font-size:9px;font-weight:850;letter-spacing:.1em;color:#e6b46e}
.wd-report-verdict{font-size:10px;font-weight:800;color:#e4bf8e;border-radius:6px;padding:5px 8px;background:#53412e}
.wd-report-verdict.is-win{color:#a6ecc0;background:#275740}.wd-report-verdict.is-hold{color:#ebc898;background:#4e4437}
.wd-report-sides{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:11px}
.wd-report-side{display:flex;align-items:center;gap:6px;font-size:11px;color:#cbdce3;min-width:0}.wd-report-side .player-dot{width:10px;height:10px}
.wd-report-route{display:flex;align-items:center;gap:6px;font-weight:800;color:#fff;font-size:12px;overflow-wrap:anywhere;margin-bottom:10px}
.wd-report-route strong{color:#ecc283}.wd-report-route span{min-width:0}
.wd-loss-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.wd-loss-grid>div{border-radius:9px;padding:10px;background:#102b3d;border:1px solid #365569;display:flex;flex-direction:column;gap:6px}
.wd-loss-grid span{font-size:10px;color:#afcbd9}.wd-loss-grid strong{font-size:20px;color:#f3bfad;font-variant-numeric:tabular-nums}
.wd-conquest-title{font-size:16px;color:#f4f5f5;margin:0 0 7px}.wd-report-description{font-size:11px;color:#c8d9df;margin-bottom:12px}
.wd-info-event{border:1px solid #34566a;background:#1a3447;border-radius:10px;padding:10px 11px;display:flex;flex-direction:column;gap:6px;margin:0 0 8px;font-size:11px;color:#c5d7df}
.report-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.wd-region-card{padding:12px;background:#1a364a;border:1px solid #3b5a70;border-radius:11px;margin-bottom:10px}
.wd-region-head{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:10px;font-size:12px}.wd-region-head span{color:#ebbd7b;font-size:11px;font-weight:750}
.wd-region-foot{font-size:10px;color:#adbfca;margin-top:9px}
.battle-modal{width:min(520px,100%);max-height:min(90dvh,750px);overflow:auto;padding:22px}
.battle-modal h2{font:600 27px Georgia,serif;margin:10px 0 18px}
.modal-topline{display:flex;align-items:center;justify-content:space-between;gap:8px}
.wd-combat-sides{display:grid;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr);align-items:center;gap:5px}
.wd-combat-sides .wd-territory{margin:0}.wd-combat-sides .combat-versus{text-align:center;color:#f0c07a;font-size:23px}
.modal-actions{display:flex;flex-direction:column;gap:8px;margin-top:16px}.modal-actions button{min-height:47px}
.auto-attack-button{background:#294c62;color:#f2d2a3;border:1px solid #59758a}
.combat-verdict{font-size:12px;padding:12px;border-radius:10px;margin:12px 0;color:#cfe7d8;background:#245b45;border:1px solid #41896d}
.combat-verdict.is-hold{color:#e6d5b8;background:#3d443d;border-color:#6e674e}
.combat-losses{display:grid;grid-template-columns:1fr 1fr;gap:9px}.combat-losses>div{border:1px solid #34596e;background:#172f41;border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:7px}.combat-losses span{font-size:11px;color:#b7ceda}.combat-losses strong{color:#f0baa4;font-size:24px}
.battle-dice-line{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:10px;color:#b1c8d7;margin-top:11px}
.victory-modal{width:min(570px,100%);max-height:85dvh;overflow:auto;text-align:center}.victory-modal h2{font:600 31px Georgia,serif;color:#f8d7a2}.victory-modal button{width:100%;margin-top:16px}
.wd-victory-banner{display:flex;flex-direction:column;gap:6px;padding:15px;border:1px solid #9b774b;border-radius:11px;background:#503d2d;margin-bottom:14px}.wd-victory-banner strong{color:#f7dcad}.wd-victory-banner span{color:#d5c1a7;font-size:12px}
.wd-result-player{display:flex;align-items:center;gap:10px;text-align:left;padding:10px;border-radius:9px;background:#1d394b;margin:6px 0}.wd-result-player strong{min-width:0;font-size:12px}.wd-result-player span:last-child{margin-left:auto;font-size:10px;color:#bbced9}
@media(max-width:930px){#matchView{height:calc(100dvh - 53px);min-height:0}.game-layout{grid-template-columns:minmax(0,1fr) 278px;min-height:0;padding:8px}.game-aside{display:flex}.game-tab-panel{grid-column:auto}.game-tabs .game-tab{font-size:9px}}
@media(max-width:820px) and (orientation:portrait){
 #matchView{height:calc(100dvh - 53px)}.game-layout{position:relative;display:block;padding:0;height:100%;overflow:hidden}
 .game-hud{min-height:56px;padding:8px 9px}.game-hud h2{font-size:14px}.game-clock{padding:5px 7px;min-width:76px}.game-clock strong{font-size:14px}.game-hud-actions button{padding:7px;font-size:10px}.connection-chip{display:none}
 .map-holder{height:100%;min-height:0;border-radius:0;border:0}
 .game-aside{position:absolute;bottom:0;left:0;right:0;height:auto;min-height:0;max-height:min(71%,650px);z-index:4;display:flex;flex-direction:column;gap:0;pointer-events:none}
 .game-aside>*{pointer-events:auto}
 .game-tabs{border-radius:14px 14px 0 0;border-bottom:0;padding:4px 8px;background:#122d41f5;flex:none}
 .game-tab{font-size:10px;min-height:40px}
 .game-aside .card.game-tab-panel{min-height:0;max-height:min(58dvh,500px);border-radius:0;overflow:auto;flex:0 1 auto}
 .game-aside .card.command-card{display:flex;overflow:hidden!important}
 .command-head{padding:9px 12px}.command-head h2{font-size:18px}.command-head .eyebrow{font-size:8px}
 .command-chevron{display:block}.command-summary{font-size:10px}.command-content-scroll{padding:12px}.command-buttons{padding:9px 12px calc(10px + env(safe-area-inset-bottom))}
 .command-card.is-collapsed .command-summary{display:block}.command-card.is-collapsed .command-interior{display:none}.command-card.is-collapsed .command-head{border:0}
 .map-toolbar{right:8px;top:10px}.map-toolbar button{min-width:36px;min-height:36px}
 #mapTip{bottom:min(26dvh,185px)}
}
@media(max-height:560px) and (orientation:landscape) and (max-width:980px){
 .masthead{min-height:39px;padding:3px 12px}.brand strong{font-size:12px}.brand small{display:none}.star{font-size:17px}.back{font-size:9px;padding:6px}#matchView{height:calc(100dvh - 39px);min-height:0}
 .game-hud{min-height:47px;padding:4px 10px;flex-wrap:nowrap}.game-hud .eyebrow{font-size:8px}.game-hud h2{font-size:13px}.game-clock{padding:3px 7px;min-width:75px}.game-clock span{font-size:7px}.game-clock strong{font-size:13px}.game-hud-actions button{padding:5px 7px;font-size:9px}.connection-chip{display:none}
 .game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(235px,29%);height:100%;gap:5px;padding:5px;overflow:hidden}
 .game-aside{height:100%;position:static;max-height:none;pointer-events:auto}.game-aside .card.game-tab-panel{max-height:none;min-height:0;flex:1 1 auto;border-radius:11px}
 .game-tabs{gap:2px;padding:2px}.game-tab{font-size:8px;min-height:29px;padding:6px 0}
 .command-head{padding:8px 10px}.command-head h2{font-size:16px}.command-content-scroll{padding:9px}.command-buttons{padding:7px 10px}
 .wd-metric strong{font-size:22px}.wd-metric{padding:8px}.wd-territory{padding:7px}.command-buttons button{min-height:37px}
 .battle-modal{padding:15px;max-height:94dvh}.battle-modal h2{font-size:20px;margin:6px 0 12px}.modal-actions{margin-top:9px}.wd-range{padding:8px;margin:5px 0}
}
@media(max-width:520px){.game-hud-actions #resignBtn{font-size:0}.game-hud-actions #resignBtn::before{content:'⚑';font-size:15px}.game-hud-actions #pauseBtn{font-size:0}.game-hud-actions #pauseBtn::before{content:'Ⅱ';font-size:15px}.game-hud h2{max-width:165px}.wd-combat-sides{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr)}.battle-modal{padding:15px}.battle-modal h2{font-size:23px}.wd-report-head{flex-wrap:wrap}.wd-report-sides{gap:5px}}
@media(prefers-reduced-motion:reduce){.wd-rail-fill{transition:none}}

.missed-modal{width:min(460px,100%);max-height:82dvh;overflow:auto}.missed-modal h2{font:600 26px Georgia,serif}.missed-modal button{width:100%;min-height:46px;margin-top:15px}.wd-catchup-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:18px 0}.wd-catchup-metrics>div{background:#1c394d;padding:13px 7px;border:1px solid #436378;border-radius:10px;display:flex;flex-direction:column;align-items:center;gap:5px}.wd-catchup-metrics strong{font-size:25px;color:#f0c07b}.wd-catchup-metrics span{font-size:11px;color:#b6cad5}

@media(max-width:820px) and (orientation:portrait){
.game-hud{flex-wrap:nowrap;gap:6px;min-height:51px}
.online-turn-info{min-width:0;flex:1 1 auto;gap:7px}
.online-turn-info .player-dot{flex:none;width:13px;height:13px}
.game-hud h2{font-size:13px;max-width:153px}
.game-hud .eyebrow{font-size:8px}
.game-clock{min-width:74px;flex:none}
.game-hud-actions{display:flex;flex:none;gap:3px;width:auto;justify-content:center}
.game-hud-actions button{min-width:28px;min-height:34px;padding:4px 7px}
}

.wd-player-list-row{background:#1b394c;border:1px solid #3e6076;border-radius:10px;padding:10px 11px;display:flex;flex-direction:column;align-items:stretch;gap:5px}.wd-player-list-row.is-current-player{border-color:#cca66d}.wd-player-name{display:flex;align-items:center;gap:8px;font-size:12px}.wd-player-order{font-size:11px;color:#e7bb81;width:19px;font-weight:850}.wd-player-details{font-size:11px;color:#adc6d2;padding-left:38px}.wd-neutral-label{font-size:12px;color:#b6ccd6;margin:9px 0}

#clockValue.clock-urgent{color:#fa9d8f;animation:wd-timer-pulse 1.6s ease-in-out infinite}@keyframes wd-timer-pulse{50%{opacity:.58}}@media(prefers-reduced-motion:reduce){#clockValue.clock-urgent{animation:none}}

/* Multiplayer Alpha 3.0 — parity with compact hot-seat game HUD.
   The separate website masthead is only for lobby, never for a live match. */
body.match-active{height:100dvh;min-height:0;overflow:hidden}
body.match-active .masthead{display:none}
body.match-active #matchView{height:100dvh;min-height:0;max-height:100dvh;padding:0;margin:0;max-width:none}
body.match-active .game-hud{position:relative;z-index:12;min-height:43px;padding:5px 12px;gap:9px;background:#0c2333;border-bottom:1px solid #375469;box-shadow:none}
body.match-active .game-hud .online-turn-info{gap:8px;min-width:0;flex:1}
body.match-active .game-hud .online-turn-info>div{display:flex;flex-direction:column;gap:3px;min-width:0}
body.match-active .game-hud h2{font-family:system-ui,-apple-system,Segoe UI,sans-serif;font-size:14px;font-weight:800;line-height:1.08;max-width:none;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.match-active .game-hud .eyebrow{font-size:9px;color:#f1bc70;letter-spacing:.055em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:1.25}
body.match-active .online-turn-info .player-dot{width:14px;height:14px;min-width:14px;box-shadow:0 0 0 2px #ffffff20}
body.match-active .game-clock{background:none;border:0;min-width:72px;padding:0 5px;text-align:right;align-items:flex-end;gap:1px}
body.match-active .game-clock span{font-size:8px;letter-spacing:.06em;line-height:1.2}
body.match-active .game-clock strong{font-size:15px;line-height:1.12}
body.match-active #connectionStatus{display:inline-block;flex:none;font-size:14px;line-height:1;min-width:14px;overflow:hidden;white-space:nowrap;max-width:14px;color:#81c9a5}
body.match-active .game-hud-actions{display:block;flex:none;position:relative}
body.match-active .hud-menu-button{height:36px;min-height:36px;min-width:39px;padding:0 8px;font-size:23px;line-height:1;border-radius:9px;color:#dce7ec;background:#213c4f;border:1px solid #38566b}
body.match-active .hud-menu{display:flex;flex-direction:column;gap:7px;position:absolute;z-index:40;right:0;top:calc(100% + 8px);width:min(270px,calc(100vw - 18px));padding:13px;background:#112e41;border:1px solid #557188;border-radius:13px;box-shadow:0 15px 45px #000c}
body.match-active .hud-menu.hidden{display:none!important}
body.match-active .hud-menu .hud-menu-header{font-size:10px;letter-spacing:.10em;color:#afc8d7;display:flex;justify-content:space-between;gap:7px;padding:2px 4px 5px}
body.match-active .hud-menu .hud-menu-header strong{color:#efbd78;font-size:12px;letter-spacing:.06em}
body.match-active .hud-menu button{display:block;width:100%;min-height:37px;text-align:left;padding:8px 11px;font-size:12px}
body.match-active .hud-menu-link{display:block;color:#bbd4df;font-size:12px;text-decoration:none;border-top:1px solid #3d586c;padding:13px 8px 5px}
body.match-active .game-layout{padding:6px;gap:7px}
body.match-active .map-holder{border-radius:12px}
body.match-active .game-aside{gap:5px}
body.match-active .game-tabs{border-radius:10px;padding:3px}
body.match-active .game-tab{min-height:34px;padding:8px 2px;font-size:10px}
body.match-active .game-aside .card.game-tab-panel{border-radius:10px}
body.match-active .command-head{padding:10px 12px}
body.match-active .command-head h2{font-size:19px}
body.match-active .command-content-scroll{padding:10px 12px}
body.match-active .command-buttons{padding:9px 11px 10px}
/* Saved guest participation and recovery without an account. */
.remembered-section{max-width:1116px;margin:0 auto 15px;padding:18px 21px}
.remembered-section .room-heading{margin:0 0 13px;align-items:baseline;flex-wrap:wrap}
.remembered-section .room-heading h2{font:600 23px Georgia,serif;margin:0}
.remembered-rooms{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:10px}
.saved-room{display:flex;align-items:center;justify-content:space-between;gap:9px;border:1px solid #3b6075;background:#1c3b4e;border-radius:11px;padding:12px;min-width:0}
.saved-room-details{min-width:0;display:flex;flex-direction:column;gap:5px;overflow-wrap:anywhere}
.saved-room-details strong{font-size:13px;color:#f5f5f6}
.saved-room-details span{font-size:10px;color:#a8c8d7;line-height:1.45}
.saved-room button{font-size:11px;padding:9px;flex:none}
.recovery-entry{border:1px solid #3f6479;background:#162f42;border-radius:11px;padding:12px 13px;margin-top:16px;color:#dfedf3}
.recovery-entry summary{font-weight:800;font-size:13px;cursor:pointer;color:#edc387}
.recovery-entry .field-stack{padding-top:14px}
.recovery-modal{width:min(510px,100%);max-height:90dvh;overflow:auto}
.recovery-modal h2{font:600 26px Georgia,serif;margin:9px 0 16px}
.recovery-secret{padding:16px 12px;background:#0c2232;border:1px solid #be995e;border-radius:11px;color:#ffe2b0;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-weight:800;text-align:center;font-size:clamp(12px,2.8vw,19px);letter-spacing:.07em;overflow-wrap:anywhere;user-select:all;margin:18px 0 11px}
.recovery-actions{display:flex;gap:8px;flex-wrap:wrap}.recovery-actions button{flex:1;min-width:140px;min-height:44px}
.recovery-open{margin:13px 0 3px}
@media(max-width:820px) and (orientation:portrait){
 body.match-active .game-hud{min-height:47px;padding:5px 7px;gap:5px}
 body.match-active .game-hud h2{font-size:12px;max-width:none}
 body.match-active .game-hud .eyebrow{font-size:7.5px;max-width:100%}
 body.match-active .game-clock{min-width:64px;padding:0 1px}
 body.match-active .game-clock strong{font-size:13px}
 body.match-active .game-clock span{font-size:7px}
 body.match-active .hud-menu-button{min-width:34px;min-height:34px;height:34px}
 body.match-active .game-layout{padding:0;gap:0}
 body.match-active .map-holder{border:0;border-radius:0}
 body.match-active .game-aside{bottom:0;max-height:74%}
 body.match-active .game-tabs{border-radius:13px 13px 0 0}
 body.match-active .game-aside .card.game-tab-panel{border-radius:0;max-height:min(57dvh,500px)}
 body.match-active .map-toolbar{right:9px;top:9px}
 .recovery-modal{padding:17px}.recovery-modal h2{font-size:22px}
}
@media(max-height:560px) and (orientation:landscape) and (max-width:980px){
 body.match-active .game-hud{min-height:36px;padding:3px 6px}
 body.match-active .game-hud h2{font-size:11px}
 body.match-active .game-hud .eyebrow{font-size:8px}
 body.match-active .game-clock{min-width:66px}
 body.match-active .game-clock strong{font-size:12px}
 body.match-active .hud-menu-button{min-width:32px;min-height:30px;height:30px;font-size:21px}
 body.match-active .game-layout{padding:3px;gap:3px;grid-template-columns:minmax(0,1fr) minmax(224px,39%)}
 body.match-active .map-holder{border-radius:5px}
 body.match-active .game-tabs{padding:2px;gap:2px;border-radius:5px}
 body.match-active .game-tab{min-height:27px;padding:5px 2px;font-size:8px}
 body.match-active .command-head{padding:6px 9px}
 body.match-active .command-head h2{font-size:15px}
 body.match-active .command-content-scroll{padding:7px 9px}
 body.match-active .command-buttons{padding:6px 9px}
 body.match-active .game-aside .card.game-tab-panel{border-radius:6px}
}
@media(max-width:360px){body.match-active .game-hud .eyebrow{max-width:135px}body.match-active .game-clock{min-width:61px}.saved-room{flex-wrap:wrap}}

/* Alpha 3.1 — command interaction parity with hot-seat 6.9.3.4. */
.wd-pool-inline{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px;color:#adc5d1;font-size:11px;padding:4px 1px}
.wd-pool-inline strong{font-variant-numeric:tabular-nums;font-size:14px;color:#efc383}
.wd-draft-note{font-size:11px;color:#a9d4b9;margin:-4px 0 10px;font-weight:700}
.wd-command-undo{margin:0 0 9px;min-height:39px;background:#254556;color:#e8c490;border:1px solid #466b7d;width:100%;font-size:11px}
.wd-reinforcement-breakdown{border:1px solid #38586a;border-radius:9px;background:#173246;padding:10px 11px;margin:11px 0;font-size:11px;color:#afc5d2}
.wd-reinforcement-breakdown summary{cursor:pointer;font-weight:750;color:#edbd79}
.wd-reinforcement-breakdown div{padding:8px 0 0}.wd-reinforcement-breakdown strong{display:block;padding:9px 0 2px;color:#d5e4e8}
#world .territory-area.fortify-available:not(.selected){stroke:#8ddabd;stroke-width:2;stroke-opacity:.95}
#world .territory-area.attack-capable:not(.selected):not(.attack-available){stroke:#cfa264;stroke-width:1.25}


/* Multiplayer Alpha 3.2 — compact three-phase HUD, no extra toolbar row. */
body.match-active .online-phase-rail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;align-items:stretch;min-width:0;width:clamp(216px,29vw,365px);flex:none}
body.match-active .phase-chip{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:32px;padding:5px 6px;border-radius:8px;background:#173143;border:1px solid #344e60;color:#8eacbc;font-size:10px;font-weight:750;line-height:1.15;white-space:nowrap;pointer-events:none}
body.match-active .phase-chip-num{font-weight:900;color:#91aebe;font-size:11px}
body.match-active .phase-chip.is-current{background:linear-gradient(130deg,#4a4030,#343b37);border-color:#efbd77;color:#fff;box-shadow:inset 0 0 0 1px #efbd7722}
body.match-active .phase-chip.is-current .phase-chip-num{color:#f5c680}
body.match-active .phase-chip.is-complete{background:#173c40;border-color:#376660;color:#b6d7c8}
body.match-active .phase-chip.is-complete .phase-chip-num{color:#8fd6ac}
body.match-active .phase-chip.is-pending{opacity:.78}
body.match-active .online-phase-rail.is-inactive{display:none}
body.match-active .hud-menu-group-label{font-size:9px;font-weight:850;letter-spacing:.14em;color:#e7bd80;padding:9px 5px 0;border-top:1px solid #36546a}
body.match-active .hud-menu button[aria-pressed=true]{border-color:#5e997e;color:#d6f2df;background:#1d463d}
/* The legacy base stylesheet limited reports to 270 px; override it and
   scroll the events list rather than the entire report panel. */
body.match-active .game-aside .card.history-card{max-height:none;min-height:0;height:auto;flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden}
body.match-active .history-card .report-heading{flex:none;margin-bottom:12px}
body.match-active #matchHistory{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#90714d #152e40;padding-right:4px}
/* Non-blocking transition: empire color marks the newly active commander. */
body.match-active .turn-transition{position:fixed;z-index:14;top:62px;left:50%;transform:translateX(-50%);width:min(410px,calc(100vw - 24px));display:flex;align-items:center;gap:12px;padding:13px 15px;border-radius:14px;background:linear-gradient(115deg,color-mix(in srgb,var(--turn-color,#e9bd75) 25%,#132c3e),#0b2535 70%);border:1px solid color-mix(in srgb,var(--turn-color,#e9bd75) 75%,#3b5b6c);box-shadow:0 13px 37px #000b;pointer-events:none;animation:wd-turn-pop .24s ease both}
body.match-active .turn-transition.is-my-turn{box-shadow:0 18px 50px #000b,0 0 21px color-mix(in srgb,var(--turn-color,#e9bd75) 18%,transparent)}
body.match-active .turn-transition-mark{width:43px;height:43px;min-width:43px;border-radius:12px;background:var(--turn-color,#e9bd75);display:grid;place-items:center;color:white;font-size:25px}
body.match-active .turn-transition-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
body.match-active .turn-transition-copy>span{font-size:9px;font-weight:900;letter-spacing:.14em;color:#edc489}
body.match-active .turn-transition-copy>strong{font-size:17px;color:#fff;overflow-wrap:anywhere}
body.match-active .turn-transition-copy>small{font-size:11px;color:#bdd0db;line-height:1.3}
@keyframes wd-turn-pop{from{opacity:0;transform:translate(-50%,-9px)}to{opacity:1;transform:translate(-50%,0)}}
@media(max-width:980px){
 body.match-active .online-phase-rail{width:clamp(168px,27vw,235px);gap:3px}
 body.match-active .phase-chip{font-size:9px;min-height:29px;padding:3px 4px;gap:3px}
}
@media(max-width:680px){
 body.match-active .online-phase-rail{width:118px;gap:2px}
 body.match-active .phase-chip{font-size:9px;min-height:29px;padding:4px 2px;gap:2px}
 body.match-active .phase-chip-name{display:none}
 body.match-active .phase-chip-num{font-size:11px}
 body.match-active .phase-chip.is-current .phase-chip-name{display:inline;max-width:45px;overflow:hidden;text-overflow:clip}
 body.match-active .turn-transition{top:56px;padding:10px 12px;width:min(350px,calc(100vw - 16px))}
}
@media(max-height:560px) and (orientation:landscape) and (max-width:980px){
 body.match-active .online-phase-rail{width:clamp(153px,22vw,210px)}
 body.match-active .phase-chip{min-height:26px;font-size:8px}
 body.match-active .turn-transition{top:43px}
}
@media(max-width:360px){
 body.match-active .online-phase-rail{width:82px}
 body.match-active .phase-chip.is-current .phase-chip-name{display:none}
 body.match-active .game-hud .online-turn-info{gap:3px}
 body.match-active .game-hud .eyebrow{font-size:7px}
}
/* Match the available height in compact portrait sheets too. */
@media(max-width:820px) and (orientation:portrait){
 body.match-active .game-aside .card.history-card{height:min(57dvh,500px);max-height:min(57dvh,500px);flex:0 1 auto}
}
@media(prefers-reduced-motion:reduce){body.match-active .turn-transition{animation:none}}

/* Alpha 3.3 — attack modal only: fixed header/footer, compact themed scroll. */
#combatOverlay .combat-window{display:flex;flex-direction:column;overflow:hidden;width:min(540px,100%);max-height:min(90dvh,760px);padding:0;min-height:0}
#combatOverlay .combat-modal-header{flex:none;padding:17px 20px 8px;background:#122d40;border-bottom:1px solid #314d60}
#combatOverlay .combat-modal-header h2{margin:7px 0 7px;font-size:24px}
#combatOverlay .combat-modal-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 20px;scrollbar-width:thin;scrollbar-color:#b48a54 #142d3e}
#combatOverlay .combat-modal-scroll::-webkit-scrollbar{width:7px}
#combatOverlay .combat-modal-scroll::-webkit-scrollbar-track{background:#142d3e;border-radius:10px}
#combatOverlay .combat-modal-scroll::-webkit-scrollbar-thumb{background:#a47a49;border-radius:10px;border:1px solid #233d4e}
#combatOverlay .combat-modal-footer{margin:0;flex:none;padding:12px 20px 16px;border-top:1px solid #365568;background:#102a3a;box-shadow:0 -5px 16px #0002;gap:7px}
#combatOverlay .combat-modal-footer button{width:100%;min-height:45px}
#combatOverlay .wd-combat-sides .wd-territory{padding:9px 10px;min-height:67px}
#combatOverlay .wd-combat-sides .wd-territory-copy strong{font-size:12px}
#combatOverlay .wd-range{margin:10px 0;padding:11px 12px}
#combatOverlay .wd-range-head output{font-size:23px}
#combatOverlay .wd-combat-hint{font-size:10px;line-height:1.45;color:#9eb8c7;margin:3px 0 0}
#combatOverlay .combat-verdict{margin:13px 0 11px;padding:10px 12px}
#combatOverlay .combat-losses{gap:8px}
#combatOverlay .combat-losses>div{padding:10px 12px;gap:3px}
#combatOverlay .combat-losses strong{font-size:21px}
.wd-dice-detail{border:1px solid #3c5d70;background:#172f40;border-radius:12px;margin-top:12px;padding:12px;min-width:0}
.wd-dice-detail-label,.wd-round-label{font-size:10px;letter-spacing:.1em;font-weight:850;color:#e8bd82}
.wd-dice-board{display:flex;flex-direction:column;gap:9px;margin-top:11px}
.wd-dice-group{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.wd-dice-group-head{display:flex;flex-direction:column;gap:3px;min-width:73px;font-size:10px;font-weight:850;color:#e2edf2}
.wd-dice-group-head span:last-child{font-size:9px;color:#a8c1ce;font-weight:600}
.wd-dice-row{display:flex;align-items:center;justify-content:flex-start;gap:7px;flex:1 1 auto;min-width:0}
.wd-die{width:45px;height:45px;flex:0 0 45px;position:relative;display:grid;place-items:center;border-radius:10px;border:2px solid transparent;box-shadow:0 3px 10px #0004;background:#294253}
.wd-die-svg{width:100%;height:100%;display:block;overflow:visible}
.wd-die-attack .wd-die-square{fill:#f1e6d2}
.wd-die-defense .wd-die-square{fill:#d9e7ec}
.wd-die-pip{fill:#192c3c}
.wd-die.is-win{border-color:#76d6a3;box-shadow:0 0 0 1px #76d6a322,0 0 12px #48bb8344}
.wd-die.is-loss{border-color:#e8867d;box-shadow:0 0 0 1px #e8867d22}
.wd-die.is-unused{opacity:.58;border-color:#556e7c}
.wd-die-unused{position:absolute;right:-5px;bottom:-6px;font-size:9px;color:#d4e1e8;background:#1e3545;padding:0 3px;border-radius:3px}
.wd-dice-matches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:3px}
.wd-dice-match{padding:8px 9px;background:#1b4140;border:1px solid #417e67;border-radius:8px;display:flex;justify-content:space-between;gap:5px;align-items:center;min-width:0}
.wd-dice-match.is-defense{background:#4a3437;border-color:#935c59}
.wd-dice-match strong{font-size:13px;color:#fff;white-space:nowrap}
.wd-dice-match span{font-size:10px;color:#c4ecda;text-align:right}
.wd-dice-match.is-defense span{color:#f6c2b9}
.wd-round-chooser{margin-top:13px;display:flex;flex-direction:column;gap:7px}
.wd-round-buttons{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:5px}
#combatOverlay .wd-round-button{padding:8px 5px;min-height:37px;font-size:10px;background:#28475a;color:#c5d9e3;border:1px solid #46677b}
#combatOverlay .wd-round-button.is-active{color:#ffdb9f;background:#4b4030;border-color:#eabb77}
#combatOverlay .wd-skip-replay{min-height:32px;font-size:11px;background:transparent;border:1px solid #4b6577;color:#c3d8e3;padding:6px}
@keyframes wd-die-appear{0%{opacity:0;transform:translateY(5px) scale(.79)}60%{opacity:1;transform:translateY(-2px) scale(1.06)}100%{opacity:1;transform:none}}
@keyframes wd-duel-appear{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.wd-die.is-revealing{opacity:0;animation:wd-die-appear .22s ease-out var(--reveal-delay,0ms) both}
.wd-dice-match.is-revealing{opacity:0;animation:wd-duel-appear .24s ease-out var(--reveal-delay,0ms) both}
@media(max-width:520px){
 #combatOverlay{padding:9px}
 #combatOverlay .combat-window{max-height:calc(100dvh - 18px)}
 #combatOverlay .combat-modal-header{padding:12px 13px 5px}
 #combatOverlay .combat-modal-header h2{font-size:21px}
 #combatOverlay .combat-modal-scroll{padding:11px 13px;scrollbar-width:none}
 #combatOverlay .combat-modal-scroll::-webkit-scrollbar{display:none}
 #combatOverlay .combat-modal-footer{padding:9px 13px calc(10px + env(safe-area-inset-bottom))}
 #combatOverlay .wd-combat-sides .wd-territory{min-height:60px;padding:7px 8px}
 #combatOverlay .wd-combat-sides .wd-territory-copy strong{font-size:11px}
 #combatOverlay .wd-range{padding:9px 11px;margin:7px 0}
 .wd-die{width:39px;height:39px;flex-basis:39px}
 .wd-dice-group-head{min-width:62px}
 .wd-dice-row{gap:5px}
 .wd-dice-detail{padding:10px}
 .wd-dice-match{padding:7px 6px;flex-direction:column;align-items:flex-start}
 .wd-dice-match span{font-size:9px;text-align:left}
}
@media(max-height:560px) and (orientation:landscape){
 #combatOverlay{padding:5px}
 #combatOverlay .combat-window{width:min(600px,100%);max-height:calc(100dvh - 10px)}
 #combatOverlay .combat-modal-header{padding:6px 12px 4px}
 #combatOverlay .combat-modal-header h2{font-size:17px;margin:2px 0 4px}
 #combatOverlay .combat-modal-scroll{padding:6px 12px}
 #combatOverlay .combat-modal-footer{padding:5px 12px 6px}
 #combatOverlay .combat-modal-footer button{min-height:37px}
 #combatOverlay .wd-range{padding:6px 9px;margin:5px 0}
 #combatOverlay .wd-combat-sides .wd-territory{min-height:45px;padding:5px 8px}
 #combatOverlay .wd-range input[type=range]{min-height:24px}
 .wd-die{width:36px;height:36px;flex-basis:36px}
 .wd-dice-detail{margin-top:6px;padding:8px}
}
@media(prefers-reduced-motion:reduce){.wd-die.is-revealing,.wd-dice-match.is-revealing{animation:none;opacity:1}}

/* Multiplayer Alpha 3.4: lobby moderation, finished games and dice spotlight. */
.lobby-host-actions{display:flex;justify-content:flex-end;gap:8px;margin:10px 0 2px}
.lobby-host-actions.hidden{display:none}
.lobby-host-actions button{color:#f3bab1;border-color:#815551;background:#312e39}
.member .wd-kick-player{width:auto;min-height:34px;padding:7px 10px;white-space:nowrap;color:#efb4aa;border:1px solid #87514e;background:#41323a}
.member .wd-kick-player:hover,.lobby-host-actions button:hover{border-color:#d7867e;background:#53393e}
.victory-modal .victory-exit{display:block;width:100%;min-height:43px;margin-top:9px;color:#d9e8ed;border:1px solid #577386;background:#203c50}
.wd-dice-detail.is-rolling{border-color:#d5aa67;box-shadow:0 0 0 1px #d5aa6733,0 0 20px #d5aa6728;transition:border-color .22s,box-shadow .22s}
@media(max-width:520px){.member .wd-kick-player{padding:6px 8px;font-size:11px}.lobby-host-actions{margin-top:8px}}
@media(prefers-reduced-motion:reduce){.wd-dice-detail.is-rolling{transition:none}}

.member .member-person{min-width:0;flex:1 1 auto;overflow-wrap:anywhere}
.member .status-chip{flex:none}
.wd-dice-detail.is-result{border-color:#836744}

/* Public site links, visible only in the ONLINE WELCOME screen */
.online-hero .site-links{display:flex;flex-wrap:wrap;gap:22px;margin-bottom:15px}.online-hero .site-links a{font-size:12px;font-weight:750;color:#e9c082;text-decoration:none}.online-hero .site-links a:hover{text-decoration:underline}
