/* ——— COD Zombies–inspired UI (cream / gold / blood red on near-black) ——— */
:root {
    --z-bg: #070807;
    --z-panel: rgba(12, 14, 11, 0.92);
    --z-border: #3d3528;
    --z-gold: #c9a227;
    --z-gold-bright: #e8c84a;
    --z-cream: #e4dfd4;
    --z-cream-dim: #9a958a;
    --z-red: #8b1538;
    --z-red-bright: #e02040;
    --z-green-hint: #6a9e6a;
    --font-display: "Bebas Neue", Impact, sans-serif;
    --font-hud: "Rajdhani", "Segoe UI", sans-serif;
    --font-boom-anton: "Anton", Impact, sans-serif;
    --font-boom-impact: Impact, "Arial Black", "Bebas Neue", sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--z-bg);
    font-family: var(--font-hud);
    color: var(--z-cream);
    user-select: none;
    -webkit-user-select: none;
}

/* ── First-visit player name modal ───────────────────────────────────────── */
.pnm-overlay {
    position: fixed;
    inset: 0;
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 4, 10, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.pnm-overlay.visible { opacity: 1; }
.pnm-overlay[hidden] { display: none; }

.pnm-box {
    background: rgba(8, 12, 26, 0.78);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 44px 52px;
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pnm-logo {
    width: clamp(100px, 14vw, 160px);
    margin-bottom: 4px;
    filter: drop-shadow(0 0 18px rgba(201, 162, 39, 0.2));
}

.pnm-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
    letter-spacing: 0.04em;
    text-align: center;
}

.pnm-sub {
    font-family: var(--font-hud);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.32);
    margin: 0;
    letter-spacing: 0.06em;
    text-align: center;
}

.pnm-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-hud);
    font-size: 15px;
    letter-spacing: 0.06em;
    padding: 13px 16px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}
.pnm-input::placeholder { color: rgba(255, 255, 255, 0.2); }
.pnm-input:focus {
    border-color: rgba(201, 162, 39, 0.55);
    background: rgba(255, 255, 255, 0.08);
}

.pnm-btn {
    margin-top: 6px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, rgba(180, 130, 20, 0.85), rgba(220, 170, 40, 0.85));
    border: none;
    border-radius: 10px;
    color: rgba(0, 0, 0, 0.88);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.22em;
    cursor: pointer;
    transition: filter 0.18s, transform 0.12s;
}
.pnm-btn:hover  { filter: brightness(1.15); }
.pnm-btn:active { transform: scale(0.97); }

/* ── Scene loading curtain — hides pop-in while map models load ─────────── */
#sceneLoader {
    position: fixed;
    inset: 0;
    background: #02040a;
    z-index: 9000;
    pointer-events: none;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sceneLoader.done { opacity: 0; }

.sl-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.sl-logo {
    width: clamp(140px, 18vw, 220px);
    opacity: 0.92;
    filter: drop-shadow(0 0 24px rgba(201, 162, 39, 0.25));
}
.sl-bar-wrap {
    width: clamp(160px, 22vw, 260px);
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.sl-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #a07818, #f0c040);
    border-radius: 2px;
    transition: width 0.35s ease;
}
.sl-text {
    font-family: var(--font-hud, monospace);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.28);
    margin: 0;
    text-transform: uppercase;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Menu / lobby: hide the entire in-game HUD layer (health, weapon, interact text, etc.) */
body[data-app-screen="main_menu"] #uiLayer,
body[data-app-screen="lobby"] #uiLayer {
    visibility: hidden;
    pointer-events: none;
}

body[data-app-screen="main_menu"] #damageNumbersLayer,
body[data-app-screen="main_menu"] #chainBoomLayer,
body[data-app-screen="lobby"] #damageNumbersLayer,
body[data-app-screen="lobby"] #chainBoomLayer {
    visibility: hidden;
}

/* ——— Floating damage numbers (world → screen at spawn) ——— */
.damage-numbers-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

/* ——— Chain kill fanfare (world-anchored like damage numbers) ——— */
.chain-boom-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* Above floating damage numbers (4) and perk shields (5); below fullscreen overlays */
    z-index: 9;
    overflow: hidden;
}

.chain-boom-host {
    position: absolute;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
    line-height: 1;
    pointer-events: none;
    will-change: left, top, font-size, opacity;
}

.chain-boom {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.06em 0.1em;
    max-width: 95vw;
    font-family: var(--font-display);
    font-size: 1em;
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
    opacity: 0;
    transform: scale(0.35) rotate(-4deg);
    filter: blur(3px);
    will-change: transform, opacity, filter;
}

.chain-boom-word {
    display: inline-block;
    paint-order: stroke fill;
}

/* ——— Per-phrase identity: own font + colours per word ——— */

.chain-boom--booom {
    font-family: var(--font-display);
    font-weight: 400;
}

.chain-boom--booom .chain-boom-word--w0 {
    letter-spacing: 0.2em;
    -webkit-text-stroke: 0.04em rgba(12, 4, 28, 0.92);
    color: #fffef8;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 0 #12041c,
        0 5px 0 #060210,
        0 0 20px rgba(255, 45, 200, 1),
        0 0 44px rgba(80, 255, 255, 0.5),
        0 0 64px rgba(255, 40, 160, 0.38),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--dayumn {
    font-family: var(--font-hud);
    font-weight: 700;
}

.chain-boom--dayumn .chain-boom-word--w0 {
    letter-spacing: 0.1em;
    -webkit-text-stroke: 0.045em rgba(20, 8, 40, 0.9);
    color: #c8f6ff;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.88),
        0 3px 0 #082040,
        0 5px 0 #040818,
        0 0 18px rgba(80, 220, 255, 1),
        0 0 40px rgba(120, 180, 255, 0.55),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--dayumn .chain-boom-word--w1 {
    letter-spacing: 0.14em;
    -webkit-text-stroke: 0.04em rgba(40, 20, 0, 0.88);
    color: #fff1a8;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.85),
        0 3px 0 #4a2808,
        0 5px 0 #180c04,
        0 0 20px rgba(255, 200, 40, 1),
        0 0 46px rgba(255, 100, 20, 0.5),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--crazy {
    font-family: var(--font-boom-anton);
    font-weight: 400;
}

.chain-boom--crazy .chain-boom-word--w0 {
    letter-spacing: 0.12em;
    -webkit-text-stroke: 0.035em #1a0408;
    color: #ff2840;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 0 #500808,
        0 5px 0 #200204,
        0 0 16px rgba(255, 220, 80, 1),
        0 0 36px rgba(255, 60, 40, 0.85),
        0 0 56px rgba(255, 0, 60, 0.45),
        0 8px 22px rgba(0, 0, 0, 0.75);
}

.chain-boom--nice {
    font-family: var(--font-display);
    font-weight: 400;
}

.chain-boom--nice .chain-boom-word--w0 {
    letter-spacing: 0.12em;
    -webkit-text-stroke: 0.04em rgba(4, 20, 48, 0.9);
    color: #d8f0ff;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.88),
        0 3px 0 #102850,
        0 5px 0 #081028,
        0 0 18px rgba(100, 200, 255, 1),
        0 0 42px rgba(60, 140, 255, 0.45),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--nice .chain-boom-word--w1 {
    letter-spacing: 0.16em;
    -webkit-text-stroke: 0.04em rgba(48, 32, 4, 0.88);
    color: #ffe8b8;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.85),
        0 3px 0 #503008,
        0 5px 0 #201004,
        0 0 20px rgba(255, 200, 100, 1),
        0 0 44px rgba(255, 160, 40, 0.48),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--snap {
    font-family: var(--font-hud);
    font-weight: 600;
}

.chain-boom--snap .chain-boom-word--w0 {
    letter-spacing: 0.18em;
    -webkit-text-stroke: 0.04em rgba(8, 8, 12, 0.92);
    color: #f6f6fa;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 0 #181820,
        0 5px 0 #08080c,
        0 0 14px rgba(220, 220, 255, 0.9),
        0 0 32px rgba(160, 180, 255, 0.4),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--snap .chain-boom-word--w1 {
    letter-spacing: 0.1em;
    -webkit-text-stroke: 0.045em rgba(48, 4, 32, 0.88);
    color: #ffb8e8;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.85),
        0 3px 0 #501040,
        0 5px 0 #200818,
        0 0 22px rgba(255, 80, 200, 1),
        0 0 48px rgba(255, 40, 160, 0.5),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--multi {
    font-family: var(--font-boom-impact);
    font-weight: 700;
}

.chain-boom--multi .chain-boom-word--w0 {
    letter-spacing: 0.06em;
    -webkit-text-stroke: 0.035em rgba(28, 18, 4, 0.92);
    color: #fff6d8;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 0 #4a3010,
        0 5px 0 #1a1006,
        0 0 12px rgba(255, 230, 160, 1),
        0 0 28px rgba(232, 180, 60, 0.65),
        0 0 44px rgba(201, 162, 39, 0.35),
        0 8px 22px rgba(0, 0, 0, 0.75);
}

.chain-boom--multi .chain-boom-word--w1 {
    letter-spacing: 0.08em;
    -webkit-text-stroke: 0.04em rgba(26, 2, 8, 0.94);
    color: #ff3a4a;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.92),
        0 3px 0 #500810,
        0 5px 0 #180204,
        0 0 14px rgba(255, 200, 120, 0.55),
        0 0 26px rgba(255, 40, 60, 1),
        0 0 48px rgba(200, 20, 40, 0.55),
        0 8px 22px rgba(0, 0, 0, 0.78);
}

.chain-boom--wrecked {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.04em;
}

.chain-boom--wrecked .chain-boom-word--w0 {
    letter-spacing: 0.14em;
    -webkit-text-stroke: 0.04em rgba(28, 6, 4, 0.9);
    color: #ff7a58;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 0 #481008,
        0 5px 0 #180404,
        0 0 20px rgba(255, 120, 60, 1),
        0 0 44px rgba(200, 40, 20, 0.55),
        0 0 62px rgba(255, 60, 0, 0.3),
        0 8px 22px rgba(0, 0, 0, 0.75);
}

.chain-boom--sheesh {
    font-family: var(--font-hud);
    font-weight: 600;
}

.chain-boom--sheesh .chain-boom-word--w0 {
    letter-spacing: 0.16em;
    -webkit-text-stroke: 0.04em rgba(24, 12, 48, 0.88);
    color: #e8dcff;
    text-shadow:
        0 0 1px rgba(0, 0, 0, 0.88),
        0 3px 0 #281848,
        0 5px 0 #100820,
        0 0 18px rgba(180, 255, 240, 0.85),
        0 0 40px rgba(160, 120, 255, 0.5),
        0 0 58px rgba(100, 255, 220, 0.32),
        0 8px 22px rgba(0, 0, 0, 0.72);
}

.chain-boom--animate {
    animation: chain-boom-pop 0.95s cubic-bezier(0.14, 0.9, 0.2, 1) forwards;
}

@keyframes chain-boom-pop {
    0% {
        opacity: 0;
        transform: scale(0.4) rotate(-8deg) translateY(0.5em);
        filter: blur(4px) brightness(1.85) saturate(1.35);
    }
    22% {
        opacity: 1;
        transform: scale(1.08) rotate(3deg) translateY(-0.15em);
        filter: blur(0) brightness(1.35) saturate(1.5);
    }
    40% {
        transform: scale(0.96) rotate(-1deg) translateY(0.08em);
        filter: brightness(1.12) saturate(1.35);
    }
    58% {
        opacity: 1;
        transform: scale(1.02) rotate(0.5deg) translateY(-0.06em);
        filter: brightness(1.08) saturate(1.25);
    }
    100% {
        opacity: 0;
        transform: scale(0.92) rotate(-2deg) translateY(-0.85em);
        filter: blur(2px) brightness(0.78) saturate(0.9);
    }
}

.dmg-num-host {
    position: absolute;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
    line-height: 1;
    pointer-events: none;
    will-change: left, top, font-size, opacity;
}

.dmg-num {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    transform-origin: 50% 40%;
    font-family: var(--font-display);
    font-size: 1em;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: 0.04em;
    opacity: 0;
    white-space: nowrap;
    will-change: transform, opacity, filter;
    --dmg-drift-x: 0;
    --dmg-rot: 0deg;
}

.dmg-num-value {
    display: block;
    font-size: 1em;
    color: #fffaf0;
    text-shadow:
        0 0 10px rgba(255, 200, 120, 0.95),
        0 0 22px rgba(255, 80, 40, 0.55),
        0 2px 0 #5c1010,
        0 4px 0 #2a0808,
        0 6px 14px rgba(0, 0, 0, 0.9);
}

.dmg-num-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4em;
    margin-top: 0.06em;
    font-family: var(--font-display);
    font-size: 0.36em;
    font-weight: 400;
    letter-spacing: 0.28em;
    line-height: 1;
}

.dmg-flag {
    padding: 0.08em 0.12em;
    border-radius: 2px;
    font-weight: 700;
}

.dmg-flag--hs {
    color: #c8fbff;
    background: linear-gradient(180deg, rgba(40, 90, 120, 0.55), rgba(10, 40, 60, 0.75));
    border: 1px solid rgba(120, 220, 255, 0.65);
    text-shadow: 0 0 10px rgba(100, 240, 255, 0.9);
    box-shadow: 0 0 12px rgba(60, 200, 255, 0.35);
}

.dmg-flag--crit {
    color: #ffe8a0;
    background: linear-gradient(180deg, rgba(120, 70, 20, 0.65), rgba(60, 30, 8, 0.85));
    border: 1px solid rgba(255, 200, 100, 0.75);
    text-shadow: 0 0 10px rgba(255, 200, 80, 0.95);
    box-shadow: 0 0 14px rgba(255, 160, 40, 0.45);
}

.dmg-num--headshot .dmg-num-value {
    color: #e8fcff;
    text-shadow:
        0 0 12px rgba(120, 240, 255, 0.95),
        0 0 28px rgba(80, 200, 255, 0.55),
        0 2px 0 #0a4a5c,
        0 4px 0 #052830,
        0 6px 16px rgba(0, 0, 0, 0.88);
}

.dmg-num--crit:not(.dmg-num--headshot):not(.dmg-num--kill) .dmg-num-value {
    color: #fff0c8;
    text-shadow:
        0 0 12px rgba(255, 220, 140, 1),
        0 0 26px rgba(255, 120, 255, 0.55),
        0 2px 0 #5c2860,
        0 4px 0 #281030,
        0 6px 16px rgba(0, 0, 0, 0.9);
}

.dmg-num--headshot.dmg-num--crit:not(.dmg-num--kill) .dmg-num-value {
    color: #fff8ff;
    text-shadow:
        0 0 14px rgba(180, 255, 255, 0.95),
        0 0 30px rgba(255, 160, 255, 0.65),
        0 2px 0 #3a2060,
        0 5px 0 #180818,
        0 8px 18px rgba(0, 0, 0, 0.92);
}

.dmg-num--heavy .dmg-num-value {
    color: #ffe8a8;
    text-shadow:
        0 0 12px rgba(255, 220, 140, 1),
        0 0 28px rgba(255, 140, 60, 0.65),
        0 2px 0 #6a2810,
        0 5px 0 #2a0a06,
        0 8px 20px rgba(0, 0, 0, 0.92);
}

/* Plain merged total only — HS/CRIT/kill/heavy keep their own value styles above */
.dmg-num--merged:not(.dmg-num--headshot):not(.dmg-num--crit):not(.dmg-num--kill):not(.dmg-num--heavy)
    .dmg-num-value {
    color: #fff2d0;
    text-shadow:
        0 0 10px rgba(255, 215, 150, 0.95),
        0 0 22px rgba(232, 180, 80, 0.5),
        0 2px 0 #4a3518,
        0 4px 0 #1e1408,
        0 6px 16px rgba(0, 0, 0, 0.88);
}

.dmg-num--kill .dmg-num-value {
    color: #fff6c2;
    text-shadow:
        0 0 14px rgba(255, 255, 200, 1),
        0 0 36px rgba(255, 200, 80, 0.85),
        0 0 52px rgba(232, 64, 120, 0.45),
        0 3px 0 #4a1538,
        0 6px 0 #1a0608,
        0 10px 24px rgba(0, 0, 0, 0.95);
}

.dmg-num--nuke-boom .dmg-num-value {
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 1.08em;
    color: #fff4a8;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 1),
        0 0 20px rgba(255, 200, 60, 1),
        0 0 40px rgba(255, 100, 20, 0.9),
        0 0 64px rgba(255, 60, 0, 0.55),
        0 3px 0 #6a2010,
        0 6px 0 #2a0c06,
        0 10px 26px rgba(0, 0, 0, 0.95);
}

.dmg-num--animate {
    animation: dmg-num-pop 0.92s cubic-bezier(0.18, 0.88, 0.22, 1) forwards;
}

@keyframes dmg-num-pop {
    0% {
        opacity: 0;
        filter: blur(4px) brightness(2);
        transform: translate(0, 0.85em) scale(0.2) rotate(calc(-12deg + var(--dmg-rot)));
    }
    12% {
        opacity: 1;
        filter: blur(0) brightness(1.35);
        transform: translate(calc(var(--dmg-drift-x) * 0.15 * 1em), -0.18em) scale(1.35)
            rotate(calc(6deg + var(--dmg-rot)));
    }
    28% {
        filter: brightness(1.1);
        transform: translate(calc(var(--dmg-drift-x) * 0.45 * 1em), -0.55em) scale(1.02)
            rotate(calc(-3deg + var(--dmg-rot)));
    }
    55% {
        opacity: 1;
        transform: translate(calc(var(--dmg-drift-x) * 0.75 * 1em), -0.95em) scale(0.98) rotate(var(--dmg-rot));
    }
    100% {
        opacity: 0;
        filter: blur(1px) brightness(0.85);
        transform: translate(calc(var(--dmg-drift-x) * 1em), -1.75em) scale(0.72) rotate(var(--dmg-rot));
    }
}

#uiLayer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(12px, 2.5vw, 28px);
    box-sizing: border-box;
    z-index: 3;
}

/* ——— Top: round banner (intro center → dock top-right each round) ——— */
.hud-top {
    position: relative;
    width: 100%;
    flex: 0 0 0;
    min-height: 0;
    pointer-events: none;
}

.hud-round-banner {
    --round-ease: cubic-bezier(0.2, 0.85, 0.25, 1);
    position: absolute;
    top: 4px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, rgba(20, 18, 14, 0.95) 0%, rgba(8, 8, 6, 0.88) 100%);
    border: 1px solid var(--z-border);
    border-top: 2px solid var(--z-gold);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    /* Always explicit `left` + % transforms — never `left/right: auto` (doesn’t interpolate → snap). */
    right: auto;
    will-change: transform, left, padding;
    transition:
        left 0.88s var(--round-ease),
        transform 0.88s var(--round-ease),
        padding 0.88s var(--round-ease),
        clip-path 0.75s ease-out,
        box-shadow 0.75s ease-out,
        border-color 0.5s ease;
}

.hud-round-banner--snap {
    transition: none !important;
}

.hud-round-banner--snap .hud-round-label,
.hud-round-banner--snap .hud-round-value {
    transition: none !important;
    animation: none !important;
}

/* Cinematic beat: top center, larger */
.hud-round-banner--intro {
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 64px 20px;
    clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(201, 162, 39, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Compact HUD slot: right edge flush with .hud-top (interpolates with intro via left + transform) */
.hud-round-banner--dock {
    left: 100%;
    transform: translateX(-100%);
    padding: 6px 20px 8px;
    clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hud-round-label {
    font-family: var(--font-display);
    letter-spacing: 0.55em;
    color: var(--z-gold);
    text-indent: 0.55em;
    line-height: 1;
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.35);
    transition:
        font-size 0.88s var(--round-ease),
        letter-spacing 0.88s ease,
        opacity 0.4s ease;
}

.hud-round-value {
    font-family: var(--font-display);
    line-height: 0.95;
    color: var(--z-cream);
    text-shadow:
        0 2px 0 #1a1510,
        0 0 40px rgba(228, 223, 212, 0.15);
    transition:
        font-size 0.88s var(--round-ease),
        text-shadow 0.6s ease,
        filter 0.6s ease;
}

.hud-round-banner--intro .hud-round-label {
    font-size: clamp(26px, 4vw, 38px);
}

.hud-round-banner--intro .hud-round-value {
    font-size: clamp(58px, 11vw, 108px);
    animation: hud-round-value-pop 0.6s cubic-bezier(0.25, 0.9, 0.3, 1.15) both;
}

.hud-round-banner--dock .hud-round-label {
    font-size: clamp(15px, 2vw, 22px);
    letter-spacing: 0.42em;
    text-indent: 0.42em;
}

.hud-round-banner--dock .hud-round-value {
    font-size: clamp(32px, 5vw, 54px);
    animation: none;
}

@keyframes hud-round-value-pop {
    0% {
        transform: scale(0.35);
        opacity: 0;
        filter: blur(8px);
    }
    70% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

/* ——— Crosshair: minimal COD-style ticks ——— */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: "";
    position: absolute;
    background: rgba(235, 232, 225, 0.92);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.85),
        0 0 6px rgba(0, 0, 0, 0.5);
}

.crosshair::before {
    top: 10px;
    left: 2px;
    width: 18px;
    height: 2px;
}

.crosshair::after {
    top: 2px;
    left: 10px;
    width: 2px;
    height: 18px;
}

/* ——— Power-up pickup banner (Black Ops–style) ——— */
.powerup-banner {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 12;
    pointer-events: none;
    font-family: var(--font-display, 'Bebas Neue', sans-serif);
    font-size: clamp(28px, 5.5vw, 52px);
    letter-spacing: 0.12em;
    text-indent: 0.12em;
    color: #ffe566;
    text-shadow:
        0 0 12px rgba(255, 180, 40, 0.95),
        0 3px 0 #3d2a08,
        0 6px 24px rgba(0, 0, 0, 0.85);
    transition: opacity 0.35s ease;
}

.powerup-banner.hidden {
    opacity: 0;
}

.powerup-banner:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

@keyframes powerup-banner-flash {
    0% {
        transform: translate(-50%, 0) scale(0.65);
        opacity: 0;
        filter: blur(6px);
    }
    35% {
        opacity: 1;
        filter: blur(0);
    }
    55% {
        transform: translate(-50%, 0) scale(1.05);
    }
    100% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
}

.powerup-banner.powerup-banner--flash {
    animation: powerup-banner-flash 0.55s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

/* ——— Perk column + power-up buffs (above perks) ——— */
.hud-perk-stack {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    z-index: 5;
}

/* Timed drop buffs only (2×, insta, fire sale, max ammo) — diamond frame, soul-green accent (not perk shields) */
.hud-powerup-buffs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: min(520px, 92vw);
}

.hud-powerup-buffs--empty {
    display: none;
}

.hud-powerup-buff {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 48px;
    --buff-pct: 1;
    --buff-color: #4ade80;
    --buff-bg: rgba(20, 40, 28, 0.55);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
}

.hud-powerup-buff-diamond {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-powerup-buff-diamond::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--buff-bg);
    border: 2px solid var(--buff-color);
    transform: rotate(45deg);
    border-radius: 5px;
    box-shadow:
        inset 0 0 10px rgba(74, 222, 128, 0.12),
        0 0 12px rgba(34, 197, 94, 0.28);
}

.hud-powerup-buff-icon {
    position: relative;
    z-index: 1;
    font-size: 15px;
    color: #f8fafc;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.45);
    margin-top: -1px;
}

.hud-powerup-buff-track {
    width: 32px;
    height: 3px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.hud-powerup-buff-track-fill {
    height: 100%;
    width: calc(100% * var(--buff-pct, 1));
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.08s linear;
}

.hud-powerup-buff-time {
    font-family: var(--font-hud);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    color: rgba(220, 252, 231, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
}

/* ——— World perks (soda machines) ——— */
/* Reserve one row so timed buffs above don’t jump when perks go 0 → 1+ (stack is bottom-anchored). */
.hud-world-perks {
    display: flex;
    gap: 12px;
    min-height: 46px;
}

.hud-perk-icon {
    position: relative;
    width: 40px;
    height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 18px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.hud-perk-shield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hud-perk-shield path {
    fill: var(--perk-bg);
    stroke: var(--perk-color);
    stroke-width: 8;
    stroke-linejoin: round;
}

.hud-perk-icon i {
    margin-top: -6px; /* Shift up slightly to center in the shield's visual mass */
    text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

@keyframes hud-perk-strip-out {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
        filter: brightness(1) saturate(1);
    }
    22% {
        transform: scale(1.08) translateY(-5px) rotate(-5deg);
        filter: brightness(1.4) saturate(0.35);
    }
    50% {
        transform: scale(0.9) translateY(8px) rotate(6deg);
        opacity: 0.88;
        filter: brightness(0.55) saturate(0);
    }
    100% {
        transform: scale(0.32) translateY(42px) rotate(-10deg);
        opacity: 0;
        filter: brightness(0.2) blur(4px);
    }
}

@keyframes hud-perk-strip-crack {
    0% {
        opacity: 0;
        transform: scaleY(0.3);
    }
    18% {
        opacity: 0.95;
        transform: scaleY(1);
    }
    100% {
        opacity: 0;
        transform: scaleY(1.1) translateY(12px);
    }
}

.hud-perk-icon--strip-out {
    z-index: 4;
    animation: hud-perk-strip-out var(--strip-dur, 0.88s) cubic-bezier(0.42, 0, 0.58, 1)
        forwards;
}

.hud-perk-icon--strip-out::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    width: 3px;
    height: 70%;
    margin-left: -1px;
    transform-origin: center top;
    background: linear-gradient(
        180deg,
        rgba(255, 240, 220, 0) 0%,
        rgba(255, 90, 60, 0.95) 35%,
        rgba(40, 20, 15, 0.9) 100%
    );
    box-shadow:
        -5px 0 0 rgba(30, 10, 8, 0.5),
        6px 2px 0 rgba(255, 200, 160, 0.35);
    pointer-events: none;
    animation: hud-perk-strip-crack var(--strip-dur, 0.88s) ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .hud-perk-icon--strip-out {
        animation-duration: 0.2s !important;
    }
    .hud-perk-icon--strip-out::before {
        animation-duration: 0.2s !important;
    }
}

@keyframes perk-drain-pulse {
    0%, 100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) brightness(1); }
    50% { filter: drop-shadow(0 4px 12px rgba(255,60,60,0.6)) brightness(1.15); }
}

.hud-perk-icon--draining {
    animation: perk-drain-pulse 1.5s infinite;
}

.hud-perk-icon--draining::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 0, 0, 0.85) var(--drain-pct, 0%),
        transparent var(--drain-pct, 0%)
    );
    clip-path: polygon(10% 8.7%, 90% 8.7%, 90% 65.2%, 50% 91.3%, 10% 65.2%);
    z-index: 2;
    pointer-events: none;
}

#interactionText .hud-interact-muted {
    color: var(--z-cream-dim);
    letter-spacing: 0.1em;
    font-size: 0.92em;
}

/* ——— Interaction prompt ——— */
#interactionText.hud-interact {
    position: absolute;
    left: 50%;
    bottom: 22%;
    transform: translateX(-50%);
    display: none;
    padding: 12px 28px;
    max-width: min(520px, 92vw);
    font-family: var(--font-hud);
    font-size: clamp(15px, 2vw, 20px);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--z-cream);
    background: var(--z-panel);
    border: 1px solid var(--z-border);
    border-left: 3px solid var(--z-gold);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
}

#interactionText .hud-interact-line {
    text-align: center;
}

#interactionText .hud-interact-desc {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78em;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.45;
    text-transform: none;
    color: var(--z-cream-dim);
    text-align: center;
}

#interactionText .hud-interact-cost {
    color: var(--z-gold-bright);
    font-weight: 700;
}

#interactionText .hud-key {
    display: inline-block;
    min-width: 1.5em;
    padding: 2px 8px;
    margin: 0 2px;
    font-weight: 700;
    color: var(--z-bg);
    background: var(--z-cream);
    border: 1px solid var(--z-border);
    border-radius: 2px;
    font-size: 0.92em;
    letter-spacing: 0.06em;
}

#interactionText.hud-interact--afford {
    border-left-color: var(--z-green-hint);
}

#interactionText.hud-interact--broke {
    border-left-color: var(--z-red-bright);
    color: var(--z-cream-dim);
}

#interactionText.hud-interact--broke .hud-interact-cost {
    color: var(--z-red-bright);
}

/* ——— Bottom HUD ——— */
.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.hud-health-block {
    min-width: min(280px, 42vw);
    padding: 12px 16px 14px;
    background: var(--z-panel);
    border: 1px solid var(--z-border);
    border-bottom: 2px solid var(--z-red);
    box-shadow: 0 -2px 0 var(--z-gold) inset, 0 8px 28px rgba(0, 0, 0, 0.5);
}

.hud-health-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.hud-health-title {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.35em;
    color: var(--z-cream-dim);
}

.hud-health-numbers {
    font-size: 17px;
    font-weight: 700;
    color: var(--z-cream);
    font-variant-numeric: tabular-nums;
}

.health-bar-container {
    width: 100%;
}

.health-bar-track {
    height: 10px;
    background: #1a1214;
    border: 1px solid #2a2220;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

#healthBar.health-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ff4a5c 0%, var(--z-red-bright) 45%, #7a0a1a 100%);
    box-shadow: 0 0 12px rgba(224, 32, 64, 0.45);
    transition: width 0.18s ease-out;
}

.hud-right-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.hud-weapon {
    padding: 8px 20px;
    font-family: var(--font-display);
    font-size: clamp(26px, 4vw, 40px);
    letter-spacing: 0.08em;
    color: var(--z-cream);
    background: var(--z-panel);
    border: 1px solid var(--z-border);
    border-right: 3px solid var(--z-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hud-points-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 4px 2px 20px;
}

.hud-points-value {
    font-family: var(--font-display);
    font-size: clamp(44px, 7vw, 72px);
    line-height: 1;
    color: var(--z-cream);
    text-shadow:
        0 2px 0 #0a0a08,
        0 0 24px rgba(228, 223, 212, 0.12);
    font-variant-numeric: tabular-nums;
}

.hud-points-caption {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.45em;
    color: var(--z-gold);
    margin-top: 2px;
    text-indent: 0.45em;
}

/* ——— In-game perk pick: viewport center (wave buff UI) ——— */
#upgradeHud.upgrade-hud {
    position: fixed;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vh, 40px) clamp(10px, 2vw, 20px);
    box-sizing: border-box;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s;
}

/* Case roll + reveal: viewport-centered overlay (only during gamble) */
#upgradeGambleOverlay.upgrade-gamble-overlay {
    position: fixed;
    inset: 0;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
    box-sizing: border-box;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s;
}

#upgradeGambleOverlay.upgrade-gamble-overlay:not(.hidden) {
    pointer-events: auto;
}

.upgrade-gamble-modal {
    pointer-events: auto;
    width: min(640px, 100%);
    max-width: 100%;
}

.upgrade-panel.upgrade-panel--hidden {
    display: none !important;
}

.upgrade-panel-block {
    width: 100%;
}

#upgradeHud.upgrade-hud.hidden {
    opacity: 0;
    visibility: hidden;
}

#upgradeHud.upgrade-hud:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.upgrade-hud-inner {
    pointer-events: auto;
    width: min(920px, 100%);
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    box-sizing: border-box;
}

.upgrade-hud-hint {
    margin: 0 0 8px;
    text-align: center;
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(228, 223, 212, 0.55);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.upgrade-hud-hint span {
    color: rgba(201, 162, 39, 0.75);
    font-weight: 600;
}

.upgrade-hud-hint kbd {
    display: inline-block;
    margin: 0 3px;
    padding: 1px 6px;
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(228, 223, 212, 0.85);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(90, 82, 70, 0.5);
    border-radius: 2px;
}

.upgrade-hud-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.upgrade-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    text-align: center;
}

.upgrade-timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.upgrade-timer-label {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: var(--z-gold);
    text-indent: 0.35em;
}

.upgrade-timer-line {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    line-height: 1;
}

.upgrade-timer {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 36px);
    line-height: 1;
    color: var(--z-gold-bright);
    text-shadow:
        0 0 12px rgba(232, 200, 74, 0.35),
        0 2px 0 #1a1510,
        0 4px 10px rgba(0, 0, 0, 0.55);
    font-variant-numeric: tabular-nums;
}

.upgrade-timer-suffix {
    font-family: var(--font-display);
    font-size: clamp(16px, 2.8vw, 20px);
    font-weight: 400;
    color: var(--z-cream-dim);
    text-shadow: 0 1px 0 #1a1510;
}

.upgrade-timer-hint {
    margin: 6px 0 0;
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--z-cream-dim);
    max-width: 22em;
    line-height: 1.35;
}

.upgrade-timer-hint kbd {
    display: inline-block;
    margin: 0 1px;
    padding: 1px 5px;
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    color: var(--z-bg);
    background: rgba(228, 223, 212, 0.2);
    border: 1px solid rgba(154, 149, 138, 0.45);
    border-radius: 2px;
}

.upgrade-gamble-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-gamble {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: clamp(17px, 2.4vw, 21px);
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    color: #1a1208;
    border-radius: 4px;
    isolation: isolate;
    transform: translateY(0);
    transition:
        transform 0.14s cubic-bezier(0.34, 1.2, 0.64, 1),
        box-shadow 0.14s ease,
        filter 0.18s ease;
    /* Dimensional chassis: top light edge, deep bottom */
    background:
        linear-gradient(180deg, rgba(255, 252, 235, 0.95) 0%, rgba(212, 175, 55, 0.15) 8%, transparent 22%),
        linear-gradient(
            165deg,
            #fff8e0 0%,
            #e8c84a 18%,
            #c9a227 42%,
            #a67c1a 58%,
            #7a5a12 78%,
            #4a3610 100%
        );
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 -1px 0 rgba(0, 0, 0, 0.35) inset,
        0 0 0 1px rgba(60, 45, 15, 0.9),
        0 0 0 2px rgba(255, 235, 180, 0.35),
        0 6px 0 #2a1f0a,
        0 8px 0 rgba(0, 0, 0, 0.45),
        0 14px 28px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(232, 200, 74, 0.25);
    animation: gamble-btn-idle-glow 4s ease-in-out infinite;
}

.btn-gamble::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 2px;
    background: linear-gradient(
        125deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 255, 255, 0.22) 47%,
        rgba(255, 255, 255, 0.65) 50%,
        rgba(255, 255, 255, 0.22) 53%,
        transparent 62%,
        transparent 100%
    );
    background-size: 280% 100%;
    background-position: 100% 0;
    animation: gamble-btn-shimmer 2.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: soft-light;
}

.btn-gamble::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
}

@keyframes gamble-btn-shimmer {
    0%,
    12% {
        background-position: 100% 0;
    }
    45%,
    55% {
        background-position: 0% 0;
    }
    88%,
    100% {
        background-position: 100% 0;
    }
}

@keyframes gamble-btn-idle-glow {
    0%,
    100% {
        filter: brightness(1) saturate(1.05);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.55) inset,
            0 -1px 0 rgba(0, 0, 0, 0.35) inset,
            0 0 0 1px rgba(60, 45, 15, 0.9),
            0 0 0 2px rgba(255, 235, 180, 0.3),
            0 6px 0 #2a1f0a,
            0 8px 0 rgba(0, 0, 0, 0.45),
            0 14px 28px rgba(0, 0, 0, 0.55),
            0 0 36px rgba(232, 200, 74, 0.22);
    }
    50% {
        filter: brightness(1.08) saturate(1.12);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.6) inset,
            0 -1px 0 rgba(0, 0, 0, 0.35) inset,
            0 0 0 1px rgba(60, 45, 15, 0.9),
            0 0 0 2px rgba(255, 245, 200, 0.5),
            0 6px 0 #2a1f0a,
            0 8px 0 rgba(0, 0, 0, 0.45),
            0 14px 32px rgba(0, 0, 0, 0.5),
            0 0 48px rgba(255, 220, 120, 0.35);
    }
}

.btn-gamble-inner {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px 12px;
    text-shadow: 0 1px 0 rgba(255, 250, 220, 0.4);
}

.btn-gamble-label {
    font-weight: 400;
}

.btn-gamble:hover {
    transform: translateY(2px);
    filter: brightness(1.05) saturate(1.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 -1px 0 rgba(0, 0, 0, 0.38) inset,
        0 0 0 1px rgba(60, 45, 15, 0.9),
        0 0 0 2px rgba(255, 235, 180, 0.45),
        0 4px 0 #2a1f0a,
        0 6px 0 rgba(0, 0, 0, 0.4),
        0 12px 26px rgba(0, 0, 0, 0.5),
        0 0 52px rgba(255, 215, 100, 0.4);
}

.btn-gamble:active {
    transform: translateY(5px);
    filter: brightness(0.98);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 2px 4px rgba(0, 0, 0, 0.5) inset,
        0 0 0 1px rgba(40, 30, 10, 0.95),
        0 2px 0 #1a1408,
        0 6px 16px rgba(0, 0, 0, 0.45);
}

.gamble-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85em;
    height: 1.65em;
    padding: 0 0.35em;
    font-family: var(--font-hud);
    font-size: 0.62em;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-indent: 0;
    color: #2a1a08;
    background: linear-gradient(180deg, #fffef8 0%, #e8dcc8 45%, #c4b49a 100%);
    border: 1px solid rgba(45, 35, 18, 0.65);
    border-radius: 3px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 2px 4px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    .btn-gamble::before {
        animation: none;
        opacity: 0.35;
        background-position: 50% 0;
    }
    .btn-gamble {
        animation: none;
    }
}

.gamble-title {
    --dmg-drift-x: 0;
    --dmg-rot: 0deg;
    font-family: var(--font-display);
    font-size: clamp(22px, 4vw, 30px);
    color: #fffaf0;
    margin: 0 0 14px;
    text-align: center;
    letter-spacing: 0.14em;
    transform-origin: 50% 50%;
    text-shadow:
        0 0 10px rgba(255, 200, 120, 0.75),
        0 0 22px rgba(255, 80, 40, 0.4),
        0 2px 0 #3a2010,
        0 4px 0 #1a0c08,
        0 6px 14px rgba(0, 0, 0, 0.75);
    animation: gamble-title-pulse 1.05s ease-in-out infinite;
}

@keyframes gamble-title-pulse {
    0%,
    100% {
        transform: translateX(calc(var(--dmg-drift-x) * -0.25em))
            rotate(calc(var(--dmg-rot) * 0.3)) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translateX(calc(var(--dmg-drift-x) * 0.4em))
            rotate(calc(var(--dmg-rot) * -0.35)) scale(1.035);
        filter: brightness(1.1) saturate(1.15);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gamble-title {
        animation: none;
    }
}

.gamble-roulette-container {
    width: 100%;
    max-width: 560px;
    height: 132px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    background: rgba(4, 4, 3, 0.85);
    border: 1px solid var(--z-border);
    border-bottom: 2px solid var(--z-red);
    box-shadow: 0 -2px 0 var(--z-gold) inset, inset 0 0 24px rgba(0, 0, 0, 0.65);
    border-radius: 2px;
}

.gamble-roulette-selector {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    z-index: 10;
    transform: translateX(-50%);
    background: var(--z-cream);
    box-shadow:
        0 0 8px rgba(232, 200, 74, 0.9),
        0 0 16px rgba(201, 162, 39, 0.45);
    pointer-events: none;
}

.gamble-roulette-track {
    display: flex;
    height: 100%;
    align-items: center;
    width: max-content;
    padding: 0 0 0 0;
    will-change: transform;
}

.gamble-card {
    width: 128px;
    height: 102px;
    flex-shrink: 0;
    margin: 0 8px;
    box-sizing: border-box;
    background: var(--z-panel);
    border: 1px solid var(--z-border);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
}

.gamble-card-title {
    font-family: var(--font-hud);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff2d0;
    margin: 0 0 4px;
    line-height: 1.15;
    text-shadow:
        0 0 8px rgba(255, 215, 150, 0.55),
        0 2px 0 #2a1810,
        0 3px 8px rgba(0, 0, 0, 0.5);
}

.gamble-card-desc {
    font-family: var(--font-hud);
    font-size: 10px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--z-cream-dim);
    margin: 0;
}

/* ——— Gamble reveal + confetti ——— */
.gamble-reveal-phase {
    position: relative;
    text-align: center;
    padding: 8px 12px 16px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gamble-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 2px;
}

.gamble-confetti-piece {
    position: absolute;
    left: calc(50% + var(--cx, 0px));
    bottom: -8px;
    width: 8px;
    height: 10px;
    border-radius: 1px;
    opacity: 0.95;
    animation: gamble-confetti-fall 1.85s ease-out forwards;
}

@keyframes gamble-confetti-fall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 0px), var(--ty, -220px)) rotate(var(--rot, 360deg));
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gamble-confetti-piece {
        animation: none;
        opacity: 0.35;
        bottom: 40%;
    }
}

/* Prize reveal — same language as floating damage: pop, glow, layered shadow, rarity badge */
.gamble-prize-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45em;
    max-width: min(32em, 100%);
    margin: 0;
    padding: 0 8px;
    transform-origin: 50% 28%;
    position: relative;
    z-index: 1;
    --dmg-drift-x: 0;
    --dmg-rot: 0deg;
}

.gamble-prize-stack.gamble-prize--pop {
    animation: gamble-prize-host-pop 0.78s cubic-bezier(0.18, 0.88, 0.22, 1) both;
}

@keyframes gamble-prize-host-pop {
    0% {
        opacity: 0;
        filter: blur(5px) brightness(1.45);
        transform: translateY(0.55em) scale(0.74) rotate(calc(-5deg + var(--dmg-rot)));
    }
    14% {
        opacity: 1;
        filter: blur(0) brightness(1.22);
        transform: translateY(-0.12em) scale(1.07) rotate(calc(5deg + var(--dmg-rot)));
    }
    32% {
        filter: brightness(1.08);
        transform: translateY(0) scale(1.02) rotate(calc(-2deg + var(--dmg-rot)));
    }
    100% {
        opacity: 1;
        filter: brightness(1);
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gamble-prize-stack.gamble-prize--pop {
        animation: none;
        opacity: 1;
        filter: none;
        transform: none;
    }
}

.gamble-prize-eyebrow {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.42em;
    color: var(--z-gold);
    margin: 0;
    text-indent: 0.42em;
}

.gamble-prize-rarity {
    display: inline-block;
    margin: 0;
    padding: 0.14em 0.4em 0.1em;
    font-family: var(--font-display);
    font-size: clamp(11px, 2vw, 13px);
    font-weight: 700;
    letter-spacing: 0.24em;
    text-indent: 0.24em;
    line-height: 1.2;
    border-radius: 2px;
    border: 1px solid transparent;
}

.gamble-prize-rarity.rarity-prize--common {
    color: #e4dfd4;
    background: linear-gradient(180deg, rgba(60, 58, 52, 0.75), rgba(28, 26, 22, 0.9));
    border-color: rgba(154, 149, 138, 0.45);
    text-shadow: 0 0 8px rgba(200, 195, 180, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.gamble-prize-rarity.rarity-prize--rare {
    color: #e8fcff;
    background: linear-gradient(180deg, rgba(40, 90, 120, 0.55), rgba(10, 40, 60, 0.82));
    border-color: rgba(120, 220, 255, 0.55);
    text-shadow: 0 0 10px rgba(100, 240, 255, 0.85);
    box-shadow: 0 0 14px rgba(60, 200, 255, 0.35);
}

.gamble-prize-rarity.rarity-prize--legendary {
    color: #fff6c2;
    background: linear-gradient(180deg, rgba(120, 70, 20, 0.65), rgba(60, 30, 8, 0.88));
    border-color: rgba(255, 200, 100, 0.7);
    text-shadow:
        0 0 12px rgba(255, 220, 140, 0.95),
        0 0 20px rgba(255, 160, 60, 0.45);
    box-shadow: 0 0 16px rgba(255, 160, 40, 0.4);
}

.gamble-prize-rarity.rarity-prize--dev {
    color: #ffc8d0;
    background: linear-gradient(180deg, rgba(120, 20, 40, 0.65), rgba(40, 8, 16, 0.9));
    border-color: rgba(255, 100, 120, 0.65);
    text-shadow: 0 0 12px rgba(255, 80, 100, 0.85);
    box-shadow: 0 0 14px rgba(224, 32, 64, 0.4);
    animation: dev-glitch 2.2s ease-in-out infinite;
}

.gamble-prize-name {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(26px, 4.5vw, 40px);
    line-height: 1.05;
    margin: 0;
    letter-spacing: 0.05em;
    text-align: center;
    color: #fffaf0;
    text-shadow:
        0 0 10px rgba(255, 200, 120, 0.95),
        0 0 22px rgba(255, 80, 40, 0.55),
        0 2px 0 #5c1010,
        0 4px 0 #2a0808,
        0 6px 14px rgba(0, 0, 0, 0.9);
}

.rarity-prize-stack--rare .gamble-prize-name {
    color: #e8fcff;
    text-shadow:
        0 0 12px rgba(120, 240, 255, 0.95),
        0 0 28px rgba(80, 200, 255, 0.55),
        0 2px 0 #0a4a5c,
        0 4px 0 #052830,
        0 6px 16px rgba(0, 0, 0, 0.88);
}

.rarity-prize-stack--legendary .gamble-prize-name {
    color: #fff6c2;
    text-shadow:
        0 0 14px rgba(255, 255, 200, 1),
        0 0 32px rgba(255, 200, 80, 0.75),
        0 2px 0 #4a3518,
        0 5px 0 #1e1408,
        0 8px 20px rgba(0, 0, 0, 0.92);
}

.rarity-prize-stack--dev .gamble-prize-name {
    color: #fff0f2;
    text-shadow:
        0 0 14px rgba(255, 160, 180, 0.95),
        0 0 28px rgba(224, 32, 64, 0.55),
        0 2px 0 #4a1538,
        0 5px 0 #1a0608,
        0 8px 18px rgba(0, 0, 0, 0.92);
}

.gamble-prize-effect {
    display: block;
    font-family: var(--font-hud);
    font-size: 14px;
    font-weight: 500;
    color: var(--z-cream-dim);
    margin: 0;
    line-height: 1.45;
    text-align: center;
    text-shadow: 0 1px 0 #1a1510;
}

/* Rarities (cards + track items) */
.rarity-common {
    border-color: rgba(154, 149, 138, 0.55);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.rarity-rare {
    border-color: rgba(74, 158, 201, 0.75);
    box-shadow: inset 0 0 14px rgba(74, 158, 201, 0.15);
}

.rarity-rare .perk-pick-title,
.rarity-rare .gamble-card-title {
    color: #9fd4ec;
    text-shadow:
        0 0 8px rgba(120, 220, 255, 0.65),
        0 2px 0 #0a3040,
        0 3px 8px rgba(0, 0, 0, 0.55);
}

.rarity-legendary {
    border-color: rgba(201, 162, 39, 0.85);
    box-shadow: inset 0 0 16px rgba(232, 200, 74, 0.12);
}

.rarity-legendary .perk-pick-title,
.rarity-legendary .gamble-card-title {
    color: var(--z-gold-bright);
    text-shadow:
        0 0 10px rgba(255, 220, 120, 0.75),
        0 2px 0 #4a3010,
        0 4px 10px rgba(0, 0, 0, 0.55);
}

.rarity-dev {
    border-color: rgba(224, 32, 64, 0.85);
    box-shadow: inset 0 0 18px rgba(224, 32, 64, 0.2);
    animation: dev-glitch 2s infinite;
}

.rarity-dev .perk-pick-title,
.rarity-dev .gamble-card-title {
    color: #ff9a9a;
    text-shadow: 0 0 6px rgba(224, 32, 64, 0.45);
}

@keyframes dev-glitch {
    0% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(90deg); }
    100% { filter: hue-rotate(0deg); }
}

.perk-pick-card {
    flex: 1 1 min(160px, 100%);
    max-width: min(280px, 100%);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 0;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-hud);
    color: rgba(228, 223, 212, 0.88);
    background: rgba(8, 8, 6, 0.45);
    border: none;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.perk-pick-card:hover,
.perk-pick-card:focus-visible {
    background: rgba(24, 22, 18, 0.65);
    outline: none;
}

.perk-pick-card:focus-visible {
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.45);
}

.perk-pick-card:active {
    background: rgba(30, 26, 20, 0.75);
}

.perk-pick-key {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: rgba(201, 162, 39, 0.9);
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(80, 72, 60, 0.35);
}

.perk-pick-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 9px;
}

.perk-pick-title {
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(232, 200, 74, 0.92);
    line-height: 1.2;
}

.perk-pick-desc {
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
    color: rgba(154, 149, 138, 0.95);
}

/* ——— Fullscreen overlays ——— */
.overlay-pause {
    z-index: 24;
}

.pause-overlay-inner {
    min-width: min(360px, 92vw);
}

.pause-panel--settings {
    width: 100%;
    max-width: min(600px, 96vw);
    align-items: stretch;
}

.pause-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.settings-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.settings-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(90, 80, 65, 0.45);
}

.settings-back-btn {
    justify-self: start;
    padding: 8px 12px 6px;
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--z-cream-dim);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--z-border);
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.settings-back-btn:hover {
    color: var(--z-cream);
    border-color: rgba(201, 162, 39, 0.45);
    background: rgba(201, 162, 39, 0.08);
}

.settings-title {
    grid-column: 2;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3.5vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--z-cream);
    text-transform: none;
}

.settings-header-spacer {
    grid-column: 3;
    width: 100%;
    min-height: 1px;
}

.settings-section {
    margin-bottom: 14px;
    padding: 16px 18px 18px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(90, 80, 65, 0.4);
    border-radius: 10px;
    font-family: var(--font-hud);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--z-gold);
}

.settings-section-desc {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--z-cream-dim);
}

.settings-section-desc.voice-mic-processing-desc {
    margin-top: 12px;
    margin-bottom: 8px;
}

.settings-section-desc.voice-walkie-send-hint {
    margin: 8px 0 0;
    font-size: 11px;
}

.settings-slider-block {
    margin-top: 4px;
}

.settings-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--z-cream-dim);
    letter-spacing: 0.04em;
}

.settings-toggle-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Voice tab: 2×2 grid (stacks to one column on narrow viewports) */
.settings-voice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
    width: 100%;
}

.settings-voice-grid > .settings-section,
.settings-voice-grid .voice-settings-body > .settings-section {
    margin-bottom: 0;
}

@media (max-width: 520px) {
    .settings-voice-grid {
        grid-template-columns: 1fr;
    }
}

.pause-panel--hidden {
    display: none !important;
}

.pause-eyebrow {
    font-family: var(--font-hud);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: var(--z-gold);
    margin: 0 0 4px;
}

.pause-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 10vw, 72px);
    margin: 0 0 20px;
    color: var(--z-cream);
    letter-spacing: 0.12em;
    text-shadow: 0 3px 0 #1a1510;
}

.pause-title--settings {
    font-size: clamp(28px, 6vw, 44px);
    margin-bottom: 12px;
}

.pause-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 320px;
}

.pause-btn-stack .btn-cod {
    width: 100%;
    text-indent: 0;
    letter-spacing: 0.14em;
}

.pause-hint {
    font-family: var(--font-hud);
    font-size: 13px;
    color: var(--z-cream-dim);
    margin: 28px 0 0;
    line-height: 1.5;
    max-width: 280px;
}

.pause-hint kbd {
    display: inline-block;
    padding: 0.1em 0.45em;
    font-family: var(--font-hud);
    font-size: 0.92em;
    font-weight: 600;
    color: var(--z-cream);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--z-border);
    border-radius: 3px;
    box-shadow: 0 2px 0 #0a0a08;
}

.pause-volume-block {
    width: 100%;
    max-width: 320px;
    padding: 16px 18px 18px;
    margin: 8px 0 20px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--z-border);
    border-radius: 4px;
    font-family: var(--font-hud);
}

.pause-panel--settings .pause-volume-block {
    max-width: none;
}

.pause-volume-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.pause-volume-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--z-cream);
    letter-spacing: 0.04em;
}

.pause-volume-pct {
    font-size: 14px;
    font-weight: 700;
    color: var(--z-gold-bright);
    font-variant-numeric: tabular-nums;
    min-width: 3em;
    text-align: right;
}

.pause-volume-range {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(
        90deg,
        rgba(60, 52, 40, 0.9) 0%,
        rgba(201, 162, 39, 0.35) 100%
    );
    border-radius: 5px;
    border: 1px solid var(--z-border);
    cursor: pointer;
}

.pause-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--z-gold-bright), var(--z-gold));
    border: 1px solid #4a3d12;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

.pause-volume-range::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.pause-volume-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--z-gold-bright), var(--z-gold));
    border: 1px solid #4a3d12;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

.pause-volume-range::-moz-range-track {
    height: 10px;
    border-radius: 5px;
    background: transparent;
    border: none;
}

.pause-back-btn {
    width: 100%;
    max-width: 320px;
}

/* ——— Settings tab strip ——— */
.settings-tab-strip {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 0 0 18px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(90, 80, 65, 0.5);
    border-radius: 10px;
}

.settings-tab {
    flex: 1;
    padding: 10px 12px;
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--z-cream-dim);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.settings-tab:hover {
    color: var(--z-cream);
    background: rgba(255, 255, 255, 0.04);
}

.settings-tab--active {
    color: var(--z-gold-bright);
    background: rgba(201, 162, 39, 0.14);
    border-color: rgba(201, 162, 39, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.settings-tab-content {
    width: 100%;
}

.settings-tab-content--hidden {
    display: none !important;
}

/* ——— Voice settings ——— */
.voice-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Wrapper for mic / volume / PTT sections; `contents` lets them sit in the 2-col grid */
.voice-settings-body {
    display: contents;
}

.voice-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.voice-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.voice-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(60, 52, 40, 0.8);
    border: 1px solid var(--z-border);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.voice-toggle-slider::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--z-cream-dim);
    transition: transform 0.2s, background 0.2s;
}

.voice-toggle input:checked + .voice-toggle-slider {
    background: rgba(201, 162, 39, 0.45);
    border-color: var(--z-gold);
}

.voice-toggle input:checked + .voice-toggle-slider::before {
    transform: translateX(20px);
    background: var(--z-gold-bright);
}

.voice-select {
    width: 100%;
    padding: 8px 10px;
    font-family: var(--font-hud);
    font-size: 14px;
    font-weight: 600;
    color: var(--z-cream);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--z-border);
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a958a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.voice-select:focus {
    outline: none;
    border-color: var(--z-gold);
}

.voice-mic-status {
    font-size: 12px;
    color: var(--z-cream-dim);
    margin: 8px 0 0;
    min-height: 1.2em;
}

.voice-settings-hint {
    font-size: 11px;
    color: var(--z-cream-dim);
    margin: 6px 0 0;
    line-height: 1.35;
    opacity: 0.9;
}

.voice-ptt-key-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(90, 80, 65, 0.35);
}

.voice-ptt-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--z-cream-dim);
}

.voice-ptt-key-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 6px 14px;
    font-family: var(--font-hud);
    font-size: 14px;
    font-weight: 700;
    color: var(--z-cream);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--z-border);
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: border-color 0.15s, background 0.15s;
}

.voice-ptt-key-btn:hover {
    border-color: var(--z-gold);
}

.voice-ptt-key-btn--listening {
    border-color: var(--z-gold-bright);
    background: rgba(201, 162, 39, 0.18);
    color: var(--z-gold-bright);
    animation: voice-ptt-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes voice-ptt-pulse {
    from { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.3); }
    to   { box-shadow: 0 0 8px 2px rgba(201, 162, 39, 0.15); }
}

/* ——— Voice mic indicator (in-game HUD) ——— */
.voice-mic-indicator {
    position: fixed;
    bottom: 140px;
    left: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--z-border);
    z-index: 12;
    pointer-events: none;
    transition: opacity 0.2s, border-color 0.2s;
}

.voice-mic-indicator .voice-mic-icon,
.voice-mic-indicator .voice-mic-icon-muted {
    font-size: 16px;
    position: absolute;
}

.voice-mic-indicator .voice-mic-icon {
    display: none;
    color: #6ed66e;
}

.voice-mic-indicator .voice-mic-icon-muted {
    display: none;
    color: #c44;
}

.voice-mic--live .voice-mic-icon {
    display: block;
}

.voice-mic--live .voice-mic-icon-muted {
    display: none;
}

.voice-mic--live {
    border-color: #4a9e4a;
    animation: voice-live-glow 1.2s ease-in-out infinite alternate;
}

@keyframes voice-live-glow {
    from { box-shadow: 0 0 4px 1px rgba(110, 214, 110, 0.25); }
    to   { box-shadow: 0 0 10px 3px rgba(110, 214, 110, 0.35); }
}

.voice-mic--muted .voice-mic-icon {
    display: none;
}

.voice-mic--muted .voice-mic-icon-muted {
    display: block;
}

.voice-mic--muted {
    border-color: #5a2222;
    opacity: 0.7;
}

/* ——— Voice debug overlay (dev / ?voiceDebug=1) ——— */
.voice-debug-overlay {
    position: fixed;
    top: 12px;
    left: 12px;
    max-width: min(520px, 96vw);
    max-height: 70vh;
    overflow: auto;
    z-index: 100;
    padding: 10px 12px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #cfe8cf;
    background: rgba(8, 14, 10, 0.92);
    border: 1px solid rgba(110, 214, 110, 0.35);
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.voice-debug-head {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #8fdf8f;
    margin-bottom: 4px;
}

.voice-debug-hint {
    margin: 0 0 8px;
    font-size: 10px;
    color: rgba(200, 230, 200, 0.65);
}

.voice-debug-hint code {
    color: #a8e6a8;
    font-size: inherit;
}

.voice-debug-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    color: #d8f0d8;
}

#gameCanvas:focus {
    outline: none;
}

#uiLayer.uiLayer--paused .crosshair {
    opacity: 0;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 10;
    transition: opacity 0.35s ease, visibility 0.35s;
    background: radial-gradient(ellipse 120% 80% at 50% 40%, rgba(28, 22, 18, 0.97), rgba(4, 4, 3, 0.98));
}

/*
 * Main menu: logo + buttons anchored to the left, fully transparent so
 * the 3D night scene shows through completely.
 */
.overlay.overlay-menu {
    align-items: flex-start;
    justify-content: flex-start;
    padding: clamp(32px, 6vmin, 72px) clamp(28px, 5vw, 72px);
    background: none;
    box-shadow: none;
}

/* ── Floating content block ── */
.menu-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: menuContentIn 0.65s ease-out both;
}

@keyframes menuContentIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Logo ── */
.menu-logo {
    display: block;
    width: clamp(220px, 36vw, 460px);
    max-width: 80vw;
    height: auto;
    margin-bottom: clamp(14px, 2.2vmin, 28px);
    filter:
        drop-shadow(0 4px 24px rgba(0, 0, 0, 0.9))
        drop-shadow(0 2px 6px rgba(0, 0, 0, 1));
    animation: menuLogoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    user-select: none;
}

@keyframes menuLogoIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* ── Menu buttons ── */
.menu-btn-stack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: clamp(220px, 36vw, 460px);
    max-width: 80vw;
    margin-top: clamp(24px, 5vmin, 60px);
}

.btn-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    outline: none;
    transform: skewX(-8deg);
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-menu:hover {
    transform: skewX(-8deg) translateX(10px) scale(1.05);
}

/* Coloured left accent bar */
.btn-menu-bar {
    display: block;
    width: 6px;
    height: 100%;
    position: absolute;
    left: -6px;
    top: 0;
    background: var(--z-red-bright);
    transition: width 0.2s ease, left 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--z-red-bright);
}

/* Text pill */
.btn-menu-label {
    display: block;
    width: 100%;
    padding: 16px 24px 14px 24px;
    font-family: var(--font-display);
    font-size: clamp(20px, 2.5vw, 28px);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--z-cream);
    background: linear-gradient(90deg, rgba(20, 4, 4, 0.85) 0%, rgba(10, 2, 2, 0.6) 100%);
    border: 1px solid var(--z-red);
    border-left: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        text-shadow 0.2s ease,
        box-shadow 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.btn-menu:hover .btn-menu-bar {
    width: 10px;
    left: -10px;
    box-shadow: 0 0 20px var(--z-red-bright), 0 0 40px var(--z-red);
}

.btn-menu:hover .btn-menu-label {
    background: linear-gradient(90deg, rgba(40, 8, 8, 0.9) 0%, rgba(20, 4, 4, 0.7) 100%);
    color: #fff;
    border-color: var(--z-red-bright);
    text-shadow: 0 0 10px var(--z-red-bright), 0 2px 4px rgba(0, 0, 0, 0.9);
    box-shadow: inset 0 0 30px rgba(139, 21, 56, 0.4), 0 0 20px rgba(139, 21, 56, 0.2);
}

.btn-menu:active {
    transform: skewX(-8deg) translateX(5px) scale(0.98);
}

.btn-menu:active .btn-menu-label {
    background: rgba(20, 4, 4, 0.95);
    filter: brightness(0.8);
}

/* Dimmed secondary (Multiplayer) */
.btn-menu--dim .btn-menu-bar {
    background: var(--z-gold);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.btn-menu--dim .btn-menu-label {
    color: var(--z-cream-dim);
    background: linear-gradient(90deg, rgba(12, 10, 4, 0.85) 0%, rgba(6, 5, 2, 0.6) 100%);
    border-color: rgba(201, 162, 39, 0.3);
}

.btn-menu--dim:hover .btn-menu-bar {
    background: var(--z-gold-bright);
    box-shadow: 0 0 20px var(--z-gold-bright), 0 0 40px var(--z-gold);
}

.btn-menu--dim:hover .btn-menu-label {
    color: #fff;
    background: linear-gradient(90deg, rgba(30, 24, 10, 0.9) 0%, rgba(15, 12, 5, 0.7) 100%);
    border-color: var(--z-gold-bright);
    text-shadow: 0 0 10px var(--z-gold-bright), 0 2px 4px rgba(0, 0, 0, 0.9);
    box-shadow: inset 0 0 30px rgba(201, 162, 39, 0.2), 0 0 20px rgba(201, 162, 39, 0.1);
}

body[data-app-screen="main_menu"] #gameCanvas,
body[data-app-screen="lobby"] #gameCanvas {
    pointer-events: none;
}

.overlay-grain {
    position: absolute;
    inset: 0;
    opacity: 0.07;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.overlay-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 960px;
    padding: 24px;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.menu-kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4em;
    color: var(--z-gold);
    margin: 0 0 12px;
}

.menu-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 12vw, 120px);
    line-height: 0.92;
    margin: 0 0 8px;
    color: var(--z-cream);
    text-shadow: 0 4px 0 #1a1510;
    letter-spacing: 0.02em;
}

.menu-title-sub {
    color: var(--z-gold-bright);
    font-size: 0.55em;
    letter-spacing: 0.28em;
}

.menu-tagline {
    font-size: 18px;
    color: var(--z-cream-dim);
    margin: 0 0 36px;
    font-weight: 500;
}

.gameover-title {
    font-family: var(--font-display);
    font-size: clamp(72px, 14vw, 140px);
    margin: 0 0 16px;
    color: var(--z-red-bright);
    letter-spacing: 0.2em;
    text-shadow: 0 0 40px rgba(224, 32, 64, 0.4);
}

.gameover-stats {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    color: var(--z-cream-dim);
    margin: 0 0 40px;
    font-weight: 500;
}

/* ——— Buttons ——— */
.btn-cod,
button.btn-cod {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: 0.2em;
    padding: 16px 48px 14px;
    color: var(--z-bg);
    background: linear-gradient(180deg, var(--z-gold-bright) 0%, var(--z-gold) 55%, #8a6f18 100%);
    border: none;
    border-bottom: 4px solid #4a3d12;
    cursor: pointer;
    text-transform: uppercase;
    text-indent: 0.2em;
    transition: transform 0.12s ease, filter 0.12s, border-bottom-width 0.12s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.btn-cod:hover {
    transform: translateY(1px);
    filter: brightness(1.08);
    border-bottom-width: 3px;
}

.btn-cod:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
}

.btn-cod-secondary {
    background: linear-gradient(180deg, #3a3530 0%, #252220 100%);
    color: var(--z-cream);
    border-bottom: 4px solid #0d0c0b;
    border: 1px solid var(--z-border);
    border-bottom-width: 4px;
}

.btn-cod-secondary:hover {
    border-color: var(--z-gold);
    color: var(--z-gold-bright);
}

/* ——— Damage vignette ——— */
#damageOverlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0);
    transition: box-shadow 0.12s ease;
}

/* ——— Downed: color grade over canvas (below HUD chrome) ——— */
#downedFxLayer.downed-fx-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.1s linear;
}

#downedFxLayer.downed-fx-layer.hidden {
    display: none;
}

.downed-fx-bw {
    position: absolute;
    inset: 0;
    backdrop-filter: grayscale(1) brightness(0.93);
    -webkit-backdrop-filter: grayscale(1) brightness(0.93);
}

.downed-fx-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 32%, rgba(0, 0, 0, 0.62) 100%);
    pointer-events: none;
}

.downed-fx-red {
    position: absolute;
    inset: 0;
    background: rgb(42, 4, 8);
    opacity: 0;
    mix-blend-mode: multiply;
    pointer-events: none;
    transition: opacity 0.15s linear;
}

/* Full-screen blink (eyelids closing): peaks mid-cycle, scaled by downed FX fade */
.downed-fx-blink {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 85% 90% at 50% 45%, rgba(12, 6, 8, 0.15) 0%, #020102 75%);
    opacity: 0;
    pointer-events: none;
}

/* ——— Solo downed / self-revive ——— */
#downedHud.hud-downed {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 10vh clamp(16px, 4vw, 32px) clamp(14vh, 18vh, 160px);
    box-sizing: border-box;
}

#downedHud.hud-downed.hidden {
    display: none;
}

/* No card / border — loose type + meters only */
.hud-downed-panel {
    width: min(440px, 92vw);
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    text-align: center;
}

.hud-downed-eyebrow {
    margin: 0 0 10px;
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: rgba(228, 223, 212, 0.55);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.hud-downed-title {
    margin: 0 0 28px;
    font-family: var(--font-display);
    font-size: clamp(34px, 9vw, 48px);
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: 1.08;
    text-transform: uppercase;
    color: #f0ebe3;
    text-shadow:
        0 2px 20px rgba(0, 0, 0, 0.95),
        0 0 60px rgba(139, 21, 56, 0.35),
        0 1px 0 rgba(0, 0, 0, 0.8);
}

/* Hairline accent — reads as typography, not a frame */
.hud-downed-rule {
    width: min(180px, 48vw);
    height: 1px;
    margin: 0 auto 22px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 162, 39, 0.55) 22%,
        rgba(201, 162, 39, 0.9) 50%,
        rgba(201, 162, 39, 0.55) 78%,
        transparent 100%
    );
    border: none;
    border-radius: 0;
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.2);
}

.hud-downed-ring-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
}

.downed-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.ring-track {
    fill: rgba(0, 0, 0, 0.35);
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}

.ring-revive {
    fill: none;
    stroke: var(--z-green-hint);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 8px rgba(106, 158, 106, 0.45));
}

#downedHud.hud-downed--no-self-revive .ring-revive {
    opacity: 0.2;
    filter: none;
    transition:
        stroke-dashoffset 0.1s linear,
        opacity 0.35s ease;
}

.ekg-group {
    transform-origin: 60px 60px;
    transform: rotate(90deg);
}

.ekg-line {
    fill: none;
    stroke: #4a9e4a;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(74, 158, 74, 0.5));
    stroke-dasharray: 40 200;
    stroke-dashoffset: 40;
}

@keyframes ekg-trail {
    0% { stroke-dashoffset: 40; }
    100% { stroke-dashoffset: -180; }
}

/* ——— Multiplayer: ally revive (same language as #interactionText — panel + bar) ——— */
.ally-revive-hud {
    position: absolute;
    left: 50%;
    bottom: 22%;
    transform: translateX(-50%);
    z-index: 7;
    pointer-events: none;
    max-width: min(420px, 92vw);
}

.ally-revive-hud.hidden {
    display: none !important;
}

.ally-revive-panel {
    padding: 12px 24px 14px;
    font-family: var(--font-hud);
    text-align: center;
    color: var(--z-cream);
    background: var(--z-panel);
    border: 1px solid var(--z-border);
    border-left: 3px solid var(--z-green-hint);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
}

.ally-revive-line {
    margin: 0 0 10px;
    font-size: clamp(14px, 1.9vw, 18px);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ally-revive-name {
    color: var(--z-gold-bright);
    font-weight: 700;
}

.ally-revive-bar-track {
    height: 5px;
    margin: 0 auto;
    max-width: 280px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 1px;
    overflow: hidden;
}

.ally-revive-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--z-gold) 0%, var(--z-gold-bright) 100%);
    transition: width 0.08s linear;
}

.ally-revive-hint {
    margin: 10px 0 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--z-cream-dim);
}

.ally-revive-key {
    display: inline-block;
    min-width: 1.5em;
    padding: 2px 8px;
    margin: 0 2px;
    font-weight: 700;
    color: var(--z-bg);
    background: var(--z-cream);
    border: 1px solid var(--z-border);
    border-radius: 2px;
    font-size: 0.92em;
    letter-spacing: 0.06em;
}

#uiLayer.uiLayer--paused .ally-revive-hud {
    display: none !important;
}

.ekg-pulse-anim {
    animation: ekg-trail 1.5s linear infinite;
}

.hud-downed-hint {
    margin: 22px 0 0;
    padding: 0;
    border: none;
    font-family: var(--font-hud);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-align: center;
    color: rgba(168, 163, 154, 0.95);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.hud-downed-key {
    display: inline-block;
    min-width: 1.6em;
    padding: 4px 10px 3px;
    margin: 0 4px;
    font-family: var(--font-hud);
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #121210;
    background: linear-gradient(180deg, #e8d48a 0%, #c9a227 50%, #8a7020 100%);
    border: none;
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 2px 14px rgba(0, 0, 0, 0.5);
    vertical-align: middle;
}

#uiLayer.uiLayer--player-downed .hud-health-block.hud-health-block--downed-hidden {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: none;
    transition:
        opacity 0.4s ease,
        visibility 0.4s ease,
        max-height 0.4s ease;
}

#uiLayer.uiLayer--player-downed .crosshair {
    opacity: 0;
    transition: opacity 0.35s ease;
}

#uiLayer.uiLayer--player-downed .hud-top,
#uiLayer.uiLayer--player-downed .hud-right-stack {
    display: none;
}

/* Upgrade pick / gamble can stay “open” in state while downed — hide until revived. */
#uiLayer.uiLayer--player-downed #upgradeHud,
#uiLayer.uiLayer--player-downed #upgradeGambleOverlay {
    display: none !important;
}

/* Timed power-up buff row (double points, insta-kill, etc.) — hide while downed. */
#uiLayer.uiLayer--player-downed #hudPowerupBuffs {
    display: none !important;
}

#uiLayer.uiLayer--spectating .hud-top,
#uiLayer.uiLayer--spectating .hud-bottom,
#uiLayer.uiLayer--spectating .crosshair,
#uiLayer.uiLayer--spectating #hudWorldPerks,
#uiLayer.uiLayer--spectating #interactionText {
    display: none !important;
}

.spectate-hud {
    position: absolute;
    left: 50%;
    bottom: clamp(20px, 5vh, 48px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 22px 10px;
    z-index: 5;
    background: linear-gradient(180deg, rgba(22, 20, 16, 0.94) 0%, rgba(10, 9, 7, 0.9) 100%);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 6px;
    box-shadow:
        0 6px 28px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.spectate-hud.hidden {
    display: none !important;
}

.spectate-hud-eyebrow {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 200, 120, 0.72);
}

.spectate-hud-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(15px, 2.2vw, 20px);
    font-weight: 700;
    color: #f2ebe0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.spectate-hud-hint {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(228, 223, 212, 0.45);
    margin-top: 2px;
}

/* ——— Multiplayer scoreboard (hold Q) ——— */
.scoreboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(48px, 10vh, 120px);
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 45%, transparent 100%);
}

.scoreboard-overlay.hidden {
    display: none !important;
}

.scoreboard-panel {
    min-width: min(520px, calc(100vw - 48px));
    max-width: 640px;
    padding: 0;
    background: linear-gradient(180deg, rgba(14, 12, 10, 0.96) 0%, rgba(8, 7, 6, 0.94) 100%);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-radius: 4px;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.scoreboard-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.22);
    background: rgba(0, 0, 0, 0.25);
}

.scoreboard-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.4vw, 1.45rem);
    letter-spacing: 0.2em;
    color: var(--z-gold-bright);
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.35);
}

.scoreboard-hint {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(228, 223, 212, 0.45);
}

.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-hud);
    font-size: 13px;
}

.scoreboard-table thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(228, 223, 212, 0.55);
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.scoreboard-table thead th:not(:first-child) {
    text-align: center;
}

.scoreboard-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--z-cream);
}

.scoreboard-table tbody tr:last-child td {
    border-bottom: none;
}

.scoreboard-name {
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scoreboard-you {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(201, 162, 39, 0.85);
}

.scoreboard-row--self td {
    background: rgba(201, 162, 39, 0.08);
}

.scoreboard-num {
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: rgba(228, 223, 212, 0.92);
}

#uiLayer.uiLayer--paused .scoreboard-overlay:not(.hidden) {
    z-index: 400;
}

/* ——— Dev: muzzle offset tuner (top-left) ——— */
.muzzle-tuner-panel {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200000;
    width: min(280px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #e8e4dc;
    background: rgba(12, 12, 18, 0.92);
    border: 1px solid rgba(255, 200, 120, 0.35);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
}

.muzzle-tuner-panel.hidden {
    display: none !important;
}

.muzzle-tuner-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.muzzle-tuner-title {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f0c060;
}

.muzzle-tuner-weapon {
    font-size: 10px;
    color: #9a9590;
}

.muzzle-tuner-out {
    margin: 0 0 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    color: #7fd8a8;
    word-break: break-all;
}

.muzzle-tuner-axis {
    display: grid;
    grid-template-columns: 58px 1fr 72px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.muzzle-tuner-label {
    color: #b8b3ab;
    font-size: 10px;
}

.muzzle-tuner-range {
    width: 100%;
    accent-color: #d4a020;
}

.muzzle-tuner-num {
    width: 100%;
    padding: 3px 5px;
    font-family: inherit;
    font-size: 11px;
    color: #f5f2ec;
    background: #1a1a22;
    border: 1px solid #3a3844;
    border-radius: 3px;
}

.muzzle-tuner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.muzzle-tuner-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-family: var(--font-hud, sans-serif);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1510;
    background: linear-gradient(180deg, #e8c86a 0%, #b8922e 100%);
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.muzzle-tuner-btn--ghost {
    color: #d8d4cc;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.muzzle-tuner-btn:hover {
    filter: brightness(1.08);
}

.muzzle-tuner-status {
    min-height: 1.2em;
    margin: 6px 0 0;
    font-size: 10px;
    color: #7fd8a8;
}

.muzzle-tuner-hint {
    margin: 8px 0 0;
    font-size: 9px;
    color: #7a7670;
    line-height: 1.4;
}

.muzzle-tuner-hint code {
    font-size: 9px;
    color: #c9b896;
}

/* ——— Menu button stack ——— */
/* ——— Lobby overlay (same 3D backdrop as main menu; readable glass over scene) ——— */
/* ═══════════════════════════════════════════════════════════════════
   LOBBY — fully transparent overlay, 3-D scene always visible
   ═══════════════════════════════════════════════════════════════════ */

.overlay-lobby {
    z-index: 22;
    background: none;
    box-shadow: none;
    /* Left-aligned panels; pointer-events re-enabled per child */
    align-items: flex-start;
    justify-content: flex-start;
    pointer-events: none;
}
.overlay-lobby > * {
    pointer-events: auto;
}

/* ══ FULL-SCREEN SERVER BROWSER (.sbr-*) ════════════════════════════════ */

#lobbyBrowserPhase {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    animation: sbrFadeIn 0.3s ease both;
}
#lobbyBrowserPhase.hidden { display: none !important; }

@keyframes sbrFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#lobbyBrowserPhase.sbr-exit {
    animation: sbrFadeOut 0.22s ease forwards;
    pointer-events: none;
}
@keyframes sbrFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes lobbyPanelIn {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.sbr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 10, 0.93);
    pointer-events: none;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.sbr-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px clamp(28px, 5vw, 72px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sbr-back {
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.38);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
    min-width: 100px;
}
.sbr-back:hover { color: rgba(255, 255, 255, 0.8); }

.sbr-title-group { text-align: center; }
.sbr-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 2.2vw, 26px);
    font-weight: 700;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
}
.sbr-subtitle {
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.22);
    display: block;
    margin-top: 3px;
}

.sbr-refresh {
    min-width: 100px;
    text-align: right;
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.32);
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.sbr-refresh:hover { color: var(--z-gold-bright); border-color: rgba(201, 162, 39, 0.45); }

/* ── Body ────────────────────────────────────────────────────────────── */
.sbr-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    min-height: 0;
    padding: clamp(28px, 4vh, 52px) clamp(28px, 5vw, 72px);
}

/* ── Server list ─────────────────────────────────────────────────────── */
.sbr-list-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-right: 48px;
}

.sbr-list-head {
    display: grid;
    grid-template-columns: 1fr 130px 110px;
    padding: 0 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}
.sbr-lh-name, .sbr-lh-players, .sbr-lh-action {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.22);
}
.sbr-lh-players, .sbr-lh-action { text-align: center; }

.sbr-list-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* Server rows */
.lobby-room-item {
    display: grid;
    grid-template-columns: 1fr 130px 110px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.lobby-room-item:hover {
    background: rgba(201, 162, 39, 0.05);
    border-color: rgba(201, 162, 39, 0.28);
}

.sbr-row-name {
    font-family: var(--font-hud);
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px;
}

.sbr-row-players {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.sbr-row-pips {
    display: flex;
    gap: 5px;
}
.sbr-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}
.sbr-pip--filled {
    background: var(--z-gold);
    box-shadow: 0 0 5px rgba(201, 162, 39, 0.55);
}
.sbr-row-count {
    font-family: var(--font-hud);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.28);
    letter-spacing: 0.04em;
}

.sbr-row-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sbr-row-lock { font-size: 12px; color: rgba(255, 255, 255, 0.3); }

.sbr-join-btn {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 7px 16px;
    cursor: pointer;
    pointer-events: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lobby-room-item:hover .sbr-join-btn {
    background: var(--z-gold);
    border-color: var(--z-gold);
    color: rgba(0, 0, 0, 0.85);
}

.sbr-list-status {
    font-family: var(--font-hud);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 8px 16px 0;
    margin: 0;
    min-height: 20px;
}
.sbr-list-empty {
    font-family: var(--font-hud);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.18);
    text-align: center;
    padding: 48px 16px;
    letter-spacing: 0.08em;
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.sbr-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.06);
    align-self: stretch;
    flex-shrink: 0;
}

/* ── Create panel ────────────────────────────────────────────────────── */
.sbr-create-section {
    width: clamp(260px, 26vw, 340px);
    flex-shrink: 0;
    padding-left: 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.sbr-create-title {
    font-family: var(--font-display);
    font-size: clamp(15px, 1.6vw, 19px);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}
.sbr-create-sub {
    font-family: var(--font-hud);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    margin: -10px 0 0;
    letter-spacing: 0.04em;
    line-height: 1.5;
}
.sbr-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.sbr-field-label {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.28);
}
.sbr-opt {
    font-weight: 400;
    opacity: 0.65;
    letter-spacing: 0;
    text-transform: none;
}
.sbr-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font-hud);
    font-size: 14px;
    padding: 12px 14px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}
.sbr-input::placeholder { color: rgba(255, 255, 255, 0.16); }
.sbr-input:focus {
    border-color: rgba(201, 162, 39, 0.45);
    background: rgba(255, 255, 255, 0.06);
}
.sbr-create-btn {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(0, 0, 0, 0.85);
    background: linear-gradient(135deg, #9a7014, #d8a82a);
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    cursor: pointer;
    width: 100%;
    transition: filter 0.18s, transform 0.12s;
}
.sbr-create-btn:hover  { filter: brightness(1.18); }
.sbr-create-btn:active { transform: scale(0.97); }

/* ── Password join overlay ───────────────────────────────────────────── */
.sbr-pw-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 4, 10, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}
.sbr-pw-overlay.hidden { display: none; }
.sbr-pw-box {
    background: rgba(8, 12, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 36px 40px;
    width: min(360px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sbr-pw-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-align: center;
}
.sbr-pw-actions {
    display: flex;
    gap: 10px;
}
.sbr-pw-actions .sbr-create-btn { margin-top: 0; }
.sbr-cancel-btn {
    flex: 1;
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.sbr-cancel-btn:hover { color: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.2); }

/* ═══════════════════════════════════════════════════════════════════
   IN-ROOM LOBBY  (.lobby-in-room / .lir-*)
   Horizontal bottom bar — no box, floats over the 3-D scene.
   ═══════════════════════════════════════════════════════════════════ */

.lobby-in-room {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 18px clamp(28px, 5vw, 72px);
    animation: lobbyPanelIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.lobby-in-room.lir-exit {
    animation: lobbyPanelOut 0.2s ease forwards;
    pointer-events: none;
}
@keyframes lobbyPanelOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}

/* Gradient tint lives in ::before so the mask never touches button text */
.lobby-in-room::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;

    /* Horizontal: dark on left, dissolves right */
    background: linear-gradient(
        to right,
        rgba(2, 5, 18, 0.92) 0%,
        rgba(2, 5, 18, 0.75) 30%,
        rgba(2, 5, 18, 0.35) 65%,
        transparent 100%
    );

    /* Vertical: solid at bottom, fades to transparent at top */
    -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
    mask-image:         linear-gradient(to top, black 50%, transparent 100%);
}

/* Ensure all direct children sit above the ::before layer */
.lobby-in-room > * {
    position: relative;
    z-index: 1;
}

/* ── Vertical separator ────────────────────────────────────────────── */
.lir-sep {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    margin: 0 28px;
}

/* ── Left column: leave + room info ───────────────────────────────── */
.lir-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    /* Flex item must opt-in to shrinking below content size */
    flex: 0 1 220px;
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
}

.lir-leave-link {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    transition: color 0.15s;
}
.lir-leave-link:hover { color: rgba(240, 80, 80, 0.85); }

.lir-room-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.lir-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #44cc66;
    box-shadow: 0 0 8px rgba(68, 204, 102, 0.85);
    animation: lirPulse 2.4s ease-in-out infinite;
}
@keyframes lirPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.lir-player-count {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.lir-room-name {
    font-family: var(--font-display);
    font-size: clamp(16px, 2vw, 22px);
    letter-spacing: 0.08em;
    color: var(--z-cream);
    /* Must have all three for ellipsis to work inside a flex child */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 1), 0 1px 3px rgba(0, 0, 0, 1);
}

.lir-status {
    font-family: var(--font-hud);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.22);
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.lir-status:empty { display: none; }

/* ── Centre: 4 player slots horizontal ───────────────────────────── */
.lir-slots {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 10px;
    min-width: 0;
}

.lir-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 6px 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
    transition: border-color 0.2s;
}
.lir-slot--filled  { border-color: rgba(255, 255, 255, 0.18); }
.lir-slot--ready   { border-color: rgba(68, 204, 102, 0.55); }
.lir-slot--local   { border-color: rgba(201, 162, 39, 0.6); }
.lir-slot--empty   { opacity: 0.22; }

/* Top row inside each slot: dot + name */
.lir-slot-top {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
}

.lir-slot-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.2s, box-shadow 0.2s;
}
.lir-slot--ready  .lir-slot-dot { background: #44cc66; box-shadow: 0 0 5px rgba(68, 204, 102, 0.75); }
.lir-slot--local  .lir-slot-dot { background: var(--z-gold); box-shadow: 0 0 5px rgba(201, 162, 39, 0.7); }

.lir-slot-name {
    font-family: var(--font-hud);
    font-size: clamp(12px, 1.3vw, 15px);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}
.lir-slot--local .lir-slot-name { color: rgba(255, 255, 255, 0.95); }
.lir-slot--ready .lir-slot-name { color: rgba(255, 255, 255, 0.8); }
.lir-slot--empty .lir-slot-name { font-style: italic; font-weight: 400; }

/* Bottom row inside each slot: badges — fixed height so the ✓ never shifts layout */
.lir-slot-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 14px;
    overflow: hidden;
}

.lir-slot-badge {
    font-family: var(--font-hud);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--z-gold);
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.lir-slot-check {
    font-size: 11px;
    font-weight: 700;
    color: #44cc66;
    text-shadow: 0 0 8px rgba(68, 204, 102, 0.6);
}

/* ── Right: action buttons ─────────────────────────────────────────── */
.lir-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;       /* both buttons expand to the same width */
    justify-content: center;    /* vertically centre button(s) in the bar */
    align-self: stretch;        /* fill full bar height so justify-content works */
    gap: 6px;
    flex-shrink: 0;
    min-width: 160px;
}

/* Both buttons fill the container so they're identical in width */
.lir-actions .btn-menu {
    width: 100%;
}
/* Start game must fully collapse (not just invisible) so Ready centres alone */
.lir-actions .btn-menu.hidden {
    display: none;
}
.lir-actions .btn-menu-label {
    width: 100%;
    white-space: nowrap;
    font-size: clamp(13px, 1.3vw, 16px);
    letter-spacing: 0.2em;
    padding: 10px 20px;
}

/* Gold accent for START GAME */
.btn-menu--start .btn-menu-bar   { background: var(--z-gold-bright); box-shadow: 0 0 8px rgba(201, 162, 39, 0.5); }
.btn-menu--start .btn-menu-label { color: var(--z-gold-bright); }
.btn-menu--start:hover .btn-menu-bar  { width: 6px; background: var(--z-gold-bright); }
.btn-menu--start:hover .btn-menu-label { background: rgba(201, 162, 39, 0.12); color: #fff; padding-left: 18px; }

/* Ready active state — green */
.btn-ready-active .btn-menu-bar   { background: #44cc66 !important; box-shadow: 0 0 10px rgba(68, 204, 102, 0.6) !important; }
.btn-ready-active .btn-menu-label { color: #44cc66 !important; }

/* ══ Network toast (unchanged) ══════════════════════════════════════ */
.network-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-hud);
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    background: rgba(12, 14, 11, 0.92);
    border: 1px solid var(--z-red);
    border-radius: 6px;
    color: var(--z-cream);
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s;
}


