@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Rajdhani:wght@600;700&display=swap');

:root {
    --bg-dark: #07070b;
    --nes-gold: #ffcc00;
    --nes-gold-glow: rgba(255, 204, 0, 0.45);
    --nes-red: #ff1744;
    --nes-green: #00e676;
    --nes-cyan: #00e5ff;
    --team-red: #ff3366;
    --team-blue: #00e5ff;
    --font-retro: 'Press Start 2P', monospace;
    --font-body: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(20, 24, 40, 0.8) 0%, rgba(5, 5, 8, 1) 100%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 32px 32px, 32px 32px;
    color: #ffffff;
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    padding: 12px;
}

.game-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #000000;
    border: 3px solid #2a2a38;
    border-radius: 16px;
    box-shadow: 
        0 0 35px rgba(0, 229, 255, 0.22), 
        0 0 90px rgba(0, 0, 0, 0.95),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    height: min(94vh, 880px);
    max-height: 96vh;
    max-width: calc(100vw - 24px);
    width: auto;
}

.canvas-wrapper {
    position: relative;
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
    flex-shrink: 1;
    min-width: 0;
}

canvas#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #000000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ==========================================================================
   RETRO HUD SIDEBAR (LARGER, WIDER, ULTRA CLEAR, NEVER CROPPED)
   ========================================================================== */
.hud-sidebar {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #12141c 0%, #0a0b10 100%);
    border-left: 3px solid #2a2a38;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--font-body);
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.hud-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeInHud 0.25s ease-out;
}

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

.hud-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.hud-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #8899bb;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.hud-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.gold-glow {
    color: var(--nes-gold);
    text-shadow: 0 0 12px var(--nes-gold-glow);
}

.hud-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #00e676;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 10px #00e676;
    animation: pulseDot 1.2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-subtext {
    font-size: 0.95rem;
    color: #99aacc;
    line-height: 1.45;
    font-weight: 600;
}

.team-target-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #778899;
    margin-top: 4px;
    white-space: nowrap;
}

.tank-icons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    max-height: 90px;
}

.mini-tank {
    width: 16px;
    height: 16px;
    background: var(--nes-red);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 23, 68, 0.5);
}

.hud-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
}

.btn-fullscreen {
    width: auto;
    min-width: 140px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 7px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #90a4ae;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: none;
    transition: all 0.2s ease;
}

.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ==========================================================================
   MAIN MENU OVERLAY (SPACIOUS, UN-CRAMPED, NO LINE BREAKS)
   ========================================================================== */
.ui-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(4, 5, 10, 0.94);
    backdrop-filter: blur(10px);
    z-index: 10;
    padding: 24px;
    text-align: center;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* MAIN MENU HEADER */
.menu-header {
    margin-bottom: 18px;
}

.arcade-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffeb3b;
    background: rgba(255, 235, 59, 0.1);
    border: 1.5px solid rgba(255, 235, 59, 0.4);
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.6);
    box-shadow: 0 0 12px rgba(255, 235, 59, 0.2);
    animation: badgePulse 2.5s ease-in-out infinite alternate;
}

h1.game-title {
    font-family: var(--font-retro);
    font-size: 2.2rem;
    margin-bottom: 8px;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: titleFloat 3.5s ease-in-out infinite alternate;
}

.title-main {
    background: linear-gradient(180deg, #fff9c4 0%, #ffd700 35%, #ffb300 65%, #e65100 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(255, 179, 0, 0.65))
            drop-shadow(3px 3px 0px #8c3b00)
            drop-shadow(5px 5px 0px #3d1400);
    letter-spacing: 2px;
    display: inline-block;
    animation: titleShimmer 3.5s ease-in-out infinite;
}

.game-title-sub {
    font-size: 1.15rem;
    letter-spacing: 1.5px;
    color: #00e5ff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.8),
                 0 0 20px rgba(0, 229, 255, 0.4),
                 2px 2px 0 #005b64;
    animation: cyberPulse 2.2s ease-in-out infinite alternate;
}

.game-subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: #80d8ff;
    letter-spacing: 1.8px;
    margin-top: 4px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    white-space: nowrap;
}

@keyframes titleFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(-0.3deg); }
    100% { transform: translateY(2px) rotate(0.3deg); }
}

@keyframes titleShimmer {
    0%, 100% {
        filter: drop-shadow(0 0 14px rgba(255, 179, 0, 0.5))
                drop-shadow(3px 3px 0px #8c3b00)
                drop-shadow(5px 5px 0px #3d1400);
    }
    50% {
        filter: drop-shadow(0 0 28px rgba(255, 215, 0, 0.95))
                drop-shadow(3px 3px 0px #b25000)
                drop-shadow(5px 5px 0px #3d1400);
    }
}

@keyframes cyberPulse {
    0% {
        color: #00e5ff;
        text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.4), 2px 2px 0 #005b64;
    }
    50% {
        color: #00ff66;
        text-shadow: 0 0 14px rgba(0, 255, 102, 0.9), 0 0 25px rgba(0, 255, 102, 0.5), 2px 2px 0 #005b26;
    }
    100% {
        color: #00e5ff;
        text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.4), 2px 2px 0 #005b64;
    }
}

@keyframes badgePulse {
    from {
        border-color: rgba(255, 235, 59, 0.3);
        box-shadow: 0 0 8px rgba(255, 235, 59, 0.15);
    }
    to {
        border-color: rgba(255, 235, 59, 0.8);
        box-shadow: 0 0 18px rgba(255, 235, 59, 0.45);
    }
}

/* ==========================================================================
   SPACIOUS SINGLE-COLUMN MENU LIST (NO LINE WRAPPING)
   ========================================================================== */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 550px;
    margin-bottom: 18px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    width: 100%;
    background: rgba(16, 20, 32, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 12px;
    pointer-events: none;
}

.menu-btn:hover {
    transform: translateX(8px) scale(1.015);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.menu-btn:active {
    transform: translateX(4px) translateY(1px) scale(0.995);
}

.btn-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.menu-btn:hover .btn-icon {
    transform: scale(1.22) rotate(-4deg);
}

.btn-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
}

.btn-title {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.btn-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: #8899bb;
    white-space: nowrap;
    transition: color 0.2s ease;
}

/* ==========================================================================
   VIBRANT COLORED HOVER THEMES FOR 4 MENU BUTTONS
   ========================================================================== */

/* 1. 1-PLAYER CAMPAIGN (WARM GOLD / AMBER ARCADE GLOW) */
.btn-solo {
    border-left: 5px solid #ff9100;
}
.btn-solo:hover {
    border-color: #ffb74d;
    border-left-color: #ffd54f;
    background: linear-gradient(90deg, rgba(255, 145, 0, 0.28) 0%, rgba(255, 193, 7, 0.14) 50%, rgba(20, 24, 38, 0.95) 100%);
    box-shadow: 
        0 8px 25px rgba(255, 145, 0, 0.4), 
        inset 0 0 20px rgba(255, 145, 0, 0.18),
        0 0 1px #ffb74d;
}
.btn-solo .btn-title { color: #ffb74d; }
.btn-solo:hover .btn-title {
    color: #fff176;
    text-shadow: 0 0 12px rgba(255, 213, 79, 0.7);
}
.btn-solo:hover .btn-desc {
    color: #fff9c4;
}
.btn-solo:hover .btn-icon {
    filter: drop-shadow(0 0 12px #ff9100) drop-shadow(0 0 20px rgba(255, 213, 79, 0.8));
}

/* 2. 2-PLAYERS CO-OP (NEON EMERALD / GREEN LASER GLOW) */
.btn-coop {
    border-left: 5px solid #00e676;
}
.btn-coop:hover {
    border-color: #69f0ae;
    border-left-color: #b9f6ca;
    background: linear-gradient(90deg, rgba(0, 230, 118, 0.28) 0%, rgba(105, 240, 174, 0.14) 50%, rgba(20, 24, 38, 0.95) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 230, 118, 0.4), 
        inset 0 0 20px rgba(0, 230, 118, 0.18),
        0 0 1px #69f0ae;
}
.btn-coop .btn-title { color: #69f0ae; }
.btn-coop:hover .btn-title {
    color: #ccff90;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.7);
}
.btn-coop:hover .btn-desc {
    color: #f1f8e9;
}
.btn-coop:hover .btn-icon {
    filter: drop-shadow(0 0 12px #00e676) drop-shadow(0 0 20px rgba(105, 240, 174, 0.8));
}

/* 3. 2V2 ONLINE MULTIPLAYER (CYBER ELECTRIC CYAN / BLUE PULSE) */
.btn-net {
    border-left: 5px solid #00e5ff;
}
.btn-net:hover {
    border-color: #84ffff;
    border-left-color: #e0f7fa;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.28) 0%, rgba(132, 255, 255, 0.14) 50%, rgba(20, 24, 38, 0.95) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 229, 255, 0.4), 
        inset 0 0 20px rgba(0, 229, 255, 0.18),
        0 0 1px #84ffff;
}
.btn-net .btn-title { color: #84ffff; }
.btn-net:hover .btn-title {
    color: #e0f7fa;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
}
.btn-net:hover .btn-desc {
    color: #ffffff;
}
.btn-net:hover .btn-icon {
    filter: drop-shadow(0 0 12px #00e5ff) drop-shadow(0 0 20px rgba(132, 255, 255, 0.8));
}

/* 4. CUSTOM MAP BUILDER (MYSTIC VIOLET / PURPLE NEON) */
.btn-build {
    border-left: 5px solid #b388ff;
}
.btn-build:hover {
    border-color: #d1c4e9;
    border-left-color: #ede7f6;
    background: linear-gradient(90deg, rgba(179, 136, 255, 0.28) 0%, rgba(209, 196, 233, 0.14) 50%, rgba(20, 24, 38, 0.95) 100%);
    box-shadow: 
        0 8px 25px rgba(179, 136, 255, 0.4), 
        inset 0 0 20px rgba(179, 136, 255, 0.18),
        0 0 1px #d1c4e9;
}
.btn-build .btn-title { color: #d1c4e9; }
.btn-build:hover .btn-title {
    color: #f3e5f5;
    text-shadow: 0 0 12px rgba(179, 136, 255, 0.7);
}
.btn-build:hover .btn-desc {
    color: #faf5ff;
}
.btn-build:hover .btn-icon {
    filter: drop-shadow(0 0 12px #b388ff) drop-shadow(0 0 20px rgba(209, 196, 233, 0.8));
}

/* ==========================================================================
   CRISP SPACIOUS CONTROLS CONSOLE
   ========================================================================== */
.controls-console {
    width: 100%;
    max-width: 550px;
    background: rgba(14, 16, 26, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
}

.console-card {
    background: rgba(10, 12, 20, 0.95);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.p1-card {
    border-top: 3px solid var(--nes-gold);
}

.p2-card {
    border-top: 3px solid var(--nes-green);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.head-title {
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.head-title.gold { color: var(--nes-gold); }
.head-title.green { color: var(--nes-green); }

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.badge-dot.gold { background: var(--nes-gold); box-shadow: 0 0 8px var(--nes-gold); }
.badge-dot.green { background: var(--nes-green); box-shadow: 0 0 8px var(--nes-green); }

.card-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
}

.label {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    color: #8899aa;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.keycap-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    color: #778899;
}

/* 3D RETRO KEYCAPS */
kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    background: linear-gradient(180deg, #32384a 0%, #1e2230 100%);
    color: #ffffff;
    border: 1px solid #5a6680;
    border-bottom: 2.5px solid #0f121a;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1;
}

kbd.wide {
    min-width: 60px;
    color: var(--nes-cyan);
    border-color: rgba(0, 229, 255, 0.4);
}

.console-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: #aaaaaa;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.bar-sep {
    color: #555566;
}

.gold {
    color: var(--nes-gold);
}

/* ==========================================================================
   CLEAN MINIMALIST ARCADE SQUAD LOBBY & WAITING ROOM
   ========================================================================== */
.lobby-view-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInLobby 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.lobby-title-compact {
    font-family: var(--font-retro);
    font-size: 1.3rem;
    color: var(--nes-gold);
    text-shadow: 2px 2px 0 #b26a00, 0 0 16px rgba(255, 204, 0, 0.4);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

/* Name Row */
.compact-name-row {
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    border: 1.5px solid rgba(255, 204, 0, 0.4);
    border-radius: 10px;
    padding: 8px 16px;
    margin-bottom: 18px;
}

.name-prefix {
    font-family: var(--font-retro);
    font-size: 0.75rem;
    color: var(--nes-gold);
    margin-right: 12px;
    letter-spacing: 1px;
}

.input-name-clean {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* Action Deck (Create / Join) */
.compact-action-deck {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.btn-clean {
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    transition: all 0.15s ease;
    text-align: left;
}

.btn-create {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.15) 0%, rgba(255, 179, 0, 0.05) 100%);
    border-color: rgba(255, 204, 0, 0.4);
}

.btn-create:hover {
    border-color: var(--nes-gold);
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.25) 0%, rgba(255, 179, 0, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.25);
}

.btn-create .btn-icon {
    font-size: 1.6rem;
}

.btn-create .btn-content {
    display: flex;
    flex-direction: column;
}

.btn-create .btn-main {
    font-family: var(--font-retro);
    font-size: 0.95rem;
    color: var(--nes-gold);
    letter-spacing: 0.5px;
}

.btn-create .btn-sub {
    font-size: 0.78rem;
    color: #90a4ae;
    margin-top: 2px;
}

.join-clean-box {
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-code-clean {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1.5px solid rgba(0, 229, 255, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--font-retro);
    font-size: 1.05rem;
    color: var(--nes-cyan);
    text-align: center;
    letter-spacing: 3px;
    outline: none;
}

.input-code-clean:focus {
    border-color: var(--nes-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.btn-join {
    width: 110px;
    padding: 12px 0;
    background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
    color: #000000;
    border-color: #81d4fa;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 1px;
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 229, 255, 0.4);
    filter: brightness(1.1);
}

/* ==========================================================================
   ACTIVE PUBLIC SQUADS BROWSER
   ========================================================================== */
.lobby-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.btn-refresh-mini {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #90a4ae;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-refresh-mini:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: #00e5ff;
}

.open-rooms-section {
    width: 100%;
    background: rgba(8, 10, 16, 0.75);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.open-rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.open-rooms-title {
    font-family: var(--font-retro);
    font-size: 0.76rem;
    color: #00e5ff;
    letter-spacing: 0.5px;
}

.open-rooms-subtitle {
    font-size: 0.72rem;
    color: #78909c;
}

.open-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 2px;
}

.no-rooms-msg {
    font-size: 0.8rem;
    color: #607d8b;
    text-align: center;
    padding: 14px 6px;
    font-style: italic;
}

.open-room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.15s ease;
}

.open-room-card:hover {
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.35);
    transform: translateX(2px);
}

.room-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.room-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-code-tag {
    font-family: var(--font-retro);
    font-size: 0.8rem;
    color: var(--nes-gold);
    font-weight: 700;
}

.room-host-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.room-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.badge-players {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-status-waiting {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(3, 169, 244, 0.15);
    color: #29b6f6;
}

.badge-status-playing {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 87, 34, 0.15);
    color: #ff7043;
}

.badge-custom-map {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(156, 39, 176, 0.15);
    color: #ce93d8;
}

.btn-card-join {
    background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
    border: none;
    border-radius: 6px;
    color: #000000;
    font-family: var(--font-retro);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-join:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

.btn-link-back {
    background: transparent;
    border: none;
    color: #78909c;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease;
}

.btn-link-back:hover {
    color: #ffffff;
}

/* ==========================================================================
   2. WAITING ROOM (CLEAN 4-ROW ROSTER)
   ========================================================================== */
.compact-lobby-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 14px;
}

.lobby-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
}

.squad-title-text {
    font-family: var(--font-retro);
    font-size: 0.85rem;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.count-tag {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--nes-gold);
    background: rgba(255, 204, 0, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

.code-pill {
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #78909c;
}

.code-val {
    font-family: var(--font-retro);
    font-size: 1.1rem;
    color: var(--nes-gold);
    background: #000000;
    border: 1px solid var(--nes-gold);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 2px;
}

.btn-copy-mini {
    background: rgba(255, 204, 0, 0.2);
    border: 1px solid var(--nes-gold);
    color: var(--nes-gold);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-mini:hover {
    background: var(--nes-gold);
    color: #000000;
}

/* 4 Clean Player Rows */
.compact-roster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
}

.player-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(14, 16, 26, 0.85);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease;
}

.player-row.slot-gold { border-left: 4px solid #ffb300; }
.player-row.slot-green { border-left: 4px solid #00e676; }
.player-row.slot-cyan { border-left: 4px solid #00e5ff; }
.player-row.slot-purple { border-left: 4px solid #e040fb; }

.player-avatar-badge {
    font-size: 0.82rem;
    font-weight: 700;
    width: 65px;
    letter-spacing: 0.5px;
}

.player-avatar-badge.gold { color: #ffb300; }
.player-avatar-badge.green { color: #00e676; }
.player-avatar-badge.cyan { color: #00e5ff; }
.player-avatar-badge.purple { color: #e040fb; }

.player-name-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-name-text.dim {
    color: #546e7a;
    font-weight: 500;
}

.player-state-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.player-state-badge.ready {
    color: #00e676;
    background: rgba(0, 230, 118, 0.15);
}

.player-state-badge.empty {
    color: #546e7a;
    background: rgba(255, 255, 255, 0.04);
}

/* Compact Actions Bar */
.compact-lobby-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-clean-start {
    flex: 1;
    padding: 13px 20px;
    background: linear-gradient(135deg, #2e7d32 0%, #00e676 100%);
    color: #000000;
    border: 1.5px solid #b9f6ca;
    border-radius: 8px;
    font-family: var(--font-retro);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.35);
}

.btn-clean-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.5);
    filter: brightness(1.1);
}

.btn-clean-start:disabled {
    background: #263238;
    color: #546e7a;
    border-color: #37474f;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}

.btn-clean-leave {
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.06);
    color: #90a4ae;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-clean-leave:hover {
    background: #c62828;
    color: #ffffff;
    border-color: #ef5350;
}

/* EDITOR PALETTE TOOLBAR (RETRO ARCADE CONTROLS) */
.editor-palette {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 16, 26, 0.96);
    border: 1.5px solid var(--nes-gold);
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 12;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
}

.palette-divider {
    width: 1px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.btn-palette-btn {
    padding: 7px 12px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-palette-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-palette-btn.btn-dice {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.2) 0%, rgba(255, 179, 0, 0.05) 100%);
    border-color: var(--nes-gold);
    color: var(--nes-gold);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.btn-palette-btn.btn-dice:hover {
    background: var(--nes-gold);
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.btn-palette-btn.btn-host-custom {
    background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
    color: #000000;
    border-color: #81d4fa;
    font-family: var(--font-retro);
    font-size: 0.76rem;
    padding: 7px 12px;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

.btn-palette-btn.btn-host-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.6);
    filter: brightness(1.1);
}

.btn-palette-btn.btn-play-custom {
    background: linear-gradient(135deg, #2e7d32 0%, #00e676 100%);
    color: #000000;
    border-color: #b9f6ca;
    font-family: var(--font-retro);
    font-size: 0.76rem;
    padding: 7px 12px;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.35);
}

.btn-palette-btn.btn-play-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(0, 230, 118, 0.6);
    filter: brightness(1.1);
}

.btn-palette-btn.btn-exit-custom {
    background: rgba(255, 255, 255, 0.05);
    color: #90a4ae;
}

.btn-palette-btn.btn-exit-custom:hover {
    background: #c62828;
    color: #ffffff;
    border-color: #ef5350;
}

.brush-tile {
    width: 32px;
    height: 32px;
    border: 2px solid #555;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.1s ease;
}

.brush-tile:hover {
    transform: scale(1.1);
}

.brush-tile.active {
    border-color: var(--nes-gold);
    box-shadow: 0 0 12px var(--nes-gold);
}

/* EMERGENCY WARNING BANNER */
.ingame-alert {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(183, 28, 28, 0.95);
    border: 2px solid #ff5252;
    box-shadow: 0 0 25px rgba(255, 23, 68, 0.9);
    padding: 10px 22px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 20;
    animation: alertPulse 0.8s infinite alternate ease-in-out;
    pointer-events: none;
}

.alert-icon {
    font-size: 1.3rem;
    animation: alertBounce 0.4s infinite alternate ease-in-out;
}

.alert-text {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px #000;
}

@keyframes alertPulse {
    0% { transform: translateX(-50%) scale(0.98); box-shadow: 0 0 10px rgba(255, 23, 68, 0.6); }
    100% { transform: translateX(-50%) scale(1.03); box-shadow: 0 0 30px rgba(255, 23, 68, 1); }
}

@keyframes alertBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

/* DANGER VIGNETTE */
.alert-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 60px rgba(255, 23, 68, 0.6), inset 0 0 100px rgba(255, 0, 0, 0.4);
    z-index: 15;
    animation: vignetteFlash 0.6s infinite alternate ease-in-out;
}

@keyframes vignetteFlash {
    0% { opacity: 0.3; }
    100% { opacity: 0.85; }
}

/* END GAME MODAL STYLES */
.end-game-badge {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 8px 22px;
    border-radius: 20px;
    background: #c62828;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: 1px;
    border: 2px solid #ef5350;
    box-shadow: 0 0 16px rgba(239, 83, 80, 0.6);
}

.end-game-badge.victory {
    background: #2e7d32;
    border-color: #66bb6a;
    box-shadow: 0 0 18px rgba(102, 187, 106, 0.7);
}

.end-game-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: #dddddd;
    margin-bottom: 20px;
    line-height: 1.4;
}

.stats-card {
    width: 100%;
    max-width: 420px;
    background: rgba(18, 20, 30, 0.9);
    border: 2px solid #444455;
    border-radius: 10px;
    padding: 16px 22px;
    margin-bottom: 22px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-value {
    font-size: 1.18rem;
    color: #ffffff;
}

/* ==========================================================================
   MODAL ACTION BUTTONS (PLAY AGAIN, RESUME, QUIT, MAIN MENU)
   ========================================================================== */
.modal-action-deck {
    display: flex;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 420px;
    margin-top: 10px;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: var(--font-retro);
    font-size: 0.88rem;
    letter-spacing: 0.8px;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    white-space: nowrap;
    text-transform: uppercase;
}

.modal-btn-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.modal-btn-text {
    line-height: 1;
}

/* Primary Action: Orange / Gold Flame */
.btn-action-primary {
    background: linear-gradient(135deg, #e65100 0%, #ff9800 100%);
    color: #000000;
    border-color: #ffe082;
    box-shadow: 0 4px 18px rgba(255, 152, 0, 0.4);
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 152, 0, 0.6);
    filter: brightness(1.1);
}

/* Success Action: Emerald Green (Next Stage / Resume) */
.btn-action-success {
    background: linear-gradient(135deg, #2e7d32 0%, #00e676 100%);
    color: #000000;
    border-color: #b9f6ca;
    box-shadow: 0 4px 18px rgba(0, 230, 118, 0.4);
}

.btn-action-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 230, 118, 0.6);
    filter: brightness(1.1);
}

/* Cyan Action: Online Multiplayer Lobby Return */
.btn-action-cyan {
    background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
    color: #000000;
    border-color: #81d4fa;
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.4);
}

.btn-action-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.6);
    filter: brightness(1.1);
}

/* Secondary Action: Sleek Dark Glassmorphism (Main Menu) */
.btn-action-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: #cfd8dc;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.btn-action-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.15);
}

/* Danger Action: Crimson Red (Quit to Menu) */
.btn-action-danger {
    background: rgba(211, 47, 47, 0.2);
    color: #ff8a80;
    border-color: rgba(255, 82, 82, 0.4);
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.3);
}

.btn-action-danger:hover {
    background: linear-gradient(135deg, #c62828 0%, #ff1744 100%);
    color: #ffffff;
    border-color: #ff8a80;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 23, 68, 0.5);
}

/* PAUSE SCREEN CARD */
.pause-card-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(14, 16, 26, 0.95);
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 229, 255, 0.2);
    max-width: 400px;
    width: 100%;
}

.pause-badge {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--nes-cyan);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.pause-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
}
