body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

#game-container {
    width: 100%;
    height: 100%;
    touch-action: none !important;
}

#game-container canvas {
    display: block !important;
    margin: 0 !important;
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Progreso UI */
#progress-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 250px;
    z-index: 105;
    text-align: left;
}

#progress-bar-bg {
    width: 100%;
    height: 15px;
    background: #333;
    border: 2px solid #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ffcc, #00ccff);
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
    margin-top: 5px;
    display: block;
}


/* Tareas UI */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* Ocultar todos los botones de acción del HUD mientras la tarea esté abierta */
body.task-modal-open .action-icon,
body.task-modal-open #vent-controls {
    display: none !important;
    pointer-events: none !important;
}

#task-modal {
    background: radial-gradient(circle at top, rgba(30, 26, 46, 0.98) 0%, rgba(12, 10, 22, 0.98) 100%);
    backdrop-filter: blur(14px);
    color: white;
    padding: clamp(14px, 3.5vw, 24px);
    border-radius: 20px;
    text-align: center;
    width: min(95vw, 540px);
    max-height: min(93vh, 660px);
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 204, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.35);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@keyframes popIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.task-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.task-modal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.task-room-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 170, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: #ffd700;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

#task-title {
    font-family: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #00ffcc;
    font-size: clamp(17px, 4.5vw, 22px);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

#task-modal-close-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.5);
    color: #ff6666;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
}

#task-modal-close-icon:hover {
    background: rgba(255, 68, 68, 0.8);
    color: white;
    transform: scale(1.08);
}

#task-content {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.task-instructions {
    font-size: clamp(13px, 3.4vw, 15px);
    color: #d6cfb8;
    margin-bottom: 14px;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.task-footer-progress {
    margin-top: 12px;
    font-size: clamp(13px, 3.4vw, 15px);
    color: #a0a5b5;
    font-weight: 600;
}

#close-task-btn {
    align-self: center;
    padding: 8px 24px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.4);
    border-radius: 8px;
    color: #ff8888;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: 0.2s;
    touch-action: manipulation;
}

#close-task-btn:hover {
    background: rgba(255, 68, 68, 0.85);
    color: white;
}

/* ========================================================
   MINIJUEGO 1: CONECTAR RUNAS ARCANAS (Cables Mágicos)
======================================================== */
.runes-game-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 290px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    touch-action: none;
    user-select: none;
    margin: 0 auto;
}

.runes-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.runes-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    width: 130px;
    z-index: 10;
}

.rune-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(20, 18, 30, 0.9);
    border: 2px solid #555;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    touch-action: none;
    position: relative;
    user-select: none;
}

.rune-node:hover {
    transform: scale(1.05);
}

.rune-node.connected {
    opacity: 0.75;
    pointer-events: none;
}

.rune-symbol {
    font-size: 22px;
    font-weight: bold;
}

.rune-label {
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.rune-connector {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px currentColor;
}

/* ========================================================
   MINIJUEGO 2: ORDENAR TOMOS DE HECHIZOS (Bookshelf)
======================================================== */
.bookshelf-wrapper {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 15px 10px 0 10px;
    background: linear-gradient(180deg, #1f140e 0%, #110b07 100%);
    border: 3px solid #54341b;
    border-radius: 12px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 8px 20px rgba(0,0,0,0.5);
    margin: 0 auto;
    overflow: hidden;
}

.books-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(8px, 2.5vw, 14px);
    min-height: 195px;
    touch-action: none;
    padding-bottom: 2px;
}

.book-spine {
    width: clamp(48px, 14vw, 68px);
    border-radius: 6px 6px 0 0;
    cursor: grab;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    box-shadow: -3px 0 6px rgba(0,0,0,0.4), inset 2px 0 4px rgba(255,255,255,0.25), inset -2px 0 4px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: none;
}

.book-spine:active {
    cursor: grabbing;
    transform: translateY(-8px) scale(1.05);
}

.book-ghost {
    opacity: 0.4;
    background: #ffd700 !important;
}

.book-gold-glow {
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px #ffd700 !important;
    animation: bookGlow 1s infinite alternate;
}

@keyframes bookGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

.book-num {
    font-size: clamp(18px, 4.5vw, 24px);
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.book-title {
    font-size: 10px;
    color: #ffffff;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.85;
}

.book-ribbon {
    width: 80%;
    height: 4px;
    background: #ffd700;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.bookshelf-wood-shelf {
    width: 100%;
    height: 18px;
    background: linear-gradient(180deg, #85532a 0%, #4a2810 100%);
    border-top: 2px solid #a66938;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

/* ========================================================
   MINIJUEGO 3: CRISTALES DE RESONANCIA (Simón Dice)
======================================================== */
.crystals-wrapper {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.crystals-pedestal {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(12px, 3.5vw, 18px);
    padding: 12px;
    background: radial-gradient(circle, rgba(30, 25, 45, 0.7) 0%, rgba(10, 8, 18, 0.9) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.crystal-shard {
    height: clamp(80px, 22vw, 105px);
    background: rgba(15, 12, 25, 0.9);
    border: 2px solid var(--c-color);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
    user-select: none;
    touch-action: manipulation;
}

.crystal-shard:active {
    transform: scale(0.94);
}

.crystal-shard.crystal-lit {
    background: var(--c-color) !important;
    box-shadow: 0 0 30px var(--c-color), inset 0 0 15px rgba(255,255,255,0.8) !important;
    transform: scale(1.06);
}

.crystal-inner {
    width: 28px;
    height: 28px;
    background: var(--c-color);
    transform: rotate(45deg);
    border-radius: 4px;
    box-shadow: 0 0 12px var(--c-color);
    transition: all 0.2s;
}

.crystal-shard.crystal-lit .crystal-inner {
    background: #ffffff;
    box-shadow: 0 0 20px #ffffff;
}

.crystal-name {
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.crystals-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.prog-gem {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.prog-gem.gem-active {
    background: #00ff88;
    border-color: #ffffff;
    box-shadow: 0 0 12px #00ff88;
}

/* ========================================================
   MINIJUEGO 4: CALIBRAR EL ASTROLABIO ASTRAL
======================================================== */
.astral-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.astral-canvas {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(0, 255, 136, 0.3));
}

.astral-press-btn {
    margin-top: 15px;
    padding: clamp(12px, 3.5vw, 16px) clamp(24px, 6vw, 42px);
    background: linear-gradient(135deg, #ffd700 0%, #ff8800 100%);
    color: #000;
    font-weight: 900;
    font-size: clamp(15px, 4vw, 18px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    transition: transform 0.1s, box-shadow 0.1s;
    touch-action: manipulation;
    letter-spacing: 1px;
}

.astral-press-btn:active {
    transform: scale(0.96);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ========================================================
   MINIJUEGO 5: EL MORTERO DEL ALQUIMISTA
======================================================== */
.alchemy-recipe-bar {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 6px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 700;
}

.recipe-label {
    color: #ffd700;
    letter-spacing: 0.5px;
}

.recipe-item {
    color: #ffffff;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 6px;
}

.alchemy-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.alchemy-shelf {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(6px, 2vw, 10px);
    width: 100%;
    max-width: 440px;
}

.alchemy-ing-card {
    background: rgba(22, 18, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: clamp(6px, 2vw, 10px) 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    touch-action: manipulation;
}

.alchemy-ing-card:active {
    transform: scale(0.94);
}

.alchemy-ing-card.ing-used {
    opacity: 0.35;
    pointer-events: none;
    transform: scale(0.9);
}

.ing-icon {
    font-size: clamp(22px, 5.5vw, 28px);
}

.ing-name {
    font-size: clamp(9px, 2.5vw, 11px);
    color: #d1d5db;
    font-weight: 600;
    text-align: center;
}

.mortar-cauldron {
    position: relative;
    width: clamp(130px, 35vw, 160px);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.mortar-bowl {
    position: relative;
    width: 100%;
    height: clamp(85px, 22vw, 105px);
    background: linear-gradient(180deg, #374151 0%, #111827 100%);
    border: 3px solid #6b7280;
    border-radius: 0 0 70px 70px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8), inset 0 2px 8px rgba(255,255,255,0.2);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.mortar-ready-to-crush .mortar-bowl {
    border-color: #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    animation: mortarPulse 1s infinite alternate;
}

@keyframes mortarPulse {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}

.mortar-liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #a855f7;
    transition: height 0.3s ease, background 0.3s ease;
    opacity: 0.85;
}

.mortar-contents {
    position: absolute;
    bottom: 15px;
    display: flex;
    gap: 8px;
    font-size: 24px;
    z-index: 5;
}

.pestle-crusher {
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 38px;
    display: none;
    transition: transform 0.12s;
    z-index: 10;
}

.pestle-crusher.pestle-hit {
    transform: translateY(22px) rotate(-15deg);
}

.mortar-label {
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

/* ========================================================
   MINIJUEGO 6: FORJAR LA ESPADA EN EL YUNQUE
======================================================== */
.forge-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.anvil-base {
    position: relative;
    width: 100%;
    height: 140px;
    background: linear-gradient(180deg, #374151 0%, #1f2937 60%, #111827 100%);
    border: 3px solid #6b7280;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 2px 4px rgba(255,255,255,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sword-blade {
    position: relative;
    width: 85%;
    height: 28px;
    background: linear-gradient(90deg, #b91c1c 0%, #ea580c 50%, #facc15 100%);
    border-radius: 4px 14px 14px 4px;
    box-shadow: 0 0 25px rgba(234, 88, 12, 0.9), inset 0 1px 2px #fff;
    transition: all 0.5s ease;
}

.sword-blade.blade-straight {
    background: linear-gradient(90deg, #ea580c 0%, #facc15 60%, #ffffff 100%);
    box-shadow: 0 0 35px rgba(250, 204, 21, 0.9);
}

.sword-blade.blade-quenched {
    background: linear-gradient(90deg, #334155 0%, #94a3b8 50%, #38bdf8 100%) !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.8) !important;
    border: 1px solid #ffffff;
}

.dent-spot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #ff4400;
    box-shadow: 0 0 14px #ff4400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}

.dent-spot:active {
    transform: translate(-50%, -50%) scale(0.9);
}

.dent-spot.dent-hammered {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 25px #ffffff, 0 0 35px #ffaa00;
}

.dent-spot.dent-fixed {
    border-color: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    background: rgba(0, 255, 136, 0.2);
    pointer-events: none;
}

.spark-icon {
    font-size: 14px;
    color: #ffcc00;
}

.dent-hits {
    font-size: 12px;
    font-weight: 900;
    color: #ffffff;
}

.quench-btn {
    margin-top: 15px;
    padding: clamp(12px, 3.5vw, 15px) clamp(22px, 5vw, 36px);
    background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: clamp(14px, 3.8vw, 17px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
    transition: transform 0.1s;
    touch-action: manipulation;
    letter-spacing: 0.5px;
}

.quench-btn:active {
    transform: scale(0.96);
}

/* ========================================================
   MINIJUEGO 7: LIMPIAR EL ESCUDO DE ARMAS
======================================================== */
.shield-wrapper {
    position: relative;
    width: clamp(200px, 50vw, 220px);
    height: clamp(240px, 60vw, 260px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shield-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.royal-shield-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

.dirt-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    border-radius: 12px;
}

/* Elementos para tareas de Preguntas Múltiples (compatibilidad) */
.task-btn {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 14px;
    background: linear-gradient(135deg, #2a2a35 0%, #1e1e24 100%);
    color: #fff;
    border: 1px solid #444;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    word-wrap: break-word;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.task-btn:hover {
    background: linear-gradient(135deg, #00ffcc 0%, #00ccff 100%);
    color: #000;
    border-color: #00ffcc;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 255, 204, 0.3);
}

.task-btn:active {
    transform: translateY(1px);
}

/* --- UI Reunión de Emergencia (18 Jugadores + Multiplataforma Móvil/Escritorio) --- */
#meeting-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    touch-action: pan-y !important;
    padding: 8px;
    box-sizing: border-box;
}

#meeting-modal {
    background: #0b0f19;
    color: white;
    width: 100%;
    max-width: 940px;
    height: 94%;
    max-height: 94vh;
    border: 2px solid #ef4444;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    box-sizing: border-box;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.35), 0 20px 45px rgba(0, 0, 0, 0.8);
    touch-action: pan-y !important;
    overflow: hidden;
}

.meeting-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 10px;
}

#meeting-modal-title {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.vote-timer-urgent {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ff8888 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8) !important;
    animation: urgentTimerPulse 0.5s infinite alternate ease-in-out;
}

@keyframes urgentTimerPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* Barra de pestañas móvil */
.meeting-tabs-bar {
    display: none;
    margin-top: 8px;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.meeting-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meeting-tab-btn.active {
    background: #1e293b;
    color: #00ffcc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.chat-unread-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    animation: pulseVoteTag 1s infinite ease-in-out;
}

.meeting-container {
    display: flex;
    flex: 1;
    gap: 12px;
    overflow: hidden;
    min-height: 0;
    margin-top: 10px;
    touch-action: pan-y !important;
}

/* Votaciones */
.voting-section {
    flex: 1.25;
    background: #101726;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    touch-action: pan-y !important;
}

.voting-scroll-wrapper {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    min-height: 0;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
    padding-right: 4px;
}

#players-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px;
    touch-action: pan-y !important;
}

.player-vote-item {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    box-sizing: border-box;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.player-vote-item:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: rgba(0, 255, 204, 0.3);
}

.vote-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    white-space: nowrap;
}

.vote-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.6);
}

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

.vote-btn:disabled {
    background: #475569 !important;
    color: #94a3b8 !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.vote-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.vote-status-badge.my-vote {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.vote-status-badge.sent {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.vote-status-badge.dead {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.voted-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 6px;
    animation: pulseVoteTag 1.8s infinite ease-in-out;
}

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

.voter-tokens-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin-top: 3px;
    min-height: 18px;
}

.voter-token-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-size: 9px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    animation: votePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes votePopIn {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    70% { transform: scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.skip-vote-btn {
    margin-top: 8px;
    padding: 10px;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
}

.skip-vote-btn:hover:not(:disabled) {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.25);
}

.skip-vote-btn:disabled {
    cursor: default;
}

.skip-vote-btn.voted-skip {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}

/* Chat */
.chat-section {
    flex: 0.95;
    background: #101726;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    touch-action: pan-y !important;
}

#chat-messages {
    flex: 1;
    background: #080c14;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    padding: 10px;
    overflow-y: auto !important;
    font-size: 13px;
    border-radius: 8px;
    line-height: 1.45;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
}

.chat-input-container {
    display: flex;
    gap: 6px;
}

#chat-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1e293b;
    color: white;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

#chat-input:focus {
    border-color: #00ffcc;
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.chat-input-container button {
    padding: 0 16px;
    background: #00ffcc;
    color: #0b0f19;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: all 0.15s ease;
}

.chat-input-container button:hover {
    background: #38bdf8;
    transform: scale(1.03);
}

/* --- REGLAS RESPONSIVAS: Móvil Vertical / Móvil Horizontal / Pantallas Compactas --- */
@media (max-width: 767px), (max-height: 520px) {
    .meeting-tabs-bar {
        display: flex;
    }

    #meeting-modal[data-active-tab="voting"] #meeting-chat-section {
        display: none !important;
    }

    #meeting-modal[data-active-tab="voting"] #meeting-voting-section {
        display: flex !important;
        flex: 1;
    }

    #meeting-modal[data-active-tab="chat"] #meeting-voting-section {
        display: none !important;
    }

    #meeting-modal[data-active-tab="chat"] #meeting-chat-section {
        display: flex !important;
        flex: 1;
    }

    #players-list {
        grid-template-columns: 1fr;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    #meeting-modal {
        height: 96%;
        max-height: 96vh;
        padding: 6px 10px;
    }

    .meeting-header-bar {
        padding-bottom: 4px;
    }

    #meeting-modal-title {
        font-size: 0.95rem;
    }

    .meeting-timer-pill {
        font-size: 0.85rem;
        padding: 2px 8px;
    }

    .meeting-tabs-bar {
        margin-top: 4px;
        padding: 2px;
    }

    .meeting-tab-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .meeting-container {
        margin-top: 6px;
    }

    #players-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 4px;
    }

    .player-vote-item {
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .vote-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .skip-vote-btn {
        margin-top: 5px;
        padding: 6px;
        font-size: 12px;
    }
}

/* --- UI Fin de Partida Cinemático (Victoria / Derrota AAA) --- */
.endgame-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: auto;
    font-family: 'Outfit', 'Inter', 'Segoe UI', sans-serif;
    transition: opacity 0.5s ease;
}

#endgame-particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.endgame-modal-cinematic {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 92%;
    max-width: 820px;
    padding: 35px 30px;
    border-radius: 28px;
    backdrop-filter: blur(16px);
    box-sizing: border-box;
    animation: endgameZoomIn 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes endgameZoomIn {
    0% { transform: scale(0.65); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Tema VICTORIA: Áureo / Cian resplandeciente */
.endgame-victory {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.28) 0%, rgba(6, 78, 59, 0.45) 45%, rgba(5, 15, 25, 0.97) 90%);
}

.endgame-victory .endgame-modal-cinematic {
    background: rgba(10, 25, 20, 0.82);
    border: 2px solid rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.4), inset 0 0 40px rgba(52, 211, 153, 0.15);
}

.endgame-victory .endgame-badge {
    background: linear-gradient(135deg, #fbbf24, #10b981);
    color: #062414;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.endgame-victory .endgame-title-cinematic {
    background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 40%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(52, 211, 153, 0.7));
}

.endgame-victory .endgame-action-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.endgame-victory .endgame-action-btn:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.7);
}

/* Tema DERROTA: Carmesí gótico / Cenizas */
.endgame-defeat {
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.3) 0%, rgba(127, 29, 29, 0.45) 50%, rgba(15, 5, 8, 0.98) 95%);
}

.endgame-defeat .endgame-modal-cinematic {
    background: rgba(25, 10, 12, 0.85);
    border: 2px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.5), inset 0 0 40px rgba(239, 68, 68, 0.15);
}

.endgame-defeat .endgame-badge {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

.endgame-defeat .endgame-title-cinematic {
    background: linear-gradient(135deg, #ffffff 0%, #fca5a5 40%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.8));
}

.endgame-defeat .endgame-action-btn {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.endgame-defeat .endgame-action-btn:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.7);
}

/* Elementos comunes del fin de partida */
.endgame-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.endgame-title-cinematic {
    font-size: clamp(38px, 6vw, 68px);
    margin: 0 0 10px 0;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.endgame-subtitle-cinematic {
    font-size: clamp(15px, 2.2vw, 20px);
    color: #e2e8f0;
    margin: 0 0 25px 0;
    max-width: 600px;
    line-height: 1.4;
    font-weight: 500;
}

/* Podio de avatares ganadores/revelados */
.endgame-podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    margin: 10px 0 25px 0;
    width: 100%;
}

.endgame-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 18px;
    padding: 16px 18px;
    min-width: 110px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.endgame-podium-card.podium-winner {
    border-color: rgba(52, 211, 153, 0.6);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
    transform: translateY(-6px);
}

.endgame-podium-card.podium-loser {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.2);
}

.podium-avatar-figure {
    width: 48px;
    height: 48px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transform: scale(1.35);
    transform-origin: center center;
    margin: 8px 0;
}

.podium-avatar-layer {
    position: absolute;
    top: 0;
    left: -48px;
    width: 144px;
    height: 192px;
    max-width: none !important;
    max-height: none !important;
    object-fit: none;
    image-rendering: pixelated;
    pointer-events: none;
}

.podium-avatar-name {
    margin-top: 10px;
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sección de impostores revelados */
.endgame-impostors-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    width: 100%;
}

.endgame-impostors-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 999px;
    padding: 6px 18px;
}

.impostor-tag {
    background: #ef4444;
    color: white;
    font-weight: 800;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.endgame-action-btn {
    padding: 14px 44px;
    font-size: 17px;
    font-weight: 800;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.endgame-action-btn:hover {
    transform: translateY(-2px);
}

.endgame-action-btn:active {
    transform: translateY(1px);
}


/* --- UI Antesala (Lobby) --- */
#lobby-layer {
    position: absolute;
    top: 20px;
    right: 20px;
    width: auto;
    height: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 600;
    pointer-events: none; /* Dejar pasar clics al mapa */
}

#lobby-toggle-btn {
    pointer-events: auto;
    margin-bottom: 10px;
    padding: 10px;
    background: #00ffcc;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

#lobby-modal {
    background: rgba(30, 30, 45, 0.9);
    border: 2px solid #00ffcc;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    color: white;
    width: 250px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
    pointer-events: auto; /* Los botones del modal sí se pueden clicar */
    transition: all 0.3s ease;
}

#lobby-title {
    font-size: 24px;
    margin-top: 0;
    color: #00ffcc;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

#lobby-subtitle {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 30px;
}

#lobby-players-count {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    background: #222;
    padding: 15px;
    border-radius: 10px;
}

#start-game-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #00ffcc 0%, #00ccff 100%);
    color: black;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 255, 204, 0.4);
    transition: transform 0.2s;
}

#start-game-btn:active {
    transform: scale(0.95);
}

.lobby-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    background: #444;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #666;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.lobby-btn:hover {
    background: #555;
    border-color: #00ffcc;
}

/* --- UI Personalización --- */
#customization-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 700;
}

#customization-modal {
    background: #1e1e2d;
    border: 2px solid #00ccff;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    color: white;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 204, 255, 0.3);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
}

.custom-category {
    margin-bottom: 20px;
}

.custom-category h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #00ccff;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.custom-select {
    width: 100%;
    padding: 10px 12px;
    background: #141424;
    color: #ffffff;
    border: 1.5px solid #ff00ff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
}

.custom-select option {
    background: #1e1e2d;
    color: #ffffff;
    padding: 8px;
}

.lobby-topic-dropdown {
    width: 100%;
    padding: 8px 10px;
    background: #141424;
    color: #00ffcc;
    border: 1.5px solid #00ffcc;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.25);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.lobby-topic-dropdown:hover,
.lobby-topic-dropdown:focus {
    box-shadow: 0 0 16px rgba(0, 255, 204, 0.5);
    border-color: #33ffdd;
}

.lobby-topic-dropdown option {
    background: #1e1e2d;
    color: #ffffff;
    font-weight: 600;
    padding: 8px;
}

#save-char-btn {
    padding: 10px 20px;
    background: #00ffcc;
    color: black;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Action Icons --- */
.action-icon {
    display: none;
    position: fixed;
    width: 90px;
    height: 90px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.1s ease, filter 0.2s ease;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    z-index: 500;
}

.action-icon:active {
    transform: scale(0.9);
}

.action-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
    pointer-events: none;
    border: none !important;
    outline: none !important;
    background: transparent !important;
}

.action-icon.disabled {
    pointer-events: none;
}

.action-icon.disabled img,
.action-icon.disabled > span:not(.cooldown-text) {
    filter: grayscale(100%) opacity(0.4);
}

.cooldown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    background: rgba(10, 10, 15, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 30;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.cooldown-text:empty {
    display: none !important;
}


/* ===================================================
   ESTILOS PROFESIONALES: SELECCIÓN DE SALAS
=================================================== */
#room-selection-layer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #1a1a2e !important;
    background-image: 
        linear-gradient(rgba(10, 10, 20, 0.45), rgba(10, 10, 20, 0.65)),
        url('../assets/images/fondo_seleccion_sala.png') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    z-index: 10000 !important;
}

.room-card {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #00f2fe, #4facfe);
    opacity: 0.6;
    transition: opacity 0.25s ease, width 0.25s ease;
}

.room-card:hover {
    background: rgba(0, 242, 254, 0.08);
    border-color: rgba(0, 242, 254, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 242, 254, 0.15);
}

.room-card:hover::before {
    opacity: 1;
    width: 6px;
}

.room-card.full {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(255, 68, 68, 0.2);
}

.room-card.full::before {
    background: #ff4444;
}

.room-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 242, 254, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.room-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    margin-bottom: 2px;
}

.room-card-status {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.room-card-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.room-card-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.occupancy-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
}

.occupancy-badge.available {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(6, 78, 59, 0.25);
}

.occupancy-badge.busy {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(120, 53, 15, 0.25);
}

.occupancy-badge.full {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(127, 29, 29, 0.25);
}

.room-join-arrow {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.room-card:hover .room-join-arrow {
    background: #00f2fe;
    color: #0b0f19;
    transform: translateX(3px);
}

/* Botones principales de acción */
.cyber-btn-primary {
    padding: 15px 24px;
    background: linear-gradient(135deg, #00f2fe 0%, #0077ff 100%);
    color: #0b0f19;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.35);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cyber-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.55);
    filter: brightness(1.1);
}

.cyber-btn-secondary {
    padding: 15px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cyber-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

@keyframes pulseServer {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 10px rgba(255, 153, 0, 0.7)); }
    100% { transform: scale(1); opacity: 0.8; }
}



/* --- MINIJUEGO 8: FORZAR CERRADURA (LOCKPICK) --- */
.lockpick-wrapper {
    position: relative;
    width: clamp(160px, 45vw, 190px);
    height: clamp(180px, 50vw, 210px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lock-shackle {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 75px;
    border: 14px solid #64748b;
    border-bottom: none;
    border-radius: 45px 45px 0 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.lock-shackle.shackle-unlocked {
    transform: translateX(-50%) translateY(-28px);
    border-color: #ffd700;
}

.lock-chassis {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 155px;
    height: 130px;
    background: linear-gradient(135deg, #b45309 0%, #d97706 45%, #78350f 100%);
    border-radius: 22px;
    box-shadow: inset 0 3px 5px rgba(255,255,255,0.4), 0 8px 25px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-cylinder {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: radial-gradient(circle, #fde047 0%, #ca8a04 70%, #713f12 100%);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.4), 0 0 10px rgba(250,204,21,0.5);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lock-keyhole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 30px;
    background: #18181b;
    border-radius: 4px;
    box-shadow: inset 0 0 6px #000;
}

.lock-pick-needle {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 42px;
    background: #38bdf8;
    border-radius: 2px;
    box-shadow: 0 0 10px #38bdf8;
    pointer-events: none;
    transform-origin: bottom center;
    transition: transform 0.05s ease;
}

.lock-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.lock-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(85vw, 320px);
}

.lock-slider {
    flex: 1;
    accent-color: #38bdf8;
    cursor: pointer;
    height: 8px;
    border-radius: 4px;
}

.lock-turn-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    border: 1px solid #38bdf8;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
}

.lock-turn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.6);
}

.lock-turn-btn:active {
    transform: translateY(1px);
}

.lock-wobble {
    animation: lockJiggle 0.35s ease;
}

@keyframes lockJiggle {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px) rotate(-3deg); }
    40%, 80% { transform: translateX(5px) rotate(3deg); }
}

.lock-open-glow {
    filter: drop-shadow(0 0 25px rgba(0, 255, 136, 0.7));
}

/* --- MINIJUEGO 9: ENCENDER CANDELABROS (CANDLES) --- */
.candelabra-scene {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px 0 10px 0;
    min-height: 190px;
}

.candelabra-base {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.candles-row {
    display: flex;
    align-items: flex-end;
    gap: clamp(14px, 4vw, 24px);
    position: relative;
    z-index: 2;
}

.candle-stick {
    width: clamp(30px, 7vw, 38px);
    background: linear-gradient(to right, #fef08a 0%, #fef9c3 50%, #fef08a 100%);
    border-radius: 6px 6px 3px 3px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    user-select: none;
    touch-action: manipulation;
}

.candle-stick:hover {
    transform: scale(1.05);
}

.candle-wick {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 14px;
    background: #44403c;
    border-radius: 1px;
}

.candle-flame {
    display: none;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 28px;
    background: radial-gradient(ellipse at bottom, #ffffff 0%, #fef08a 25%, #f97316 70%, transparent 100%);
    border-radius: 50% 50% 20% 20%;
    animation: flameFlicker 0.4s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 10px #f97316);
}

.candle-lit .candle-flame {
    display: block;
}

.candle-halo {
    display: none;
    position: absolute;
    top: -38px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.45) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: haloPulse 1.2s infinite ease-in-out;
}

.candle-lit .candle-halo {
    display: block;
}

.candle-lit {
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.75);
}

.candle-roman {
    font-size: 13px;
    font-weight: 800;
    color: #78350f;
    margin-bottom: 6px;
}

@keyframes flameFlicker {
    0% { transform: translateX(-50%) scale(0.95, 0.95) rotate(-2deg); }
    100% { transform: translateX(-50%) scale(1.08, 1.15) rotate(2deg); filter: drop-shadow(0 0 14px #ea580c); }
}

@keyframes haloPulse {
    0%, 100% { transform: translateX(-50%) scale(0.9); opacity: 0.6; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 0.9; }
}

/* --- MINIJUEGO 10: PUZZLE ESCUDO HERÁLDICO (SHIELD) --- */
.crest-puzzle-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.crest-shield-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 8px;
    width: clamp(180px, 46vw, 220px);
    height: clamp(180px, 46vw, 220px);
    background: #18181b;
    padding: 10px;
    border-radius: 16px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
    transition: all 0.3s ease;
}

.crest-shield-board.crest-completed-glow {
    border-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.85);
    transform: scale(1.03);
}

.crest-quadrant {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 70px;
    user-select: none;
    touch-action: manipulation;
}

.crest-quadrant:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

.crest-quadrant-filled {
    border: 2px solid #ffd700 !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.quadrant-ghost {
    font-size: 26px;
    opacity: 0.25;
    filter: grayscale(1);
}

.crest-placed-icon {
    font-size: 32px;
    animation: popInScale 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInScale {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.crest-pieces-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.crest-piece-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    transition: all 0.2s ease;
    user-select: none;
    touch-action: manipulation;
}

.crest-piece-card:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.crest-piece-card.selected-piece {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
    transform: scale(1.05);
}

.crest-piece-card.crest-piece-used {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.quadrant-shake {
    animation: quadShake 0.3s ease;
}

@keyframes quadShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}



/* --- Alto contraste cuando un cristal/ideal se ilumina --- */
.crystal-shard.crystal-lit .crystal-name {
    color: #000000 !important;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    font-weight: 900;
}

/* ========================================================
   MEJORAS CANDELABRO: PLACA Y PEDESTAL PROFESIONAL
======================================================== */
.candle-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.candle-column:hover .candle-stick {
    transform: scale(1.05);
}

.candle-pedestal {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.candle-plaque {
    background: linear-gradient(180deg, #3d2b16 0%, #201409 100%);
    border: 1.5px solid #b45309;
    border-radius: 6px;
    padding: 5px 8px;
    width: clamp(70px, 18vw, 88px);
    text-align: center;
    font-size: clamp(10px, 2.5vw, 11px);
    font-weight: 700;
    color: #fef08a;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.candle-column.candle-lit .candle-plaque {
    border-color: #ffd700;
    background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.9);
}

.candle-column.candle-lit .candle-stick {
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.75);
}

/* ========================================================
   ESTILOS PREMIUM: BOTÓN CALIBRAR ASTROLABIO / PODERES
======================================================== */
.astral-press-btn {
    margin-top: 18px;
    padding: clamp(12px, 3.5vw, 16px) clamp(24px, 6vw, 38px);
    background: linear-gradient(135deg, #ffd700 0%, #f59e0b 50%, #b45309 100%) !important;
    color: #1a0f00 !important;
    font-weight: 900 !important;
    font-size: clamp(14px, 3.8vw, 16px) !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    border: 2px solid #ffffff !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 22px rgba(245, 158, 11, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.7) !important;
    transition: all 0.15s ease !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.astral-press-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(245, 158, 11, 0.7) !important;
    filter: brightness(1.08);
}

.astral-press-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4) !important;
}

/* ========================================================
   MINIJUEGO 11: LA BALANZA DE LA JUSTICIA (Scale)
======================================================== */
.scale-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 190px;
    position: relative;
    padding: 10px 0;
}

.scale-fulcrum {
    position: relative;
    width: 220px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.scale-fulcrum::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 90px solid #78350f;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
    z-index: 1;
}

.scale-needle {
    position: absolute;
    top: 15px;
    left: 50%;
    width: 4px;
    height: 45px;
    background: #ffd700;
    transform-origin: bottom center;
    z-index: 4;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 2px;
}

.scale-beam {
    position: absolute;
    top: 55px;
    left: 50%;
    width: 240px;
    height: 10px;
    background: linear-gradient(90deg, #b45309 0%, #ffd700 50%, #b45309 100%);
    border-radius: 5px;
    transform-origin: center center;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.scale-pan {
    position: absolute;
    top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scale-pan-left { left: 5px; }
.scale-pan-right { right: 5px; }

.scale-chain {
    width: 2px;
    height: 40px;
    background: repeating-linear-gradient(to bottom, #cbd5e1, #cbd5e1 3px, #475569 3px, #475569 6px);
}

.scale-plate {
    width: 90px;
    min-height: 42px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #b45309;
    border-radius: 0 0 45px 45px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
}

.scale-initial-weight {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.scale-weights-tray {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.scale-weight-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.scale-weight-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    transform: translateY(-2px);
}

.scale-weight-btn.weight-placed {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

.scale-placed-token {
    font-size: 9.5px;
    font-weight: bold;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 4px;
    padding: 1px 4px;
    margin: 1px 0;
    text-align: center;
}

.scale-balanced {
    box-shadow: 0 0 20px #00ff88 !important;
}

.needle-balanced {
    background: #00ff88 !important;
    box-shadow: 0 0 10px #00ff88 !important;
}

/* ========================================================
   MINIJUEGO 12: EL SELLO DEL DECRETO (Decree)
======================================================== */
.decree-scroll {
    background: #fef3c7;
    border: 4px solid #b45309;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: inset 0 0 40px rgba(180, 83, 9, 0.25), 0 10px 25px rgba(0,0,0,0.6);
    color: #1e1b4b;
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    box-sizing: border-box;
}

.decree-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1.5px solid #b45309;
    padding-bottom: 6px;
}

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

.wax-seal-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    touch-action: manipulation;
}

.wax-blob {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle at 35% 35%, #ef4444 0%, #b91c1c 60%, #7f1d1d 100%);
    border-radius: 50% 48% 52% 47%;
    box-shadow: inset 0 3px 6px rgba(255,255,255,0.4), 0 4px 14px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.15s, filter 0.15s;
    user-select: none;
}

.wax-prompt {
    font-size: 8px;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0.5px;
    color: #ffedd5;
}

.wax-blob.wax-pressing {
    transform: scale(0.92);
    filter: brightness(1.2);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.8);
}

.wax-blob.wax-stamped {
    background: radial-gradient(circle at 40% 40%, #ffd700 0%, #b45309 80%, #78350f 100%);
    border: 2px solid #fff;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.wax-relief {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #1a0f00;
}

.wax-press-meter {
    width: 60px;
    height: 5px;
    background: rgba(0,0,0,0.25);
    border-radius: 3px;
    overflow: hidden;
}

.wax-meter-bar {
    width: 0%;
    height: 100%;
    background: #ffd700;
    transition: width 0.05s linear;
}

/* ========================================================
   MINIJUEGO 13: EL TELÉGRAFO ÓPTICO DE CHAPPE (Telegraph)
======================================================== */
.telegraph-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 8px 0;
}

.telegraph-target-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px;
    padding: 6px 14px;
    text-align: center;
    margin-bottom: 12px;
}

.telegraph-tower {
    position: relative;
    width: 180px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tower-pole {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 85px;
    background: #64748b;
    border-radius: 4px;
}

.tower-roof {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 25px;
    background: #334155;
    border-radius: 6px 6px 0 0;
}

.chappe-main-arm {
    position: absolute;
    top: 40px;
    left: 50%;
    width: 120px;
    height: 8px;
    background: #ffd700;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    transition: transform 0.25s ease;
    z-index: 5;
}

.chappe-sub-arm {
    position: absolute;
    width: 45px;
    height: 6px;
    background: #38bdf8;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
    transition: transform 0.25s ease;
}

.chappe-left-arm {
    left: 0;
    top: 1px;
    transform-origin: left center;
}

.chappe-right-arm {
    right: 0;
    top: 1px;
    transform-origin: right center;
}

.chappe-aligned {
    filter: drop-shadow(0 0 15px #00ff88);
}

.telegraph-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tele-btn {
    background: rgba(30, 41, 59, 0.9);
    border: 1.5px solid #38bdf8;
    border-radius: 8px;
    color: #fff;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.tele-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #ffd700;
    transform: translateY(-2px);
}

/* ========================================================
   MINIJUEGO 14: EL CAÑÓN DE VALMY (Cannon)
======================================================== */
.cannon-stage {
    position: relative;
    width: 180px;
    height: 110px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.cannon-viewport {
    position: relative;
    width: 100%;
    height: 100%;
}

.cannon-barrel {
    position: absolute;
    bottom: 20px;
    left: 35px;
    width: 100px;
    height: 24px;
    transform-origin: 20px 15px;
    transition: transform 0.1s linear;
}

.cannon-barrel-tube {
    width: 90px;
    height: 18px;
    background: linear-gradient(180deg, #b45309 0%, #78350f 70%, #451a03 100%);
    border-radius: 4px 10px 10px 4px;
    border: 1px solid #ffd700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.cannon-wheel {
    position: absolute;
    bottom: -15px;
    left: 5px;
    width: 40px;
    height: 40px;
    border: 5px solid #d97706;
    border-radius: 50%;
    background: radial-gradient(circle, #78350f 30%, #451a03 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.7);
}

.cannon-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    margin: 10px auto;
}

.cannon-slider-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cannon-slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
}

.cannon-range {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #334155;
    border-radius: 4px;
    outline: none;
}

.cannon-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.cannon-fire-btn {
    width: 100%;
    max-width: 320px;
    margin: 10px auto 0 auto;
    display: block;
    padding: 12px 20px;
    background: #475569;
    color: #94a3b8;
    font-weight: 900;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: not-allowed;
    transition: all 0.2s ease;
}

.cannon-fire-btn.fire-ready {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
    animation: firePulse 0.8s infinite alternate ease-in-out;
}

@keyframes firePulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.02); filter: brightness(1.2); }
}

.barrel-recoil {
    animation: recoilAnim 0.4s ease;
}

@keyframes recoilAnim {
    0% { transform: translateX(0); }
    30% { transform: translateX(-15px) rotate(-35deg); }
    100% { transform: translateX(0); }
}

/* ========================================================
   MINIJUEGO 15: CARTOGRAFÍA / FOCOS MUNDIALES (Map Puzzle)
======================================================== */
.map-puzzle-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

.map-puzzle-canvas {
    position: relative;
    width: 100%;
    height: 220px;
    background: radial-gradient(ellipse at center, #1e293b 0%, #090e17 100%);
    border: 2px solid #b45309;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 35px rgba(0,0,0,0.7), 0 6px 20px rgba(0,0,0,0.5);
    display: block;
}

.map-svg-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.map-title-tag {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 9.5px;
    font-weight: 800;
    color: #ffd700;
    background: rgba(15, 23, 42, 0.9);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    z-index: 5;
}

.map-drop-target {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.target-pulse {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px dashed #38bdf8;
    border-radius: 50%;
    animation: mapTargetPulse 1.2s infinite ease-in-out;
}

@keyframes mapTargetPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; border-color: #ffd700; }
}

.target-locked .target-pulse {
    display: none;
}

.pinned-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: dropPin 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pinned-flag {
    font-size: 16px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8));
}

.pinned-name {
    font-size: 8px;
    font-weight: 900;
    color: #ffd700;
    background: rgba(0,0,0,0.8);
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

@keyframes dropPin {
    0% { transform: translateY(-20px) scale(1.4); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.map-pins-tray {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.map-pin-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.map-pin-btn:hover {
    border-color: #ffd700;
    transform: translateY(-2px);
}

.map-pin-btn.pin-selected {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.map-pin-btn.pin-placed {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
}

/* ========================================================
   CINEMÁTICA DE EYECCIÓN (EL ABISMO / FOSO DEL CASTILLO)
======================================================== */
.ejection-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: radial-gradient(circle at center, #0c0d1a 0%, #030308 100%) !important;
    z-index: 15000 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.5s ease;
    user-select: none;
}

#ejection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#ejection-avatar-track {
    position: absolute;
    top: 45%;
    left: 0;
    width: 100%;
    height: 140px;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
}

.ejected-avatar {
    position: absolute;
    width: 48px;
    height: 48px;
    overflow: hidden;
    transform-origin: center center;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.9));
    pointer-events: none;
    will-change: transform, left;
}

.ejected-avatar img {
    position: absolute;
    top: 0;
    left: -48px;
    width: 144px;
    height: 192px;
    max-width: none !important;
    max-height: none !important;
    object-fit: none;
    pointer-events: none;
    image-rendering: pixelated;
}

.ejection-textbox {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 92vw;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: none;
}

.ejection-text-main {
    font-family: 'Outfit', 'Segoe UI', Tahoma, sans-serif;
    font-size: clamp(22px, 5.2vw, 36px);
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 2px;
    min-height: 1.4em;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.95), 0 0 25px rgba(255, 255, 255, 0.25);
}

.ejection-text-role {
    font-family: 'Outfit', 'Segoe UI', Tahoma, sans-serif;
    font-size: clamp(24px, 5.8vw, 42px);
    font-weight: 900;
    margin: 0;
    min-height: 1.3em;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ejection-text-role.role-reveal-impostor {
    color: #ef4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.95), 0 0 60px rgba(239, 68, 68, 0.6);
    opacity: 1;
    transform: scale(1.1);
}

.ejection-text-role.role-reveal-crew {
    color: #00ffcc;
    text-shadow: 0 0 30px rgba(0, 255, 204, 0.95), 0 0 60px rgba(0, 255, 204, 0.6);
    opacity: 1;
    transform: scale(1.05);
}

.ejection-text-role.role-reveal-tie {
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.95);
    opacity: 1;
    transform: scale(1);
}

.ejection-text-remaining {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: clamp(15px, 3.8vw, 20px);
    font-weight: 700;
    color: #cbd5e1;
    margin: 0;
    letter-spacing: 1px;
    min-height: 1.2em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.ejection-text-remaining.show-remaining {
    opacity: 1;
    transform: translateY(0);
}

.ejection-shake {
    animation: shakeScreen 0.4s ease-in-out;
}

@keyframes shakeScreen {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px) translateY(5px); }
    40% { transform: translateX(10px) translateY(-5px); }
    60% { transform: translateX(-6px) translateY(3px); }
    80% { transform: translateX(6px) translateY(-2px); }
}

.typewriter-cursor::after {
    content: '▋';
    color: #00ffcc;
    animation: blinkCursor 0.65s infinite;
    margin-left: 6px;
    font-weight: 900;
    text-shadow: 0 0 10px #00ffcc;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================================
   FASE 2: CINEMÁTICA DE ASESINATO (KILL SCREEN)
======================================================== */
.kill-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: radial-gradient(circle at center, #1a0408 0%, #0a0103 65%, #000000 100%) !important;
    z-index: 16000 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: all;
    user-select: none;
    transition: opacity 0.6s ease;
}

.kill-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 160px 70px rgba(220, 10, 40, 0.45);
    background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.kill-flash-overlay {
    position: absolute;
    inset: 0;
    background: #ff0022;
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    transition: opacity 0.06s ease-out;
}

.kill-flash-active .kill-flash-overlay {
    opacity: 0.85;
}

.kill-shake-active {
    animation: killViolentShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes killViolentShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    12% { transform: translate(-14px, 9px) rotate(-1.5deg); }
    26% { transform: translate(16px, -11px) rotate(1.8deg); }
    44% { transform: translate(-13px, -8px) rotate(-1.2deg); }
    64% { transform: translate(11px, 8px) rotate(1.2deg); }
    82% { transform: translate(-7px, 4px) rotate(-0.5deg); }
}

.kill-stage {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Silueta acechante del asesino con sable revolucionario */
.kill-attacker-wrapper {
    position: absolute;
    left: -70px;
    top: 20px;
    width: 140px;
    height: 220px;
    pointer-events: none;
    z-index: 8;
    background: radial-gradient(ellipse at 30% 50%, rgba(10, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.95));
    transform: rotate(6deg);
}

.kill-saber-blade {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 6px;
    height: 190px;
    background: linear-gradient(180deg, #ffffff 0%, #ff1744 60%, rgba(255, 23, 68, 0) 100%);
    box-shadow: 0 0 18px 4px #ff1744, 0 0 35px 8px rgba(255, 0, 60, 0.7);
    border-radius: 4px;
    transform: rotate(-35deg);
    transform-origin: bottom center;
}

.kill-victim-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    overflow: hidden;
    transform: scale(3.5);
    transform-origin: center center;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.95));
    z-index: 12;
}

.kill-victim-avatar img {
    position: absolute;
    top: 0;
    left: -48px;
    width: 144px;
    height: 192px;
    max-width: none !important;
    max-height: none !important;
    object-fit: none;
    pointer-events: none;
    image-rendering: pixelated;
}

/* Contenedor del tajo animado */
.kill-slash-container {
    position: absolute;
    inset: -50px;
    pointer-events: none;
    z-index: 22;
    opacity: 0;
    transform: scale(0.65);
}

.kill-slash-container.slash-animate {
    animation: slashSwipe 0.38s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes slashSwipe {
    0% {
        opacity: 0;
        transform: scale(0.5) translate(40px, -40px) rotate(-15deg);
    }
    18% {
        opacity: 1;
        transform: scale(1.15) translate(0px, 0px) rotate(0deg);
    }
    100% {
        opacity: 0.65;
        transform: scale(1.02) translate(-10px, 10px) rotate(4deg);
    }
}

.kill-slash-svg {
    width: 100%;
    height: 100%;
}

/* Salpicadura visceral de sangre */
.kill-blood-container {
    position: absolute;
    inset: -30px;
    pointer-events: none;
    z-index: 18;
    opacity: 0;
}

.kill-blood-container.blood-animate {
    animation: bloodBurst 0.5s ease-out forwards;
}

@keyframes bloodBurst {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }
    25% {
        opacity: 0.95;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

.blood-splash-core {
    position: absolute;
    top: 40%;
    left: 45%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #b30018 0%, #66000c 70%, transparent 100%);
    filter: blur(2px);
}

.blood-drop {
    position: absolute;
    background: #990014;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff0022;
}

.blood-drop.b1 { width: 18px; height: 18px; top: 25%; left: 30%; transform: scale(1.2); }
.blood-drop.b2 { width: 14px; height: 14px; top: 32%; right: 28%; }
.blood-drop.b3 { width: 22px; height: 15px; top: 58%; left: 22%; transform: rotate(25deg); }
.blood-drop.b4 { width: 12px; height: 24px; top: 62%; right: 34%; transform: rotate(-35deg); }
.blood-drop.b5 { width: 10px; height: 10px; top: 78%; left: 48%; }

/* Texto de Defunción */
.kill-banner {
    position: relative;
    z-index: 30;
    margin-top: 30px;
    text-align: center;
    padding: 0 20px;
}

.kill-title {
    font-family: 'Cinzel', 'Trajan Pro', 'Georgia', serif;
    font-size: clamp(26px, 6vw, 42px);
    font-weight: 900;
    color: #ff1e38;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 0 0 25px rgba(255, 30, 56, 0.9), 0 3px 6px rgba(0, 0, 0, 0.95);
    animation: killTitleGlow 1.8s ease-in-out infinite alternate;
}

@keyframes killTitleGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 30, 56, 0.8), 0 3px 6px rgba(0, 0, 0, 0.95);
    }
    to {
        text-shadow: 0 0 35px rgba(255, 50, 75, 1), 0 0 50px rgba(255, 0, 40, 0.7), 0 3px 6px rgba(0, 0, 0, 0.95);
    }
}

.kill-subtitle {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: clamp(14px, 3.2vw, 17px);
    color: #e2e8f0;
    max-width: 640px;
    margin: 12px auto 0;
    font-weight: 500;
    line-height: 1.45;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

/* ========================================================
   FASE 3: SABOTAJES, ALARMA DE EMERGENCIA E ILUMINACIÓN
======================================================== */

/* 1. OVERLAY DE SABOTAJE (PULSO DE CRISIS Y BANNER DE CUENTA ATRÁS) */
.sabotage-overlay {
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 1100 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    user-select: none;
}

.sabotage-strobe-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Pulso carmesí para sabotaje crítico (reactor / guillotina) */
.sabotage-overlay.sabotage-critical .sabotage-strobe-vignette {
    box-shadow: inset 0 0 140px 50px rgba(255, 23, 68, 0.45);
    animation: sabotageCriticalPulse 1s ease-in-out infinite alternate;
}

@keyframes sabotageCriticalPulse {
    0% {
        box-shadow: inset 0 0 80px 30px rgba(255, 23, 68, 0.3);
        background: rgba(255, 0, 40, 0.05);
    }
    100% {
        box-shadow: inset 0 0 180px 70px rgba(255, 23, 68, 0.65);
        background: rgba(255, 0, 40, 0.15);
    }
}

/* Parpadeo eléctrico para sabotaje de luces */
.sabotage-overlay.sabotage-lights .sabotage-strobe-vignette {
    box-shadow: inset 0 0 160px 60px rgba(10, 10, 20, 0.85);
    animation: sabotageLightsFlicker 0.35s steps(2, start) infinite;
}

@keyframes sabotageLightsFlicker {
    0%, 100% {
        box-shadow: inset 0 0 150px 60px rgba(0, 0, 0, 0.85);
        background: rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: inset 0 0 180px 80px rgba(255, 180, 0, 0.15);
        background: rgba(0, 0, 0, 0.4);
    }
}

/* Banner de Alerta Superior */
.sabotage-banner {
    position: relative;
    z-index: 5;
    margin-top: 14px;
    background: rgba(20, 5, 8, 0.94);
    border: 2px solid #ff1744;
    border-radius: 35px;
    padding: 8px 24px;
    box-shadow: 0 0 25px rgba(255, 23, 68, 0.65), 0 8px 20px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(8px);
    animation: sabotageBannerBounce 0.5s ease-out;
    max-width: 90vw;
}

.sabotage-overlay.sabotage-lights .sabotage-banner {
    border-color: #ffcc00;
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.8);
}

@keyframes sabotageBannerBounce {
    0% { transform: translateY(-40px); opacity: 0; }
    70% { transform: translateY(6px); opacity: 1; }
    100% { transform: translateY(0); }
}

.sabotage-banner-icon {
    font-size: 26px;
    animation: sabotageIconSpin 1.4s ease-in-out infinite alternate;
}

@keyframes sabotageIconSpin {
    from { transform: scale(1); }
    to { transform: scale(1.25); }
}

.sabotage-banner-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.sabotage-banner-text {
    font-family: 'Cinzel', 'Trajan Pro', 'Segoe UI', sans-serif;
    font-size: clamp(13px, 3.2vw, 16px);
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.8);
}

.sabotage-overlay.sabotage-lights .sabotage-banner-text {
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}

.sabotage-banner-sub {
    font-size: clamp(10px, 2.5vw, 12px);
    color: #cbd5e1;
    font-weight: 500;
}

.sabotage-timer-box {
    background: #ff1744;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 12px;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(255, 23, 68, 0.9);
    min-width: 48px;
    text-align: center;
}

.sabotage-overlay.sabotage-lights .sabotage-timer-box {
    background: #ffcc00;
    color: #000000;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.9);
}

/* 2. FLECHA GUÍA DIRECCIONAL EN PANTALLA */
.sabotage-guide-arrow {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    width: 66px;
    height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 23, 68, 0.95) 0%, rgba(160, 0, 30, 0.9) 100%);
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(255, 23, 68, 0.95), 0 4px 12px rgba(0, 0, 0, 0.8);
    color: white;
    transform: translate(-50%, -50%);
    transition: left 0.08s ease-out, top 0.08s ease-out;
}

.sabotage-guide-arrow.guide-lights {
    background: radial-gradient(circle, rgba(255, 204, 0, 0.95) 0%, rgba(180, 140, 0, 0.9) 100%);
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.95), 0 4px 12px rgba(0, 0, 0, 0.8);
}

.guide-arrow-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.guide-arrow-dist {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    font-weight: 900;
    margin-top: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    letter-spacing: 0.5px;
}

/* 3. SPLASH CINEMÁTICO DE REUNIÓN DE EMERGENCIA / CADÁVER */
.emergency-splash-screen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 15500 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    overflow: hidden;
    user-select: none;
    background: radial-gradient(circle at center, #1c0307 0%, #080102 70%, #000000 100%);
}

.splash-stripe-bg {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 23, 68, 0.12),
        rgba(255, 23, 68, 0.12) 35px,
        rgba(10, 0, 2, 0.7) 35px,
        rgba(10, 0, 2, 0.7) 70px
    );
    opacity: 0.85;
    animation: splashStripeMove 10s linear infinite;
}

.emergency-splash-screen.splash-body-mode .splash-stripe-bg {
    background: repeating-linear-gradient(
        -45deg,
        rgba(0, 229, 255, 0.12),
        rgba(0, 229, 255, 0.12) 35px,
        rgba(0, 10, 18, 0.7) 35px,
        rgba(0, 10, 18, 0.7) 70px
    );
}

@keyframes splashStripeMove {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

.splash-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.splash-badge {
    font-family: 'Cinzel', 'Trajan Pro', sans-serif;
    font-size: clamp(14px, 3.5vw, 20px);
    font-weight: 900;
    letter-spacing: 3px;
    padding: 6px 20px;
    border-radius: 20px;
    background: #ff1744;
    color: #ffffff;
    box-shadow: 0 0 30px rgba(255, 23, 68, 0.9);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.emergency-splash-screen.splash-body-mode .splash-badge {
    background: #00e5ff;
    color: #000000;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.9);
}

.splash-title {
    font-family: 'Cinzel', 'Trajan Pro', serif;
    font-size: clamp(28px, 7vw, 54px);
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffffff;
    margin: 0 0 20px 0;
    text-shadow: 0 0 25px rgba(255, 23, 68, 0.95), 0 4px 10px rgba(0, 0, 0, 0.9);
}

.emergency-splash-screen.splash-body-mode .splash-title {
    text-shadow: 0 0 25px rgba(0, 229, 255, 0.95), 0 4px 10px rgba(0, 0, 0, 0.9);
}

.splash-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 195px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.splash-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.2);
    border: 4px solid #ff1744;
    opacity: 0;
    pointer-events: none;
}

.emergency-splash-screen.splash-body-mode .splash-shockwave {
    border-color: #00e5ff;
}

.splash-impact-active .splash-shockwave {
    animation: splashWaveBurst 0.65s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes splashWaveBurst {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

.splash-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    overflow: hidden;
    transform: scale(2.6);
    transform-origin: center center;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.95));
}

.splash-impact-active .splash-avatar {
    animation: splashAvatarSlam 0.45s cubic-bezier(0.17, 0.89, 0.32, 1.25) forwards;
}

@keyframes splashAvatarSlam {
    0% {
        transform: scale(3.6) translateY(-40px);
        opacity: 0;
    }
    60% {
        transform: scale(2.4) translateY(5px);
        opacity: 1;
    }
    100% {
        transform: scale(2.6) translateY(0);
        opacity: 1;
    }
}

.splash-avatar img {
    position: absolute;
    top: 0;
    left: -48px;
    width: 144px;
    height: 192px;
    max-width: none !important;
    max-height: none !important;
    object-fit: none;
    pointer-events: none;
    image-rendering: pixelated;
}

.splash-caller-box {
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 8px 24px;
    backdrop-filter: blur(8px);
}

.splash-caller-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
}

.splash-caller-name {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: clamp(16px, 4vw, 22px);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   CINEMÁTICA DE INICIO AAA "SHHH... SILENCIO" Y REVELACIÓN DE ROL
   ========================================================================== */
.intro-cinematic-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: #000000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    pointer-events: auto;
    font-family: 'Outfit', 'Inter', 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

/* FASE 1: SHHH... SILENCIO */
.intro-shhh-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 2;
    animation: shhhFadeIn 0.5s ease-out forwards;
}

@keyframes shhhFadeIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.intro-shhh-figure {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shhhFloat 2.2s infinite ease-in-out;
}

@keyframes shhhFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.intro-shhh-icon {
    font-size: clamp(65px, 12vw, 110px);
    filter: drop-shadow(0 0 35px rgba(255, 255, 255, 0.45));
    position: relative;
    z-index: 2;
}

.intro-shhh-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    z-index: 1;
    animation: shhhPulseGlow 1.8s infinite alternate ease-in-out;
}

@keyframes shhhPulseGlow {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 1; }
}

.intro-shhh-text {
    font-size: clamp(42px, 8vw, 84px);
    font-weight: 900;
    letter-spacing: 6px;
    color: #ffffff;
    text-shadow: 0 0 35px rgba(255, 255, 255, 0.7);
    margin: 15px 0 6px 0;
}

.intro-shhh-sub {
    font-size: clamp(14px, 2.5vw, 20px);
    color: #94a3b8;
    letter-spacing: 3px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.intro-shhh-countdown {
    margin-top: 22px;
    font-size: clamp(36px, 7vw, 56px);
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 25px rgba(251, 191, 36, 0.85);
    font-variant-numeric: tabular-nums;
    animation: countdownTick 1s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes countdownTick {
    0% { transform: scale(1.35); opacity: 0.7; }
    30% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.9; }
}

/* FASE 2: REVELACIÓN Y ALINEACIÓN DE PERSONAJES */
.intro-reveal-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 2;
    animation: revealPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes revealPopIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.intro-role-badge {
    padding: 6px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.badge-impostor {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
}

.badge-crewmate {
    background: linear-gradient(135deg, #064e3b, #10b981);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}

.intro-role-title {
    font-size: clamp(38px, 8vw, 78px);
    font-weight: 900;
    letter-spacing: 4px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.title-impostor {
    background: linear-gradient(135deg, #ffffff 0%, #fca5a5 40%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.9));
}

.title-crewmate {
    background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 40%, #00ffcc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(0, 255, 204, 0.9));
}

.intro-role-subtitle {
    font-size: clamp(15px, 2.4vw, 22px);
    color: #e2e8f0;
    margin: 0 0 25px 0;
    max-width: 650px;
    font-weight: 500;
    line-height: 1.4;
}

.intro-lineup-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    width: 100%;
}

.intro-lineup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 12px 16px;
    min-width: 95px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-lineup-card.is-me {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
    transform: translateY(-8px);
}

.intro-lineup-card.is-impostor-peer {
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
    background: rgba(40, 10, 15, 0.6);
}

.intro-figure-wrap {
    width: 48px;
    height: 48px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transform: scale(1.35);
    transform-origin: center center;
    margin: 6px 0;
}

.intro-figure-layer {
    position: absolute;
    top: 0;
    left: -48px;
    width: 144px;
    height: 192px;
    max-width: none !important;
    max-height: none !important;
    object-fit: none;
    image-rendering: pixelated;
    pointer-events: none;
}

.intro-figure-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intro-impostors-count {
    font-size: 15px;
    color: #94a3b8;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* FONDOS TEMÁTICOS */
.intro-theme-impostor {
    background: radial-gradient(circle at center, rgba(185, 28, 28, 0.35) 0%, rgba(127, 29, 29, 0.45) 45%, rgba(15, 5, 8, 0.98) 85%);
}

.intro-theme-crewmate {
    background: radial-gradient(circle at center, rgba(6, 78, 59, 0.35) 0%, rgba(6, 95, 70, 0.45) 45%, rgba(5, 15, 25, 0.98) 85%);
}

/* RELOJ DE VOTACIÓN URGENTE (MECHA / PULSO CARDÍACO) */
.vote-timer-urgent {
    color: #ef4444 !important;
    animation: timerUrgentPulse 0.5s infinite alternate ease-in-out !important;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.9) !important;
}

@keyframes timerUrgentPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.18); }
}

/* ==========================================================================
   TERMINAL DE CÁMARAS DE SEGURIDAD (CCTV SURVEILLANCE OVERLAY)
   ========================================================================== */
.security-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, 0.88);
    backdrop-filter: blur(8px);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.security-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
}

.security-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 229, 255, 0.02) 0px,
        rgba(0, 229, 255, 0.02) 2px,
        transparent 2px,
        transparent 4px
    );
    opacity: 0.8;
}

.security-terminal {
    position: relative;
    z-index: 3;
    width: min(92vw, 880px);
    height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 15, 30, 0.98) 100%);
    border: 2px solid rgba(0, 229, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 0 35px rgba(0, 229, 255, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.security-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(2, 6, 23, 0.9);
    border-bottom: 1px solid rgba(0, 229, 255, 0.25);
    flex-shrink: 0;
}

.security-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-rec-bullet {
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 12px #ef4444;
    animation: secRecBlink 1s infinite alternate;
}

@keyframes secRecBlink {
    0% { opacity: 0.3; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1.15); }
}

.security-rec-text {
    font-weight: 800;
    font-size: 13px;
    color: #ef4444;
    letter-spacing: 1.5px;
    font-family: monospace;
}

.security-room-tag {
    font-size: 11px;
    background: rgba(0, 229, 255, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(0, 229, 255, 0.35);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 1px;
}

.security-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.security-active-cams {
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
    letter-spacing: 1px;
    font-family: monospace;
}

.security-btn-close {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.security-btn-close:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
}

.security-info-banner {
    padding: 8px 18px;
    background: rgba(0, 229, 255, 0.08);
    border-bottom: 1px solid rgba(0, 229, 255, 0.15);
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.security-info-banner i {
    color: #38bdf8;
}

.security-viewport-frame {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 220px;
    background: #020617;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#security-radar-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    image-rendering: pixelated;
}

.security-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: 1;
}

.security-radar-crosshair {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    border: 1px solid rgba(0, 229, 255, 0.1);
}

.security-bottombar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(2, 6, 23, 0.95);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.security-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 600;
}

.sec-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sec-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-me { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-crew { background: #00e5ff; box-shadow: 0 0 8px #00e5ff; }
.dot-sab { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.security-btn-exit {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(2, 132, 199, 0.4) 100%);
    border: 1px solid rgba(0, 229, 255, 0.5);
    color: #38bdf8;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-btn-exit:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
    color: #000000;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    transform: translateY(-1px);
}

/* ==========================================================================
   ROLES ESPECIALES: AJUSTES DE SALA, HUD BADGE Y CINEMÁTICA
   ========================================================================== */
.role-toggle-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(30, 35, 55, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.role-toggle-card:hover {
    background: rgba(45, 52, 80, 0.9);
    border-color: rgba(0, 255, 204, 0.4);
}

.role-toggle-card input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #00ffcc;
    cursor: pointer;
    flex-shrink: 0;
}

.imp-role-card input[type="checkbox"] {
    accent-color: #ef4444;
}

.imp-role-card:hover {
    border-color: rgba(239, 68, 68, 0.5);
}

.role-toggle-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.role-toggle-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.role-toggle-icon {
    font-size: 1rem;
}

.role-toggle-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #ffffff;
}

.role-toggle-team {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: auto;
}

.role-toggle-team.team-crew {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.45);
}

.role-toggle-team.team-ghost {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
}

.role-toggle-team.team-imp {
    background: rgba(239, 68, 68, 0.22);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.role-toggle-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* HUD Role Badge (Top Left debajo de la barra de progreso) */
.hud-role-badge {
    position: fixed;
    top: 68px;
    left: 20px;
    z-index: 490;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(0, 255, 204, 0.45);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    transition: all 0.25s ease;
}

.hud-role-badge.role-impostor {
    border-color: rgba(239, 68, 68, 0.65);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.hud-role-badge.role-guardian {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 4px 18px rgba(56, 189, 248, 0.4);
}

.hud-role-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.hud-role-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.hud-role-main {
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #00ffcc;
    text-transform: uppercase;
}

.hud-role-badge.role-impostor .hud-role-main {
    color: #f87171;
}

.hud-role-sub {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fde047;
    letter-spacing: 0.3px;
}

/* Píldora de Sub-rol en IntroCinema */
.intro-subrole-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: clamp(13px, 2vw, 17px);
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 22px rgba(0, 255, 204, 0.45);
    animation: endgameZoomIn 0.5s ease forwards;
}

.subrole-scientist {
    background: linear-gradient(135deg, #0284c7, #10b981);
    color: #ffffff;
}

.subrole-engineer {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #0b0f19;
}

.subrole-detective {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #ffffff;
}

.subrole-guardian_angel {
    background: linear-gradient(135deg, #0ea5e9, #fde047);
    color: #0b0f19;
}

.subrole-shapeshifter {
    background: linear-gradient(135deg, #9333ea, #ef4444);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.65);
}

/* ==========================================================================
   MONITOR DE CONSTANTES VITALES (ROL CIENTÍFICO)
   ========================================================================== */
.vitals-terminal {
    position: relative;
    z-index: 3;
    width: min(94vw, 880px);
    height: min(88vh, 620px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(6, 28, 24, 0.96) 0%, rgba(4, 15, 20, 0.98) 100%);
    border: 2px solid rgba(16, 185, 129, 0.55);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3), inset 0 0 30px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.vitals-pulse-bullet {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 12px #10b981;
    animation: secRecBlink 0.8s infinite alternate;
}

.vitals-battery-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 78, 59, 0.45);
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 800;
    color: #a7f3d0;
    font-family: monospace;
}

.vitals-battery-bar-bg {
    width: 72px;
    height: 10px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(52, 211, 153, 0.5);
    border-radius: 6px;
    overflow: hidden;
}

.vitals-battery-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.15s linear;
}

.vitals-grid-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 12px;
    align-content: start;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, rgba(2, 6, 23, 0.95) 100%);
}

.vitals-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 28, 36, 0.85);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: all 0.25s ease;
}

.vitals-card.status-dead {
    background: rgba(45, 12, 18, 0.88);
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}

.vitals-card.status-disc {
    background: rgba(30, 35, 45, 0.75);
    border-color: rgba(148, 163, 184, 0.35);
    opacity: 0.75;
}

.vitals-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vitals-player-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vitals-status-tag {
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-family: monospace;
    flex-shrink: 0;
}

.vitals-status-tag.tag-alive {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.vitals-status-tag.tag-dead {
    background: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
    border: 1px solid #ef4444;
    animation: urgentTimerPulse 0.7s infinite alternate;
}

.vitals-status-tag.tag-disc {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.vitals-ecg-box {
    position: relative;
    height: 44px;
    background: #030b0e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.vitals-ecg-svg {
    width: 100%;
    height: 100%;
}

.ecg-line-alive {
    fill: none;
    stroke: #10b981;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px #10b981);
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: ecgSweep 1.35s linear infinite;
}

.ecg-line-dead {
    fill: none;
    stroke: #ef4444;
    stroke-width: 2.4;
    filter: drop-shadow(0 0 6px #ef4444);
}

.ecg-line-disc {
    fill: none;
    stroke: #64748b;
    stroke-width: 2;
    stroke-dasharray: 5 5;
}

@keyframes ecgSweep {
    0% { stroke-dashoffset: 220; opacity: 1; }
    80% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0.25; }
}

/* ===================================================
   SELECTOR DE METAMORFOSIS (ROL: CAMBIAFORMAS)
   =================================================== */
.shapeshift-target-card {
    background: rgba(59, 7, 100, 0.55);
    border: 1.5px solid rgba(217, 70, 239, 0.4);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.shapeshift-target-card:hover {
    background: rgba(162, 28, 175, 0.45);
    border-color: #f0abfc;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(217, 70, 239, 0.35);
}

.shapeshift-avatar-box {
    width: 48px;
    height: 48px;
    position: relative;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(240, 171, 252, 0.45);
    flex-shrink: 0;
    overflow: hidden;
}

.shapeshift-avatar-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 144px;
    height: 192px;
    image-rendering: pixelated;
    pointer-events: none;
}

.shapeshift-target-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.shapeshift-target-name {
    color: #fae8ff;
    font-weight: 800;
    font-size: 0.96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shapeshift-target-cta {
    color: #e879f9;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#shapeshift-btn.shapeshift-active {
    background: radial-gradient(circle, #db2777 0%, #701a75 100%) !important;
    border-color: #fde047 !important;
    box-shadow: 0 0 24px rgba(244, 114, 182, 0.95), 0 0 12px rgba(253, 224, 71, 0.8) !important;
    animation: urgentTimerPulse 0.8s infinite alternate;
}







