/* --- 1. RESET & VARIABLES BASE --- */
:root {
    --bg-dark: #09090b;
    --primary: #8b5cf6;
    --accent: #f43f5e;
    --gold: #fbbf24;
    --text: #ffffff;
    /* Colores de la ruleta */
    --c1: #ef4444; --c2: #f59e0b; --c3: #10b981; 
    --c4: #06b6d4; --c5: #3b82f6; --c6: #d946ef;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh; 
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Fondo Premium con degradado sutil */
.background-glow {
    position: fixed; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.2) 0%, rgba(0,0,0,0) 70%),
                radial-gradient(circle at 85% 85%, rgba(244, 63, 94, 0.15) 0%, rgba(0,0,0,0) 60%);
    z-index: -1; pointer-events: none; top: 0; left: 0;
}

.app-container {
    width: 100%; max-width: 420px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    height: 100dvh; 
}

/* --- 2. LOGOS --- */
.logo-imagen {
    max-width: 240px;
    height: auto;
    margin: 0 auto 5px auto;
    display: block;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.3));
}

.logo-imagen-juego {
    max-width: 140px;
    height: auto;
    margin: 10px auto;
    filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.5));
    display: block;
}

/* --- 3. MENÚ PRINCIPAL (DISEÑO PREMIUM) --- */
header { margin-bottom: 10px; text-align: center; width: 100%; }
.subtitle { color: #a1a1aa; font-size: 0.85rem; margin-top: 5px; font-weight: 500; letter-spacing: 0.5px; }

.menu-grid {
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px;
    width: 100%; 
    margin: 20px 0;
    align-content: center;
}

/* Tarjeta Menú Horizontal (Glassmorphism) */
.game-card {
    background: rgba(24, 24, 27, 0.6); /* Semitransparente */
    backdrop-filter: blur(12px); /* Efecto cristal */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 20px;
    text-align: left; /* Alineado a la izquierda */
    text-decoration: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: row; /* Icono lado a lado */
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.game-card:active {
    transform: scale(0.98);
    background: rgba(39, 39, 42, 0.9);
    border-color: var(--primary);
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 0;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

.game-info { flex: 1; }

.game-title {
    font-weight: 900;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.game-desc {
    font-size: 0.8rem;
    color: #a1a1aa;
    font-weight: 500;
}

/* --- 4. RELOJ DIGITAL (BOMBA) --- */
.countdown-container {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.timer-box {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fbbf24;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.2);
}

/* Tarjeta Especial Finde (ACTIVA) */
.special-card {
    background: linear-gradient(135deg, rgba(42, 34, 8, 0.85) 0%, rgba(0,0,0,0.95) 100%);
    border: 1px solid rgba(251, 191, 36, 0.5);
    animation: pulseBorder 2s infinite;
}

/* Tarjeta Especial BLOQUEADA (Lunes-Jueves) */
.locked-card {
    background: rgba(20, 20, 20, 0.4) !important;
    border: 1px solid #333 !important;
    filter: grayscale(1);
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none !important;
    animation: none !important;
    pointer-events: none; /* No click */
}

/* Ajustes visuales para modo bloqueado */
.locked-card .limited-badge { background: #555 !important; color: #aaa !important; box-shadow: none; }
.locked-card .timer-box { border-color: #444 !important; color: #777 !important; box-shadow: none !important; }
.locked-card .game-title { color: #999 !important; }

.limited-badge {
    position: absolute; top: 10px; right: 10px;
    background: #ef4444; color: white;
    font-size: 0.6rem; font-weight: 900;
    padding: 3px 6px; border-radius: 4px;
    text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* --- 5. COMPONENTES DE JUEGO (Stickers y Tarjetas Blancas) --- */
/* (Estilos para Ruleta, Verdad/Reto, Globo, Corte) */
.game-card-display, .question-card, .sticker-card, .result-sticker, .detonator-box, .win-sticker {
    background: #ffffff; /* BLANCO */
    color: #000000;      /* NEGRO */
}

.detonator-box {
    background: #222; /* Excepción: La bomba es oscura */
    color: white;
}

/* ESTILOS ESPECÍFICOS COPIADOS DE LOS JUEGOS PARA QUE NO SE ROMPAN */
.question-card, .sticker-card, .result-sticker, .win-sticker {
    border: 4px solid #111;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.7);
    position: relative;
    border: 3px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #fbbf24, #f43f5e, #3b82f6);
    background-origin: border-box; background-clip: content-box, border-box;
}

/* RULETA: Sticker Overlay */
.sticker-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: none; justify-content: center; align-items: center;
    z-index: 200; backdrop-filter: blur(8px);
}
.sticker-card { width: 85%; max-width: 320px; padding: 40px 20px; transform: rotate(-2deg); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.sticker-emoji { font-size: 6rem; display: block; margin-bottom: 15px; animation: bounce 1s infinite; }
.sticker-text { font-size: 1.5rem; font-weight: 900; line-height: 1.2; margin-bottom: 30px; text-transform: uppercase; }

/* VERDAD O RETO */
.game-card-display {
    padding: 30px 20px; width: 100%; min-height: 320px; border: 4px solid #111; border-radius: 20px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; margin-bottom: 20px;
    background-image: none; /* Reset para V/R */
    background: white;
}
.icon-large { font-size: 4rem; margin-bottom: 10px; }
.category-badge { font-size: 1rem; font-weight: 900; text-transform: uppercase; margin-bottom: 15px; padding: 5px 15px; border-radius: 50px; background: #eee; color: #999; }
.main-text { font-size: 1.5rem; font-weight: 800; line-height: 1.3; text-transform: uppercase; margin-bottom: 20px; }
.sub-text { font-size: 0.9rem; color: #666; font-weight: 600; }

/* GLOBO */
.question-card { padding: 20px; width: 100%; display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.q-text { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; min-height: 3.5rem; display: flex; align-items: center; justify-content: center; }
.balloon-area { height: 220px; display: flex; align-items: center; justify-content: center; margin: 10px 0; position: relative; }
.balloon { font-size: 5rem; transition: transform 0.1s linear; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.4)); cursor: pointer; z-index: 10; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.opt-btn { background: #111; color: white; border: none; padding: 15px 5px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; cursor: pointer; text-transform: uppercase; transition: transform 0.1s; word-wrap: break-word; }
.opt-btn:active { transform: scale(0.95); }
.opt-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* ELEMENTOS COMUNES */
.spin-button { background: linear-gradient(135deg, var(--primary), var(--accent)); border: none; padding: 20px 0; width: 100%; border-radius: 18px; color: white; font-weight: 800; font-size: 1.15rem; letter-spacing: 2px; cursor: pointer; box-shadow: 0 10px 30px -5px rgba(244, 63, 94, 0.5); text-transform: uppercase; transition: transform 0.1s; }
.spin-button:active { transform: scale(0.97); }
.sticker-btn { background: #111; color: white; border: none; padding: 15px 30px; font-size: 1.2rem; font-weight: 900; border-radius: 50px; cursor: pointer; width: 100%; }
.controls-row { display: flex; gap: 15px; width: 100%; }
.half-btn { flex: 1; display: flex; justify-content: center; align-items: center; padding: 20px 0; border-radius: 18px; color: white; font-weight: 800; font-size: 1.1rem; cursor: pointer; border: none; transition: transform 0.1s; text-transform: uppercase; }
.back-btn { background: rgba(255,255,255,0.05); border: 1px solid #333; color: #a1a1aa; padding: 12px; width: 100%; border-radius: 12px; margin-top: 15px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: background 0.2s; }
.back-btn:active { background: rgba(255,255,255,0.1); }

/* RULETA CANVAS */
.wheel-wrapper { position: relative; width: 90%; max-width: 400px; aspect-ratio: 1 / 1; margin: 20px 0; filter: drop-shadow(0 0 15px rgba(0,0,0,0.5)); }
#wheel { width: 100%; height: 100%; border-radius: 50%; background: transparent; }
.arrow { width: 0; height: 0; border-left: 20px solid transparent; border-right: 20px solid transparent; border-top: 30px solid white; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 10; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); }

/* ANIMACIONES */
.boom-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(220, 38, 38, 0.95); z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; color: white; text-align: center; animation: flash 0.2s; }
@keyframes pulseBorder { 0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); } }
@keyframes popIn { 0% { transform: scale(0.5) rotate(-10deg); opacity: 0; } 100% { transform: scale(1) rotate(-2deg); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes flash { 0% { background: white; } 100% { background: rgba(220, 38, 38, 0.95); } }
.shake { animation: shake 0.5s infinite; }
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg) scale(var(--scale)); }
    50% { transform: translate(-1px, 2px) rotate(1deg) scale(var(--scale)); }
    100% { transform: translate(1px, -2px) rotate(-1deg) scale(var(--scale)); }
}