@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@300;400&display=swap');

:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.95);
    --primary-red: #8a0303;
    --bright-red: #c91a1a;
    --gold: #d4af37;
    --gold-dim: #8a7018;
    --text-main: #e0e0e0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 20px;
    padding-top: 80px !important;
    text-align: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Partículas */
.embers-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background: radial-gradient(circle at center, #1a0505 0%, #000 100%); }
.ember { position: absolute; bottom: -10px; width: 2px; height: 2px; background: orangered; box-shadow: 0 0 10px red; border-radius: 50%; animation: rise linear infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-110vh); opacity: 0; } }

h1, h2, h3 { font-family: 'Cinzel', serif; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; }
h1 { font-size: 2.2em; border-bottom: 1px solid var(--primary-red); padding-bottom: 10px; display: inline-block; }

.container { max-width: 550px; margin: 0 auto; background: var(--card-bg); padding: 30px 20px; border: 1px solid #333; border-top: 3px solid var(--primary-red); border-bottom: 3px solid var(--primary-red); box-shadow: 0 10px 30px rgba(0,0,0,0.9); }

input { width: 90%; padding: 15px; margin-bottom: 20px; background: #0f0f0f; border: 1px solid #444; border-left: 2px solid var(--gold-dim); color: var(--gold); font-family: 'Cinzel', serif; font-size: 1.2em; text-align: center; }
input:focus { outline: none; border-color: var(--primary-red); }

button { width: 100%; padding: 18px; margin: 10px 0; background: linear-gradient(180deg, #2a0a0a 0%, #1a0000 100%); border: 1px solid #444; color: #ccc; font-family: 'Cinzel', serif; font-size: 1.1em; cursor: pointer; text-transform: uppercase; transition: 0.3s; }
button:hover { background: linear-gradient(180deg, var(--primary-red) 0%, #4a0000 100%); color: white; border-color: var(--bright-red); box-shadow: 0 0 15px rgba(138, 3, 3, 0.6); }
button:disabled { background: #111; border-color: #222; color: #444; cursor: not-allowed; box-shadow: none; }
button.secondary { background: transparent; border: 1px solid #333; color: #777; font-size: 0.9em; }
button.secondary:hover { background: rgba(255,255,255,0.05); color: #aaa; }
.execute-btn { background: linear-gradient(to right, #600, #900); border: 1px solid #f00; color: #fff; font-weight: bold; box-shadow: 0 0 20px rgba(150,0,0,0.3); display: none; animation: pulse-red 2s infinite; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(168, 50, 50, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(168, 50, 50, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 50, 50, 0); } }

button.target-btn { background: #121212; border: 1px solid #333; text-align: left; padding-left: 20px; display: flex; align-items: center; justify-content: space-between; }
button.target-btn.selected { background: #1f1a10; border: 1px solid var(--gold); color: var(--gold); }

/* BARRA SUPERIOR Y MENÚ ARREGLADO */
.top-bar { position: fixed; top: 0; left: 0; width: 100%; height: 60px; background: rgba(10, 10, 10, 0.98); border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 6000; box-sizing: border-box; }
.app-title { font-family: 'Cinzel', serif; color: var(--primary-red); font-size: 1.4em; font-weight: bold; }
.hamburger { color: var(--gold); font-size: 1.8em; cursor: pointer; padding: 10px; }

/* Menú lateral - ARREGLADO */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px; /* Escondido */
    width: 280px;
    height: 100vh; /* Toda la altura */
    background: #0f0f0f;
    border-left: 1px solid var(--gold-dim);
    transition: right 0.3s ease-in-out;
    z-index: 7000; /* Por encima de todo */
    display: flex;
    flex-direction: column;
    padding: 80px 20px 20px 20px; /* Padding top deja espacio para cerrar */
    box-sizing: border-box;
    box-shadow: -5px 0 20px rgba(0,0,0,0.8);
}
.side-menu.open { right: 0; }

.menu-close-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: #777; font-size: 2em; cursor: pointer; padding: 0; width: auto; margin: 0;
}
.menu-item { background: #1a1a1a; margin-bottom: 10px; padding: 15px; border: 1px solid #333; cursor: pointer; text-align: left; }
.menu-item:hover { background: #252525; border-color: var(--gold); color: var(--gold); }
.menu-item.host-item { border-left: 3px solid var(--primary-red); }

/* Overlays y Modales */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 8000; display: none; justify-content: center; align-items: center; }
.modal-content { background: #0a0a0a; border: 1px solid var(--gold-dim); width: 90%; max-width: 400px; max-height: 80vh; overflow-y: auto; padding: 20px; text-align: center; }

#night-intro-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 9999; transition: opacity 1.5s ease; pointer-events: none; opacity: 0; }
#night-intro-overlay h1 { font-size: 2.5em; color: var(--primary-red); border: none; text-shadow: 0 0 20px red; margin: 0; }
#night-intro-overlay p { font-family: 'Cinzel', serif; color: #888; letter-spacing: 2px; margin-top: 15px; font-size: 1.2em; text-align: center; padding: 0 20px; }

.phase-badge { position: absolute; top: -15px; right: 20px; background: #000; border: 1px solid var(--gold); color: var(--gold); padding: 5px 15px; font-size: 0.8em; text-transform: uppercase; z-index: 10; }
.player-row { background: #111; padding: 12px; margin: 8px 0; border-left: 3px solid #333; display: flex; justify-content: space-between; font-family: 'Cinzel', serif; }
.role-card { width: 45%; background: #0f0f0f; border: 1px solid #333; padding: 10px; cursor: pointer; opacity: 0.5; margin-bottom: 10px; }
.role-card.selected { opacity: 1; border-color: var(--gold); background: #1a1505; }
.roles-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.log-entry { border-bottom: 1px solid #222; color: #999; padding: 8px; text-align: left; font-size: 0.9em; }

@media (max-width: 400px) { h1 { font-size: 1.8em; } .role-card { width: 100%; } }