/* ── 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: 34px;
    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-spectate {
    border-color: rgba(140,140,140,0.35);
    background: rgba(60,60,60,0.3);
    color: #b0b0b0;
    margin-top: 6px;
    letter-spacing: 0.5px;
}
.btn-spectate:hover {
    background: rgba(80,80,80,0.4);
    border-color: rgba(160,160,160,0.5);
    color: #d0d0d0;
}
.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 screen — позиционируется НАД consumables hot-bar'ом (он на canvas'е,
   y = h - 70). Затемняем только верх экрана: gradient overlay прозрачен на
   bottom 120px, чтобы followed-tank's consumables (kill-cam HUD) оставался
   виден. Контейнер прибит к низу через flex-end + padding-bottom. */
#deathScreen.overlay {
    background: linear-gradient(180deg,
        rgba(5,8,3,0.85) 0%,
        rgba(5,8,3,0.85) calc(100% - 120px),
        rgba(5,8,3,0) 100%);
    align-items: flex-end;
    padding-bottom: 90px;
}

.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: 36px;
    height: 44px;
    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;
}
/* Статус 'ЭКИПИРОВАНО' на карточке скина — статичный лейбл вместо
   кнопки (снятие только через превью со статистикой). */
.item-card .equip-status {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid rgba(180,220,100,0.45);
    border-radius: 4px;
    background: rgba(40,60,22,0.5);
    color: #b4dc64;
    font-family: 'Black Ops One', 'Impact', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-align: center;
    margin-top: 6px;
}

/* 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;
}

