@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap');

/* ════════════════════════════════════════════════════════════════
   ▼ CASCADE LAYERS — explicit cascade order ▼
   Layers are evaluated in declaration order; later layers WIN over
   earlier ones regardless of selector specificity. Anything NOT in
   a layer (the bulk of this file today) is treated as "unlayered"
   and beats every layer below — that's the migration ramp: new
   sections move into layers when they're touched, old sections
   keep working unchanged.
   Order:
     reset       — global resets / normalize
     base        — typography, body background
     components  — reusable widgets (buttons, inputs, cards)
     panels      — menu side/battle panels, modals, screens
     ui          — topbar, HUD overlays, in-game widgets
     overrides   — last-resort tweaks that should always win
   Browser support: Chrome 99+, FF 97+, Safari 15.4+ (universal 2025).
   ════════════════════════════════════════════════════════════════ */
@layer reset, base, components, panels, ui, overrides;

@layer reset {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
}

body {
    background: #0e1108;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #d4cdb8;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

.screen {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    justify-content: center;
    align-items: center;
}
.screen.active {
    display: flex;
}
.screen.overlay {
    background: rgba(5,8,3,0.82);
    z-index: 20;
}

/* ── Military background (shared by auth + menu) ── */
.military-bg {
    background-color: #1e2a18;
    background-image:
        /* diagonal hatch lines */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 24px,
            rgba(120,145,75,0.08) 24px,
            rgba(120,145,75,0.08) 25px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 24px,
            rgba(120,145,75,0.08) 24px,
            rgba(120,145,75,0.08) 25px
        ),
        /* large camo patches */
        radial-gradient(ellipse 320px 260px at 10% 20%, rgba(75,100,45,0.35) 0%, transparent 70%),
        radial-gradient(ellipse 280px 350px at 80% 10%, rgba(60,85,40,0.32) 0%, transparent 70%),
        radial-gradient(ellipse 400px 220px at 50% 75%, rgba(65,90,42,0.30) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 20% 85%, rgba(70,95,48,0.28) 0%, transparent 70%),
        radial-gradient(ellipse 340px 240px at 90% 55%, rgba(55,78,35,0.34) 0%, transparent 70%),
        radial-gradient(ellipse 250px 320px at 40% 30%, rgba(80,105,50,0.26) 0%, transparent 70%),
        /* medium patches for detail */
        radial-gradient(ellipse 180px 140px at 65% 45%, rgba(90,115,55,0.24) 0%, transparent 65%),
        radial-gradient(ellipse 150px 180px at 30% 55%, rgba(60,85,40,0.26) 0%, transparent 65%),
        radial-gradient(ellipse 200px 120px at 75% 80%, rgba(70,95,45,0.22) 0%, transparent 65%),
        /* vignette */
        radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.3) 100%),
        /* base gradient */
        linear-gradient(160deg, #232e1c, #192214);
}

/* ═══════════ Main Menu — Unified Dark Theme ═══════════ */
#mainMenu {
    flex-direction: column;
    padding: 0;
}

/* ── Top Bar ── */
.menu-topbar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: rgba(20,30,15,0.6);
    border-bottom: 1px solid rgba(100,130,60,0.25);
    gap: 16px;
    flex-shrink: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-left label {
    font-size: 10px;
    color: #7a9a5a;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    white-space: nowrap;
}
.topbar-left input {
    padding: 6px 12px;
    background: rgba(15,22,10,0.7);
    border: 1px solid rgba(100,140,60,0.3);
    border-radius: 8px;
    color: #e0d8c0;
    font-size: 15px;
    outline: none;
    width: 180px;
    transition: all 0.3s;
}
.topbar-left input:focus {
    border-color: rgba(120,180,60,0.55);
    box-shadow: 0 0 12px rgba(100,160,40,0.2);
    background: rgba(15,22,10,0.85);
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}
.rank-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 16px;
    background: rgba(15,22,10,0.6);
    border: 1px solid rgba(100,140,60,0.3);
    border-radius: 10px;
}
#rankIcon {
    border-radius: 4px;
}
.rank-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}
.rank-name {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 14px;
    color: #e8cc60;
    letter-spacing: 2px;
}
.rank-bar-track {
    height: 6px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(100,140,60,0.2);
    border-radius: 3px;
    overflow: hidden;
}
.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8abb48, #a8dd58);
    border-radius: 3px;
    transition: width 0.4s;
}
.rank-xp {
    font-size: 9px;
    color: #6a8a4a;
    letter-spacing: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.crystals-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(80,40,120,0.25);
    border: 1px solid rgba(170,85,238,0.35);
    border-radius: 10px;
}
.crystals-display span {
    font-size: 16px;
    font-weight: 700;
    color: #cc88ff;
}

/* ── Two Column Layout ── */
.menu-columns {
    display: flex;
    flex: 1;
    gap: 10px;
    padding: 10px 12px;
    overflow: hidden;
    min-height: 0;
}

.menu-panel {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    overflow-y: auto;
    background: rgba(18,28,14,0.65);
    border: 1px solid rgba(100,140,60,0.25);
    border-radius: 12px;
}
.menu-panel h3 {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 16px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(100,140,60,0.2);
    color: #c8b560;
    flex-shrink: 0;
}
.menu-panel h4 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 6px;
    font-weight: 700;
    color: #7a9a5a;
}

/* ── Settings Gear Button (in topbar) ── */
.settings-gear-btn {
    background: rgba(40,70,100,0.3);
    border: 1px solid rgba(100,160,220,0.35);
    border-radius: 8px;
    color: #88bbdd;
    font-size: 20px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 10px;
    padding: 0;
    line-height: 1;
}
.settings-gear-btn:hover {
    background: rgba(100,160,220,0.18);
    border-color: rgba(100,160,220,0.5);
    color: #aaddff;
    transform: rotate(30deg);
}

/* ── Settings Modal ── */
.settings-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5,8,3,0.75);
    z-index: 50;
    display: flex !important;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.settings-modal-overlay[style*="display:none"],
.settings-modal-overlay[style*="display: none"] {
    display: none !important;
}
.settings-modal-box {
    background: linear-gradient(160deg, #141a10, #0e120a);
    border: 1px solid rgba(100,160,220,0.25);
    border-radius: 16px;
    padding: 0;
    min-width: 340px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(100,160,220,0.05);
}
.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.settings-modal-header h3 {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 15px;
    letter-spacing: 3px;
    color: #60a8e8;
    margin: 0;
    padding: 0;
    border: none;
}
.settings-close-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #6a8a9a;
    font-size: 13px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.settings-close-btn:hover {
    background: rgba(200,50,50,0.15);
    border-color: rgba(200,50,50,0.3);
    color: #ee6666;
}
.settings-modal-body {
    padding: 14px 18px 18px;
}

/* ── Settings rows (shared between modal and pause) ── */
.setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 12px;
    color: #90b0cc;
}
.setting-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.setting-row input[type="range"] {
    flex: 1;
    min-width: 60px;
    accent-color: #4a88cc;
}
.setting-row input[type="checkbox"] {
    accent-color: #4a88cc;
    width: 14px;
    height: 14px;
}
.setting-row span {
    font-size: 11px;
    color: #5a7a9a;
    min-width: 32px;
}
.settings-controls {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.control-hint {
    font-size: 11px;
    color: #5a7a7a;
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-hint .key {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 9px;
    color: #6a9acc;
    font-weight: 700;
    letter-spacing: 1px;
    min-width: 50px;
    text-align: center;
}

/* ── Garage nav button in topbar ── */
.topbar-nav-btn {
    background: rgba(60,90,30,0.35);
    border: 1px solid rgba(120,180,60,0.4);
    border-radius: 8px;
    color: #a8cc70;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s;
    margin-left: 8px;
}
.topbar-nav-btn:hover {
    background: rgba(80,120,40,0.5);
    border-color: rgba(140,200,70,0.6);
    color: #c8e890;
    box-shadow: 0 0 12px rgba(100,180,40,0.15);
}

/* ── Left Panel: Side (Missions + Leaderboard) ── */
.panel-side {
    flex: 0 0 300px;
    min-width: 240px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    overflow: hidden;
}
.side-block {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.side-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(100,140,60,0.2);
    flex-shrink: 0;
}
.side-block-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    color: #c8b560;
}
.side-missions .side-block-title {
    color: #88cc66;
}
.side-leaderboard .side-block-title {
    color: #e8c840;
}
.side-refresh-hint {
    font-size: 10px;
    color: #5a6a4a;
    letter-spacing: 0.5px;
}
.side-refresh-btn {
    background: none;
    border: none;
    color: #7a9a5a;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.2s, transform 0.3s;
    line-height: 1;
}
.side-refresh-btn:hover {
    color: #a8cc70;
    transform: rotate(180deg);
}
.side-loading {
    text-align: center;
    color: #555;
    font-size: 11px;
    padding: 12px 0;
    font-style: italic;
}

/* Override missions-list / leaderboard-list for inline use */
.panel-side .missions-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    gap: 8px;
}
.panel-side .leaderboard-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
    gap: 4px;
}
/* Compact mission rows in side panel */
.panel-side .mission-row {
    padding: 8px 10px;
}
.panel-side .mission-label {
    font-size: 12px;
    margin-bottom: 6px;
}
/* Compact leaderboard rows in side panel */
.panel-side .lb-row {
    grid-template-columns: 28px 1fr auto auto;
    gap: 6px;
    padding: 5px 8px;
    font-size: 12px;
}
/* Hide kills count in narrow side panel */
.panel-side .lb-kills { display: none; }
.panel-side .lb-rank { display: none; }
.panel-side .lb-xp { font-size: 11px; }
.panel-side .lb-name { font-size: 12px; }
.panel-side .lb-pos { font-size: 13px; }

/* ── Hangar Screen (Ангар) ── */
#garageScreen {
    /* .screen gives position:fixed, but the !important ensures nothing overrides it.
       position:fixed creates a containing block for position:absolute children. */
    position: fixed !important;
}
#hangarCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    display: block;
}

/* Shared overlay base */
.hangar-topbar,
.hangar-side,
.hangar-bottom-bar {
    position: absolute;
    z-index: 10;
}

/* Top bar */
.hangar-topbar {
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    background: linear-gradient(180deg, rgba(4,7,3,0.88) 0%, rgba(4,7,3,0) 100%);
    pointer-events: none; /* let clicks through to canvas except actual buttons/inputs */
}
.hangar-topbar > * { pointer-events: auto; }
.hangar-back-btn {
    background: rgba(20,30,12,0.75);
    border: 1px solid rgba(100,160,50,0.4);
    border-radius: 8px;
    color: #a0c068;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
.hangar-back-btn:hover {
    background: rgba(40,65,22,0.85);
    border-color: rgba(130,200,60,0.55);
    color: #c0e080;
}
.hangar-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 20px;
    letter-spacing: 8px;
    color: #c8b560;
    flex: 1;
    text-align: center;
    margin: 0;
    text-shadow: 0 0 20px rgba(200,180,80,0.3);
}
.hangar-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Side panels */
.hangar-side {
    top: 170px; /* leave room for the taller topbar (title + consumables strip) */
    bottom: 136px;
    width: 210px;
    background: rgba(5,9,3,0.88);
    border: 1px solid rgba(100,150,50,0.28);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0 8px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.55), inset 0 1px 0 rgba(140,200,70,0.07);
}
.hangar-left  { left:  14px; }
.hangar-right { right: 14px; }

.hangar-panel-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 10px;
    letter-spacing: 3.5px;
    color: #88aa58;
    text-align: center;
    margin: 0;
    padding: 9px 10px 8px;
    background: rgba(80,120,40,0.12);
    border-bottom: 1px solid rgba(100,150,50,0.22);
    flex-shrink: 0;
    text-shadow: 0 0 12px rgba(120,180,60,0.25);
}
.hangar-side .item-cards {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,150,50,0.3) transparent;
}
.hangar-stats-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,150,50,0.25), transparent);
    margin: 6px 8px;
    flex-shrink: 0;
}
/* Compact cards inside hangar panels */
.hangar-side .item-card {
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 5px;
}
.hangar-side .item-card canvas {
    width: 52px !important;
    height: 32px !important;
}

/* Bottom skin strip */
.hangar-bottom-bar {
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(0deg, rgba(4,7,3,0.94) 65%, rgba(4,7,3,0) 100%);
    padding: 6px 238px 14px; /* sidebars 210 + 14 margin + 14 padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 126px;
}
.hangar-bottom-bar .hangar-panel-title {
    background: none;
    border: none;
    padding: 0 0 4px;
}
.hangar-bottom-bar .skin-cards-row {
    justify-content: center;
    overflow-x: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,150,50,0.3) transparent;
}
.hangar-bottom-bar .item-card {
    flex-shrink: 0;
}
/* Topbar centre slot: title above, consumables strip below — no overlap with side panels. */
.hangar-topbar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: auto;
    flex: 1 1 auto;
    min-width: 0;
}
.hangar-topbar-center .hangar-title { margin: 0; }
.hangar-consumables-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.hangar-consumables-strip .hangar-panel-title {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 9px;
    letter-spacing: 1px;
}
.hangar-panel-subtitle {
    color: rgba(180,200,140,0.55);
    font-weight: normal;
    font-size: 10px;
    margin-left: 6px;
}
/* Consumable cards — fixed width, vertical stack. Designed to look the same
   regardless of the actual screen DPI / scale. */
.consumable-cards {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
}
.consumable-card {
    width: 110px;
    flex: 0 0 110px;
    background: rgba(20,30,15,0.85);
    border: 1px solid rgba(120,150,80,0.3);
    border-radius: 8px;
    padding: 10px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    box-sizing: border-box;
}
.consumable-card .cc-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--cc-color, #aaccaa);
    font-size: 26px;
    line-height: 1;
}
.consumable-card .cc-name {
    font-size: 12px;
    font-weight: bold;
    color: #cce0a8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}
.consumable-card .cc-count {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
    margin-top: 1px;
}
.consumable-card .cc-buy {
    margin-top: 4px;
    background: rgba(60,90,30,0.6);
    border: 1px solid rgba(120,170,60,0.5);
    color: #d8ffaa;
    border-radius: 5px;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    line-height: 1.1;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.consumable-card .cc-buy:hover { background: rgba(80,120,40,0.85); }
.consumable-card .cc-buy:disabled { background: rgba(40,40,40,0.5); color: #666; cursor: not-allowed; border-color: rgba(80,80,80,0.4); }
.consumable-card .cc-key {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255,220,120,0.92);
    color: #1a1a0a;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

/* ── Bot count selector (lives in the create-battle column) ── */
.bot-count-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}
.bot-count-toggle-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
}
.bot-count-value {
    color: #ffd24a;
    font-size: 14px;
    font-weight: bold;
    background: rgba(255,210,74,0.10);
    padding: 1px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,210,74,0.35);
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.bot-count-body[hidden] { display: none; }
/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 36px; height: 18px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(60,60,60,0.6);
    border: 1px solid rgba(120,150,80,0.35);
    border-radius: 11px;
    transition: background 0.15s;
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 1px; left: 1px;
    width: 14px; height: 14px;
    background: #aabbaa;
    border-radius: 50%;
    transition: transform 0.18s, background 0.15s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(120,170,60,0.7); }
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: #ffd24a;
}
.bot-count-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bot-count-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(120,170,60,0.45);
    background: rgba(40,60,20,0.55);
    color: #d8ffaa;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, transform 0.05s;
    flex-shrink: 0;
}
.bot-count-btn:hover { background: rgba(80,120,40,0.85); }
.bot-count-btn:active { transform: scale(0.92); }
.bot-count-track {
    position: relative;
    flex: 1;
    height: 28px;
}
.bot-count-track input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    z-index: 2;
    cursor: pointer;
}
.bot-count-track input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(90deg, rgba(120,170,60,0.55), rgba(255,210,74,0.55));
    border-radius: 3px;
    margin-top: 11px;
}
.bot-count-track input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(90deg, rgba(120,170,60,0.55), rgba(255,210,74,0.55));
    border-radius: 3px;
}
.bot-count-track input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #ffd24a;
    border: 2px solid #1a1a0a;
    box-shadow: 0 0 8px rgba(255,210,74,0.7);
    cursor: grab;
    margin-top: -6px;
}
.bot-count-track input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #ffd24a;
    border: 2px solid #1a1a0a;
    box-shadow: 0 0 8px rgba(255,210,74,0.7);
    cursor: grab;
}
.bot-count-pips {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 9px;
    pointer-events: none;
    z-index: 1;
}
.bot-count-pips span {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transition: background 0.12s, transform 0.12s;
}
.bot-count-pips span.active {
    background: rgba(255,210,74,0.9);
    transform: scale(1.5);
}

/* Old panel-garage — kept for compatibility */
.panel-garage { flex: 3 1 0; min-width: 400px; }
.panel-garage h4 { color: #7a9a5a; }
.garage-inline {
    display: flex;
    gap: 10px;
    flex: 1;
    min-height: 0;
}
.garage-section {
    flex: 0 0 125px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.garage-section .item-cards {
    flex: 1;
    overflow-y: auto;
}
.garage-preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    justify-content: center;
}
#previewCanvas {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 480 / 300;
    max-height: 280px;
    background: radial-gradient(ellipse at center, rgba(30,45,20,0.6) 0%, rgba(10,15,8,0.8) 100%);
    border-radius: 12px;
    border: 1px solid rgba(100,140,60,0.3);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.3);
    object-fit: contain;
}
.tank-stats {
    font-size: 11px;
    line-height: 1.6;
    color: #9aaa80;
    width: 100%;
    flex-shrink: 0;
    padding: 0 8px;
}
.stat-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0;
}
.stat-label {
    width: 62px;
    text-align: right;
    font-size: 8.5px;
    text-transform: uppercase;
    color: #5a7a4a;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.stat-track {
    flex: 1;
    height: 7px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(100,140,60,0.12);
    border-radius: 4px;
    overflow: hidden;
}
.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.35s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 4px currentColor;
}

/* ── Collapsible Item Cards ── */
.item-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.item-card {
    background: rgba(12,20,8,0.65);
    border: 1px solid rgba(100,140,60,0.2);
    border-radius: 9px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
    position: relative;
}
.item-card::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: background 0.18s;
}
.item-card:hover {
    border-color: rgba(130,190,65,0.4);
    background: rgba(50,80,24,0.22);
}
.item-card.selected {
    border-color: rgba(150,210,75,0.55);
    background: rgba(60,100,28,0.32);
    box-shadow: 0 0 18px rgba(120,180,60,0.12), inset 0 0 0 0 transparent;
}
.item-card.selected::before {
    background: #8acc44;
}
.item-card.locked {
    opacity: 0.55;
    cursor: not-allowed;
}
.item-card h4 {
    color: #d8c870;
    margin-bottom: 0;
    font-size: 11px;
    text-align: left;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-card p {
    font-size: 10px;
    color: #6a7a5a;
    line-height: 1.3;
    margin-top: 4px;
    display: none;
}
.item-card.expanded p {
    display: block;
}
.item-card-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}
.item-card canvas {
    flex-shrink: 0;
    border-radius: 5px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(80,120,40,0.2);
}
.item-card.selected canvas {
    border-color: rgba(140,200,70,0.3);
}
.item-card-info {
    flex: 1;
    min-width: 0;
}
.item-card-info h4 {
    margin-bottom: 0;
}

/* Inside garage sections: stack canvas + name vertically */
.garage-section .item-card-inner {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.garage-section .item-card-info {
    width: 100%;
    text-align: center;
}
.garage-section .item-card-info h4 {
    text-align: center;
    font-size: 10px;
}

/* ── Right Panel: Battle ── */
.panel-battle {
    flex: 2 1 0;
    min-width: 640px;
    display: flex;
    flex-direction: column;
}

.panel-battle h3 {
    color: #e8a040;
}

/* ── Tank Showcase column (left side of battle panel) ── */
.battle-showcase {
    flex: 1 1 0;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: linear-gradient(180deg, rgba(20,30,12,0.55) 0%, rgba(10,16,6,0.7) 100%);
    border: 1px solid rgba(232,160,64,0.22);
    border-radius: 10px;
    padding: 12px 14px 14px;
    box-shadow: inset 0 1px 0 rgba(232,160,64,0.08), 0 4px 14px rgba(0,0,0,0.35);
}
.showcase-header {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11px;
    letter-spacing: 4px;
    color: #c8a060;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(232,160,64,0.22);
    text-shadow: 0 0 10px rgba(232,160,64,0.3);
    flex-shrink: 0;
}
.showcase-frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 220px;
    background:
        radial-gradient(ellipse at 50% 55%, rgba(150,200,80,0.14) 0%, transparent 65%),
        linear-gradient(180deg, rgba(55,75,30,0.45) 0%, rgba(18,26,10,0.7) 100%);
    border: 1px solid rgba(140,180,70,0.28);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
}
.showcase-frame::before {
    /* hangar floor tile grid */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110,150,60,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110,150,60,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    opacity: 0.7;
}
.showcase-frame::after {
    /* spotlight from above */
    content: '';
    position: absolute;
    left: 50%;
    top: -30px;
    transform: translateX(-50%);
    width: 80%;
    height: 90px;
    background: radial-gradient(ellipse, rgba(255,230,160,0.2) 0%, transparent 70%);
    pointer-events: none;
}
.showcase-corners span {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(232,160,64,0.55);
    pointer-events: none;
}
.showcase-corners span:nth-child(1) { top: 6px;    left: 6px;    border-right: none; border-bottom: none; border-top-left-radius: 3px; }
.showcase-corners span:nth-child(2) { top: 6px;    right: 6px;   border-left:  none; border-bottom: none; border-top-right-radius: 3px; }
.showcase-corners span:nth-child(3) { bottom: 6px; left: 6px;    border-right: none; border-top: none;    border-bottom-left-radius: 3px; }
.showcase-corners span:nth-child(4) { bottom: 6px; right: 6px;   border-left:  none; border-top: none;    border-bottom-right-radius: 3px; }
#battleTankPreview {
    display: block;
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6));
}
.showcase-stage {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: 60%;
    height: 14px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.6) 0%, transparent 75%);
    pointer-events: none;
}
.showcase-info {
    flex-shrink: 0;
    padding: 4px 0 2px;
    border-top: 1px solid rgba(232,160,64,0.15);
    border-bottom: 1px solid rgba(232,160,64,0.15);
}
.showcase-label {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 15px;
    letter-spacing: 2.5px;
    color: #e8c870;
    text-align: center;
    text-shadow: 0 0 14px rgba(232,200,112,0.35);
}
.showcase-sub {
    font-size: 10px;
    letter-spacing: 1.8px;
    color: #8a9a6a;
    text-align: center;
    text-transform: uppercase;
    margin-top: 2px;
}
.btn-hangar {
    flex-shrink: 0;
    padding: 11px 14px;
    background: linear-gradient(180deg, rgba(232,160,64,0.22) 0%, rgba(170,110,35,0.24) 100%);
    border: 1px solid rgba(232,160,64,0.55);
    color: #f0c080;
    border-radius: 7px;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s;
    text-shadow: 0 0 10px rgba(232,160,64,0.35);
}
.btn-hangar:hover {
    background: linear-gradient(180deg, rgba(250,180,80,0.34) 0%, rgba(200,140,50,0.34) 100%);
    border-color: rgba(250,200,100,0.85);
    color: #ffd090;
    box-shadow: 0 0 16px rgba(232,160,64,0.35);
}

/* Battle inner grid: showcase | settings | lobby — all equal height */
.battle-grid {
    display: flex;
    gap: 14px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
.battle-settings {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.battle-lobby {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.battle-lobby .battle-list {
    flex: 1;
}
.battle-actions {
    flex-shrink: 0;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(180,120,40,0.2);
}
.mode-label {
    font-size: 10px;
    color: #8a6a3a;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

/* Big map preview (above dropdowns) */
.battle-map-preview {
    position: relative;
    flex: 0 0 50%;
    min-height: 0;
    border: 1px solid rgba(180,120,40,0.35);
    border-radius: 10px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at center, rgba(60,40,15,0.4) 0%, rgba(10,8,4,0.85) 100%),
        rgba(8,10,6,0.85);
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.6),
        0 0 14px rgba(200,130,30,0.08);
}
#battleMapPreviewCanvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Selected-battle preview overlay corners */
.battle-preview-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.battle-preview-timer {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #ffe4a8;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95), 0 0 12px rgba(220,150,40,0.45);
    padding: 4px 10px;
    background: rgba(20,12,4,0.6);
    border: 1px solid rgba(220,150,40,0.45);
    border-radius: 4px;
}
.battle-preview-gamemode {
    position: absolute;
    top: 8px;
    right: 46px;
    font-size: 13px;
    font-weight: 800;
    color: #ffd28a;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 10px;
    background: rgba(20,12,4,0.6);
    border: 1px solid rgba(220,150,40,0.4);
    border-radius: 4px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}
.battle-preview-mapname {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #ffd28a;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    background: rgba(20,12,4,0.6);
    border: 1px solid rgba(220,150,40,0.4);
    border-radius: 4px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}
.battle-preview-close {
    position: absolute;
    top: 8px;
    right: 10px;
    pointer-events: auto;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(20,12,4,0.7);
    border: 1px solid rgba(220,150,40,0.5);
    color: #ffd28a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.battle-preview-close:hover {
    background: rgba(220,150,40,0.25);
    border-color: rgba(255,210,138,0.85);
    color: #fff;
}
.battle-preview-scores {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(20,12,4,0.6);
    border: 1px solid rgba(220,150,40,0.35);
    border-radius: 4px;
}
.battle-preview-scores .score-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
.battle-preview-scores .score-pill .swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    box-shadow: 0 0 6px var(--team-color, #888);
    background: var(--team-color, #888);
}

/* Roster panel — replaces dropdowns + bot count when a battle is selected */
.battle-roster[hidden] { display: none; }
.battle-roster {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(110,120,55,0.45);
    border-radius: 8px;
    /* Военный тёмно-оливковый — темнее основного меню */
    background:
        linear-gradient(180deg, rgba(28,34,16,0.95), rgba(14,18,8,0.95)),
        #0e1208;
    box-shadow:
        inset 0 0 22px rgba(0,0,0,0.7),
        inset 0 0 0 1px rgba(110,120,55,0.08),
        0 0 6px rgba(110,120,55,0.06);
}
.battle-roster-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.battle-roster-cols {
    display: flex;
    align-items: flex-start;
}
.roster-team {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* Тинт колонки в цвет команды (вертикальная заливка с градиентом). */
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--team-color, transparent) 18%, transparent) 0,
        color-mix(in srgb, var(--team-color, transparent) 6%, transparent) 80%,
        transparent 100%);
}
.roster-team + .roster-team {
    border-left: 1px solid color-mix(in srgb, var(--team-color, rgba(110,120,55,0.18)) 25%, rgba(110,120,55,0.18));
}
.roster-team-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 800;
    color: var(--team-color, #d8d4a0);
    border-bottom: 1px solid rgba(110,120,55,0.28);
    background:
        linear-gradient(180deg, rgba(18,22,10,0.97), rgba(14,18,8,0.95));
    text-shadow: 0 1px 4px rgba(0,0,0,0.95);
    text-align: center;
}
.roster-cols-header {
    position: sticky;
    top: 28px;
    z-index: 1;
    display: grid;
    grid-template-columns: 30px 1fr 48px;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #6a7a3a;
    background: rgba(14,18,8,0.95);
    border-bottom: 1px solid rgba(110,120,55,0.18);
}
.roster-cols-header .h-kd { text-align: center; }
.roster-table {
    padding: 2px 0 4px;
}
.roster-row {
    display: grid;
    grid-template-columns: 30px 1fr 48px;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    color: #c8c8a0;
    font-size: 12px;
    line-height: 1.2;
}
.roster-row + .roster-row {
    border-top: 1px solid rgba(110,120,55,0.08);
}
.roster-row .emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}
.roster-row .emblem-rank {
    width: 28px;
    height: 28px;
    image-rendering: -webkit-optimize-contrast;
}
.roster-row .emblem-bot {
    color: #6a7a3a;
}
.roster-row.is-bot { color: #8a8a6a; font-style: italic; }
.roster-row.is-bot .emblem-bot { color: #8a9050; }
.roster-row .name {
    color: inherit;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.roster-row .kd {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #e8e4a0;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: center;
}
.roster-row .kd .deaths {
    color: #8a8a4a;
    font-weight: 600;
}
.roster-row.is-bot .kd { color: #a8a878; font-style: normal; }
.roster-empty {
    padding: 14px 10px;
    text-align: center;
    color: #5a5a3a;
    font-size: 10px;
    font-style: italic;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Read-only / informational dropdowns when a battle is selected */
.custom-select.is-readonly {
    pointer-events: none;
    opacity: 0.55;
    filter: grayscale(0.6);
}
.custom-select.is-readonly .cs-trigger {
    cursor: default;
}
.custom-select.is-readonly .cs-arrow {
    visibility: hidden;
}

/* Make battle-list items clickable as a whole */
.battle-item {
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.battle-item:hover {
    background: rgba(180,120,40,0.10);
    border-color: rgba(220,150,40,0.55);
}
.battle-item.is-selected {
    background: rgba(220,150,40,0.16);
    border-color: rgba(255,210,138,0.75);
    box-shadow: 0 0 10px rgba(220,150,40,0.35);
}

/* Selectors row under map preview */
.battle-selectors[hidden] { display: none; }
.bot-count-control[hidden] { display: none; }
.battle-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}
.battle-selectors > .custom-select[data-name="map"] {
    grid-column: 1 / -1;
}

/* Custom dropdown */
.custom-select {
    position: relative;
    text-align: left;
    min-width: 0;
}
.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: rgba(15,22,10,0.7);
    border: 1px solid rgba(180,120,40,0.3);
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    color: #d8c090;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}
.cs-trigger:hover {
    border-color: rgba(200,130,35,0.55);
    background: rgba(90,60,20,0.3);
    color: #e8c898;
}
.custom-select.open .cs-trigger {
    border-color: rgba(220,150,40,0.7);
    background: rgba(100,65,20,0.4);
    color: #e8a040;
    box-shadow: 0 0 12px rgba(200,130,30,0.18);
}
.cs-current {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.cs-arrow {
    color: #b88840;
    font-size: 11px;
    transition: transform 0.18s;
}
.custom-select.open .cs-arrow { transform: rotate(180deg); }

.cs-panel {
    position: absolute;
    left: 0; right: 0;
    bottom: calc(100% + 4px);
    z-index: 30;
    background: rgba(15,18,10,0.97);
    border: 1px solid rgba(220,150,40,0.55);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.7), 0 0 14px rgba(200,130,30,0.15);
    max-height: 260px;
    overflow-y: auto;
}
.cs-option {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #b0a080;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: background 0.12s, color 0.12s;
}
.cs-option:hover {
    background: rgba(100,65,20,0.35);
    color: #e8c898;
}
.cs-option.selected {
    background: rgba(120,75,20,0.45);
    color: #e8a040;
}
.cs-option--arms-race { color: #cc88ff; }
.cs-option--arms-race:hover { background: rgba(80,20,120,0.35); color: #ee99ff; }
.cs-option--arms-race.selected { background: rgba(100,20,160,0.45); color: #dd88ff; }

/* Battle list */
.battle-list {
    background: rgba(10,15,8,0.5);
    border: 1px solid rgba(180,120,40,0.2);
    border-radius: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}
.battle-empty {
    padding: 20px 12px;
    text-align: center;
    color: #5a5040;
    font-size: 11px;
    font-style: italic;
}
.battle-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 11px 8px;
    border-bottom: 1px solid rgba(180,120,40,0.12);
    position: relative;
}
.battle-item:last-child { border-bottom: none; }
.battle-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 1px;
}
.battle-creator {
    color: #ffd28a;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.battle-badge {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid;
}
.battle-badge--solo {
    color: #c89a4a;
    background: rgba(180,120,40,0.12);
    border-color: rgba(180,120,40,0.45);
}
.battle-badge--online {
    color: #6aa86f;
    background: rgba(90,160,90,0.10);
    border-color: rgba(90,160,90,0.4);
}
.battle-row-mid {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d0b080;
    font-size: 11px;
    font-weight: 600;
}
.battle-mode-icon {
    color: #c89a4a;
    font-size: 12px;
    line-height: 1;
}
.battle-mode-name {
    color: #d0b080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
}
.battle-row-map {
    color: #8a7a60;
    font-size: 11px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.battle-row-bot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    font-size: 10px;
}
.battle-elapsed {
    color: #8a6a3a;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 9px;
    font-weight: 700;
}
.battle-players-count {
    color: #d0b080;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.battle-players-count b {
    color: #ffd28a;
    font-weight: 800;
}
.battle-players-count .bots {
    color: #8a8a4a;
}
.battle-players-count .slash {
    color: #5a5040;
    margin: 0 1px;
}
.battle-fill {
    margin-top: 5px;
    height: 3px;
    width: 100%;
    background: rgba(0,0,0,0.45);
    border-radius: 2px;
    overflow: hidden;
}
.battle-fill-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(180,120,40,0.7), rgba(220,150,40,0.85));
    border-radius: 2px;
    transition: width 0.3s ease;
}
.battle-item.is-selected .battle-fill-bar {
    background: linear-gradient(90deg, rgba(220,150,40,0.85), rgba(255,210,138,1));
}
.btn-small {
    padding: 5px 10px;
    font-size: 10px;
    border-radius: 4px;
    width: 100%;
    text-align: center;
}
.btn-join {
    background: linear-gradient(135deg, #3a8a5a, #2a6a4a);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    white-space: nowrap;
}
.btn-join:hover {
    background: linear-gradient(135deg, #4a9a6a, #3a7a5a);
}

/* Play button */
.btn-play {
    padding: 14px 20px;
    font-size: 20px;
    width: 100%;
    letter-spacing: 6px;
    border-radius: 10px;
}
.rejoin-btn {
    padding: 14px 20px;
    font-size: 18px;
    width: 100%;
    letter-spacing: 4px;
    border-radius: 10px;
    border: 1px solid rgba(80,180,220,0.5);
    background: rgba(30,80,120,0.4);
    color: #80d0f0;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    margin-bottom: 8px;
    transition: all 0.2s;
    animation: rejoinPulse 2s ease-in-out infinite;
}
.rejoin-btn:hover {
    background: rgba(40,100,150,0.5);
    border-color: rgba(100,200,240,0.6);
    box-shadow: 0 0 20px rgba(80,180,220,0.3);
    color: #a0e8ff;
}
@keyframes rejoinPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(80,180,220,0.1); }
    50% { box-shadow: 0 0 16px rgba(80,180,220,0.25); }
}

/* ═══════════ Buttons ═══════════ */
.btn {
    padding: 10px 28px;
    border: 1px solid rgba(120,150,80,0.3);
    border-radius: 8px;
    background: rgba(40,60,25,0.4);
    color: #c8c0a8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 3px;
}
.btn:hover {
    background: rgba(50,75,30,0.5);
    border-color: rgba(130,170,80,0.4);
    color: #e0d8c0;
}
.btn-primary {
    border-color: rgba(120,180,60,0.4);
    background: rgba(50,80,30,0.4);
}
.btn-primary:hover {
    background: rgba(60,100,35,0.5);
    border-color: rgba(130,190,65,0.55);
}
.btn-accent {
    border-color: rgba(220,160,40,0.5);
    background: rgba(100,70,20,0.35);
    color: #e8d480;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    animation: btnPulse 2.5s ease-in-out infinite;
}
.btn-accent:hover {
    background: rgba(110,80,25,0.5);
    border-color: rgba(230,170,45,0.6);
    box-shadow: 0 0 20px rgba(180,140,40,0.25);
    color: #f0e090;
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(180,140,40,0.05); }
    50% { box-shadow: 0 0 20px rgba(180,140,40,0.2); }
}

.btn-editor {
    padding: 8px 16px;
    border: 1px solid rgba(100,160,220,0.3);
    border-radius: 8px;
    background: rgba(100,160,220,0.08);
    color: #88bbdd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-editor:hover {
    background: rgba(100,160,220,0.18);
    border-color: rgba(100,160,220,0.5);
    color: #aaddff;
}
.btn-full {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 6px;
}

/* ═══════════ Pause Menu ═══════════ */
.pause-container {
    background: linear-gradient(160deg, #141a10, #0e120a);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 0;
    min-width: 380px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 30px rgba(120,180,60,0.05);
    backdrop-filter: blur(10px);
}
.pause-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pause-container h2 {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 22px;
    color: #c8b560;
    letter-spacing: 4px;
    margin: 0;
}
.pause-body {
    padding: 14px 22px 20px;
}
.pause-section-title {
    font-size: 10px;
    color: #7a9a5a;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin: 14px 0 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pause-section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.pause-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pause-hint {
    margin-top: 10px;
    font-size: 10px;
    color: #4a5a3a;
    text-align: center;
}

/* ═══════════ Death Screen ═══════════ */
.death-container {
    text-align: center;
    padding: 0;
    background: linear-gradient(160deg, #1a0a08, #120808);
    border: 1px solid rgba(200,40,20,0.3);
    border-radius: 16px;
    box-shadow: 0 8px 60px rgba(200,40,20,0.2), 0 0 30px rgba(200,40,20,0.05);
    min-width: 380px;
    max-width: 440px;
}
.death-container h2 {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 32px;
    color: #dd3a2a;
    padding: 18px 24px 14px;
    margin: 0;
    border-bottom: 1px solid rgba(200,40,20,0.15);
    text-shadow: 0 0 20px rgba(220,50,30,0.3);
    letter-spacing: 5px;
}
.death-body {
    padding: 18px 28px 24px;
}
.death-container p {
    font-size: 15px;
    margin: 8px 0;
    color: #c0a890;
}
.death-container .btn-accent {
    font-size: 16px;
    padding: 12px 40px;
    margin-top: 14px;
    border-color: rgba(200,40,20,0.4);
    background: rgba(200,40,20,0.1);
    color: #ff8866;
    animation-name: deathBtnPulse;
}
.death-container .btn {
    margin-top: 10px;
}
@keyframes deathBtnPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(200,40,20,0.05); }
    50% { box-shadow: 0 0 20px rgba(200,40,20,0.25); }
}

/* ═══════════ Scoreboard ═══════════ */
.scoreboard-container {
    background: rgba(14,18,10,0.96);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 22px;
    min-width: 500px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.scoreboard-container h2 {
    text-align: center;
    margin-bottom: 14px;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    color: #c8b560;
    letter-spacing: 3px;
    font-size: 22px;
}
#scoreTable {
    width: 100%;
    border-collapse: collapse;
}
#scoreTable th {
    background: rgba(255,255,255,0.04);
    padding: 9px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #6a7a5a;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
#scoreTable td {
    padding: 7px 9px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px;
    color: #b0a890;
}
#scoreTable tr.self td {
    color: #c8b560;
    font-weight: bold;
}

/* ═══════════ Match End Screen ═══════════ */
.match-end-container {
    background: rgba(14,18,10,0.97);
    border: 1px solid rgba(200,180,100,0.2);
    border-radius: 16px;
    padding: 28px 36px;
    min-width: 440px;
    max-width: 600px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    text-align: center;
}
.match-end-container h2 {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    color: #c8b560;
    letter-spacing: 3px;
    font-size: 24px;
    margin-bottom: 16px;
}
.match-winner {
    font-size: 18px;
    color: #d4cdb8;
    margin-bottom: 14px;
}
.winner-name {
    color: #ffd700;
    font-weight: bold;
    font-size: 22px;
}
.match-results {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.match-results th {
    background: rgba(255,255,255,0.04);
    padding: 8px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #6a7a5a;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.match-results td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px;
    color: #b0a890;
}
.match-results tr.winner-row td {
    color: #ffd700;
    font-weight: bold;
    font-size: 15px;
}
.match-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #9a9278;
}
.match-meta b { color: #d8cfa8; font-weight: 600; }
.match-loadout {
    font-size: 15px;
    color: #d4cdb8;
    margin: 4px 0 14px;
    letter-spacing: 0.5px;
}
.match-loadout b { color: #ffc048; }
.match-my-place {
    display: inline-block;
    margin: 0 auto 14px;
    padding: 6px 14px;
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 6px;
    font-size: 13px;
    color: #e3d8a8;
}
.match-my-place b { color: #ffd700; }
.winner-bot-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    background: rgba(100,100,100,0.4);
    border-radius: 3px;
    color: #aaa;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    vertical-align: middle;
}
.team-scores-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}
.team-score-block {
    border: 2px solid;
    border-radius: 10px;
    padding: 8px 18px;
    background: rgba(0,0,0,0.3);
    text-align: center;
}
.tsb-name {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tsb-score {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    margin-top: 2px;
}
.team-players-block {
    text-align: left;
    margin-bottom: 10px;
}
.team-players-block h4 {
    font-size: 13px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tp-row {
    font-size: 12px;
    color: #b0a890;
    padding: 2px 0 2px 12px;
}

/* ═══════════ Connection Status ═══════════ */
#connectionStatus {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 18px;
    background: rgba(180,50,30,0.9);
    border: 1px solid #aa3020;
    border-radius: 8px;
    font-size: 13px;
    z-index: 100;
    display: none;
    color: #ffccbb;
}

/* ═══════════ Auth Screen ═══════════ */
.auth-container {
    background: linear-gradient(160deg, rgba(22,30,16,0.92), rgba(14,20,10,0.95));
    border: 1px solid rgba(100,140,60,0.3);
    border-radius: 16px;
    padding: 0;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(80,120,40,0.08);
}
.auth-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 28px;
    color: #c8b560;
    letter-spacing: 6px;
    text-align: center;
    padding: 22px 0 16px;
    margin: 0;
    border-bottom: 1px solid rgba(100,140,60,0.2);
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(100,140,60,0.2);
}
.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: #6a7a5a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.auth-tab:hover {
    color: #9aaa80;
    background: rgba(255,255,255,0.02);
}
.auth-tab.active {
    color: #c8b560;
    border-bottom-color: #c8b560;
    background: rgba(255,255,255,0.02);
}
.auth-form {
    padding: 18px 22px;
}
.auth-field {
    margin-bottom: 12px;
}
.auth-field label {
    display: block;
    font-size: 10px;
    color: #7a9a5a;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 4px;
}
.auth-field input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(10,16,8,0.7);
    border: 1px solid rgba(100,140,60,0.3);
    border-radius: 8px;
    color: #e0d8c0;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}
.auth-field input:focus {
    border-color: rgba(120,180,60,0.55);
    box-shadow: 0 0 12px rgba(100,160,40,0.2);
    background: rgba(10,16,8,0.85);
}
.auth-error {
    color: #dd4444;
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 8px;
    text-align: center;
}
.auth-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    letter-spacing: 3px;
}
.auth-hint {
    text-align: center;
    font-size: 10px;
    color: #4a5a3a;
    padding: 0 22px 14px;
    margin: 0;
}

/* ═══════════ Ranks Modal ═══════════ */
.ranks-modal-box {
    max-width: 500px;
    max-height: 80vh;
}
.ranks-list {
    overflow-y: auto;
    max-height: 60vh;
}
.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rank-row:last-child {
    border-bottom: none;
}
.rank-row.current {
    background: rgba(120,180,60,0.06);
    border-radius: 6px;
    padding: 8px 10px;
    margin: 0 -10px;
}
.rank-row-index {
    width: 22px;
    font-size: 10px;
    color: #5a6a4a;
    text-align: center;
    flex-shrink: 0;
}
.rank-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    flex-shrink: 0;
}
.rank-row-info {
    flex: 1;
    min-width: 0;
}
.rank-row-name {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
}
.rank-row-xp {
    font-size: 10px;
    color: #6a8a4a;
}
.rank-row-check {
    font-size: 14px;
    color: #7aaa3a;
}
/* Make rank display clickable */
.rank-display {
    cursor: pointer;
    transition: all 0.2s;
}
.rank-display:hover {
    border-color: rgba(120,180,60,0.3);
    background: rgba(255,255,255,0.05);
}

/* ═══════════ Locked / Buy / Skin Cards ═══════════ */
.item-card.locked {
    opacity: 0.5;
    cursor: default;
    border-color: rgba(80,80,80,0.3);
}
.item-card.locked:hover {
    border-color: rgba(80,80,80,0.3);
    background: rgba(15,25,10,0.6);
}
.item-card .locked-text {
    color: #886644;
    font-size: 10px;
    display: block;
    font-style: italic;
}
.item-card .buy-btn,
.item-card .equip-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid rgba(200,170,60,0.5);
    background: rgba(200,170,60,0.15);
    color: #d8c870;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.item-card .buy-btn:hover {
    background: rgba(200,170,60,0.3);
    border-color: rgba(200,170,60,0.7);
}
.item-card .equip-btn {
    border-color: rgba(100,200,100,0.5);
    background: rgba(100,200,100,0.15);
    color: #88cc88;
}
.item-card .equip-btn:hover {
    background: rgba(100,200,100,0.3);
}
.item-card .equip-btn.equipped {
    border-color: rgba(200,100,100,0.5);
    background: rgba(200,100,100,0.15);
    color: #cc8888;
}

/* Skins section */
.skins-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(100,140,60,0.15);
}
.skins-section h4 {
    text-align: center;
    color: #d8c870;
    font-size: 12px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.skin-cards-row {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.skin-cards-row .item-card {
    width: 140px;
    flex-shrink: 0;
}
.skin-cards-row .item-card-inner {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.skin-cards-row .item-card-info {
    text-align: center;
}
.skin-cards-row .item-card-info h4 {
    text-align: center;
    font-size: 11px;
}
.skin-cards-row .item-card p {
    display: block;
    font-size: 9px;
}

/* ═══════════ Daily Reward Modal ═══════════ */
.daily-reward-box {
    max-width: 320px;
    text-align: center;
}
.daily-reward-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
}
.daily-reward-icon {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation: dailyPulse 1.5s ease-in-out infinite;
}
@keyframes dailyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.daily-reward-amount {
    font-size: 36px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255,215,0,0.4);
}
.daily-reward-label {
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.daily-reward-streak {
    font-size: 13px;
    color: #88aa66;
    margin-top: 4px;
}

/* ═══════════ Leaderboard ═══════════ */
.leaderboard-modal-box {
    min-width: 520px;
    max-width: 600px;
}
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.lb-row {
    display: grid;
    grid-template-columns: 36px 1fr auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    font-size: 13px;
}
.lb-row-me {
    background: rgba(100,180,80,0.12);
    border: 1px solid rgba(100,180,80,0.3);
}
.lb-pos { font-size: 16px; text-align: center; }
.lb-name { font-weight: bold; color: #d4cdb8; }
.lb-rank { font-size: 11px; }
.lb-xp { color: #88aa66; font-size: 12px; white-space: nowrap; }
.lb-kills { color: #cc8844; font-size: 12px; white-space: nowrap; }

/* ═══════════ Missions ═══════════ */
.missions-modal-box {
    min-width: 420px;
    max-width: 500px;
}
.missions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    overflow-y: auto;
}
.mission-row {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 14px;
}
.mission-row.mission-claimed {
    opacity: 0.5;
}
.mission-label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #d4cdb8;
}
.mission-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5a9a2a, #88cc44);
    border-radius: 3px;
    transition: width 0.3s;
}
.mission-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.mission-count { color: #888; flex: 1; }
.mission-reward { color: #aa77ee; font-weight: bold; }
.mission-done { color: #88cc44; font-weight: bold; }
.mission-claim-btn {
    padding: 3px 10px;
    font-size: 11px;
    background: rgba(100,180,60,0.2);
    border: 1px solid #5a9a2a;
    color: #88cc44;
    cursor: pointer;
    border-radius: 4px;
}
.mission-claim-btn:hover { background: rgba(100,180,60,0.35); }

/* ═══════════ Turret Upgrades ═══════════ */
.turret-level-stars {
    font-size: 10px;
    color: #f0c040;
    margin-left: 3px;
    letter-spacing: 1.5px;
    text-shadow: 0 0 6px rgba(240,192,64,0.5);
}
.upgrade-bonus {
    font-size: 9px !important;
    color: #78a055 !important;
    margin: 1px 0 3px !important;
    letter-spacing: 0.3px;
}
.upgrade-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 9px;
    font-size: 10px;
    background: rgba(80,110,220,0.14);
    border: 1px solid rgba(100,140,255,0.35);
    color: #8aabff;
    cursor: pointer;
    border-radius: 5px;
    letter-spacing: 0.3px;
    transition: background 0.15s, border-color 0.15s;
}
.upgrade-btn:hover {
    background: rgba(100,140,255,0.26);
    border-color: rgba(130,170,255,0.55);
}
.upgrade-max {
    display: inline-block;
    margin-top: 4px;
    font-size: 9px;
    color: #f0c040;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(240,192,64,0.4);
}

/* ═══════════ Scrollbar ═══════════ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Match-end animated sequence ─────────────────────────────────────── */
#matchEndSequence {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}
#matchEndSequence.active { pointer-events: auto; }

/* Phase 1: white-flash transition */
.me-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,240,1) 0%, rgba(255,200,80,0.4) 40%, rgba(0,0,0,0) 80%);
    opacity: 0;
    transition: opacity 0.18s ease-out;
}
.me-flash.show { opacity: 1; }

/* Phase 2: replay banner */
.me-replay-banner {
    position: absolute;
    top: 50px; left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    animation: me-banner-in 0.3s ease-out;
}
@keyframes me-banner-in {
    from { transform: translate(-50%, -40px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}
.me-replay-label {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 28px;
    letter-spacing: 6px;
    color: #ffd24a;
    text-shadow: 0 0 18px rgba(255,210,74,0.8), 0 2px 4px rgba(0,0,0,0.8);
}
.me-replay-player {
    font-size: 20px;
    color: #fff;
    margin-top: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* Phase 3: pixel-dissolve canvas (covers full screen) */
.me-pixel-canvas {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
}

/* Phase 3: stats screen (replaces old plain match-end overlay) */
.me-podium {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, #1a2a18 0%, #050805 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4vh 0 24px;
    pointer-events: auto;
    overflow-y: auto;
    animation: me-podium-in 0.4s ease-out;
}
@keyframes me-podium-in {
    from { opacity: 0; transform: scale(1.04); }
    to   { opacity: 1; transform: scale(1); }
}
.me-stats-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 42px;
    letter-spacing: 10px;
    color: #ffd24a;
    text-shadow: 0 0 32px rgba(255,210,74,0.55);
    margin: 0 0 4px 0;
}
.me-stats-mode-tag {
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(180,200,140,0.7);
    margin-bottom: 22px;
}
.me-stats-top3 {
    display: flex;
    gap: 18px;
    align-items: stretch;
    justify-content: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.me-stats-card {
    width: 200px;
    background: rgba(15,22,12,0.85);
    border: 2px solid rgba(120,150,80,0.4);
    border-radius: 12px;
    padding: 14px 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}
.me-stats-card.me-stats-place-1 {
    transform: scale(1.08);
    box-shadow: 0 4px 30px rgba(255,210,74,0.35);
}
.me-stats-card .me-stats-medal {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 4px;
}
.me-stats-card .me-stats-medal span { font-size: 14px; color: #cce0a8; margin-left: 6px; }
.me-stats-card .me-stats-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    word-break: break-word;
}
.me-stats-card .me-stats-kd {
    font-size: 14px;
    color: #ffd24a;
    margin-bottom: 4px;
}
.me-stats-card .me-stats-tank {
    margin-top: 6px;
}
.me-stats-meta {
    color: #cce0a8;
    font-size: 14px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 12px 0 14px;
}
.me-stats-meta b { color: #ffd24a; }
.me-stats-leaderboard {
    width: min(90vw, 540px);
    margin: 0 0 18px;
}
.me-stats-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10,15,8,0.6);
    border-radius: 8px;
    overflow: hidden;
}
.me-stats-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(180,200,140,0.7);
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(120,150,80,0.25);
}
.me-stats-table td {
    color: #d4e0c0;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(80,100,60,0.15);
    font-size: 14px;
}
.me-stats-table .me-row-winner td {
    color: #ffd24a;
    font-weight: bold;
}
.me-stats-table .me-row-self td {
    background: rgba(255,210,74,0.08);
}
.me-stats-table tr:last-child td { border-bottom: none; }
.me-podium-btn {
    margin-bottom: 24px;
    min-width: 200px;
}

/* ── Battle loading overlay ── */
#battleLoadingOverlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a2418 0%, #08100a 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Black Ops One', 'Impact', sans-serif;
}
#battleLoadingOverlay .bl-box {
    text-align: center;
    min-width: 320px;
    padding: 28px 40px;
    background: rgba(0,0,0,0.55);
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 6px;
}
#battleLoadingOverlay .bl-title {
    color: #e0d890;
    font-size: 22px;
    letter-spacing: 6px;
    margin-bottom: 18px;
}
#battleLoadingOverlay .bl-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
}
#battleLoadingOverlay .bl-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c8b560, #ffe48a);
    transition: width 120ms linear;
}
#battleLoadingOverlay .bl-status {
    margin-top: 12px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    letter-spacing: 2px;
}

/* ============================================================
 * ── Loading screen ──
 * Shown on initial page load + after returning to menu (when the
 * page was reloaded). Custom branded design with rotating tips so
 * the wait feels intentional, not blank. Music is intentionally
 * silenced here — no menu music until the user is in the actual menu.
 * ============================================================ */
#loadingScreen {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 50;
    overflow: hidden;
}
#loadingScreen.active {
    display: flex;
}
#loadingScreen::before {
    /* Subtle ambient glow behind the centerpiece */
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(120, 180, 60, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 80%, rgba(60, 100, 40, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.loading-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 36px 60px;
    width: min(540px, 90vw);
}

.loading-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.loading-mark {
    font-size: 38px;
    color: #c8e8a0;
    text-shadow:
        0 0 20px rgba(140, 200, 80, 0.55),
        0 0 40px rgba(120, 180, 60, 0.3);
    animation: loadingPulse 2s ease-in-out infinite;
}
@keyframes loadingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.05); opacity: 0.85; }
}
.loading-title {
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 42px;
    color: #e8d480;
    letter-spacing: 8px;
    margin: 0;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.5),
        0 0 24px rgba(232, 212, 128, 0.25);
}
.loading-subtitle {
    font-size: 11px;
    color: #7a9a5a;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.loading-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.loading-bar {
    width: 280px;
    height: 4px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(120, 180, 60, 0.18);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.loading-bar-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #6aa83a, #c8e8a0, #6aa83a);
    background-size: 200% 100%;
    animation: loadingShimmer 1.6s linear infinite;
    transition: width 0.4s ease;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(140, 200, 80, 0.5);
}
@keyframes loadingShimmer {
    from { background-position: 0% 0%; }
    to   { background-position: 200% 0%; }
}
.loading-status {
    font-size: 11px;
    color: #8aa970;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.loading-tip-card {
    width: 100%;
    background: rgba(20, 30, 15, 0.55);
    border: 1px solid rgba(120, 180, 60, 0.2);
    border-radius: 10px;
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.loading-tip-label {
    font-size: 9px;
    color: #c8a850;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.loading-tip-text {
    font-size: 14px;
    color: #d8d0b8;
    text-align: center;
    line-height: 1.5;
    transition: opacity 0.2s ease;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
 * ── Topbar polish ──
 * Tighten the vertical rhythm, soften the corners, and make the
 * three columns visually cohesive instead of "cropped" looking.
 * ============================================================ */
.menu-topbar {
    padding: 12px 22px;
    background: linear-gradient(180deg, rgba(22, 32, 16, 0.75) 0%, rgba(16, 24, 12, 0.85) 100%);
    border-bottom: 1px solid rgba(120, 180, 60, 0.22);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    min-height: 60px;
}
.topbar-left input {
    background: rgba(10, 16, 6, 0.65);
    border: 1px solid rgba(100, 140, 60, 0.28);
    border-radius: 8px;
    padding: 7px 14px;
    width: 200px;
    transition: border-color 0.18s, background 0.18s;
}
.topbar-left input:hover { border-color: rgba(120, 160, 60, 0.45); }

/* Rank display — make it feel like a card, not a bare element */
.rank-display {
    padding: 6px 18px;
    background: linear-gradient(180deg, rgba(15, 22, 10, 0.75) 0%, rgba(10, 16, 6, 0.85) 100%);
    border: 1px solid rgba(120, 160, 60, 0.32);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.rank-info { min-width: 180px; }

/* Crystals — keep the purple tint but match the new card vibe */
.crystals-display {
    padding: 7px 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(80, 40, 120, 0.30) 0%, rgba(50, 25, 80, 0.40) 100%);
    border-color: rgba(170, 85, 238, 0.40);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Settings + logout — uniform 36×36 round buttons, less "weird" */
.settings-gear-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-size: 16px;
    background: rgba(15, 22, 10, 0.7);
    border: 1px solid rgba(100, 140, 60, 0.28);
    border-radius: 9px;
    color: #c8c0a8;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-gear-btn:hover {
    background: rgba(120, 180, 60, 0.15);
    border-color: rgba(120, 180, 60, 0.45);
    color: #e8d480;
}

/* ── Active battles list — own battle highlight + rejoin button ── */
.battle-item--mine {
    background: linear-gradient(90deg, rgba(220,160,40,0.08), rgba(220,160,40,0));
    border-left: 3px solid #e8d480;
    padding-left: 9px;
}
.btn-rejoin {
    background: linear-gradient(135deg, #d68246, #b06028);
    color: #1a1209;
    border: 1px solid rgba(255,200,140,0.4);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255,255,255,0.15);
    box-shadow: 0 0 12px rgba(255,140,60,0.18);
}
.btn-rejoin:hover {
    background: linear-gradient(135deg, #e8945a, #c87033);
    box-shadow: 0 0 18px rgba(255,140,60,0.4);
}
.battle-private-badge {
    display: inline-block;
    background: rgba(220,160,40,0.18);
    border: 1px solid rgba(220,160,40,0.4);
    color: #e8d480;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}


/* ════════════════════════════════════════════════════════════
 * ── Global leaderboard screen ("Зал Славы") ──
 * Cinematic 3-tier layout:
 *   1. Hero podium — top 3 with elevated 1st-place plinth
 *   2. Cards strip — places #4..#10 with full tank thumbnails
 *   3. Full table — places #1..#100 + viewer's row at the bottom
 *      if outside top 100
 * Own row everywhere is highlighted + autoscrolled into view.
 * ════════════════════════════════════════════════════════════ */

#globalLeaderboardScreen.glb-screen {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Ambient backdrop baked directly into the screen — no extra absolute
       layers needed (the previous layered approach hid content if the mask
       parser tripped on a particular browser). */
    background:
        radial-gradient(ellipse 70% 60% at 20% 10%, rgba(120,180,60,0.10) 0%, transparent 80%),
        radial-gradient(ellipse 80% 70% at 85% 35%, rgba(220,160,40,0.08) 0%, transparent 80%),
        radial-gradient(ellipse 90% 60% at 50% 100%, rgba(60,90,40,0.10) 0%, transparent 80%),
        linear-gradient(180deg, #0a1208 0%, #070b05 50%, #050802 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
/* Decorative layers (kept as no-op divs in HTML for back-compat with any
   stale cached HTML — invisible if present). */
.glb-bg, .glb-bg-grid { display: none; }

/* ── Header (sticky) ── */
.glb-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 76px;
    display: grid;
    /* 1fr · auto · 1fr → title block lives in the middle column (auto-width)
       with two EQUAL flexible side columns. Title is therefore at the true
       visual centre of the viewport, regardless of how wide the left
       (back btn) or right (stat + refresh) sides happen to be. */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 28px;
    gap: 18px;
    background: linear-gradient(180deg, rgba(15,22,10,0.92) 0%, rgba(8,14,6,0.85) 100%);
    border-bottom: 1px solid rgba(120,180,60,0.18);
    flex-shrink: 0;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}
.glb-back { justify-self: start; }
.glb-meta { justify-self: end; }
.glb-back {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(120,180,60,0.30);
    color: #c8e8a0;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
}
.glb-back:hover {
    background: rgba(120,180,60,0.18);
    border-color: rgba(120,180,60,0.55);
    color: #e8f0c8;
    transform: translateX(-2px);
}
.glb-title-wrap {
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.glb-eyebrow {
    font-size: 10px;
    color: #7a9a5a;
    letter-spacing: 4px;
    font-weight: 700;
}
.glb-title {
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 28px;
    color: #e8d480;
    letter-spacing: 8px;
    margin: 0;
    text-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 22px rgba(232,212,128,0.25);
    background: linear-gradient(180deg, #ffe890 0%, #c89c2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glb-meta {
    display: flex; align-items: center; gap: 14px;
}
.glb-meta-stat {
    text-align: right;
    line-height: 1;
}
.glb-meta-num {
    display: block;
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 22px;
    color: #e8d480;
    letter-spacing: 1px;
}
.glb-meta-lbl {
    display: block;
    font-size: 9px;
    color: #6a8a4a;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 3px;
    font-weight: 600;
}
.glb-refresh {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: #c8c0a8;
    width: 36px; height: 36px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.glb-refresh:hover {
    background: rgba(120,180,60,0.18);
    border-color: rgba(120,180,60,0.45);
    color: #e8f0c8;
    transform: rotate(60deg);
}

/* ── Top-10 showcase cards (same look as menu "ВАШ ТАНК") ── */
.glb-cards-wrap {
    padding: 22px 28px 8px;
}
.glb-cards-title {
    font-size: 10px;
    color: #c8a060;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(232,160,64,0.25);
}
.glb-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    max-width: 1500px;
    margin: 0 auto;
}
@media (max-width: 1200px) { .glb-cards-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 980px)  { .glb-cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .glb-cards-grid { grid-template-columns: repeat(2, 1fr); } }

/* Cards literally reuse `.battle-showcase` from the main menu — only
   accent colours and per-card canvas sizing are added on top. */
.glb-showcase {
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.glb-showcase:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 1px 0 rgba(232,160,64,0.12), 0 8px 22px rgba(0,0,0,0.5);
    border-color: rgba(232,160,64,0.4);
}
.glb-showcase .glb-showcase-canvas {
    display: block;
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6));
}
.glb-showcase .glb-showcase-stats {
    border-top: 0;
}
.glb-card-top3 { border-color: rgba(255,210,74,0.42); }
.glb-card-r1 {
    border-color: rgba(255,210,74,0.7);
    box-shadow: inset 0 1px 0 rgba(255,210,74,0.18), 0 6px 30px rgba(255,210,74,0.18);
}
.glb-card-r2 {
    border-color: rgba(216,216,216,0.6);
    box-shadow: inset 0 1px 0 rgba(216,216,216,0.14), 0 6px 24px rgba(216,216,216,0.12);
}
.glb-card-r3 {
    border-color: rgba(205,138,74,0.6);
    box-shadow: inset 0 1px 0 rgba(205,138,74,0.14), 0 6px 24px rgba(205,138,74,0.14);
}
.glb-card-r1 .showcase-header { color: #ffe890; }
.glb-card-r2 .showcase-header { color: #e0e0e0; }
.glb-card-r3 .showcase-header { color: #e8a878; }
.glb-card-me {
    border-color: #e8d480 !important;
    box-shadow: 0 0 0 2px rgba(232,212,128,0.45), 0 6px 26px rgba(232,212,128,0.30) !important;
}

/* ── Legacy hero/podium blocks (no longer rendered, kept harmless) ── */
.glb-hero-wrap, .glb-podium-wrap { display: none; }

/* (legacy hero/podium styling below — kept for any cached HTML, hidden) */
.glb-hero-wrap-LEGACY {
    flex-shrink: 0;
    padding: 28px 28px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.20) 100%);
}
.glb-hero {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 18px;
    max-width: 920px;
    margin: 0 auto;
}
.glb-hero-card {
    flex: 0 1 240px;
    background: linear-gradient(180deg, rgba(20,30,14,0.85) 0%, rgba(8,12,6,0.95) 100%);
    border: 1px solid rgba(120,180,60,0.18);
    border-top: 3px solid var(--acc, #c8e8a0);
    border-radius: 12px;
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.55),
        0 0 32px var(--acc-glow, rgba(120,180,60,0.10)),
        inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.glb-hero-card.hero-1 {
    flex-basis: 280px;
    transform: translateY(-22px);
    --acc-glow: rgba(255,210,74,0.22);
    box-shadow:
        0 14px 40px rgba(0,0,0,0.6),
        0 0 44px rgba(255,210,74,0.25),
        inset 0 1px 0 rgba(255,255,255,0.06);
}
.glb-hero-card.hero-2 { --acc-glow: rgba(216,216,216,0.16); }
.glb-hero-card.hero-3 { --acc-glow: rgba(205,138,74,0.18); }
.glb-hero-card:hover { transform: translateY(-26px); }
.glb-hero-card.hero-1:hover { transform: translateY(-32px); }
.glb-hero-me {
    box-shadow:
        0 14px 40px rgba(0,0,0,0.6),
        0 0 0 2px var(--acc),
        0 0 50px var(--acc-glow);
}

.glb-hero-medal {
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 16px;
    color: var(--acc);
    letter-spacing: 2px;
    text-shadow: 0 0 14px var(--acc);
}
.hero-1 .glb-hero-medal { font-size: 20px; }

.glb-hero-tank {
    width: 100%;
    height: 200px;
    background:
        radial-gradient(ellipse at center, rgba(120,180,60,0.14) 0%, transparent 65%),
        radial-gradient(circle at 50% 100%, rgba(0,0,0,0.40) 0%, transparent 55%),
        rgba(0,0,0,0.32);
    border-radius: 8px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 -8px 20px rgba(0,0,0,0.25);
}
.hero-1 .glb-hero-tank { height: 220px; }
.glb-hero-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.glb-hero-name {
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 18px;
    color: #ffe890;
    letter-spacing: 1.5px;
    text-align: center;
    margin-top: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hero-1 .glb-hero-name { font-size: 22px; }

.glb-hero-tier {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.glb-hero-stats {
    display: flex;
    width: 100%;
    justify-content: space-around;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 10px;
    margin-top: 4px;
}
.glb-hero-stat {
    flex: 1;
    text-align: center;
    line-height: 1;
}
.glb-hero-stat-num {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #e8d480;
}
.hero-1 .glb-hero-stat-num { font-size: 22px; }
.glb-hero-kd { color: #88dd66 !important; }
.glb-hero-stat-lbl {
    display: block;
    font-size: 9px;
    color: #6a8a4a;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-top: 3px;
    font-weight: 600;
}

/* ── Strip for places 4-10 ── */
.glb-podium-wrap {
    flex-shrink: 0;
    padding: 12px 28px 16px;
    overflow-x: auto;
    overflow-y: hidden;
}
.glb-podium-title {
    font-size: 10px;
    color: #7a9a5a;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}
.glb-podium-strip {
    display: flex;
    gap: 10px;
    min-width: max-content;
    justify-content: center;
}
.glb-podium-card {
    flex: 0 0 168px;
    background: linear-gradient(180deg, rgba(15,22,10,0.85) 0%, rgba(6,10,4,0.95) 100%);
    border: 1px solid rgba(120,180,60,0.14);
    border-radius: 8px;
    padding: 8px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.glb-podium-card:hover {
    transform: translateY(-3px);
    border-color: rgba(120,180,60,0.35);
    box-shadow: 0 8px 22px rgba(0,0,0,0.55);
}
.glb-podium-me {
    border-color: #e8d480 !important;
    box-shadow: 0 0 0 1px #e8d480, 0 6px 22px rgba(232,212,128,0.28) !important;
}
.glb-podium-head {
    display: flex; align-items: baseline; gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 5px;
}
.glb-podium-rank {
    font-family: 'Black Ops One', Impact, sans-serif;
    font-size: 14px;
    color: #c8e8a0;
    letter-spacing: 1px;
    min-width: 28px;
}
.glb-podium-name {
    font-size: 12px;
    font-weight: 700;
    color: #e0d8c0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.glb-podium-canvas {
    display: block;
    width: 100%;
    height: 120px;
    background:
        radial-gradient(ellipse at center, rgba(120,180,60,0.10) 0%, transparent 65%),
        radial-gradient(circle at 50% 100%, rgba(0,0,0,0.35) 0%, transparent 60%),
        rgba(0,0,0,0.28);
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: inset 0 -6px 14px rgba(0,0,0,0.22);
}
.glb-podium-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.glb-podium-tier {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.glb-podium-stats {
    display: flex; justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}
.glb-podium-kills { color: #c8c0a8; }
.glb-podium-kd { color: #88dd66; font-weight: 700; }

/* ── Full table ── */
/* No internal scroll — the whole screen scrolls as one document, so the
   user can drag past the cards into the table without two scrollbars. */
.glb-table-wrap {
    padding: 8px 28px 36px;
    flex: 1 0 auto;
    background: transparent;
}
.glb-table-title {
    font-size: 10px;
    color: #7a9a5a;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    padding: 16px 0 10px;
}
.glb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: #c8c0a8;
    table-layout: fixed;
    background: rgba(8,12,6,0.50);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.glb-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, rgba(20,30,14,0.98) 0%, rgba(12,18,8,0.96) 100%);
    color: #8aa970;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid rgba(120,180,60,0.30);
    font-weight: 700;
}
.glb-col-rank    { width: 56px;  text-align: center !important; }
.glb-col-name    { width: 22%; }
.glb-col-userid  { width: 14%; color: #6a8a4a !important; }
.glb-col-tier    { width: 14%; }
.glb-col-kills   { width: 9%;  text-align: right !important; }
.glb-col-deaths  { width: 9%;  text-align: right !important; }
.glb-col-kd      { width: 8%;  text-align: right !important; }
.glb-col-matches { width: 8%;  text-align: right !important; }
.glb-col-wins    { width: 8%;  text-align: right !important; }
.glb-col-xp      { width: 9%;  text-align: right !important; }

.glb-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    transition: background 0.12s;
}
.glb-table tbody tr:hover td { background: rgba(120,180,60,0.06); }
.glb-row-rank {
    font-family: 'Black Ops One', Impact, sans-serif;
    color: #c8c0a8;
    font-weight: 400;
    text-align: center;
    font-size: 14px;
}
.glb-row-rank-1 { color: #ffd24a; text-shadow: 0 0 12px rgba(255,210,74,0.4); }
.glb-row-rank-2 { color: #d8d8d8; }
.glb-row-rank-3 { color: #cd8a4a; }
.glb-row-name   { color: #e0d8c0; font-weight: 600; }
.glb-row-uid    { font-family: 'Courier New', monospace; color: #6a8a4a; font-size: 11px; }
.glb-row-tier   { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.glb-row-num    { font-family: 'Courier New', monospace; text-align: right; color: #c8c0a8; }
.glb-row-kd     { font-family: 'Courier New', monospace; text-align: right; color: #88dd66; font-weight: 700; }
.glb-row-xp     { font-family: 'Courier New', monospace; text-align: right; color: #aaaaaa; }

.glb-row-me td {
    background: linear-gradient(90deg, rgba(232,212,128,0.18), rgba(232,212,128,0.04)) !important;
    box-shadow: inset 4px 0 0 #e8d480;
}
.glb-row-me .glb-row-name { color: #ffe890; }
.glb-row-me:hover td {
    background: linear-gradient(90deg, rgba(232,212,128,0.26), rgba(232,212,128,0.08)) !important;
}

.glb-divider td {
    padding: 12px 8px;
    background: rgba(0,0,0,0.4);
    border-top: 1px dashed rgba(255,255,255,0.10);
    border-bottom: 1px dashed rgba(255,255,255,0.10);
    color: #c8a850;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    font-weight: 700;
}

/* Side-panel "Все игроки →" button (kept here for proximity) */
.lb-global-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    background: rgba(120,180,60,0.10);
    border: 1px solid rgba(120,180,60,0.25);
    color: #c8e8a0;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
}
.lb-global-btn:hover {
    background: rgba(120,180,60,0.20);
    border-color: rgba(120,180,60,0.55);
    color: #e8f0c8;
    box-shadow: 0 0 14px rgba(120,180,60,0.25), inset 0 0 0 1px rgba(200,232,160,0.15);
    letter-spacing: 1.4px;
}
.lb-kd { color: #88dd66; font-family: 'Courier New', monospace; font-size: 11px; }

/* ──────────────────────────────────────────────────────────
   Menu ↔ Hall-of-Fame transition
   - Plain translate + opacity, no blur/skew (smoother & cheaper).
   - Parents that normally clip are unclamped while transitioning
     so panels can fly fully off-screen.
   - The topbar's rank-display and settings cluster also slide up
     individually so the dive looks like distinct tiles flying out.
   ────────────────────────────────────────────────────────── */
#mainMenu.menu-out,
#mainMenu.menu-in,
#globalLeaderboardScreen.glb-in,
#globalLeaderboardScreen.glb-out { overflow: hidden; }
#mainMenu.menu-out .menu-columns,
#mainMenu.menu-in  .menu-columns { overflow: visible; }

#mainMenu .menu-topbar,
#mainMenu .panel-side,
#mainMenu .panel-battle,
#mainMenu .topbar-left,
#mainMenu .topbar-center,
#mainMenu .topbar-right,
#globalLeaderboardScreen .glb-header,
#globalLeaderboardScreen .glb-table-wrap {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Custom easings — fast launch, soft glide */
:root {
    --ease-out-soft: cubic-bezier(0.22, 0.78, 0.32, 1);
    --ease-in-soft:  cubic-bezier(0.55, 0, 0.78, 0.32);
}

/* ── Menu exit ── */
/* Topbar bar slides up just enough to clear; its children fly off
   well past the viewport so they read as separate tiles ejecting. */
#mainMenu.menu-out .menu-topbar   { animation: slideOutBar    0.40s var(--ease-in-soft) forwards; }
#mainMenu.menu-out .topbar-left   { animation: tileOutUp      0.42s var(--ease-in-soft) forwards; animation-delay: 0.04s; }
#mainMenu.menu-out .topbar-center { animation: tileOutUp      0.42s var(--ease-in-soft) forwards; animation-delay: 0.08s; }
#mainMenu.menu-out .topbar-right  { animation: tileOutUp      0.42s var(--ease-in-soft) forwards; animation-delay: 0.12s; }
#mainMenu.menu-out .panel-side    { animation: slideOutLeft   0.42s var(--ease-in-soft) forwards; }
#mainMenu.menu-out .panel-battle  { animation: slideOutRight  0.42s var(--ease-in-soft) forwards; }

/* ── Menu re-entry ── */
#mainMenu.menu-in .menu-topbar    { animation: slideInBar     0.50s var(--ease-out-soft) both; }
#mainMenu.menu-in .topbar-left    { animation: tileInDown     0.55s var(--ease-out-soft) both; animation-delay: 0.10s; }
#mainMenu.menu-in .topbar-center  { animation: tileInDown     0.55s var(--ease-out-soft) both; animation-delay: 0.16s; }
#mainMenu.menu-in .topbar-right   { animation: tileInDown     0.55s var(--ease-out-soft) both; animation-delay: 0.22s; }
#mainMenu.menu-in .panel-side     { animation: slideInLeft    0.55s var(--ease-out-soft) both; animation-delay: 0.06s; }
#mainMenu.menu-in .panel-battle   { animation: slideInRight   0.55s var(--ease-out-soft) both; animation-delay: 0.06s; }

/* ── Hall-of-Fame entry ── */
#globalLeaderboardScreen.glb-in .glb-header     { animation: slideInDown 0.50s var(--ease-out-soft) both; }
#globalLeaderboardScreen.glb-in .glb-table-wrap { animation: glbTableIn  0.55s var(--ease-out-soft) both; animation-delay: 0.06s; }

/* ── Hall-of-Fame exit ── */
#globalLeaderboardScreen.glb-out .glb-header     { animation: slideOutUp 0.40s var(--ease-in-soft) forwards; }
#globalLeaderboardScreen.glb-out .glb-table-wrap { animation: glbTableOut 0.40s var(--ease-in-soft) forwards; }

@keyframes slideOutUp    { to { transform: translateY(-140%); opacity: 0; } }
@keyframes slideOutLeft  { to { transform: translateX(-140%); opacity: 0; } }
@keyframes slideOutRight { to { transform: translateX( 140%); opacity: 0; } }
@keyframes slideInDown   { from { transform: translateY(-140%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInLeft   { from { transform: translateX(-140%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInRight  { from { transform: translateX( 140%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glbTableIn    { from { transform: translateY( 70vh);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glbTableOut   { to   { transform: translateY( 70vh);  opacity: 0; } }
/* Topbar — bar slides just over its own height; tiles fly past the
   top edge of the viewport for a clear "ejected from above" feel. */
@keyframes slideInBar    { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOutBar   { to   { transform: translateY(-100%); opacity: 0; } }
@keyframes tileInDown    { from { transform: translateY(-32vh);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tileOutUp     { to   { transform: translateY(-32vh);  opacity: 0; } }

/* ===========================================================
   Top-bar buttons (Missions / Hall-of-Fame) — added 2026-05
   =========================================================== */
.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(15,22,10,0.65);
    border: 1px solid rgba(120,160,60,0.4);
    border-radius: 10px;
    color: #c8e2a0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.topbar-btn:hover {
    background: rgba(120,160,60,0.18);
    border-color: rgba(170,200,90,0.7);
    color: #e8f5b0;
}
.topbar-btn-icon {
    font-size: 16px;
    line-height: 1;
}
.topbar-btn-label {
    line-height: 1;
}
.topbar-btn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #c84030, #8a2010);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 6px rgba(200,80,40,0.5);
}
.topbar-btn-hof {
    background: rgba(60,40,15,0.7);
    border-color: rgba(220,160,50,0.5);
    color: #ffd28a;
}
.topbar-btn-hof:hover {
    background: rgba(220,160,50,0.18);
    border-color: rgba(255,210,138,0.85);
    color: #ffe4a8;
}
.topbar-btn-hof .topbar-btn-icon {
    color: #ffd24a;
    text-shadow: 0 0 6px rgba(255,210,74,0.6);
}

/* Missions popup — anchored top-left under the trigger */
.missions-popup {
    position: absolute;
    top: 64px;
    left: 18px;
    z-index: 80;
    width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(28,34,16,0.97), rgba(14,18,8,0.97));
    border: 1px solid rgba(120,160,60,0.5);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.6), inset 0 0 12px rgba(0,0,0,0.4);
    animation: popupFadeIn 0.18s ease-out;
}
.missions-popup[hidden] { display: none; }
.missions-popup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(120,160,60,0.25);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #c8e2a0;
    text-transform: uppercase;
}
@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* Friends panel */
.side-friends .side-block-title { color: #88c0e8; }
.friend-search { padding: 8px; background: rgba(0,0,0,0.25); border-radius: 6px; margin-bottom: 8px; }
.friend-search[hidden] { display: none; }
.friend-search-row {
    display: flex; gap: 6px; align-items: center;
}
.friend-search-row input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(15,22,10,0.7);
    border: 1px solid rgba(120,160,60,0.35);
    border-radius: 4px;
    color: #c8e2a0;
    font-size: 12px;
}
.friend-search-row input:focus {
    outline: none;
    border-color: rgba(170,200,90,0.8);
}
.friend-search-close {
    width: 24px; height: 24px;
    background: transparent;
    border: 1px solid rgba(180,120,40,0.35);
    color: #c89a4a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.friend-search-results {
    max-height: 180px;
    overflow-y: auto;
    margin-top: 6px;
}
.friend-search-row-item, .friend-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    margin-top: 4px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(120,160,60,0.12);
}
.friend-row .friend-info { display: flex; flex-direction: column; min-width: 0; }
.friend-row .friend-name { font-size: 12px; font-weight: 700; color: #c8e2a0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .friend-uid { font-size: 9px; color: #6a8a4a; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; }
.friend-row .friend-online {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4a4a4a;
    margin-right: 4px;
}
.friend-row.is-online .friend-online {
    background: #5acc5a;
    box-shadow: 0 0 4px rgba(90,204,90,0.6);
}
.friend-row .friend-action {
    background: linear-gradient(135deg, #3a8a5a, #2a6a4a);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.friend-row .friend-action:hover { background: linear-gradient(135deg, #4aaa6a, #3a8a5a); }
.friend-row .friend-action.danger { background: linear-gradient(135deg, #8a3a3a, #6a2a2a); }
.friend-row .friend-action.danger:hover { background: linear-gradient(135deg, #aa4a4a, #8a3a3a); }
.friend-row .friend-action.muted { background: rgba(80,80,80,0.6); border-color: rgba(255,255,255,0.05); }
.friend-row .friend-action.offline {
    background: rgba(60,60,60,0.7);
    color: rgba(255,255,255,0.45);
    border-color: rgba(255,255,255,0.06);
    cursor: default;
    font-size: 10px;
    letter-spacing: 0.5px;
}

/* Passive status pill (replaces a button when no action is possible). */
.friend-row .friend-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.45);
    background: rgba(60,60,60,0.55);
    border: 1px solid rgba(255,255,255,0.05);
    cursor: default;
    user-select: none;
    pointer-events: none;
}
.friend-row .friend-status--offline { /* default styling above is the offline look */ }
.friend-row .friend-status--sent {
    background: rgba(70,70,70,0.7);
    color: rgba(255,225,140,0.55);
}
.friend-row .friend-status--inparty {
    background: rgba(50,80,55,0.55);
    color: rgba(180,225,180,0.7);
}

/* Party invite popup — custom in-game UI, replaces window.confirm. */
.party-invite-popup {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 8000;
    animation: partyInviteSlide 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes partyInviteSlide {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.party-invite-card {
    width: 320px;
    background: linear-gradient(160deg, rgba(28,38,32,0.97), rgba(18,24,20,0.97));
    border: 1px solid rgba(120,200,140,0.45);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 24px rgba(80,180,110,0.2);
    overflow: hidden;
    color: #e8efe6;
}
.party-invite-header {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #b5e3b8;
    background: linear-gradient(90deg, rgba(80,180,110,0.18), rgba(80,180,110,0.05));
    border-bottom: 1px solid rgba(120,200,140,0.25);
}
.party-invite-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.party-invite-callsign {
    font-size: 17px;
    font-weight: bold;
    color: #ffd86a;
}
.party-invite-text {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}
.party-invite-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 12px;
}
.party-invite-actions button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}
.party-invite-actions button:hover { filter: brightness(1.15); }
.party-invite-actions button:active { transform: translateY(1px); }
.party-invite-accept {
    background: linear-gradient(135deg, #3a8a5a, #2a6a3a);
    border-color: rgba(120,200,140,0.6);
    color: #fff;
}
.party-invite-decline {
    background: rgba(60,60,60,0.7);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
}
.party-invite-bar {
    height: 3px;
    background: rgba(0,0,0,0.4);
}
.party-invite-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #80c890, #4a8a5a);
}
.friend-row.is-pending {
    background: rgba(220,150,40,0.1);
    border-color: rgba(220,150,40,0.4);
}
.friend-row .friend-action-row { display: flex; gap: 4px; }
.friends-list { max-height: 36vh; overflow-y: auto; padding-right: 4px; }
.friends-list-section {
    font-size: 9px;
    color: #6a8a4a;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 8px 4px 4px;
    font-weight: 700;
}
.friends-list-section:first-child { margin-top: 0; }
.friend-emblem {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
}

/* Team panel */
.side-team .side-block-title { color: #d8c898; }
.team-list { max-height: 24vh; overflow-y: auto; padding-right: 4px; }
.team-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    margin-top: 4px;
    background: rgba(0,0,0,0.22);
    border-left: 3px solid rgba(180,120,40,0.5);
}
.team-row.is-leader { border-left-color: #ffd24a; background: rgba(220,160,50,0.10); }
.team-row .team-info { display: flex; flex-direction: column; min-width: 0; }
.team-row .team-name {
    font-size: 12px; font-weight: 700; color: #c8e2a0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-row .team-uid { font-size: 9px; color: #6a8a4a; }
.team-row .team-leader-badge { font-size: 10px; color: #ffd24a; font-weight: 800; }
.team-empty {
    padding: 14px 10px;
    text-align: center;
    color: #5a5040;
    font-size: 11px;
    font-style: italic;
}

/* Disabled "leader-only" lock state for the join/create-battle button. */
.btn-locked,
.btn-locked:hover {
    background: linear-gradient(135deg, #444, #2a2a2a) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.45) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    text-shadow: none !important;
    pointer-events: auto;
}

/* ===========================================================
   Duel match-end screen — tournament layout
   =========================================================== */
.me-stats-duel .me-stats-title {
    font-size: 56px;
    letter-spacing: 4px;
    margin-bottom: 4px;
}
.me-stats-duel .me-stats-mode-tag {
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 28px;
}
.me-duel-board {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 24px;
    width: min(900px, 92vw);
    margin: 0 auto 24px;
}
.me-duel-team {
    flex: 1 1 0;
    background: linear-gradient(180deg, rgba(20,22,28,0.75), rgba(8,10,15,0.85));
    border: 1.5px solid var(--c, #888);
    border-radius: 12px;
    padding: 20px 24px 22px;
    box-shadow: inset 0 0 22px rgba(0,0,0,0.6);
    text-align: center;
    transition: transform 0.2s;
}
.me-duel-team.is-victor {
    box-shadow: inset 0 0 22px rgba(0,0,0,0.6),
                0 0 24px var(--c),
                0 0 60px rgba(255,210,138,0.15);
    transform: translateY(-4px);
}
.me-duel-team-head {
    color: var(--c, #fff);
    font: 800 20px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 4px;
    text-shadow: 0 0 12px var(--c);
    margin-bottom: 6px;
}
.me-duel-team-score {
    color: var(--c, #fff);
    font: 900 78px 'Black Ops One', 'Impact', sans-serif;
    line-height: 1;
    text-shadow: 0 0 22px var(--c), 0 4px 14px rgba(0,0,0,0.85);
    margin: 6px 0 12px;
}
.me-duel-pips {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}
.me-duel-pip {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
}
.me-duel-pip.on {
    border-color: rgba(255,255,255,0.55);
}
.me-duel-vs {
    align-self: center;
    color: rgba(255,255,255,0.45);
    font: 900 28px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 4px;
    padding: 0 4px;
}
.me-duel-team-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.me-duel-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    font-size: 14px;
    color: #c8c8a0;
}
.me-duel-player.me-duel-self {
    background: rgba(255,210,138,0.15);
    border: 1px solid rgba(255,210,138,0.5);
    color: #ffd28a;
    font-weight: 700;
}
.me-duel-pname {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.me-duel-bot {
    font-size: 9px;
    background: rgba(120,120,120,0.4);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    letter-spacing: 1px;
    vertical-align: middle;
}
.me-duel-pkd {
    color: #ffd28a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.me-duel-pkd .muted {
    color: rgba(255,210,138,0.4);
    margin: 0 4px;
}
.me-duel-team-empty {
    color: rgba(255,255,255,0.25);
    font-style: italic;
    padding: 14px;
}

/* ===========================================================
   Duel team-pick lobby
   =========================================================== */
#duelLobby {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(15,15,20,0.95), rgba(0,0,0,0.98));
    z-index: 200;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
#duelLobby[hidden], #duelLobby[style*="display:none"], #duelLobby[style*="display: none"] {
    display: none !important;
}
.duel-lobby-wrap {
    text-align: center;
    width: min(900px, 92vw);
}
.duel-lobby-title {
    color: #ffd28a;
    font: 900 56px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 6px;
    margin: 0 0 8px;
    text-shadow: 0 0 24px rgba(255,210,138,0.5);
}
.duel-lobby-sub {
    color: rgba(255,255,255,0.55);
    font: 700 14px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 36px;
}
.duel-lobby-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}
.duel-lobby-team {
    flex: 1 1 0;
    min-height: 240px;
    background: linear-gradient(180deg, rgba(20,22,28,0.85), rgba(8,10,15,0.95));
    border: 2px solid;
    border-radius: 14px;
    padding: 24px 18px;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
    color: #fff;
    font-family: 'Black Ops One', 'Impact', sans-serif;
}
.duel-lobby-team--red  { border-color: #d65a4a; }
.duel-lobby-team--blue { border-color: #4a9ed6; }
.duel-lobby-team:hover {
    transform: translateY(-4px);
}
.duel-lobby-team--red:hover  { box-shadow: 0 0 32px rgba(214,90,74,0.7); background: linear-gradient(180deg, rgba(80,30,20,0.85), rgba(40,15,10,0.95)); }
.duel-lobby-team--blue:hover { box-shadow: 0 0 32px rgba(74,158,214,0.7); background: linear-gradient(180deg, rgba(20,40,80,0.85), rgba(10,20,40,0.95)); }
.duel-lobby-team.is-mine {
    box-shadow: 0 0 28px currentColor;
}
.duel-lobby-team--red.is-mine { color: #d65a4a; }
.duel-lobby-team--blue.is-mine { color: #4a9ed6; }
.duel-lobby-team.is-full {
    opacity: 0.4;
    cursor: not-allowed;
}
.dlt-name {
    font-size: 28px;
    letter-spacing: 6px;
    margin-bottom: 16px;
    text-shadow: 0 0 16px currentColor;
}
.duel-lobby-team--red  .dlt-name { color: #ff7a6a; }
.duel-lobby-team--blue .dlt-name { color: #6abfff; }
.dlt-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0;
    min-height: 80px;
    color: #c8c8a0;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: 1px;
}
.dlt-slot {
    padding: 6px 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
}
.dlt-slot.is-empty {
    color: rgba(255,255,255,0.25);
    font-style: italic;
}
.dlt-slot.is-me {
    background: rgba(255,210,138,0.18);
    border-color: rgba(255,210,138,0.6);
    color: #ffd28a;
}
.dlt-action {
    margin-top: 12px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    letter-spacing: 3px;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.duel-lobby-vs {
    color: rgba(255,255,255,0.4);
    font: 900 36px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 4px;
}
.duel-lobby-timer {
    margin-top: 32px;
    color: #ffd28a;
    font: 700 18px 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 3px;
}

/* ════════════════════════════════════════════════════════════════
   ▼ TANKI-STYLE TOPBAR CAPSULES — overrides earlier topbar styles ▼
   Inspired by Tanki Online's brushed-metal capsule row. Each item
   in the topbar is a tight rounded-rect with a top-highlight and a
   subtle inset shadow, on a dark metallic gradient. They sit in a
   single row with no gaps between them — true "capsule strip."
   ════════════════════════════════════════════════════════════════ */
.menu-topbar {
    padding: 10px 18px;
    background: linear-gradient(180deg, #1c2516 0%, #10160b 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 4px 14px rgba(0, 0, 0, 0.55);
    min-height: 56px;
    gap: 12px;
}

/* All capsule-like elements share this base — buttons, crystals, gear */
.topbar-btn,
.settings-gear-btn,
.crystals-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    height: 38px;
    background: linear-gradient(180deg, #46535e 0%, #2a333d 50%, #1f262d 100%);
    border: 1px solid #0a0e12;
    border-top-color: #5a6770;
    border-radius: 6px;
    color: #d8e0e8;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
    transition: filter 0.12s, transform 0.06s;
    position: relative;
}
.topbar-btn:hover,
.settings-gear-btn:hover,
.crystals-display:hover {
    filter: brightness(1.18);
}
.topbar-btn:active,
.settings-gear-btn:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 0 2px rgba(0, 0, 0, 0.4);
}

/* Settings gear — square capsule, icon-only */
.settings-gear-btn {
    width: 38px;
    padding: 0;
    font-size: 18px;
    color: #d8e0e8;
    transform: none;
}
.settings-gear-btn:hover { transform: none; filter: brightness(1.18); }

/* Hall-of-fame variant — gold tint to stand out */
.topbar-btn-hof {
    background: linear-gradient(180deg, #6e5630 0%, #3e2e18 50%, #2a1e10 100%);
    border-top-color: #826838;
    color: #ffd486;
}
.topbar-btn-hof .topbar-btn-icon { color: #ffd24a; }

/* Missions variant — blue-grey accent */
.topbar-btn-missions {
    background: linear-gradient(180deg, #46535e 0%, #2a333d 50%, #1f262d 100%);
    border-top-color: #5a6770;
}

/* Icons in capsules — cleaner sizing, subtle drop shadow */
.topbar-btn-icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4));
}

/* Crystals — gold tint via inner color, share capsule shape */
.crystals-display {
    background: linear-gradient(180deg, #4a3e22 0%, #2e2614 50%, #1f1a0e 100%);
    border-top-color: #5e5028;
    cursor: default;
    padding: 0 16px;
}
.crystals-display:hover { filter: none; }
.crystals-display span {
    color: #ffe48a;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 16px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.crystals-display canvas { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45)); }

/* Badge stays the same red dot, just adjust position for new capsule */
.topbar-btn-badge {
    top: -5px;
    right: -5px;
    border-radius: 8px;
}

/* Right-side group — capsules visually connected with a tight gap */
.topbar-right { gap: 6px; }
.topbar-left  { gap: 10px; }

/* Rank pill — match capsule aesthetic, slimmer */
.rank-display {
    height: 38px;
    padding: 0 16px;
    background: linear-gradient(180deg, #1f2a16 0%, #131a0d 100%);
    border: 1px solid #0a0e08;
    border-top-color: #2c3a20;
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.5);
    gap: 12px;
}
.rank-info { min-width: 170px; }
.rank-name {
    font-size: 13px;
    color: #ffe48a;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}
.rank-bar-track {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* Topbar input — capsule-flavored too */
.topbar-left input {
    height: 38px;
    background: linear-gradient(180deg, #11170c 0%, #0b1008 100%);
    border: 1px solid #050805;
    border-top-color: #2c3a20;
    border-radius: 6px;
    color: #e8d480;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 1.5px;
    font-size: 14px;
}
.topbar-left input:focus {
    outline: none;
    border-color: rgba(120, 180, 60, 0.6);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.5),
        0 0 8px rgba(120, 180, 60, 0.25);
}
.topbar-left label {
    color: #7a9a5a;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* ════════════════════════════════════════════════════════════════
   ▼ TANKI-STYLE TOPBAR REWORK v2 ▼
   Layout: [emblem] [wide XP bar] [crystals] [missions] [HoF] [⚙][↩]
   The XP bar capsule fills almost the entire row (flex:1) — that's
   the visual centerpiece, like in Tanki Online.
   ════════════════════════════════════════════════════════════════ */
.menu-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #1c2516 0%, #10160b 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 4px 14px rgba(0, 0, 0, 0.55);
    min-height: 56px;
}

/* Standalone rank emblem — gold-tinted square at the very left */
.topbar-rank-emblem {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #5a4a22 0%, #1f1810 100%);
    border: 1px solid #0a0e08;
    border-top-color: #6e5a30;
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 230, 150, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}
.topbar-rank-emblem canvas { display: block; }

/* Wide XP-bar capsule — flex:1 so it spans the row.
   Stacks two layers: the fill (absolute, grows left→right by width %)
   and the text overlay (absolute, sits on top, mix-blend ensures it's
   readable on both filled and unfilled portions). */
.topbar-xpbar {
    flex: 1;
    position: relative;
    height: 38px;
    border-radius: 6px;
    border: 1px solid #050805;
    border-top-color: #2c3a20;
    background: linear-gradient(180deg, #0a0f06 0%, #060a04 100%);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-width: 240px;
}
.topbar-xpbar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    background: linear-gradient(180deg, #95cc4f 0%, #6a9c30 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    transition: width 0.4s;
}
.topbar-xpbar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 14px;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    letter-spacing: 1.5px;
    font-size: 12px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
}
.topbar-xp-num {
    color: #ffffff;
    font-size: 13px;
    flex-shrink: 0;
}
.topbar-xp-rank {
    color: #f0ffd8;
    flex-shrink: 0;
}
.topbar-xp-player {
    color: #ffe48a;
    margin-left: auto;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
}

/* Hide legacy elements that may still be in older mainMenu sections */
.menu-topbar > .topbar-left,
.menu-topbar > .topbar-center,
.menu-topbar > .topbar-right { display: none !important; }

/* Callsign capsule — own capsule between emblem and XP bar.
   Click toggles between display <span> and editable <input>. */
.topbar-callsign {
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: linear-gradient(180deg, #1f2a16 0%, #131a0d 100%);
    border: 1px solid #0a0e08;
    border-top-color: #2c3a20;
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.5);
    cursor: text;
    flex-shrink: 0;
    min-width: 140px;
    max-width: 200px;
    transition: filter 0.12s;
}
.topbar-callsign:hover { filter: brightness(1.12); }
.topbar-callsign-text {
    color: #ffe48a;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.topbar-callsign-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffe48a;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    width: 100%;
    padding: 0;
}

/* ════════════════════════════════════════════════════════════════
   ▼ TOPBAR overrides ▼
   Note: the bulk of style.css is still unlayered. In CSS cascade
   rules, UNLAYERED selectors beat ANY @layer (including @layer
   overrides). So these stay with !important for now — they have
   to win against earlier unlayered .menu-topbar / .topbar-rank-emblem
   declarations. The @layer ordering at the top of the file is
   ready for future migration: wrap the EARLIER conflicting rules
   in @layer panels first, then this block can drop !important and
   move into @layer overrides. Native CSS nesting (&) is available.
   ════════════════════════════════════════════════════════════════ */
.menu-topbar {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 14px 18px !important;
}

.topbar-rank-emblem {
    width: 44px !important;
    height: 44px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer;

    & canvas {
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    }

    &:hover canvas {
        filter: drop-shadow(0 0 8px rgba(255, 210, 138, 0.5))
                drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    }
}

/* ════════════════════════════════════════════════════════════════
   ▼ GLOBAL TOPBAR — единый layout для всех экранов ▼
   Один и тот же вид везде (главное меню, бой, загрузка). Скрывается
   ТОЛЬКО на authScreen (когда игрок ещё не вошёл в аккаунт).
   Раскладка:
     [emblem][callsign][===wide XP bar===] [crystals][missions]   [HoF][⚙][↩]
   • XP-шкала растягивается на всё доступное пространство (flex:1)
   • Кристаллы + Задания — после XP, идут естественно
   • HoF + ⚙ + ↩ — прижаты к правому краю через margin-left:auto
   • Капсулы сохраняют объёмный вид (gradient + inset shadows) —
     стили из ранних блоков .topbar-btn / .crystals-display / etc
     применяются как есть. Сама полоса topbar'а — без подложки,
     капсулы плавают на фоне страницы.
   ════════════════════════════════════════════════════════════════ */
#globalTopbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
}
body.topbar-hidden #globalTopbar { display: none; }

/* Universal spread layout — applied always */
#globalTopbar > .topbar-xpbar {
    flex: 1 1 auto !important;
    min-width: 240px !important;
}
#globalTopbar > .topbar-btn-hof {
    margin-left: auto !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ Topbar: padding-top вместо top/height shift ▼
   Раньше делал top:66px → screen начинался ниже шапки, и сверху
   просвечивала body-подложка как отдельная серая полоса. Уродливо.
   Теперь screen остаётся top:0 height:100% (фон тянется во всю
   высоту, под шапкой — то же что и под контентом), а сам контент
   панелей сдвигается вниз через padding-top.
   ════════════════════════════════════════════════════════════════ */
:root {
    --topbar-h: 66px;
}

/* Main menu — flex column. padding-top сдвигает .menu-columns вниз. */
body:not(.topbar-hidden) #mainMenu {
    padding-top: var(--topbar-h) !important;
}

/* Garage — содержит свой собственный hangar-topbar. Сдвигаем его
   margin'ом чтобы наш глобальный не перекрывал. */
body:not(.topbar-hidden) #garageScreen .hangar-topbar {
    margin-top: var(--topbar-h);
}

/* В бою (canvas full-screen) — отступы не нужны, шапка плавает
   поверх рендера. */

/* В главном меню подгоняем шапку под стиль панелей: тёмно-зелёный
   фон с тонкой границей, как у .menu-panel. Так шапка читается как
   четвёртая «панель» сверху, а не чужой плавающий блок. */
body:has(#mainMenu.active) #globalTopbar {
    background: linear-gradient(180deg,
        rgba(28, 38, 22, 0.88) 0%,
        rgba(20, 28, 14, 0.92) 100%) !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.20) !important;
}

/* В бою — никакой подложки у самой шапки (transparent). Полупрозрачными
   становятся ТОЛЬКО капсулы, чтобы они не заслоняли игровую сцену.
   Текст внутри капсул остаётся читаемым (alpha не трогает текст). */
body.in-battle #globalTopbar {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
}
body.in-battle #globalTopbar > .topbar-rank-emblem,
body.in-battle #globalTopbar > .topbar-callsign,
body.in-battle #globalTopbar > .topbar-xpbar,
body.in-battle #globalTopbar > .crystals-display,
body.in-battle #globalTopbar > .topbar-btn,
body.in-battle #globalTopbar > .settings-gear-btn {
    opacity: 0.78;
    transition: opacity 0.15s;
}
body.in-battle #globalTopbar > *:hover {
    opacity: 1.0;
}

/* ════════════════════════════════════════════════════════════════
   ▼ Topbar — icon group + battle-mode HoF↔hangar swap ▼
   ════════════════════════════════════════════════════════════════ */
/* Settings + logout сидят в одном flex-кластере с маленьким gap'ом —
   чтобы не выглядели как два отдельных оторванных значка. Кластер
   сам по себе уезжает к правому краю через margin-left: auto на
   .topbar-btn-hof / .topbar-btn-hangar (предыдущий элемент). */
#globalTopbar > .topbar-icon-group {
    display: flex;
    align-items: center;
    gap: 4px;            /* плотно друг к другу */
}

/* Logout-кнопка получает красноватый акцент чтобы отличаться от
   шестерёнки настроек — глазу понятно «выход» vs «настройки». */
#globalTopbar .topbar-logout-btn {
    color: #ff8866 !important;
    font-size: 16px !important;
}
#globalTopbar .topbar-logout-btn:hover {
    color: #ff5544 !important;
}

/* Hangar capsule — синий металлический градиент, ставит акцент на
   "вернуться в гараж" в бою. Скрыта в меню (style=display:none),
   показывается через body.in-battle. */
#globalTopbar > .topbar-btn-hangar {
    background: linear-gradient(180deg, #2c4566 0%, #182838 50%, #0e1822 100%) !important;
    border-top-color: #3a5a7a !important;
    color: #b0d8ff !important;
    margin-left: auto !important;     /* спейсер до icon-group */
}
#globalTopbar > .topbar-btn-hangar .topbar-btn-icon {
    color: #88c8ff;
}

/* В бою — прячем HoF, показываем hangar-кнопку */
body.in-battle #globalTopbar > .topbar-btn-hof { display: none !important; }
body.in-battle #globalTopbar > .topbar-btn-hangar { display: inline-flex !important; }

/* В меню — наоборот: HoF видна, hangar скрыт (default через inline style) */
body:not(.in-battle) #globalTopbar > .topbar-btn-hangar { display: none !important; }

/* ════════════════════════════════════════════════════════════════
   ▼ Topbar capsules — flatten ▼
   Сильно градиентный 3D-вид капсул выделялся на фоне остального
   меню (плоские .menu-panel, .friend-row и т.п.). Уплощаем:
   • Solid фон вместо вертикального градиента (3 stops → 1 цвет
     с лёгкой top-tint для минимального объёма).
   • Убираем inset top-highlight и bottom-shadow.
   • Убираем drop-shadow под капсулой.
   • Текст-shadow ослаблен (читаемость осталась).
   • Border остаётся — даёт визуальную границу без 3D-эффекта.
   ════════════════════════════════════════════════════════════════ */

#globalTopbar > .topbar-btn,
#globalTopbar > .settings-gear-btn,
#globalTopbar > .crystals-display,
#globalTopbar .topbar-icon-group > .settings-gear-btn {
    background: #2a333d !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35) !important;
}

#globalTopbar > .topbar-btn-hof {
    background: #3e2e18 !important;
    border-color: rgba(255, 212, 138, 0.20) !important;
    color: #ffd486 !important;
}
#globalTopbar > .topbar-btn-hangar {
    background: #1c2c40 !important;
    border-color: rgba(120, 180, 220, 0.20) !important;
    color: #b0d8ff !important;
}
#globalTopbar > .crystals-display {
    background: #2e2614 !important;
    border-color: rgba(255, 212, 138, 0.20) !important;
}
#globalTopbar > .topbar-callsign {
    background: #1a2410 !important;
    background-image: none !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    box-shadow: none !important;
}
#globalTopbar > .topbar-xpbar {
    background: #0e1408 !important;
    background-image: none !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    box-shadow: none !important;
}
/* XP-bar fill — оставим градиентом (визуально отличается от трека) */
#globalTopbar .topbar-xpbar-fill {
    box-shadow: none !important;
}

#globalTopbar .topbar-btn-icon {
    filter: none !important;
}

/* Hover — лёгкое осветление (+12% вместо +18%) */
#globalTopbar > .topbar-btn:hover,
#globalTopbar > .settings-gear-btn:hover,
#globalTopbar .topbar-icon-group > .settings-gear-btn:hover {
    filter: brightness(1.12);
}

/* ════════════════════════════════════════════════════════════════
   ▼ Topbar — emblem + callsign как единое целое ▼
   Раньше эмблема и позывной были отдельными визуальными блоками
   с разным фоном. Делаем их визуально слитной парой:
   • У позывного убираем background+border — он становится 'плашкой'
     прямо рядом с эмблемой, без рамки.
   • Между ними нулевой gap, эмблема как иконка слева от текста.
   ════════════════════════════════════════════════════════════════ */
#globalTopbar > .topbar-rank-emblem + .topbar-callsign {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-left: -4px !important;       /* притянуть вплотную к эмблеме */
    padding-left: 6px !important;
    padding-right: 12px !important;
}

/* ── Settings/Logout кластер — ещё плотнее ── */
#globalTopbar > .topbar-icon-group {
    gap: 2px !important;                /* почти впритык */
}
/* Убрать border у второй иконки чтобы они выглядели как пара,
   а не два отдельных квадрата. */
#globalTopbar > .topbar-icon-group > .settings-gear-btn + .settings-gear-btn {
    border-left: none !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
#globalTopbar > .topbar-icon-group > .settings-gear-btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ── В бою XP-шкала более прозрачная ──
   Сама шкала и заливка — alpha ~50%. Текст внутри остаётся как есть.
*/
body.in-battle #globalTopbar > .topbar-xpbar {
    opacity: 0.55 !important;
}
body.in-battle #globalTopbar > .topbar-xpbar:hover {
    opacity: 0.95;
}

/* ════════════════════════════════════════════════════════════════
   ▼ INTEGRATED UI — единый интерфейс вместо плавающих карточек ▼
   Раньше каждая зона меню (Друзья / Битва / Команда) была отдельной
   floating-карточкой со своим border/border-radius/shadow. Получался
   эффект «приклеенных стикеров». Теперь:
   • Фон #mainMenu — единый dark-зелёный градиент (под палитру шапки).
   • .menu-panel теряет card-look (нет фона/border/radius/shadow).
     Остаётся только flexbox-структура для расположения детей.
   • Внутренние секции разделяются ТОНКОЙ линией снизу вместо рамок.
   • Заголовки секций (h3, side-block-title) — uppercase
     с легчайшим бордером, плотно лежат на общем фоне.
   • Интерактивные элементы (кнопки, инпуты, list-rows) сохраняют
     контраст с фоном — это единственный визуальный «hierarchy»
     теперь.
   ════════════════════════════════════════════════════════════════ */

/* Единый фон меню — продолжение топбар-палитры. */
#mainMenu.active {
    background:
        radial-gradient(ellipse at top, rgba(50, 70, 30, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(28, 38, 22, 0.88) 0%, rgba(20, 28, 14, 0.92) 100%) !important;
}

/* Снимаем card-look с панелей. */
#mainMenu .menu-panel {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 18px 22px !important;
}

/* Колонки разделяются вертикальной линией вместо собственных рамок. */
#mainMenu .menu-columns {
    gap: 0 !important;
    padding: 0 !important;
}
#mainMenu .menu-panel + .menu-panel {
    border-left: 1px solid rgba(120, 160, 60, 0.12) !important;
}

/* Заголовок секции (h3 'БИТВА', etc) — рамка вместо отдельной плашки. */
#mainMenu .menu-panel h3 {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.18) !important;
    border-radius: 0 !important;
    padding: 0 0 10px !important;
    margin: 0 0 16px !important;
    text-align: left !important;
    color: #c8d8a0 !important;
    letter-spacing: 3px !important;
    font-size: 13px !important;
}

/* Side-block (Друзья / Команда) — теряют card, разделяются линией. */
#mainMenu .side-block {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
#mainMenu .side-block + .side-block {
    margin-top: 18px !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(120, 160, 60, 0.12) !important;
}
#mainMenu .side-block-header {
    margin-bottom: 10px !important;
}
#mainMenu .side-block-title {
    color: #a8c280 !important;
    font-size: 11px !important;
    letter-spacing: 2.5px !important;
    text-transform: uppercase !important;
}

/* Battle-grid sub-columns — разделители вместо собственных карточек. */
#mainMenu .battle-grid {
    gap: 0 !important;
}
#mainMenu .battle-grid > * + * {
    border-left: 1px solid rgba(120, 160, 60, 0.10) !important;
    padding-left: 18px !important;
    margin-left: 18px !important;
}

/* Tank showcase frame — keep структурный border, но без glow/shadow */
#mainMenu .showcase-frame {
    background: rgba(10, 14, 8, 0.45) !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}
#mainMenu .showcase-header {
    color: #a8c280 !important;
    font-size: 11px !important;
    letter-spacing: 2.5px !important;
    margin-bottom: 8px !important;
}

/* Map preview frame — same treatment */
#mainMenu .battle-map-preview {
    background: rgba(10, 14, 8, 0.45) !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

/* Friend rows / battle items / mission rows — интерактивные элементы
   ОСТАЮТСЯ контрастными к фону. Это единственная визуальная иерархия. */
#mainMenu .friend-row {
    background: rgba(10, 14, 8, 0.55) !important;
    border: 1px solid rgba(120, 160, 60, 0.10) !important;
    border-radius: 4px !important;
}
#mainMenu .friend-row:hover {
    background: rgba(15, 20, 10, 0.7) !important;
    border-color: rgba(150, 200, 80, 0.20) !important;
}
#mainMenu .battle-item {
    background: rgba(10, 14, 8, 0.55) !important;
    border: 1px solid rgba(120, 160, 60, 0.10) !important;
    border-radius: 4px !important;
}
#mainMenu .battle-item:hover {
    background: rgba(15, 20, 10, 0.7) !important;
}

/* Selectors / labels — спокойнее, без отдельных коробок */
#mainMenu .mode-label {
    color: #8aa468 !important;
    letter-spacing: 2px !important;
    font-size: 10px !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ TOPBAR — финальный полированный вид (v3) ▼
   • Mature унифицированный набор кнопок без 'детских' акцентов.
   • Settings/Logout: квадратные кнопки с одинаковым radius (без
     segmented-control обрезки).
   • XP-шкала в бою скрывается полностью (опция: opacity не нужна).
   • Перенарисованный margin-left:auto под новый HTML-порядок:
     emblem|callsign|xpbar  ⇠⇠  crystals  HoF/Hangar  missions  ⇠⇠  ⚙ ↩
   ════════════════════════════════════════════════════════════════ */

/* XP-шкала растягивается на всё доступное пространство — как было
   изначально. Раньше тут стоял max-width:280 + flex:0 — это и
   обрезало шкалу до маленькой коробочки. */
#globalTopbar > .topbar-xpbar {
    flex: 1 1 auto !important;
    min-width: 240px !important;
}
/* Спейсер — всё начиная с crystals уезжает к правому краю */
#globalTopbar > .crystals-display { margin-left: auto !important; }
/* Старые spacers убрать */
#globalTopbar > .topbar-btn-hof,
#globalTopbar > .topbar-btn-hangar,
#globalTopbar > .topbar-btn-missions { margin-left: 0 !important; }

/* Порядок капсул визуально: crystals, HoF/hangar, missions, icon-group.
   Между ними — небольшой gap (общий gap у .menu-topbar). */

/* В бою — полностью скрываем XP-шкалу (даже не opacity). */
body.in-battle #globalTopbar > .topbar-xpbar {
    display: none !important;
}

/* ── Унифицированный вид капсул (mature) ──
   • Чуть меньше размер, тоньше border, мягче типографика.
   • Все варианты используют один и тот же фон с лёгкой акцентной
     полоской слева (border-left по цвету типа). Это даёт единство
     стиля + цветовая идентичность типа кнопки.
*/
#globalTopbar > .topbar-btn,
#globalTopbar > .crystals-display {
    height: 36px !important;
    padding: 0 14px !important;
    background: #1c2618 !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    border-left: 3px solid rgba(120, 160, 60, 0.35) !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    letter-spacing: 1.2px !important;
    color: #d4dcc4 !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    font-family: 'Black Ops One', 'Impact', sans-serif !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: background 0.12s, border-color 0.12s !important;
}
#globalTopbar > .topbar-btn:hover {
    background: #243020 !important;
    border-color: rgba(150, 200, 80, 0.30) !important;
}

/* Crystals — золотой акцент слева */
#globalTopbar > .crystals-display {
    border-left-color: rgba(255, 212, 138, 0.55) !important;
    cursor: default;
}
#globalTopbar > .crystals-display span {
    color: #ffd486 !important;
    font-size: 14px !important;
    font-family: 'Black Ops One', 'Impact', sans-serif !important;
    text-shadow: none !important;
}

/* Hall of Fame — золотой */
#globalTopbar > .topbar-btn-hof {
    border-left-color: rgba(255, 212, 138, 0.55) !important;
    color: #ffd486 !important;
}
#globalTopbar > .topbar-btn-hof:hover {
    border-color: rgba(255, 212, 138, 0.40) !important;
}

/* Missions — нейтральный (оливковый) */
#globalTopbar > .topbar-btn-missions {
    border-left-color: rgba(150, 200, 80, 0.55) !important;
}

/* В ангар — синий */
#globalTopbar > .topbar-btn-hangar {
    border-left-color: rgba(120, 180, 220, 0.55) !important;
    color: #b0d8ff !important;
}
#globalTopbar > .topbar-btn-hangar:hover {
    border-color: rgba(120, 180, 220, 0.30) !important;
}

/* Иконка слева внутри капсулы — приглушаем размер чтобы текст вёл */
#globalTopbar .topbar-btn-icon {
    font-size: 13px !important;
    line-height: 1 !important;
    filter: none !important;
    opacity: 0.85;
}

/* ── Settings + Logout: квадратные иконки ── */
#globalTopbar .topbar-icon-group {
    gap: 4px !important;
    margin-left: 4px !important;
}
#globalTopbar .topbar-icon-group > .settings-gear-btn {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    background: #1c2618 !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    border-radius: 4px !important;     /* одинаковый radius на всех углах */
    color: #d4dcc4 !important;
    font-size: 16px !important;
    transition: background 0.12s, border-color 0.12s, color 0.12s !important;
    box-shadow: none !important;
}
#globalTopbar .topbar-icon-group > .settings-gear-btn:hover {
    background: #243020 !important;
    border-color: rgba(150, 200, 80, 0.30) !important;
    color: #ffffff !important;
}
#globalTopbar .topbar-icon-group > .topbar-logout-btn {
    color: #d88060 !important;
    border-left: 1px solid rgba(120, 160, 60, 0.18) !important;  /* override segmented-control */
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}
#globalTopbar .topbar-icon-group > .topbar-logout-btn:hover {
    color: #ff8866 !important;
    border-color: rgba(220, 100, 80, 0.45) !important;
}
#globalTopbar .topbar-icon-group > .settings-gear-btn:first-child {
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

/* Bonus badge на missions — переоформление чтобы не царапало глаз */
#globalTopbar .topbar-btn-badge {
    background: #c84030 !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-size: 9px !important;
    min-width: 16px !important;
    height: 16px !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ TOPBAR v3 fine-tuning ▼
   • Missions / Settings / Logout — серый подтон вместо оливкового.
     Crystals и HoF остаются золотыми (валюта + достижения), Hangar
     синим (информация о возврате в гараж), а вспомогательные кнопки
     становятся нейтрально-серыми.
   • Центрирование текста в капсулах: 3px left-border ел padding-left
     и текст уезжал вправо. Компенсируем padding-left = 14 - 3 = 11.
   ════════════════════════════════════════════════════════════════ */

/* Симметричный padding с учётом 3px LEFT-border'а */
#globalTopbar > .topbar-btn {
    padding-left: 11px !important;
    padding-right: 14px !important;
}

/* Серая палитра для нейтральных кнопок */
#globalTopbar > .topbar-btn-missions {
    background: #1d2126 !important;
    border-color: rgba(160, 170, 180, 0.18) !important;
    border-left-color: rgba(160, 170, 180, 0.45) !important;
    color: #c0c8d0 !important;
}
#globalTopbar > .topbar-btn-missions:hover {
    background: #252a30 !important;
    border-color: rgba(180, 190, 200, 0.30) !important;
}

#globalTopbar .topbar-icon-group > .settings-gear-btn {
    background: #1d2126 !important;
    border-color: rgba(160, 170, 180, 0.18) !important;
    color: #c0c8d0 !important;
}
#globalTopbar .topbar-icon-group > .settings-gear-btn:hover {
    background: #252a30 !important;
    border-color: rgba(180, 190, 200, 0.30) !important;
    color: #ffffff !important;
}
/* Logout оставляем красноватый акцент (отличает от шестерёнки) —
   только фон тоже серый. */
#globalTopbar .topbar-icon-group > .topbar-logout-btn {
    background: #1d2126 !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ ANGAR / HANGAR — INTEGRATED UI ▼
   Подгоняем гараж под ту же концепцию что и главное меню:
   • НЕТ floating-карточек (.hangar-side, .hangar-bottom-bar)
   • Шапка гаража интегрирована в общий topbar (наш #globalTopbar
     уже сверху, внутренний .hangar-topbar теряет свой backdrop)
   • Фон гаража — единый dark-зелёный (как меню), внутренний 3D
     танк-canvas рендерится без внешних рамок
   • Контраст оставляем только на интерактивных item-card'ах
   ════════════════════════════════════════════════════════════════ */

/* Внутренний hangar-topbar — теперь без подложки. Глобальный topbar
   сверху уже даёт визуальное обрамление. Внутренний — только функциональные
   элементы (back-кнопка, заголовок, consumables strip). */
#garageScreen .hangar-topbar {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Back-button в стиле новых топбар-кнопок (серый акцент). */
#garageScreen .hangar-back-btn {
    height: 36px !important;
    padding: 0 14px !important;
    background: #1d2126 !important;
    border: 1px solid rgba(160, 170, 180, 0.18) !important;
    border-left: 3px solid rgba(160, 170, 180, 0.45) !important;
    border-radius: 4px !important;
    color: #c0c8d0 !important;
    font-size: 11px !important;
    letter-spacing: 1.2px !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}
#garageScreen .hangar-back-btn:hover {
    background: #252a30 !important;
    border-color: rgba(180, 190, 200, 0.30) !important;
    color: #ffffff !important;
}

/* Внутренний hangar title — приглушаем (АНГАР дублируется со статусом
   приложения; убирать совсем стрёмно — нужен для выравнивания layout). */
#garageScreen .hangar-title {
    color: #a8c280 !important;
    font-size: 14px !important;
    letter-spacing: 4px !important;
    text-shadow: none !important;
}

/* Side panels (КОРПУС / БАШНЯ) — теряют card-look. */
#garageScreen .hangar-side {
    background: rgba(20, 28, 14, 0.65) !important;     /* лёгкая тёмная полупрозрачность */
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}
/* Левый panel — тонкий вертикальный divider справа */
#garageScreen .hangar-left {
    border-right: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Правый panel — тонкий вертикальный divider слева */
#garageScreen .hangar-right {
    border-left: 1px solid rgba(120, 160, 60, 0.18) !important;
}

/* Panel-title (КОРПУС, БАШНЯ, СКИНЫ) — без своего фона/бордера, просто
   текстовый заголовок с тонкой линией снизу. */
#garageScreen .hangar-panel-title {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.18) !important;
    color: #a8c280 !important;
    font-size: 11px !important;
    letter-spacing: 2.5px !important;
    text-shadow: none !important;
    padding: 12px 14px 10px !important;
    text-align: left !important;
}

/* Bottom bar (СКИНЫ) — теряет gradient overlay. */
#garageScreen .hangar-bottom-bar {
    background: rgba(20, 28, 14, 0.65) !important;
    border-top: 1px solid rgba(120, 160, 60, 0.18) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    padding-top: 0 !important;
}
#garageScreen .hangar-bottom-bar .hangar-panel-title {
    border-bottom: none !important;
    padding: 8px 14px 6px !important;
}

/* Item-card — единственное визуально контрастное в новом UI.
   Hover/selected более выражено, чтобы было понятно что кликабельно. */
#garageScreen .item-card {
    background: rgba(10, 14, 8, 0.55) !important;
    border: 1px solid rgba(120, 160, 60, 0.10) !important;
    border-radius: 4px !important;
}
#garageScreen .item-card:hover {
    background: rgba(15, 22, 10, 0.75) !important;
    border-color: rgba(150, 200, 80, 0.35) !important;
}
#garageScreen .item-card.selected,
#garageScreen .item-card.equipped {
    background: rgba(40, 60, 22, 0.55) !important;
    border-color: rgba(180, 220, 100, 0.50) !important;
}

/* Stats divider тонкий и спокойный */
#garageScreen .hangar-stats-divider {
    background: rgba(120, 160, 60, 0.18) !important;
    margin: 8px 14px !important;
}

/* Consumables strip — тёмная плашка пропадает, иконки на чистом фоне */
#garageScreen .hangar-consumables-strip .hangar-panel-title {
    color: rgba(168, 194, 128, 0.70) !important;
    border-bottom: none !important;
    padding: 0 !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ HANGAR — LAYOUT v9 ▼
   • Превью на ВСЮ высоту (от топбара до низа)
   • Табы сдвинуты вправо (left = ширина превью)
   • Припасы — интегрированный правый столбец без card-look,
     отделён только тонкой линией
   • Реальный фон ангара (рендерится Garage._drawHangarScene)
   ════════════════════════════════════════════════════════════════ */

body:has(#garageScreen.active) #globalTopbar {
    background: linear-gradient(180deg,
        rgba(28,38,22,0.92) 0%,
        rgba(20,28,14,0.96) 100%) !important;
    border-bottom: 1px solid rgba(120,160,60,0.22) !important;
    box-shadow: 0 2px 18px rgba(0,0,0,0.35) !important;
}

#garageScreen { background: #0a0e07; }
#garageScreen .hangar-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, #0c1208 0%, #060a04 100%);
}
#garageScreen > canvas#hangarCanvas { display: none; }

#garageScreen {
    --hangar-side-w: 360px;
    --hangar-supplies-w: 240px;
    --hangar-bottom-h: 200px;
}

#garageScreen .hangar-panel {
    position: absolute;
    top: var(--topbar-h, 66px);
    left: 0; right: 0; bottom: 0;
    z-index: 11;
}

/* === АРЕНА с танком — центральная зона, без рамок === */
#garageScreen .hangar-arena {
    position: absolute;
    top: 0;
    left: var(--hangar-side-w);
    right: var(--hangar-supplies-w);
    bottom: var(--hangar-bottom-h);
    z-index: 1;
    overflow: hidden;
    background: transparent;  /* фон рисует Garage._drawHangarScene в canvas */
}
#garageScreen .hangar-arena canvas#hangarCanvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    display: block !important;
}

/* === ЛЕВЫЙ САЙДБАР: превью НА ВСЮ ВЫСОТУ === */
#garageScreen .hangar-preview-zone {
    position: absolute;
    top: 0; left: 0;
    bottom: 0;                     /* до самого низа */
    width: var(--hangar-side-w);
    z-index: 3;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg,
        rgba(20,28,14,0.94) 0%,
        rgba(12,18,8,0.97) 100%);
    border-right: 1px solid rgba(120,160,60,0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}
#garageScreen .hangar-preview-header {
    flex-shrink: 0;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(120,160,60,0.18);
}

#garageScreen .hangar-back-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px 0 14px;
    background: linear-gradient(180deg,
        rgba(80,120,40,0.55) 0%,
        rgba(60,95,28,0.70) 100%);
    border: 1px solid rgba(150,200,80,0.45);
    border-left: 3px solid #b4dc64;
    border-radius: 4px;
    color: #e6f0c8;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 12px;
    letter-spacing: 2.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(180,220,100,0.18);
}
#garageScreen .hangar-back-btn:hover {
    background: linear-gradient(180deg,
        rgba(100,150,50,0.7) 0%,
        rgba(75,120,35,0.85) 100%);
    border-color: rgba(180,220,100,0.65);
    color: #ffffff;
    transform: translateX(-2px);
    box-shadow: 0 3px 12px rgba(80,140,40,0.35), inset 0 1px 0 rgba(180,220,100,0.25);
}
#garageScreen .hangar-back-arrow {
    font-size: 14px;
    color: #b4dc64;
    line-height: 1;
    transition: transform 0.15s;
}
#garageScreen .hangar-back-btn:hover .hangar-back-arrow {
    transform: translateX(-3px);
}

#garageScreen .hangar-preview-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,160,60,0.35) transparent;
}
#garageScreen .hangar-preview-headline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
#garageScreen .hangar-preview-name {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 22px;
    letter-spacing: 1.5px;
    color: #e6f0c8;
}
#garageScreen .hangar-preview-stars {
    font-size: 14px;
    color: #ffcc44;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255,200,80,0.4);
}
#garageScreen .hangar-preview-desc {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(168,194,128,0.78);
    margin: 6px 0 14px;
    min-height: 2.8em;
}
#garageScreen .hangar-preview-stats {
    padding-top: 12px;
    border-top: 1px solid rgba(120,160,60,0.18);
}
#garageScreen .hangar-preview-stats .hangar-pane-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 9.5px;
    letter-spacing: 2.5px;
    color: rgba(168,194,128,0.6);
    margin: 0 0 6px;
}
#garageScreen .hangar-preview-stats .tank-stats {
    padding: 0;
    width: 100%;
}

#garageScreen .hangar-preview-actions {
    flex-shrink: 0;
    padding: 12px 20px 18px;
    border-top: 1px solid rgba(120,160,60,0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(8,12,5,0.45);
}
#garageScreen .hangar-preview-action,
#garageScreen .hangar-preview-upgrade {
    appearance: none;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border-radius: 4px;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 12.5px;
    letter-spacing: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    background: rgba(40,50,30,0.55);
    color: rgba(168,194,128,0.7);
    border-color: rgba(120,160,60,0.25);
}
#garageScreen .hangar-preview-action.is-equip {
    background: linear-gradient(180deg, rgba(80,140,40,0.85), rgba(60,110,30,0.9));
    border-color: rgba(140,200,60,0.6);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(80,140,40,0.4), inset 0 1px 0 rgba(180,220,100,0.3);
}
#garageScreen .hangar-preview-action.is-equip:hover {
    background: linear-gradient(180deg, rgba(100,160,50,0.95), rgba(75,130,35,1));
    transform: translateY(-1px);
}
#garageScreen .hangar-preview-action.is-equipped {
    background: rgba(40,60,22,0.6);
    border-color: rgba(180,220,100,0.45);
    color: #b4dc64;
    cursor: default;
}
#garageScreen .hangar-preview-action.is-buy {
    background: linear-gradient(180deg, rgba(180,140,40,0.9), rgba(140,100,20,0.95));
    border-color: rgba(220,180,80,0.6);
    color: #fff8d8;
    box-shadow: 0 2px 10px rgba(180,140,40,0.4), inset 0 1px 0 rgba(255,220,140,0.3);
}
#garageScreen .hangar-preview-action.is-buy:hover {
    background: linear-gradient(180deg, rgba(210,160,55,1), rgba(160,115,25,1));
    transform: translateY(-1px);
}
#garageScreen .hangar-preview-action.is-locked {
    background: rgba(60,30,20,0.55);
    border-color: rgba(170,80,60,0.4);
    color: rgba(220,140,100,0.7);
    cursor: not-allowed;
}
#garageScreen .hangar-preview-action:disabled,
#garageScreen .hangar-preview-upgrade:disabled { cursor: default; }
#garageScreen .hangar-preview-action:disabled:not(.is-equipped):not(.is-locked) { opacity: 0.6; }
#garageScreen .hangar-preview-upgrade {
    height: 36px;
    font-size: 11.5px;
    background: linear-gradient(180deg, rgba(120,80,180,0.7), rgba(90,60,140,0.85));
    border-color: rgba(170,130,220,0.5);
    color: #f0e0ff;
    box-shadow: 0 2px 8px rgba(120,80,180,0.3), inset 0 1px 0 rgba(200,170,240,0.25);
}
#garageScreen .hangar-preview-upgrade:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(140,95,200,0.85), rgba(105,70,160,0.95));
    transform: translateY(-1px);
}
#garageScreen .hangar-preview-upgrade:disabled {
    background: rgba(40,40,55,0.5);
    border-color: rgba(110,100,140,0.3);
    color: rgba(180,170,210,0.55);
    box-shadow: none;
}

/* === ПРИПАСЫ — ИНТЕГРИРОВАННЫЙ правый столбец, без card-look === */
#garageScreen .hangar-supplies-zone {
    position: absolute;
    top: 0; right: 0;
    bottom: var(--hangar-bottom-h);
    width: var(--hangar-supplies-w);
    z-index: 3;
    display: flex;
    flex-direction: column;
    background: transparent;        /* интегрировано с ареной */
    border-left: 1px solid rgba(120,160,60,0.22);  /* только тонкая граница */
    overflow: hidden;
}
#garageScreen .hangar-supplies-zone .hangar-zone-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(168,194,128,0.75);
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(120,160,60,0.18);
    background: transparent;
    flex-shrink: 0;
}
#garageScreen .consumable-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-wrap: nowrap;
    padding: 12px 14px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,160,60,0.35) transparent;
}
#garageScreen .consumable-cards-vertical .consumable-card {
    width: 100%;
    flex: 0 0 auto;
    padding: 8px 10px 8px 34px;
    background: rgba(8,12,5,0.45);
    border: 1px solid rgba(120,160,60,0.18);
    border-radius: 4px;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 8px;
    position: relative;
}
#garageScreen .consumable-cards-vertical .consumable-card .cc-key {
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    font-size: 10px;
    padding: 1px 4px;
}
#garageScreen .consumable-cards-vertical .consumable-card .cc-icon {
    width: 22px; height: 22px;
    font-size: 17px;
    flex-shrink: 0;
}
#garageScreen .consumable-cards-vertical .consumable-card .cc-name {
    font-size: 10.5px;
    flex: 1;
    text-align: left;
}
#garageScreen .consumable-cards-vertical .consumable-card .cc-count {
    font-size: 12px;
    margin: 0;
}
#garageScreen .consumable-cards-vertical .consumable-card .cc-buy {
    width: auto;
    margin: 0;
    padding: 2px 7px;
    font-size: 10px;
}

/* === НИЖНЯЯ ПОЛОСА: табы + горизонтальный ряд карточек.
   Сдвинута вправо — стартует ПОСЛЕ левого превью-сайдбара === */
#garageScreen .hangar-bottom {
    position: absolute;
    bottom: 0;
    left: var(--hangar-side-w);
    right: 0;
    height: var(--hangar-bottom-h);
    z-index: 4;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg,
        rgba(8,12,6,0.0) 0%,
        rgba(14,20,9,0.92) 18%,
        rgba(10,14,7,0.98) 100%);
    border-top: 1px solid rgba(120,160,60,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.55);
}
#garageScreen .hangar-bottom .hangar-tabs {
    display: flex;
    align-items: stretch;
    height: 44px;
    background: rgba(8,12,5,0.55);
    border-bottom: 1px solid rgba(120,160,60,0.22);
    flex-shrink: 0;
    padding: 0 18px;
}
#garageScreen .hangar-tab {
    appearance: none;
    background: transparent;
    border: none;
    color: rgba(168,194,128,0.55);
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 3px;
    padding: 0 26px;
    cursor: pointer;
    position: relative;
    transition: color 0.15s, background 0.15s;
}
#garageScreen .hangar-tab:hover { color: #c8d8a8; background: rgba(80,120,40,0.10); }
#garageScreen .hangar-tab.active { color: #e6f0c8; }
#garageScreen .hangar-tab.active::after {
    content: "";
    position: absolute;
    left: 22px; right: 22px; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b4dc64 20%, #b4dc64 80%, transparent);
    box-shadow: 0 0 10px rgba(180,220,100,0.6);
}

#garageScreen .hangar-bottom .hangar-cards-pane {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 14px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,160,60,0.35) transparent;
}
#garageScreen .hangar-cards-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    height: 100%;
    align-items: stretch;
}
#garageScreen .hangar-cards-row.hangar-pane-hidden { display: none !important; }

#garageScreen .hangar-cards-row .item-card {
    flex: 0 0 150px;
    width: 150px;
    background: rgba(15,22,10,0.7);
    border: 1px solid rgba(120,160,60,0.18);
    border-radius: 5px;
    padding: 10px;
    margin: 0;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}
#garageScreen .hangar-cards-row .item-card:hover {
    background: rgba(25,35,14,0.85);
    border-color: rgba(150,200,80,0.45);
    transform: translateY(-2px);
}
#garageScreen .hangar-cards-row .item-card.is-focused {
    border-color: #6cc4ff;
    background: rgba(15,30,40,0.55);
    box-shadow: inset 0 0 0 1px rgba(108,196,255,0.25);
}
#garageScreen .hangar-cards-row .item-card.selected,
#garageScreen .hangar-cards-row .item-card.equipped {
    border-color: #b4dc64;
    background: rgba(40,60,22,0.55);
    box-shadow: inset 0 0 0 1px rgba(180,220,100,0.30);
}
#garageScreen .hangar-cards-row .item-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}
#garageScreen .hangar-cards-row .item-card canvas {
    width: 86px !important;
    height: 54px !important;
    border-radius: 3px;
    background: rgba(0,0,0,0.40);
    border: 1px solid rgba(80,120,40,0.20);
}
#garageScreen .hangar-cards-row .item-card-info { width: 100%; }
#garageScreen .hangar-cards-row .item-card h4 {
    font-size: 12px;
    margin: 0 0 2px;
    color: #d8e8b8;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#garageScreen .hangar-cards-row .item-card .turret-level-stars {
    color: rgba(255,200,80,0.6);
    font-size: 9px;
    letter-spacing: 0.5px;
}
#garageScreen .hangar-cards-row .item-card p,
#garageScreen .hangar-cards-row .item-card .upgrade-bonus,
#garageScreen .hangar-cards-row .item-card .upgrade-max { display: none; }
#garageScreen .hangar-cards-row .item-card .locked-text {
    display: block;
    color: #cc7755;
    font-size: 9.5px;
    letter-spacing: 0.3px;
}
#garageScreen .hangar-cards-row .item-card .buy-btn,
#garageScreen .hangar-cards-row .item-card .equip-btn,
#garageScreen .hangar-cards-row .item-card .upgrade-btn { display: none !important; }

@media (max-width: 1280px) {
    #garageScreen { --hangar-side-w: 320px; --hangar-supplies-w: 220px; }
}
@media (max-width: 1024px) {
    #garageScreen { --hangar-side-w: 290px; --hangar-supplies-w: 200px; --hangar-bottom-h: 180px; }
}

/* ─── v9.1 — карточки красивее, корнер-бейджи ─── */

/* Карточки с градиентом и более выраженным hover */
#garageScreen .hangar-cards-row .item-card {
    background:
        linear-gradient(180deg, rgba(28,38,18,0.85) 0%, rgba(12,18,8,0.92) 100%);
    position: relative;
    overflow: hidden;
    padding: 10px 10px 12px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
#garageScreen .hangar-cards-row .item-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 70%;
    background: radial-gradient(ellipse at 50% 0%, rgba(180,220,100,0.06) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: 0;
}
#garageScreen .hangar-cards-row .item-card-inner { position: relative; z-index: 1; }

/* Иконка крупнее, с лёгким свечением снизу */
#garageScreen .hangar-cards-row .item-card canvas {
    width: 110px !important;
    height: 64px !important;
    border-radius: 4px !important;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(80,120,40,0.18) 0%, rgba(0,0,0,0.5) 70%) !important;
    border: 1px solid rgba(120,160,60,0.30) !important;
    margin: 4px 0 6px;
}

/* Имя — ярче и крупнее */
#garageScreen .hangar-cards-row .item-card h4 {
    font-family: 'Black Ops One', 'Impact', sans-serif !important;
    font-size: 12.5px !important;
    color: #e6f0c8 !important;
    letter-spacing: 0.8px !important;
    margin-top: 2px !important;
}

/* Звёзды башен крупнее и заметнее */
#garageScreen .hangar-cards-row .item-card .turret-level-stars {
    color: #ffcc44 !important;
    font-size: 11px !important;
    letter-spacing: 1px !important;
    text-shadow: 0 0 6px rgba(255,200,80,0.5) !important;
    display: block;
    margin-top: 2px;
}

/* === КОРНЕР-БЕЙДЖИ === */
/* Цена покупки — золотой пилл в правом верхнем углу.
   Показываем кнопку buy-btn как бейдж (не интерактивный). */
#garageScreen .hangar-cards-row .item-card .buy-btn {
    display: inline-block !important;
    position: absolute;
    top: 6px; right: 6px;
    padding: 2px 7px !important;
    font-size: 10px !important;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(220,170,55,0.92), rgba(170,125,30,0.95)) !important;
    color: #fff8d8 !important;
    border: 1px solid rgba(240,200,100,0.6) !important;
    border-radius: 10px !important;
    pointer-events: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,220,140,0.3);
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Лок-бейдж для locked */
#garageScreen .hangar-cards-row .item-card.locked::before {
    background: rgba(0,0,0,0.45);
    height: 100%;
}
#garageScreen .hangar-cards-row .item-card .locked-text {
    display: inline-block !important;
    position: absolute;
    top: 6px; right: 6px;
    padding: 2px 7px !important;
    font-size: 9.5px !important;
    background: rgba(80,30,20,0.85) !important;
    color: #ffaa88 !important;
    border: 1px solid rgba(180,90,60,0.6) !important;
    border-radius: 10px !important;
    letter-spacing: 0.3px;
    z-index: 2;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Чек-бейдж для экипированного — небольшая зелёная метка */
#garageScreen .hangar-cards-row .item-card.selected::after,
#garageScreen .hangar-cards-row .item-card.equipped::after {
    content: "✓";
    position: absolute;
    top: 4px; right: 6px;
    width: 20px; height: 20px;
    line-height: 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(120,200,40,0.95), rgba(80,160,30,1));
    color: #ffffff;
    font-weight: 900;
    font-size: 12px;
    border-radius: 50%;
    border: 1px solid rgba(180,220,100,0.7);
    box-shadow: 0 2px 6px rgba(80,140,40,0.5);
    z-index: 3;
}

/* Hover-эффект сильнее */
#garageScreen .hangar-cards-row .item-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 14px rgba(0,0,0,0.5), 0 0 0 1px rgba(150,200,80,0.25);
}

/* Sync hangar-back-btn (МЕНЮ) с прежним стилем не трогаем */

/* ─── v9.3 — палитра ангара = палитра главного меню ─── */
/* Подложка ангара (фон тоев же экрана за зонами) — как у меню */
#garageScreen .hangar-bg {
    background:
        radial-gradient(ellipse at top, rgba(50, 70, 30, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(28, 38, 22, 0.88) 0%, rgba(20, 28, 14, 0.92) 100%) !important;
}
/* Превью-сайдбар — та же зелёно-оливковая палитра, не темнее меню */
#garageScreen .hangar-preview-zone {
    background: linear-gradient(180deg,
        rgba(28, 38, 22, 0.88) 0%,
        rgba(20, 28, 14, 0.92) 100%) !important;
    border-right: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Нижняя полоса — та же палитра, без тёмного "уплотнения" снизу */
#garageScreen .hangar-bottom {
    background: linear-gradient(180deg,
        rgba(28, 38, 22, 0.88) 0%,
        rgba(20, 28, 14, 0.92) 100%) !important;
    border-top: 1px solid rgba(120, 160, 60, 0.18) !important;
    box-shadow: none !important;
}
/* Заголовок-полоса табов внутри bottom-strip — лёгкая подсветка как
   у menu-panel-title, без своей тёмной подложки */
#garageScreen .hangar-bottom .hangar-tabs {
    background: transparent !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Припасы остаются прозрачными, тонкая разделительная линия в палитре меню */
#garageScreen .hangar-supplies-zone {
    border-left: 1px solid rgba(120, 160, 60, 0.18) !important;
}
#garageScreen .hangar-supplies-zone .hangar-zone-title {
    border-bottom: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Кнопки-блок снизу превью — лёгкое затемнение в той же гамме */
#garageScreen .hangar-preview-actions {
    background: rgba(20, 28, 14, 0.35) !important;
    border-top: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Шапка превью с кнопкой В МЕНЮ — её border-bottom в той же палитре */
#garageScreen .hangar-preview-header {
    border-bottom: 1px solid rgba(120, 160, 60, 0.18) !important;
}
/* Stats-разделитель в превью */
#garageScreen .hangar-preview-stats {
    border-top-color: rgba(120, 160, 60, 0.18) !important;
}

/* ─── v9.4 — палитра глубже + полная переработка ПРИПАСОВ ─── */

/* Палитра ангара/меню на ~7% темнее: rgb(28,38,22)→(25,34,19),
   rgb(20,28,14)→(17,24,12). Применяем и к меню, и к зонам ангара,
   чтобы не разъезжаться. */
#mainMenu.active {
    background:
        radial-gradient(ellipse at top, rgba(46, 64, 28, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(25, 34, 19, 0.92) 0%, rgba(17, 24, 12, 0.96) 100%) !important;
}
#garageScreen .hangar-bg {
    background:
        radial-gradient(ellipse at top, rgba(46, 64, 28, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(25, 34, 19, 0.92) 0%, rgba(17, 24, 12, 0.96) 100%) !important;
}
#garageScreen .hangar-preview-zone {
    background: linear-gradient(180deg,
        rgba(25, 34, 19, 0.92) 0%,
        rgba(17, 24, 12, 0.96) 100%) !important;
}
#garageScreen .hangar-bottom {
    background: linear-gradient(180deg,
        rgba(25, 34, 19, 0.92) 0%,
        rgba(17, 24, 12, 0.96) 100%) !important;
}
body:has(#garageScreen.active) #globalTopbar {
    background: linear-gradient(180deg,
        rgba(25, 34, 19, 0.94) 0%,
        rgba(17, 24, 12, 0.98) 100%) !important;
}

/* ════════════════════════════════════════════════════════════════
   ▼ ПРИПАСЫ — полная переработка карточек ▼
   Вертикальная компоновка: header (key + name + count),
   крупная иконка по центру, единая кнопка покупки внизу.
   Свои SVG-иконки.
   ════════════════════════════════════════════════════════════════ */

#garageScreen .hangar-supplies-zone .hangar-zone-title {
    padding: 14px 18px 10px !important;
    font-size: 11px !important;
    letter-spacing: 3px !important;
    color: rgba(168,194,128,0.80) !important;
}
#garageScreen .hangar-supplies-zone .hangar-panel-subtitle {
    color: rgba(168,194,128,0.40) !important;
    font-weight: normal;
    font-size: 9.5px;
    letter-spacing: 1px;
    margin-left: 4px;
}

#garageScreen .consumable-cards-vertical {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px 12px 14px !important;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,160,60,0.30) transparent;
}

/* Карточка — полностью переписана, без старого «padding-left:38px» layout'а */
#garageScreen .consumable-cards-vertical .consumable-card {
    all: unset;
    display: grid !important;
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 10px 12px 10px !important;
    background: linear-gradient(180deg,
        rgba(30, 40, 20, 0.55) 0%,
        rgba(15, 22, 10, 0.70) 100%) !important;
    border: 1px solid rgba(120,160,60,0.16) !important;
    border-radius: 6px !important;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25), inset 0 1px 0 rgba(180,220,100,0.04);
    transition: border-color 0.15s, transform 0.15s;
    box-sizing: border-box;
}
#garageScreen .consumable-cards-vertical .consumable-card:hover {
    border-color: rgba(150,200,80,0.30) !important;
}

/* HEADER ROW: hotkey + name + count */
#garageScreen .consumable-cards-vertical .cc-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
#garageScreen .consumable-cards-vertical .cc-key {
    /* перекрываем абсолютные позиции из старого CSS */
    position: static !important;
    transform: none !important;
    top: auto !important; left: auto !important;
    flex-shrink: 0;
    width: 22px; height: 22px;
    line-height: 22px;
    text-align: center;
    background: rgba(80,120,40,0.20);
    border: 1px solid rgba(150,200,80,0.30);
    color: #d8e8b0;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 0 !important;
}
#garageScreen .consumable-cards-vertical .cc-name {
    flex: 1;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 12.5px !important;
    letter-spacing: 1.5px;
    color: #e0eac0 !important;
    text-align: left !important;
}
#garageScreen .consumable-cards-vertical .cc-count {
    flex-shrink: 0;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px !important;
    color: #ffcc55 !important;
    letter-spacing: 0.5px;
    margin: 0 !important;
    min-width: 28px;
    text-align: right;
}
#garageScreen .consumable-cards-vertical .cc-count[data-zero="true"] {
    color: rgba(180,180,180,0.45) !important;
}

/* ICON BOX — SVG в центре */
#garageScreen .consumable-cards-vertical .cc-icon-box {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center,
        rgba(80,110,45,0.18) 0%,
        rgba(8,14,5,0) 70%);
    border-radius: 4px;
}
#garageScreen .consumable-cards-vertical .cc-icon-box svg {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* BUY BUTTON */
#garageScreen .consumable-cards-vertical .cc-buy {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg,
        rgba(80,130,38,0.85) 0%,
        rgba(55,95,22,0.92) 100%) !important;
    border: 1px solid rgba(140,200,60,0.55) !important;
    border-radius: 4px !important;
    color: #ffffff !important;
    font-family: 'Black Ops One', 'Impact', sans-serif !important;
    font-size: 11.5px !important;
    letter-spacing: 1px !important;
    cursor: pointer;
    transition: all 0.12s !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(180,220,100,0.25);
}
#garageScreen .consumable-cards-vertical .cc-buy:hover:not(:disabled) {
    background: linear-gradient(180deg,
        rgba(100,160,50,0.95) 0%,
        rgba(70,120,30,1) 100%) !important;
    transform: translateY(-1px);
}
#garageScreen .consumable-cards-vertical .cc-buy:disabled {
    background: rgba(40,55,25,0.55) !important;
    border-color: rgba(120,150,80,0.25) !important;
    color: rgba(200,200,200,0.5) !important;
    cursor: default;
    box-shadow: none;
}
#garageScreen .consumable-cards-vertical .cc-buy-plus {
    color: #ffffff;
    font-weight: 800;
}
#garageScreen .consumable-cards-vertical .cc-buy-cost {
    color: #ffe6a0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
#garageScreen .consumable-cards-vertical .cc-buy-cost .cc-cry {
    color: #c084ff;
    font-size: 12px;
}

/* ─── v9.5 — компактные карточки припасов (без скролла) ─── */

/* Сами карточки — две строки: основная info + кнопка */
#garageScreen .consumable-cards-vertical .consumable-card {
    grid-template-rows: auto auto !important;
    gap: 6px !important;
    padding: 8px 10px !important;
}
/* Скрываем старый отдельный icon-box (теперь иконка живёт в .cc-row) */
#garageScreen .consumable-cards-vertical .cc-head { display: none !important; }

/* Основная строка: key + icon + name + count в один ряд */
#garageScreen .consumable-cards-vertical .cc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
#garageScreen .consumable-cards-vertical .cc-row .cc-key {
    flex-shrink: 0;
    width: 20px; height: 20px;
    line-height: 20px;
    text-align: center;
    background: rgba(80,120,40,0.20);
    border: 1px solid rgba(150,200,80,0.30);
    color: #d8e8b0;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 3px;
    padding: 0 !important;
    position: static !important;
    transform: none !important;
}
#garageScreen .consumable-cards-vertical .cc-row .cc-icon-box {
    width: 28px; height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(80,110,45,0.20) 0%, rgba(8,14,5,0) 75%);
    border-radius: 4px;
}
#garageScreen .consumable-cards-vertical .cc-row .cc-icon-box svg {
    width: 24px; height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
#garageScreen .consumable-cards-vertical .cc-row .cc-name {
    flex: 1;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11.5px !important;
    letter-spacing: 1px;
    color: #e0eac0 !important;
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#garageScreen .consumable-cards-vertical .cc-row .cc-count {
    flex-shrink: 0;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 12px !important;
    color: #ffcc55 !important;
    margin: 0 !important;
    min-width: 26px;
    text-align: right;
    position: static !important;
    transform: none !important;
}
#garageScreen .consumable-cards-vertical .cc-row .cc-count[data-zero="true"] {
    color: rgba(180,180,180,0.4) !important;
}

/* Кнопка покупки — компактнее */
#garageScreen .consumable-cards-vertical .cc-buy {
    height: 28px !important;
    font-size: 11px !important;
    gap: 8px;
}

/* Контейнер припасов: помещаемся без скролла, gaps меньше */
#garageScreen .consumable-cards-vertical {
    gap: 6px !important;
    padding: 10px 12px !important;
    overflow-y: hidden !important;
}


/* ─── XP-шкала в бою: серый трек, чтоб не сливался ни с чёрным, ни с прозрачным ─── */
/* В бою XP-шкала такая же как в меню (#0e1408 трек + olive border),
   только с прозрачностью чтобы не перекрывала рендер боя. */
body.in-battle #globalTopbar > .topbar-xpbar {
    display: flex !important;
    background: rgba(14, 20, 8, 0.55) !important;
    border: 1px solid rgba(120, 160, 60, 0.18) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
/* Заполненная часть остаётся как есть (градиент XP-fill) */

/* ─── Force-password-change modal ─── */
#forcePwdModal {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
#forcePwdModal .fpm-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#forcePwdModal .fpm-card {
    position: relative;
    width: 360px;
    max-width: 90vw;
    background: linear-gradient(180deg, rgba(28,38,22,0.98) 0%, rgba(17,24,12,1) 100%);
    border: 1px solid rgba(120,160,60,0.30);
    border-radius: 8px;
    padding: 24px 26px 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
#forcePwdModal .fpm-title {
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 18px;
    letter-spacing: 3px;
    color: #e6f0c8;
    text-align: center;
    margin-bottom: 8px;
}
#forcePwdModal .fpm-sub {
    font-size: 12px;
    color: rgba(168,194,128,0.75);
    line-height: 1.45;
    margin-bottom: 16px;
    text-align: center;
}
#forcePwdModal .fpm-input {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    margin-bottom: 10px;
    background: rgba(8,12,5,0.6);
    border: 1px solid rgba(120,160,60,0.30);
    border-radius: 4px;
    color: #e6f0c8;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}
#forcePwdModal .fpm-input:focus {
    border-color: rgba(180,220,100,0.55);
}
#forcePwdModal .fpm-error {
    color: #ee7755;
    font-size: 11.5px;
    min-height: 16px;
    margin: 4px 0 8px;
    text-align: center;
}
#forcePwdModal .fpm-submit {
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg, rgba(80,140,40,0.85), rgba(60,110,30,0.9));
    border: 1px solid rgba(140,200,60,0.6);
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 10px rgba(80,140,40,0.4), inset 0 1px 0 rgba(180,220,100,0.3);
}
#forcePwdModal .fpm-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(100,160,50,0.95), rgba(75,130,35,1));
    transform: translateY(-1px);
}
#forcePwdModal .fpm-submit:disabled { opacity: 0.6; cursor: default; }

/* Зал славы — экран начинается ПОД топбаром (top:topbar-h),
   а не с padding-top. Так sticky-header прилипает к самому верху
   экрана = впритык к нижней кромке топбара, без зазора. */
body:not(.topbar-hidden) #globalLeaderboardScreen.glb-screen {
    top: var(--topbar-h) !important;
    height: calc(100% - var(--topbar-h)) !important;
    padding-top: 0 !important;
}
body:not(.topbar-hidden) #globalLeaderboardScreen.glb-screen .glb-header {
    top: 0 !important;
}

/* Зал славы — подложка глобальной шапки (палитра меню/ангара).
   Используем body-class screen-globalLeaderboardScreen (стабильнее :has). */
body.screen-globalLeaderboardScreen #globalTopbar {
    background: linear-gradient(180deg,
        rgba(25, 34, 19, 0.94) 0%,
        rgba(17, 24, 12, 0.98) 100%) !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.22) !important;
    box-shadow: 0 2px 18px rgba(0,0,0,0.35) !important;
}

/* Зал славы — собственный sticky-заголовок получает свою подложку
   и тонкую разделительную линию снизу, чтобы читался как отдельный
   слой под глобальной шапкой, а не сливался с фоном экрана */
#globalLeaderboardScreen.glb-screen .glb-header {
    background: linear-gradient(180deg,
        rgba(25, 34, 19, 0.85) 0%,
        rgba(17, 24, 12, 0.92) 100%);
    border-bottom: 1px solid rgba(120, 160, 60, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════════════════════════════
   ▼ ЗАЛ СЛАВЫ — интегрированный вид (как меню/ангар) ▼
   • Палитра rgba(25,34,19) → (17,24,12) — единая с меню
   • Никаких card-look рамок/теней на таблице — flat surface
   • Кнопка В МЕНЮ — оливковая с акцентной полосой слева, как в ангаре
   • Заголовок остаётся gold (это hero-элемент)
   ════════════════════════════════════════════════════════════════ */

#globalLeaderboardScreen.glb-screen {
    background:
        radial-gradient(ellipse at top, rgba(50, 70, 30, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(25, 34, 19, 0.92) 0%, rgba(17, 24, 12, 0.96) 100%) !important;
}

/* === ШАПКА: интегрирована в общую полосу под топбаром === */
#globalLeaderboardScreen .glb-header {
    height: 64px;
    padding: 0 24px;
    background: transparent !important;
    border-bottom: 1px solid rgba(120, 160, 60, 0.18);
    box-shadow: none !important;
}

/* === КНОПКА В МЕНЮ (как в ангаре) === */
#globalLeaderboardScreen .glb-back {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px 0 14px;
    background: linear-gradient(180deg,
        rgba(80,120,40,0.55) 0%,
        rgba(60,95,28,0.70) 100%) !important;
    border: 1px solid rgba(150,200,80,0.45) !important;
    border-left: 3px solid #b4dc64 !important;
    border-radius: 4px;
    color: #e6f0c8 !important;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 12px;
    letter-spacing: 2.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(180,220,100,0.18);
    text-transform: none;
}
#globalLeaderboardScreen .glb-back:hover {
    background: linear-gradient(180deg,
        rgba(100,150,50,0.7) 0%,
        rgba(75,120,35,0.85) 100%) !important;
    border-color: rgba(180,220,100,0.65) !important;
    color: #ffffff !important;
    transform: translateX(-2px);
    box-shadow: 0 3px 12px rgba(80,140,40,0.35), inset 0 1px 0 rgba(180,220,100,0.25);
}

/* === TITLE BLOCK (центр) — оставляем gold-акцент, чуть умереннее === */
#globalLeaderboardScreen .glb-eyebrow {
    color: rgba(168, 194, 128, 0.70);
    letter-spacing: 3px;
    font-size: 9.5px;
}
#globalLeaderboardScreen .glb-title {
    font-size: 22px;
    letter-spacing: 6px;
    text-shadow: 0 0 18px rgba(232,212,128,0.20);
}

/* === META (всего игроков + refresh) === */
#globalLeaderboardScreen .glb-meta-num {
    font-size: 18px;
    color: #d8e8b8;
    letter-spacing: 0.5px;
}
#globalLeaderboardScreen .glb-meta-lbl {
    color: rgba(168, 194, 128, 0.55);
    letter-spacing: 1.5px;
    font-size: 8.5px;
    margin-top: 2px;
}
#globalLeaderboardScreen .glb-refresh {
    background: transparent !important;
    border: 1px solid rgba(120, 160, 60, 0.25) !important;
    color: rgba(168, 194, 128, 0.7) !important;
    width: 32px; height: 32px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.15s !important;
}
#globalLeaderboardScreen .glb-refresh:hover {
    background: rgba(80, 120, 40, 0.18) !important;
    border-color: rgba(150, 200, 80, 0.45) !important;
    color: #e6f0c8 !important;
    transform: rotate(60deg);
}

/* === ТАБЛИЦА: flat surface, без card-look === */
#globalLeaderboardScreen .glb-table-wrap {
    padding: 18px 24px 32px;
    background: transparent !important;
}
#globalLeaderboardScreen .glb-table-title {
    color: rgba(168, 194, 128, 0.65);
    letter-spacing: 3px;
    font-size: 9.5px;
    padding: 4px 0 14px;
    text-align: left;
}
#globalLeaderboardScreen .glb-table {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible;
}
#globalLeaderboardScreen .glb-table thead th {
    background: transparent !important;
    color: #d8b860 !important;
    border-bottom: 1px solid rgba(216, 184, 96, 0.30) !important;
    padding: 10px 12px;
    letter-spacing: 2.5px;
    font-size: 9.5px;
    text-shadow: 0 0 8px rgba(216, 184, 96, 0.20);
}
#globalLeaderboardScreen .glb-table tbody td {
    border-bottom: 1px solid rgba(120, 160, 60, 0.08);
    padding: 10px 12px;
    color: #cfdbb0;
}
#globalLeaderboardScreen .glb-table tbody tr:hover td {
    background: rgba(80, 120, 40, 0.10) !important;
}
#globalLeaderboardScreen .glb-row-name { color: #e6f0c8; }
#globalLeaderboardScreen .glb-row-uid {
    color: rgba(168, 194, 128, 0.5);
    font-family: 'Courier New', monospace;
}

/* Подсветка собственной строки */
#globalLeaderboardScreen .glb-row-me td {
    background: rgba(80, 120, 40, 0.18) !important;
    border-bottom-color: rgba(180, 220, 100, 0.30) !important;
}

/* Top-3 бейджи приглушаем — gold всё ещё читается, но не кричит */
#globalLeaderboardScreen .glb-row-rank-1 { color: #ffd966; text-shadow: 0 0 8px rgba(255,217,102,0.35); }
#globalLeaderboardScreen .glb-row-rank-2 { color: #cfd6dc; }
#globalLeaderboardScreen .glb-row-rank-3 { color: #cd8a4a; }

/* Кнопка ВЕРНУТЬСЯ В БОЙ — рядом с В МЕНЮ когда ангар открыт из боя */
#garageScreen .hangar-preview-header {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
#garageScreen .hangar-return-btn {
    background: linear-gradient(180deg,
        rgba(180,140,40,0.55) 0%,
        rgba(140,100,20,0.70) 100%) !important;
    border-color: rgba(220,180,80,0.55) !important;
    border-left: 3px solid #ffcc44 !important;
    color: #fff8d8 !important;
}
#garageScreen .hangar-return-btn:hover {
    background: linear-gradient(180deg,
        rgba(210,160,55,0.7) 0%,
        rgba(160,115,25,0.85) 100%) !important;
    border-color: rgba(240,200,100,0.65) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}
#garageScreen .hangar-return-btn:hover .hangar-back-arrow {
    transform: translateX(3px);
}

/* (Удалено правило body.in-duel { display:none } — оно ломало
   капсулы топбара после выхода из дуэли в меню. Топбар в бою уже
   полностью скрыт через body.in-battle #globalTopbar { display:none }
   поэтому duel-специфичное правило избыточно.) */

/* В бою — глобальный топбар УДАЛЁН целиком (display:none).
   Битва занимает весь экран без любых HUD-капсул сверху.
   В дуэли in-duel применяется одновременно с in-battle, но display:none
   на самом топбаре уже всё перекрывает — duel-специфичные правила
   (выше) безопасны как noop. */
body.in-battle #globalTopbar {
    display: none !important;
}
