/* ===================================================
   VARIABLES DE DISEÑO & PALETA DE COLORES RETRO CYBER
   =================================================== */
:root {
    --bg-dark: #0d1117;
    --bg-card: rgba(22, 27, 34, 0.85);
    --border-color: rgba(255, 255, 255, 0.15);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --gold: #fbbf24;
    --silver: #9ca3af;
    --bronze: #d97706;
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    --font-retro: 'Press Start 2P', monospace;
    --font-ui: 'Outfit', sans-serif;
}

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

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-ui);
    color: var(--text-light);
}

.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.screen-overlay.active {
    display: flex;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-glow);
    padding: 32px;
}

/* LOGIN */
.login-card {
    width: 90%;
    max-width: 540px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.logo-badge {
    margin-bottom: 24px;
}

.game-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

.logo-badge h1 {
    font-family: var(--font-retro);
    font-size: 1.3rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    margin-bottom: 8px;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group.hidden {
    display: none;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #e5e7eb;
}

.retro-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-ui);
    outline: none;
    transition: all 0.3s;
}

.retro-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 18px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 10px 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.avatar-option.selected {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.avatar-option canvas {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

.avatar-name {
    font-size: 0.7rem;
    margin-top: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

.avatar-option.selected .avatar-name {
    color: var(--gold);
}

.retro-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 800;
    font-size: 1.05rem;
    font-family: var(--font-ui);
    cursor: pointer;
    box-shadow: 0 6px 20px var(--primary-glow);
    transition: all 0.2s;
    margin-top: 10px;
}

.retro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--primary-glow);
    filter: brightness(1.1);
}

/* CANVAS DE JUEGO */
#game-screen {
    position: relative;
    background: #05070a;
}

#canvas-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    border: 3px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
}

#game-canvas {
    display: block;
    background-color: #090d16;
    image-rendering: pixelated;
}

/* BANNER DE PANEL DE ADMINISTRACIÓN */
.editor-banner {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--gold);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
    z-index: 30;
    cursor: move;
    /* Indicate draggable */
    user-select: none;
    min-width: 320px;
}

.editor-banner.hidden {
    display: none;
}

.editor-modes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.editor-hint {
    color: #cbd5e1;
    font-size: 0.82rem;
}

.small-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.small-btn.active-mode {
    background: var(--primary);
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--primary-glow);
}

.add-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
}

.scenario-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
}

.save-db-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    font-weight: 800;
}

.small-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.reset-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
}

/* HUD PANELS */
.hud-panel {
    position: absolute;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 18px;
    z-index: 20;
}

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

.player-hud canvas {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.hud-name {
    font-weight: 800;
    font-size: 1rem;
    display: block;
}

.score-pill {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 700;
    margin-top: 2px;
}

.controls-hud {
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-ui);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn.hidden {
    display: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.leaderboard-hud {
    top: 20px;
    right: 20px;
    width: 260px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.lb-header h3 {
    font-family: var(--font-retro);
    font-size: 0.65rem;
    color: var(--gold);
}

.live-dot {
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    animation: pulse 1.5s infinite;
}

.lb-scroll {
    overflow: hidden;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.lb-table th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding-bottom: 6px;
}

.lb-table td {
    padding: 6px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-badge {
    font-weight: 800;
    width: 20px;
    display: inline-block;
}

.rank-1 {
    color: var(--gold);
}

.rank-2 {
    color: var(--silver);
}

.rank-3 {
    color: var(--bronze);
}

.interaction-prompt {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 20px var(--accent-glow);
    animation: bounce 1.5s infinite;
    z-index: 25;
}

.interaction-prompt.hidden {
    display: none;
}

.key-badge {
    background: #fff;
    color: #000;
    font-weight: 900;
    font-family: var(--font-retro);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* MINIGAME MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s;
}

.modal-overlay.hidden {
    display: none;
}

.minigame-card {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.minigame-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.minigame-title h2 {
    font-size: 1.2rem;
    color: #fff;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

.minigame-body {
    min-height: 280px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-footer {
    margin-top: 14px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.wires-game-container {
    width: 100%;
    height: 260px;
    position: relative;
    display: flex;
    justify-content: space-between;
}

.wire-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 2;
}

.wire-node {
    width: 50px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.wire-node::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
}

.left-column .wire-node::after {
    right: -6px;
}

.right-column .wire-node::after {
    left: -6px;
}

.wires-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.simon-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 220px;
    height: 220px;
}

.simon-btn {
    border-radius: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.simon-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 25px currentColor;
}

.passcode-container {
    text-align: center;
    width: 100%;
}

.passcode-display {
    background: #000;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-retro);
    font-size: 1.8rem;
    padding: 12px;
    letter-spacing: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.passcode-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 240px;
    margin: 0 auto;
}

.pad-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #fff;
    font-size: 1.2rem;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-retro);
    transition: background 0.2s;
}

.pad-btn:hover {
    background: #334155;
}

.score-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-retro);
    font-size: 2rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 40px rgba(251, 191, 36, 0.5);
    pointer-events: none;
    z-index: 150;
    animation: popAndFade 1.2s ease-out forwards;
}

.score-popup.hidden {
    display: none;
}

.key-reward-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    z-index: 200;
    backdrop-filter: blur(8px);
    font-family: var(--font-retro);
    animation: keyRewardPop 3.5s ease-in-out forwards;
    pointer-events: none;
}

.key-reward-toast.hidden {
    display: none;
}

@keyframes keyRewardPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.8);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }

    15% {
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes popAndFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -30%) scale(0.6);
    }

    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1);
    }
}

/* ===================================================
   MODAL DIÁLOGO NPC & MÁQUINA DE ESCRIBIR
   =================================================== */
.npc-dialogue-card {
    width: 90%;
    max-width: 620px;
    background: rgba(13, 17, 23, 0.95);
    border: 2px solid var(--primary);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.4), 0 20px 50px rgba(0, 0, 0, 0.8);
    padding: 24px;
    cursor: pointer;
}

.npc-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.npc-portrait {
    width: 64px;
    height: 64px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid var(--gold);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.npc-portrait canvas {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
}

.npc-identity {
    flex: 1;
}

.npc-identity h3 {
    font-size: 1.3rem;
    color: var(--gold);
    font-weight: 800;
}

.npc-room-tag {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 4px;
}

.npc-body {
    background: #090d16;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 20px;
    min-height: 120px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.typewriter-box {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    line-height: 1.6;
    color: #f3f4f6;
    white-space: pre-wrap;
    word-break: break-word;
}

.typewriter-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background-color: var(--gold);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.7s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.npc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.typewriter-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.npc-continue-btn {
    width: auto;
    padding: 10px 24px;
    margin-top: 0;
    font-size: 0.9rem;
}

/* ===================================================
   CONTROLES TÁCTILES PARA MÓVILES (D-PAD & ACTION BUTTON)
   =================================================== */
.mobile-touch-controls {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 40;
}

.mobile-touch-controls.hidden {
    display: none !important;
}

.dpad-container {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
    touch-action: none;
}

.dpad-middle {
    display: flex;
    align-items: center;
}

.dpad-center {
    width: 44px;
    height: 44px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 8px;
}

.dpad-btn {
    width: 48px;
    height: 48px;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid var(--primary);
    border-radius: 10px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.1s, transform 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.dpad-btn:active,
.dpad-btn.active {
    background: var(--primary);
    border-color: var(--gold);
    transform: scale(0.92);
    box-shadow: 0 0 15px var(--primary-glow);
}

.action-btn-container {
    pointer-events: auto;
}

.touch-action-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #059669);
    border: 3px solid #fff;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-glow);
    touch-action: manipulation;
    transition: transform 0.1s;
}

.touch-action-btn:active,
.touch-action-btn.active {
    transform: scale(0.92);
    filter: brightness(1.2);
}

.action-key {
    font-family: var(--font-retro);
    font-size: 1.3rem;
    font-weight: 900;
}

.action-label {
    font-size: 0.65rem;
    font-weight: 800;
    margin-top: 2px;
    letter-spacing: 0.5px;
}

@media (min-width: 1025px) {
    .mobile-touch-controls {
        opacity: 0.85;
    }

    .mobile-touch-controls:hover {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    #canvas-container {
        width: 100vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    #game-canvas {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        object-fit: cover;
    }

    .leaderboard-hud {
        display: none !important;
    }

    .controls-hud .controls-hint {
        display: none;
    }

    .mobile-touch-controls {
        bottom: 60px;
        padding: 0 14px;
        transform: scale(1);
        transform-origin: bottom;
    }

    .dpad-btn {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .dpad-center {
        width: 48px;
        height: 48px;
    }

    .touch-action-btn {
        width: 76px;
        height: 76px;
    }

    .interaction-prompt {
        bottom: 80px !important;
        left: 35% !important;
        font-size: 0.85rem;
    }

    .score-popup {
        display: none !important;
    }
}

/* ===================================================
   MODO TV PANTALLA COMPLETA & RANKING TRANSPARENTE
   =================================================== */
body.tv-fullscreen-active {
    overflow: hidden !important;
    background: #000000 !important;
}

body.tv-fullscreen-active #game-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #000000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.tv-fullscreen-active #canvas-container {
    width: 100vw !important;
    height: 100vh !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.tv-fullscreen-active #game-canvas {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

/* En Modo TV ocultar banners de control, paneles de usuario e indicaciones */
body.tv-fullscreen-active .player-hud,
body.tv-fullscreen-active .controls-hud,
body.tv-fullscreen-active .quick-chat-bar,
body.tv-fullscreen-active .mobile-touch-controls,
body.tv-fullscreen-active .interaction-prompt,
body.tv-fullscreen-active .duel-prompt {
    display: none !important;
}

body.hide-ui .editor-banner,
body.hide-ui .player-hud,
body.hide-ui .controls-hud,
body.hide-ui .quick-chat-bar,
body.hide-ui .mobile-touch-controls,
body.hide-ui .interaction-prompt,
body.hide-ui .duel-prompt {
    display: none !important;
}

/* Leaderboard Flotante con Fondo Transparente para ver el mapa por detrás */
body.tv-fullscreen-active .leaderboard-hud {
    display: flex !important;
    position: absolute !important;
    top: 24px !important;
    right: 24px !important;
    width: 280px !important;
    max-height: 380px !important;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6) !important;
    z-index: 9999 !important;
}

/* ===================================================
   BARRA DE MENSAJES RÁPIDOS (QUICK CHAT BARS)
   =================================================== */
.quick-chat-bar {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

.quick-chat-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.quick-chat-buttons {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 450px;
    padding-bottom: 2px;
}

.quick-chat-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.quick-chat-btn:hover {
    background: var(--primary);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 0 10px var(--primary-glow);
}

.quick-chat-btn:active {
    transform: scale(0.95);
}