:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-card: rgba(255, 255, 255, 0.08);
    --accent: #00f2fe;
    --accent-dark: #4facfe;
    --success: #00e676;
    --danger: #ff3d00;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 0%, #1a233a 0%, var(--bg-main) 70%);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
    user-select: none;
    overflow-x: hidden;
    max-width: 100vw;
    padding-bottom: 70px; /* NUEVO: Espacio para que el banner inferior no tape nada */
}


.game-container {
    text-align: center;
    max-width: 420px;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 25px 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 25px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Pestañas Principales */
.tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 6px;
    border: 1px solid var(--border-card);
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 5px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}
.tab-btn.active {
    background-color: #1e293b;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tab-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* Controles de Visión */
.vision-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #334155;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--accent-dark); }
input:checked + .slider:before { transform: translateX(26px); }
input:disabled + .slider { opacity: 0.4; cursor: not-allowed; }

/* Paneles */
.mode-info {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: var(--text-muted);
    border: 1px solid var(--border-card);
}
.target-highlight {
    font-family: 'Roboto Mono', monospace;
    font-size: 2.2rem;
    color: var(--accent);
    font-weight: 700;
    margin: 8px 0;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* Cronómetro en Directo */
#live-timer {
    font-family: 'Roboto Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 25px;
    display: none;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

/* Botón Principal (Toque Neón) */
#main-btn {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #0b0f19;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.4), inset 0 -6px 0 rgba(0,0,0,0.15);
    touch-action: none;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
}
#main-btn:active:not(:disabled) { 
    transform: scale(0.92) translateY(4px); 
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4), inset 0 -2px 0 rgba(0,0,0,0.15);
}
#main-btn:disabled {
    background: #1e293b; 
    color: #475569; 
    cursor: not-allowed; 
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2);
}

.result { 
    margin: 25px 0; 
    font-size: 1.2rem; 
    min-height: 140px; 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

/* Clasificaciones */
.leaderboard {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 18px;
    margin-top: 30px;
    text-align: left;
    border: 1px solid var(--border-card);
}
.leaderboard h3 { 
    margin-top: 0; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding-bottom: 12px;
    font-size: 1.1rem;
    color: #e2e8f0;
}

/* Caja con Scroll para Rankings largos */
#leaderboard-content {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px; /* Para separar el texto de la barra */
}
/* Estilizar la barra de scroll */
#leaderboard-content::-webkit-scrollbar { width: 6px; }
#leaderboard-content::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 10px; }
#leaderboard-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.95rem;
}
.score-row:last-child { border-bottom: none; }

/* Inputs y Botones secundarios */
input[type="number"], input[type="text"] {
    background-color: #0f172a; 
    color: white; 
    border: 1px solid #334155;
    border-radius: 8px; 
    padding: 10px; 
    text-align: center;
    font-family: 'Inter', sans-serif;
    outline: none;
}
input:focus { border-color: var(--accent); }

.tab-btn-action {
    background: #334155; color: white; width: 100%; margin-bottom: 10px; padding: 14px;
    border-radius: 8px; font-weight: 600; border: none; cursor: pointer;
    transition: 0.2s; font-family: 'Inter', sans-serif;
}
.tab-btn-action.green { background: #059669; }
.tab-btn-action.red { background: #dc2626; }
.tab-btn-action.share { background: #1da1f2; margin-top: 15px; }
.tab-btn-action:active { transform: scale(0.98); }

.dev-zone { margin-top: 40px; text-align: center; opacity: 0.5; transition: 0.3s; }
.dev-zone:hover { opacity: 1; }
.clear-btn {
    background-color: transparent; color: var(--text-muted); border: 1px dashed #334155;
    padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 0.75rem;
    white-space: nowrap;
}

/* Modal Personalizado */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 25, 0.85); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Soporte extra para Safari/iOS */
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: fadeInOverlay 0.2s ease-out; /* Aparición suave del fondo para evitar el parpadeo */
}

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

.modal-content {
    background: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 25px 15px;
    text-align: center;
    width: 92%; max-width: 380px;
    box-sizing: border-box;
    max-height: 85vh; 
    overflow-y: auto; 
    overscroll-behavior: contain; 
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.3);
    
    /* ACELERACIÓN POR HARDWARE: Obligamos a usar la GPU para evitar el 'flicker' */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform, opacity;
    
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Ocultar la barra de scroll visualmente pero mantener la función */
.modal-content {
    scrollbar-width: none; /* Firefox */
}
.modal-content::-webkit-scrollbar { 
    display: none; /* Chrome, Safari y Opera */
}
.modal-content h2 { margin-top: 0; font-size: 1.5rem; color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.4); }
.modal-content p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.modal-content input { margin-bottom: 20px; font-size: 1.2rem; width: 100%; box-sizing: border-box; }

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

/* Perfil de Usuario - Estadísticas y Calendario */
.stats-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.stat-card { flex: 1 1 45%; background: rgba(255,255,255,0.03); padding: 12px 5px; border-radius: 8px; text-align: center; border: 1px solid rgba(255,255,255,0.08); }
.stat-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; letter-spacing: 0.5px; }
.stat-value { font-size: 1.2rem; font-weight: bold; color: #fff; font-family: 'Roboto Mono', monospace; text-shadow: 0 0 10px rgba(255,255,255,0.2); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { width: 100%; aspect-ratio: 1; border-radius: 4px; background: rgba(255,255,255,0.08); transition: 0.2s; box-sizing: border-box; border: 2px solid transparent; }
.calendar-day.active-bad { background: #dc2626; opacity: 0.8; } /* Rojo para los fallos grandes */
.calendar-day.active-med { background: #f59e0b; opacity: 0.9; } /* Naranja para fallos medios */
.calendar-day.active-good { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); } /* Verde para buenos intentos */
.calendar-day.active-perfect { 
    background: linear-gradient(135deg, #ffd700, #f59e0b); 
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.8);
}


/* --- EFECTOS DE GAME FEEL --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px) rotate(-1deg); }
    40%, 80% { transform: translateX(4px) rotate(1deg); }
}

@keyframes flashBg {
    0% { background-color: #ffd700; box-shadow: 0 0 50px #ffd700; border-color: #fff; }
    100% { background-color: var(--bg-card); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
}

.shake-active {
    animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

.flash-perfect {
    animation: flashBg 0.6s ease-out;
}

/* --- ESTILOS MODO DUELO --- */
.duel-btn {
    flex: 1;
    border-radius: 16px;
    border: none;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3);
    transition: 0.1s;
    touch-action: none; /* Bloqueamos el scroll del navegador aquí */
}
.duel-btn:active:not(:disabled) {
    transform: scale(0.96);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
}
.duel-btn:disabled { opacity: 0.5; }
.floating-text {
    position: absolute;
    font-weight: 900;
    font-size: 2.5rem;
    pointer-events: none;
    animation: floatUp 1.8s ease-out forwards;
    z-index: 9999;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    transform: translate(-50%, -50%);
}

@keyframes floatUp {
    0% { opacity: 0; margin-top: 0; scale: 0.5; }
    15% { opacity: 1; scale: 1.2; }
    25% { scale: 1; }
    80% { opacity: 1; margin-top: -80px; } /* Se queda quieto y visible hasta aquí */
    100% { opacity: 0; margin-top: -120px; }
}

/* =========================================
   🛍️ TIENDA Y COSMÉTICOS (SKINS)
   ========================================= */

/* --- 1. SKINS BÁSICAS (Color en reposo) --- */
.skin-ruby { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important; box-shadow: 0 0 30px rgba(239, 68, 68, 0.4), inset 0 -6px 0 rgba(0,0,0,0.15) !important; }
.skin-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important; box-shadow: 0 0 30px rgba(16, 185, 129, 0.4), inset 0 -6px 0 rgba(0,0,0,0.15) !important; }
.skin-amethyst { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important; box-shadow: 0 0 30px rgba(168, 85, 247, 0.4), inset 0 -6px 0 rgba(0,0,0,0.15) !important; }
.skin-amber { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important; box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), inset 0 -6px 0 rgba(0,0,0,0.15) !important; color: #111 !important; }


/* --- 2. SKINS ANIMADAS Y ÉPICAS (Efectos del botón) --- */

/* Retro 8-Bits */
.skin-pixel { border-radius: 0 !important; border: 4px solid #fff !important; box-shadow: 6px 6px 0 #000, inset -4px -4px 0 rgba(0,0,0,0.3) !important; font-family: monospace !important; font-weight: 900; letter-spacing: 2px; }
.skin-pixel.is-pressing { animation: pixelSquish var(--rnd-fast) infinite alternate; }
@keyframes pixelSquish { from { border-width: 4px; transform: scale(0.92) translateY(4px) scaleY(1); } to { border-width: 10px; transform: scale(0.92) translateY(4px) scaleY(0.95); } }

/* Slime Tóxico */
.skin-slime { border-radius: 50% 50% 40% 40% / 60% 60% 30% 30% !important; box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 -10px 20px rgba(0,0,0,0.2), inset 0 10px 15px rgba(255,255,255,0.4) !important; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1.3) !important; }
.skin-slime.is-pressing { transform: scale(1.15, 0.8) translateY(15px) !important; border-radius: 40% 40% 60% 60% / 70% 70% 30% 30% !important; box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 -5px 15px rgba(0,0,0,0.3), inset 0 5px 10px rgba(255,255,255,0.5) !important; }

/* Radar Táctico */
.skin-radar { border: 2px solid #22c55e !important; color: #22c55e !important; font-family: monospace !important; }
.skin-radar.is-pressing { animation: radarSweep var(--rnd-fast) linear infinite; }
@keyframes radarSweep { 0% { box-shadow: inset 0 0 0 0px rgba(34, 197, 94, 0.8), 0 0 10px rgba(34, 197, 94, 0.2); } 100% { box-shadow: inset 0 0 0 85px rgba(34, 197, 94, 0), 0 0 20px rgba(34, 197, 94, 0.6); } }

/* Hielo Frágil (Mejorado: Más cuadrado y con efecto de rotura dura) */
.skin-ice { border: 3px solid #bae6fd !important; background: rgba(255,255,255,0.1) !important; backdrop-filter: blur(4px) !important; color: #e0f2fe !important; border-radius: 12px !important; box-shadow: 0 0 15px rgba(186, 230, 253, 0.3), inset 0 0 15px rgba(255,255,255,0.2) !important; }
.skin-ice.is-pressing { animation: iceShatter var(--rnd-fast) infinite alternate; border-color: #fff !important; box-shadow: -5px -5px 0 rgba(255,255,255,0.4), 5px 5px 0 rgba(186, 230, 253, 0.4), inset 0 0 30px rgba(255,255,255,0.8) !important; }
@keyframes iceShatter { 0% { transform: scale(0.92) translateY(4px) skewX(-2deg); } 100% { transform: scale(0.92) translateY(4px) skewX(2deg) scaleY(0.95); } }

/* Arcoíris Infinito */
.skin-rainbow { background: linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #ff2400) !important; background-size: 400% 400% !important; animation: rainbowMove 3s ease infinite !important; color: #fff !important; border: 4px solid #fff !important; text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important; font-weight: 900 !important; }
.skin-rainbow.is-pressing { animation: rainbowMove 0.2s ease infinite !important; transform: scale(0.92) translateY(4px) !important; box-shadow: 0 10px 30px rgba(255,255,255,0.5), inset 0 0 20px rgba(255,255,255,0.8) !important; }
@keyframes rainbowMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Hexágono Core (Corta las esquinas del botón para hacerlo poligonal) */
.skin-hex { border-radius: 0 !important; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%) !important; background: #1e293b !important; color: #fff !important; border: none !important; font-weight: 900 !important; letter-spacing: 1px !important; }
.skin-hex.is-pressing { animation: hexSpin var(--rnd-slow) linear infinite !important; transform-origin: center; }
@keyframes hexSpin { 0% { transform: scale(0.92) translateY(4px) rotate(0deg); } 100% { transform: scale(0.92) translateY(4px) rotate(360deg); } }


/* Cyber Neón */
.skin-neon { border: 2px solid #0ff !important; color: #fff !important; font-style: italic; box-shadow: 0 0 10px #0ff, inset 0 0 10px #0ff !important; text-shadow: 0 0 5px #0ff; }
.skin-neon.is-pressing { animation: neonPulse var(--rnd-fast) infinite alternate; }
@keyframes neonPulse { 0% { box-shadow: 0 0 10px #0ff, inset 0 0 10px #0ff; text-shadow: 0 0 5px #0ff; } 100% { box-shadow: 0 0 30px #0ff, inset 0 0 25px #0ff; text-shadow: 0 0 20px #0ff, 0 0 30px #fff; } }

/* Fuego Infernal */
.skin-fire { border: 2px solid #ff3d00 !important; color: #fff !important; }
.skin-fire.is-pressing { animation: fireFlicker var(--rnd-fast) infinite alternate; }
@keyframes fireFlicker { 0% { box-shadow: 0 -10px 20px #ff3d00, 0 10px 20px #ffb300, inset 0 0 15px #ff3d00; transform: scale(0.92) translateY(4px) skewX(-1deg); } 100% { box-shadow: 0 -20px 35px #ffb300, 0 5px 15px #ff3d00, inset 0 0 30px #ffb300; transform: scale(0.92) translateY(4px) skewX(2deg); } }

/* Oro Puro */
.skin-gold { border: 4px solid #b8860b !important; color: #000 !important; font-weight: 900 !important; background-image: linear-gradient(60deg, transparent 20%, rgba(255,255,255,0.8) 50%, transparent 80%) !important; background-size: 200% 100% !important; box-shadow: 0 0 15px #ffd700 !important; text-shadow: none !important; }
.skin-gold.is-pressing { animation: goldShine var(--rnd-slow) linear infinite; }
@keyframes goldShine { 0% { background-position: 200% 0; box-shadow: 0 0 15px #ffd700; } 100% { background-position: -200% 0; box-shadow: 0 0 40px #fff; } }

/* Agujero Negro */
.skin-void { color: #fff !important; border: 1px solid #333 !important; box-shadow: 0 0 0 0 #000 !important; letter-spacing: -1px; }
.skin-void.is-pressing { animation: voidSuck var(--rnd-slow) cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes voidSuck { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,1); transform: scale(0.92) translateY(4px); } 50% { box-shadow: 0 0 0 20px rgba(0,0,0,0), inset 0 0 80px rgba(0,0,0,1); transform: scale(0.85) translateY(4px); letter-spacing: 5px; color: #666; } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0), inset 0 0 10px rgba(0,0,0,1); transform: scale(0.92) translateY(4px); } }

/* Sistema Glitch */
.skin-glitch { font-family: monospace !important; font-weight: 900 !important; letter-spacing: 2px !important; border-radius: 0 !important; }
.skin-glitch.is-pressing { animation: glitchJitter var(--rnd-fast) infinite linear alternate-reverse; }
@keyframes glitchJitter { 0% { transform: scale(0.92) translateY(4px) translate(0); text-shadow: 2px 0 red, -2px 0 cyan; box-shadow: 5px 0 red, -5px 0 cyan; } 20% { transform: scale(0.92) translateY(4px) translate(-2px, 2px); text-shadow: -2px 0 red, 2px 0 cyan; box-shadow: -2px 0 red, 2px 0 cyan; } 40% { transform: scale(0.92) translateY(4px) translate(-2px, -2px); filter: invert(0.2); } 60% { transform: scale(0.92) translateY(4px) translate(2px, 2px); text-shadow: 4px 0 red, -4px 0 cyan; box-shadow: 4px 0 red, -4px 0 cyan; } 80% { transform: scale(0.92) translateY(4px) translate(2px, -2px); filter: hue-rotate(90deg); } 100% { transform: scale(0.92) translateY(4px) translate(0); text-shadow: 2px 0 red, -2px 0 cyan; box-shadow: 2px 0 red, -2px 0 cyan; } }


/* --- 3. EFECTOS GLOBALES DE PANTALLA AL PULSAR --- */

body.is-pressing-radar .game-container { animation: screenRadarPulse var(--rnd-slow) infinite alternate; }
@keyframes screenRadarPulse { 
    0% { box-shadow: inset 0 0 10px rgba(34, 197, 94, 0.2); } 
    100% { box-shadow: inset 0 0 50px rgba(34, 197, 94, 0.4); border-color: rgba(34, 197, 94, 0.8); background-color: rgba(34, 197, 94, 0.05); } 
}

body.is-pressing-neon .game-container { animation: neonPulseScreen var(--rnd-fast) infinite alternate; }
@keyframes neonPulseScreen { 
    0% { box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.3); } 
    100% { box-shadow: inset 0 0 80px rgba(0, 242, 254, 0.6); border-color: rgba(0, 242, 254, 0.8); background-color: rgba(0, 242, 254, 0.1); } 
}

body.is-pressing-fire .game-container { animation: fireScreenShake var(--rnd-fast) infinite alternate; }
@keyframes fireScreenShake { 
    0% { transform: translate(1px, 1px) rotate(0deg); box-shadow: inset 0 -30px 40px rgba(255, 61, 0, 0.2); background-color: rgba(255, 61, 0, 0.05); } 
    100% { transform: translate(-1px, -2px) rotate(-0.5deg); box-shadow: inset 0 -60px 80px rgba(255, 179, 0, 0.4); background-color: rgba(255, 179, 0, 0.1); border-color: #ff3d00; } 
}

body.is-pressing-rainbow .game-container { animation: screenRainbow var(--rnd-fast) infinite alternate; }
@keyframes screenRainbow { 
    0% { box-shadow: inset 0 0 60px #ff2400; border-color: #ff2400; background-color: rgba(255, 36, 0, 0.1); } 
    33% { box-shadow: inset 0 0 60px #1de840; border-color: #1de840; background-color: rgba(29, 232, 64, 0.1); } 
    66% { box-shadow: inset 0 0 60px #2b1de8; border-color: #2b1de8; background-color: rgba(43, 29, 232, 0.1); } 
    100% { box-shadow: inset 0 0 60px #dd00f3; border-color: #dd00f3; background-color: rgba(221, 0, 243, 0.1); } 
}

body.is-pressing-ice .game-container { transition: 0.3s; filter: saturate(0.2) contrast(1.2); }
body.is-pressing-glitch .game-container { animation: screenGlitch var(--rnd-fast) infinite steps(2); }
@keyframes screenGlitch { 0% { transform: translateX(0); filter: hue-rotate(0deg); } 100% { transform: translateX(2px); filter: hue-rotate(45deg); } }
body.is-pressing-gold .game-container { transition: 0.5s ease-out; background: #000; border-color: #ffd700; box-shadow: 0 25px 50px -12px rgba(255, 215, 0, 0.1); }
body.is-pressing-void .game-container { transform-origin: center center; animation: voidScreenSuck var(--rnd-slow) cubic-bezier(0.5, 0, 0.2, 1) infinite alternate; }
body.is-pressing-hex .game-container { animation: screenHexPulse var(--rnd-fast) infinite alternate; }
@keyframes screenHexPulse { 0% { clip-path: polygon(2% 2%, 98% 0%, 100% 98%, 0% 100%); } 100% { clip-path: polygon(0% 0%, 100% 2%, 98% 100%, 2% 98%); } }
@keyframes voidScreenSuck { 0% { transform: scale(1); filter: brightness(1) contrast(1) blur(0px); } 100% { transform: scale(0.75); filter: brightness(0.2) contrast(2) blur(3px); border-radius: 80px; } }
/* =========================================
   🚨 MODAL PERSONALIZADO (ALERTAS Y APODOS)
   ========================================= */
.custom-modal-overlay {
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex; justify-content: center; align-items: center;
}

.custom-modal {
    background: #111827;
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 25px;
    width: 90%; max-width: 340px;
    text-align: center;
    box-shadow: 0 0 25px rgba(0,242,254,0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal h3 { 
    margin-top: 0; 
    color: #fff; 
    font-size: 1.4rem; 
}

.custom-modal p { 
    color: var(--text-muted); 
    font-size: 1rem; 
    margin-bottom: 20px; 
}

.custom-modal input { 
    margin-bottom: 20px; 
    width: 100%; 
    box-sizing: border-box; 
    padding: 12px; 
    font-size: 1.1rem; 
    border-radius: 8px; 
    border: 1px solid #334155; 
    background: #0f172a; 
    color: #fff; 
    text-align: center;
    outline: none;
}

.custom-modal input:focus {
    border-color: var(--accent);
}

.custom-modal-buttons { 
    display: flex; 
    gap: 10px; 
}
/* =========================================
   🕹️ CABECERA Y DOCK DE BOTONES
   ========================================= */
.header-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 4px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-action-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.08);
}

.shop-btn-highlight {
    background: rgba(0, 242, 254, 0.08);
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15), inset 0 0 10px rgba(0, 242, 254, 0.05);
}

/* =========================================
   📢 BANNERS DE PUBLICIDAD
   ========================================= */

/* Banner Inferior Fijo */
.ad-banner-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px; /* Altura estándar de un banner móvil */
    background: #0f172a;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: #475569;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Banners Verticales al lado del botón */
.ad-vertical {
    /* Por defecto en MÓVILES estarán OCULTOS para no aplastar el botón */
    display: none; 
    width: 120px; /* Tamaño real de AdMob */
    height: 240px; 
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed #475569;
    border-radius: 12px;
    color: #475569;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Solo se mostrarán si la pantalla es grande (Tablets, PC, o móviles en horizontal) */
@media (min-width: 768px) {
    .ad-vertical {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* =========================================
   🏷️ EFECTOS DE NICKNAME VIP
   ========================================= */
.nick_cyan { color: #00f2fe; text-shadow: 0 0 8px rgba(0,242,254,0.6); }
.nick_magenta { color: #d946ef; text-shadow: 0 0 8px rgba(217,70,239,0.6); }
.nick_lime { color: #84cc16; text-shadow: 0 0 8px rgba(132,204,22,0.6); }
.nick_bold { font-weight: 900; letter-spacing: 1px; color: #fff; text-transform: uppercase; }
.nick_neon { color: #fff; text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #e11d48, 0 0 30px #e11d48; }
.nick_gold { background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: bold; }
.nick_glitch { animation: textGlitch 1.5s infinite linear alternate-reverse; color: #fff; position: relative; display: inline-block; }
@keyframes textGlitch { 0% { text-shadow: 2px 0 red, -2px 0 cyan; } 25% { text-shadow: -2px 0 red, 2px 0 cyan; } 50% { text-shadow: 2px 2px red, -2px -2px cyan; } 75% { text-shadow: -2px -2px red, 2px 2px cyan; } 100% { text-shadow: 2px 0 red, -2px 0 cyan; } }
.nick_rgb { animation: textRgb 3s infinite linear; font-weight: bold; }
@keyframes textRgb { 0% { color: #ff0000; } 16% { color: #ffff00; } 33% { color: #00ff00; } 50% { color: #00ffff; } 66% { color: #0000ff; } 83% { color: #ff00ff; } 100% { color: #ff0000; } }

/* =========================================
   🫧 EFECTO BURBUJAS REALISTAS (CSS PURO)
   ========================================= */
.real-bubble {
    position: fixed;
    border-radius: 50%;
    /* Degradado para imitar el reflejo de la luz en el jabón */
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1) 40%, rgba(0, 242, 254, 0.2) 80%, rgba(255, 255, 255, 0.6) 100%);
    /* Sombra interior para darle volumen 3D */
    box-shadow: inset 0 0 10px rgba(255,255,255,0.8), 0 2px 4px rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 9999;
    animation: floatBubble ease-in forwards;
}

@keyframes floatBubble {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    50% { transform: translateY(-25vh) translateX(calc(var(--dir) * 20px)) scale(1); opacity: 0.8; }
    100% { transform: translateY(-60vh) translateX(calc(var(--dir) * -15px)) scale(1.1); opacity: 0; }
}
