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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0f14;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: #e2e8f0;
}

.hidden {
    display: none !important;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#webglCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ================= Dynamic Tactical Crosshair ================= */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    pointer-events: none;
    z-index: 20;
    transition: transform 0.08s ease-out;
}

.ch-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    background: #38bdf8;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

.ch-line {
    position: absolute;
    background: rgba(226, 232, 240, 0.85);
    border-radius: 1px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    transition: transform 0.08s ease-out;
}

.ch-top {
    width: 2px;
    height: 9px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.ch-bottom {
    width: 2px;
    height: 9px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.ch-left {
    height: 2px;
    width: 9px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.ch-right {
    height: 2px;
    width: 9px;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Spread Crosshair on Movement or Firing */
#crosshair.spread .ch-top { transform: translate(-50%, -6px); }
#crosshair.spread .ch-bottom { transform: translate(-50%, 6px); }
#crosshair.spread .ch-left { transform: translate(-6px, -50%); }
#crosshair.spread .ch-right { transform: translate(6px, -50%); }

/* Hitmarker (X effect on hit) */
#hitmarker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.05s ease-out;
    pointer-events: none;
}

#hitmarker::before, #hitmarker::after {
    content: '';
    position: absolute;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

#hitmarker::before {
    width: 100%;
    height: 3px;
    top: 50%;
    transform: translateY(-50%);
}

#hitmarker::after {
    height: 100%;
    width: 3px;
    left: 50%;
    transform: translateX(-50%);
}

#hitmarker.active {
    opacity: 1;
}

/* ================= In-Game HUD ================= */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 32px;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand .badge {
    align-self: flex-start;
    font-size: 10px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.brand h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #f8fafc;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.brand h1 span {
    color: #38bdf8;
}

.hud-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toggle-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.toggle-btn.inverted {
    background: rgba(225, 29, 72, 0.85);
    border-color: #fb7185;
    color: #ffffff;
}

.score-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.3);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: 10px;
    text-align: right;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.score-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #94a3b8;
}

.score-val {
    font-size: 28px;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    font-family: 'Consolas', monospace;
}

/* Weapon Selection Tabs */
.hud-weapons {
    position: absolute;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.weapon-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    backdrop-filter: blur(6px);
}

.weapon-tab .key-hint {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
}

.weapon-tab .name {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

.weapon-tab:hover {
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.weapon-tab.active {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.8), rgba(3, 105, 161, 0.8));
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.weapon-tab.active .name {
    color: #ffffff;
}

.weapon-tab.active .key-hint {
    background: #38bdf8;
    color: #0f172a;
}

/* Bottom Right Ammo Card */
.hud-bottom-right {
    align-self: flex-end;
}

.weapon-info-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px 22px;
    min-width: 220px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.weapon-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#weaponName {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.fire-mode {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
}

.ammo-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
    font-family: 'Consolas', monospace;
}

.current-ammo {
    font-size: 38px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.slash {
    font-size: 20px;
    color: #64748b;
}

.max-ammo {
    font-size: 20px;
    color: #94a3b8;
    font-weight: 600;
}

.ammo-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.ammo-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    transition: width 0.15s ease-out;
}

/* Bottom Left Controls Pill */
.hud-bottom-left {
    position: absolute;
    bottom: 24px;
    left: 32px;
}

.controls-pill {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 12px;
    color: #cbd5e1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.controls-pill b {
    color: #38bdf8;
}

.controls-pill .sep {
    color: #475569;
}

/* ================= Blocker / Start Screen ================= */
#blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 20, 0.88);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 0.25s ease;
}

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

.modal-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
    max-width: 540px;
}

.icon-reticle {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
}

.modal-box h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #f8fafc;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 24px;
}

.feature-tags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.tag {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
}

.btn-start {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7, #0284c7 50%, #38bdf8);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.5);
    transition: all 0.2s ease;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.6);
}

.hint-text {
    margin-top: 14px;
    font-size: 12px;
    color: #64748b;
}

.hint-text b {
    color: #94a3b8;
}

/* ================= Loader Indicator ================= */
#loader {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #38bdf8;
    padding: 8px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 60;
    font-size: 13px;
    color: #38bdf8;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s;
}

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

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(56, 189, 248, 0.3);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================= Proximity Interaction Prompt ================= */
#interactPrompt {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid #38bdf8;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 30px;
    pointer-events: none;
    z-index: 50;
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulsePrompt 1.6s infinite ease-in-out;
}

#interactPrompt.hidden {
    display: none;
}

@keyframes pulsePrompt {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.06); }
}

/* ================= Retro Horror Dialogue Box ================= */
#dialogueBox {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 680px;
    background: rgba(7, 11, 20, 0.94);
    border: 2px solid rgba(56, 189, 248, 0.5);
    border-radius: 12px;
    padding: 18px 24px;
    color: #e2e8f0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.18);
    backdrop-filter: blur(12px);
    z-index: 55;
}

#dialogueBox.hidden {
    display: none;
}

.dialogue-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.dialogue-avatar {
    font-size: 26px;
    background: rgba(56, 189, 248, 0.15);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.dialogue-header h3 {
    margin: 0;
    font-size: 18px;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.dialogue-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dialogue-close-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

.dialogue-close-btn:hover {
    color: #ef4444;
}

.dialogue-body p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #f1f5f9;
    font-family: 'Consolas', 'Courier New', monospace;
    min-height: 48px;
}

.dialogue-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.dialogue-footer b {
    color: #38bdf8;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #38bdf8;
    border-radius: 50%;
    animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* ================= 5 Nights Tracker HUD ================= */
#nightStatus {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    background: rgba(7, 11, 20, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.1);
    z-index: 15;
    pointer-events: none;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

#nightTitle {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.hud-sep {
    color: #475569;
}

#survivorCount {
    color: #e2e8f0;
}

/* ================= Night Transition / Completion Overlay ================= */
#nightOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 12, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 0.5s ease;
}

#nightOverlay.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.night-card {
    text-align: center;
    max-width: 520px;
    padding: 48px 40px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.15);
    animation: nightCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nightCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.night-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

#nightOverlayTitle {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #38bdf8;
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

#nightOverlaySubtitle {
    font-size: 15px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 28px;
}

.btn-night {
    display: inline-block;
    padding: 14px 36px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #070b14;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.4);
    transition: all 0.2s ease;
}

.btn-night:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.7);
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
}

/* =========================================================
   CO-OP MULTIPLAYER HUD & NOTIFICATIONS
   ========================================================= */
#coopFeed {
    position: absolute;
    top: 70px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    z-index: 50;
    max-width: 360px;
}

.coop-toast {
    background: rgba(12, 28, 22, 0.88);
    border: 1px solid rgba(46, 196, 182, 0.4);
    border-left: 4px solid #2ec4b6;
    color: #e0fbf7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOutToast 0.5s ease-in 3.5s forwards;
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* =========================================================
   TEAM STATUS HUD
   ========================================================= */
#teamStatusHUD {
    position: absolute;
    top: 60px;
    right: 24px;
    z-index: 50;
    pointer-events: none;
}

#teamStatusList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.team-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
}

.team-chip.alive {
    border-color: rgba(46, 196, 182, 0.5);
}

.team-chip.alive .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ec4b6;
    box-shadow: 0 0 8px #2ec4b6;
}

.team-chip.dead {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(35, 10, 10, 0.85);
    color: #fca5a5;
}

.team-chip.dead .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* =========================================================
   SPECTATOR MODE HUD
   ========================================================= */
#spectatorHUD {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    pointer-events: none;
}

.spectator-card {
    background: rgba(18, 12, 12, 0.92);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 14px;
    padding: 16px 28px;
    text-align: center;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.35), 0 8px 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: specCardPulse 2s infinite ease-in-out;
}

@keyframes specCardPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.35), 0 8px 30px rgba(0, 0, 0, 0.8); }
    50% { box-shadow: 0 0 45px rgba(239, 68, 68, 0.6), 0 8px 30px rgba(0, 0, 0, 0.8); }
}

.spec-badge {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ef4444;
    text-transform: uppercase;
    margin-bottom: 6px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.spec-watching {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.spec-target-highlight {
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.spec-controls {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.spec-revive-hint {
    font-size: 12px;
    color: #34d399;
}

/* =========================================================
   LOBBY OVERLAY (SẢNH CHỜ 4 NGƯỜI)
   ========================================================= */
#lobbyOverlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(11, 19, 32, 0.94) 0%, rgba(4, 7, 13, 0.98) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(12px);
    overflow-y: auto;
    padding: 24px;
}

.lobby-container {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 20px;
    padding: 36px 44px;
    max-width: 780px;
    width: 100%;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lobby-header {
    text-align: center;
}

.lobby-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(46, 196, 182, 0.15);
    border: 1px solid #2ec4b6;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    color: #2ec4b6;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.lobby-header h1 {
    font-size: 30px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.lobby-desc {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.5;
}

/* Link chia sẻ phòng */
.lobby-share-box {
    background: rgba(8, 14, 26, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 12px 18px;
}

.share-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64dfdf;
    margin-bottom: 6px;
}

.share-input-group {
    display: flex;
    gap: 8px;
}

.share-input-group input {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    color: #e2e8f0;
    font-family: monospace;
    font-size: 13.5px;
    padding: 8px 14px;
    outline: none;
}

.btn-copy {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 8px;
    color: #38bdf8;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(56, 189, 248, 0.4);
    color: #ffffff;
}

/* Tên kiểm lâm */
.lobby-name-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(8, 14, 26, 0.5);
    border-radius: 12px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-name-box label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
}

.name-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
}

.name-input-group input {
    flex: 1;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    outline: none;
}

.btn-name-save {
    background: rgba(46, 196, 182, 0.2);
    border: 1px solid #2ec4b6;
    border-radius: 8px;
    color: #2ec4b6;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-name-save:hover {
    background: #2ec4b6;
    color: #070b14;
}

/* Grid 4 Slot người chơi */
.lobby-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.lobby-slot-card {
    background: rgba(8, 14, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
}

.lobby-slot-card.occupied {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.lobby-slot-card.self {
    border-color: #2ec4b6;
    background: rgba(12, 28, 26, 0.85);
}

.lobby-slot-card.empty {
    border: 1px dashed rgba(255, 255, 255, 0.15);
    opacity: 0.65;
}

.slot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slot-info {
    flex: 1;
    min-width: 0;
}

.slot-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-badge-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.badge-host {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-ready {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #4ade80;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-waiting {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid #64748b;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Action Buttons */
.lobby-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 6px;
}

.btn-action {
    flex: 1;
    max-width: 320px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-start-game {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.4);
}

.btn-start-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(14, 165, 233, 0.7);
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
}

.btn-ready {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.btn-ready.active {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
}

.lobby-notice {
    text-align: center;
    font-size: 13px;
    color: #cbd5e1;
    font-style: italic;
}

.lobby-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
    font-size: 12px;
    color: #94a3b8;
}

.lobby-tips span b {
    color: #38bdf8;
}

/* =========================================================
   RESUME OVERLAY
   ========================================================= */
#resumeOverlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 20, 0.82);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
    backdrop-filter: blur(8px);
}

.resume-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 16px;
    padding: 36px 44px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(56, 189, 248, 0.2);
}

.resume-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.resume-card h2 {
    font-size: 24px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.resume-card p {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.btn-resume {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border: none;
    border-radius: 8px;
    color: #070b14;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 12px 32px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
    transition: all 0.2s;
}

.btn-resume:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.8);
}

/* =====================================================
   SAFE ZONE BADGE (Khu vực an toàn trong ngôi nhà)
   ===================================================== */
#safeZoneBadge {
    position: absolute;
    top: 66px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(6, 78, 59, 0.75);
    border: 1.5px solid #10b981;
    color: #6ee7b7;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 8px 22px;
    border-radius: 24px;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    z-index: 25;
    animation: safePulse 2.2s infinite ease-in-out;
}

#safeZoneBadge.hidden {
    display: none !important;
}

.safe-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 6px #10b981);
}

@keyframes safePulse {
    0%, 100% {
        opacity: 0.92;
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 35px rgba(52, 211, 153, 0.75);
    }
}

/* =====================================================
   EXTRACTION BANNER (Thông báo rút về nhà khi cứu đủ 5 người)
   ===================================================== */
#extractionBanner {
    position: absolute;
    top: 118px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(127, 29, 29, 0.88);
    border: 2px solid #ef4444;
    border-radius: 14px;
    padding: 12px 28px;
    box-shadow: 0 0 45px rgba(239, 68, 68, 0.65), 0 0 80px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 25;
    animation: alertPulse 1.6s infinite ease-in-out;
    max-width: 90%;
}

#extractionBanner.hidden {
    display: none !important;
}

.extraction-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.extraction-icon {
    font-size: 32px;
}

.extraction-title {
    font-size: 17px;
    font-weight: 900;
    color: #fee2e2;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}

.extraction-desc {
    font-size: 13.5px;
    font-weight: 600;
    color: #fecaca;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

@keyframes alertPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 35px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: translateX(-50%) scale(1.03);
        box-shadow: 0 0 60px rgba(239, 68, 68, 0.9);
    }
}

