/* =================================================================================
   SECTION 1: ROOT & GLOBAL STYLES
================================================================================= */
:root {
    /* Fonts */
    --font-sans: 'Roboto', sans-serif;
    --font-header: 'Oswald', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Colors */
    --bg-color: #F4F7F6;
    --panel-bg: #FFFFFF;
    --border-color: #DDE1E3;
    --text-primary: #1A1A1A;
    --text-secondary: #5C5C5C;
    --text-light: #9A9A9A;

    --color-home: #004A99;
    --color-away: #D50032;
    --color-accent: #FFC72C;
    --color-destroyed: #888888;
}

/* Base font size set to 12px. All 'rem' units are relative to this. */
html {
    font-size: 12px;
    height: 100%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 1.25rem;
    overflow-x: hidden;
}

/* =================================================================================
   SECTION 2: LAYOUT & PANELS
================================================================================= */
.console-grid {
    display: grid;
    /* Left Col (Sliders), Center Col (Main), Right Col (Sliders) */
    grid-template-columns: minmax(210px, 240px) minmax(375px, 525px) minmax(210px, 240px);
    gap: 1.25rem;
    width: 100%;
    max-width: 1020px;
    justify-content: center;
}

.console-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.center-column {
    max-width: 100%;
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
}

.panel-header {
    padding: 1rem 1.25rem;
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    position: relative;
}

.panel-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Responsive Layout */
@media (max-width: 900px) {
    .console-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }
    .center-column {
        grid-column: 1 / -1;
        order: 1;
        min-width: 0; 
    }
    .left-column { order: 2; }
    .right-column { order: 3; }
}

@media (max-width: 450px) {
    body { padding: 0.5rem; }
    .console-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .panel-content { padding: 1rem; }
    .panel-header { padding: 0.75rem 1rem; }
    .center-column {
         min-width: 0;
     }
}

/* =================================================================================
   SECTION 3: SCOREBOARD & OOB LISTS (CENTER)
================================================================================= */

.combined-scoreboard-panel {
    padding: 0;
}

/* --- MODIFIED: Scoreboard --- */
.scoreboard-main {
    display: grid; 
    /* MODIFIED: 1fr auto 1fr (Name, Visualizer, Name) */
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); 
    align-items: center;
    padding: 1.25rem 1rem; /* Reduced padding */
    gap: 0.75rem; 
}

.scoreboard-name {
    font-family: var(--font-header);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; 
}
#scoreboard-blue-name { text-align: left; }
#scoreboard-red-name { text-align: right; }

/* --- DELETED: .scoreboard-score --- */
/* --- DELETED: .scoreboard-info --- */

/* --- NEW: Battle Visualizer Styles --- */
.battle-visualizer {
    position: relative;
    height: 34px;
    width: 200px;
    background-color: rgba(213, 0, 50, 0.4); /* Red (Away) background */
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.battle-slider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%; /* Default 50% */
    background-color: rgba(0, 74, 153, 0.4); /* Blue (Home) foreground */
    transition: width 0.3s ease;
    z-index: 1;
}
.battle-day {
    /* This is the repurposed #game-time-display */
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    white-space: nowrap;
    line-height: 1;
}

.oob-row {
    display: grid;
    /* MODIFIED: Name (1fr), Qty/Loss (auto) */
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: transparent; /* MODIFIED */
    border: none; /* MODIFIED */
    border-bottom: 1px solid var(--border-color); /* MODIFIED */
    border-radius: 0; /* MODIFIED */
    font-family: var(--font-mono);
    font-size: 1.1rem;
    align-items: center;
    /* NEW: For click-to-view-details */
    cursor: pointer;
    transition: background-color 0.2s ease;
}
/* NEW: Hover state */
.oob-row:hover {
    background-color: var(--bg-color);
}
.oob-list-column > .oob-row:last-child {
    border-bottom: none;
}


.oob-row.destroyed {
    opacity: 0.4;
    background-color: var(--bg-color);
    color: var(--text-secondary);
}
.oob-row.destroyed .oob-name {
    text-decoration: line-through;
}
/* NEW: Destroyed hover state */
.oob-row.destroyed:hover {
    background-color: #e9ecef;
}

.oob-name {
    font-family: var(--font-header);
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left !important;
}
#blue-oob-list .oob-name { color: var(--color-home); }
#red-oob-list .oob-name { color: var(--color-away); }

.oob-row span {
    text-align: right;
}

/* NEW: OOB Qty/Loss specific styles */
.oob-qty-loss {
    font-weight: 700;
    white-space: nowrap; /* Prevent wrapping */
}
.oob-losses {
    color: var(--color-away);
    font-size: 0.9rem;
    margin-left: 0.25rem;
}
/* DELETED: .oob-kills (no longer displayed) */

.oob-empty {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--text-light);
    text-align: center;
    padding-top: 2rem;
}
/* --- End OOB List Styles --- */


/* === Sim Controls Panel === */
.sim-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.sim-speed-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

.sim-sub-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-sim {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--color-home);
    color: #FFF;
    transition: all 0.2s ease;
}
.btn-sim:hover:not(:disabled) {
    background-color: #00336A;
}
.btn-sim:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
}

.btn-sim.secondary {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--panel-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}
.btn-sim.secondary:hover:not(:disabled) {
    background-color: var(--bg-color);
    border-color: var(--text-secondary);
}

.btn-speed {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--panel-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-speed:hover {
    background: var(--bg-color);
    border-color: var(--text-secondary);
}
.btn-speed.active {
    background: var(--text-primary);
    color: var(--panel-bg);
    border-color: var(--text-primary);
}


/* =================================================================================
   SECTION 4: STRATEGY PANELS (LEFT & RIGHT)
================================================================================= */
.team-logo {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    background-color: var(--bg-color);
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
}
#blue-logo { color: var(--color-home); }
#red-logo { color: var(--color-away); }

/* --- DELETED: .team-select styles --- */

/* --- DELETED: .ratings-display styles --- */

.ai-toggle-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}
.ai-toggle-group label {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.ai-toggle {
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.ai-toggle:disabled + label,
.ai-toggle:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.gameplan-header {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.05em;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
}
.slider-label span:not(.slider-value) {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-header);
    flex-grow: 1;
}
.slider-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    background-color: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-color);
    border-radius: 5px;
    outline: none;
    border: 1px solid var(--border-color);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--panel-bg);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    border: 2px solid var(--panel-bg);
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Active Slider Thumbs */
#blue-controls input[type="range"]::-webkit-slider-thumb { background: var(--color-home); }
#blue-controls input[type="range"]::-moz-range-thumb { background: var(--color-home); }
#red-controls input[type="range"]::-webkit-slider-thumb { background: var(--color-away); }
#red-controls input[type="range"]::-moz-range-thumb { background: var(--color-away); }

/* Disabled Sliders */
input[type="range"]:disabled::-webkit-slider-thumb {
    background: var(--text-light);
    cursor: not-allowed;
}
input[type="range"]:disabled::-moz-range-thumb {
    background: var(--text-light);
    cursor: not-allowed;
}
input[type="range"]:disabled {
    background: var(--border-color);
    opacity: 0.7;
}

.slider-description {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* --- NEW: OOB List (in side columns) --- */
.oob-list-column {
    height: 300px;
    overflow-y: auto;
    padding: 0.75rem;
    gap: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 1.25rem;
}
/* NEW: OOB Group Header (for side columns) */
.oob-group-header {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.5rem 0.25rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
}
.oob-list-column .oob-group-header:first-child {
    margin-top: 0;
}
/* --- End OOB List --- */


/* =================================================================================
   SECTION 5: TOOLTIPS
================================================================================= */
.tooltip {
    position: relative;
    display: inline-block;
    z-index: 5;
}

.tooltip > span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-light);
    color: var(--panel-bg);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    cursor: help;
    display: block;
}
.slider-label .tooltip {
    order: -1;
    margin-right: 8px;
}
.ai-toggle-group .tooltip {
    margin-right: -4px;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 210px;
    background-color: #1A1A1A;
    color: #FFF;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 6px;
    padding: 0.75rem;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -105px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1A1A1A transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text b {
    color: var(--color-accent);
}

/* =================================================================================
   SECTION 6: MODAL & ROSTER EDITOR
================================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Changed from 'flex' */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.5); /* Added backdrop */
}

.modal-panel {
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-panel .panel-content {
    overflow-y: auto;
}

.modal-close {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.modal-textarea {
    width: 100%;
    min-height: 263px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    resize: vertical;
}
.modal-textarea:focus {
    outline: none;
    border-color: var(--color-home);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2);
}

.modal-error {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-away);
    background-color: rgba(213, 0, 50, 0.05);
    border: 1px solid rgba(213, 0, 50, 0.2);
    padding: 0.75rem;
    border-radius: 6px;
}

/* =================================================================================
   SECTION 7: BATTLE LOG (PBP) PANEL
   --- DELETED ---
================================================================================= */


/* =================================================================================
   SECTION 8: CAMPAIGN MODE
================================================================================= */

.challenge-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-step-header {
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* --- NEW: Scenario Card (in Challenge Setup) --- */
.scenario-card {
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.scenario-card:hover {
    background-color: var(--panel-bg);
    border-color: var(--text-secondary);
}
.scenario-card.active {
    border-color: var(--color-home);
    background-color: #e8f0fe;
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2);
}
.scenario-name {
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-home);
    margin-bottom: 0.5rem;
}
.scenario-card.active .scenario-name {
    color: #00336A;
}
.scenario-desc {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
/* --- End Scenario Card --- */


#challenge-builder-sliders {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Roadmap grid */
#roadmap-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default 1 column */
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 6px;
    background-color: var(--bg-color);
    max-height: 300px;
    overflow-y: auto;
}

@media (min-width: 500px) {
    #roadmap-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on larger screens */
    }
}


.roadmap-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--panel-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-wrap: wrap;
}

.roadmap-logo {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 40px;
    flex-shrink: 0;
    text-align: center;
}

.roadmap-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-grow: 1;
}

.roadmap-item.beaten {
    opacity: 1;
    background-color: var(--bg-color);
}
.roadmap-item.beaten .roadmap-name {
    text-decoration: line-through;
    color: var(--text-light);
}
.roadmap-item.beaten .roadmap-logo {
    color: var(--text-light);
}

.roadmap-item.next {
    opacity: 1;
    border-color: var(--color-home);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2);
}
.roadmap-item.next .roadmap-name {
    font-weight: 700;
    color: var(--text-primary);
}
.roadmap-item.next .roadmap-logo {
    color: var(--color-home);
}

.roadmap-score {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: auto;
    white-space: nowrap;
}

.roadmap-score.win {
    background-color: var(--color-home);
    color: white;
}

.roadmap-item.lost {
    opacity: 1;
    background-color: rgba(213, 0, 50, 0.05);
    border-color: var(--color-away);
}
.roadmap-item.lost .roadmap-name {
    font-weight: 700;
    color: var(--color-away);
}
.roadmap-item.lost .roadmap-logo {
    color: var(--color-away);
}

.roadmap-score.loss {
    background-color: var(--color-away);
    color: white;
}

#btn-roadmap-next-game:disabled {
    background-color: var(--text-light);
    border-color: var(--border-color);
    cursor: not-allowed;
}

/* =================================================================================
   SECTION 9: WIN PROBABILITY CHART
   --- DELETED ---
================================================================================= */


/* =================================================================================
   SECTION 10: MISC & FIXES
================================================================================= */

/* Re-enable text selection for textareas */
textarea,
input[type="text"] {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

#btn-roadmap-quit {
    display: none;
}

/* Hides/Shows the correct UI */
.sim-mode .sandbox-ui { display: none; }
.setup-mode .sim-ui { display: none; }

/* Faction Selector in L/R columns */
.builder-faction-select {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.builder-faction-select label {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.builder-select {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    cursor: pointer;
    width: 100%;
    padding: 0.25rem 0.5rem;
}
#blue-faction-select { color: var(--color-home); }
#red-faction-select { color: var(--color-away); }

/* Writable OOB list in L/R columns */
.builder-oob-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: var(--bg-color);
}
.oob-build-row {
    display: grid;
    grid-template-columns: 1fr 60px 25px;
    gap: 0.5rem;
    align-items: center;
    background-color: var(--panel-bg);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.oob-build-name {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.oob-build-qty {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-align: right;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem;
}
.oob-build-remove {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-away);
    background: none;
    border: none;
    cursor: pointer;
}

/* Unit Picker in Center column */
#sandbox-unit-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    overflow-y: auto;
}
.unit-picker-card {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.unit-picker-name {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1rem;
}
.unit-picker-type {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}
.unit-picker-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: auto;
}
.unit-picker-buttons button {
    font-family: var(--font-header);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.25rem;
}
.unit-picker-buttons button[data-team="blue"] {
    background-color: var(--color-home);
    color: white;
}
.unit-picker-buttons button[data-team="red"] {
    background-color: var(--color-away);
    color: white;
}

/* =================================================================================
   SECTION 11: NEW UNIT DETAILS MODAL
================================================================================= */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.detail-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.detail-label {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.detail-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}
.kill-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 120px;
    overflow-y: auto;
    padding-top: 0.25rem;
}
.kill-log-item {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}
.kill-log-name {
    font-weight: 500;
    color: var(--text-secondary);
}
.kill-log-qty {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}
.kill-log-empty {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* =================================================================================
   SECTION 12: NEW CASUALTY PANEL STYLES (V7)
================================================================================= */

/* This is the new list container we added in index.html */
.casualty-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem; /* Matches old .casualty-side gap */
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

/* This is the empty state text (e.g., "--") */
.casualty-empty {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-light);
}

/* A standard line item (e.g., "1,200 Medium Tanks") */
.casualty-item {
    color: var(--text-primary);
}

/* A sub-item (e.g., "300 Killed & Wounded") */
.casualty-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
#casualty-red .casualty-detail {
    padding-left: 0;
    text-align: right;
}

#casualty-red-strength,
#casualty-red-casualties {
    text-align: right;
}

/* --- NEW: Casualty Panel (Center Column) --- */
.casualty-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.casualty-side {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.casualty-header {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
}

.oob-child {
    background-color: rgba(0, 0, 0, 0.03); /* Slight shading to indicate depth */
    border-bottom: 1px dashed var(--border-color); /* Dashed line to differentiate */
}

/* Make the cargo name smaller and lighter */
.oob-child .oob-name {
    font-size: 0.8rem;
    color: var(--text-secondary) !important;
    font-weight: 500;
}

/* Ensure the row hover effect still works but stays distinct */
.oob-child:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* NEW: Despawned (Mission Complete) Style */
.oob-row.despawned {
    opacity: 0.6;
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
}
.oob-row.despawned .oob-name {
    /* No strike-through for successful mission */
    text-decoration: none; 
    font-style: italic;
}
.oob-row.despawned:hover {
    background-color: var(--bg-color);
}

/* =================================================================================
   MOBILE SCOREBOARD STACKING
================================================================================= */
@media (max-width: 600px) {
    .scoreboard-main {
        /* Change grid from 3 columns to 1 column */
        grid-template-columns: 1fr;
        /* Stack order: Blue Name -> Time -> Red Name */
        grid-template-rows: auto auto auto; 
        gap: 0.5rem;
    }

    /* Force the center timer bar to stretch full width */
    .battle-visualizer {
        width: 100%;
    }

    /* Center-align the text and override the specific ID left/right alignments */
    #scoreboard-blue-name, 
    #scoreboard-red-name {
        text-align: center;
        white-space: normal; /* Allow names to wrap if they are very long */
        font-size: 1.2rem;   /* Adjust font size for mobile readability */
    }
    
    /* Optional: Add a little spacing specifically to the bottom name */
    #scoreboard-red-name {
        margin-top: 0.25rem;
    }
}