/* ===== OVERRIDE CUSTOM CURSOR FOR LOBBY ===== */
body, body * {
    cursor: auto !important;
}
a, button, select, summary,
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"],
input[type="range"], label[for], [role="button"], .clickable, .nav-link, .nav-card,
.mode-tab, .control-btn, .slot-empty, .slot-release, .pylon-clear-btn,
.loadout-btn-kneeboard {
    cursor: pointer !important;
}
.leaflet-grab { cursor: grab !important; }
.leaflet-dragging, .leaflet-dragging .leaflet-grab { cursor: grabbing !important; }

/* ===== LOBBY HEADER OVERRIDES ===== */
.dash-cell { padding: 6px 15px; }
.dash-home {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-width: 56px;
    padding: 0 !important;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.15s, background 0.15s;
    border-right: 1px solid var(--border);
}

.dash-home:hover {
    color: var(--amber);
    background: rgba(200, 154, 32, 0.06);
}

.dash-home-tower {
    width: 22px;
    height: 36px;
    color: inherit;
}

.dash-title { min-width: 260px; }
.dash-title .callsign { font-size: 26px; }
.dash-label { font-size: 11px; }
.dash-value { font-size: 21px; }
.dash-sub { font-size: 14px; }
.dash-news { flex: 0 0 770px; width: 770px; }
.dash-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(70px, 1fr));
    align-content: center;
    gap: 5px;
}
.dash-nav .nav-link {
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    letter-spacing: 3px;
}

/* ===== LOBBY LAYOUT ===== */
.main-layout {
    display: flex;
    height: calc(100vh - 102px);
}

#map-panel {
    flex: 1;
    min-width: 0;
    position: relative;
}

#map-panel .map-crosshair-coords {
    top: -36px;
}

#lobby-panel {
    width: 700px;
    min-width: 700px;
    cursor: auto;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 0;
    background:
        linear-gradient(to right, rgba(180, 60, 60, 0.35) 0px, rgba(180, 60, 60, 0.35) 2px, transparent 2px),
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 26px,
            rgba(100, 140, 200, 0.25) 26px,
            rgba(100, 140, 200, 0.25) 27px
        );
    background-position: 30px 0, 0 12px;
    background-color: #f5f2ea;
    background-attachment: local;
    color: #1a1a1a;
}

/* Briefing text colors on light background */
#lobby-panel .briefing-header {
    background: rgba(240, 237, 228, 0.9);
    padding-left: 44px;
}

#lobby-panel .briefing-section {
    padding-left: 44px;
}

#lobby-panel .briefing-footer {
    padding-left: 44px;
}

#lobby-panel .briefing-header h2 {
    color: #111;
}

#lobby-panel .classification {
    color: #b91c1c;
    border-color: #b91c1c;
}

#lobby-panel .brief-meta {
    color: #6b5a00;
}

#lobby-panel .briefing-section h3 {
    color: #1a3a1a;
}

#lobby-panel .briefing-section div {
    color: #1a1a1a;
}

#lobby-panel .briefing-section li::before {
    color: #2a5a2a;
}

#lobby-panel .brief-callsign {
    color: #c0392b;
}

#lobby-panel .brief-freq {
    color: rgb(107, 90, 0);
}

#lobby-panel .brief-threat {
    color: #b91c1c;
}

#lobby-panel .brief-coord {
    color: #c0392b;
}

#lobby-panel .briefing-footer {
    border-top-color: rgba(100, 140, 200, 0.3);
    padding-bottom: 40px;
}

/* ===== PILOT SCRATCHPAD ===== */
.scratchpad {
    margin: 0;
    padding: 20px 28px 20px 44px;
    border-bottom: 1px solid rgba(100, 140, 200, 0.25);
    background: transparent;
}

.scratchpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.scratchpad-title {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 2px;
    color: #1a3a1a;
    font-weight: 700;
    text-decoration: underline dotted;
    text-decoration-color: rgba(0, 0, 0, 0.3);
    text-underline-offset: 4px;
}

.scratchpad-status {
    font-size: 10px;
    color: #8a7a60;
    letter-spacing: 1px;
}

.scratchpad-paper {
    min-height: 40px;
    max-height: 220px;
    overflow-y: auto;
    padding: 0;
}

.scratchpad-paper:empty::before {
    content: 'No notes yet...';
    color: #a09880;
    font-style: italic;
    font-size: 13px;
}

.scratchpad-note {
    padding: 2px 0;
    font-size: 13px;
    line-height: 27px;
    color: #1a1a1a;
    font-family: var(--font-mono);
}

.scratchpad-note .note-author {
    font-weight: 700;
    color: #2c5f9e;
    margin-right: 6px;
}

.scratchpad-note .note-time {
    font-size: 10px;
    color: #8a7a60;
    margin-left: 8px;
    float: right;
    line-height: 27px;
}

.scratchpad-input-row {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.scratchpad-name {
    width: 90px;
    flex-shrink: 0;
    padding: 5px 8px;
    font-size: 12px;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(100, 140, 200, 0.25);
    border-radius: 3px;
    color: #1a1a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scratchpad-input {
    flex: 1;
    padding: 5px 8px;
    font-size: 13px;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(100, 140, 200, 0.25);
    border-radius: 3px;
    color: #1a1a1a;
}

.scratchpad-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-family: var(--font-heading);
    letter-spacing: 2px;
    background: rgba(100, 140, 200, 0.15);
    color: #1a3a1a;
    border: 1px solid rgba(100, 140, 200, 0.25);
    border-radius: 3px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}

.scratchpad-btn:hover {
    background: rgba(100, 140, 200, 0.3);
}

.scratchpad-name::placeholder,
.scratchpad-input::placeholder {
    color: #a09880;
    font-style: italic;
}

.scratchpad-paper::-webkit-scrollbar {
    width: 6px;
}

.scratchpad-paper::-webkit-scrollbar-thumb {
    background: rgba(100, 140, 200, 0.2);
    border-radius: 3px;
}

/* ===== LOADOUT OVERLAY — DCS ME Style ===== */
#loadout-overlay {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 12, 18, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

#loadout-panel {
    background: linear-gradient(180deg, #2a3444 0%, #1a2430 40%, #101820 100%);
    border: 1px solid #3a4a5a;
    width: 100%;
    max-width: 1800px;
    height: 98vh;
    max-height: 98%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}

/* Top area: aircraft left, settings right */
.loadout-body {
    display: flex;
    flex: 53;
    min-height: 0;
    overflow: hidden;
}

.loadout-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.loadout-aircraft {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.loadout-aircraft::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(16, 24, 32, 0.5) 0%, rgba(16, 24, 32, 0.2) 30%, transparent 60%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
    transition: opacity 0.8s ease;
}

.loadout-aircraft:hover::before {
    opacity: 0.5;
}


/* Weather box — left corner over aircraft image */
.loadout-wx {
    position: absolute;
    top: 16px;
    left: 94px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 16, 22, 0.209);
    padding: 6px 10px;
    border: 1px solid rgba(80, 96, 112, 0.197);
    pointer-events: none;
}

.loadout-wx .wx-icon {
    width: 28px;
    height: 28px;
    opacity: 0.8;
    flex-shrink: 0;
}

.loadout-wx .wx-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.loadout-wx .wx-main {
    font-family: var(--font-heading);
    font-size: 12px;
    color: #c8d4e0;
    font-weight: 700;
    letter-spacing: 1px;
}

.loadout-wx .wx-detail {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #919ba4;
    letter-spacing: 0.5px;
}

.loadout-aircraft img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.95;
    position: relative;
    z-index: 0;
    filter: brightness(1.15) contrast(1.1);
}


/* Pylon strip — horizontal bar below aircraft */
.loadout-pylon-strip {
    display: flex;
    justify-content: center;
    padding: 0 12px 8px;
    gap: 0;
}

.pylon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 63px;
    cursor: pointer;
    position: relative;
}

.pylon-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #c8d4e0;
    padding: 2px 0;
    text-align: center;
    letter-spacing: 1px;
}

.pylon-box {
    width: 64px;
    height: 52px;
    background: #b8bfc7;
    border: 1px solid #8b7037;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.pylon-cell:hover .pylon-box {
    background: #5a6a7a;
    border-color: #8ab;
}

.pylon-cell.pylon-active .pylon-box {
    background: #b8b8b8;
    border-color: #ff9500;
}

.pylon-box img {
    width: 56px;
    height: 52px;
    object-fit: contain;
    filter: brightness(0) !important;
}

/* Right panel: fuel, ammo, flares */
.loadout-right {
    width: 380px;
    box-sizing: border-box;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 1px solid #506070;
    overflow: hidden;
    transform: translateZ(0);
}

.loadout-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loadout-row-label {
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    color: #c8d4e0;
    width: 120px;
    flex-shrink: 0;
}

.loadout-bar-wrap {
    flex: 1;
    height: 18px;
    background: #1a2430;
    border: 1px solid #506070;
    position: relative;
    overflow: hidden;
}

.loadout-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #5a8ab0 0px, #5a8ab0 3px,
        #4a7a9a 3px, #4a7a9a 6px
    );
    transition: width 0.2s;
}

.loadout-bar-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #c8d4e0;
    white-space: nowrap;
    width: 44px;
    flex-shrink: 0;
    text-align: right;
}

.loadout-select-row {
    margin-top: 8px;
}

.loadout-select-row label {
    display: block;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    color: #8a9aaa;
    margin-bottom: 3px;
}

.loadout-dropdown {
    width: 100%;
    padding: 5px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #c8d4e0;
    background: #1a2430;
    border: 1px solid #506070;
    cursor: pointer;
}

.loadout-dropdown option { background: #1a2430; }
.loadout-dropdown optgroup { color: #ffaa00; font-weight: 700; font-style: normal; }

/* Weapon picker panel */
.loadout-weapon-picker {
    padding: 0 12px 6px;
    background: #101820;
    transform: translateZ(0);
    border-top: 1px solid #506070;
    display: none;
    max-height: none;
    overflow-y: auto;
    flex: 47;
}

.loadout-weapon-picker.active {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
}

.weapon-group-title {
    width: 100%;
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 2px;
    color: #ffaa00;
    padding: 7px 0 3px;
    border-bottom: 1px solid #304050;
    margin-bottom: 1px;
}

.weapon-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #1a1a1a;
    background: #c8d0d8;
    border: 1px solid #b0b8c0;
    border-left: 3px solid #8090a0;
    transition: all 0.1s;
    white-space: nowrap;
    width: 278px;
    margin: 2px 6px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weapon-option:hover {
    background: #dde4ea;
    border-color: #8a9aaa;
    color: #000;
}

.weapon-option.selected {
    background: #e8ecf0;
    border-color: #ff9500;
    border-left: 3px solid #ff9500;
    color: #000;
}

.weapon-option img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
    filter: brightness(0) !important;
}

.weapon-option-empty {
    width: 100%;
    color: #607080;
    font-style: italic;
    padding: 4px 8px;
    border-bottom: 1px solid #304050;
    margin-bottom: 1px;
}

/* Bottom bar: weight + buttons */
.loadout-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #101820;
    transform: translateZ(0);
    border-top: 1px solid #506070;
}

.loadout-weight {
    font-family: var(--font-heading);
    font-size: 14px;
    color: #c8d4e0;
    letter-spacing: 1px;
}

.loadout-weight span {
    font-family: var(--font-mono);
    color: #fff;
    font-size: 16px;
}

.loadout-weight small {
    display: block;
    font-size: 13px;
    color: #607080;
    text-align: center;
    letter-spacing: 2px;
}

.loadout-btn-cancel {
    padding: 8px 28px;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 2px;
    color: #c8d4e0;
    background: #1d242b;
    border: 1px solid #506878;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}

.loadout-btn-cancel:hover { background: #4a5a6a; }

.loadout-btn-ok {
    padding: 8px 36px;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 2px;
    color: #ffef3d;
    background: #d4760a;
    border: 1px solid #e8940a;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}

.loadout-btn-ok:hover { background: #e8940a; }

.loadout-title-bar {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    color: #ffffff;
    padding: 8px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.loadout-title-pilot {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.loadout-title-sub {
    font-size: 13px;
    color: #8a9aaa;
    letter-spacing: 1px;
}

/* Weapon picker scrollbar */
.loadout-weapon-picker::-webkit-scrollbar { width: 6px; }
.loadout-weapon-picker::-webkit-scrollbar-thumb { background: #c04040; border-radius: 3px; }
.loadout-weapon-picker::-webkit-scrollbar-thumb:hover { background: #e05050; }

/* Slot pilot name + loadout summary layout */
.slot-booked {
    flex: 1;
    background: rgba(0, 100, 50, 0.1);
    border: 1px solid rgba(0, 100, 50, 0.4);
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #1a5a1a;
    letter-spacing: 1px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
}

.slot-pilot-name {
    flex: 1;
    min-width: 80px;
}

.slot-loadout-summary {
    width: 100%;
    font-size: 11px;
    color: #5a8a5a;
    letter-spacing: 0;
    margin-top: 2px;
    line-height: 1.3;
}

/* Range sliders — filled track via JS-set background gradient */
input[type="range"].loadout-slider {
    -webkit-appearance: none;
    flex: 1;
    height: 14px;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
    border-radius: 0;
    background: transparent;
}

input[type="range"].loadout-slider::-webkit-slider-runnable-track {
    height: 6px;
    border: 1px solid #506070;
    border-radius: 0;
}

input[type="range"].loadout-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 4px;
    height: 14px;
    background: #e0e8f0;
    border: 1px solid #ffffff;
    cursor: pointer;
    border-radius: 0;
    margin-top: -4px;
}

input[type="range"].loadout-slider::-moz-range-track {
    height: 6px;
    background: transparent;
    border: 1px solid #506070;
    border-radius: 0;
}

input[type="range"].loadout-slider::-moz-range-thumb {
    width: 4px;
    height: 14px;
    background: #e0e8f0;
    border: 1px solid #ffffff;
    cursor: pointer;
    border-radius: 0;
}

/* Pylon clear button */
.pylon-clear-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: rgba(180, 30, 30, 0.85);
    border: none;
    color: #fff;
    font-size: 11px;
    line-height: 14px;
    text-align: center;
    cursor: pointer !important;
    padding: 0;
    display: none;
    z-index: 2;
}

.pylon-box {
    position: relative;
}

.pylon-cell:hover .pylon-clear-btn,
.pylon-cell.pylon-active .pylon-clear-btn {
    display: block;
}

/* Asymmetry warning */
.loadout-asym-warn {
    margin-top: 8px;
    padding: 6px 10px;
    background: #351d03;
    border: 1px solid #c70000;
    color: #ff424c;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Kneeboard button */
.loadout-btn-kneeboard {
    padding: 8px 18px;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    color: #32b521;
    background: #2a371a;
    border: 1px solid #506878;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}

.loadout-btn-kneeboard:hover { background: #3a5a6a; }

/* Loadout button in slot row */
.slot-loadout {
    background: none;
    border: 1px solid rgba(30, 70, 160, 0.5);
    color: #2a5caa;
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 1px;
    padding: 3px 8px;
    margin-left: 6px;
    border-radius: 2px;
    transition: all 0.15s;
}

.slot-loadout:hover {
    background: rgba(30, 70, 160, 0.15);
    border-color: #2a5caa;
}

.slot-loadout-set {
    color: #2d7a3a;
    border-color: rgba(45, 122, 58, 0.4);
}

.slot-loadout-set:hover {
    background: rgba(45, 122, 58, 0.15);
    border-color: #2d7a3a;
}

/* Scrollbar — red/yellow theme */
#lobby-panel::-webkit-scrollbar {
    width: 8px;
}

#lobby-panel::-webkit-scrollbar-track {
    background: #ebe8e0;
}

#lobby-panel::-webkit-scrollbar-thumb {
    background: #c04040;
    border-radius: 4px;
}

#lobby-panel::-webkit-scrollbar-thumb:hover {
    background: #a02020;
}

#lobby-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

#lobby-placeholder .placeholder-icon {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

#lobby-placeholder p {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 1px;
}

/* ===== SLOT SECTION ===== */
#slot-section {
    border-top: 2px solid rgba(100, 140, 200, 0.3);
    padding-bottom: 120px;
}

#slot-section .section-title {
    color: #1a3a1a;
}

.flight-group {
    padding: 12px 16px 12px 44px;
    border-bottom: 1px solid rgba(100, 140, 200, 0.15);
}

.flight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.flight-callsign {
    font-family: var(--font-heading);
    font-size: 20px;
    letter-spacing: 2px;
    color: #111;
}

.flight-aircraft {
    font-family: var(--font-mono);
    font-size: 18px;
    color: #6b5a00;
    letter-spacing: 1px;
}

.slot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    padding-left: 12px;
}

.slot-number {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #888;
    width: 24px;
    text-align: right;
}

.slot-empty {
    flex: 1;
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed #aaa;
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 1px;
}

.slot-empty:hover {
    border-color: #1a5a1a;
    color: #1a5a1a;
    background: rgba(0, 100, 50, 0.08);
    cursor: pointer;
}

.slot-release {
    background: none;
    border: 1px dashed rgba(120, 20, 20, 0.7);
    color: #b91c1c;
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 1px;
    padding: 3px 8px;
    opacity: 0.6;
    border-radius: 2px;
}

.slot-release:hover {
    opacity: 1;
}

/* ===== PLAYER PACKAGES ===== */
.player-groups-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 8px 44px;
    border-top: 2px solid rgba(160, 140, 0, 0.25);
    margin-top: 6px;
}

.player-groups-label {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 3px;
    color: #7a7000;
    flex: 1;
}

.player-group-add-btn {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1a3a1a;
    background: rgba(160, 140, 0, 0.12);
    border: 1px solid rgba(140, 120, 0, 0.45);
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.player-group-add-btn:hover {
    background: rgba(160, 140, 0, 0.25);
    border-color: rgba(140, 120, 0, 0.8);
    color: #000;
}

.player-group-util-btn {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: #888;
    background: none;
    border: 1px solid #ccc;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.player-group-util-btn:hover {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.5);
    background: rgba(185, 28, 28, 0.05);
}

.player-flight-group {
    border-left: 2px solid rgba(180, 160, 0, 0.45);
}

.player-group-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: #7a7000;
    background: rgba(160, 140, 0, 0.12);
    padding: 2px 6px;
    border: 1px solid rgba(140, 120, 0, 0.35);
}

.player-group-del {
    margin-left: auto;
    background: none;
    border: 1px solid rgba(185, 28, 28, 0.3);
    color: #b91c1c;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 3px 9px;
    cursor: pointer;
    opacity: 0.45;
    transition: all 0.15s;
}

.player-group-del:hover {
    opacity: 1;
    background: rgba(185, 28, 28, 0.07);
}

.player-group-form {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 12px 44px;
    background: rgba(180, 160, 0, 0.04);
    border-top: 1px solid rgba(160, 140, 0, 0.2);
    border-bottom: 1px solid rgba(160, 140, 0, 0.2);
}

.pg-input {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #fff;
    border: 1px solid #bbb;
    border-bottom-color: #888;
    color: #1a1a1a;
    padding: 5px 9px;
    letter-spacing: 1px;
    width: 130px;
    outline: none;
    transition: border-color 0.15s;
}

.pg-input:focus {
    border-color: #7a7000;
    border-bottom-color: #7a7000;
}

select.pg-input {
    width: 180px;
    cursor: pointer;
    appearance: auto;
}

/* Hide native radio, style label as toggle button */
.pg-size-opt input[type="radio"] {
    display: none;
}

.pg-size-opt {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: #555;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #bbb;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.pg-size-opt:has(input:checked) {
    background: rgba(40, 80, 40, 0.12);
    border-color: #2d7a3a;
    color: #1a5a1a;
    font-weight: bold;
}

.pg-create-btn {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    background: #1a5a1a;
    border: 1px solid #1a5a1a;
    padding: 5px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.pg-create-btn:hover {
    background: #267a26;
    border-color: #267a26;
}

.pg-cancel-btn {
    background: none;
    border: 1px solid #ccc;
    color: #999;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1;
    padding: 5px 9px;
    cursor: pointer;
    transition: all 0.15s;
}

.pg-cancel-btn:hover {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.5);
}

/* ===== OPERATIONS PANEL (right column) ===== */
#ops-panel {
    width: 260px;
    min-width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ops-header {
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
}

.ops-title {
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--text-secondary);
    font-weight: 700;
}

.ops-list {
    list-style: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ops-list li {
    padding: 10px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ops-list li:hover {
    border-color: rgba(255, 170, 0, 0.35);
    background: rgba(255, 170, 0, 0.04);
}

.ops-list li.active {
    border-color: rgba(255, 170, 0, 0.6);
    background: rgba(255, 170, 0, 0.08);
}

.ops-list .cmp-name {
    font-size: 12px;
    display: block;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-list .cmp-meta {
    display: block;
    font-size: 10px;
    margin-bottom: 5px;
}

.ops-list .cmp-progress {
    width: 100%;
}

.ops-empty {
    padding: 20px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
}

.section-title-dark {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 3px;
    color: var(--text-primary);
    font-weight: 700;
}

.cmp-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(255, 170, 0, 0.12);
    border: 1px solid rgba(255, 170, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cmp-info {
    flex: 1;
    min-width: 0;
}

.cmp-name {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--amber);
    font-weight: 700;
    display: block;
}

.cmp-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.cmp-progress {
    width: 50px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.cmp-progress-fill {
    height: 100%;
    background: var(--amber);
    border-radius: 2px;
    transition: width 0.3s;
}

.empty-state-dark {
    padding: 20px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
}

/* ===== CAMPAIGN TIMELINE (inside ops-panel) ===== */
#campaign-timeline {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.timeline-back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 1px 6px;
    cursor: pointer;
    border-radius: 3px;
    font-family: var(--font-mono);
    transition: all 0.15s;
}

.timeline-back-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
}

#timeline-track {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.timeline-day {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    border-radius: 4px;
}

.timeline-day:hover {
    background: rgba(255, 170, 0, 0.05);
}

.timeline-day.active {
    background: rgba(255, 170, 0, 0.1);
}

/* Vertical line connecting days */
.timeline-day::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.timeline-day:first-child::before {
    top: 50%;
}

.timeline-day:last-child::before {
    bottom: 50%;
}

.tl-node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-day.status-completed .tl-node {
    border-color: var(--green, #44cc66);
    color: var(--green, #44cc66);
    background: rgba(68, 204, 102, 0.1);
}

.timeline-day.status-active .tl-node {
    border-color: var(--amber);
    color: var(--amber);
    background: rgba(255, 170, 0, 0.12);
    box-shadow: 0 0 6px rgba(255, 170, 0, 0.3);
}

.timeline-day.status-failed .tl-node {
    border-color: #ff3344;
    color: #ff3344;
    background: rgba(255, 51, 68, 0.1);
}

.timeline-day.mission-locked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.timeline-day.mission-locked .tl-node {
    border-color: #3a4a5a;
    color: #3a4a5a;
    background: transparent;
    font-size: 11px;
}

.timeline-day.mission-locked .tl-name,
.timeline-day.mission-locked .tl-detail,
.timeline-day.mission-locked .tl-status-badge {
    color: #3a4a5a;
}

.tl-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tl-name {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.tl-status-badge {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.5px;
    padding: 1px 4px;
    border-radius: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.status-completed .tl-status-badge {
    background: rgba(68, 204, 102, 0.12);
    color: var(--green, #44cc66);
    border: 1px solid rgba(68, 204, 102, 0.3);
}

.status-active .tl-status-badge {
    background: rgba(255, 170, 0, 0.12);
    color: var(--amber);
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.status-planned .tl-status-badge {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-failed .tl-status-badge {
    background: rgba(255, 51, 68, 0.12);
    color: #ff3344;
    border: 1px solid rgba(255, 51, 68, 0.3);
}

/* ===== PILOT ROSTER ===== */
.roster-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.roster-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.roster-chevron {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.roster-body {
    background: var(--bg-primary);
    padding: 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
}

.roster-body.collapsed {
    display: none;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 11px;
}

.roster-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--text-secondary);
    font-size: 10px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.roster-table td {
    padding: 5px 8px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.roster-table .rank-cell {
    color: var(--amber);
    font-weight: 700;
    font-size: 10px;
}

.roster-table .pilot-cell {
    font-weight: 500;
}

.roster-table .kills-cell {
    color: #ff6644;
}

.roster-empty {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== BDA OVERLAY ===== */
.bda-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(10, 14, 19, 0.92);
    border: 1px solid var(--border);
    padding: 12px 16px;
    max-width: 320px;
    z-index: 500;
}

.bda-panel h3 {
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--amber);
    margin-bottom: 8px;
}

#bda-content {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== LOBBY ACTIONS (Generate MIZ) ===== */
.lobby-actions {
    border-top: 1px solid rgba(100, 140, 200, 0.25);
}

.lobby-action-btn {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #1a3a1a;
    background: rgba(100, 140, 200, 0.15);
    border: 1px solid rgba(100, 140, 200, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}

.lobby-action-btn:hover {
    background: rgba(100, 140, 200, 0.3);
}

.lobby-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== ROSTER DROP-UP ===== */
.lf-roster-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.roster-dropup {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 680px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(180deg, rgba(14, 20, 28, 0.99), rgba(10, 14, 19, 0.99));
    border: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1099;
    display: flex;
    flex-direction: column;
}

.roster-dropup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.roster-dropup-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.roster-dropup-close:hover {
    color: var(--text-primary);
}

.roster-dropup-body {
    overflow-y: auto;
    flex: 1;
}

.roster-dropup-body .roster-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 12px;
}

.roster-dropup-body .roster-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 10px;
    letter-spacing: 2px;
    padding: 5px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.roster-dropup-body .roster-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(28, 42, 58, 0.5);
}

.roster-dropup-body .roster-table tr:last-child td {
    border-bottom: none;
}

.roster-dropup-body .roster-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.roster-dropup-body td.dr-rank     { color: #5b9bd5; }
.roster-dropup-body td.dr-pilot    { color: #e8f0f8; }
.roster-dropup-body .dr-pilot-tag  { color: var(--amber); }
.roster-dropup-body td.dr-sorties  { color: #5dd98a; }
.roster-dropup-body td.dr-kills    { color: #ff4455; }
.roster-dropup-body td.dr-kd       { color: var(--amber); }
.roster-dropup-body td.dr-aircraft { color: #e8f0f8; }

/* ===== LOBBY FOOTER ===== */
.lobby-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: stretch;
    height: 40px;
    background: linear-gradient(180deg, rgba(20, 28, 38, 0.98), rgba(11, 17, 24, 0.98));
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1100;
}

#lobby-panel {
    padding-bottom: 40px;
}

.lf-btn {
    padding: 0 22px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    background: transparent;
}

.lf-btn:last-child {
    border-right: none;
}

.lf-sep {
    flex: 1;
}

.lf-nav {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--amber);
    text-decoration: none;
    border: 1px solid rgba(200, 154, 32, 0.35);
    margin: 7px 0 7px 8px;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.lf-nav:hover {
    background: rgba(200, 154, 32, 0.1);
    border-color: var(--amber);
}

.lf-nav-sep {
    width: 1px;
    background: var(--border);
    margin: 0 4px;
    align-self: stretch;
}

.lf-btn-primary {
    color: var(--green-accent);
    background: rgba(93, 217, 138, 0.06);
    border-right-color: var(--border);
}

.lf-btn-primary:hover {
    background: rgba(93, 217, 138, 0.14);
    color: #fff;
}

.lf-btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lf-btn-secondary {
    color: var(--text-secondary);
}

.lf-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

/* ===== BOOKING MODAL ===== */
.slot-input-row {
    flex: 1;
    display: flex;
    gap: 6px;
}

.slot-input-row input {
    flex: 1;
    background: #fff;
    border: 1px solid #1a5a1a;
    color: #111;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 5px 8px;
    outline: none;
    letter-spacing: 1px;
}

.slot-input-row input::placeholder {
    color: #999;
}

.slot-input-row button {
    background: #1a5a1a;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: bold;
    padding: 5px 12px;
    cursor: pointer;
    letter-spacing: 1px;
}

.slot-input-row .slot-cancel {
    background: none;
    border: 1px solid #aaa;
    color: #666;
}

/* ===== RESOLUTION SCALING (4K=100%, 1080p=85%) ===== */
/* Height compensated so page always fills viewport */

@media (min-width: 2561px) {
    body { zoom: 1.0; }
    .main-layout { height: calc(100vh - 102px); }
}

/* 1440p 2560px = 92% */
@media (max-width: 2560px) {
    body { zoom: 0.92; }
    .main-layout { height: calc(100vh / 0.92 - 102px); }
}

/* 1080p 1920px = 85% */
@media (max-width: 1920px) {
    body { zoom: 0.85; }
    .main-layout { height: calc(100vh / 0.85 - 102px); }
}

/* 1600px = 79% */
@media (max-width: 1600px) {
    body { zoom: 0.79; }
    .main-layout { height: calc(100vh / 0.79 - 102px); }
}

/* 1366px = 74% */
@media (max-width: 1366px) {
    body { zoom: 0.74; }
    .main-layout { height: calc(100vh / 0.74 - 102px); }
}

/* 1024px = 66% */
@media (max-width: 1024px) {
    body { zoom: 0.66; }
    .main-layout { height: calc(100vh / 0.66 - 102px); }
}

@media (max-width: 900px) {
    body { zoom: 0.62; }

    .main-layout {
        flex-direction: column;
        height: auto;
    }

    #lobby-panel {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 60vh;
        overflow-y: auto;
    }

    #map-panel {
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    body { zoom: 0.6; }

    #lobby-panel .briefing-header,
    #lobby-panel .briefing-section,
    #lobby-panel .briefing-footer,
    .flight-group {
        padding-left: 16px;
    }

    #lobby-panel .briefing-header h2 {
        font-size: 22px;
    }

    .slot-empty,
    .slot-booked {
        min-height: 44px;
        padding: 10px;
    }

    .slot-input-row input {
        min-height: 44px;
        padding: 8px;
    }

    .slot-input-row button,
    .slot-cancel {
        min-height: 44px;
        padding: 8px 12px;
    }
}
