:root {
    --wod-bg-deep: #0a121c;
    --wod-bg-panel: rgba(10, 18, 28, 0.97);
    --wod-bg-panel-grad: linear-gradient(165deg, rgba(18, 28, 42, 0.98), rgba(8, 14, 22, 0.98));
    --wod-gold: #d4af37;
    --wod-gold-bright: #f1c40f;
    --wod-gold-soft: rgba(212, 175, 55, 0.45);
    --wod-gold-line: rgba(212, 175, 55, 0.55);
    --wod-text: #ecf0f1;
    --wod-text-muted: #bdc3c7;
    --wod-accent-green: #2ecc71;
    --wod-accent-green-deep: #27ae60;
    --wod-accent-blue: #3498db;
    --wod-accent-blue-deep: #2980b9;
    --wod-danger: #e74c3c;
    --wod-radius-sm: 8px;
    --wod-radius-md: 12px;
    --wod-radius-lg: 16px;
    --wod-border-thin: 1px solid var(--wod-gold-line);
    --wod-shadow-panel: 0 10px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    background-color: #111;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Prefer dynamic viewport so browser chrome (non-fullscreen) does not clip UI. */
@supports (height: 100dvh) {
    html, body {
        height: 100dvh;
        max-height: 100dvh;
    }
}
@supports (height: 100svh) {
    html, body {
        min-height: 100svh;
    }
}

#gameWrapper {
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border: none;
    position: relative;
    overflow: hidden;
    background-color: #154360; /* Deep water fallback */
    box-sizing: border-box;
}

#gameCanvas {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
    touch-action: none;
    /* Backing store is DPR-scaled in JS; disable browser blur upscale */
    image-rendering: auto;
}

#gameCanvas.menu-bg-active {
    display: block !important;
    z-index: 2;
}

/* UI Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 8px;
    box-sizing: border-box;
}

/* (No backdrop blur: the battle behind the menu changes every frame, so a full-screen blur over it had to be redone
   every frame, and the menu ran at about 20 frames a second with presses slow to show. A little more shade instead.) */
#mainMenu.overlay {
    background: linear-gradient(180deg, rgba(6, 12, 20, 0.44) 0%, rgba(6, 12, 20, 0.66) 48%, rgba(6, 12, 20, 0.82) 100%);
    pointer-events: none;
}

#mainMenu h1,
#mainMenu .menu-btn,
#mainMenu .main-menu-land-wrap,
#mainMenu .main-menu-hero,
#mainMenu .main-menu-btns,
#mainMenu .wod-changelog,
#mainMenu .wod-changelog-popup {
    pointer-events: auto;
}
#mainMenu .main-menu-land-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
}
#mainMenu .main-menu-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0;
}
#mainMenu .main-menu-btns .menu-btn {
    margin-left: 0;
    margin-right: 0;
}
#mainMenu .main-menu-hero {
    text-align: center;
}
#mainMenu h1 {
    margin-top: 0;
}

#mainMenu #wodQuitBtn {
    margin-top: 18px;
}
/* Changelog stays off the button column: a side rail on a wide screen, under the buttons when the screen is narrow. */
#mainMenu .wod-changelog {
    position: relative;
    z-index: 3;
    width: min(440px, 100%);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
}
#mainMenu .wod-changelog-body {
    max-height: min(34vh, 280px);
    overflow: auto;
    text-align: left;
    background: rgba(10, 18, 28, 0.9);
    border: 1px solid var(--wod-gold-line);
    border-radius: var(--wod-radius-sm);
    padding: 12px 14px 14px;
    box-sizing: border-box;
}
#mainMenu .wod-changelog-body h2 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--wod-gold-bright);
    letter-spacing: 0.04em;
}
#mainMenu .wod-changelog-entry {
    padding: 10px 0 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
/* The changelog holds every version (some 1,500 elements), and the browser laid all of them out each time the main
   menu came back from a panel, about 20 ms per press. Entries scrolled out of view now skip layout and painting until
   they are scrolled to (the size each last had is remembered, so the scrollbar stays steady). */
.wod-changelog-entry { content-visibility: auto; contain-intrinsic-size: auto 180px; }
#mainMenu .wod-changelog-entry time {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.85);
    margin-bottom: 2px;
}
#mainMenu .wod-changelog-entry h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #ecf0f1;
}
#mainMenu .wod-changelog-entry ul {
    margin: 0;
    padding-left: 16px;
    color: #bdc3c7;
    font-size: 13px;
    line-height: 1.45;
}
#mainMenu .wod-changelog-entry li + li {
    margin-top: 4px;
}
.wod-changelog-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.wod-changelog-version { display: inline-block; padding: 3px 8px; border: 1px solid rgba(241,196,15,.35); border-radius: 999px; background: rgba(241,196,15,.09); color: #f5d779; font-size: 11px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
#mainMenu .wod-changelog-meta time, .wod-changelog-popup-body .wod-changelog-meta time { margin-bottom: 0; }
@media (min-width: 1100px) and (min-height: 680px) {
    #mainMenu .wod-changelog {
        position: absolute;
        top: max(16px, env(safe-area-inset-top, 0px));
        right: max(16px, env(safe-area-inset-right, 0px));
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        width: min(320px, calc((100vw - 520px) / 2));
        margin-top: 0;
    }
    #mainMenu .wod-changelog-body {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

.wod-changelog-popup {
    position: fixed;
    inset: 0;
    z-index: 100003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.wod-changelog-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 8, 14, 0.62);
}
.wod-changelog-popup-card {
    position: relative;
    width: min(560px, 100%);
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(12, 20, 30, 0.96), rgba(8, 14, 22, 0.94));
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.wod-changelog-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
}
.wod-changelog-popup-head h2 {
    margin: 0;
    font-size: 20px;
    color: #f4e4a6;
}
.wod-changelog-close {
    background: #1a3348;
    color: #f4e4a6;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}
.wod-changelog-popup-body {
    overflow: auto;
    padding: 4px 16px 16px;
    color: #d5d8dc;
}
.wod-changelog-popup-body .wod-changelog-entry h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #ecf0f1;
}
.wod-changelog-popup-body .wod-changelog-entry time {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #95a5a6;
}
.wod-changelog-popup-body .wod-changelog-entry ul {
    margin: 0 0 14px;
    padding-left: 16px;
}

.hidden {
    display: none !important;
}

.wod-load-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}
.wod-load-overlay.hidden {
    display: none !important;
}
#wodMapGenOverlay {
    z-index: 100001;
}
#wodMpSyncOverlay {
    z-index: 100003;
    background: rgba(0, 0, 0, 0.72);
    pointer-events: none;
}
#wodDevMenu {
    position: fixed;
    top: 56px;
    right: 16px;
    z-index: 100010;
    width: min(360px, calc(100vw - 24px));
    max-height: min(78vh, 640px);
    overflow: auto;
    background: rgba(10, 16, 24, 0.94);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: #ecf0f1;
    font: 12px/1.4 Consolas, "Courier New", monospace;
    padding: 12px 14px 14px;
    pointer-events: auto;
}
#wodDevMenu.hidden { display: none !important; }
#wodDevMenu h3 {
    margin: 0 0 8px;
    font: 700 14px/1.2 system-ui, sans-serif;
    color: #f1c40f;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#wodDevMenu .wod-dev-sub {
    margin: 0 0 10px;
    color: #9db3c7;
    font: 11px/1.35 system-ui, sans-serif;
}
#wodDevMenu .wod-dev-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#wodDevMenu .wod-dev-section h4 {
    margin: 0 0 6px;
    font: 600 11px/1.2 system-ui, sans-serif;
    color: #7fdbff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#wodDevFps {
    font-size: 18px;
    font-weight: 700;
    color: #2ecc71;
}
#wodDevFps.wod-dev-fps-warn { color: #f1c40f; }
#wodDevFps.wod-dev-fps-bad { color: #e74c3c; }
#wodDevStats, #wodDevActivity {
    white-space: pre-wrap;
    word-break: break-word;
    color: #c8d6e5;
}
#wodDevActivity {
    max-height: 140px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 6px;
    padding: 6px 8px;
}
.wod-dev-cheats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wod-dev-cheats button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #ecf0f1;
    border-radius: 6px;
    padding: 5px 8px;
    font: 600 11px/1.2 system-ui, sans-serif;
    cursor: pointer;
}
.wod-dev-cheats button:hover {
    border-color: rgba(241, 196, 15, 0.65);
    background: rgba(241, 196, 15, 0.12);
}
.wod-dev-close {
    float: right;
    margin: -2px 0 0;
    border: none;
    background: transparent;
    color: #9db3c7;
    font: 700 14px/1 system-ui, sans-serif;
    cursor: pointer;
}
.wod-dev-close:hover { color: #ecf0f1; }
#wodMpSyncOverlay .wod-load-caption {
    font-size: 15px;
    text-align: center;
    line-height: 1.45;
    max-width: min(420px, 86vw);
}
.wod-load-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: min(420px, 86vw);
}
.wod-load-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: rgba(200, 220, 255, 0.95);
    animation: wod-spin 0.85s linear infinite;
}
@keyframes wod-spin {
    to { transform: rotate(360deg); }
}
.wod-load-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.45);
}
.wod-load-bar-inner {
    height: 100%;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #2e6b8f, #5ab0d8, #8fd4f0);
    transition: transform 0.35s ease-out;
}
.wod-load-bar-inner.wod-boot-tween-suppress {
    transition: none;
}
.wod-load-caption {
    font-size: 14px;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.72);
}
.wod-boot-continue {
    display: none;
    margin-top: 4px;
    min-width: 160px;
    padding: 12px 28px;
    font-size: 1rem;
    letter-spacing: 0.06em;
    border: 1px solid rgba(212, 175, 55, 0.65);
    background: linear-gradient(180deg, rgba(60, 48, 28, 0.95), rgba(28, 22, 14, 0.98));
    color: #f5e6b8;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.wod-boot-continue.visible {
    display: inline-block;
    animation: wod-boot-continue-in 0.35s ease-out;
}
.wod-boot-continue:hover {
    border-color: rgba(241, 196, 15, 0.9);
    color: #fff6d0;
    background: linear-gradient(180deg, rgba(80, 62, 32, 0.98), rgba(40, 30, 16, 1));
}
.wod-boot-continue:focus-visible {
    outline: 2px solid rgba(241, 196, 15, 0.85);
    outline-offset: 3px;
}
@keyframes wod-boot-continue-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.wod-load-panel.wod-boot-ready .wod-load-spinner {
    animation: none;
    border-color: rgba(212, 175, 55, 0.35);
    border-top-color: rgba(212, 175, 55, 0.85);
}

#wodMissionPopupOverlay {
    z-index: 100004;
    background: rgba(4, 10, 18, 0.82);
    pointer-events: auto;
}
.wod-mission-popup-panel {
    width: min(520px, 92vw);
    max-height: min(78vh, 640px);
    overflow: auto;
    background: linear-gradient(165deg, #1a2f42 0%, #0f1a28 55%, #0a121c 100%);
    border: 2px solid rgba(201, 162, 39, 0.55);
    border-radius: 14px;
    padding: 22px 24px 20px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    text-align: center;
}
.wod-mission-popup-panel.wod-mission-style-alert {
    border-color: rgba(231, 76, 60, 0.75);
    box-shadow: 0 0 32px rgba(231, 76, 60, 0.18);
}
.wod-mission-popup-panel.wod-mission-style-briefing {
    border-color: rgba(52, 152, 219, 0.65);
}
.wod-mission-popup-panel.wod-mission-style-victory {
    border-color: rgba(46, 204, 113, 0.7);
}
.wod-mission-popup-kicker {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(201, 220, 240, 0.72);
    font-weight: 800;
}
.wod-mission-popup-title {
    margin: 0 0 14px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #f4e4a6;
    line-height: 1.25;
}
.wod-mission-popup-body {
    margin: 0 0 20px;
    font-size: 1rem;
    line-height: 1.55;
    color: #d5e4f0;
    text-align: left;
    white-space: pre-wrap;
}
.wod-mission-popup-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.wod-mission-popup-btn {
    min-width: 120px;
    padding: 10px 22px;
    border-radius: 8px;
    border: 1px solid rgba(201, 162, 39, 0.65);
    background: linear-gradient(180deg, #2a4a62, #1e3448);
    color: #f4f8fc;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}
.wod-mission-popup-btn:hover { filter: brightness(1.08); }

#campaignSummaryOverlay {
    z-index: 42;
    background: radial-gradient(circle at 50% 20%, rgba(26, 48, 64, 0.96), rgba(5, 10, 16, 0.96));
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 12px 28px;
    box-sizing: border-box;
}
.campaign-summary-overlay-wrap {
    pointer-events: auto;
}
.campaign-summary-panel {
    max-width: 640px;
    width: 92vw;
    max-height: min(92vh, 960px);
    margin: auto;
    padding: 24px 26px 20px;
    border-radius: 16px;
    border: 2px solid rgba(212, 175, 39, 0.55);
    background: linear-gradient(165deg, rgba(18, 28, 40, 0.98), rgba(10, 17, 26, 0.99));
    box-shadow: 0 18px 48px rgba(0,0,0,0.5);
    text-align: left;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
}
.campaign-summary-panel > h2,
.campaign-summary-panel > .campaign-summary-sub,
.campaign-summary-panel > .campaign-summary-actions {
    flex: 0 0 auto;
}
.campaign-summary-panel > .cs-stats-root {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}
.campaign-summary-panel h2 {
    margin: 0 0 6px;
    font-size: 1.65rem;
    text-align: center;
}
.campaign-summary-panel.campaign-summary--victory h2 { color: #2ecc71; }
.campaign-summary-panel.campaign-summary--defeat h2 { color: #e74c3c; }
.campaign-summary-sub { margin: 0 0 18px; color: #bdc3c7; font-size: 0.96rem; line-height: 1.4; text-align: center; }
.cs-stats-root {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 6px 0 12px;
    padding-right: 2px;
}
.cs-card {
    background: rgba(6, 12, 22, 0.72);
    border: 1px solid rgba(212, 175, 39, 0.28);
    border-radius: 12px;
    padding: 12px 14px 14px;
}
.cs-card-title {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.88);
}
.cs-kv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 8px 18px;
    font-size: 0.93rem;
    color: #ecf0f1;
}
.cs-kv-grid span:nth-child(odd) { color: #95a5a6; }
.cs-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media(max-width: 560px) {
    .cs-dual { grid-template-columns: 1fr; }
    .cs-kv-grid { grid-template-columns: 1fr; }
}
.cs-pillar {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.cs-pillar h5 {
    margin: 0 0 8px;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.9);
    font-weight: 800;
}
.cs-pillar .cs-big {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f1c40f;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.cs-pillar .cs-sub {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #95a5a6;
    line-height: 1.35;
}
.cs-bar-row {
    margin-top: 10px;
}
.cs-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    color: #bdc3c7;
    gap: 8px;
    margin-bottom: 4px;
}
.cs-bar-head span { font-variant-numeric: tabular-nums; }
.cs-bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.38);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
}
.cs-bar-a {
    background: linear-gradient(90deg, #2ecc71, #58d68d);
    height: 100%;
    min-width: 0;
    transition: width 0.35s ease;
}
.cs-bar-b {
    background: linear-gradient(90deg, #3498db, #5dade2);
    height: 100%;
    min-width: 0;
    transition: width 0.35s ease;
}
.cs-legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 8px;
    font-size: 0.74rem;
    color: #95a5a6;
}
.cs-legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.cs-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.cs-dot.you { background: #2ecc71; }
.cs-dot.ai { background: #3498db; }
.campaign-summary-panel.campaign-summary--mp-wide {
    max-width: 920px;
}
.cs-mp-table-wrap {
    overflow-x: auto;
    margin-top: 6px;
    -webkit-overflow-scrolling: touch;
}
.cs-mp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: #ecf0f1;
}
.cs-mp-table th, .cs-mp-table td {
    padding: 7px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: middle;
}
.cs-mp-table th {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.88);
    white-space: nowrap;
}
.cs-mp-table tr:last-child td { border-bottom: none; }
.cs-mp-table tbody.cs-team-block + tbody.cs-team-block {
    border-top: 1px solid rgba(212, 175, 39, 0.2);
}
.cs-mp-table tr.cs-team-banner td {
    padding: 8px 8px 6px;
    background: rgba(212, 175, 39, 0.08);
    border-bottom: 1px solid rgba(212, 175, 39, 0.16);
}
.cs-team-banner-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.cs-team-banner-name {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: #f1c40f;
}
.cs-team-banner-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
}
.cs-team-swatches { display: inline-flex; align-items: center; gap: 4px; }
.cs-team-banner-res { margin-left: auto; }
.cs-mp-table tr.cs-team-member .cs-mp-fname { padding-left: 10px; }
.cs-mp-table tr.cs-team-sum td {
    color: #bdc3c7;
    font-weight: 700;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.03);
}
.cs-mp-fname { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.cs-mp-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.35);
}
.cs-mp-res-won { color: #2ecc71; font-weight: 800; }
.cs-mp-res-lost { color: #e74c3c; font-weight: 800; }
.campaign-summary-actions {
    text-align: center;
    margin-top: auto;
    padding-top: 14px;
    padding-bottom: 4px;
    flex-shrink: 0;
    border-top: 1px solid rgba(212, 175, 39, 0.18);
    background: linear-gradient(180deg, rgba(10, 17, 26, 0), rgba(10, 17, 26, 0.96) 28%);
}
.campaign-summary-actions .menu-btn {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

/* Main Menu */
#mainMenu h1 {
    font-size: clamp(38px, 10vw, 56px);
    margin: 0 0 28px 0;
    color: #2ecc71;
    text-shadow: 0 4px 10px rgba(46, 204, 113, 0.5);
    letter-spacing: 0.02em;
}

.menu-btn {
    background: linear-gradient(180deg, #2a3a4d 0%, #1a2533 100%);
    color: var(--wod-text);
    border: 1px solid var(--wod-gold-line);
    padding: 15px 30px;
    margin: 8px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    width: 260px;
    border-radius: var(--wod-radius-sm);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.menu-btn:hover {
    background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
    border-color: var(--wod-accent-green);
    color: #08140d;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(46, 204, 113, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
}
/* Pressed: the button pushes in the moment it is pressed (its action runs on release, so without this a press showed
   nothing until the finger or mouse button came up). */
.menu-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 2px 5px rgba(0, 0, 0, 0.22);
    transition-duration: 0.05s;
}

/* In-Game UI */
#inGameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    display: none;
}

.wod-hud-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(8px);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    border-bottom: 2px solid #d4af37;
    pointer-events: auto;
    z-index: 5;
}
.wod-m-intel-bundle {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
}
.wod-m-intel-bundle .resources {
    flex: 1;
    min-width: 0;
}
.wod-m-map-bundle,
.wod-m-build-bundle,
.wod-m-units-bundle {
    display: contents;
}
.wod-m-sheet-banner {
    display: none;
}
@media ((max-width: 900px) and (orientation: portrait)), ((max-height: 520px) and (orientation: landscape) and (max-width: 932px)) {
    #inGameUI .wod-m-sheet-banner {
        display: flex;
        flex-direction: column;
        gap: 3px;
        flex: 0 0 auto;
        order: -1;
        padding: 10px 12px;
        margin: 0 0 4px 0;
        background: linear-gradient(180deg, rgba(18, 28, 42, 0.98), rgba(10, 18, 28, 0.94));
        border: 1px solid rgba(212, 175, 55, 0.48);
        border-radius: 12px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    }
    #inGameUI .wod-m-sheet-title {
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(241, 196, 15, 0.96);
    }
    #inGameUI .wod-m-sheet-sub {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.03em;
        color: rgba(189, 195, 199, 0.9);
        line-height: 1.3;
        max-width: 36em;
    }
    #statsMenu .wod-m-sheet--intel .resource-section {
        background: rgba(12, 20, 32, 0.75);
        border: 1px solid rgba(212, 175, 55, 0.28);
        border-radius: 11px;
        padding: 12px 10px 10px;
        box-sizing: border-box;
        gap: 8px;
    }
    #statsMenu .wod-m-sheet--intel .resource-section-label {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.1em;
        color: rgba(236, 240, 245, 0.96);
    }
    #statsMenu .wod-m-sheet--intel .resource-chip {
        font-size: 11px;
        font-weight: 700;
        padding: 8px 11px;
        border-radius: 9px;
        line-height: 1.25;
        background: rgba(6, 12, 20, 0.88);
        border: 1px solid rgba(100, 118, 138, 0.45);
        color: rgba(255, 255, 255, 0.96);
    }
    #statsMenu .wod-m-sheet--intel .resource-section-chips {
        gap: 7px;
        justify-content: center;
    }
    #statsMenu .wod-m-sheet--intel .resource-combat-split {
        gap: 10px;
    }
    /* Combat chips: two-row grid per pane so Casualties/Kills stay narrow and the Intel sheet scrolls */
    #statsMenu .wod-m-sheet--intel .resource-combat-pane {
        align-self: center;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    #statsMenu .wod-m-sheet--intel .resource-combat-pane .resource-section-chips {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
        width: 100%;
    }
    #statsMenu .wod-m-sheet--intel .resource-combat-pane .resource-section-chips .resource-chip:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 100%;
    }
    #statsMenu .wod-m-sheet--intel .resource-section.resource-section-combat .resource-chip .chip-value {
        min-width: 6ch;
    }
    #statsMenu .wod-m-sheet--intel .resource-chip .chip-value {
        color: #f1c40f;
        font-weight: 800;
        margin-left: 4px;
        font-variant-numeric: tabular-nums;
        font-feature-settings: "tnum" 1;
        display: inline-block;
        min-width: 8ch;
        text-align: right;
    }
    #statsMenu .wod-m-sheet--intel .player-summary h4 {
        font-size: 13px;
        letter-spacing: 0.08em;
    }
    #statsMenu .wod-m-sheet--intel .player-row {
        font-size: 12px;
        gap: 9px 10px;
        grid-template-columns: 14px minmax(44px, 0.9fr) minmax(9ch, 1fr) minmax(10ch, 1.2fr) minmax(6ch, 0.9fr) minmax(6ch, 0.85fr) 6px;
    }
    #statsMenu .wod-m-sheet--intel .player-row.header {
        font-size: 10px;
        letter-spacing: 0.04em;
    }
    .stats-menu .stats-menu-panel {
        width: min(720px, 96vw);
        max-height: min(88svh, 88dvh);
        padding: 22px 18px 28px;
    }
    #statsMenu .wod-m-sheet--intel .resources {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        row-gap: 12px;
        overflow: visible;
    }
    #statsMenu .wod-m-sheet--intel .resources .resources-divider { display: none; }
    #statsMenu .wod-m-sheet--intel .resource-section.resource-section-combat { grid-column: 1 / -1; }
}
@media (min-width: 901px) and (min-height: 521px) {
    #inGameUI .wod-m-sheet-banner {
        display: none !important;
    }
}
@media (min-width: 901px) {
    #inGameUI .wod-m-sheet {
        display: contents;
    }
}
.top-bar {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    flex-shrink: 0;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: auto;
}

.wod-hud-objective {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: min(380px, 36vw);
    margin-right: auto;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(8, 14, 24, 0.55);
    border: 1px solid rgba(212, 175, 39, 0.35);
    box-sizing: border-box;
}
.wod-hud-objective > .wod-m-objective-icon {
    flex: 0 0 auto;
    order: 0;
    align-self: center;
}
.wod-hud-objective > .wod-m-objective-copy {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
}
.wod-hud-objective-label {
    display: block;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.88);
    line-height: 1.15;
    margin-bottom: 3px;
}
.wod-hud-objective-mode {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    color: #ecf0f1;
    margin-right: 8px;
}
.wod-hud-objective-rule {
    display: inline;
    font-size: 11px;
    color: rgba(189, 195, 199, 0.95);
    line-height: 1.35;
}

.wod-hud-compact {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    flex: 1 1 auto;
    min-width: 0;
}
.wod-hud-compact-group {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}
.wod-hud-compact-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.9);
    white-space: nowrap;
}
.wod-hud-compact-total {
    font-size: 15px;
    font-weight: 800;
    color: #ecf0f1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wod-hud-compact-rate {
    font-size: 12px;
    font-weight: 700;
    color: rgba(189, 195, 199, 0.95);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wod-hud-compact-rate.negative { color: #e74c3c; }
.wod-hud-compact-rate.positive { color: #2ecc71; }
.top-bar .wod-stats-btn,
.top-bar .wod-cities-btn {
    flex-shrink: 0;
    min-width: 64px;
}

/* Civ5-style city list */
#citiesMenu {
    z-index: 36;
    background: radial-gradient(circle at 50% 18%, rgba(28, 42, 56, 0.94), rgba(6, 10, 16, 0.96));
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 16px 12px 24px;
    box-sizing: border-box;
}
.cities-menu-panel {
    max-width: min(980px, 96vw);
    width: 100%;
    max-height: min(88vh, 860px);
    margin: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: linear-gradient(180deg, #1a2a38 0%, #101820 100%);
    border: 1px solid rgba(212, 175, 39, 0.45);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.cities-menu-panel > h2 {
    margin: 0;
    padding: 14px 18px 6px;
    text-align: center;
    font-size: 1.35rem;
    color: #f1c40f;
    letter-spacing: 0.04em;
}
.cities-menu-sub {
    margin: 0;
    padding: 0 18px 10px;
    text-align: center;
    color: #95a5a6;
    font-size: 0.86rem;
}
.cities-menu-actions {
    padding: 10px 16px 14px;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 39, 0.18);
    flex-shrink: 0;
}
.cities-menu-actions .menu-btn {
    width: 100%;
    max-width: 280px;
}
.cities-chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px 8px;
}
.cities-chart {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
    color: #ecf0f1;
}
.cities-chart thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #243746, #1b2b38);
    color: rgba(241, 196, 15, 0.92);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 9px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 39, 0.35);
    white-space: nowrap;
}
.cities-chart tbody tr {
    background: rgba(0, 0, 0, 0.18);
    transition: background 0.12s ease;
}
.cities-chart tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}
.cities-chart tbody tr:hover {
    background: rgba(241, 196, 15, 0.08);
}
.cities-chart tbody tr.cities-row--selected {
    background: rgba(46, 204, 113, 0.14);
    outline: 1px solid rgba(46, 204, 113, 0.35);
}
.cities-chart td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}
.cities-name-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #ecf0f1;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-align: left;
    text-decoration: underline dotted rgba(241, 196, 15, 0.45);
    text-underline-offset: 3px;
}
.cities-name-btn:hover { color: #f1c40f; }
.cities-yield {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #f1c40f;
    font-weight: 700;
}
.cities-yield-mp { color: #5dade2; }
.cities-bldg-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.cities-bldg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: #7f8c8d;
}
.cities-bldg.is-built {
    color: #1e2a24;
    background: linear-gradient(180deg, #7dcea0, #27ae60);
    border-color: rgba(39, 174, 96, 0.8);
}
.cities-bldg.is-missing {
    border-style: dashed;
    color: #bdc3c7;
}
.cities-bldg.is-unavailable {
    opacity: 0.45;
}
.cities-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 320px;
}
.cities-build-btn {
    appearance: none;
    border: 1px solid rgba(212, 175, 39, 0.45);
    background: linear-gradient(180deg, #2a4054, #1a2c3c);
    color: #ecf0f1;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cities-build-btn:hover:not(:disabled) {
    border-color: rgba(241, 196, 15, 0.85);
    color: #f1c40f;
}
.cities-build-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.cities-empty {
    padding: 28px 16px;
    text-align: center;
    color: #95a5a6;
}
.cities-card-list {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 2px 2px 8px;
}
.cities-card {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 12px 10px;
}
.cities-card.cities-row--selected {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.45);
}
.cities-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.cities-card-yields {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.cities-card .cities-name-btn {
    font-size: 1.02rem;
    line-height: 1.25;
    text-decoration: none;
    padding: 2px 0;
}
.cities-card .cities-bldg-slots {
    margin-bottom: 8px;
}
.cities-card .cities-actions {
    max-width: none;
    gap: 6px;
}
.cities-card .cities-build-btn {
    flex: 1 1 auto;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.78rem;
    border-radius: 10px;
}
.cities-card .cities-complete {
    color: #7f8c8d;
    font-size: 0.78rem;
    font-weight: 700;
}
@media (max-width: 720px), ((hover: none) and (pointer: coarse)) {
    #citiesMenu {
        padding: 0;
        align-items: stretch;
        justify-content: flex-end;
    }
    .cities-menu-panel {
        max-width: none;
        width: 100%;
        max-height: min(92dvh, 92vh);
        min-height: min(62dvh, 520px);
        margin: 0;
        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }
    .cities-menu-panel > h2 {
        padding: 14px 14px 4px;
        font-size: 1.2rem;
    }
    .cities-menu-sub {
        display: none;
    }
    .cities-chart-wrap {
        padding: 0 10px 6px;
    }
    .cities-chart { display: none; }
    .cities-card-list { display: flex; }
    .cities-menu-actions {
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .cities-menu-actions .menu-btn {
        max-width: none;
        min-height: 44px;
        border-radius: 12px;
    }
}

.resources {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 3px;
}

.resource-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.resource-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.92);
    text-align: center;
    white-space: nowrap;
    width: 100%;
    line-height: 1.05;
}

.resource-section-chips {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    justify-content: center;
}

.resources::-webkit-scrollbar {
    height: 5px;
}

.resources::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 999px;
}

.resource-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: var(--wod-radius-sm);
    background: rgba(8, 14, 22, 0.88);
    border: 1px solid var(--wod-gold-soft);
    color: rgba(236, 240, 241, 0.95);
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 2px 8px rgba(0, 0, 0, 0.25);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.resources-divider {
    flex-shrink: 0;
    width: 1px;
    align-self: stretch;
    min-height: 44px;
    margin: 0 5px 2px;
    background: rgba(212, 175, 55, 0.38);
    opacity: 0.85;
}

.resource-section-combat {
    align-self: stretch;
}

.resource-combat-split {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
}

.resource-combat-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.resources-divider-inline {
    flex-shrink: 0;
    width: 1px;
    align-self: stretch;
    min-height: 44px;
    margin: 0 2px 2px;
    background: rgba(212, 175, 55, 0.38);
    opacity: 0.85;
}

.resource-chip .chip-value {
    color: #f1c40f;
    font-weight: 800;
    text-shadow: 0 0 6px rgba(241, 196, 15, 0.35);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    display: inline-block;
    box-sizing: border-box;
    min-width: 10ch;
    text-align: right;
    vertical-align: bottom;
}

.resource-chip.expense .chip-value {
    color: #ff6b6b;
    text-shadow: 0 0 6px rgba(231, 76, 60, 0.35);
}

.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(8px);
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    box-sizing: border-box;
    border-top: 2px solid #d4af37;
    pointer-events: auto;
}

.build-btn {
    background: linear-gradient(180deg, #2a3a4d 0%, #1a2533 100%);
    color: var(--wod-text);
    border: 1px solid var(--wod-gold-line);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: var(--wod-radius-sm);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.07);
}

.build-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
    border-color: var(--wod-accent-green);
    color: #08140d;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(46, 204, 113, 0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}

.build-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
    transform: none;
    box-shadow: none;
}

.menu-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

#setupPanel select:disabled,
#setupPanel input:disabled,
#mpHostMapDlg select:disabled,
#mpHostMapDlg input:disabled,
#mpHostRulesDlg select:disabled,
#mpHostRulesDlg input:disabled,
#mpGameLobbyScreen select:disabled,
#mpGameLobbyScreen .mp-gl-slot button:disabled,
#mpGameLobbyScreen .mp-gl-slot select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wod-pc-prod-root {
    display: none;
}
@media (min-width: 901px) {
    #gameWrapper:has(#inGameUI[style*="display: block"]) .wod-pc-prod-root {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9;
        pointer-events: none;
    }
    .wod-pc-prod-slide {
        pointer-events: auto;
        max-height: min(288px, 34vh, 34dvh);
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
        border-top: 2px solid rgba(212, 175, 55, 0.95);
        background: rgba(15, 25, 35, 0.94);
        backdrop-filter: blur(10px);
        box-sizing: border-box;
    }
    @media (max-height: 700px) {
        .wod-pc-prod-slide {
            max-height: min(220px, 30dvh);
        }
        .wod-pc-prod-tab {
            padding: 8px 10px;
            font-size: 12px;
        }
    }
    .wod-pc-prod-root.wod-pc-collapsed .wod-pc-prod-slide {
        max-height: 0;
        opacity: 0;
        border-top-color: transparent;
        pointer-events: none;
    }
    .wod-pc-prod-root.wod-pc-collapsed .wod-pc-prod-pane-wrap {
        padding: 0;
    }
    .wod-pc-prod-tabs {
        pointer-events: auto;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin: 0;
        background: rgba(10, 18, 28, 0.98);
        border-top: 2px solid #d4af37;
        box-sizing: border-box;
    }
    .wod-pc-prod-tab {
        flex: 1;
        appearance: none;
        border: none;
        cursor: pointer;
        font-weight: 800;
        font-size: 13px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        padding: 10px 14px;
        background: transparent;
        color: rgba(189, 195, 199, 0.95);
        border-right: 1px solid rgba(212, 175, 55, 0.28);
        transition: background 0.15s, color 0.15s;
    }
    .wod-pc-prod-tab:last-of-type {
        border-right: none;
    }
    .wod-pc-prod-tab:hover {
        background: rgba(212, 175, 55, 0.12);
        color: #ecf0f1;
    }
    .wod-pc-prod-tab.active {
        background: rgba(212, 175, 55, 0.22);
        color: #f1c40f;
    }
    .wod-pc-prod-toggle {
        flex: 0 0 auto;
        min-width: 44px;
        border: none;
        cursor: pointer;
        font-size: 16px;
        line-height: 1;
        background: rgba(8, 14, 22, 0.95);
        color: rgba(236, 240, 241, 0.94);
        border-left: 1px solid rgba(212, 175, 55, 0.45);
        padding: 0 14px;
    }
    .wod-pc-prod-pane-wrap {
        padding: 12px 16px 14px;
        box-sizing: border-box;
        max-height: min(276px, 33vh);
        overflow-y: auto;
    }
    .wod-pc-prod-pane {
        display: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 12px;
    }
    .wod-pc-prod-pane.active {
        display: flex;
    }
    #inGameUI .wod-m-sheet--build .bottom-bar,
    #inGameUI .wod-m-sheet--units .bottom-bar {
        display: none !important;
    }
    #inGameUI .wod-pc-prod-pane .build-btn {
        flex: 1 1 200px;
        max-width: 320px;
        margin: 0;
        font-size: 13px;
        padding: 12px 16px;
        border-radius: 10px;
        background: linear-gradient(180deg, #2c4a66 0%, #1a3044 100%);
        border: 1px solid rgba(212, 175, 55, 0.45);
        color: #ecf0f1;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.28);
    }
    #inGameUI .wod-pc-prod-pane .build-btn:hover:not(:disabled) {
        background: linear-gradient(180deg, #355a78 0%, #223a52 100%);
        border-color: rgba(212, 175, 55, 0.7);
        color: #fff;
        transform: translateY(-1px);
    }
    #inGameUI {
        --wod-pc-dock-h: 54px;
    }
    #inGameUI .info-card {
        --wod-pc-dock-h: 54px;
        left: auto;
        right: 12px;
        bottom: var(--wod-pc-dock-h);
        z-index: 14;
        width: min(560px, calc(100vw - 28px));
        max-width: min(560px, calc(100vw - 28px));
        margin: 0;
        padding: 13px 14px 12px;
        border-radius: 14px 14px 0 0;
        background: linear-gradient(160deg, rgba(8, 20, 31, 0.975), rgba(5, 13, 22, 0.99));
        border: 1px solid #d9a94c;
        border-bottom: none;
        box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    #inGameUI:has(.wod-pc-prod-root:not(.wod-pc-collapsed)) .info-card {
        bottom: calc(min(276px, 33vh) + var(--wod-pc-dock-h));
        border-radius: 14px;
        border-bottom: 1px solid #d9a94c;
    }
    #inGameUI .info-card.visible {
        max-height: min(460px, calc(100vh - 120px));
    }
    /* Keep details below orders; auxiliary pages open through the card controls. */
    #inGameUI .info-card.info-card--mobile-orders:not(.info-card--more-open) .info-card-pager,
    #inGameUI .info-card.info-card--mobile-orders:not(.info-card--more-open) .info-deselect-wrap {
        display: none !important;
    }
    #inGameUI .info-card.visible .info-card-body {
        min-height: 0;
        overflow: hidden;
    }
    #inGameUI .info-card.visible .info-card-pages {
        overflow-y: auto;
        overscroll-behavior: contain;
        min-height: 0;
    }
    #inGameUI .info-card .info-sheet-head {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding-right: 0;
        width: 100%;
    }
    #inGameUI .info-card .info-identity {
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
        gap: 10px;
    }
    #inGameUI .info-card .info-kpi-row {
        flex: 1 1 auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(56px, 1fr));
        gap: 7px;
        margin: 0 0 0 auto;
        max-width: 220px;
    }
    #inGameUI .info-card .info-kpi {
        min-height: 54px;
        padding: 6px 4px;
        border-radius: 10px;
        background: rgba(13, 23, 32, 0.92);
        border: 1px solid rgba(217, 169, 76, 0.42);
    }
    #inGameUI .info-card .info-kpi-lbl {
        display: none;
    }
    #inGameUI .info-card h3 {
        font-size: 15px;
        font-weight: 800;
        color: #fff;
    }
    #inGameUI .info-card #infoType {
        color: rgba(189, 195, 199, 0.95);
        font-size: 12px;
        margin: 0;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-mobile-orders {
        display: flex;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(217, 169, 76, 0.28);
    }
    #inGameUI .info-card .info-order-btn {
        min-height: 48px;
        font-size: 9px;
        border-radius: 9px;
        text-transform: none;
        letter-spacing: 0;
        padding: 6px 2px;
        background: linear-gradient(180deg, #17324c, #102338);
        border-color: rgba(217, 169, 76, 0.42);
        color: #ecf0f1;
    }
    #inGameUI .info-card .info-order-btn .info-order-ico {
        color: #d9a94c;
    }
    #inGameUI .info-card .info-order-btn.active {
        background: linear-gradient(180deg, #2ecc71 0%, #1e9e4f 100%);
        border-color: #58d68d;
        color: #08140d;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(46, 204, 113, 0.28);
    }
    #inGameUI .info-card .info-order-btn.active .info-order-ico {
        color: #08140d;
    }
    #inGameUI .info-card .info-order-btn[data-mo="stats"].active {
        background: linear-gradient(180deg, #f1c40f 0%, #b7950b 100%);
        border-color: #f7dc6f;
        color: #1a1400;
    }
    #inGameUI .info-card .info-order-btn[data-mo="stats"].active .info-order-ico {
        color: #1a1400;
    }
    #inGameUI .info-card .info-effects-scroll > .effect-list {
        max-height: 88px;
        overscroll-behavior: contain;
    }
    #inGameUI .info-card-edge-toggle {
        display: none !important;
    }
    #inGameUI {
        --wod-pc-top-ui-h: 96px;
    }
    #inGameUI #terrainKey {
        top: calc(var(--wod-pc-top-ui-h) + 14px);
        left: 16px;
        z-index: 12;
    }
    #inGameUI .layer-toggles {
        top: calc(var(--wod-pc-top-ui-h) + 14px);
        right: 16px;
        z-index: 12;
    }
    #inGameUI .player-summary {
        top: calc(var(--wod-pc-top-ui-h) + 230px);
    }
    .wod-pc-prod-slide {
        background: rgba(8, 16, 26, 0.96);
        border-top: 1px solid #d9a94c;
    }
    .wod-pc-prod-tabs {
        background: rgba(6, 12, 20, 0.98);
        border-top: 1px solid #d9a94c;
        min-height: var(--wod-pc-dock-h, 54px);
        height: var(--wod-pc-dock-h, 54px);
    }
    .wod-pc-prod-tab {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: none;
        padding: 6px 10px;
        color: #d9a94c;
        border-right: 1px solid rgba(217, 169, 76, 0.22);
    }
    .wod-pc-prod-tab .wod-pc-prod-ico {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: inherit;
    }
    .wod-pc-prod-tab .wod-pc-prod-ico svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.7;
    }
    .wod-pc-prod-tab.active {
        background: rgba(16, 26, 39, 0.95);
        color: #f2f1ea;
        box-shadow: inset 0 0 0 1.5px #d9a94c;
    }
    .wod-pc-prod-toggle {
        display: none !important;
    }
    #inGameUI .wod-hud-top {
        padding: 10px 16px;
        gap: 14px;
        background: rgba(8, 14, 22, 0.94);
        border-bottom: 1px solid #d9a94c;
        backdrop-filter: blur(10px);
    }
    #inGameUI .wod-hud-compact {
        gap: 22px;
        display: flex !important;
        flex: 0 1 auto;
    }
    #inGameUI .wod-hud-compact-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 8px 14px;
        min-height: 50px;
        min-width: 148px;
        border-radius: 10px;
        background: rgba(8, 14, 22, 0.92);
        border: 1px solid rgba(217, 169, 76, 0.48);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.28);
    }
    #inGameUI .wod-hud-compact-group .wod-m-resource-mark {
        flex: 0 0 auto;
        color: #d9a94c;
        font-size: 24px;
        font-weight: 800;
        line-height: 1;
    }
    #inGameUI .wod-hud-compact-group .wod-m-resource-mark--mp {
        font-size: 11px;
        letter-spacing: 0.06em;
    }
    #inGameUI .wod-hud-compact-values {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 3px;
    }
    #inGameUI .wod-hud-compact-title {
        display: none;
    }
    #inGameUI .wod-hud-compact-total {
        font-size: 17px;
        font-weight: 800;
        color: #ecf0f1;
        line-height: 1.1;
        font-variant-numeric: tabular-nums;
    }
    #inGameUI .wod-hud-compact-rate {
        font-size: 12px;
        font-weight: 800;
        color: #7fbe55;
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }
    #inGameUI .wod-hud-objective,
    #inGameUI #hudObjectiveDesktop {
        max-width: min(460px, 42vw);
        margin-right: 0;
        margin-left: 4px;
        padding: 6px 12px 6px 10px;
        border-radius: 10px;
        background: rgba(8, 14, 24, 0.72);
        border: 1px solid rgba(217, 169, 76, 0.4);
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px;
        box-sizing: border-box;
    }
    #inGameUI .wod-hud-objective .wod-m-objective-icon {
        display: block;
        position: relative;
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        border: 2px solid #d9a94c;
        border-radius: 50%;
        box-sizing: border-box;
        align-self: center;
        order: 0;
    }
    #inGameUI .wod-hud-objective .wod-m-objective-icon::before {
        content: '';
        position: absolute;
        left: 50%;
        top: -6px;
        width: 2px;
        height: 38px;
        background: #d9a94c;
        transform: translateX(-50%);
    }
    #inGameUI .wod-hud-objective .wod-m-objective-icon::after {
        content: '';
        position: absolute;
        top: 50%;
        left: -6px;
        width: 38px;
        height: 2px;
        background: #d9a94c;
        transform: translateY(-50%);
    }
    #inGameUI .wod-hud-objective .wod-m-objective-icon span {
        position: absolute;
        inset: 7px;
        border: 2px solid #d9a94c;
        border-radius: 50%;
        box-sizing: border-box;
        background: #0a1420;
        z-index: 1;
    }
    #inGameUI .wod-hud-objective .wod-m-objective-copy {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        flex: 1 1 auto;
        order: 1;
    }
    #inGameUI .wod-hud-objective .wod-m-objective-lines {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }
    #inGameUI .wod-hud-objective-label {
        display: block;
        font-size: 8px;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(217, 169, 76, 0.92);
        line-height: 1;
        margin-bottom: 0;
    }
    #inGameUI .wod-hud-objective-mode {
        display: block;
        font-size: 13px;
        font-weight: 800;
        color: #ecf0f1;
        margin-right: 0;
        line-height: 1.15;
    }
    #inGameUI .wod-hud-objective-rule {
        display: block;
        font-size: 11px;
        color: rgba(189, 195, 199, 0.95);
        line-height: 1.25;
    }
    #inGameUI .speed-controls {
        background: rgba(8, 14, 22, 0.92);
        border: 1px solid rgba(217, 169, 76, 0.45);
        border-radius: 10px;
        padding: 3px;
        gap: 3px;
    }
    #inGameUI .speed-btn {
        border-radius: 8px;
        border-color: transparent;
        background: transparent;
        min-width: 40px;
    }
    #inGameUI .speed-btn.active {
        background: linear-gradient(180deg, #d4af37 0%, #b7950b 100%);
        color: #1a1400;
        border-color: #f1c40f;
    }
    #inGameUI .top-actions .build-btn {
        border-radius: 10px;
        background: linear-gradient(180deg, #17324c, #102338);
        border: 1px solid rgba(217, 169, 76, 0.45);
        color: #ecf0f1;
        padding: 8px 12px;
        font-size: 12px;
    }
    #inGameUI .top-bar .wod-stats-btn,
    #inGameUI .top-bar .wod-cities-btn {
        border-radius: 10px;
        background: linear-gradient(180deg, #17324c, #102338);
        border: 1px solid rgba(217, 169, 76, 0.45);
        color: #ecf0f1;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    #inGameUI .top-bar .wod-stats-btn .wod-pc-prod-ico,
    #inGameUI .top-bar .wod-cities-btn .wod-pc-prod-ico {
        width: 14px;
        height: 14px;
        display: inline-flex;
    }
    #inGameUI .top-bar .wod-stats-btn .wod-pc-prod-ico svg,
    #inGameUI .top-bar .wod-cities-btn .wod-pc-prod-ico svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        fill: none;
        stroke-width: 1.8;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.speed-controls {
    display: flex;
    gap: 5px;
    padding: 4px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 8px;
}

.speed-btn {
    background: linear-gradient(180deg, #2a3a4d 0%, #1a2533 100%);
    color: #fff;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    padding: 8px 7px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

.speed-btn.active {
    background: linear-gradient(180deg, #2ecc71 0%, #1e8449 100%);
    border-color: #f1c40f;
    color: #07130b;
}

#inGameUI.wod-mp-match .speed-controls,
#inGameUI.wod-mp-match .speed-controls .speed-btn,
#inGameUI.wod-mp-match .wod-m-speed-dd,
#inGameUI.wod-mp-match .wod-m-speed-trigger,
#inGameUI.wod-mp-match #wodSpeedTrigger,
#inGameUI.wod-mp-match #wodSpeedPop,
#inGameUI.wod-mp-match .wod-m-speed-pop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Campaign reserves are separate from normal skirmish recruitment. */
.campaign-reserves {display:none;}
.wod-campaign-battle .campaign-reserves {display:block;grid-column:1/-1;width:100%;flex:1 0 100%;box-sizing:border-box;border:1px solid #a68a46;border-radius:9px;background:#102431;color:#f1e5bd;padding:0 10px;}
.campaign-reserves summary {display:flex;align-items:center;min-height:44px;cursor:pointer;font-size:13px;font-weight:700;list-style:none;}
.campaign-reserves summary::before {content:'▸';margin-right:8px;}
.campaign-reserves[open] summary::before {content:'▾';}
.campaign-reserves[open] {padding-bottom:10px;}
.campaign-reserve-buttons {display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.campaign-reserve-buttons button {min-height:44px;flex:1 1 140px;white-space:normal;border:1px solid #8b8058;border-radius:7px;background:#254257;color:#f1e5bd;padding:8px;cursor:pointer;}

.mp-host-dlg {
    position: fixed;
    inset: 0;
    z-index: 12050;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 16px;
    box-sizing: border-box;
}
.mp-host-dlg:not(.hidden) {
    display: flex;
}
.mp-host-dlg .panel {
    max-width: 420px;
    width: 100%;
    margin: 0;
    padding: 28px 32px;
    text-align: left;
}
.mp-host-dlg .panel h3 {
    margin-top: 0;
    color: #2ecc71;
}
.mp-host-dlg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
#wodConfirmDlg.mp-host-dlg {
    padding: max(16px, env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(16px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
    align-items: center;
    justify-content: center;
}
#wodConfirmDlg.mp-host-dlg .panel {
    text-align: center;
    max-width: min(420px, 92vw);
    width: 100%;
    margin: 0 auto;
    padding: 26px 24px 22px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#wodConfirmDlg.mp-host-dlg .panel h3 {
    color: #ecf0f1;
    margin: 0 0 10px;
    width: 100%;
    text-align: center;
}
#wodConfirmDlg.wod-confirm-danger .panel h3 {
    color: #ff9d8f;
}
#wodConfirmDlgBody {
    margin: 0 0 18px;
    color: #bdc3c7;
    font-size: 0.94rem;
    line-height: 1.5;
    width: 100%;
    text-align: center;
}
#wodConfirmDlg.mp-host-dlg .mp-host-dlg-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin-top: 0;
}
#wodConfirmDlg.mp-host-dlg .mp-host-dlg-actions .wod-editor-btn,
#wodConfirmDlg.mp-host-dlg .mp-host-dlg-actions .menu-btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    max-width: none;
    margin: 0 !important;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 0.95rem;
    white-space: nowrap;
}
#wodConfirmDlgOk.wod-confirm-ok-danger {
    background: linear-gradient(135deg, #922b21, #e74c3c) !important;
    border-color: #ff7979 !important;
    color: #fff !important;
}

/* Map editor–parity controls for save/load map flows (see map-editor.js .editor-btn, .editor-save-dialog) */
.wod-editor-btn {
    background: linear-gradient(180deg, #273d54, #203446);
    color: #ecf4fa;
    border: 1px solid rgba(155, 174, 188, 0.55);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    font-family: inherit;
}
.wod-editor-btn:hover {
    filter: brightness(1.07);
    border-color: rgba(231, 227, 173, 0.85);
}
.wod-editor-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.wod-editor-btn-main {
    background: linear-gradient(180deg, #5b4320, #3d2b12);
    border-color: #d4af37;
    color: #fff6d4;
    font-weight: 800;
}
.wod-editor-btn-main:hover {
    filter: brightness(1.12);
}
.wod-editor-btn-danger {
    background: rgba(120, 40, 40, 0.85);
    border: 1px solid rgba(255, 120, 120, 0.5);
    color: #ffecec;
}
.wod-editor-btn-danger:hover {
    filter: brightness(1.12);
    border-color: rgba(255, 180, 120, 0.7);
}
.wod-editor-hint {
    font-size: 12px;
    color: #93a8b9;
    line-height: 1.45;
    margin: 0 0 8px;
    font-weight: 400;
}
.wod-editor-save-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

#wodNameInputDlg.mp-host-dlg {
    background: rgba(4, 8, 14, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#wodNameInputDlg .panel {
    max-width: 420px;
    padding: 18px 20px;
    background: rgba(15, 25, 35, 0.97);
    border: 2px solid #d4af37;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
}
#wodNameInputDlg .panel h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: #2ecc71;
    font-weight: 800;
}
#wodNameInputDlg #wodNameInputDlgHint {
    margin: 0 0 10px;
    font-size: 12px;
    color: rgba(189, 195, 199, 0.92);
    line-height: 1.35;
}
#wodNameInputDlg .wod-name-input-dlg-field {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(8, 14, 22, 0.95);
    color: #ecf0f1;
    font-size: 14px;
}
#wodNameInputDlg .wod-name-input-dlg-field:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.22);
}
#wodNameInputDlg #wodNameInputDlgHint:empty {
    display: none;
}
#wodNameInputDlg .wod-save-dlg-label {
    display: block;
    font-size: 11px;
    color: rgba(189, 195, 199, 0.95);
    margin: 0 0 6px 0;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
#wodNameInputDlg .wod-editor-save-actions {
    margin-top: 14px;
    gap: 8px;
}
#wodNameInputDlg .wod-editor-save-actions .wod-editor-btn {
    min-width: 88px;
    font-weight: 800;
}
#wodNameInputDlg #wodNameInputOk {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #2ecc71;
    color: #08140d;
}

#mpGameLobbyScreen.hidden {
    display: none !important;
}
#mpLobbyBrowsePhase.hidden {
    display: none !important;
}
.mp-gl-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.mp-gl-sub {
    font-size: 13px;
    opacity: 0.9;
    margin: 4px 0 0 0;
}
.mp-gl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 14px;
    text-align: left;
}
@media (max-width: 840px) {
    .mp-gl-grid {
        grid-template-columns: 1fr;
    }
}
.mp-gl-hint {
    font-size: 12px;
    opacity: 0.82;
    margin: 0 0 10px 0;
    line-height: 1.45;
}
#mpLobbyMapPreview {
    width: 100%;
    max-width: 440px;
    height: 220px;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #154360;
}
.mp-gl-readout {
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.92;
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mp-gl-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.15);
}
.mp-gl-slot--inactive {
    opacity: 0.45;
}
.mp-gl-slot-num {
    font-weight: 800;
    min-width: 2.2em;
    color: #d4af37;
}
.mp-gl-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}
.mp-gl-swatch--lg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.mp-gl-color-wrap {
    position: relative;
    flex-shrink: 0;
}
.mp-gl-color-trigger {
    cursor: pointer;
    padding: 0;
    display: block;
}
.mp-gl-color-trigger:hover {
    border-color: rgba(255, 255, 255, 0.65);
}
.mp-gl-color-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    min-width: 148px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(18, 22, 28, 0.98);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.mp-gl-color-wrap.open .mp-gl-color-menu {
    display: flex;
}
.mp-gl-color-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.mp-gl-color-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.mp-gl-color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.85);
}
.mp-gl-color-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.mp-lb-scope {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.mp-lb-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.mp-lb-page-label {
    font-size: 13px;
    opacity: 0.88;
    min-width: 6em;
    text-align: center;
}
#mpGlHostActions {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
#mpGlHostActions.visible {
    display: flex;
}
.mp-gl-layout-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mp-gl-host-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mp-gl-launch-btn {
    background: linear-gradient(135deg, #1e8449, #27ae60) !important;
    border-color: #2ecc71 !important;
    color: #08140d !important;
    font-weight: 700;
}
.mp-host-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(160deg, rgba(0, 0, 0, 0.28), rgba(30, 60, 90, 0.18));
}
.mp-host-shell {
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 14px;
    padding: 18px 18px 16px;
    background: linear-gradient(165deg, rgba(12, 22, 34, 0.92), rgba(22, 48, 72, 0.55));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.mp-host-header {
    margin-bottom: 14px;
}
.mp-host-title {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
    color: #d4af37;
    letter-spacing: 0.02em;
}
.mp-host-sub {
    margin: 0;
    font-size: 13px;
    opacity: 0.88;
    line-height: 1.45;
}
.mp-host-form.visible {
    display: block;
    border: none;
    padding: 0;
    background: transparent;
}
.mp-host-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mp-host-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}
.mp-host-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .mp-host-field-row {
        grid-template-columns: 1fr;
    }
}
.mp-host-label {
    font-size: 14px;
    font-weight: 600;
    color: #ecf0f1;
    letter-spacing: 0.02em;
}
.mp-host-input,
.mp-host-select {
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, #2c3e50, #243342);
    color: #fff;
    border: 1px solid rgba(127, 140, 141, 0.85);
    padding: 10px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
    appearance: none;
    -webkit-appearance: none;
}
.mp-host-select {
    cursor: pointer;
    background-image: linear-gradient(180deg, #2c3e50, #243342),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d4af37' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 12px center;
    padding-right: 36px;
}
.mp-host-input:focus,
.mp-host-select:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}
.mp-host-hint {
    margin: 12px 0 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #7f9bb3;
}
.mp-host-card-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    color: #d4af37;
}
.mp-host-create-btn {
    width: 100%;
    max-width: 100%;
    margin: 16px 0 0 0 !important;
    padding: 14px 24px !important;
    font-size: 17px !important;
    background: linear-gradient(135deg, #1e8449, #27ae60) !important;
    border: 2px solid #2ecc71 !important;
    color: #08140d !important;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.mp-host-create-btn:hover {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    transform: translateY(-2px);
}

/* Multiplayer hub */
.mp-hub-panel {
    max-width: 1080px !important;
    width: min(96vw, 1080px) !important;
    padding: clamp(18px, 3vw, 36px) !important;
    text-align: left;
}
.mp-hub-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.mp-hub-head h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}
.mp-hub-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.mp-hub-pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}
.mp-hub-pill--live {
    border-color: rgba(46, 204, 113, 0.55);
    color: #b8f5c8;
}
.mp-hub-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: clamp(14px, 2.5vw, 22px);
    align-items: start;
}
@media (max-width: 860px) {
    .mp-hub-layout {
        grid-template-columns: 1fr;
    }
}
.mp-profile-card {
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: linear-gradient(160deg, rgba(0, 0, 0, 0.35), rgba(30, 39, 46, 0.85));
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mp-profile-card h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    letter-spacing: 0.02em;
}
.mp-profile-skin-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
#mpProfileSkinCanvas {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #1a252f;
    flex-shrink: 0;
}
.mp-profile-skin-label {
    font-size: 13px;
    opacity: 0.92;
    line-height: 1.35;
}
.mp-profile-skin-label strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}
.mp-profile-field {
    margin-bottom: 12px;
}
.mp-profile-field label {
    display: block;
    font-size: 12px;
    opacity: 0.82;
    margin-bottom: 4px;
}
.mp-profile-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
}
.mp-profile-field input.invalid {
    border-color: rgba(231, 76, 60, 0.85);
}
.mp-display-name-hint {
    font-size: 11px;
    opacity: 0.72;
    margin-top: 4px;
}
.mp-profile-id-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.mp-profile-id-row code {
    flex: 1;
    font-size: 12px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    word-break: break-all;
}
.mp-profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.mp-profile-stat {
    text-align: center;
    padding: clamp(8px, 2vw, 10px) 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
}
.mp-profile-stat-val {
    display: block;
    font-size: clamp(1rem, 3.5vw, 1.15rem);
    font-weight: 800;
    color: #d4af37;
    line-height: 1.2;
}
.mp-profile-share {
    margin-top: 10px;
}
.mp-profile-share button {
    width: 100%;
}
.mp-profile-stat-lbl {
    font-size: 11px;
    opacity: 0.78;
}
.mp-hub-main {
    min-width: 0;
}
.mp-hub-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.mp-hub-tab {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font: inherit;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
}
.mp-hub-tab.active {
    background: rgba(212, 175, 55, 0.22);
    border-color: rgba(212, 175, 55, 0.65);
    color: #ffeaa7;
}
.mp-hub-pane {
    display: none;
}
.mp-hub-pane.active {
    display: block;
}
.mp-hub-pane-lead {
    font-size: 13px;
    opacity: 0.88;
    line-height: 1.45;
    margin: 0 0 12px 0;
}
.mp-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
#mpLobbyList {
    max-height: min(52vh, 420px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.22);
}
.mp-lobby-row {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
}
.mp-lobby-row:last-child {
    margin-bottom: 0;
}
.mp-host-form {
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.18);
}
.mp-host-form.visible {
    display: block;
}
.mp-friends-add {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.mp-friends-add input {
    flex: 1;
    min-width: 160px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
}
#mpFriendsList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(48vh, 380px);
    overflow: auto;
}
.mp-friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.18);
    flex-wrap: wrap;
}
.mp-friend-row canvas {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.mp-friend-meta {
    flex: 1;
    min-width: 120px;
}
.mp-friend-name {
    font-weight: 700;
    font-size: 14px;
}
.mp-friend-id {
    font-size: 11px;
    opacity: 0.72;
}
.mp-friend-status {
    font-size: 11px;
    margin-top: 2px;
}
.mp-friend-status.online {
    color: #7bed9f;
}
.mp-friend-status.offline {
    opacity: 0.65;
}
.mp-friend-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mp-friend-actions button {
    font-size: 11px;
    padding: 5px 9px;
}
.mp-gl-slot--invite {
    cursor: pointer;
    border-color: rgba(46, 204, 113, 0.35);
}
.mp-gl-slot--invite:hover {
    background: rgba(46, 204, 113, 0.08);
}
.mp-profile-view {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.mp-profile-view canvas {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.mp-profile-view-stats {
    flex: 1;
    min-width: 180px;
    font-size: 14px;
    line-height: 1.55;
}
#mpStatus {
    font-size: 13px;
    min-height: 1.5em;
    opacity: 0.95;
    margin: 8px 0 0 0;
}
.mp-hub-foot {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mp-lobby-row--match {
    border-color: rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.06);
}
.mp-lobby-row--waiting {
    opacity: 0.82;
}
.mp-lobby-status {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #d4af37;
    margin-top: 2px;
}
.mp-profile-stats-actions {
    margin-top: 10px;
}
.mp-profile-stats-actions button {
    width: 100%;
}
.mp-lb-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.mp-lb-sort button.active {
    background: rgba(212, 175, 55, 0.22);
    border-color: rgba(212, 175, 55, 0.65);
    color: #ffeaa7;
}
#mpLeaderboardList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 420px);
    overflow: auto;
}
.mp-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.18);
}
.mp-lb-rank {
    font-weight: 800;
    color: #d4af37;
    min-width: 1.8em;
    text-align: center;
}
.mp-lb-row canvas {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.mp-lb-meta {
    flex: 1;
    min-width: 0;
}
.mp-lb-name {
    font-weight: 700;
    font-size: 14px;
}
.mp-lb-val {
    font-size: 12px;
    opacity: 0.85;
}
.mp-lb-val-primary {
    color: #d4af37;
    font-weight: 700;
    opacity: 1;
}
.mp-lb-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.mp-lb-add-friend {
    font-size: 11px;
    padding: 4px 10px;
    white-space: nowrap;
}
.mp-lb-friend-tag,
.mp-lb-pending-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.mp-lb-friend-tag {
    color: #7bed9f;
    border: 1px solid rgba(123, 237, 159, 0.35);
    background: rgba(39, 174, 96, 0.12);
}
.mp-lb-pending-tag {
    opacity: 0.72;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.mp-lb-status {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.mp-lb-status.online {
    color: #7bed9f;
}
.mp-lb-status.offline {
    color: #95a5a6;
    opacity: 0.85;
}
.mp-friend-row.pending-in {
    border-color: rgba(52, 152, 219, 0.45);
}
.mp-friend-row.pending-out {
    opacity: 0.78;
}
.mp-stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
@media (max-width: 520px) {
    .mp-stats-detail-grid {
        grid-template-columns: 1fr;
    }
}
.mp-stats-detail-block {
    padding: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    line-height: 1.5;
}
.mp-stats-detail-block h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #d4af37;
}

/* Generic Panels */
.panel {
    background: var(--wod-bg-panel-grad);
    border: 1px solid var(--wod-gold);
    padding: 50px;
    border-radius: var(--wod-radius-md);
    text-align: center;
    max-width: 600px;
    width: 80%;
    max-height: min(92vh, 92dvh, 960px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    box-shadow: var(--wod-shadow-panel);
}

.panel h2 {
    margin-top: 0;
    color: var(--wod-gold-bright);
    font-size: 32px;
    letter-spacing: 0.03em;
    font-weight: 800;
}

.panel p {
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 18px;
    color: var(--wod-text-muted);
}

/* Selection box */
#selectionBox {
    position: absolute;
    border: 2px dashed rgba(241, 196, 15, 0.8);
    background-color: rgba(241, 196, 15, 0.2);
    display: none;
    pointer-events: none;
    z-index: 4;
}

/* Info Card */
.info-card {
    position: absolute;
    bottom: 120px;
    right: 20px;
    z-index: 14;
    background: var(--wod-bg-panel-grad);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--wod-gold);
    padding: 14px;
    border-radius: var(--wod-radius-md);
    width: min(320px, calc(100vw - 40px));
    pointer-events: auto;
    color: #fff;
    box-shadow: var(--wod-shadow-panel);
    transition: opacity 0.2s;
    display: none;
    box-sizing: border-box;
}

.info-card.visible {
    display: flex;
    flex-direction: column;
    max-height: min(520px, calc(100vh - 100px));
}

.info-card h3 {
    margin: 0 0 2px 0;
    color: var(--wod-text);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.info-card p {
    margin: 0 0 4px 0;
    color: var(--wod-text-muted);
    font-size: 13px;
    text-transform: capitalize;
}

.info-stats {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.info-stats .info-stat-line {
    flex: none;
    width: 100%;
    min-width: 0;
    text-align: left;
    white-space: normal;
    line-height: 1.35;
}
.info-stat-extra {
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

.info-card-edge-toggle {
    display: none !important;
}

.info-card.visible .info-card-body {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.info-card-pages {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.info-card-page {
    display: none;
}

.info-card-page.info-card-page--active {
    display: block;
}

.info-card--paged .info-card-page.info-card-page--active {
    overflow: hidden;
}

.info-card-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    flex-shrink: 0;
}

.info-card-pager[hidden] {
    display: none !important;
}

.info-card-page-btn {
    appearance: none;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(24, 34, 50, 0.96);
    color: #f1c40f;
    border-radius: 8px;
    width: 32px;
    height: 28px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.info-card-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.info-card-page-label {
    flex: 1 1 auto;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.95);
}

.info-emblem-wrap {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
}

.info-emblem-wrap .unit-emblem {
    width: 100%;
    height: 100%;
    flex: none;
}

.info-veteran-badge {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f1c40f, #d4af37);
    color: #1a1200;
    font-size: 10px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.65);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.unit-xp {margin:9px 0 12px;padding:10px 12px;border:1px solid #b2954c66;border-radius:9px;background:linear-gradient(135deg,#cba34b13,#152c392e);color:#ebd79c;}
.unit-xp[hidden] {display:none;}
.unit-xp-head {display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:12px;line-height:1.5;}
.unit-xp-head strong {font-size:13px;color:#ffe5a2;}
.unit-xp-track {height:7px;background:#090f18;border-radius:4px;margin:7px 0;overflow:hidden;position:relative;box-shadow:inset 0 0 0 1px #d6ba6640;}
.unit-xp-track i {display:block;height:100%;background:linear-gradient(90deg,#a67d26,#f6d674);border-radius:4px;}
.unit-xp-track::after {content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent 24.5%,#12212e 24.5% 25.5%,transparent 25.5% 49.5%,#12212e 49.5% 50.5%,transparent 50.5%);}
.unit-xp-note {font-size:11px;line-height:1.4;color:#b8c6cb;}
.info-veteran-badge[hidden] {
    display: none !important;
}
.mp-account-options{padding:12px;border:1px solid rgba(233,195,96,.3);border-radius:12px;background:rgba(6,18,28,.65);margin:10px 0 16px;display:flex;flex-wrap:wrap;gap:8px}
.mp-account-options strong,.mp-account-options p{flex-basis:100%;margin:0}
.mp-account-options strong{color:#efcc75;font-size:13px}.mp-account-options p{font-size:12px;line-height:1.5;color:#bac9d1}
.mp-account-options button{flex:1;white-space:normal;min-height:38px}.mp-account-options [hidden]{display:none!important}

.info-record-head {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f1c40f;
    margin: 0 0 8px;
}

.info-stats-page-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0 40px 9px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.34);
}

.info-stats-name-row {
    flex: 1 1 auto;
    min-width: 0;
}

.info-stats-name-row h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-stats-back {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(16, 31, 47, 0.96);
    color: #e7bd61;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.info-record-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    font-size: 12px;
    font-weight: 700;
}

.info-record-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.info-record-item span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.9);
}

.info-record-item strong {
    font-size: 14px;
    font-weight: 800;
    color: #ecf0f1;
    font-variant-numeric: tabular-nums;
}

.info-record-item--wide {
    grid-column: 1 / -1;
}

.info-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.unit-emblem {
    position: relative;
    width: 48px;
    height: 48px;
    border: 2px solid var(--wod-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #0a0c10;
    background: #bdc3c7;
    flex: 0 0 48px;
    box-shadow: 0 0 0 2px rgba(10, 18, 28, 0.95), 0 2px 8px rgba(0, 0, 0, 0.4);
    font-size: 18px;
    letter-spacing: -0.02em;
    line-height: 1;
}

.unit-emblem[data-unit-type] {
    --unit-color: #2f7d3b;
    color: transparent !important;
    overflow: hidden;
    background:
        linear-gradient(#d9ad46, #d9ad46) calc(50% - 3px) 88% / 2px 6px no-repeat,
        linear-gradient(#d9ad46, #d9ad46) calc(50% + 3px) 88% / 2px 6px no-repeat,
        radial-gradient(circle at 34% 28%, rgba(255,255,255,0.18), transparent 34%),
        radial-gradient(circle, color-mix(in srgb, var(--unit-color) 76%, #14251a) 0 62%, #07110c 63% 100%) !important;
    border-color: #d9ad46;
    box-shadow:
        0 0 0 2px rgba(7, 15, 12, 0.98),
        0 0 0 3px rgba(217, 173, 70, 0.9),
        0 3px 10px rgba(0, 0, 0, 0.52);
}

.unit-emblem[data-unit-type]::before {
    content: '';
    position: absolute;
    left: 21%;
    top: 30%;
    width: 58%;
    height: 38%;
    box-sizing: border-box;
    border: 2px solid #f3f5e9;
    background: rgba(240, 244, 232, 0.06);
    box-shadow: 0 1px 2px rgba(0,0,0,0.65);
}

.unit-emblem[data-unit-type]::after {
    content: '';
    position: absolute;
    left: 26%;
    top: 35%;
    width: 48%;
    height: 28%;
    background:
        linear-gradient(36deg, transparent 45%, #f3f5e9 46% 53%, transparent 54%),
        linear-gradient(-36deg, transparent 45%, #f3f5e9 46% 53%, transparent 54%);
}

.unit-emblem[data-unit-type="heavy"]::before {
    left: 25%;
    top: 34%;
    width: 50%;
    height: 30%;
    border-radius: 50%;
}

.unit-emblem[data-unit-type="heavy"]::after {
    display: none;
}

#wodTransportControls {display:contents;}
.info-card.wod-has-transport-controls .info-mobile-orders {display:flex;}
#wodTransportControls .info-order-btn {width:auto;min-height:40px;}
#wodTransportControls [hidden] {display:none!important;}
#wodTransportControls [data-transport-state] {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
#wodTransportControls [data-transport-state]:empty {display:none;}
.unit-emblem[data-unit-type="transport"]::before,.unit-emblem[data-unit-type="supply"]::before {
    left:22%;top:33%;width:56%;height:34%;border:0;background:#f3f5e9;clip-path:polygon(0 12%,100% 0,100% 100%,0 88%,10% 50%);
}
.unit-emblem[data-unit-type="supply"]::after {left:36%;top:40%;width:28%;height:22%;border:2px solid #d8d2a8;background:#427f96;box-shadow:5px 0 #e8d7a4;transform:none;border-radius:1px;}
.unit-emblem[data-unit-type="transport"]::after {
    content:'1';left:43%;top:34%;width:15%;height:25%;background:none;color:#244437;font:bold 15px Arial;border:0;
}
.unit-emblem[data-unit-type="ship"]::before {
    left: 29%;
    top: 24%;
    width: 42%;
    height: 48%;
    border: 0;
    background: #f3f5e9;
    clip-path: polygon(50% 0, 100% 82%, 50% 68%, 0 82%);
}

.unit-emblem[data-unit-type="ship"]::after,
.unit-emblem[data-unit-type="convoy"]::after {
    display: none;
}

.info-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
    color: var(--wod-text-muted);
}

.info-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wod-accent-green);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.65);
    flex-shrink: 0;
}

.info-status-dot.is-busy {
    background: var(--wod-accent-blue);
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.65);
}

.info-status-dot.is-warn {
    background: #f39c12;
    box-shadow: 0 0 6px rgba(243, 156, 18, 0.65);
}

.info-status-dot.is-danger {
    background: var(--wod-danger);
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.65);
}

.info-sheet-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 2px;
}

.info-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0;
}

.info-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 6px 4px;
    border-radius: var(--wod-radius-sm);
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

button.info-kpi.info-kpi--terrain {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
button.info-kpi.info-kpi--terrain:hover,
button.info-kpi.info-kpi--terrain:focus-visible {
    border-color: rgba(241, 196, 15, 0.75);
    background: rgba(20, 34, 48, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px rgba(217, 169, 76, 0.28);
    outline: none;
}
button.info-kpi.info-kpi--terrain:active {
    transform: translateY(1px);
}
button.info-kpi.info-kpi--terrain.active {
    border-color: rgba(241, 196, 15, 0.85);
    background: rgba(30, 42, 28, 0.95);
    box-shadow: inset 0 0 0 1.5px rgba(217, 169, 76, 0.55);
}

.info-kpi-ico {
    width: 16px;
    height: 16px;
    color: var(--wod-gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-kpi-ico svg {
    width: 15px;
    height: 15px;
    display: block;
}

.info-kpi strong {
    font-size: 12px;
    font-weight: 800;
    color: var(--wod-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-align: center;
}

.info-kpi-lbl {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.78);
    line-height: 1;
}

.info-detail-block {
    display: block;
}

@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    .info-card.info-card--mobile-orders:not(.info-card--more-open) .info-card-pager,
    .info-card.info-card--mobile-orders:not(.info-card--more-open) .info-deselect-wrap {
        display: none;
    }
}

.effect-list {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-start;
}

.info-effects-scroll {
    margin-top: 8px;
    flex: 0 0 auto;
    overflow: visible;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
    padding: 6px;
    box-sizing: border-box;
}

.info-effects-scroll > .effect-list {
    max-height: 64px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.2);
}

.info-effects-scroll > .effect-list::-webkit-scrollbar {
    width: 8px;
}

.info-effects-scroll > .effect-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.info-effects-scroll > .effect-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.42);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.info-effects-scroll .effect-pill-tip,
.info-terrain-active-effects .effect-pill-tip {
    display: none;
}

#wodFxTip {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-50%);
    min-width: 168px;
    max-width: min(260px, calc(100vw - 24px));
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(10, 18, 28, 0.98);
    color: rgba(236, 240, 241, 0.96);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.38;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
    pointer-events: none;
    z-index: 20050;
}

#wodFxTip[hidden] {
    display: none !important;
}

#wodFxTip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(212, 175, 55, 0.55);
}

#wodFxTip.wod-hud-tip-panel {
    min-width: 210px;
    max-width: min(320px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 24px));
    overflow-y: auto;
    padding: 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.2);
}

#wodFxTip.wod-hud-tip-panel::-webkit-scrollbar {
    width: 8px;
}

#wodFxTip.wod-hud-tip-panel::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.42);
    border-radius: 6px;
}

.wod-hud-tip-title {
    font-size: 12px;
    font-weight: 800;
    color: #f1c40f;
    margin-bottom: 6px;
}

.wod-hud-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(236, 240, 241, 0.94);
    padding: 2px 0;
}

.wod-hud-tip-row span:last-child {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wod-hud-tip-row--expense span:last-child {
    color: #e74c3c;
}

.wod-hud-tip-row--total {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(212, 175, 55, 0.28);
    font-weight: 800;
}

.wod-hud-tip-host {
    cursor: help;
}

.info-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.info-name-row h3 {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-name-block p {
    margin: 0 0 4px 0;
    padding-left: 12px;
}

.info-name-block .info-status-row {
    padding-left: 12px;
}

.info-rename-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border-radius: 7px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: linear-gradient(180deg, rgba(24, 34, 50, 0.98), rgba(14, 22, 34, 0.96));
    color: #f1c40f;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.info-rename-btn[hidden] {
    display: none !important;
}

/* The skull beside a unit's name: disband. Red while armed (a second press within three seconds disbands). */
.info-disband-btn {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-color: rgba(231, 76, 60, 0.6);
    color: #e8a39b;
}

.info-disband-btn:hover,
.info-disband-btn:focus-visible {
    color: #ff7b6b;
    border-color: rgba(231, 76, 60, 0.9);
}

.info-disband-btn.is-armed {
    background: linear-gradient(180deg, #c0392b, #8e2219);
    border-color: #ff8a7a;
    color: #fff;
    animation: wodDisbandPulse 0.9s ease-in-out infinite;
}

@keyframes wodDisbandPulse {
    50% { box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35); }
}

@media (prefers-reduced-motion: reduce) {
    .info-disband-btn.is-armed { animation: none; }
}

.info-rename-btn:active {
    filter: brightness(1.08);
}

.effect-pill {
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.35);
    font-size: 12px;
    color: #ecf0f1;
    max-width: 100%;
    line-height: 1.35;
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.effect-pill:not(.effect-pill--block) {
    align-items: center;
}

.effect-pill-label {
    font-weight: 600;
}

.effect-pill-stat {
    font-size: 11px;
    line-height: 1.38;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
    color: rgba(189, 195, 199, 0.98);
}

.effect-pill:not(.effect-pill--block) .effect-pill-stat {
    text-align: center;
}

.effect-pill:not(.effect-pill--block) .effect-pill-label {
    text-align: center;
}

.effect-pill:not(.effect-pill--block):has(.effect-pill-stat) {
    flex-direction: column;
    align-items: stretch;
}

.effect-pill--block {
    flex: 1 1 100%;
    border-radius: 8px;
    white-space: normal;
}

.effect-pill--warn {
    border-color: rgba(231, 76, 60, 0.75);
    background: rgba(231, 76, 60, 0.14);
    color: #fdecea;
}

.effect-pill--warn .effect-pill-stat {
    color: rgba(253, 236, 234, 0.92);
}

.effect-pill--terrain .effect-pill-stat {
    color: rgba(213, 232, 245, 0.95);
}

.effect-pill--has-tip {
    position: relative;
    cursor: help;
}

.effect-pill-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 7px);
    transform: translateX(-50%) translateY(4px);
    min-width: 168px;
    max-width: min(240px, 70vw);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(10, 18, 28, 0.98);
    color: rgba(236, 240, 241, 0.96);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.38;
    text-align: left;
    white-space: normal;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.effect-pill-tip::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(212, 175, 55, 0.55);
}

@media (hover: hover) and (pointer: fine) {
    .effect-pill--has-tip:hover .effect-pill-tip,
    .effect-pill--has-tip:focus-visible .effect-pill-tip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.info-mobile-orders {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
}

.info-card.info-card--mobile-orders .info-mobile-orders {
    display: flex;
}

.info-mobile-orders-label {
    display: none;
}

.info-mobile-orders-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
}

.info-order-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    background: linear-gradient(180deg, #2a4058 0%, #1a2a3c 100%);
    color: #ecf0f1;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: var(--wod-radius-sm);
    padding: 6px 2px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.28);
    -webkit-tap-highlight-color: transparent;
}

.info-order-btn .info-order-ico {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d9a94c;
}

.info-order-btn .info-order-ico svg {
    width: 16px;
    height: 16px;
    display: block;
}

.info-order-btn.active {
    background: linear-gradient(180deg, #2ecc71 0%, #1e8449 100%);
    border-color: #58d68d;
    color: #08140d;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 0 2px rgba(46, 204, 113, 0.35);
}

.info-order-btn.active .info-order-ico {
    color: #08140d;
}

.info-order-btn[data-mo="stats"].active {
    background: linear-gradient(180deg, #f1c40f 0%, #b7950b 100%);
    border-color: #f7dc6f;
    color: #1a1400;
}

.info-order-btn[data-mo="stats"].active .info-order-ico {
    color: #1a1400;
}

.info-card--multi .info-order-btn[data-mo="stats"] {
    display: none !important;
}
.info-card--multi .info-mobile-orders-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.info-order-btn[data-mo="retreat"].active {
    background: linear-gradient(180deg, #e67e22 0%, #ca6f1e 100%);
    border-color: #f5b041;
    color: #1a1000;
}
.info-order-btn[data-mo="retreat"].active .info-order-ico {
    color: #1a1000;
}

.info-terrain-page-note {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(189, 195, 199, 0.95);
}
.info-terrain-page-body {
    max-height: min(280px, 42vh);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.info-terrain-page-body .wod-help-terrain-combat-wrap {
    max-width: none;
    margin: 0;
}

@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    .info-card--mobile-orders .info-mobile-orders {
        display: flex;
    }
    .info-card.info-card--mobile-orders .info-sheet-head {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding-right: 0;
        width: 100%;
    }
    .info-card.info-card--mobile-orders .info-identity {
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
        gap: 10px;
    }
    .info-card.info-card--mobile-orders .info-kpi-row {
        flex: 0 1 auto;
        display: grid;
        grid-template-columns: repeat(3, minmax(54px, 72px));
        gap: 7px;
        margin: 0 0 0 auto;
        justify-content: end;
    }
    .info-card.info-card--mobile-orders .info-kpi {
        min-height: 52px;
        padding: 6px 4px;
        border-radius: 10px;
        background: rgba(0, 0, 0, 0.45);
        border: 1px solid rgba(212, 175, 55, 0.4);
    }
    .info-card.info-card--mobile-orders .info-kpi strong {
        font-size: 12px;
    }
    .info-card.info-card--mobile-orders .info-kpi-lbl {
        display: none;
    }
    .info-card.info-card--mobile-orders .info-mobile-orders {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(212, 175, 55, 0.28);
    }
    .info-card.info-card--mobile-orders .info-order-btn {
        min-height: 50px;
        font-size: 9px;
        border-radius: 10px;
        background: linear-gradient(180deg, #2c4a66 0%, #1a3044 100%);
        border-color: rgba(212, 175, 55, 0.42);
        color: #ecf0f1;
    }
    .info-card.info-card--mobile-orders .info-order-btn .info-order-ico {
        color: #d9a94c;
    }
    .info-card.info-card--mobile-orders .info-order-btn.active {
        background: linear-gradient(180deg, #2ecc71 0%, #1e9e4f 100%);
        border-color: #58d68d;
        color: #08140d;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 0 2px rgba(46, 204, 113, 0.35);
    }
    .info-card.info-card--mobile-orders .info-order-btn.active .info-order-ico {
        color: #08140d;
    }
    .info-card.info-card--mobile-orders .info-status-row {
        font-size: 12px;
    }
    .info-card.info-card--mobile-orders h3 {
        font-size: 16px;
        font-weight: 800;
        color: #fff;
    }
    .info-card.info-card--mobile-orders #infoType {
        color: rgba(189, 195, 199, 0.95);
        font-size: 12px;
        margin: 0;
    }
}

@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    #inGameUI .info-card.visible {
        transition:
            bottom 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            width 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            max-width 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            min-width 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            padding 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            min-height 0.26s cubic-bezier(0.32, 0.72, 0, 1),
            max-height 0.26s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: hidden;
    }
    #inGameUI .info-card.visible .info-card-edge-toggle {
        display: none !important;
    }
    #inGameUI .info-card.visible .info-card-edge-glyph {
        display: none !important;
    }
    #inGameUI[data-infocard="peek"] .info-card.visible .info-card-body {
        visibility: visible;
        opacity: 1;
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
        pointer-events: auto;
        border: none;
        clip: auto;
    }
    #inGameUI[data-infocard="peek"] .info-card.visible .info-card-edge-toggle {
        display: none !important;
    }
}

.info-deselect-wrap {
    display: none;
}
.info-deselect-btn {
    width: 100%;
    margin-top: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(231, 76, 60, 0.65);
    background: rgba(192, 57, 43, 0.22);
    color: #fadbd8;
    box-sizing: border-box;
}
.info-deselect-btn:active {
    background: rgba(231, 76, 60, 0.38);
}
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
    #inGameUI .info-card.visible .info-deselect-wrap {
        display: block;
    }
    #inGameUI .info-card.visible .info-card-body {
        overflow: hidden;
        gap: 0;
        touch-action: pan-y;
    }
    #inGameUI .info-card.visible .info-card-pages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    #inGameUI .info-card.visible .info-effects-scroll,
    #inGameUI .info-card.visible .info-effects-scroll > .effect-list {
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    #inGameUI .info-card.visible .info-card-page.info-card-page--active {
        max-height: none;
        overflow: visible;
    }
    #inGameUI .info-card.visible .info-card-pager {
        margin-top: 0;
        padding-top: 8px;
        flex-shrink: 0;
    }
    #inGameUI .info-card.visible .info-deselect-wrap {
        flex-shrink: 0;
        margin-top: 8px;
    }
    #inGameUI .info-card--paged.visible .info-deselect-wrap {
        margin-top: 6px;
    }
    #inGameUI .info-card.visible .info-deselect-btn {
        margin-top: 0;
    }
}
/* Layer Toggles */
.layer-toggles {
    position: absolute;
    top: 84px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    align-items: flex-end;
}

.layer-btn {
    background: rgba(18, 28, 40, 0.92);
    color: #ecf0f1;
    border: 1px solid rgba(212, 175, 55, 0.55);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.layer-btn:hover {
    border-color: rgba(241, 196, 15, 0.85);
    transform: translateX(-2px);
}

.layer-btn.active {
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.95), rgba(46, 204, 113, 0.88));
    border-color: #2ecc71;
    color: #08140d;
    font-weight: 800;
}

.layer-toggles.collapsed .layer-btn:not(.layer-master) {
    display: none;
}

.layer-btn.layer-master {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    min-width: 118px;
    background: linear-gradient(160deg, rgba(30, 45, 62, 0.98), rgba(15, 25, 35, 0.95));
    border: 2px solid rgba(212, 175, 55, 0.75);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.layer-btn.layer-master:hover {
    border-color: #f1c40f;
}

/* Game Setup */
.setup-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    align-items: center;
}

.setup-row label {
    color: #fff;
    font-size: 16px;
}

.setup-row input, .setup-row select {
    background: #2c3e50;
    color: white;
    border: 1px solid #7f8c8d;
    padding: 8px;
    border-radius: 4px;
    width: 150px;
}
.setup-victory-hint {
    margin: -6px 0 15px 0;
    font-size: 0.88rem;
    color: #bdc3c7;
    line-height: 1.45;
    max-width: 100%;
    padding-right: 4px;
    box-sizing: border-box;
}
/* The computer opponents' difficulty in the battle report. */
.report-opponents .report-opp-difficulty { color: #cfd8e3; font-size: 0.9rem; margin: 0; }

#mapPreview {
    width: 100%;
    height: 200px;
    background: #154360;
    border: 2px solid #d4af37;
    margin-bottom: 20px;
    border-radius: 8px;
}

.wod-preview-shell {
    position: relative;
    width: 100%;
    margin: 0 auto 20px;
}

.wod-preview-shell #mapPreview,
.wod-preview-shell #mpLobbyMapPreview {
    margin-bottom: 0;
}

.wod-preview-busy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 8px;
    background: rgba(9, 20, 34, 0.48);
    color: rgba(237, 243, 249, 0.94);
    font: 700 13px system-ui, sans-serif;
    letter-spacing: 0.04em;
    pointer-events: none;
    z-index: 2;
}

.wod-preview-busy .wod-load-spinner {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: rgba(255, 255, 255, 0.14);
    border-top-color: rgba(200, 220, 255, 0.95);
    flex-shrink: 0;
}

.wod-preview-busy.hidden {
    display: none;
}

#shopPanel.overlay {
    justify-content: flex-start;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    padding: max(14px, env(safe-area-inset-top, 0px)) 12px max(18px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

#shopPanel .panel.panel-wide {
    width: min(640px, 100%);
    max-width: 640px;
    max-height: none;
    overflow: visible;
    padding: 26px 22px 22px;
    margin: 6px auto 14px;
    flex-shrink: 0;
    box-sizing: border-box;
}

#shopPanel .panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

#shopPanel .panel > p {
    margin-bottom: 14px;
    font-size: 16px;
}

#shopPanel .supporter-pack {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--wod-gold-line);
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.08);
}
.supporter-pack h3 {
    margin: 0 0 6px;
    color: var(--wod-gold-bright);
    font-size: 1.05rem;
}
.supporter-pack p { margin: 0 0 10px; color: #d5dde3; }
.supporter-pack .menu-btn { margin: 0; }
.supporter-pack.owned { border-color: rgba(46, 204, 113, 0.7); }
.shop-unlock-note {
    text-align: center;
}

.shop-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}
.shop-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(12, 20, 32, 0.75);
    color: #bdc3c7;
    cursor: pointer;
    font-family: inherit;
}
.shop-tab:hover { color: #ecf0f1; border-color: rgba(212, 175, 55, 0.65); }
.shop-tab.active {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.35), rgba(160, 130, 40, 0.22));
    color: #f8f4e6;
    border-color: rgba(212, 175, 55, 0.85);
    font-weight: 700;
}
.shop-tab-pane { display: none; }
.shop-tab-pane.active { display: block; }
.shop-tab-lead {
    margin: 0 0 14px;
    font-size: 0.95rem;
    color: #bdc3c7;
    line-height: 1.45;
}
.shop-subsection {
    margin: 0 0 22px;
    padding: 14px 12px 4px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 12px;
    background: rgba(8, 14, 24, 0.55);
}
.shop-subsection-title {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #5dade2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.shop-mini-label {
    margin: 12px 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.shop-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.shop-option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 12px 10px;
    border-radius: 10px;
    border: 2px solid rgba(212, 175, 55, 0.35);
    background: rgba(10, 18, 28, 0.9);
    color: #ecf0f1;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
}
.shop-option-card:hover { border-color: rgba(212, 175, 55, 0.7); }
.shop-option-card.active {
    border-color: #f1c40f;
    box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.35);
}
.shop-option-card.shop-visual-locked {
    opacity: 0.82;
}
.shop-option-card .shop-visual-footer {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
    font-size: 0.72rem;
}
.shop-option-card .shop-visual-state { color: #95a5a6; font-weight: 700; }
.shop-option-card:not(.shop-visual-locked) .shop-visual-state { color: #2ecc71; }
.shop-option-card .shop-visual-price { color: #f1c40f; font-weight: 700; }
.shop-option-card:not(.shop-visual-locked) .shop-visual-price { display: none; }
.shop-option-title { font-weight: 700; }
.shop-option-desc { font-size: 0.78rem; color: #95a5a6; }
.shop-option-badge {
    font-size: 0.72rem;
    color: #2ecc71;
    font-weight: 700;
    text-transform: uppercase;
}
.shop-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 8px;
}
.shop-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(10, 18, 28, 0.9);
    color: #ecf0f1;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
}
.shop-color-swatch .swatch-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
    background: var(--swatch, #f1c40f);
}
.shop-color-swatch.active {
    border-color: #f1c40f;
    box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.4);
}
.shop-color-swatch .shop-swatch-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shop-color-swatch .shop-visual-footer {
    width: 100%;
}
.shop-color-swatch.shop-visual-locked .shop-visual-state { color: #95a5a6; }
.shop-color-swatch:not(.shop-visual-locked) .shop-visual-footer { display: none; }
.shop-empty-state {
    padding: 28px 16px;
    text-align: center;
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    color: #95a5a6;
    background: rgba(8, 14, 24, 0.45);
}

.shop-map-card {
    flex-direction: column;
    align-items: stretch;
    min-height: 168px;
    padding: 10px;
}
.shop-map-card .shop-map-preview {
    width: 100%;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a252f;
    margin-bottom: 8px;
}
.shop-map-card .shop-map-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-map-card .shop-map-meta {
    text-align: left;
    width: 100%;
}
.shop-map-card .shop-option-desc {
    margin-top: 4px;
    line-height: 1.35;
}
.shop-option-preview {
    display: block;
    width: 100%;
    height: 40px;
    border-radius: 6px;
    margin-bottom: 2px;
    background: rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}
#shopTabCommand .shop-option-preview {
    background: linear-gradient(135deg, #2c3e50 0%, #3d566e 48%, #4a6b85 100%);
    border: 1px solid rgba(93, 173, 226, 0.22);
}
.map-skin-preview-hd {
    background: repeating-linear-gradient(153deg,transparent 0 12px,#d5ccb514 13px 14px,transparent 15px 28px),radial-gradient(ellipse at 74% 34%,#c3c1a7 0,#7c8067 13%,transparent 31%),radial-gradient(ellipse at 35% 60%,#304e38 0,#5e7352 29%,transparent 46%),linear-gradient(125deg,#284959 0 23%,#72958d 24%,#b1aa88 27%,#7c855b 40%,#555f47 72%,#a19e81);
    box-shadow:inset 0 0 18px #091d2466;
}
.map-skin-preview-default {
    background: linear-gradient(135deg, #2d6a4f 0%, #40916c 40%, #74c69d 70%, #1b4332 100%);
}
#shopTabCommand {
    --shop-frontline-color: #050505;
    --shop-command-color: #050505;
}
.frontline-preview-solid::after,
.frontline-preview-dotted::after,
.frontline-preview-dashed::after,
.frontline-preview-dashdot::after,
.frontline-preview-thick::after,
.frontline-preview-glow::after,
.frontline-preview-double::before,
.frontline-preview-double::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    height: 3px;
    border-radius: 2px;
    background: var(--shop-frontline-color, #050505);
}
.frontline-preview-solid::after {
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
}
.frontline-preview-dotted::after {
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--shop-frontline-color, #050505) 0 7px, transparent 7px 15px);
}
.frontline-preview-dashed::after {
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--shop-frontline-color, #050505) 0 30px, transparent 30px 38px);
}
.frontline-preview-dashdot::after {
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--shop-frontline-color, #050505) 0 14px, transparent 14px 18px, var(--shop-frontline-color, #050505) 18px 22px, transparent 22px 26px);
}
.frontline-preview-thick::after {
    top: 50%;
    transform: translateY(-50%);
    height: 8px;
    border-radius: 4px;
}
.frontline-preview-glow::after {
    top: 50%;
    transform: translateY(-50%);
    height: 5px;
    box-shadow: 0 0 10px 3px color-mix(in srgb, var(--shop-frontline-color, #050505) 58%, transparent);
}
.frontline-preview-double::before,
.frontline-preview-double::after {
    height: 3px;
}
.frontline-preview-double::before { top: 13px; }
.frontline-preview-double::after { top: 24px; }
#shopCommandStyleOptions canvas.shop-option-preview {
    width: 100%;
    height: 44px;
    display: block;
}

#shopPanel .skin-grid-scroll {
    max-height: none;
    overflow: visible;
    margin: 10px 0 16px;
}

.skin-grid-scroll {
    padding: 10px 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(10, 18, 28, 0.88), rgba(6, 12, 20, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.2);
}

.skin-grid-scroll::-webkit-scrollbar {
    width: 11px;
}

.skin-grid-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.skin-grid-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin: 6px 4px 2px;
}

@media (orientation: portrait) and (max-width: 640px) {
    .skin-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        max-width: min(320px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    #shopPanel .skin-card {
        width: min(100%, 300px);
    }
    canvas.skin-preview {
        width: 120px !important;
        height: 80px !important;
        max-width: 100%;
        flex-shrink: 0;
    }
}

@media (max-width: 900px) {
    #shopPanel .panel.panel-wide {
        width: min(560px, 94vw);
        padding: 22px 16px 20px;
    }
    .skin-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        max-width: min(480px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    .skin-card {
        width: 100%;
        max-width: 220px;
        justify-self: center;
    }
    canvas.skin-preview {
        width: 120px !important;
        height: 80px !important;
        max-width: 100%;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .skin-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.shop-equip-row {
    display: none;
}

.shop-preview-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: min(460px, 100%);
    margin: 6px auto 18px;
    align-items: stretch;
}

.shop-preview-card {
    background: rgba(8, 16, 26, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    padding: 14px 12px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-preview-card h4 {
    margin: 0;
    font-size: 13px;
    color: #f1c40f;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.shop-preview-card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.shop-color-picker {
    position: relative;
    flex-shrink: 0;
}

.shop-color-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 8px;
    background: rgba(8, 16, 26, 0.95);
    cursor: pointer;
}

.shop-color-picker-trigger:hover {
    border-color: rgba(46, 204, 113, 0.85);
}

.shop-color-picker-swatch {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 2px solid #0a1520;
    box-sizing: border-box;
    background: #2ecc71;
    display: block;
}

.shop-color-picker-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 65;
    min-width: 148px;
    padding: 6px;
    background: rgba(12, 22, 34, 0.98);
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.shop-color-picker-menu.open {
    display: block !important;
}

.shop-color-picker-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 2px 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #ecf4fa;
    font: inherit;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
}

.shop-color-picker-option:hover {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.45);
}

.shop-color-picker-option.active {
    border-color: rgba(241, 196, 15, 0.65);
    background: rgba(241, 196, 15, 0.08);
}

.shop-color-picker-option .shop-color-picker-swatch {
    width: 18px;
    height: 18px;
}

.shop-skin-picker {
    position: relative;
    margin: 0 auto;
    max-width: 340px;
    width: 100%;
}

.shop-skin-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #2c4962, #1f334a);
    color: #f2f8fd;
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.shop-skin-picker-trigger:hover {
    border-color: rgba(46, 204, 113, 0.85);
}

.shop-skin-picker-flag {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 2px solid #0a1520;
    border-radius: 8px;
    box-sizing: border-box;
    background: #2ecc71;
    display: block;
}

canvas.shop-skin-picker-flag {
    background: #0f1823;
}

.shop-skin-option-canvas {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 2px solid #0a1520;
    border-radius: 8px;
    box-sizing: border-box;
    background: #0f1823;
    display: block;
}

.shop-skin-picker-flag.ball-preview {
    border-radius: 50%;
    overflow: hidden;
}

.shop-skin-picker-flag.nato-preview {
    border-radius: 5px;
    background: #d9e8f5;
    position: relative;
}

.shop-skin-picker-flag.nato-preview::after {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-weight: 900;
    font-size: 22px;
    line-height: 1;
}

.shop-skin-picker-flag.shop-thumb-default,
.shop-skin-option-flag.shop-thumb-default {
    background: linear-gradient(145deg, #2ecc71 0%, #3498db 100%);
    border-radius: 8px;
    position: relative;
}

.shop-skin-picker-flag.shop-thumb-default::after,
.shop-skin-option-flag.shop-thumb-default::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 4px;
    background: repeating-linear-gradient(
        90deg,
        #ecf0f1 0 28%,
        #7f8c8d 28% 52%,
        #f1c40f 52% 74%,
        #2c3e50 74% 100%
    );
    opacity: 0.95;
}

.shop-skin-picker-label {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.shop-skin-picker-caret {
    flex-shrink: 0;
    opacity: 0.85;
    font-size: 12px;
}

.shop-skin-picker-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(12, 22, 34, 0.98);
    border: 2px solid rgba(212, 175, 55, 0.55);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.shop-skin-picker-menu.open {
    display: block !important;
}

.shop-skin-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 2px 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #ecf4fa;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.shop-skin-option:hover:not(:disabled) {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.45);
}

.shop-skin-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.shop-skin-option-own {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 7px;
    border-radius: 6px;
}

.shop-skin-option-own.yes {
    background: rgba(46, 204, 113, 0.25);
    color: #9fffc8;
    border: 1px solid rgba(46, 204, 113, 0.55);
}

.shop-skin-option-own.no {
    background: rgba(192, 57, 43, 0.2);
    color: #f5b8b2;
    border: 1px solid rgba(231, 76, 60, 0.45);
}

.shop-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 1px, 1px) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.shop-unit-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.shop-unit-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.shop-unit-cell-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(220, 230, 238, 0.72);
    line-height: 1.1;
}

.shop-mini-canvas {
    width: 100%;
    max-width: 72px;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 30%, rgba(30, 60, 85, 0.6), rgba(10, 14, 22, 0.95));
    border: 2px solid #050505;
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .shop-preview-card {
        padding: 12px 10px 14px;
    }
    .shop-unit-strip {
        gap: 4px;
        padding: 6px 4px;
    }
    .shop-mini-canvas {
        max-width: 58px;
    }
    .shop-unit-cell-label {
        font-size: 8px;
    }
}

@media (min-width: 900px) {
    .shop-preview-row {
        max-width: 500px;
    }
    .shop-mini-canvas {
        max-width: 80px;
    }
}

.shop-unlock-note {
    color: rgba(220,230,238,.82);
    font-size: 14px;
    margin-bottom: 8px;
    text-align: left;
}

.skin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    background: rgba(15, 25, 35, 0.8);
    border: 2px solid #7f8c8d;
    color: #fff;
    padding: 14px 12px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.skin-card:hover,
.skin-card.active {
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.35);
    transform: translateY(-2px);
}

.skin-card.skin-owned {
    border-color: rgba(46, 204, 113, 0.75);
    box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.2);
}

.skin-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 2px;
}

.skin-card-state {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
}

.skin-card.skin-owned .skin-card-state {
    color: #bff5dc;
}

.skin-card.skin-missing:not(.skin-owned) .skin-card-state {
    color: #f0c8c8;
}

.skin-card-price {
    font-size: 12px;
    font-weight: 800;
    color: #f1c40f;
    line-height: 1.2;
    min-height: 14px;
    letter-spacing: 0.03em;
}

.skin-card.skin-owned .skin-card-price {
    color: rgba(210, 220, 230, 0.45);
    font-weight: 600;
    font-size: 11px;
}

.skin-card.locked {
    opacity: 1;
    border-color: #8e6f23;
}

.skin-card.skin-no-buy {
    cursor: default;
    border-color: #576574;
}

.skin-card.skin-no-buy:hover {
    transform: none;
    border-color: #576574;
    box-shadow: none;
}

.ach-card.ach-secret.locked {
    opacity: 0.65;
    border-style: dashed;
    filter: grayscale(0.2);
}

.ach-card.ach-secret .ach-icon {
    font-size: 26px;
    font-weight: bold;
    color: #7f8c8d;
}

.shop-skin-option-flag {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 2px solid #050505;
    border-radius: 8px;
    box-sizing: border-box;
    background: #2ecc71;
}

.shop-skin-option-flag.ball-preview {
    border-radius: 50%;
    overflow: hidden;
}

.shop-skin-option-flag.nato-preview {
    border-radius: 5px;
    background: #d9e8f5;
    position: relative;
}

.shop-skin-option-flag.nato-preview::after {
    content: "✕";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
}

.skin-preview {
    width: 120px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 8px;
    background: #0f1823;
    border: 3px solid #050505;
    box-sizing: border-box;
    position: relative;
    display: block;
}

canvas.skin-preview {
    padding: 0;
}

.skin-preview.ring {
    border-radius: 50%;
    background: radial-gradient(circle, #154360 35%, #2ecc71 38%);
}

.skin-preview.fort {
    clip-path: polygon(12% 22%, 28% 22%, 28% 8%, 44% 8%, 44% 22%, 56% 22%, 56% 8%, 72% 8%, 72% 22%, 88% 22%, 88% 88%, 12% 88%);
}

.credits-intro {
    color: rgba(220, 230, 238, 0.88);
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 18px;
}

.credits-list {
    display: grid;
    gap: 16px;
    margin: 8px 0 22px;
    text-align: left;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.credit-card {
    background: linear-gradient(145deg, rgba(22, 36, 52, 0.95), rgba(12, 22, 34, 0.92));
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.credit-card.company-card {
    border-color: rgba(46, 204, 113, 0.55);
    text-align: center;
}

.credit-company {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #ecf0f1;
    margin-bottom: 6px;
}

.credit-tagline {
    color: #95a5a6;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.credit-role {
    color: #f1c40f;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.credit-name {
    color: #ecf0f1;
    font-size: 17px;
    font-weight: 600;
}

.credit-thanks { color: rgba(220,230,238,.9); font-size: 14px; line-height: 1.6; margin: 12px 0 0; }

.credit-name.credit-music-body {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(236, 240, 241, 0.92);
}

#creditsPanel .panel.panel-wide {
    max-width: 720px;
    max-height: min(calc(100svh - 40px), calc(100dvh - 40px));
    overflow: auto;
}

.credits-music-list {
    margin: 8px 0 0;
    padding-left: 1.15em;
    display: grid;
    gap: 6px;
}

.credits-music-list li {
    color: rgba(220, 230, 238, 0.9);
}
.credit-name.credit-music-body p { font-size: 13px; font-weight: 500; line-height: 1.6; margin: 8px 0; }
.credit-music-body a { color: #85d0ff; text-underline-offset: 2px; }
.credit-music-body a:hover { color: #f7dc6f; }
.credit-music-body a:focus-visible { outline: 2px solid #f1c40f; outline-offset: 3px; }

.credits-music-attr {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(241, 196, 15, 0.28);
    color: #f7dc6f;
    font-size: 12px;
    line-height: 1.45;
}

.panel-wide {
    max-width: 640px;
}

.achievements-panel.panel-wide {
    max-width: 760px;
    max-height: min(calc(100svh - 40px), calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.achievements-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.achievements-panel-top h2 {
    margin: 0;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.ach-panel-back {
    flex-shrink: 0;
    width: auto !important;
    min-width: 100px;
    margin: 0 !important;
    padding: 12px 20px !important;
}

.achievements-panel > .credits-intro {
    flex-shrink: 0;
}

.achievements-panel > .credits-intro {
    margin-top: 0;
}

.achievements-panel .ach-tab-bar {
    flex-shrink: 0;
}

.ach-panels-stack {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.ach-tab-bar {
    display: flex;
    gap: 8px;
    margin: 16px 0 14px;
}

.ach-tab {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(25, 35, 48, 0.9);
    color: #dbe6ee;
    font-weight: 700;
    cursor: pointer;
}

.ach-tab:hover {
    border-color: #2ecc71;
}

.ach-tab.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #08140d;
    border-color: #2ecc71;
}

.ach-tab-panel {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    text-align: left;
}

.ach-tab-panel.active {
    display: flex;
}

.ach-panel-scroll {
    flex: 1 1 auto;
    min-height: 200px;
    max-height: min(52vh, 500px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 18px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(12, 20, 30, 0.92), rgba(8, 14, 22, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.35);
    text-align: left;
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.2);
}

html, body, * {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.45) rgba(0, 0, 0, 0.22);
}
*::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}
*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}
*::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.42);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
    background: transparent;
}

.ach-panel-scroll::-webkit-scrollbar {
    width: 11px;
}

.ach-panel-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 6px 0;
}

.ach-panel-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.42);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.ach-grid {
    display: grid;
    gap: 14px;
}

.ach-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    align-items: start;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(127, 140, 141, 0.45);
    background: rgba(18, 28, 40, 0.82);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ach-card.unlocked {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.12);
}

.ach-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.ach-icon .ach-art {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}

.ach-card.unlocked .ach-icon {
    background: rgba(46, 204, 113, 0.18);
    border-color: rgba(46, 204, 113, 0.35);
}

.ach-icon:has(.ach-art) {
    background: transparent;
    border: none;
}

.ach-title {
    font-weight: 800;
    color: #ecf0f1;
    margin-bottom: 6px;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.ach-desc {
    color: #a8b8c4;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.ach-progress-track {
    height: 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin-bottom: 6px;
}

.ach-progress-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #c9a227, #f1c40f);
    transition: width 0.25s ease;
}

.ach-card.unlocked .ach-progress-fill {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.ach-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #7f8c9a;
    font-variant-numeric: tabular-nums;
}

.ach-progress-footer strong {
    color: #d4e0ea;
    font-weight: 700;
}

.stats-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.stats-section {
    border: 1px solid rgba(127, 140, 141, 0.35);
    border-radius: 12px;
    padding: 14px 16px 16px;
    background: rgba(14, 22, 32, 0.65);
}

.stats-section-title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f1c40f;
    opacity: 0.95;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.stats-combat-split {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stats-combat-sub {
    margin: 0 0 8px 2px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.78);
}

.stats-grid.stats-grid--combat-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 700px) {
    .stats-grid.stats-grid--combat-row {
        grid-template-columns: 1fr;
    }
}

.stat-cell {
    background: rgba(12, 20, 30, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 10px;
    padding: 12px 14px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: #95a5a6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
    line-height: 1.3;
}

.stat-value {
    color: #ecf0f1;
    font-size: 19px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.settings-section {
    text-align: left;
    margin: 18px 0;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(231, 76, 60, 0.35);
    background: rgba(35, 20, 20, 0.25);
}

.settings-section p {
    color: rgba(220, 230, 238, 0.88);
    line-height: 1.45;
    margin-bottom: 12px;
}
.settings-section.wod-local-save-section {
    border-color: rgba(52, 152, 219, 0.45);
    background: rgba(12, 28, 42, 0.35);
}
.wod-music-transport {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    max-width: 520px;
}
.wod-music-transport .menu-btn {
    margin: 0;
    padding: 8px 14px;
    min-width: 0;
    font-size: 0.9rem;
}
.wod-music-track {
    width: 100%;
    max-width: 520px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(241, 196, 15, 0.35);
    background: rgba(20, 18, 12, 0.55);
    color: #f5f0e6;
    font: inherit;
}
.wod-music-now-row {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #d5d8dc;
    max-width: 520px;
}
.wod-music-now {
    color: #f7dc6f;
    font-weight: 600;
}
.wod-save-folder-status {
    font-size: 0.9rem;
    color: #bdc3c7;
    margin: 0 0 10px 0;
}
.wod-save-folder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.wod-save-slot-create {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.wod-save-slot-create input {
    flex: 1;
    min-width: 160px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(127, 140, 141, 0.5);
    background: rgba(0, 0, 0, 0.35);
    color: #ecf0f1;
}
.wod-save-file-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(127, 140, 141, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    padding: 6px;
}
.wod-save-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}
.wod-save-file-row:last-child { border-bottom: none; }
.wod-save-file-row .menu-btn { padding: 6px 12px; font-size: 0.82rem; }
.wod-save-list-empty {
    margin: 8px;
    font-size: 0.88rem;
    color: #95a5a6;
}

.terrain-key {
    position: absolute;
    left: 18px;
    top: 96px;
    background: rgba(15, 25, 35, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.8);
    border-radius: 8px;
    padding: 8px 10px 10px;
    min-width: 130px;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.player-summary {
    position: absolute;
    left: 18px;
    top: 360px;
    background: rgba(15, 25, 35, 0.78);
    border: 1px solid rgba(212, 175, 55, 0.8);
    border-radius: 8px;
    padding: 8px 10px 10px;
    min-width: 300px;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.player-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

#playerSummaryToggle,
#terrainKeyToggle {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 5px;
    border: 1px solid rgba(241, 196, 15, 0.65);
    background: rgba(30, 42, 54, 0.95);
    color: #f1c40f;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#playerSummaryToggle:hover,
#terrainKeyToggle:hover {
    background: rgba(241, 196, 15, 0.2);
}

.player-summary h4,
.terrain-key-header h4 {
    margin: 0;
    flex: 1;
    color: #f1c40f;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.player-summary.collapsed #playerSummaryBody {
    display: none;
}

.terrain-key.collapsed #terrainKeyBody {
    display: none;
}

.player-summary.collapsed,
.terrain-key.collapsed {
    min-width: 0;
    width: max-content;
    max-width: 100%;
    padding: 4px 6px 5px;
}

.player-summary.collapsed .player-summary-header,
.terrain-key.collapsed .terrain-key-header {
    margin-bottom: 0;
}

.player-summary.collapsed #playerSummaryToggle,
.terrain-key.collapsed #terrainKeyToggle {
    width: 20px;
    height: 20px;
    font-size: 13px;
    border-radius: 4px;
}

.player-summary.collapsed h4,
.terrain-key.collapsed .terrain-key-header h4 {
    flex: 0 1 auto;
}

.terrain-key-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.player-row {
    display: grid;
    grid-template-columns: 14px minmax(48px, 1fr) minmax(9ch, 1.15fr) minmax(10ch, 1.35fr) minmax(6ch, 0.95fr) minmax(6ch, 0.85fr) 10px;
    align-items: center;
    gap: 8px;
    margin: 3px 0;
    color: #ecf0f1;
    font-size: 11px;
}

.player-row span:nth-child(n + 3) {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    text-align: right;
    white-space: nowrap;
}

.player-row.header {
    color: #f1c40f;
    font-weight: 800;
    border-bottom: 1px solid rgba(241, 196, 15, 0.35);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.player-row.loss-row {
    color: #bdc3c7;
    opacity: 0.95;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.player-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.85);
}

.terrain-key-row, .help-terrain-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    color: #ecf0f1;
    font-size: 13px;
    text-transform: capitalize;
}

.terrain-swatch {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0,0,0,0.8);
    border-radius: 3px;
    flex: 0 0 16px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.terrain-swatch svg {
    width: 100%;
    height: 100%;
    display: block;
}

.esc-menu {
    z-index: 20;
    background: rgba(0, 0, 0, 0.72);
}

#escMenu,
#statsMenu {
    z-index: 30;
    pointer-events: auto;
}
/* Keep pause menu above deploy / end-countdown banners and toast notes. */
#escMenu:not(.hidden) {
    z-index: 80;
}
.wod-toast-note {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(620px, calc(100vw - 28px));
    box-sizing: border-box;
    text-align: center;
    background-color: rgba(180, 55, 42, 0.96);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 70;
    pointer-events: none;
}
.wod-toast-note[data-tone="success"] { background: #205642f5; border: 1px solid #6ac69b; }
.wod-toast-note[data-tone="info"] { background: #183747f5; border: 1px solid #79a7bc; }
#escMenu:not(.hidden) ~ .wod-toast-note,
body.wod-esc-open .wod-toast-note,
body.wod-esc-open #wodEndCountdownBanner,
body.wod-esc-open #wodDeployBanner {
    display: none !important;
}

.stats-menu .stats-menu-panel {
    width: min(960px, 94vw);
    max-width: 960px;
    max-height: min(92vh, 900px);
    overflow-y: auto;
    text-align: left;
    padding: 28px 32px 36px;
    box-sizing: border-box;
}
.stats-menu .stats-menu-panel > h2 {
    text-align: center;
}
.stats-menu .esc-actions {
    margin-bottom: 14px;
}
.stats-menu .wod-m-sheet-banner {
    display: none;
}
.stats-menu .wod-m-intel-bundle {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    min-width: 0;
}
.stats-menu .wod-m-sheet--intel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stats-menu .stats-m-tabs {
    display: none;
}
.stats-menu .stats-m-pages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.stats-menu .stats-m-page {
    min-width: 0;
}
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .stats-menu .stats-menu-panel {
        width: min(100%, calc(100vw - 16px));
        max-width: none;
        max-height: min(94dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px));
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(16px, env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .stats-menu .stats-menu-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .stats-menu .stats-m-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        padding-bottom: 2px;
    }
    .stats-menu .stats-m-tab {
        flex: 1 1 0;
        min-width: 72px;
        appearance: none;
        border: 1px solid rgba(212, 175, 55, 0.45);
        border-radius: 10px;
        background: rgba(12, 20, 32, 0.92);
        color: rgba(236, 240, 241, 0.92);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        padding: 10px 8px;
        cursor: pointer;
    }
    .stats-menu .stats-m-tab.active {
        background: linear-gradient(160deg, rgba(241, 196, 15, 0.95), rgba(212, 175, 55, 0.82));
        border-color: rgba(255, 230, 150, 0.85);
        color: #1a1103;
    }
    .stats-menu .stats-m-pages {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        gap: 0;
    }
    .stats-menu .stats-m-page {
        display: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: min(68dvh, calc(100dvh - 200px));
        padding: 4px 2px 8px;
    }
    .stats-menu .stats-m-page.active {
        display: block;
    }
    .stats-menu .wod-m-intel-bundle {
        gap: 12px;
    }
    .stats-menu .wod-m-sheet--intel {
        gap: 12px;
    }
    .stats-menu .wod-m-sheet-banner {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px;
        border-radius: 11px;
        background: rgba(8, 14, 24, 0.88);
        border: 1px solid rgba(212, 175, 55, 0.38);
    }
    .stats-menu .resources {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        overflow: visible;
        padding-bottom: 0;
    }
    .stats-menu .resources-divider {
        display: none;
    }
    .stats-menu .resource-combat-split {
        flex-direction: column;
        gap: 10px;
    }
    .stats-menu .resources-divider-inline {
        display: none;
    }
    .stats-menu .player-summary {
        margin-top: 4px;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .stats-menu #playerSummaryBody {
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row.header {
        display: none;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row {
        display: grid;
        grid-template-columns: 12px 1fr;
        gap: 4px 10px;
        align-items: center;
        padding: 10px 12px;
        margin: 0 0 10px;
        border-radius: 10px;
        background: rgba(8, 14, 24, 0.75);
        border: 1px solid rgba(212, 175, 55, 0.28);
        min-width: 0;
        font-size: 11px;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row.loss-row {
        margin-top: -8px;
        margin-bottom: 12px;
        padding-top: 6px;
        padding-bottom: 10px;
        border-bottom: none;
        background: rgba(6, 10, 18, 0.55);
        border-style: dashed;
        opacity: 0.92;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row .player-dot {
        grid-row: 1 / span 6;
        align-self: start;
        margin-top: 2px;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row .player-name {
        grid-column: 2;
        font-weight: 800;
        font-size: 12px;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row .player-stat {
        grid-column: 2;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 10px;
        text-align: right;
        white-space: normal;
        font-size: 10px;
        color: rgba(236, 240, 241, 0.92);
    }
    #statsMenu.stats-menu .wod-m-sheet--intel .player-row .player-stat::before {
        content: attr(data-label);
        flex: 1 1 auto;
        text-align: left;
        opacity: 0.68;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
.stats-menu .resources {
    flex-wrap: wrap;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 6px;
}
.stats-menu .player-summary {
    position: static !important;
    top: auto !important;
    left: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: auto !important;
}

.esc-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.esc-section {
    display: none;
    text-align: left;
    background: rgba(15, 25, 35, 0.55);
    border: 1px solid rgba(127, 140, 141, 0.55);
    border-radius: 8px;
    padding: 15px;
    max-height: 320px;
    overflow-y: auto;
}

.esc-section.esc-help-panel {
    max-height: min(88vh, 720px);
}

.esc-section.visible {
    display: block;
}

.esc-full-help-guide h2 {
    margin-top: 0;
}

/* Game guide: the main menu panel (#helpGuidePanel), also copied into the pause menu's Help section (#escFullHelpGuide). */
#helpGuidePanel .help-guide.panel {
    width: min(940px, 96vw);
    max-width: 940px;
    max-height: min(94vh, 94dvh, 980px);
    margin: auto;
    padding: 0 30px 24px;
    text-align: left;
}
#helpGuidePanel .help-guide.panel:focus,
.help-guide-toc:focus,
.help-guide-section:focus {
    outline: none;
}
#escFullHelpGuide {
    text-align: left;
}
.help-guide-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px 12px;
    margin: 0 -30px 16px;
    padding: 14px 30px 12px;
    background: #111c28;
    border-bottom: 1px solid var(--wod-gold-line);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}
#escFullHelpGuide .help-guide-toc,
#escFullHelpGuide .help-guide-section {
    scroll-margin-top: 92px;
}
#escFullHelpGuide .help-guide-head {
    /* Stick at the Help section's edge, over its padding (15px, or 18px on wide screens). */
    top: -15px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--wod-gold-line);
    border-radius: var(--wod-radius-sm);
}
@media (min-width: 901px) {
    #escFullHelpGuide .help-guide-head {
        top: -18px;
    }
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-head h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}
.help-guide-head-link {
    padding: 8px 10px;
    border-radius: 8px;
    color: #9fd0f0;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.help-guide-head-link:hover,
.help-guide-head-link:focus-visible {
    background: rgba(52, 152, 219, 0.18);
    color: #fff;
    outline: none;
}
.help-guide-close {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid var(--wod-gold-line);
    border-radius: var(--wod-radius-sm);
    background: linear-gradient(180deg, #2a3a4d 0%, #1a2533 100%);
    color: var(--wod-text);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.help-guide-close:hover,
.help-guide-close:focus-visible {
    background: linear-gradient(180deg, #2ecc71 0%, #219a52 100%);
    border-color: var(--wod-accent-green);
    color: #08140d;
    outline: none;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-intro {
    margin: 0 0 14px;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--wod-text);
}
.help-guide-toc {
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    scroll-margin-top: 80px;
}
.help-guide-toc ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: help-guide-toc;
}
.help-guide-toc li {
    margin: 0;
    counter-increment: help-guide-toc;
}
.help-guide-toc a {
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
    color: #d6e6f2;
    font-size: 14.5px;
    line-height: 1.3;
    text-decoration: none;
}
.help-guide-toc a::before {
    content: counter(help-guide-toc);
    min-width: 1.5em;
    color: var(--wod-gold-bright);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.help-guide-toc a:hover,
.help-guide-toc a:focus-visible {
    background: rgba(52, 152, 219, 0.18);
    color: #fff;
    outline: none;
}
.help-guide-section {
    margin-top: 10px;
    padding: 4px 0 10px;
    border-top: 1px solid rgba(127, 140, 141, 0.3);
    scroll-margin-top: 76px;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 10px;
    color: var(--wod-gold-bright);
    font-size: 21px;
    line-height: 1.25;
}
.help-guide-num {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--wod-gold-line);
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.14);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section h4 {
    margin: 18px 0 6px;
    color: #6cb8e6;
    font-size: 16px;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > p,
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-mapkey > p,
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ul > li,
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ol > li {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #d3dce2;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ul > li,
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ol > li {
    margin-bottom: 5px;
}
.help-guide-section > ul,
.help-guide-section > ol {
    margin: 0 0 12px;
    padding-left: 1.35em;
}
.help-guide-steps > li::marker {
    color: var(--wod-gold-bright);
    font-weight: 700;
}
:is(#helpGuidePanel, #escFullHelpGuide) strong {
    font-weight: 700;
    color: #f4f7f9;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section a {
    color: #8fc9ee;
}
:is(#helpGuidePanel, #escFullHelpGuide) kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 6px;
    border: 1px solid #6f8494;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #1b2836;
    color: #fff;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1.55;
    text-align: center;
    white-space: nowrap;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > p.help-guide-tip {
    padding: 10px 14px;
    border-left: 3px solid var(--wod-gold);
    border-radius: 0 8px 8px 0;
    background: rgba(212, 175, 55, 0.08);
}
.help-guide-table-wrap {
    max-width: 100%;
    margin: 6px 0 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    background: rgba(5, 10, 16, 0.35);
}
.help-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #e1e8ec;
}
.help-guide-table th,
.help-guide-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(127, 140, 141, 0.22);
    text-align: left;
    vertical-align: top;
    line-height: 1.45;
}
.help-guide-table thead th {
    background: rgba(26, 39, 53, 0.95);
    color: var(--wod-gold-bright);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: bottom;
}
.help-guide-table tbody th {
    color: #fff;
    font-weight: 700;
}
.help-guide-table tbody tr:last-child > * {
    border-bottom: none;
}
.help-guide-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.help-guide-table--stack tbody th {
    width: 10rem;
}
.help-guide-table .help-guide-total > * {
    border-top: 1px solid var(--wod-gold-line);
    color: var(--wod-gold-bright);
}
.help-guide-units tbody th,
.help-guide-terrain tbody th {
    white-space: nowrap;
    vertical-align: middle;
}
.help-guide-units td[data-label="Cost"] {
    white-space: nowrap;
}
.help-guide-unit-icon {
    width: 34px;
    height: 34px;
    margin: -4px 10px -4px 0;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: #0f1823;
}
.help-guide-terrain .terrain-swatch {
    margin-right: 8px;
    vertical-align: -3px;
}
.help-guide-swatch-bridge {
    background: repeating-linear-gradient(90deg, #8a6a43 0 3px, #5d452b 3px 5px);
}
.help-guide-figure {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 4px 0 14px;
}
.help-guide-figure canvas {
    flex: 0 0 auto;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: #0f1823;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-guide-figure figcaption {
    flex: 1 1 200px;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #bdc3c7;
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-effects-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}
:is(#helpGuidePanel, #escFullHelpGuide) .help-effect-card-note {
    margin: 8px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
}
/* The map key lists the last generated map's terrain; hide it until there is one. */
.help-guide-mapkey:has(.help-terrain-grid:empty) {
    display: none;
}
.help-guide-foot {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.help-guide-foot .menu-btn {
    margin: 0;
}
@media (max-width: 760px) {
    .help-guide-toc ol {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* Wide tables become one card per row; each cell shows its column name. */
    .help-guide-table--cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .help-guide-table--cards,
    .help-guide-table--cards tbody,
    .help-guide-table--cards tr {
        display: block;
        width: 100%;
    }
    .help-guide-table--cards tr {
        padding: 10px 12px;
        border-bottom: 1px solid rgba(127, 140, 141, 0.22);
        box-sizing: border-box;
    }
    .help-guide-table--cards tbody tr:last-child {
        border-bottom: none;
    }
    .help-guide-table.help-guide-table--cards th,
    .help-guide-table.help-guide-table--cards td {
        display: block;
        padding: 2px 0;
        border: none;
        text-align: left;
    }
    .help-guide-table.help-guide-table--cards tbody th {
        padding-bottom: 6px;
        font-size: 15px;
    }
    .help-guide-table.help-guide-table--cards td {
        display: flex;
        gap: 12px;
    }
    .help-guide-table--cards td::before {
        content: attr(data-label);
        flex: 0 0 5.4rem;
        padding-top: 2px;
        color: #93a8b8;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }
    .help-guide-table--cards td.num,
    .help-guide-units td[data-label="Cost"] {
        text-align: left;
        white-space: normal;
    }
}
@media (max-width: 640px) {
    #helpGuidePanel .help-guide.panel {
        width: 100%;
        padding: 0 14px 18px;
    }
    .help-guide-head {
        gap: 6px;
        margin: 0 -14px 12px;
        padding: 10px 14px;
    }
    :is(#helpGuidePanel, #escFullHelpGuide) .help-guide-head h2 {
        font-size: 20px;
    }
    .help-guide-head-link {
        padding: 8px 6px;
        font-size: 14px;
    }
    .help-guide-close {
        padding: 8px 12px;
        font-size: 14px;
    }
    .help-guide-toc {
        padding: 8px;
        scroll-margin-top: 64px;
    }
    .help-guide-toc ol {
        gap: 0 8px;
    }
    .help-guide-toc a {
        padding: 6px 4px;
        font-size: 14px;
    }
    .help-guide-section {
        scroll-margin-top: 64px;
    }
    :is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section h3 {
        font-size: 18px;
    }
    .help-guide-num {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    :is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > p,
    :is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ul > li,
    :is(#helpGuidePanel, #escFullHelpGuide) .help-guide-section > ol > li {
        font-size: 14.5px;
    }
    .help-guide-table th,
    .help-guide-table td {
        padding: 7px 10px;
    }
    /* Two-column reference tables stack the label above the text. */
    .help-guide-table--stack,
    .help-guide-table--stack tbody,
    .help-guide-table--stack tr {
        display: block;
    }
    .help-guide-table--stack tr {
        padding: 8px 12px;
        border-bottom: 1px solid rgba(127, 140, 141, 0.22);
    }
    .help-guide-table--stack tbody tr:last-child {
        border-bottom: none;
    }
    .help-guide-table--stack th,
    .help-guide-table--stack td {
        display: block;
        width: auto;
        padding: 0;
        border: none;
    }
    .help-guide-table--stack tbody th {
        width: auto;
        margin-bottom: 2px;
        color: var(--wod-gold-bright);
    }
}
@media (max-width: 359px) {
    .help-guide-toc ol {
        grid-template-columns: 1fr;
    }
}

.help-effects-catalog {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.help-effect-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(8, 14, 24, 0.72);
    border: 1px solid rgba(127, 140, 141, 0.45);
    box-sizing: border-box;
}
.help-effect-card-visual {
    flex-shrink: 0;
}
.help-effect-card-visual canvas {
    display: block;
    width: 88px;
    height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0f1823;
}
.help-effect-card-body {
    flex: 1;
    min-width: 0;
}
.help-effect-card-body h5 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: #ecf0f1;
}
.help-effect-card-note {
    margin: 8px 0 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(189, 195, 199, 0.92);
}
.help-effect-card-body .effect-list {
    margin-top: 0;
}
.help-effect-card-body .effect-pill--block {
    flex: 1 1 100%;
}

.wod-play-mode-panel {
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}
.wod-play-mode-btns {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 18px 0 20px;
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}
.wod-play-mode-btn {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    box-sizing: border-box;
}
.wod-panel-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    width: 100%;
    max-width: 280px;
    box-sizing: border-box;
}
.wod-panel-footer .menu-btn,
.wod-panel-footer .wod-editor-btn {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}
.wod-camp-footer {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 10px;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}
.wod-camp-footer-left,
.wod-camp-footer-right {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
}
.wod-camp-footer-left { justify-content: flex-start; }
.wod-camp-footer-right { justify-content: flex-end; }
.wod-camp-footer .menu-btn {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wod-map-lib-actions .menu-btn {
    margin: 0 auto;
    width: min(260px, 100%);
    display: block;
}
#missionsPanel .wod-panel-footer,
#playModePanel .wod-panel-footer {
    justify-content: center;
}
.wod-mission-row {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    margin: 0 0 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #ecf0f1;
    cursor: pointer;
    font: inherit;
}
.wod-mission-row:hover {
    border-color: rgba(212, 175, 55, 0.55);
}
.wod-mission-row.active {
    border-color: rgba(46, 204, 113, 0.75);
    background: rgba(46, 204, 113, 0.12);
}
.wod-mission-row-title {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}
.wod-mission-row-desc {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #9db3c7;
    line-height: 1.4;
}
.wod-camp-panel {
    max-width: 1120px;
    width: min(1120px, 96vw);
    max-height: min(92vh, 92dvh, 960px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 28px 28px 22px;
}
@media (min-width: 901px) and (max-height: 820px) {
    .wod-camp-panel {
        padding: 18px 20px 14px;
        max-height: min(94vh, 94dvh);
    }
    .wod-camp-layout {
        min-height: 0;
    }
    .wod-camp-side {
        max-height: min(70vh, 70dvh);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    #wodCampMapCanvas {
        max-height: min(48vh, 420px);
        object-fit: contain;
    }
    .wod-camp-roster {
        max-height: min(160px, 22vh);
    }
}
@media (min-width: 901px) and (max-height: 640px) {
    .wod-camp-panel {
        padding: 12px 14px 10px;
    }
    .wod-camp-header {
        margin-bottom: 6px;
    }
    #wodCampMapCanvas {
        max-height: min(38vh, 280px);
    }
    .wod-camp-side {
        max-height: min(78vh, 78dvh);
    }
    .panel {
        padding: 22px 24px;
    }
}
.wod-camp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.wod-camp-status {
    text-align: right;
    font-size: 0.9rem;
    color: #d4af37;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
.wod-camp-research {
    display: none;
}
.wod-camp-research-dlg.mp-host-dlg .panel {
    max-width: 480px;
    width: min(480px, 94vw);
    text-align: left;
    padding: 22px 22px 18px;
    background: linear-gradient(165deg, rgba(28, 42, 58, 0.98), rgba(16, 26, 38, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.wod-camp-research-dlg .wod-research-dlg-kicker {
    margin: 0 0 4px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d4af37;
    font-weight: 700;
}
.wod-camp-research-dlg .panel h3 {
    margin: 0 0 6px;
    color: #ecf0f1;
    font-size: 1.35rem;
}
.wod-camp-research-dlg .wod-research-dlg-sub {
    margin: 0 0 14px;
    color: #9db3c7;
    font-size: 0.86rem;
    line-height: 1.45;
}
.wod-camp-research-dlg .wod-research-dlg-points {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #f0d78c;
    font-size: 0.8rem;
    font-weight: 700;
}
.wod-camp-research-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 360px);
    overflow-y: auto;
    margin-bottom: 14px;
    padding-right: 2px;
}
.wod-camp-research-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}
.wod-camp-research-row.owned {
    border-color: rgba(46, 204, 113, 0.4);
    background: rgba(46, 204, 113, 0.1);
}
.wod-camp-research-meta {
    min-width: 0;
    flex: 1;
    text-align: left;
}
.wod-camp-research-meta strong {
    display: block;
    color: #ecf0f1;
    font-size: 0.92rem;
}
.wod-camp-research-meta em {
    display: block;
    font-style: normal;
    color: #9db3c7;
    font-size: 0.74rem;
    line-height: 1.4;
    margin-top: 3px;
}
.wod-camp-research-buy {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.16);
    color: #f0d78c;
    cursor: pointer;
    white-space: nowrap;
}
.wod-camp-research-buy:hover { filter: brightness(1.08); }
.wod-camp-research-buy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}
.wod-camp-research-lvl {
    color: #7ee2a8;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.wod-camp-research-dlg .mp-host-dlg-actions {
    justify-content: center;
}
.wod-camp-status .wod-camp-turn {
    display: block;
    color: #9db3c7;
    font-weight: 400;
    font-size: 0.78rem;
}
.wod-camp-layout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.wod-camp-map-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
#wodCampMapCanvas {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #10202e;
    cursor: pointer;
    display: block;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex: 0 0 auto;
}
.wod-camp-log {
    margin-top: 8px;
    flex: 1 1 auto;
    min-height: 72px;
    max-height: 160px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #9db3c7;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
}
.wod-camp-log p { margin: 0 0 3px; }
.wod-camp-log p strong { color: #d9e6f2; }
.wod-camp-side {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.wod-camp-side-active {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.wod-camp-setup {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    padding: 14px 14px 16px;
    color: #d9e6f2;
}
.wod-camp-setup .setup-row {
    margin-bottom: 0;
}
.wod-camp-setup .setup-row label {
    font-size: 16px;
    color: #fff;
}
.wod-camp-setup .setup-row input,
.wod-camp-setup .setup-row select {
    background: #2c3e50;
    color: white;
    border: 1px solid #7f8c8d;
    padding: 8px;
    border-radius: 4px;
    width: 150px;
}
.wod-camp-side-active .setup-row {
    margin-bottom: 0;
}
.wod-camp-side-active .setup-row label {
    font-size: 14px;
    color: #fff;
}
.wod-camp-side-active .setup-row select {
    background: #2c3e50;
    color: white;
    border: 1px solid #7f8c8d;
    padding: 8px;
    border-radius: 4px;
    width: 150px;
}
#missionsPanel .setup-row select {
    background: #2c3e50;
    color: white;
    border: 1px solid #7f8c8d;
    padding: 8px;
    border-radius: 4px;
    flex: 1;
}
.wod-camp-set-hint {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #7f9bb3;
}
.wod-camp-setup .menu-btn { margin: 0; }
.wod-camp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    padding: 7px 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    font-size: 0.76rem;
    color: #9db3c7;
    flex: 0 0 auto;
}
.wod-camp-stats strong { color: #ecf0f1; }
.wod-camp-intel {
    color: #9db3c7;
    font-size: 0.76rem;
    margin: 4px 0;
}
.wod-camp-node-info {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #bdc3c7;
    min-height: 96px;
}
.wod-camp-node-info h3 { margin: 0 0 4px; font-size: 0.98rem; color: #ecf0f1; }
.wod-camp-node-info .wod-camp-node-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.wod-camp-node-tag.friendly { background: rgba(46, 204, 113, 0.18); color: #7ee2a8; }
.wod-camp-node-tag.hostile { background: rgba(231, 76, 60, 0.18); color: #ff9d8f; }
.wod-camp-node-tag.alert { background: rgba(241, 196, 15, 0.2); color: #ffd968; }
.wod-camp-from-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 6px;
}
.wod-camp-from-row label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #d4e4f2;
    letter-spacing: 0.02em;
}
.wod-camp-from-row select {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    color: #ecf0f1;
    border: 1px solid rgba(155, 179, 199, 0.35);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.8rem;
}
.wod-camp-launch { width: 100%; margin: 0; }
.wod-camp-army-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ecf0f1;
    margin-top: 2px;
}
#wodCampArmyCount {
    font-weight: 600;
    color: #b8c9d9;
    font-variant-numeric: tabular-nums;
}
.wod-camp-roster {
    max-height: 170px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wod-camp-unit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 0.76rem;
    color: #d9e6f2;
}
.wod-camp-unit .hpbar {
    flex: 0 0 64px;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}
.wod-camp-unit .hpbar i {
    display: block;
    height: 100%;
    background: #2ecc71;
    border-radius: 3px;
}
.wod-camp-unit .hpbar i.low { background: #e67e22; }
.wod-camp-unit .vet { color: #d4af37; font-weight: 700; }
.wod-camp-unit .wod-camp-unit-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.wod-camp-unit .wod-camp-unit-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wod-camp-unit .wod-camp-vet-tag {
    color: #d4af37;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.wod-camp-unit .wod-camp-unit-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.wod-camp-unit .wod-camp-rename,
.wod-camp-unit .wod-camp-del {
    flex: 0 0 auto;
    margin: 0;
    padding: 2px 7px;
    font-size: 0.68rem;
    line-height: 1.2;
    border-radius: 4px;
    cursor: pointer;
}
.wod-camp-unit .wod-camp-rename {
    border: 1px solid rgba(127, 155, 179, 0.55);
    background: rgba(127, 155, 179, 0.12);
    color: #c5d6e6;
}
.wod-camp-unit .wod-camp-rename:hover {
    background: rgba(127, 155, 179, 0.28);
}
.wod-camp-unit .wod-camp-del {
    border: 1px solid rgba(231, 76, 60, 0.45);
    background: rgba(231, 76, 60, 0.12);
    color: #ff9d8f;
}
.wod-camp-unit .wod-camp-del:hover {
    background: rgba(231, 76, 60, 0.28);
}
.wod-camp-unit.wod-camp-unit--vet {
    border-color: rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.06);
}
.wod-camp-shop {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
}
.wod-camp-shop button {
    margin: 0;
    padding: 7px 4px;
    font-size: 0.74rem;
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wod-camp-actions { display: flex; gap: 6px; }
.wod-camp-actions .menu-btn { flex: 1; margin: 0; padding: 8px 6px; font-size: 0.78rem; }
.wod-camp-danger { border-color: rgba(231, 76, 60, 0.5) !important; }

#wodEndCountdownBanner {
    position: fixed;
    top: max(52px, env(safe-area-inset-top, 0px) + 48px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    padding: 10px 22px;
    border-radius: 10px;
    background: rgba(20, 34, 24, 0.92);
    border: 1px solid rgba(46, 204, 113, 0.7);
    color: #7ee2a8;
    font-weight: 700;
    font-size: clamp(0.82rem, 1.6vw, 1.02rem);
    letter-spacing: 0.02em;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    animation: wodEndCdPulse 1.1s ease-in-out infinite;
    max-width: min(720px, calc(100vw - 16px));
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
}
#wodEndCountdownBanner.wod-endcd-danger {
    background: rgba(44, 18, 18, 0.92);
    border-color: rgba(231, 76, 60, 0.75);
    color: #ff9d8f;
}
#wodDeployBanner {
    position: fixed;
    top: max(52px, env(safe-area-inset-top, 0px) + 48px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 65;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    max-width: min(720px, calc(100vw - 16px));
    padding: 12px 16px 12px 18px;
    border-radius: 12px;
    background: rgba(18, 28, 42, 0.94);
    border: 1px solid rgba(100, 170, 255, 0.55);
    color: #d7e8ff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    box-sizing: border-box;
}
@media (max-height: 700px) {
    #wodEndCountdownBanner,
    #wodDeployBanner {
        top: max(44px, env(safe-area-inset-top, 0px) + 40px);
    }
    .wod-hud-top {
        padding: 8px 14px;
    }
    .info-card {
        bottom: max(72px, 10vh);
        max-height: min(42vh, 360px);
    }
}
#wodDeployBanner.hidden { display: none; }
.wod-deploy-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.35;
}
.wod-deploy-banner-text strong {
    color: #9ec8ff;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
}
.wod-deploy-banner-text span { opacity: 0.92; }
.wod-deploy-begin-btn {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(120, 200, 120, 0.65);
    background: rgba(46, 140, 70, 0.85);
    color: #f2fff4;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
}
.wod-deploy-begin-btn:hover { filter: brightness(1.08); }
@keyframes wodEndCdPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}
.wod-mission-row.locked {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.5);
}
.wod-mission-row.locked:hover {
    border-color: rgba(255, 255, 255, 0.1);
}
.wod-mission-row.completed .wod-mission-row-title {
    color: #7ee2a8;
}
.wod-mission-row-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: 1px;
}
.wod-mission-row-badge.lock {
    background: rgba(255, 255, 255, 0.08);
    color: #95a5a6;
}
.wod-mission-row-badge.done {
    background: rgba(46, 204, 113, 0.16);
    color: #7ee2a8;
}
.shop-map-card.shop-mission-spent {
    opacity: 0.72;
}
.wod-mission-source-tabs {
    justify-content: flex-start;
}

#mapLibraryPanel.overlay {
    z-index: 40;
}
.wod-map-lib-panel {
    max-width: 920px;
}
.wod-map-lib-sub {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #bdc3c7;
    margin: 0 0 16px 0;
}
.wod-map-lib-layout {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.wod-map-lib-list-column {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wod-map-lib-list {
    max-height: min(62vh, 420px);
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(0,0,0,0.22);
    padding: 8px;
}
.wod-map-lib-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.wod-map-lib-pager[hidden] {
    display: none !important;
}
.wod-map-lib-page-label {
    font-size: 12px;
    color: #9db3c7;
    min-width: 120px;
    text-align: center;
    font-weight: 700;
}
.wod-map-lib-pager .wod-map-lib-page-btn {
    padding: 6px 14px;
    min-width: 44px;
}
.wod-map-lib-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 6px;
    align-items: center;
}
.wod-map-lib-card:hover {
    background: rgba(255,255,255,0.06);
}
.wod-map-lib-card.active {
    border-color: rgba(93,173,226,0.75);
    background: rgba(93,173,226,0.12);
}
.wod-map-lib-card img {
    width: 72px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    background: #0f1823;
    flex-shrink: 0;
}
.wod-map-lib-card .wod-map-lib-card-text {
    min-width: 0;
}
.wod-map-lib-card .wod-map-lib-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #ecf0f1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wod-map-lib-card .wod-map-lib-card-date {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-top: 2px;
}
.wod-map-lib-detail {
    flex: 1 1 320px;
    min-width: 280px;
}
.wod-map-lib-preview-canvas {
    width: 100%;
    max-width: 420px;
    height: auto;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    background: #154360;
    display: block;
}
.wod-map-lib-meta {
    margin: 10px 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #d5d8dc;
}
.wod-map-lib-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

#escTerrainKeyBody {
    margin-top: 8px;
}

.surrender-box {
    text-align: center;
    border-color: rgba(231, 76, 60, 0.75);
}

.danger-btn {
    background: linear-gradient(135deg, #922b21, #e74c3c) !important;
    border-color: #ff7979 !important;
}

.wod-help-terrain-combat-wrap {
    overflow-x: auto;
    margin: 10px 0 8px;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.32);
    background: rgba(5, 10, 16, 0.45);
    max-width: 100%;
}

.wod-help-terrain-combat-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: #ecf0f1;
}

.wod-help-terrain-combat-table th,
.wod-help-terrain-combat-table td {
    border: 1px solid rgba(212, 175, 55, 0.26);
    padding: 8px 7px;
    vertical-align: top;
    text-align: center;
    line-height: 1.42;
    min-width: 5.6rem;
}

.wod-help-terrain-combat-table th:first-child,
.wod-help-terrain-combat-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 8.5rem;
    background: rgba(15, 22, 31, 0.98);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.24);
}

.wod-help-terrain-combat-table thead th {
    background: rgba(26, 39, 53, 0.96);
    font-weight: 700;
    color: rgba(243, 237, 226, 0.98);
    font-size: 10.5px;
}

.wod-help-terrain-matrix-atk {
    color: #f1c40f;
    white-space: nowrap;
}

.wod-help-terrain-matrix-def {
    color: #85c1e9;
    white-space: nowrap;
}

.effect-pill-stat-chart {
    white-space: normal;
    line-height: 1.45;
}

.effect-pill--warn .effect-pill-stat-chart .wod-help-terrain-matrix-atk {
    color: #fde68a;
}

.effect-pill--warn .effect-pill-stat-chart .wod-help-terrain-matrix-def {
    color: #aed6f1;
}

@media (min-width: 901px) {
    .esc-menu.overlay > .panel {
        max-width: min(1320px, 98vw);
        width: min(1320px, 96vw);
        padding: 40px 48px;
        box-sizing: border-box;
    }

    .esc-section {
        padding: 18px 20px;
    }

    .esc-section.esc-help-panel {
        max-height: min(82vh, 900px);
        overflow-y: auto;
    }

    .wod-help-terrain-combat-wrap {
        overflow-x: visible;
        margin: 14px 0 12px;
        border-radius: 10px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 18px rgba(0, 0, 0, 0.25);
        background: linear-gradient(168deg, rgba(7, 12, 20, 0.62), rgba(16, 28, 40, 0.48));
    }

    .wod-help-terrain-combat-table {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        table-layout: fixed;
        font-size: 11.5px;
    }

    .wod-help-terrain-combat-table th:not(:first-child),
    .wod-help-terrain-combat-table td:not(:first-child) {
        min-width: 0;
        width: calc((100% - 9rem) / 8);
        padding: 6px 4px;
    }

    .wod-help-terrain-combat-table th:first-child,
    .wod-help-terrain-combat-table td:first-child {
        min-width: 9rem;
        width: 9rem;
        padding: 6px 10px;
        font-weight: 700;
        font-size: 12px;
    }

    .wod-help-terrain-combat-table thead th {
        font-size: 11px;
        letter-spacing: 0.02em;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        hyphens: auto;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .wod-matrix-cell-stats {
        line-height: 1.34;
        font-variant-numeric: tabular-nums;
    }

    .wod-help-terrain-matrix-atk,
    .wod-help-terrain-matrix-def {
        white-space: normal;
        display: inline;
    }

    .wod-matrix-cell-empty {
        opacity: 0.45;
    }
}

.help-terrain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 4px 14px;
}

.nato-preview {
    border-radius: 3px;
    background: #d9e8f5;
    position: relative;
}

.nato-preview::after {
    content: "X";
    color: #111;
    font-weight: 900;
    font-size: 28px;
    line-height: 48px;
}

.ball-preview {
    border-radius: 50%;
    overflow: hidden;
}

/* USA: 13 stripes + blue canton (matches in-game ball art). UK: simplified Union hues. */
.ball-usa {
    background:
        linear-gradient(180deg, #3c3b6e 0%, #162456 100%) 0 0 / 42% 52% no-repeat,
        repeating-linear-gradient(to bottom, #b22234 0 7.692%, #fff 7.692% 15.384%);
}
/* UK Union Jack — crisp SVG decoration (clips to circle via ball-preview). */
.ball-uk {
    background-color: #012169;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Crect width='60' height='60' fill='%23012169'/%3E%3Cg fill='none' stroke-linecap='square'%3E%3Cpath stroke='%23ffffff' stroke-width='10' d='M0 0 L60 60 M60 0 L0 60'/%3E%3Cpath stroke='%23C8102E' stroke-width='4' d='M0 60 L60 0 M60 60 L0 0'/%3E%3Cpath stroke='%23ffffff' stroke-width='12' d='M30 0 V60 M0 30 H60'/%3E%3Cpath stroke='%23C8102E' stroke-width='6' d='M30 0 V60 M0 30 H60'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}
.ball-germany { background: linear-gradient(to bottom,#000 0 33%,#dd0000 33% 66%,#ffce00 66%); }
.ball-france { background: linear-gradient(to right,#0055a4 0 33%,#fff 33% 66%,#ef4135 66%); }
.ball-japan { background: radial-gradient(circle,#bc002d 0 28%,#fff 29%); }
.ball-ussr {
    background: #cc1d1d;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 550 550'%3E%3Crect width='550' height='550' fill='%23cc1d1d'/%3E%3Cg fill='%23ffd700' transform='translate(18 -824)'%3E%3Cpath d='m 255.989,844.0001 c 0,0 168.00781,127.99997 168.00783,256 C 423.99684,1164 367.99425,1236 271.98975,1236 c -64.00296,0 -104.24119,-47.7637 -104.24119,-47.7637 l -11.31302,11.3125 a 16 16 0 0 0 -22.62801,0 16 16 0 0 0 -2.47863,3.2227 32 32 0 0 0 -31.464359,8.0918 32 32 0 0 0 -9.330512,21.5449 C 65.101725,1246.1605 22.969246,1272.9834 4.2643862,1308 l 0.029298,0.029 A 32 32 0 0 0 4.2643862,1340 32 32 0 0 0 47.979313,1351.7129 c 35.025561,-18.708 61.854737,-60.8518 75.605087,-86.2813 a 32 32 0 0 0 21.53616,-9.3144 32 32 0 0 0 7.93201,-13.2012 c 24.51647,23.0544 71.44493,57.084 134.93792,57.084 96.00451,0 200.00932,-72 200.00932,-199.9999 0,-160.00002 -232.01081,-256 -232.01081,-256 z'/%3E%3Cpath d='m 157.54301,922.36336 -16.97149,16.9707 -45.256019,45.2539 -56.570993,56.57034 62.227502,62.2246 56.571,-56.5684 299.82842,299.8124 a 32 32 0 0 0 45.25601,0 32 32 0 0 0 0,-45.2539 l -299.82646,-299.8143 16.9715,-16.97074 50.91448,-50.91015 z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 50% 50%;
    background-position: center;
    background-repeat: no-repeat;
}

.shop-skin-section-title,
.shop-skin-section-desc {
    grid-column: 1 / -1;
}
.shop-skin-section-title {
    width: 100%;
    margin: 16px 0 8px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #5dade2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.shop-skin-section-title:first-of-type { margin-top: 4px; }
.shop-skin-section-desc {
    width: 100%;
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: #bdc3c7;
}
.shop-section-buy-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 8px;
}
.shop-section-buy-row .shop-skin-section-title {
    margin: 0;
    width: auto;
}
.shop-purchase-all-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    min-width: 0;
}
.shop-purchase-all-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (orientation: landscape) and (max-height: 600px), (max-width: 900px) {
    .top-bar {
        padding: 7px 10px;
        gap: 8px;
    }
    .resources {
        gap: 4px;
        font-size: 10px;
    }

    .resource-section {
        gap: 4px;
    }

    .resource-section-label {
        font-size: 9px;
        letter-spacing: 0.06em;
    }

    .resource-chip {
        padding: 4px 8px;
        gap: 4px;
    }

    .resources-divider {
        min-height: 38px;
        margin: 0 3px 2px;
    }
    .resources-divider-inline {
        min-height: 38px;
        margin: 0 1px 2px;
    }
    .bottom-bar {
        padding: 7px 8px;
        gap: 7px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .build-btn {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    .terrain-key {
        top: 68px;
        left: 8px;
        transform: scale(0.82);
        transform-origin: top left;
    }
    .player-summary {
        top: 292px;
        left: 8px;
        transform: scale(0.82);
        transform-origin: top left;
    }
    .layer-toggles {
        top: 58px;
        right: 8px;
        gap: 6px;
    }
    .layer-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    .info-card {
        right: 8px;
        bottom: 58px;
        width: 210px;
        padding: 10px;
    }
}

/* Touch phones / small screens: locked layout; JS syncs #gameWrapper to visualViewport */
@media (max-width: 900px), (max-height: 500px), (hover: none) and (pointer: coarse) {
    html, body {
        overflow: hidden;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        display: block;
        background-color: #154360;
        /* Block browser pinch-zoom on the page; canvas handles map zoom. Overlays use pan-y for scroll. */
        touch-action: none;
        -webkit-text-size-adjust: 100%;
    }

    #gameWrapper {
        overflow: hidden;
        box-sizing: border-box;
        touch-action: none;
    }

    #inGameUI .resources,
    #inGameUI .player-summary,
    #inGameUI #terrainKey,
    #inGameUI .layer-toggles,
    #inGameUI .bottom-bar,
    #inGameUI .info-card {
        touch-action: pan-y;
    }

    #inGameUI[data-mtab] .wod-m-sheet--map,
    #inGameUI[data-mtab] .wod-m-sheet--build,
    #inGameUI[data-mtab] .wod-m-sheet--units {
        contain: layout style;
    }

    /* Build-placement: sheets must not cover canvas (rings + taps). */
    #inGameUI[data-build-picking] #wodMobileBackdrop {
        display: none !important;
        pointer-events: none !important;
    }
    #inGameUI[data-build-picking] .wod-m-sheet--map,
    #inGameUI[data-build-picking] .wod-m-sheet--build,
    #inGameUI[data-build-picking] .wod-m-sheet--units {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .overlay {
        padding: max(10px, env(safe-area-inset-top, 0px))
            max(10px, env(safe-area-inset-right, 0px))
            max(10px, env(safe-area-inset-bottom, 0px))
            max(10px, env(safe-area-inset-left, 0px));
        box-sizing: border-box;
        justify-content: flex-start;
        align-items: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #mainMenu.overlay {
        justify-content: center;
    }

    /* Compact menus sit in the middle of the phone screen, not pinned to the top. */
    #playModePanel.overlay {
        justify-content: center;
        align-items: center;
    }
    #playModePanel .wod-play-mode-panel {
        margin-top: auto;
        margin-bottom: auto;
    }

    .panel {
        width: min(560px, 96vw);
        max-width: none;
        padding: 22px 16px 28px;
        margin: 10px auto;
        max-height: min(92svh, 92dvh);
        overflow-y: auto;
        box-sizing: border-box;
    }

    .panel h2 {
        font-size: clamp(22px, 5.5vw, 30px);
    }

    .panel p {
        font-size: 15px;
        margin-bottom: 18px;
    }

    #mainMenu h1 {
        font-size: clamp(32px, 9vw, 52px);
    }

    #mainMenu p {
        font-size: clamp(14px, 3.8vw, 18px);
        margin-bottom: 22px;
    }

    .menu-btn {
        width: min(320px, 88vw);
        padding: 14px 18px;
        font-size: 16px;
        margin: 6px;
    }

    #wodConfirmDlg.mp-host-dlg .mp-host-dlg-actions .wod-editor-btn,
    #wodConfirmDlg.mp-host-dlg .mp-host-dlg-actions .menu-btn {
        width: auto !important;
        max-width: none;
        flex: 1 1 0;
        margin: 0 !important;
    }

    .setup-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .setup-row label {
        flex: 1 1 40%;
        min-width: 120px;
    }

    .setup-row input, .setup-row select {
        flex: 1 1 50%;
        max-width: 100%;
    }

    #mapPreview {
        height: min(200px, 28vh);
    }

    .esc-menu .panel {
        max-height: min(88svh, 88dvh);
    }

    .esc-actions .menu-btn {
        width: auto;
        min-width: 140px;
        flex: 1 1 140px;
    }

    .esc-section.esc-help-panel {
        max-height: min(70svh, 70dvh);
    }

    .achievements-panel.panel-wide,
    .panel-wide {
        width: min(720px, 96vw);
    }

    .achievements-panel.panel-wide {
        max-height: min(calc(100svh - 24px), calc(100dvh - 24px));
    }

    #shopPanel .skin-grid-scroll {
        max-height: none;
        overflow: visible;
    }

    /* Campaign: stack map above side panel on phones */
    .wod-camp-panel {
        max-width: none;
        width: min(720px, 96vw);
        padding-left: 14px;
        padding-right: 14px;
        box-sizing: border-box;
    }
    .wod-camp-layout {
        flex-direction: column;
        gap: 12px;
    }
    .wod-camp-side {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        max-height: min(52vh, 420px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    .wod-camp-roster {
        max-height: none;
        overflow: visible;
    }
    .wod-camp-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .wod-camp-status {
        text-align: left;
        white-space: normal;
    }
    #wodCampMapCanvas {
        max-height: min(42vh, 320px);
        object-fit: contain;
    }
    .wod-camp-setup .setup-row select,
    .wod-camp-side-active .setup-row select {
        width: min(180px, 55vw);
    }
    .wod-camp-setup .menu-btn,
    .wod-camp-launch,
    .wod-camp-actions .menu-btn,
    .wod-camp-shop .menu-btn {
        width: 100% !important;
        max-width: 100%;
        margin: 0 !important;
        box-sizing: border-box;
    }
    /* Kill the global mobile 88vw button width inside constrained panels —
       that was left-shifting Play vs AI and clipping campaign Back/Surrender. */
    #playModePanel .menu-btn,
    #campaignPanel .menu-btn,
    #missionsPanel .menu-btn {
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }
    #playModePanel .wod-play-mode-btns,
    #playModePanel .wod-panel-footer {
        width: 100%;
        max-width: min(280px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    #missionsPanel .wod-panel-footer {
        width: 100%;
        max-width: min(280px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
    .wod-panel-footer {
        justify-content: center;
    }
    .wod-map-lib-actions .menu-btn {
        width: min(280px, 100%) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .wod-camp-footer {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        width: 100%;
        max-width: 100%;
    }
    .wod-camp-footer-left,
    .wod-camp-footer-right {
        flex: 0 0 auto;
        width: 100%;
        max-width: min(280px, 100%);
        min-width: 0;
        justify-content: center;
        margin: 0;
    }
    .wod-camp-footer .menu-btn {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        flex: none;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .wod-play-mode-panel,
    #missionsPanel .panel {
        text-align: center;
    }
    #missionsPanel .wod-map-lib-layout {
        justify-content: center;
    }
    #missionsPanel .wod-map-lib-detail {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #missionsPanel .wod-map-lib-meta {
        text-align: center;
        width: 100%;
    }
    .wod-camp-panel {
        overflow-x: hidden;
    }
}

/* ---- Mobile HUD shell (hidden on desktop) ---- */
#inGameUI .wod-m-mobile-shell {
    display: none;
    pointer-events: none;
    z-index: 9;
}
#inGameUI .wod-m-mobile-shell * {
    pointer-events: auto;
}
#inGameUI .wod-m-dock-pack {
    display: none;
    pointer-events: none;
    z-index: 9;
    overflow: visible;
}
#inGameUI .wod-m-dock-pack > * {
    pointer-events: auto;
}
#inGameUI .wod-m-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(2, 6, 12, 0.58);
    pointer-events: auto;
}
#inGameUI[data-mtab] .wod-m-backdrop {
    display: block;
}
#inGameUI[data-mtab="build"] .wod-m-backdrop,
#inGameUI[data-mtab="units"] .wod-m-backdrop {
    background: rgba(2, 6, 12, 0.34);
}
#inGameUI .wod-m-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}
#inGameUI .wod-m-status-accent {
    width: 4px;
    height: 28px;
    border-radius: 4px;
    background: linear-gradient(180deg, #f1c40f, #d4af37);
    flex-shrink: 0;
}
#inGameUI .wod-m-kpis {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    align-items: stretch;
}
    #inGameUI .wod-m-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 10px;
    background: rgba(8, 14, 22, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.48);
    min-width: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.28);
}
#inGameUI .wod-m-kpi--wide { flex: 1 1 72px; min-width: 64px; }
#inGameUI .wod-m-kpi--grow { display: none; }
#inGameUI .wod-m-kpi-lbl {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(189, 195, 199, 0.88);
    line-height: 1;
}
#inGameUI .wod-m-kpi-val {
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    color: #ecf0f1;
    line-height: 1.2;
    margin-top: 3px;
    min-width: 7ch;
}
#inGameUI .wod-m-resource-card {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
#inGameUI .wod-m-resource-mark {
    flex: 0 0 auto;
    color: #d9a94c;
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}
#inGameUI .wod-m-resource-mark--mp {
    font-size: 9px;
    letter-spacing: 0.05em;
}
#inGameUI .wod-m-resource-values {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#inGameUI .wod-m-resource-rate {
    margin-top: 2px;
    color: #7fbe55;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
#inGameUI .wod-m-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
#inGameUI .wod-m-objective-hud {
    display: none;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 46%;
    padding: 4px 8px 5px;
    border-radius: 9px;
    background: rgba(8, 14, 24, 0.58);
    border: 1px solid rgba(212, 175, 55, 0.34);
    box-sizing: border-box;
}
#inGameUI .wod-m-objective-label {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(241, 196, 15, 0.88);
    line-height: 1;
}
#inGameUI .wod-m-objective-lines {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
#inGameUI .wod-m-objective-mode {
    font-size: 11px;
    font-weight: 800;
    color: #ecf0f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#inGameUI .wod-m-objective-rule {
    font-size: 9px;
    color: rgba(189, 195, 199, 0.95);
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#inGameUI .wod-m-objective-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
#inGameUI .wod-m-objective-icon {
    position: relative;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border: 2px solid #d9a94c;
    border-radius: 50%;
    box-sizing: border-box;
}
#inGameUI .wod-m-objective-icon::before,
#inGameUI .wod-m-objective-icon::after {
    content: '';
    position: absolute;
    background: #d9a94c;
}
#inGameUI .wod-m-objective-icon::before {
    left: 50%;
    top: -6px;
    width: 2px;
    height: 38px;
    transform: translateX(-50%);
}
#inGameUI .wod-m-objective-icon::after {
    top: 50%;
    left: -6px;
    width: 38px;
    height: 2px;
    transform: translateY(-50%);
}
#inGameUI .wod-m-objective-icon span {
    position: absolute;
    inset: 7px;
    border: 2px solid #d9a94c;
    border-radius: 50%;
    background: #0a1420;
    z-index: 1;
}
#inGameUI .wod-m-meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, rgba(241, 196, 15, 0.32), rgba(212, 175, 55, 0.14));
    border: 1px solid rgba(241, 196, 15, 0.6);
    color: #fceaa3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
#inGameUI .wod-m-speed-dd {
    position: relative;
}
#inGameUI .wod-m-speed-trigger {
    cursor: pointer;
    font: inherit;
    min-width: 52px;
}
#inGameUI .wod-m-speed-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(8, 14, 22, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.55);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#inGameUI .wod-m-speed-pop[hidden] {
    display: none !important;
}
#inGameUI .wod-m-speed-opt {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(100, 120, 140, 0.5);
    background: rgba(22, 32, 46, 0.95);
    color: #ecf0f1;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
}
#inGameUI .wod-m-speed-opt.active {
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.95), rgba(46, 204, 113, 0.88));
    border-color: #2ecc71;
    color: #08140d;
}
#inGameUI .wod-m-menu-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.65);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
#inGameUI[data-mdock="hid"] {
    --wod-m-dock-gap: calc(var(--wod-m-dock-toggle-h, 28px) + 6px + env(safe-area-inset-bottom, 0px)) !important;
}
#inGameUI[data-mdock="hid"] .wod-m-dock-pack {
    bottom: 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5px);
    overflow: visible !important;
}
#inGameUI[data-mdock="hid"] .wod-m-dock-toggle {
    margin-bottom: 2px !important;
    min-height: 30px !important;
    padding-top: max(6px, 0.5em);
    padding-bottom: max(7px, 0.72em);
    overflow: visible !important;
    box-sizing: border-box !important;
}
#inGameUI[data-mdock="hid"] .wod-m-dock-clip {
    max-height: 0 !important;
    min-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
    overflow: hidden;
}
#inGameUI[data-mdock="hid"] .wod-m-dock {
    box-shadow: none;
    border-color: transparent;
    background: transparent;
}
#inGameUI[data-mdock="hid"] .wod-m-dock-toggle .wod-m-dock-chevron {
    display: inline-block;
    transform: rotate(180deg);
}
#inGameUI .wod-m-dock-clip {
    transition: max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
    position: relative;
    z-index: 1;
}
#inGameUI .wod-m-dock {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    box-sizing: border-box;
}
#inGameUI .wod-m-tab {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid rgba(100, 120, 140, 0.55);
    background: rgba(18, 28, 42, 0.92);
    color: rgba(236, 240, 241, 0.92);
    cursor: pointer;
}
#inGameUI .wod-m-tab-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1c40f;
}
#inGameUI .wod-m-tab-glyph svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#inGameUI .wod-m-tab-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.92;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#inGameUI .wod-m-tab.active {
    background: linear-gradient(160deg, rgba(241, 196, 15, 0.95), rgba(212, 175, 55, 0.82));
    border-color: rgba(255, 230, 150, 0.85);
    color: #1a1103;
    box-shadow: 0 4px 18px rgba(241, 196, 15, 0.25);
}
#inGameUI .wod-m-tab.active .wod-m-tab-glyph {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1103;
}
#inGameUI .wod-m-tab:focus-visible {
    outline: 2px solid rgba(241, 196, 15, 0.75);
    outline-offset: 2px;
}
@media (min-width: 901px) {
    #inGameUI .wod-m-header-actions {
        display: none !important;
    }
    #inGameUI[data-mtab] .wod-m-backdrop { display: none !important; }
    #inGameUI .wod-m-mobile-shell { display: none !important; }
    #inGameUI .wod-hud-compact {
        display: none !important;
    }
    #inGameUI .wod-m-dock-pack { display: none !important; }
    /* Prevent stat columns from growing/shrinking when numbers update */
    #inGameUI .wod-hud-compact {
        display: flex !important;
    }
    #inGameUI .top-bar {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        flex-shrink: 0;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        border: none;
    }
    #inGameUI .resources {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        max-height: none !important;
        width: auto !important;
        margin: 0 !important;
        padding-bottom: 3px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        align-self: center;
    }
    #inGameUI .resource-section {
        flex: 0 0 auto;
    }
    #inGameUI .resource-section-chips {
        flex-wrap: nowrap !important;
    }
    #inGameUI .resource-chip {
        flex-shrink: 0;
    }
    #inGameUI .top-actions {
        display: flex !important;
        width: auto !important;
        margin-top: 0 !important;
    }
    #inGameUI .wod-hud-objective,
    #inGameUI #hudObjectiveDesktop {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        max-width: min(460px, 42vw);
        gap: 10px;
    }
    #inGameUI #hudObjectiveDesktop > .wod-m-objective-icon {
        display: block !important;
        flex: 0 0 30px !important;
        order: 0 !important;
        align-self: center !important;
    }
    #inGameUI #hudObjectiveDesktop > .wod-m-objective-copy {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        order: 1 !important;
    }
    #inGameUI #hudObjectiveMobileBlock { display: none !important; }
    #inGameUI #terrainKey,
    #inGameUI .player-summary,
    #inGameUI .layer-toggles {
        display: revert !important;
    }
    #inGameUI #terrainKey {
        top: calc(var(--wod-pc-top-ui-h, 96px) + 14px);
        left: 16px;
    }
    #inGameUI .layer-toggles {
        top: calc(var(--wod-pc-top-ui-h, 96px) + 14px);
        right: 16px;
    }
    #inGameUI .bottom-bar {
        display: flex !important;
        position: absolute !important;
        inset: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-height: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #inGameUI .wod-hud-top {
        min-height: 54px;
        align-items: center;
        flex-wrap: nowrap;
        padding: 8px 14px 10px 18px;
        box-sizing: border-box;
    }
    #inGameUI .resources {
        gap: 4px;
        font-size: 11px;
    }
    #inGameUI .resource-section-label {
        font-size: 9px;
    }
    #inGameUI .resource-section-chips {
        gap: 5px;
    }
    #inGameUI .resource-chip {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }
    #inGameUI .resources-divider {
        min-height: 38px;
        margin: 0 4px 2px;
    }
    /* Fixed numeric slots (comma-formatted totals need extra width vs. ch estimates) */
    #inGameUI .chip-value {
        display: inline-block;
        box-sizing: border-box;
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-feature-settings: "tnum" 1;
    }
    #inGameUI #ui-income.chip-value,
    #inGameUI #ui-land-income.chip-value,
    #inGameUI #ui-expenses.chip-value,
    #inGameUI #ui-manpower-income.chip-value {
        width: 12ch;
        min-width: 12ch;
    }
    #inGameUI #ui-money.chip-value,
    #inGameUI #ui-manpower.chip-value {
        width: 12ch;
        min-width: 12ch;
    }
    #inGameUI #ui-troops.chip-value,
    #inGameUI #ui-tanks.chip-value,
    #inGameUI #ui-ships.chip-value,
    #inGameUI #ui-casualties.chip-value,
    #inGameUI #ui-tank-casualties.chip-value,
    #inGameUI #ui-ship-casualties.chip-value,
    #inGameUI #ui-enemy-casualties.chip-value,
    #inGameUI #ui-tank-kills.chip-value,
    #inGameUI #ui-ship-kills.chip-value {
        width: 9ch;
        min-width: 9ch;
    }
}

@media (max-width: 900px) and (orientation: portrait) {
    #inGameUI {
        --wod-m-pad: 9px;
        --wod-m-sheet-y: calc(env(safe-area-inset-top, 0px) + 124px);
        --wod-m-dock-h: 72px;
        --wod-m-dock-toggle-h: 28px;
        --wod-m-dock-gap: calc(var(--wod-m-dock-h) + var(--wod-m-dock-toggle-h) + env(safe-area-inset-bottom, 0px) + 14px);
        --wod-sheet-h: min(56vh, calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap)));
        --wod-intel-stats-cap: min(50vh, 360px);
        --wod-map-key-cap: min(34vh, 280px);
        --wod-info-card-gap: 12px;
        --wod-info-card-inset-x: max(12px, env(safe-area-inset-left, 0px));
        --wod-info-card-max-w: min(340px, calc(100vw - 24px));
        --wod-info-card-max-h: min(44vh, 360px);
    }
    #inGameUI .wod-m-kpi-val { font-size: 13px; }
    #inGameUI .info-card {
        padding: 12px 14px 14px 12px;
        border-radius: 14px;
    }
    #inGameUI .info-card h3 { font-size: 16px; }
    #inGameUI .info-card p { font-size: 12px; }
    #inGameUI .info-stats { font-size: 12px; }
    #inGameUI .info-emblem-wrap {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
    }
    #inGameUI .unit-emblem {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        font-size: 18px;
    }
    #inGameUI .info-card .info-effects-scroll > .effect-list {
        max-height: 60px;
    }
    #inGameUI .info-card .effect-list { margin-top: 0; }
    #inGameUI .wod-m-status {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 4px minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 8px;
        row-gap: 6px;
        padding: max(8px, env(safe-area-inset-top, 0px)) 14px 9px;
        background: linear-gradient(180deg, rgba(4, 8, 16, 0.99) 0%, rgba(8, 14, 24, 0.96) 45%, rgba(12, 20, 34, 0.92) 100%);
        border-bottom: 1px solid rgba(212, 175, 55, 0.42);
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.48);
    }
    #inGameUI .wod-m-status-accent {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: stretch;
        border-radius: 5px;
        box-shadow: 0 0 14px rgba(241, 196, 15, 0.35);
        min-height: 56px;
        width: 4px;
    }
    #inGameUI .wod-m-kpis {
        grid-column: 2;
        grid-row: 1;
        flex-wrap: wrap;
        gap: 7px;
        flex: 0 0 auto;
        min-width: 0;
    }
    #inGameUI .wod-m-header-actions {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
    }
    #inGameUI .wod-m-mobile-shell {
        display: block;
    }
    #inGameUI .wod-m-kpi--wide,
    #inGameUI .wod-m-kpi--grow {
        display: none !important;
    }
    #inGameUI .wod-m-objective-hud {
        display: flex !important;
        flex-direction: column;
        grid-column: 2 / -1;
        grid-row: 2;
        min-width: 0;
        max-width: none;
        width: auto;
        margin: 0;
        justify-self: stretch;
        padding: 6px 9px 7px;
        border-radius: 10px;
        background: rgba(8, 14, 24, 0.72);
        border: 1px solid rgba(212, 175, 39, 0.38);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
        gap: 3px;
    }
    #inGameUI .wod-m-objective-label {
        font-size: 6.5px;
        letter-spacing: 0.12em;
    }
    #inGameUI .wod-m-objective-lines {
        flex-direction: column;
        gap: 2px;
    }
    #inGameUI .wod-m-objective-mode {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        font-size: 9.5px;
        line-height: 1.2;
        font-weight: 800;
    }
    #inGameUI .wod-m-objective-rule {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 9px;
        line-height: 1.3;
        color: rgba(189, 195, 199, 0.96);
    }
    #inGameUI .wod-m-kpi {
        padding: 6px 10px;
        border-radius: 12px;
        background: rgba(8, 14, 22, 0.92);
        border-color: rgba(212, 175, 55, 0.42);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
    #inGameUI .wod-m-meta-chip {
        font-size: 10px;
        padding: 7px 11px;
        letter-spacing: 0.06em;
    }
    #inGameUI .wod-m-dock-pack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: fixed;
        left: 0;
        right: 0;
        bottom: env(safe-area-inset-bottom, 0px);
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        z-index: 9;
        pointer-events: none;
        background: transparent;
        overflow: visible;
    }
    #inGameUI .wod-m-dock-pack > * {
        pointer-events: none;
    }
    #inGameUI .wod-m-dock-clip {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        width: 100%;
        max-height: 220px;
        overflow: hidden;
        pointer-events: none;
        background: transparent;
    }
    #inGameUI .wod-m-dock-clip > * {
        pointer-events: auto;
    }
    #inGameUI .wod-m-dock-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        flex-shrink: 0;
        appearance: none;
        -webkit-appearance: none;
        width: 56px;
        min-height: 30px;
        height: auto;
        margin: 0;
        padding: 6px 16px 7px;
        border-radius: 13px 13px 0 0;
        border: 1px solid rgba(212, 175, 55, 0.55);
        border-bottom: none;
        background: linear-gradient(180deg, rgba(24, 34, 50, 0.99), rgba(14, 22, 34, 0.97));
        color: #f1c40f;
        font-size: 11px;
        font-weight: 800;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 -3px 18px rgba(0, 0, 0, 0.35);
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 9;
        isolation: isolate;
        overflow: visible;
        box-sizing: border-box;
        pointer-events: auto;
        touch-action: manipulation;
    }
    #inGameUI .wod-m-dock-toggle:active,
    #inGameUI .wod-m-dock-toggle:focus-visible:active {
        opacity: 1;
        visibility: visible;
        transform: translateZ(0);
        filter: brightness(1.08);
        -webkit-filter: brightness(1.08);
    }
    #inGameUI .wod-m-dock-toggle:active .wod-m-dock-chevron {
        opacity: 1 !important;
    }
    #inGameUI .wod-m-dock-toggle .wod-m-dock-chevron {
        display: inline-block;
        line-height: 1;
        padding-bottom: 1px;
        transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
    }
    #inGameUI .wod-m-dock {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        min-height: 56px;
        padding: 4px 4px 0;
        background: rgba(8, 12, 20, 0.98);
        border: none;
        border-top: 1px solid rgba(212, 175, 55, 0.55);
        border-radius: 0;
        margin-top: -1px;
        box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.55);
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
    }
    #inGameUI .wod-m-tab {
        flex: 1 1 0;
        min-height: 52px;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        border-radius: 10px;
        border: none;
        border-right: none;
        background: transparent;
        box-shadow: none;
        color: rgba(220, 225, 230, 0.92);
        transition: background 0.15s, color 0.15s;
    }
    #inGameUI .wod-m-tab:last-child {
        border-right: none;
    }
    #inGameUI .wod-m-tab:active {
        transform: none;
    }
    #inGameUI .wod-m-tab-glyph {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 900;
        letter-spacing: 0.02em;
        background: transparent;
        border: 1px solid rgba(241, 196, 15, 0.45);
        color: #f1c40f;
        flex-shrink: 0;
    }
    #inGameUI .wod-m-tab-lbl {
        font-size: 9px;
        letter-spacing: 0.08em;
        font-weight: 800;
        text-transform: uppercase;
        opacity: 0.95;
    }
    #inGameUI .wod-m-tab.active {
        background: linear-gradient(180deg, #f1c40f 0%, #d4af37 100%);
        border-color: transparent;
        color: #0a121c;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
    #inGameUI .wod-m-tab.active .wod-m-tab-glyph {
        background: transparent;
        border: 1px solid rgba(10, 18, 28, 0.45);
        color: #0a121c;
        box-shadow: none;
    }
    #inGameUI .wod-m-tab.active .wod-m-tab-lbl {
        color: #0a121c;
        opacity: 1;
    }
    #inGameUI .wod-hud-top {
        display: contents;
    }
    #inGameUI .wod-hud-top > .top-bar {
        display: none !important;
    }
    #inGameUI .wod-m-map-bundle,
    #inGameUI .wod-m-build-bundle,
    #inGameUI .wod-m-units-bundle {
        display: contents;
    }
    #inGameUI #terrainKeyToggle,
    #inGameUI #playerSummaryToggle,
    #inGameUI .layer-toggles .layer-master {
        display: none !important;
    }
    #inGameUI #terrainKey.collapsed #terrainKeyBody,
    #inGameUI .player-summary.collapsed #playerSummaryBody {
        display: block !important;
    }
    #inGameUI #terrainKey.collapsed,
    #inGameUI .player-summary.collapsed {
        padding: 8px 10px 10px;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
    }
    #inGameUI .layer-toggles.collapsed .layer-btn:not(.layer-master) {
        display: flex !important;
    }
    #inGameUI .wod-m-sheet--map,
    #inGameUI .wod-m-sheet--build,
    #inGameUI .wod-m-sheet--units {
        display: none;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map {
        display: flex;
        flex-direction: column;
        gap: 14px;
        position: fixed;
        top: var(--wod-m-sheet-y);
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--wod-m-dock-gap) + 10px);
        z-index: 8;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 14px;
        box-sizing: border-box;
        background: rgba(10, 17, 26, 0.97);
        border: 1px solid rgba(212, 175, 55, 0.5);
        border-radius: 16px;
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map #terrainKey {
        display: block !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
        flex-shrink: 0;
        overflow: visible;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map .layer-toggles {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0;
        flex: 0 0 auto;
        overflow: visible;
        padding: 12px;
        gap: 8px;
        background: rgba(12, 20, 32, 0.92);
        border-radius: 12px;
        border: 1px solid rgba(212, 175, 55, 0.4);
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: var(--wod-m-dock-gap);
        max-height: min(300px, 38vh);
        z-index: 8;
        overflow: hidden;
        padding: 10px 14px 12px;
        box-sizing: border-box;
        background: rgba(15, 25, 35, 0.94);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: none;
        border-top: 2px solid rgba(212, 175, 55, 0.95);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .wod-m-sheet-banner,
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .wod-m-sheet-banner {
        flex: 0 0 auto;
        padding: 8px 10px;
        margin: 0 0 10px 0;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .wod-m-sheet-sub,
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .wod-m-sheet-sub {
        display: none;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .bottom-bar {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-height: none !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 0;
        margin: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .build-btn {
        width: 100%;
        flex-shrink: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        font-size: 12px;
        min-height: 46px;
        padding: 10px 12px;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: var(--wod-m-dock-gap);
        max-height: min(300px, 38vh);
        z-index: 8;
        overflow: hidden;
        padding: 10px 14px 12px;
        box-sizing: border-box;
        background: rgba(15, 25, 35, 0.94);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: none;
        border-top: 2px solid rgba(212, 175, 55, 0.95);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .bottom-bar {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-height: none !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 0;
        margin: 0;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .build-btn {
        width: 100%;
        flex-shrink: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        font-size: 12px;
        min-height: 46px;
        padding: 10px 12px;
    }
    #inGameUI .resource-section-chips { flex-wrap: wrap; justify-content: center; gap: 5px; }
    #inGameUI .resource-chip { padding: 5px 8px; font-size: 9px; }
    #inGameUI .resource-combat-split { flex-wrap: wrap; gap: 8px; justify-content: center; }
    #inGameUI .resources-divider-inline { display: none; }
    #inGameUI .resources {
        display: none;
    }
    #inGameUI .bottom-bar {
        display: none !important;
    }
    #inGameUI .info-card {
        position: fixed;
        z-index: 10;
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-info-card-gap));
        left: var(--wod-info-card-inset-x);
        right: auto;
        top: auto;
        width: calc(100vw - var(--wod-info-card-inset-x) - max(10px, env(safe-area-inset-right, 0px)));
        max-width: var(--wod-info-card-max-w);
        margin: 0;
        padding: 12px 14px 12px 12px;
        border-radius: 14px;
        border-width: 1px;
        border-color: var(--wod-gold);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(165deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 20, 0.99));
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        font-size: 11px;
        max-height: var(--wod-info-card-max-h);
    }
    #inGameUI[data-mtab] .info-card.visible {
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-sheet-h) + var(--wod-info-card-gap));
        max-height: min(var(--wod-info-card-max-h), calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap) - var(--wod-info-card-gap) - 16px));
    }
    #inGameUI[data-infocard="peek"] .info-card.visible {
        left: var(--wod-info-card-inset-x);
        right: auto;
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-info-card-gap));
    }
    #inGameUI .info-card h3 {
        font-size: 15px;
        line-height: 1.2;
    }
    #inGameUI .info-card p {
        font-size: 11px;
        margin-bottom: 5px;
    }
    #inGameUI .info-stats {
        font-size: 11px;
        gap: 5px;
    }
    #inGameUI .info-identity {
        gap: 8px;
        margin-bottom: 6px;
    }
    #inGameUI .info-emblem-wrap {
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
    }
    #inGameUI .unit-emblem {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        font-size: 17px;
    }
    #inGameUI .info-veteran-badge {
        width: 14px;
        height: 14px;
        font-size: 9px;
        line-height: 14px;
    }
    #inGameUI .info-card .info-effects-scroll {
        padding: 5px;
    }
    #inGameUI .info-card .info-effects-scroll > .effect-list {
        max-height: 56px;
    }
    #inGameUI .info-card .effect-list {
        margin-top: 0;
        gap: 4px;
    }
    #inGameUI .info-card .effect-pill {
        font-size: 9px;
        padding: 2px 6px;
    }
    #inGameUI .info-card .effect-pill-stat {
        font-size: 8px;
    }
    #inGameUI .info-card-pager {
        margin-top: 6px;
        padding-top: 6px;
    }
    #inGameUI .info-card-page-btn {
        width: 30px;
        height: 26px;
        font-size: 16px;
    }
    #inGameUI .info-card-page-label {
        font-size: 10px;
    }
    #inGameUI .info-record-head {
        font-size: 11px;
        margin-bottom: 6px;
    }
    #inGameUI .info-record-grid {
        gap: 6px 8px;
    }
    #inGameUI .info-record-item {
        padding: 6px 7px;
    }
    #inGameUI .info-record-item strong {
        font-size: 13px;
    }
    #inGameUI .info-order-btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    #inGameUI .info-deselect-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Reference-style portrait HUD: one compact top rail and a full-width order sheet. */
    #inGameUI {
        --wod-m-sheet-y: calc(env(safe-area-inset-top, 0px) + 76px);
        --wod-m-dock-h: 62px;
        --wod-m-dock-toggle-h: 0px;
        --wod-m-dock-gap: calc(var(--wod-m-dock-h) + env(safe-area-inset-bottom, 0px));
        --wod-info-card-gap: 0px;
        --wod-info-card-inset-x: max(12px, env(safe-area-inset-left, 0px));
        --wod-info-card-max-w: calc(100vw - 24px);
        --wod-info-card-max-h: min(46vh, 390px);
    }
    #inGameUI .wod-m-status {
        grid-template-columns: minmax(136px, 0.96fr) minmax(124px, 1.08fr) auto;
        grid-template-rows: auto;
        column-gap: 7px;
        row-gap: 0;
        min-height: 64px;
        padding: max(7px, env(safe-area-inset-top, 0px)) 10px 8px;
        background: linear-gradient(180deg, rgba(3, 9, 16, 0.985), rgba(7, 17, 28, 0.96));
        border-bottom-color: rgba(217, 169, 76, 0.48);
        box-shadow: 0 8px 26px rgba(0, 0, 0, 0.46);
    }
    #inGameUI .wod-m-status-accent {
        display: none;
    }
    #inGameUI .wod-m-kpis {
        grid-column: 1;
        grid-row: 1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        min-width: 0;
        overflow: hidden;
        border: 1px solid rgba(217, 169, 76, 0.55);
        border-radius: 11px;
        background: rgba(8, 16, 25, 0.9);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 2px 8px rgba(0,0,0,0.28);
    }
    #inGameUI .wod-m-resource-card {
        min-width: 0;
        min-height: 46px;
        padding: 5px 6px;
        gap: 6px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        box-sizing: border-box;
    }
    #inGameUI .wod-m-resource-card + .wod-m-resource-card {
        border-left: 1px solid rgba(217, 169, 76, 0.42);
    }
    #inGameUI .wod-m-resource-mark { font-size: 18px; }
    #inGameUI .wod-m-resource-mark--mp { font-size: 7px; }
    #inGameUI .wod-m-resource-values { overflow: hidden; }
    #inGameUI .wod-m-resource-card .wod-m-kpi-val {
        min-width: 0;
        margin-top: 0;
        font-size: 11px;
        line-height: 1.05;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #inGameUI .wod-m-resource-rate {
        margin-top: 4px;
        font-size: 7.5px;
    }
    #inGameUI .wod-m-objective-hud {
        display: flex !important;
        grid-column: 2;
        grid-row: 1;
        flex-direction: row;
        align-items: center;
        align-self: stretch;
        gap: 7px;
        min-width: 0;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 5px 7px;
        border-radius: 11px;
        background: rgba(8, 16, 25, 0.9);
        border-color: rgba(217, 169, 76, 0.55);
        box-sizing: border-box;
    }
    #inGameUI .wod-m-objective-icon {
        flex-basis: 23px;
        width: 23px;
        height: 23px;
        border-width: 1.5px;
    }
    #inGameUI .wod-m-objective-icon::before { top: -4px; height: 29px; width: 1.5px; }
    #inGameUI .wod-m-objective-icon::after { left: -4px; width: 29px; height: 1.5px; }
    #inGameUI .wod-m-objective-icon span { inset: 5px; border-width: 1.5px; }
    #inGameUI .wod-m-objective-label {
        font-size: 5.5px;
        letter-spacing: 0.12em;
    }
    #inGameUI .wod-m-objective-lines { gap: 1px; }
    #inGameUI .wod-m-objective-mode {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 9px;
        line-height: 1.1;
    }
    #inGameUI .wod-m-objective-rule {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 7px;
        line-height: 1.18;
    }
    #inGameUI .wod-m-header-actions {
        grid-column: 3;
        grid-row: 1;
        gap: 4px;
    }
    #inGameUI .wod-m-meta-chip {
        min-width: 38px;
        min-height: 42px;
        padding: 6px 7px;
        border-radius: 11px;
        font-size: 9px;
        box-sizing: border-box;
    }
    #inGameUI .wod-m-menu-btn {
        min-height: 42px;
        padding: 7px 8px;
        border-radius: 11px;
        font-size: 9px;
        background: rgba(15, 27, 41, 0.96);
    }
    #inGameUI .wod-m-menu-btn::before {
        content: '☰';
        margin-right: 4px;
        color: #d9a94c;
        font-size: 11px;
    }
    #inGameUI .wod-m-dock-toggle { display: none !important; }
    #inGameUI .wod-m-dock-clip { max-height: 70px; }
    #inGameUI .wod-m-dock {
        min-height: var(--wod-m-dock-h);
        height: var(--wod-m-dock-h);
        padding: 3px 5px max(3px, env(safe-area-inset-bottom, 0px));
        gap: 3px;
        background: rgba(5, 13, 22, 0.985);
        border-top: 1px solid rgba(217, 169, 76, 0.52);
    }
    #inGameUI .wod-m-tab {
        min-height: 54px;
        gap: 2px;
        padding: 4px 3px;
        border-radius: 10px;
        color: rgba(203, 205, 198, 0.82);
    }
    #inGameUI .wod-m-tab-glyph,
    #inGameUI .wod-m-tab.active .wod-m-tab-glyph {
        width: 27px;
        height: 27px;
        padding: 2px;
        box-sizing: border-box;
        border: none;
        border-radius: 0;
        background: transparent;
        color: #d9a94c;
    }
    #inGameUI .wod-m-tab-lbl {
        font-size: 9px;
        font-weight: 600;
        letter-spacing: 0;
        text-transform: none;
    }
    #inGameUI .wod-m-tab.active {
        background: rgba(16, 26, 39, 0.9);
        color: #f2f1ea;
        box-shadow: inset 0 0 0 1.5px #d9a94c;
    }
    #inGameUI:not([data-mtab]) .wod-m-tab[data-wod-mtab="map"] {
        background: rgba(16, 26, 39, 0.9);
        color: #f2f1ea;
        box-shadow: inset 0 0 0 1.5px #d9a94c;
    }
    #inGameUI .info-card {
        right: max(12px, env(safe-area-inset-right, 0px));
        width: auto;
        max-width: none;
        padding: 13px 14px 12px;
        border-radius: 14px;
        background: linear-gradient(160deg, rgba(8, 20, 31, 0.975), rgba(5, 13, 22, 0.99));
        border-color: #d9a94c;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-sheet-head {
        gap: 9px;
        padding-right: 0;
    }
    #inGameUI .info-card.info-card--mobile-orders h3 {
        font-size: 14px;
        letter-spacing: -0.012em;
    }
    #inGameUI .info-card.info-card--mobile-orders #infoCardPage0 h3 {
        font-size: 13px;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-kpi-row {
        grid-template-columns: repeat(3, minmax(52px, 1fr));
        gap: 7px;
        margin-left: auto;
        flex: 1 1 auto;
        max-width: 240px;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-kpi {
        min-height: 50px;
        padding: 5px 4px;
        border-color: rgba(217, 169, 76, 0.42);
        background: rgba(13, 23, 32, 0.92);
    }
    #inGameUI .info-mobile-orders-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 5px;
    }
    #inGameUI .info-card--multi .info-mobile-orders-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    #inGameUI .info-card.info-card--mobile-orders .info-mobile-orders {
        margin-top: 9px;
        padding-top: 9px;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-order-btn {
        min-height: 48px;
        padding: 6px 2px;
        border-radius: 9px;
        font-size: 8.5px;
        letter-spacing: 0;
        text-transform: none;
        background: linear-gradient(180deg, #17324c, #102338);
        border-color: rgba(217, 169, 76, 0.42);
        color: #ecf0f1;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-order-btn .info-order-ico {
        color: #d9a94c;
    }
    #inGameUI .info-card.info-card--mobile-orders .info-order-btn.active {
        background: linear-gradient(180deg, #2ecc71 0%, #1e9e4f 100%);
        border-color: #58d68d;
        color: #08140d;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 10px rgba(46, 204, 113, 0.28);
    }
    #inGameUI .info-card.info-card--mobile-orders .info-order-btn.active .info-order-ico {
        color: #08140d;
    }
    #inGameUI .info-card.info-card--mobile-orders:not(.info-card--more-open) .info-deselect-wrap {
        display: none !important;
    }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 932px) {
    #inGameUI {
        --wod-m-pad: 6px;
        --wod-m-tab-fs: 10px;
        --wod-m-land-shelf: 44px;
        --wod-m-sheet-y: calc(env(safe-area-inset-top, 0px) + var(--wod-m-land-shelf) + 6px);
        --wod-m-dock-h: 58px;
        --wod-m-dock-toggle-h: 26px;
        --wod-m-dock-gap: calc(var(--wod-m-dock-h) + var(--wod-m-dock-toggle-h) + env(safe-area-inset-bottom, 0px) + 12px);
        --wod-sheet-w: min(100%, calc(100vw - 20px));
        --wod-sheet-h: calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap));
        --wod-intel-stats-cap: min(40vh, 260px);
        --wod-map-key-cap: min(32vh, 200px);
        --wod-info-card-gap: 8px;
        --wod-info-card-inset-x: max(8px, env(safe-area-inset-left, 0px));
        --wod-info-card-max-w: min(252px, calc(46vw - 12px));
        --wod-info-card-max-h: min(calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap) - 20px), 280px);
    }
    #inGameUI .wod-m-mobile-shell {
        display: flex;
        flex-direction: row;
        align-items: center;
        position: fixed;
        left: 0;
        right: 0;
        top: env(safe-area-inset-top, 0px);
        width: 100%;
        height: auto;
        min-height: var(--wod-m-land-shelf);
        z-index: 9;
        padding: 4px 10px 5px;
        background: linear-gradient(180deg, rgba(8, 14, 24, 0.97), rgba(10, 18, 30, 0.93));
        border-bottom: 1px solid rgba(212, 175, 55, 0.42);
        box-shadow: 0 6px 26px rgba(0, 0, 0, 0.4);
        overflow: visible;
    }
    #inGameUI .wod-m-status {
        flex: 1 1 auto;
        min-width: 0;
        position: relative;
        padding: 0 8px 0 0;
        border: none;
        background: transparent;
    }
    #inGameUI .wod-m-status-accent {
        height: 22px;
        width: 3px;
    }
    #inGameUI .wod-m-kpis {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        align-items: stretch;
    }
    #inGameUI .wod-m-kpi {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        flex: 0 1 auto;
        padding: 4px 8px;
        min-width: 0;
    }
    #inGameUI .wod-m-kpi-lbl { font-size: 6px; }
    #inGameUI .wod-m-kpi-val { font-size: 10px; margin-top: 2px; margin-left: 0; }
    #inGameUI .wod-m-kpi--wide,
    #inGameUI .wod-m-kpi--grow { display: none !important; }
    #inGameUI .wod-m-header-actions { flex-shrink: 0; margin-left: 6px; }
    #inGameUI .wod-m-meta-chip { font-size: 9px; padding: 5px 9px; }
    #inGameUI .wod-m-objective-hud {
        display: flex !important;
        max-width: 42vw;
        padding: 3px 7px;
    }
    #inGameUI .wod-m-dock-pack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: fixed;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        bottom: env(safe-area-inset-bottom, 0px);
        z-index: 9;
        pointer-events: none;
        background: transparent;
        overflow: visible;
    }
    #inGameUI .wod-m-dock-pack > * {
        pointer-events: none;
    }
    #inGameUI .wod-m-dock-clip {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        width: 100%;
        max-height: 200px;
        overflow: hidden;
        pointer-events: none;
        background: transparent;
    }
    #inGameUI .wod-m-dock-clip > * {
        pointer-events: auto;
    }
    #inGameUI .wod-m-dock-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        flex-shrink: 0;
        appearance: none;
        -webkit-appearance: none;
        width: 54px;
        min-height: 28px;
        height: auto;
        margin: 0;
        padding: 5px 14px 6px;
        border-radius: 11px 11px 0 0;
        border: 1px solid rgba(212, 175, 55, 0.55);
        border-bottom: none;
        background: linear-gradient(180deg, rgba(24, 34, 50, 0.99), rgba(14, 22, 34, 0.97));
        color: #f1c40f;
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.32);
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 9;
        isolation: isolate;
        overflow: visible;
        box-sizing: border-box;
        pointer-events: auto;
        touch-action: manipulation;
    }
    #inGameUI .wod-m-dock-toggle:active,
    #inGameUI .wod-m-dock-toggle:focus-visible:active {
        opacity: 1;
        visibility: visible;
        transform: translateZ(0);
        filter: brightness(1.08);
        -webkit-filter: brightness(1.08);
    }
    #inGameUI .wod-m-dock-toggle:active .wod-m-dock-chevron {
        opacity: 1 !important;
    }
    #inGameUI .wod-m-dock-toggle .wod-m-dock-chevron {
        display: inline-block;
        line-height: 1;
        padding-bottom: 1px;
        transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
    }
    #inGameUI .wod-m-dock {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
        flex: none;
        width: 100%;
        box-sizing: border-box;
        flex-direction: row;
        align-items: stretch;
        justify-content: stretch;
        min-height: 54px;
        padding: 0;
        gap: 0;
        border-radius: 0;
        margin-top: -1px;
        border: none;
        border-top: 2px solid #d4af37;
        font-size: var(--wod-m-tab-fs);
        background: rgba(10, 18, 28, 0.98);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        transition: background 0.12s ease, box-shadow 0.12s ease;
    }
    #inGameUI .wod-m-dock .wod-m-tab {
        flex: 1 1 0;
        max-width: none;
        min-height: 54px;
        flex-direction: row;
        gap: 8px;
        border-radius: 0;
        border: none;
        border-right: 1px solid rgba(212, 175, 55, 0.28);
        background: transparent;
        box-shadow: none;
        color: rgba(189, 195, 199, 0.96);
        padding: 8px 6px;
    }
    #inGameUI .wod-m-dock .wod-m-tab:last-child {
        border-right: none;
    }
    #inGameUI .wod-m-tab:active { transform: none; }
    #inGameUI .wod-m-tab.active {
        background: linear-gradient(180deg, #f1c40f 0%, #d4af37 100%);
        color: #0a121c;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
        border-color: transparent;
    }
    #inGameUI .wod-m-tab-glyph {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 900;
        background: rgba(0, 0, 0, 0.32);
        border: 1px solid rgba(241, 196, 15, 0.22);
        color: #f1c40f;
        flex-shrink: 0;
    }
    #inGameUI .wod-m-tab.active .wod-m-tab-glyph {
        background: rgba(10, 18, 28, 0.12);
        border-color: rgba(10, 18, 28, 0.35);
        color: #0a121c;
    }
    #inGameUI .wod-m-tab-lbl {
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
        max-width: 100%;
        word-break: break-word;
    }
    #inGameUI .wod-hud-top {
        display: contents;
    }
    #inGameUI .wod-hud-top > .top-bar {
        display: none !important;
    }
    #inGameUI .wod-m-map-bundle,
    #inGameUI .wod-m-build-bundle,
    #inGameUI .wod-m-units-bundle {
        display: contents;
    }
    #inGameUI #terrainKeyToggle,
    #inGameUI #playerSummaryToggle,
    #inGameUI .layer-toggles .layer-master {
        display: none !important;
    }
    #inGameUI #terrainKey.collapsed #terrainKeyBody,
    #inGameUI .player-summary.collapsed #playerSummaryBody {
        display: block !important;
    }
    #inGameUI #terrainKey.collapsed,
    #inGameUI .player-summary.collapsed {
        padding: 8px 10px 10px;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
    }
    #inGameUI .layer-toggles.collapsed .layer-btn:not(.layer-master) {
        display: flex !important;
    }
    #inGameUI .wod-m-sheet--map,
    #inGameUI .wod-m-sheet--build,
    #inGameUI .wod-m-sheet--units {
        display: none;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map {
        display: flex;
        flex-direction: column;
        gap: 12px;
        position: fixed;
        top: var(--wod-m-sheet-y);
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        width: auto;
        transform: none;
        max-width: none;
        bottom: calc(var(--wod-m-dock-gap) + 8px);
        z-index: 8;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px;
        box-sizing: border-box;
        background: rgba(10, 17, 26, 0.97);
        border: 1px solid rgba(212, 175, 55, 0.5);
        border-radius: 14px;
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map #terrainKey {
        display: block !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: auto !important;
        max-height: none !important;
        flex-shrink: 0;
        overflow: visible;
    }
    #inGameUI[data-mtab="map"] .wod-m-sheet--map .layer-toggles {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: auto !important;
        max-height: none !important;
        margin: 0;
        flex: 0 0 auto;
        overflow: visible;
        padding: 10px;
        gap: 8px;
        background: rgba(12, 20, 32, 0.92);
        border-radius: 12px;
        border: 1px solid rgba(212, 175, 55, 0.4);
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: var(--wod-m-dock-gap);
        width: auto;
        transform: none;
        max-width: none;
        max-height: min(280px, 42vh);
        z-index: 8;
        overflow: hidden;
        padding: 10px 14px 12px;
        box-sizing: border-box;
        background: rgba(15, 25, 35, 0.94);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: none;
        border-top: 2px solid rgba(212, 175, 55, 0.95);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .wod-m-sheet-banner,
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .wod-m-sheet-banner {
        flex: 0 0 auto;
        padding: 8px 10px;
        margin: 0 0 8px 0;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .wod-m-sheet-sub,
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .wod-m-sheet-sub {
        display: none;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .bottom-bar {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-height: none !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 0;
        margin: 0;
        transform: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #inGameUI[data-mtab="build"] .wod-m-sheet--build .build-btn {
        width: 100%;
        flex-shrink: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        font-size: 12px;
        min-height: 44px;
        padding: 10px 12px;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: auto !important;
        left: max(8px, env(safe-area-inset-left, 0px));
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: var(--wod-m-dock-gap);
        width: auto;
        transform: none;
        max-width: none;
        max-height: min(280px, 42vh);
        z-index: 8;
        overflow: hidden;
        padding: 10px 14px 12px;
        box-sizing: border-box;
        background: rgba(15, 25, 35, 0.94);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: none;
        border-top: 2px solid rgba(212, 175, 55, 0.95);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
        pointer-events: auto;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .bottom-bar {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-height: none !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 0;
        margin: 0;
        transform: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #inGameUI[data-mtab="units"] .wod-m-sheet--units .build-btn {
        width: 100%;
        flex-shrink: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        font-size: 12px;
        min-height: 44px;
        padding: 10px 12px;
    }
    #inGameUI .resource-section-chips { flex-wrap: wrap; justify-content: center; gap: 4px; }
    #inGameUI .resource-chip { padding: 4px 7px; font-size: 8px; }
    #inGameUI .resources {
        display: none !important;
    }
    #inGameUI .bottom-bar {
        display: none !important;
    }
    #inGameUI .info-card {
        position: fixed;
        z-index: 10;
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-info-card-gap));
        left: var(--wod-info-card-inset-x);
        right: auto;
        top: auto;
        width: calc(100vw - var(--wod-info-card-inset-x) - max(8px, env(safe-area-inset-right, 0px)));
        max-width: var(--wod-info-card-max-w);
        margin: 0;
        padding: 10px 12px 12px;
        max-height: var(--wod-info-card-max-h);
        border-radius: 12px;
        border-width: 1px;
        border-color: var(--wod-gold);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(165deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 20, 0.99));
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        font-size: 10px;
    }
    #inGameUI[data-mtab] .info-card.visible {
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-sheet-h) + var(--wod-info-card-gap));
        max-height: min(var(--wod-info-card-max-h), calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap) - var(--wod-info-card-gap) - 12px));
    }
    #inGameUI[data-infocard="peek"] .info-card.visible {
        left: var(--wod-info-card-inset-x);
        right: auto;
        bottom: calc(var(--wod-m-dock-gap) + var(--wod-info-card-gap));
    }
    #inGameUI .info-card.visible .info-card-edge-toggle {
        display: none !important;
    }
    #inGameUI .info-card h3 { font-size: 13px; }
    #inGameUI .info-card p { font-size: 10px; margin-bottom: 4px; }
    #inGameUI .info-stats { font-size: 10px; gap: 4px; }
    #inGameUI .info-emblem-wrap {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }
    #inGameUI .unit-emblem {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        font-size: 15px;
    }
    #inGameUI .info-card .info-effects-scroll {
        padding: 4px;
    }
    #inGameUI .info-card .info-effects-scroll > .effect-list {
        max-height: 44px;
        margin-top: 0;
    }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 700px) {
    #inGameUI {
        --wod-m-tab-fs: 9px;
        --wod-sheet-w: min(360px, calc(100vw - 16px));
    }
    #inGameUI .wod-m-kpi-val { font-size: 9px; }
}
@media (max-height: 520px) and (orientation: landscape) and (min-width: 701px) and (max-width: 840px) {
    #inGameUI { --wod-m-tab-fs: 10px; --wod-sheet-w: min(400px, calc(100vw - 20px)); }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 932px) {
    #mainMenu.overlay {
        justify-content: center;
        align-items: center;
        padding: max(6px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    }
    #mainMenu .main-menu-land-wrap {
        display: grid;
        grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.15fr);
        gap: 12px 18px;
        align-items: center;
        width: min(720px, 96vw);
        max-width: 100%;
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #mainMenu .main-menu-hero {
        text-align: left;
    }
    #mainMenu .main-menu-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        align-content: start;
        width: 100%;
    }
    #mainMenu .main-menu-btns .menu-btn {
        width: 100%;
        margin: 0;
        padding: 10px 12px;
        font-size: clamp(12px, 2.5vh, 15px);
    }
    #mainMenu h1 {
        font-size: clamp(20px, 5.5vh, 36px);
        margin: 0 0 6px 0;
    }
}

#campaignPanel.overlay,
#shopPanel.overlay,
#missionsPanel.overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}
#campaignPanel .wod-camp-panel,
#shopPanel .panel.panel-wide,
#missionsPanel .panel.panel-wide {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
    padding: 18px 22px 14px;
    box-sizing: border-box;
}
#campaignPanel .wod-camp-header,
#campaignPanel .wod-camp-bottom,
#missionsPanel h2,
#missionsPanel .wod-mission-source-tabs,
#missionsPanel .wod-map-lib-sub,
#missionsPanel .wod-mission-footer,
#shopPanel .panel > h2,
#shopPanel .supporter-pack,
#shopPanel .shop-tabs {
    flex: 0 0 auto;
}
#campaignPanel .wod-camp-kicker {
    margin: 0 0 2px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #d4af37;
    font-weight: 700;
}
#campaignPanel .wod-camp-header h2 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 32px);
}
#campaignPanel .wod-camp-header .wod-map-lib-sub {
    margin: 4px 0 0;
    max-width: 62ch;
}
#campaignPanel .wod-camp-status {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    align-content: flex-start;
    gap: 8px;
    text-align: left;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    max-width: 58%;
    white-space: normal;
}
#campaignPanel .wod-camp-chip {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: #d9e6f2;
    white-space: nowrap;
}
#campaignPanel .wod-camp-chip b {
    color: #d4af37;
    font-variant-numeric: tabular-nums;
}
#campaignPanel .wod-camp-layout {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    gap: 16px;
}
#campaignPanel .wod-camp-map-col {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
}
#campaignPanel #wodCampMapCanvas {
    width: 100%;
    height: 0;
    max-height: none;
    flex: 1 1 auto;
    min-height: 180px;
    object-fit: contain;
    background: #0c1a28;
}
#campaignPanel .wod-camp-stats:empty {
    display: none;
}
#campaignPanel .wod-camp-side,
#campaignPanel .wod-camp-orders {
    flex: 1 1 300px;
    width: auto;
    min-width: 260px;
    max-width: 420px;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#campaignPanel .wod-camp-orders .wod-camp-region-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#campaignPanel .wod-camp-setup,
#campaignPanel .wod-camp-side-active {
    flex: 1 1 auto;
    min-height: 0;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
}
#campaignPanel .wod-camp-setup {
    overflow: auto;
    flex-direction: column;
}
#campaignPanel .wod-camp-setup h3,
#campaignPanel .wod-camp-card-label {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d4af37;
}
#campaignPanel .wod-camp-set-lead {
    margin: 0 0 12px;
    color: #b7c6d4;
    font-size: 0.9rem;
    line-height: 1.45;
}
#campaignPanel .wod-camp-setup .setup-row,
#campaignPanel .wod-camp-side-active .setup-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0 0 12px;
}
#campaignPanel .wod-camp-setup .setup-row select,
#campaignPanel .wod-camp-side-active .setup-row select {
    width: 100%;
}
#campaignPanel .wod-camp-set-hint {
    margin: 4px 0 14px;
}
#campaignPanel .wod-camp-setup-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}
#campaignPanel .wod-camp-setup .menu-btn,
#campaignPanel .wod-camp-launch {
    width: 100% !important;
    max-width: none;
    margin: 0;
}
#campaignPanel .wod-camp-launch {
    background: linear-gradient(180deg, #2ecc71 0%, #1e8f4d 100%);
    color: #08140d;
    border-color: #8dffc0;
}
#campaignPanel .wod-camp-launch:disabled {
    background: linear-gradient(180deg, #243140 0%, #1a2533 100%);
    color: #8aa0b4;
    border-color: rgba(255, 255, 255, 0.16);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
#campaignPanel .wod-camp-side-active {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
#campaignPanel .wod-camp-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    min-height: 0;
}
#campaignPanel .wod-camp-region-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: none;
    min-height: 0;
}
#campaignPanel .wod-camp-node-info {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    margin: 0;
}
#campaignPanel .wod-camp-army-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
#campaignPanel .wod-camp-roster {
    flex: 1 1 auto;
    max-height: none;
    min-height: 140px;
    overflow: auto;
}
#campaignPanel .wod-camp-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}
#campaignPanel .wod-camp-log {
    grid-column: 1;
    max-height: min(22vh, 180px);
    min-height: 72px;
    margin: 0;
}
#campaignPanel .wod-camp-log:empty,
#campaignPanel .wod-camp-log[style*="display: none"],
#campaignPanel .wod-camp-log[style*="display:none"] {
    display: none;
}
#campaignPanel .wod-camp-footer {
    grid-column: 2;
    width: auto;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
}
#campaignPanel .wod-camp-footer-left,
#campaignPanel .wod-camp-footer-right {
    flex: 0 0 auto;
    width: auto;
}
#campaignPanel .wod-camp-footer .menu-btn {
    width: 168px !important;
    max-width: none;
    margin: 0;
}
#campaignPanel .wod-camp-footer-right:empty,
#campaignPanel #wodCampResetBtn[style*="display: none"],
#campaignPanel #wodCampResetBtn[style*="display:none"] {
    display: none;
}
#shopPanel .panel > p {
    margin-bottom: 10px;
}
#shopPanel .shop-tab-pane.active {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
#shopPanel .shop-preview-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
#shopPanel .skin-grid {
    max-width: none;
}
#shopMapOptions.shop-codex,
#wodMissionList.wod-mission-codex {
    display: grid;
    grid-template-columns: repeat(auto-fill, 148px);
    grid-auto-rows: 148px;
    gap: 12px;
    justify-content: start;
    align-content: start;
}
.shop-codex-card,
.wod-mission-codex-card {
    box-sizing: border-box;
    width: 148px;
    height: 148px;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: #0c1824;
    color: #fff;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.shop-codex-card .shop-codex-art,
.wod-mission-codex-card .shop-codex-art {
    position: absolute;
    inset: 0;
}
.shop-codex-card canvas,
.wod-mission-codex-card canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-codex-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 8px 7px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.88) 42%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}
.shop-codex-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    background: #000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
#shopMapOptions.shop-codex { grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr)); grid-auto-rows:auto; gap:18px; }
#shopMapOptions .shop-mission-card { width:100%;height:auto;min-height:275px;display:flex;flex-direction:column;border-radius:12px;background:#102333; }
#shopMapOptions .shop-mission-card .shop-codex-art { position:relative;inset:auto;display:block;width:100%;height:160px;border-bottom:1px solid rgba(212,175,55,.3); }
#shopMapOptions .shop-mission-card canvas { object-fit:contain; background:#154360; }
#shopMapOptions .shop-mission-card .shop-codex-name { position:static;background:none;display:block;padding:12px 14px 0;font-size:16px;line-height:1.3; }
#shopMapOptions .shop-mission-meta { display:block;padding:6px 14px 0;color:#dfc57e;font-size:11px;line-height:1.4; }
#shopMapOptions .shop-mission-description { display:block;padding:8px 14px 14px;color:#c5d5df;font-size:12px;line-height:1.5; }
#shopMapOptions .shop-mission-card:focus-visible { outline:3px solid #f1c40f;outline-offset:3px; }
.shop-codex-unknown {
    box-sizing: border-box;
    width: 148px;
    height: 148px;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid #1a1a1a;
    pointer-events: none;
    user-select: none;
}
.shop-codex-card.shop-visual-locked {
    filter: grayscale(0.35);
}
.shop-codex-card.shop-mission-spent,
.wod-mission-codex-card.spent {
    opacity: 0.7;
}
.wod-mission-codex-card.active {
    border-color: #2ecc71;
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.7);
}
#wodMissionList.wod-mission-codex {grid-auto-rows:auto;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));}
#wodMissionList .wod-mission-codex-card {width:100%;height:160px;border-radius:9px;}
#wodMissionList .wod-mission-codex-card.locked {filter:saturate(.35);opacity:.65;}
.wod-store-pack-heading {grid-column:1/-1;display:flex;flex-direction:column;gap:6px;padding:16px 2px 3px;color:#f2d890;line-height:1.4;}
.wod-store-pack-heading span {font-size:12px;color:#b9cbd8;}
#wodMissionMeta {overflow-wrap:anywhere;}
#wodMissionMeta a {color:#b8dfff;}
#missionsPanel .wod-map-lib-layout {
    flex: 1 1 auto;
    min-height: 0;
    flex-wrap: nowrap;
    align-items: stretch;
}
#missionsPanel .wod-map-lib-list-column {
    flex: 0 0 min(440px, 36vw);
    min-height: 0;
}
#missionsPanel.wod-store-codex .wod-map-lib-list-column {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
}
#missionsPanel .wod-map-lib-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
}
#missionsPanel .wod-map-lib-detail {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#missionsPanel #wodMissionPreview {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: min(48vh, 460px);
    flex: 0 1 auto;
}
#missionsPanel .wod-map-lib-meta {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 10px 0 0;
}
#missionsPanel .wod-mission-footer {
    width: 100%;
    max-width: none;
    margin: 12px 0 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
#missionsPanel .wod-mission-footer .menu-btn {
    width: auto !important;
    max-width: none;
    min-width: 180px;
    margin: 0 !important;
    flex: 0 0 auto;
}
#missionsPanel #wodMissionStartBtn {
    margin-left: auto !important;
}
@media (max-width: 900px) {
    #campaignPanel .wod-camp-layout,
    #missionsPanel .wod-map-lib-layout,
    #shopPanel .shop-preview-row {
        flex-direction: column;
        display: flex;
        grid-template-columns: none;
    }
    #campaignPanel .wod-camp-header {
        flex-direction: column;
        align-items: stretch;
    }
    #campaignPanel .wod-camp-status {
        align-items: flex-start;
        text-align: left;
        min-width: 0;
    }
    #campaignPanel .wod-camp-side,
    #campaignPanel .wod-camp-orders,
    #missionsPanel .wod-map-lib-list-column {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
        max-height: 46vh;
    }
    #campaignPanel .wod-camp-region-card {
        max-height: none;
    }
    #campaignPanel .wod-camp-bottom {
        grid-template-columns: 1fr;
    }
    #campaignPanel .wod-camp-footer,
    #campaignPanel .wod-camp-log {
        grid-column: 1;
    }
    #campaignPanel .wod-camp-footer {
        justify-content: space-between;
    }
    #campaignPanel .wod-camp-footer .menu-btn,
    #missionsPanel .wod-mission-footer .menu-btn {
        width: auto !important;
        min-width: 0;
        flex: 1 1 auto;
    }
    #missionsPanel .wod-mission-footer {
        max-width: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        justify-content: space-between;
    }
    #missionsPanel #wodMissionStartBtn {
        margin-left: auto !important;
    }
    #shopPanel .panel.panel-wide,
    #campaignPanel .wod-camp-panel,
    #missionsPanel .panel.panel-wide {
        width: 100%;
        max-width: none;
        padding: 14px 12px 12px;
    }
}


#missionsPanel.wod-store-codex .wod-map-lib-list-column {flex:0 0 36%;max-width:480px;}
#missionsPanel .wod-map-lib-detail {overflow-y:auto;padding-right:5px;}
#missionsPanel #wodMissionPreview {max-height:min(36vh,340px);object-fit:contain;}
@media(max-width:900px) {
    #missionsPanel .panel .wod-map-lib-layout {display:block;justify-content:flex-start;overflow-y:auto;flex:1 1 auto;min-height:0;}
    #missionsPanel .panel .wod-map-lib-list-column {width:100%;max-width:none;height:min(280px,38dvh);max-height:280px;flex:none;}
    #missionsPanel .panel .wod-map-lib-detail {display:block;overflow:visible;width:100%;padding:14px 0;flex:none;}
    #missionsPanel .panel #wodMissionPreview {max-height:220px;}
}

/* Battle report: fixed summary/tabs with independently scrolling details. */
#statsMenu .stats-menu-panel {width:min(1140px,96vw);max-width:1140px;height:min(940px,94dvh);max-height:94dvh;padding:24px;display:flex;flex-direction:column;overflow:hidden;border:1px solid #68808b;border-radius:18px;background:#101e28;box-shadow:0 22px 100px #0009;text-align:left;font-family:"Segoe UI",Arial,sans-serif;color:#e9f1f5;box-sizing:border-box;}
.report-header {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px;flex-shrink:0;}
#statsMenu .report-header h2 {color:#f3f6f8;margin:0;font-size:28px;line-height:1.2;letter-spacing:-.02em;text-align:left;}
.report-eyebrow {font-size:10px!important;letter-spacing:.14em;color:#a0bac8!important;margin:0 0 5px!important;}
#statsMenu .report-close {width:auto;min-width:0;min-height:40px;padding:8px 14px;margin:0;font:600 12px "Segoe UI",Arial,sans-serif;flex-shrink:0;}
.report-identity {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0 12px;font-size:14px;color:#d4e5ed;flex-shrink:0;}
.report-identity strong {display:flex;align-items:center;gap:8px;font-size:15px;}
.report-identity i {display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--side);box-shadow:0 0 0 3px #ffffff0c;}
.report-identity>span {font-size:12px;color:#a7bdca;text-align:right;}
.battle-overview {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 16px;flex-shrink:0;}
.battle-stat {display:flex;flex-direction:column;gap:6px;padding:13px;border-radius:9px;background:#203440;border:1px solid #7893a12b;min-width:0;}
.battle-stat>span {color:#c0d0d9;font-size:12px;line-height:1.4;overflow-wrap:anywhere;}
.battle-stat strong {font-size:21px;line-height:1.25;font-weight:650;font-variant-numeric:tabular-nums;color:#f2f6f8;overflow-wrap:anywhere;}
.battle-stat small {font-size:11px;line-height:1.4;color:#b0c5d0;}
.battle-overview .battle-stat {background:#1d3540;border-color:#779d9959;}
.battle-overview .battle-stat strong {font-size:27px;color:#f4dc9e;}
#statsMenu .stats-menu-body {display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden;gap:0;}
#statsMenu .stats-m-tabs {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:static;gap:5px;padding:5px;margin:0 0 14px;background:#091720;border:1px solid #69849166;border-radius:10px;flex-shrink:0;}
#statsMenu .stats-m-tab {min-width:0;min-height:44px;border:0;border-radius:6px;background:transparent;color:#c7d7df;cursor:pointer;font:600 14px "Segoe UI",Arial,sans-serif;padding:10px 6px;}
#statsMenu .stats-m-tab.active {background:#e6ce91;color:#15252c;box-shadow:0 2px 6px #0003;}
#statsMenu .stats-m-tab:focus-visible {outline:2px solid #fff0bc;outline-offset:1px;}
#statsMenu .stats-m-pages {display:block;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 6px 4px 0;}
#statsMenu .stats-m-page {display:none;min-width:0;overflow:visible;max-height:none;padding:0;}
#statsMenu .stats-m-page.active:not([hidden]) {display:grid;gap:16px;}
#statsMenu .stats-m-page[hidden] {display:none!important;}
.report-page-heading h3 {font-size:20px;color:#f0f5f7;margin:0 0 5px;text-align:left;}
.report-page-heading p {font-size:13px!important;line-height:1.5;color:#aec4d0!important;margin:0!important;text-align:left;}
.battle-details {display:grid;gap:16px;min-width:0;}
.battle-section {border:1px solid #7893a14a;border-radius:12px;padding:17px;background:#152833;min-width:0;}
.battle-section h3 {font-size:15px;line-height:1.3;margin:0 0 14px;padding-bottom:11px;border-bottom:1px solid #7893a138;color:#e8f2f6;font-weight:650;text-align:left;}
.battle-stat-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
#statsMenu .resource-chip.report-metric {display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:13px;margin:0;min-width:0;border:1px solid #7893a12b;border-radius:9px;background:#203440;white-space:normal;font:400 12px/1.4 "Segoe UI",Arial,sans-serif;color:#c0d0d9;box-shadow:none;}
#statsMenu .report-metric .chip-value {margin:0;min-width:0;max-width:100%;text-align:left;font:650 21px/1.25 "Segoe UI",Arial,sans-serif;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;color:#f2f6f8;text-shadow:none;}
#statsMenu .report-metric.expense .chip-value {color:#ffc0ae;}
.report-two-sections {display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.report-two-sections .battle-stat-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
.battle-note {font-size:12px!important;line-height:1.6;color:#b5cbd5!important;margin:2px 0 12px!important;text-align:left;}
.battle-factions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.battle-faction {grid-column:1/-1;border:1px solid #7893a14a;border-top:3px solid var(--side);border-radius:12px;padding:18px;background:#152833;min-width:0;}
.battle-faction--local {grid-column:1/-1;background:#19303a;}
.battle-faction header {display:flex;align-items:center;gap:9px;margin:0 0 14px;}
.battle-faction header i {width:10px;height:10px;border-radius:50%;background:var(--side);flex-shrink:0;}
.battle-faction h3 {margin:0;font-size:18px;color:#f0f5f7;overflow-wrap:anywhere;}
.battle-faction header>span {margin-left:auto;padding:4px 7px;border-radius:5px;background:#ffffff0b;color:#bdcfd8;font-size:11px;text-align:right;}
.battle-land {display:flex;align-items:baseline;gap:8px;}
.battle-land>strong {font-size:27px;font-variant-numeric:tabular-nums;color:#f4dc9e;}
.battle-land>span {font-size:12px;color:#c0d3dd;flex:1;}
.battle-land b {float:right;font-weight:500;}
.battle-share {height:5px;overflow:hidden;background:#020e1566;border-radius:10px;margin:10px 0 17px;}
.battle-share i {height:100%;display:block;border-radius:10px;background:var(--side);}
.battle-faction-groups {display:grid;grid-template-columns:1fr 1fr;gap:18px 24px;}
.battle-faction-group {min-width:0;}
.battle-faction-group h4 {margin:0 0 5px;color:#a9d3dc;font-size:12px;font-weight:650;letter-spacing:.04em;}
.battle-faction-group dl {margin:0;}
.battle-faction-group dl>div {display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:8px 0;border-bottom:1px solid #7893a126;}
.battle-faction-group dt {font-size:12px;line-height:1.5;color:#c2d1da;min-width:0;}
.battle-faction-group dd {margin:0;font-size:15px;line-height:1.4;color:#f2f6f8;font-weight:600;font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere;}
#statsMenu #playerSummary {transform:none!important;width:100%;border:0;background:none;padding:0;margin:0;overflow:visible;max-width:none;}
#statsMenu #playerSummaryBody {display:block;width:100%;overflow:visible;max-height:none;}
.battle-final-stats {grid-column:1/-1;}
@media(max-width:900px) {.report-two-sections {grid-template-columns:1fr;}}
@media(max-width:700px) {
    #statsMenu {padding:8px;align-items:center;}
    #statsMenu .stats-menu-panel {width:100%;height:96dvh;max-height:96dvh;padding:16px 12px 12px;border-radius:12px;}
    #statsMenu .report-header h2 {font-size:23px;}
    .report-header {gap:8px;margin-bottom:5px;}
    #statsMenu .report-close {font-size:11px;min-height:38px;padding:7px 9px;}
    .report-eyebrow {font-size:9px!important;}
    .report-identity {font-size:12px;padding:8px 0 10px;}
    .report-identity strong {font-size:13px;}
    .report-identity>span {font-size:10px;}
    .battle-overview {grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:10px;}
    .battle-overview .battle-stat {padding:9px;gap:3px;}
    .battle-overview .battle-stat>span {font-size:11px;}
    .battle-overview .battle-stat strong {font-size:21px;}
    .battle-overview .battle-stat small {font-size:10px;}
    #statsMenu .stats-m-tabs {margin-bottom:12px;gap:3px;padding:4px;}
    #statsMenu .stats-m-tab {font-size:12px;padding:8px 3px;min-height:42px;}
    #statsMenu .stats-m-pages {padding-right:3px;}
    .report-page-heading h3 {font-size:18px;}
    .report-page-heading p {font-size:12px!important;}
    .battle-section,.battle-faction {padding:13px;}
    .battle-section h3 {font-size:14px;}
    .battle-stat-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
    .battle-stat,#statsMenu .resource-chip.report-metric {padding:10px;font-size:12px;}
    .battle-stat strong,#statsMenu .report-metric .chip-value {font-size:19px;}
    .battle-factions,.battle-faction-groups,.report-two-sections {grid-template-columns:1fr;}
    .battle-faction h3 {font-size:16px;}
    .report-two-sections .battle-stat-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* Full-roster previews and touch layouts share the existing era artwork. */
#shopPanel .shop-preview-row {max-width:1080px;}
.shop-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0;margin-bottom:12px;}
#shopPanel .shop-heading h2,#shopPanel .shop-heading p {margin:0;}
#shopPanel .shop-heading p {font-size:14px;color:#cbdce7;}
#shopPanel .shop-heading strong {color:#f0d59c;font-variant-numeric:tabular-nums;}
.shop-unit-cell-label {text-transform:none;letter-spacing:0;font-size:12px;line-height:1.35;overflow-wrap:break-word;}
.shop-unit-cell {justify-content:flex-start;}
.production-name,.production-cost,.production-meta {display:block;}
.production-name {font-weight:700;}
.production-cost {font-variant-numeric:tabular-nums;}
.command-hint--touch,.command-save-group {display:none;}
.supporter-mobile-copy {display:none;}
@media (max-width:900px), (hover:none) and (pointer:coarse) {
    .overlay input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
    .overlay select,.overlay textarea {font-size:16px;min-height:44px;box-sizing:border-box;max-width:100%;}
    #shopPanel .panel.panel-wide {padding:max(14px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(10px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));}
    #shopPanel .panel h2 {font-size:26px;margin:0 0 12px;}
    #shopPanel .panel>p {font-size:13px;margin:0 0 8px;}
    #shopPanel .panel>.menu-btn {min-height:44px;margin:8px 0 0!important;padding:10px;width:100%;max-width:none;font-size:14px;}
    #shopPanel .supporter-pack {padding:12px;margin-bottom:12px;}
    #shopPanel .supporter-pack h3 {font-size:16px;margin-bottom:6px;}
    #shopPanel .supporter-pack p {font-size:13px;line-height:1.5;margin-bottom:10px;}
    #shopPanel #supporterPackCopy {display:none;}
    #shopPanel .supporter-mobile-copy {display:block;}
    #shopPanel .supporter-pack .menu-btn {width:100%;max-width:none;margin:0;min-height:44px;padding:10px;font-size:13px;box-sizing:border-box;}
    #shopPanel .shop-tabs {display:grid;grid-template-columns:1fr 1fr;gap:6px;padding-bottom:10px;margin-bottom:10px;flex-shrink:0;}
    #shopPanel .shop-tab {min-height:44px;padding:8px 6px;font-size:13px;line-height:1.25;margin:0;}
    #shopPanel .shop-tab-pane {overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:pan-y;padding-bottom:12px;}
    #shopPanel .shop-tab-pane>p {font-size:13px;line-height:1.5;margin:4px 0 12px;}
    #shopPanel .shop-preview-row {grid-template-columns:1fr;gap:12px;margin:0 0 16px;width:100%;}
    #shopPanel .shop-preview-card {padding:12px;gap:10px;min-width:0;}
    #shopPanel .shop-preview-card-top {justify-content:space-between;}
    #shopPanel .shop-preview-card h4 {font-size:12px;}
    #shopPanel .shop-skin-picker {width:100%;max-width:none;}
    #shopPanel .shop-skin-picker-trigger {min-height:48px;padding:6px 10px;gap:8px;font-size:13px;}
    #shopPanel .shop-skin-picker-label {white-space:normal;text-align:left;overflow-wrap:break-word;}
    #shopPanel .shop-skin-picker-menu {max-height:240px;max-height:min(240px,42dvh);}
    #shopPanel .shop-skin-option {min-height:44px;font-size:13px;}
    #shopPanel .shop-color-picker-trigger {width:44px;height:44px;}
    #shopPanel .shop-unit-strip {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px;}
    #shopPanel .shop-unit-cell {display:grid;grid-template-columns:44px minmax(0,1fr);gap:7px;align-items:center;text-align:left;}
    #shopPanel .shop-mini-canvas {width:44px;max-width:44px;height:44px;border-radius:6px;}
    #shopPanel .shop-unit-cell-label {font-size:12px;line-height:1.3;color:#cbdce7;}
    #shopPanel .skin-grid-scroll {padding:10px 8px;}
    #shopPanel .skin-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0;}
    #shopPanel .skin-card {width:100%;min-width:0;max-width:none;padding:10px 6px;font-size:12px;line-height:1.4;}
    #shopPanel canvas.skin-preview {width:100%!important;max-width:120px;height:auto!important;aspect-ratio:3/2;}
    #shopPanel .shop-section-buy-row {gap:8px;flex-wrap:wrap;}
    #shopPanel .shop-purchase-all-btn {width:auto;min-height:44px;font-size:12px;padding:8px 10px;}
    #shopPanel .shop-option-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
    #shopPanel .shop-map-card {padding:12px;min-width:0;}
    #shopPanel .shop-option-title {font-size:14px;line-height:1.4;overflow-wrap:break-word;}
    #shopPanel .shop-option-desc {font-size:12px;line-height:1.5;}
    #inGameUI[data-mtab=units] .wod-m-sheet--units,
    #inGameUI[data-mtab=build] .wod-m-sheet--build {max-height:min(54dvh,460px);padding:12px;border-radius:16px 16px 10px 10px;}
    #inGameUI[data-mtab=units] .wod-m-sheet--units .bottom-bar,
    #inGameUI[data-mtab=build] .wod-m-sheet--build .bottom-bar {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start;overflow-y:auto;}
    #inGameUI[data-mtab] .wod-m-sheet .build-btn {min-width:0;min-height:88px;margin:0;padding:10px;text-align:left;border:1px solid #7f9aae66;border-radius:10px;background:linear-gradient(155deg,#223e52,#152837);white-space:normal;line-height:1.35;display:flex;flex-direction:column;justify-content:center;gap:5px;}
    #inGameUI .production-name {font:650 13px/1.3 "Segoe UI",Arial,sans-serif;color:#f0f4f6;overflow-wrap:break-word;}
    #inGameUI .production-cost {font:600 12px/1.3 "Segoe UI",Arial,sans-serif;color:#f0d59c;}
    #inGameUI .production-meta {font:400 11px/1.3 "Segoe UI",Arial,sans-serif;color:#adc4d2;}
    #inGameUI .wod-m-sheet-banner {padding:8px 2px;margin-bottom:8px;min-height:30px;}
    #inGameUI .wod-m-sheet-title {font-size:13px;letter-spacing:.05em;}
    #inGameUI .wod-m-sheet-sub {font-size:11px;}
    #inGameUI .info-card.info-card--mobile-orders .info-order-btn {min-height:44px;font-size:11px;line-height:1.2;padding:7px 4px;}
    #inGameUI .info-mobile-orders-row {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px;}
    #inGameUI .info-card .info-stats {font-size:12px;line-height:1.5;gap:6px;margin-top:9px;}
    #inGameUI .info-card .info-stat-extra {font-size:12px;line-height:1.5;padding:6px 8px;border:1px solid #7893a14a;border-radius:6px;background:#ffffff06;}
    #inGameUI .info-card .effect-pill {font-size:11px;padding:6px 8px;line-height:1.4;}
    #inGameUI .info-card .effect-pill-stat {font-size:11px;}
    #inGameUI .info-card .info-effects-scroll>.effect-list {max-height:none;overflow:visible;}
    #inGameUI .info-card .info-detail-block {margin-top:9px;}
    #inGameUI .info-terrain-entry {font-size:13px;line-height:1.5;}
    #inGameUI .info-terrain-entry small {font-size:12px;}
    #inGameUI .info-card-page-btn,#inGameUI .info-stats-back {min-height:44px;min-width:44px;}
    #inGameUI #wodCommandHud {max-width:calc(100% - 24px)!important;font-size:11px!important;padding:6px 8px!important;border:1px solid #7893a138;display:flex;align-items:center;flex-wrap:wrap;gap:6px;box-sizing:border-box;}
    #wodCommandHud .command-group-head {display:flex;align-items:center;gap:6px;}
    #wodCommandHud [data-group-buttons] {display:flex;flex:1;min-width:0;gap:5px;overflow-x:auto;max-width:100%;}
    #wodCommandHud [data-reserve-count],#wodCommandHud [data-production-countdown] {flex:0 0 100%;}
    #wodCommandHud [data-reserve-count]:empty,#wodCommandHud [data-production-countdown]:empty,#wodCommandHud [data-group-buttons]:empty {display:none;}
    #wodCommandHud[data-has-groups] .command-hint--touch {display:none;}
    #wodCommandHud [data-control-group] {flex:0 0 48px;min-height:44px;margin:0!important;}
    .command-hint--desktop {display:none;}
    .command-hint--touch {display:inline;color:#b4c5d6;}
    .command-save-group:not([hidden]) {display:inline-block;min-height:44px;padding:6px 10px;margin-left:8px;border:1px solid #a18c54;border-radius:6px;background:#263c50;color:#f3dca5;font:600 12px "Segoe UI",Arial,sans-serif;}
    #campaignPanel .wod-camp-shop button {white-space:normal;text-overflow:clip;min-height:58px;line-height:1.4;font-size:12px;padding:9px 7px;}
    #campaignPanel .wod-camp-panel {display:block;overflow-y:auto;overscroll-behavior:contain;padding:14px 12px;}
    #campaignPanel .wod-camp-header {display:block;margin-bottom:14px;}
    #campaignPanel .wod-camp-header h2 {font-size:24px;line-height:1.25;margin:0 0 6px;}
    #campaignPanel .wod-camp-kicker {font-size:10px;margin:0 0 5px;}
    #campaignPanel .wod-camp-header .wod-map-lib-sub {font-size:13px;line-height:1.5;margin:0 0 10px;}
    #campaignPanel .wod-camp-status {width:100%;max-width:none;justify-content:flex-start;gap:6px;}
    #campaignPanel .wod-camp-chip {font-size:11px;padding:5px 7px;}
    #campaignPanel .wod-camp-layout {display:flex;flex-direction:column;overflow:visible;gap:14px;}
    #campaignPanel .wod-camp-side,#campaignPanel .wod-camp-orders,#campaignPanel .wod-camp-map-col {flex:none;max-height:none;min-height:0;width:100%;box-sizing:border-box;overflow:visible;}
    #campaignPanel .wod-camp-side-active,#campaignPanel .wod-camp-army-card {overflow:visible;max-height:none;}
    #campaignPanel .wod-camp-side-active .setup-row {display:flex;flex-direction:column;align-items:stretch;gap:6px;}
    #campaignPanel .wod-camp-side-active .setup-row label {font-size:12px;min-width:0;flex:none;}
    #campaignPanel .wod-camp-side-active .setup-row select {width:100%;min-width:0;flex:none;}
    #campaignPanel .wod-camp-army-head {align-items:flex-start;gap:8px;flex-direction:column;}
    #campaignPanel #wodCampArmyCount {font-size:11px;line-height:1.5;text-align:left;}
    #campaignPanel .wod-camp-roster {flex:none;min-height:80px;max-height:260px;overflow-y:auto;}
    #campaignPanel #wodCampMapCanvas {flex:none;width:100%;height:auto;min-height:180px;max-height:280px;object-fit:contain;}
    #campaignPanel .wod-camp-region-card,#campaignPanel .wod-camp-node-info {flex:none;max-height:none;overflow:visible;}
    #campaignPanel .wod-camp-bottom {display:block;margin-top:14px;}
    #campaignPanel .wod-camp-log {max-height:150px;min-height:0;font-size:12px;line-height:1.5;margin-bottom:12px;}
    #campaignPanel .wod-camp-footer {display:flex;gap:10px;justify-content:space-between;}
    #campaignPanel .wod-camp-footer .menu-btn {min-height:44px;padding:10px 14px;font-size:13px;}
    #campaignPanel .wod-camp-unit {display:grid;grid-template-columns:44px minmax(0,1fr);gap:6px;padding:10px 8px;}
    #campaignPanel .wod-camp-unit>span:first-child {grid-column:1;grid-row:1/3;padding:4px!important;min-height:44px;display:flex;align-items:center;}
    #campaignPanel .wod-camp-unit-meta {grid-column:2;min-width:0;}
    #campaignPanel .wod-camp-unit-title {white-space:normal;overflow-wrap:break-word;font-size:13px;line-height:1.4;}
    #campaignPanel .wod-camp-unit-right {grid-column:2;justify-content:flex-end;flex-wrap:wrap;}
    #campaignPanel .wod-camp-rename,#campaignPanel .wod-camp-del {min-width:44px;min-height:44px;font-size:16px;}
    #statsMenu .report-close {min-height:44px;}
    #statsMenu .stats-m-tab {min-height:44px;}
    #statsMenu .battle-stat>span,#statsMenu .report-metric {font-size:12px;line-height:1.45;}
    #statsMenu .battle-faction header {flex-wrap:wrap;}
    #statsMenu .battle-faction-group dt {font-size:13px;}
    #statsMenu .battle-faction-group dd {flex-shrink:0;}
    #settingsPanel .settings-section {padding:14px;margin:12px 0;}
    #settingsPanel .settings-section h3 {font-size:16px;margin-bottom:8px;}
    #settingsPanel .settings-section p,#settingsPanel .settings-section label {font-size:13px;line-height:1.5;}
    #settingsPanel .settings-section .menu-btn {width:100%;max-width:100%;min-height:44px;margin:0;padding:10px;font-size:14px;box-sizing:border-box;}
    #achievementsPanel .stats-period-bar {display:flex;flex-direction:column;align-items:stretch;gap:6px;max-width:none!important;}
    #achievementsPanel .stats-period-bar label,#achievementsPanel .stats-period-bar select {width:100%;flex:none;min-width:0;}
    #achievementsPanel .stats-period-bar label {font-size:12px;}
    #achievementsPanel .stats-section {padding:12px;}
    #achievementsPanel .stats-layout {gap:14px;}
    #achievementsPanel .stats-grid,#achievementsPanel .stats-grid.stats-grid--combat-row {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
    #achievementsPanel .stat-cell {min-width:0;min-height:72px;padding:10px;box-sizing:border-box;}
    #achievementsPanel .stat-label {font-size:12px;letter-spacing:0;text-transform:none;line-height:1.4;overflow-wrap:break-word;}
    #achievementsPanel .stat-value {font-size:20px;overflow-wrap:anywhere;}
}
@media (max-width:600px) {
    #settingsPanel .setup-row {flex-direction:column;align-items:stretch;}
    #settingsPanel .setup-row label,#settingsPanel .setup-row select {width:100%;min-width:0;flex:none;}
    #inGameUI {--wod-m-sheet-y:calc(env(safe-area-inset-top,0px) + 106px);}
    #inGameUI .wod-m-status {grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:6px 8px;padding: max(7px,env(safe-area-inset-top,0px)) 10px 7px;min-height:96px;}
    #inGameUI .wod-m-kpis {grid-column:1;grid-row:1;min-width:0;}
    #inGameUI .wod-m-resource-card .wod-m-kpi-val {font-size:13px;}
    #inGameUI .wod-m-resource-rate {font-size:10px;line-height:1.2;}
    #inGameUI .wod-m-header-actions {grid-column:2;grid-row:1;}
    #inGameUI .wod-m-menu-btn,#inGameUI .wod-m-meta-chip {min-height:44px;font-size:11px;}
    #inGameUI .wod-m-objective-hud {grid-column:1/-1;grid-row:2;padding:4px 8px;min-height:28px;gap:8px;}
    #inGameUI .wod-m-objective-icon {width:18px;height:18px;flex-basis:18px;}
    #inGameUI .wod-m-objective-icon::before {height:24px;top:-4px;}
    #inGameUI .wod-m-objective-icon::after {width:24px;left:-4px;}
    #inGameUI .wod-m-objective-lines {flex-direction:row;align-items:baseline;gap:7px;}
    #inGameUI .wod-m-objective-label {display:none;}
    #inGameUI .wod-m-objective-mode {font-size:11px;flex-shrink:0;}
    #inGameUI .wod-m-objective-rule {font-size:10px;line-height:1.3;-webkit-line-clamp:1;line-clamp:1;}
    #inGameUI .info-card {--wod-info-card-max-h:min(54dvh,440px);}
    #inGameUI .info-card.info-card--mobile-orders .info-sheet-head {flex-direction:column;align-items:stretch;gap:8px;}
    #inGameUI .info-card .info-identity {width:100%;margin:0;}
    #inGameUI .info-card .info-name-block {min-width:0;flex:1;}
    #inGameUI .info-card.info-card--mobile-orders #infoCardPage0 h3 {font-size:15px;white-space:normal;line-height:1.3;overflow-wrap:break-word;}
    #inGameUI .info-card #infoType {font-size:12px;line-height:1.4;}
    #inGameUI .info-card.info-card--mobile-orders .info-kpi-row {width:100%;max-width:none;margin:0;flex:none;gap:6px;}
    #inGameUI .info-card.info-card--mobile-orders .info-kpi {min-height:38px;display:grid;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:2px 5px;padding:6px 8px;}
    #inGameUI .info-kpi .info-kpi-ico {grid-row:1/3;width:16px;height:16px;}
    #inGameUI .info-kpi strong {font-size:13px;line-height:1.3;}
    #inGameUI .info-card.info-card--mobile-orders .info-kpi-lbl {display:block;font-size:9px;line-height:1.3;}
    #shopPanel #shopMapOptions {grid-template-columns:1fr;}
}
@media (max-width:932px) and (max-height:520px) and (orientation:landscape) {
    #inGameUI {--wod-m-sheet-y:calc(env(safe-area-inset-top,0px) + 64px);--wod-m-dock-h:52px;--wod-m-dock-toggle-h:0px;--wod-m-dock-gap:calc(52px + env(safe-area-inset-bottom,0px));}
    #inGameUI .wod-m-mobile-shell {min-height:56px;padding:5px 10px;box-sizing:border-box;}
    #inGameUI .wod-m-status {display:grid;grid-template-columns:minmax(170px,220px) minmax(120px,1fr) auto;gap:8px;min-height:0;width:100%;padding:0;}
    #inGameUI .wod-m-status-accent {display:none;}
    #inGameUI .wod-m-kpis {display:grid;grid-template-columns:1fr 1fr;gap:0;grid-column:1;grid-row:1;}
    #inGameUI .wod-m-resource-card {display:flex;flex-direction:row;align-items:center;gap:7px;min-height:44px;max-height:44px;padding:4px 7px;overflow:hidden;}
    #inGameUI .wod-m-resource-mark {font-size:18px;}
    #inGameUI .wod-m-resource-mark--mp {font-size:9px;}
    #inGameUI .wod-m-resource-card .wod-m-kpi-val {font-size:12px;margin:0;}
    #inGameUI .wod-m-resource-rate {font-size:9px;margin-top:2px;}
    #inGameUI .wod-m-objective-hud {grid-column:2;grid-row:1;max-width:none;flex-direction:row;align-items:center;gap:9px;min-height:40px;padding:4px 9px;}
    #inGameUI .wod-m-objective-icon {width:20px;height:20px;flex-basis:20px;}
    #inGameUI .wod-m-objective-icon::before {height:26px;top:-4px;}
    #inGameUI .wod-m-objective-icon::after {width:26px;left:-4px;}
    #inGameUI .wod-m-objective-label {display:none;}
    #inGameUI .wod-m-objective-mode {font-size:11px;}
    #inGameUI .wod-m-objective-rule {font-size:10px;line-height:1.25;-webkit-line-clamp:1;line-clamp:1;}
    #inGameUI .wod-m-header-actions {grid-column:3;grid-row:1;margin:0;}
    #inGameUI .wod-m-meta-chip,#inGameUI .wod-m-menu-btn {min-height:44px;font-size:11px;}
    #inGameUI .wod-m-dock-toggle {display:none!important;}
    #inGameUI .wod-m-dock {height:52px;min-height:52px;padding:3px 6px;gap:5px;box-sizing:border-box;}
    #inGameUI .wod-m-tab {min-height:44px;flex-direction:row;gap:7px;padding:5px;}
    #inGameUI .wod-m-tab-glyph {width:23px;height:23px;}
    #inGameUI .wod-m-tab-lbl {font-size:11px;letter-spacing:0;}
    #shopPanel .supporter-pack {display:flex;align-items:center;gap:12px;padding:8px 10px;margin-bottom:8px;}
    #shopPanel .supporter-pack p {display:none;}
    #shopPanel .supporter-pack h3 {margin:0;font-size:14px;flex:1;}
    #shopPanel .supporter-pack .menu-btn {width:auto;max-width:55%;}
    #shopPanel .shop-tabs {grid-template-columns:repeat(4,minmax(0,1fr));}
    #shopPanel .shop-preview-row {grid-template-columns:1fr 1fr;}
    #inGameUI[data-mtab=units] .wod-m-sheet--units,#inGameUI[data-mtab=build] .wod-m-sheet--build {max-height:calc(100dvh - var(--wod-m-sheet-y) - var(--wod-m-dock-gap) - 70px);}
    #inGameUI[data-mtab] .wod-m-sheet .build-btn {min-height:76px;}
    #statsMenu {padding:6px;}
    #statsMenu .stats-menu-panel {height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);padding:10px 14px;}
    #statsMenu .report-header {margin-bottom:2px;}
    #statsMenu .report-header h2 {font-size:20px;}
    #statsMenu .report-eyebrow {display:none;}
    #statsMenu .report-identity {padding:3px 0 6px;}
    #statsMenu .battle-overview {grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:8px;gap:6px;}
    #statsMenu .battle-overview .battle-stat {padding:6px 9px;gap:2px;}
    #statsMenu .battle-overview .battle-stat strong {font-size:18px;}
    #statsMenu .battle-overview .battle-stat small {display:none;}
    #statsMenu .stats-m-tabs {margin-bottom:8px;padding:3px;}
}
@media (max-width:600px) and (max-height:700px) {
    #shopPanel .supporter-pack {display:flex;align-items:center;gap:10px;padding:8px 10px;}
    #shopPanel .supporter-pack p {display:none;}
    #shopPanel .supporter-pack h3 {font-size:14px;margin:0;flex:1;}
    #shopPanel .supporter-pack .menu-btn {width:auto;max-width:65%;font-size:12px;}
    #statsMenu .report-header h2 {font-size:20px;}
    #statsMenu .report-identity {padding:5px 0 8px;}
    #statsMenu .battle-overview .battle-stat {flex-direction:row;align-items:center;justify-content:space-between;padding:7px;min-height:44px;box-sizing:border-box;gap:4px;}
    #statsMenu .battle-overview .battle-stat>span {font-size:11px;max-width:50%;}
    #statsMenu .battle-overview .battle-stat strong {font-size:14px;white-space:nowrap;flex-shrink:0;}
    #statsMenu .battle-overview .battle-stat small {display:none;}
}
.wod-gold-coin {--coin-size:20px;display:inline-grid;place-items:center;position:relative;flex:0 0 auto;width:var(--coin-size);height:var(--coin-size);box-sizing:border-box;border:1px solid #ffeab0;border-radius:50%;background:linear-gradient(140deg,#fff0a0 5%,#f3c451 40%,#c58a20 70%,#f3cb61);box-shadow:inset 0 0 0 2px #b87920,inset 0 0 0 3px #ffde80,0 2px 4px #0005;vertical-align:middle;}
.wod-gold-coin::after {content:'✦';font-size:calc(var(--coin-size)*.6);line-height:1;color:#96601a;text-shadow:0 1px #ffeab0;}
#shopPanel .shop-gold-wallet {display:flex;align-items:center;gap:10px;white-space:nowrap;padding:8px 12px;border:1px solid #c99a425e;border-radius:12px;background:linear-gradient(135deg,#644a1b33,#f2bc3912);font-size:26px;font-weight:750;box-sizing:border-box;}
#shopPanel .shop-gold-wallet .wod-gold-coin {--coin-size:36px;}
#shopPanel .shop-heading .shop-gold-wallet strong {font-size:26px;line-height:1.1;color:#ffe49c;}
.shop-gold-wallet .sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}
#creditsPanel .company-card {display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:6px 12px;text-align:left;}
#creditsPanel .credits-list {position:relative;}
.credits-coin-home {display:block;width:44px;height:44px;}
.credits-coin-button {display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.credits-coin-button[hidden] {display:none;}
.credits-coin-button .wod-gold-coin {--coin-size:32px;}
.credit-coin-perch {display:inline-block;position:relative;}
#creditsPanel .coin-landing-card {padding-top:42px;}
.credits-coin-button:focus-visible {outline:2px solid #ffeab0;outline-offset:3px;}
.credits-coin-button:hover .wod-gold-coin,.credits-coin-button.coin-found .wod-gold-coin {filter:drop-shadow(0 0 6px #f3c45177);}
.credits-coin-status {grid-column:1/-1;text-align:right;font-size:12px;color:#ffe092;line-height:1.5;}
.credits-coin-status:empty {display:none;}
.cs-gold-reward {grid-column:1/-1!important;border-color:#cba05188;background:linear-gradient(135deg,#43351d,#182c37);}
.cs-gold-title {display:flex;align-items:center;justify-content:space-between;gap:14px;}
.cs-gold-total {display:flex;align-items:center;gap:10px;color:#ffe49c;font:750 32px/1.3 "Segoe UI",Arial,sans-serif;}
.cs-gold-total .wod-gold-coin {--coin-size:32px;}
.cs-gold-note {font-size:12px;color:#d7cfbc;margin:5px 0 0;}
.cs-gold-breakdown {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:14px;}
.cs-gold-breakdown>div {display:flex;flex-direction:column;gap:5px;padding:10px;border:1px solid #d8bc6b33;border-radius:8px;background:#08151d55;font-size:12px;color:#cbd6db;}
.cs-gold-breakdown strong {font-size:18px;color:#f7e3ab;}
@media(max-width:600px){#shopPanel .shop-gold-wallet{font-size:22px;padding:7px 9px;gap:8px;}#shopPanel .shop-heading .shop-gold-wallet strong{font-size:22px;}#shopPanel .shop-gold-wallet .wod-gold-coin{--coin-size:32px;}.cs-gold-breakdown{grid-template-columns:repeat(2,minmax(0,1fr));}.cs-gold-total{font-size:28px;}}

.unit-recruit-tile{position:relative;display:flex;min-width:0;min-height:44px;align-items:stretch}.unit-recruit-tile>.build-btn,.unit-recruit-tile>.cities-build-btn{width:100%;height:100%;padding-right:43px!important}.unit-recruit-info{position:absolute;right:6px;top:6px;width:32px;height:32px;border:1px solid #b7c9d4;border-radius:50%;background:#142b3c;color:#f6d478;font:bold 17px Georgia,serif;cursor:pointer;z-index:2}.unit-recruit-info:hover,.unit-recruit-info:focus-visible{background:#35556a;outline:2px solid #efd073;outline-offset:2px}#wodRecruitInfo{box-sizing:border-box;width:min(94vw,620px);max-height:88dvh;overflow:auto;padding:20px;border:1px solid #bba66e;border-radius:16px;background:#102532;color:#edf3f4;box-shadow:0 20px 80px #0009}#wodRecruitInfo::backdrop{background:#07121bb8}#wodRecruitInfo header{display:flex;justify-content:space-between;align-items:center;gap:16px}#wodRecruitInfo h3{margin:0;color:#f3d582}#wodRecruitInfo header button{width:38px;height:38px;border:1px solid #7896a5;border-radius:8px;background:#1c3a4d;color:white;font-size:25px}#wodRecruitInfo p{font-size:14px;line-height:1.55;color:#cbdbe2}.recruit-cost{color:#f6d884!important}#wodRecruitInfo .info-record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.recruit-terrain{overflow-x:auto}.recruit-terrain table{width:100%;border-collapse:collapse;font-size:13px}.recruit-terrain th,.recruit-terrain td{padding:8px 5px;text-align:left;border-bottom:1px solid #47606e}#infoCombatStats{margin:8px 0}#infoCombatStats[hidden]{display:none}@media(pointer:coarse){.unit-recruit-tile{min-height:48px}.unit-recruit-info{width:40px;height:40px}.unit-recruit-tile>.build-btn,.unit-recruit-tile>.cities-build-btn{padding-right:51px!important}}

/* ---- Game lobby seats (four at most): seat cards, the seat-type dropdown, and the Players / AI counters ---- */
.mp-hidden-select { display: none !important; }
.mp-gl-seats-head { margin: 0 0 8px 0; font-size: 1.08rem; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mp-gl-seat-cap { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: rgba(236, 240, 241, .72); }
.mp-gl-seat {
    --seat: #8a8f98;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(100deg, color-mix(in srgb, var(--seat) 16%, rgba(10, 14, 20, .78)) 0%, rgba(10, 14, 20, .55) 60%);
    transition: border-color .15s, background .15s, opacity .15s;
}
.mp-gl-seat::before {
    content: "";
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--seat);
}
.mp-gl-seat:hover { border-color: rgba(255, 255, 255, .2); }
.mp-gl-seat--open { border-style: dashed; border-color: rgba(46, 204, 113, .4); }
.mp-gl-seat--closed { background: rgba(10, 14, 20, .4); }
.mp-gl-seat--closed .mp-gl-seat-main, .mp-gl-seat--closed .mp-gl-seat-color { opacity: .5; }
.mp-gl-seat--closed::before { background: rgba(255, 255, 255, .18); }
.mp-gl-seat-color { flex: 0 0 auto; }
.mp-gl-seat-main { flex: 1 1 auto; min-width: 0; }
.mp-gl-seat-name { font-weight: 700; font-size: 14px; line-height: 1.25; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-gl-seat-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mp-gl-seat-sub { font-size: 12px; color: rgba(236, 240, 241, .66); margin-top: 2px; }
.mp-gl-seat-tag {
    font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 999px;
    background: rgba(212, 175, 55, .16); color: #e8c75a; border: 1px solid rgba(212, 175, 55, .35);
}
.mp-gl-seat-tag--you { background: rgba(52, 152, 219, .16); color: #7cc4f5; border-color: rgba(52, 152, 219, .4); }
.mp-gl-seat-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.mp-gl-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 30px; padding: 0 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #ecf0f1; cursor: pointer;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
    transition: background .15s, border-color .15s;
}
.mp-gl-icon-btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.mp-gl-icon-btn:focus-visible { outline: 2px solid #d4af37; outline-offset: 2px; }
.mp-gl-icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.mp-gl-icon-btn--invite { color: #7ee2a8; border-color: rgba(46, 204, 113, .45); background: rgba(46, 204, 113, .1); }
.mp-gl-icon-btn--kick { color: #f1948a; border-color: rgba(231, 76, 60, .4); background: rgba(231, 76, 60, .08); }
.mp-gl-type-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: rgba(236, 240, 241, .85);
    background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .1);
}
.mp-gl-type-chip svg, .wod-dd svg { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }

/* The seat-type dropdown */
.wod-dd { position: relative; }
.wod-dd-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-width: 112px; height: 32px; padding: 0 10px; border-radius: 9px;
    font-size: 13px; font-weight: 600; color: #ecf0f1; cursor: pointer; text-align: left;
    background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 6px rgba(0, 0, 0, .25);
    transition: border-color .15s, background .15s;
}
.wod-dd-btn:hover, .wod-dd.open .wod-dd-btn { border-color: rgba(212, 175, 55, .7); }
.wod-dd-btn:focus-visible { outline: 2px solid #d4af37; outline-offset: 2px; }
.wod-dd-val { flex: 1 1 auto; }
.wod-dd-chev { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid rgba(236, 240, 241, .7); transition: transform .15s; }
.wod-dd.open .wod-dd-chev { transform: rotate(180deg); }
.wod-dd-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
    min-width: 230px; padding: 6px; border-radius: 12px;
    background: rgba(16, 20, 27, .98); border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
    display: none; flex-direction: column; gap: 2px;
}
.wod-dd.open .wod-dd-menu { display: flex; }
.wod-dd-opt {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
    color: #ecf0f1; cursor: pointer; text-align: left; font: inherit;
}
.wod-dd-opt:hover:not(:disabled), .wod-dd-opt:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.wod-dd-opt[aria-selected="true"] { background: rgba(212, 175, 55, .14); }
.wod-dd-opt[aria-selected="true"]::after { content: "\2713"; margin-left: auto; color: #e8c75a; font-weight: 800; }
.wod-dd-opt:disabled { opacity: .4; cursor: not-allowed; }
.wod-dd-opt b { display: block; font-size: 13px; }
.wod-dd-opt small { display: block; font-size: 11px; color: rgba(236, 240, 241, .62); margin-top: 1px; }
.wod-dd-opt svg { width: 18px; height: 18px; }

/* Players / AI counters, with the four-seat bar */
.mp-seat-counters { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.mp-seatbar { display: flex; align-items: center; gap: 5px; }
.mp-seatbar-pip {
    flex: 1 1 0; min-width: 0; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    border: 1px dashed rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .18); color: rgba(236, 240, 241, .32);
}
.mp-seatbar-pip--you { border-style: solid; background: rgba(52, 152, 219, .25); border-color: rgba(52, 152, 219, .55); color: #9bd2f7; }
.mp-seatbar-pip--player { border-style: solid; background: rgba(46, 204, 113, .18); border-color: rgba(46, 204, 113, .5); color: #8de6b2; }
.mp-seatbar-pip--bot { border-style: solid; background: rgba(212, 175, 55, .16); border-color: rgba(212, 175, 55, .5); color: #e8c75a; }
.mp-seatbar-label { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: rgba(236, 240, 241, .75); margin-left: 4px; white-space: nowrap; }
.mp-seg-row { display: flex; align-items: center; gap: 10px; }
.mp-seg-label { flex: 0 0 auto; width: 7.4em; font-size: 12px; font-weight: 700; color: rgba(236, 240, 241, .8); }
.mp-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .1); }
.mp-seg-btn {
    min-width: 34px; height: 28px; padding: 0 8px; border-radius: 7px; border: 0; cursor: pointer;
    font-size: 13px; font-weight: 700; color: rgba(236, 240, 241, .78); background: transparent;
    transition: background .12s, color .12s;
}
.mp-seg-btn:hover:not(:disabled):not(.on) { background: rgba(255, 255, 255, .08); color: #fff; }
.mp-seg-btn.on { background: linear-gradient(180deg, #e3c158, #c9a227); color: #14110a; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.mp-seg-btn:disabled { opacity: .28; cursor: not-allowed; }
.mp-seg-btn:focus-visible { outline: 2px solid #d4af37; outline-offset: 1px; }
.mp-seg-note { margin: 0; font-size: 12px; color: rgba(236, 240, 241, .62); line-height: 1.4; }
.mp-host-label-note { font-weight: 400; opacity: .7; text-transform: none; letter-spacing: 0; }
.mp-gl-layout-row .mp-gl-regen { align-self: flex-start; }
@media (max-width: 520px) {
    .mp-gl-seat { flex-wrap: wrap; }
    .mp-gl-seat-actions { width: 100%; justify-content: flex-end; }
    .mp-seg-label { width: 5.8em; }
}
@media (prefers-reduced-motion: reduce) {
    .mp-gl-seat, .wod-dd-btn, .wod-dd-chev, .mp-seg-btn { transition: none; }
}
/* (the lobby's two columns may shrink below the map preview's drawn width: on a phone the preview set the column's
   width and the seat buttons ran off the screen) */
.mp-gl-grid > div { min-width: 0; }
#mpGameLobbyScreen .wod-preview-shell, #mpGameLobbyScreen #mpLobbyMapPreview { max-width: 100%; box-sizing: border-box; }
#mpGameLobbyScreen .mp-gl-seat-sub, #mpGameLobbyScreen .mp-seat-counters .mp-seg-note { font-size: 12px; }
.mp-gl-seat-color .mp-gl-swatch { display: inline-block; vertical-align: middle; }

/* ---- Full-screen screens (skirmish setup, multiplayer): a title bar, a body filling the window and an
   action bar, over the game's dark backdrop. Content keeps a comfortable width on very wide screens. ---- */
.overlay.wod-screen-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 10% 0%, rgba(212, 175, 55, 0.11), transparent 70%),
        radial-gradient(ellipse 60% 60% at 100% 100%, rgba(52, 152, 219, 0.10), transparent 70%),
        linear-gradient(165deg, #111d2c 0%, #0a121c 48%, #05090e 100%);
}
.overlay.wod-screen-overlay > .panel.wod-screen {
    --wod-screen-pad: max(clamp(16px, 3vw, 44px), calc((100vw - 1760px) / 2));
    width: 100% !important;
    max-width: none !important;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}
.wod-screen-phase {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.wod-screen-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin: 0;
    padding: 14px var(--wod-screen-pad);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(180deg, rgba(3, 7, 12, 0.78), rgba(3, 7, 12, 0.45));
}
.wod-screen-titles { min-width: 0; }
.wod-screen .wod-screen-head h2 {
    margin: 0;
    font-size: clamp(24px, 2.1vw, 32px);
    line-height: 1.1;
    letter-spacing: 0.03em;
    color: var(--wod-gold-bright);
}
.wod-screen .wod-screen-sub {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--wod-text-muted);
}
.wod-screen-head-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wod-screen-body {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(12px, 1.8vw, 24px) var(--wod-screen-pad);
    box-sizing: border-box;
}
.wod-screen-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px var(--wod-screen-pad) calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(0deg, rgba(3, 7, 12, 0.85), rgba(3, 7, 12, 0.55));
}
.wod-screen .wod-screen-foot .menu-btn {
    margin: 0;
    width: auto;
    min-width: 140px;
    padding: 11px 24px;
    font-size: 16px;
}
.wod-screen .wod-screen-foot .wod-screen-back {
    background: transparent;
    box-shadow: none;
}
.wod-screen .wod-screen-status {
    margin: 0 0 0 auto;
    font-size: 13px;
    line-height: 1.4;
    color: var(--wod-text-muted);
    text-align: right;
}
.wod-screen p { font-size: 14px; line-height: 1.45; margin: 0 0 10px; }
.wod-screen .mp-display-name-hint { font-size: 12px; margin: 6px 0 0; color: var(--wod-text-muted); }
.wod-screen .mp-host-hint { font-size: 13px; color: var(--wod-text-muted); }
.wod-screen .mp-host-sub { font-size: 14px; color: var(--wod-text-muted); }
.wod-screen .mp-hub-pane-lead { margin: 0 0 12px; }
/* a section heading inside a screen */
.wod-screen .mp-gl-seats-head,
.wod-screen .mp-gl-map-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wod-gold-bright);
}

/* ---- Skirmish setup: a large map on the left (its summary and buttons under it, then the rules), map settings
   and players on the right. One scrolling column on narrow screens. ---- */
#setupPanel .wod-setup-body {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(16px, 2vw, 28px);
    overflow: hidden;
}
#setupPanel .wod-setup-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#setupPanel .wod-setup-col--opts { padding-right: 4px; grid-area: opts; }
#setupPanel .wod-setup-col--map { display: contents; }
#setupPanel .wod-setup-body {
    grid-template-areas: "view opts" "rules opts";
    grid-template-rows: minmax(0, 1fr) auto;
}
#setupPanel .wod-setup-group--rules { grid-area: rules; }
/* (tall screens: the map takes the whole left side, Rules goes under the players) */
@media (min-height: 900px) and (min-width: 821px) {
    #setupPanel .wod-setup-body {
        grid-template-areas: "view opts" "view rules";
        grid-template-rows: auto minmax(0, 1fr);
    }
    #setupPanel .wod-setup-group--rules { align-self: start; }
}
#setupPanel .wod-setup-mapview {
    grid-area: view;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#setupPanel .wod-preview-shell {
    flex: 1 1 auto;
    min-height: 240px;
    margin: 0;
    border-radius: 12px;
    background: #154360;
}
#setupPanel #mapPreview {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    border-radius: 12px;
    object-fit: contain;
}
#setupPanel .wod-setup-mapsum {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.4;
    color: var(--wod-text);
    text-align: center;
    min-height: 1.4em;
}
#setupPanel .wod-setup-maptools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}
#setupPanel .wod-setup-maptools .build-btn,
#setupPanel .wod-setup-maptools .wod-editor-btn {
    margin: 0;
    padding: 7px 14px;
    font-size: 13px;
    min-height: 34px;
}
/* a group of settings: a quiet card with its name on the border */
.wod-setup-group {
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 14px 8px;
    min-width: 0;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}
.wod-setup-group > legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wod-gold-bright);
}
#setupPanel .setup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#setupPanel .setup-row.hidden { display: none; }
#setupPanel .wod-setup-group > .setup-row:last-of-type { border-bottom: 0; }
#setupPanel .setup-row label {
    font-size: 15px;
    color: var(--wod-text);
    min-width: 0;
}
#setupPanel .setup-row select,
#setupPanel .setup-row input[type="number"] {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 6px 9px;
    font-size: 14px;
    background: #22313f;
    border: 1px solid rgba(189, 195, 199, 0.45);
    border-radius: 6px;
}
#setupPanel .setup-row select:focus-visible,
#setupPanel .setup-row input[type="number"]:focus-visible {
    outline: 2px solid var(--wod-gold-bright);
    outline-offset: 1px;
}
/* an on/off setting: a switch with its state written beside it */
.wod-switch-wrap {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.wod-switch-state {
    min-width: 26px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--wod-text-muted);
}
.setup-row input.wod-switch {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    min-width: 44px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(189, 195, 199, 0.45);
    border-radius: 12px;
    background: #3a4652;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.setup-row input.wod-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ecf0f1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}
.setup-row input.wod-switch:checked {
    background: var(--wod-accent-green-deep);
    border-color: var(--wod-accent-green);
}
.setup-row input.wod-switch:checked::before { transform: translateX(20px); }
.setup-row input.wod-switch:focus-visible {
    outline: 2px solid var(--wod-gold-bright);
    outline-offset: 2px;
}
/* a line under a setting saying what it means */
#setupPanel .wod-setup-hint,
#mpHostMapDlg .wod-setup-hint {
    margin: 0 0 6px;
    padding: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--wod-text-muted);
    text-align: left;
}
#mpHostMapDlg .wod-setup-hint { margin: -4px 0 12px; }
.wod-difficulty-hint, #campaignPanel p.wod-difficulty-hint, #mpHostRulesDlg p.wod-difficulty-hint { margin: -4px 0 12px; padding: 0; font-size: 13px; line-height: 1.45; color: var(--wod-text-muted); text-align: left; }
.wod-difficulty-hint:empty { display: none; }
#setupPanel .wod-setup-hint:empty { display: none; }
/* your colour, with a swatch */
#setupPanel .wod-setup-colorpick {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
#setupPanel .wod-setup-swatch {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: #2ecc71;
}
/* who plays, in their colours */
#setupPanel .wod-setup-roster { margin: 4px 0 2px; }
#setupPanel .wod-roster {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}
#setupPanel .wod-roster-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
    line-height: 1.3;
}
#setupPanel .wod-roster-line--you { background: rgba(46, 204, 113, 0.08); }
#setupPanel .wod-roster-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
}
#setupPanel .wod-roster-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: var(--wod-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#setupPanel .wod-roster-tag {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--wod-text-muted);
}
#setupPanel .wod-setup-actions .wod-setup-start {
    margin-left: auto;
    min-width: 220px;
}

/* the lobby's map dialog: labels in one column, controls in the other */
#mpHostMapDlg .mp-host-dlg-lead { font-size: 14px; line-height: 1.45; opacity: 0.9; margin: 0 0 14px; }
#mpHostMapDlg .setup-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: center; }
#mpHostMapDlg .setup-row label { text-align: left; }
#mpHostMapDlg .setup-row select { width: 100%; box-sizing: border-box; }

/* ---- Multiplayer hub: your profile in a sidebar, the sections (games, host, friends, rankings) filling the rest;
   Back and the connection status in the action bar. ---- */
.mp-hub-layout.wod-screen-body {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(16px, 2vw, 28px);
    align-items: stretch;
    overflow: hidden;
}
.wod-screen .mp-profile-card {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.wod-screen .mp-hub-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}
.wod-screen .mp-hub-tabs { flex: 0 0 auto; margin-bottom: 14px; }
.wod-screen .mp-hub-tab { padding: 9px 18px; font-size: 14px; }
.wod-screen .mp-hub-pane.active {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}
.wod-screen .mp-hub-pane-lead { font-size: 14px; text-align: left; }
.wod-screen #mpLobbyList {
    max-height: none;
    overflow: visible;
    border: 0;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wod-screen .mp-lobby-row {
    margin: 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    text-align: left;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    transition: border-color 0.15s ease;
}
.wod-screen .mp-lobby-row:hover { border-color: rgba(212, 175, 55, 0.45); }
.mp-lobby-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mp-lobby-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--wod-text);
}
.mp-lobby-lock { font-size: 13px; }
.mp-lobby-detail { font-size: 13px; color: var(--wod-text-muted); }
.mp-lobby-count { font-size: 12px; color: #9fb3c8; }
.mp-lobby-action { flex: 0 0 auto; font-size: 13px; color: var(--wod-text-muted); }
.mp-lobby-action .build-btn { min-width: 96px; margin: 0; }
.wod-screen .mp-hub-foot { margin-top: 0; }
.wod-screen .mp-host-shell { max-width: 760px; }
.wod-screen #mpLobbyList, .wod-screen #mpFriendsList, .wod-screen #mpLeaderboardList { max-width: 1100px; }

/* ---- Game lobby: seats (and the host's seat counters) on the left; the map, the host's map buttons and the
   settings on the right; Leave and Main menu on the left of the action bar, Launch (or the wait) on its right. ---- */
.mp-gl-grid.wod-screen-body {
    display: grid;
    grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.35fr);
    grid-template-rows: minmax(0, 1fr);
    gap: clamp(16px, 2vw, 28px);
    margin: 0;
    overflow: hidden;
    text-align: left;
}
.mp-gl-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.mp-gl-col--players { padding-right: 4px; }
.wod-screen .mp-gl-seats-head .mp-gl-seat-cap {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--wod-text-muted);
}
.wod-screen #mpGlHostActions { margin-top: 2px; }
.wod-screen #mpGlHostActions .mp-gl-layout-row { border-bottom: 0; padding-bottom: 0; }
.mp-gl-map-head {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: wrap;
}
.wod-screen .mp-gl-host-btns {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wod-screen .mp-gl-host-btns .wod-editor-btn { margin: 0; padding: 7px 14px; font-size: 13px; min-height: 34px; }
.mp-gl-host-only[hidden] { display: none !important; }
.wod-screen .mp-gl-preview {
    flex: 1 1 auto;
    min-height: 220px;
    max-width: none;
    margin: 0;
    border-radius: 12px;
    background: #154360;
}
.wod-screen #mpLobbyMapPreview {
    width: 100%;
    height: 100%;
    max-width: none;
    display: block;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.45);
}
.wod-screen .mp-gl-readout {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
}
.mp-gl-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px 18px;
    margin: 0;
}
.mp-gl-fact { min-width: 0; }
.mp-gl-fact dt {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9fb3c8;
}
.mp-gl-fact dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--wod-text); }
.mp-gl-fact--wide { grid-column: 1 / -1; }
.mp-gl-fact-note { color: var(--wod-text-muted); font-size: 13px; }
.wod-screen .mp-gl-foot .mp-gl-launch-btn { margin-left: auto; min-width: 230px; }

/* ---- narrow screens: one scrolling column per screen ---- */
@media (max-width: 820px) {
    .wod-screen-head { padding: 10px 14px; }
    .wod-screen .wod-screen-head h2 { font-size: 22px; }
    .wod-screen .wod-screen-sub { font-size: 13px; }
    .wod-screen-head-meta { margin-left: 0; }
    .wod-screen-body { padding: 10px 14px 14px; }
    .wod-screen-foot { flex-wrap: wrap; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
    .wod-screen .wod-screen-foot .menu-btn { flex: 1 1 0; min-width: 0; padding: 11px 12px; font-size: 15px; }
    .wod-screen .wod-screen-status { flex: 1 1 100%; order: -1; margin: 0; text-align: center; }
    .wod-screen .wod-screen-status:empty { display: none; }
    .wod-screen .mp-gl-foot .mp-gl-launch-btn { margin-left: 0; min-width: 0; flex-basis: 100%; }
    /* skirmish: the preview, then map, players and rules */
    #setupPanel .wod-setup-body { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
    #setupPanel .wod-setup-col { display: contents; }
    #setupPanel .wod-setup-mapview { order: 1; flex: none; }
    #setupPanel .wod-setup-group--map { order: 2; }
    #setupPanel .wod-setup-group--players { order: 3; }
    #setupPanel .wod-setup-group--rules { order: 4; }
    #setupPanel .wod-preview-shell { flex: none; min-height: 0; aspect-ratio: 16 / 10; }
    #setupPanel .setup-row { grid-template-columns: minmax(0, 1fr) minmax(130px, 52%); gap: 10px; }
    #setupPanel .wod-roster { grid-template-columns: minmax(0, 1fr); }
    #setupPanel .wod-setup-actions .wod-setup-start { margin-left: 0; min-width: 0; }
    .mp-hub-layout.wod-screen-body > *, .mp-gl-grid.wod-screen-body > *, .wod-screen .mp-hub-main > *, .mp-gl-col > *,
    #setupPanel .wod-setup-body > *, #setupPanel .wod-setup-col > * { flex: 0 0 auto; }
    .wod-screen .mp-hub-main, .mp-gl-col, .wod-screen .mp-profile-card { min-height: auto; }
    /* hub: the sections first, the profile after */
    .mp-hub-layout.wod-screen-body { display: flex; flex-direction: column; overflow-y: auto; }
    .wod-screen .mp-hub-main { order: 1; }
    .wod-screen .mp-profile-card { order: 2; overflow: visible; }
    .wod-screen .mp-hub-pane.active { overflow: visible; padding-right: 0; }
    .wod-screen .mp-lobby-row { padding: 12px 14px; gap: 12px; }
    /* lobby: the map and its settings, then the seats */
    .mp-gl-grid.wod-screen-body { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
    .mp-gl-col { overflow: visible; }
    .mp-gl-col--map { order: 1; }
    .mp-gl-col--players { order: 2; padding-right: 0; }
    .wod-screen .mp-gl-preview { flex: none; min-height: 0; aspect-ratio: 16 / 10; }
    .wod-screen .mp-gl-host-btns { margin-left: 0; }
}
@media (max-height: 600px) and (min-width: 821px) {
    .wod-screen-head { padding-top: 8px; padding-bottom: 8px; }
    .wod-screen .wod-screen-sub { display: none; }
    .wod-screen-foot { padding-top: 8px; padding-bottom: 8px; }
    #setupPanel .wod-preview-shell, .wod-screen .mp-gl-preview { min-height: 160px; }
}
