/* Estilos críticos para que funcionen los botones móviles */
.mobile-controls {
    position: fixed;
    bottom: 30px;
    left: 0;
    width: 100%;
    z-index: 10000; /* Encima de todo */
    display: none; /* Controlado por JS */
    justify-content: space-between;
    padding: 0 30px;
    pointer-events: none; /* Deja pasar clicks fuera de botones */
    box-sizing: border-box;
}

.mobile-controls.active {
    display: flex !important; /* Fuerza visibilidad */
}

.control-left, .control-right {
    display: flex;
    gap: 20px;
    pointer-events: auto;
    z-index: 10001;
}

.control-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00f0ff;
    color: #00f0ff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 240, 255, 0.3);
    transition: transform 0.1s;
}

.control-btn:active {
    background: rgba(0, 240, 255, 0.3);
    transform: scale(0.9);
}
/* ===================================
   Variables y Reset
   =================================== */
:root {
    --cyber-cyan: #00f0ff;
    --cyber-cyan-glow: rgba(0, 240, 255, 0.5);
    --cyber-dark: #0a0a0a;
    --cyber-black: #000000;
    --cyber-white: #ffffff;
    --cyber-gray: #1a1a1a;
    --cyber-red: #ff0055;
}

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

body {
    font-family: 'Courier New', monospace;
    background-color: var(--cyber-black);
    color: var(--cyber-cyan);
    overflow: hidden; /* Sin scroll en body - cada pantalla maneja su propio scroll */
    min-height: 100vh;
    max-height: 100vh;
    position: relative;
}

/* ===================================
   Agujero Negro de Fondo (Sistema)
   =================================== */
.black-hole-bg {
    position: fixed;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(
        circle,
        #000 30%,
        #0a0a0a 50%,
        #1a1a1a 65%,
        transparent 80%
    );
    box-shadow: 
        0 0 100px rgba(0, 240, 255, 0.05),
        inset 0 0 100px rgba(0, 0, 0, 0.8);
    animation: pulseGravity 6s infinite ease-in-out;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulseGravity {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

/* ===================================
   Botón de Regreso
   =================================== */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--cyber-gray);
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-button:hover {
    background: var(--cyber-cyan);
    color: var(--cyber-black);
    box-shadow: 0 0 20px var(--cyber-cyan-glow);
    transform: translateX(-5px);
}

/* ===================================
   Clases de Utilidad
   =================================== */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: flex !important;
}

/* Ocultar elementos de forma accesible (para lectores de pantalla) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================
   Pantallas Base
   =================================== */
.screen {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow: hidden; /* Por defecto sin scroll */
}

.screen.active {
    display: flex;
}

/* ===================================
   Pantalla de Inicio
   =================================== */

/* ===================================
   Pantalla de Inicio
   =================================== */
#start-screen {
    background: 
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridScroll 20s linear infinite;
}

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

.glitch-container {
    position: relative;
    margin-bottom: 30px;
}

.glitch-text {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--cyber-cyan);
    position: relative;
    animation: glitch 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    animation: glitchTop 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    color: var(--cyber-red);
}

.glitch-text::after {
    animation: glitchBottom 3s infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    color: var(--cyber-white);
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitchTop {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-5px, -5px); }
}

@keyframes glitchBottom {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(5px, 5px); }
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--cyber-white);
    text-align: center;
    margin-bottom: 60px;
    opacity: 0.8;
}

/* ===================================
   Instrucciones
   =================================== */
.instructions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
    padding: 30px;
    border: 1px solid var(--cyber-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    color: var(--cyber-white);
}

.instruction-item i {
    color: var(--cyber-cyan);
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

/* ===================================
   Botón Cyber
   =================================== */
.cyber-button {
    position: relative;
    padding: 15px 40px;
    background: transparent;
    border: 2px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    text-decoration: none;
    display: inline-block;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--cyber-cyan);
    transition: left 0.3s ease;
    z-index: 0;
}

.cyber-button:hover::before {
    left: 0;
}

.cyber-button:hover {
    color: var(--cyber-black);
    box-shadow: 0 0 30px var(--cyber-cyan-glow);
}

.button-text {
    position: relative;
    z-index: 1;
}

.cyber-button.secondary {
    border-color: var(--cyber-white);
    color: var(--cyber-white);
}

.cyber-button.secondary::before {
    background: var(--cyber-white);
}

/* ===================================
   Quote
   =================================== */
.quote {
    margin-top: 60px;
    max-width: 600px;
    text-align: center;
    position: relative;
    padding: 20px;
    border-left: 2px solid var(--cyber-cyan);
    border-right: 2px solid var(--cyber-cyan);
}

.quote p {
    font-size: 1rem;
    color: var(--cyber-white);
    font-style: italic;
    line-height: 1.8;
    margin: 15px 0;
}

.quote i {
    color: var(--cyber-cyan);
    opacity: 0.3;
    font-size: 1.5rem;
}

/* ===================================
   Contenedor del Juego
   =================================== */
#game-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: relative;
    background: var(--cyber-black);
}

#game-container.active {
    display: block;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===================================
   HUD
   =================================== */
#hud {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-item i {
    font-size: 1.2rem;
}

/* ===================================
   Botón y Menú de Configuración
   =================================== */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: var(--cyber-cyan);
    color: var(--cyber-black);
    box-shadow: 0 0 20px var(--cyber-cyan-glow);
    transform: rotate(90deg);
}

.settings-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--cyber-cyan);
    padding: 30px;
    z-index: 10000;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.5);
}

.settings-menu.hidden {
    display: none;
}

.settings-menu h3 {
    color: var(--cyber-cyan);
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    color: var(--cyber-white);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--cyber-gray);
    border: 1px solid var(--cyber-cyan);
    outline: none;
    -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--cyber-cyan);
    cursor: pointer;
    border-radius: 50%;
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cyber-cyan);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--cyber-cyan);
}

.setting-item span {
    color: var(--cyber-cyan);
    font-size: 0.9rem;
    min-width: 40px;
}

.hud-item i {
    font-size: 1.2rem;
}

/* ===================================
   Diálogos
   =================================== */
.dialogue-box {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--cyber-cyan);
    padding: 25px;
    z-index: 2000;
    box-shadow: 0 0 30px var(--cyber-cyan-glow);
}

.dialogue-box.hidden {
    display: none;
}

.dialogue-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 0, 85, 0.2);
    border: 2px solid var(--cyber-red);
    color: var(--cyber-red);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 4px;
}

.dialogue-close:hover {
    background: rgba(255, 0, 85, 0.4);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
}

.dialogue-close:active {
    transform: scale(0.95) rotate(90deg);
}

.dialogue-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#dialogue-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--cyber-white);
    min-height: 60px;
}

.dialogue-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cyber-cyan);
    font-size: 0.85rem;
    opacity: 0.7;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.2; }
}

/* ===================================
   Pantalla de Pausa
   =================================== */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

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

.overlay-screen h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

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

/* ===================================
   Pantalla Final
   =================================== */
#end-screen {
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
        var(--cyber-black);
    overflow-y: auto !important; /* Scroll vertical activo */
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    padding: 0; /* Remover padding del .screen base */
    align-items: flex-start; /* Alinear al inicio para permitir scroll */
    height: 100vh; /* Altura fija para que el scroll funcione */
}

/* Estilos de scrollbar personalizados */
#end-screen::-webkit-scrollbar {
    width: 8px;
}

#end-screen::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.5);
}

#end-screen::-webkit-scrollbar-thumb {
    background: var(--cyber-cyan);
    border-radius: 4px;
}

#end-screen::-webkit-scrollbar-thumb:hover {
    background: var(--cyber-white);
}

.end-content {
    text-align: center;
    max-width: 900px;
    padding: 40px 20px;
    padding-bottom: 80px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.end-message {
    margin: 40px 0;
    padding: 30px;
    border-top: 1px solid var(--cyber-cyan);
    border-bottom: 1px solid var(--cyber-cyan);
}

.end-message p {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--cyber-white);
    margin: 10px 0;
}

.end-message .big-text {
    font-size: 1.5rem;
    color: var(--cyber-cyan);
    font-weight: bold;
    margin-bottom: 20px;
}

.end-message .highlight {
    color: var(--cyber-cyan);
    font-size: 1.4rem;
    margin-top: 20px;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px var(--cyber-cyan-glow); }
    50% { text-shadow: 0 0 20px var(--cyber-cyan-glow), 0 0 30px var(--cyber-cyan-glow); }
}

/* ===================================
   Estadísticas Finales
   =================================== */
.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 40px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--cyber-cyan);
    text-shadow: 0 0 10px var(--cyber-cyan-glow);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--cyber-white);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

/* ===================================
   CTA Section
   =================================== */
.cta-section {
    margin: 60px 0;
}

.cta-text {
    font-size: 1.5rem;
    color: var(--cyber-white);
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===================================
   Créditos
   =================================== */
.credits {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--cyber-gray);
}

.credits p {
    color: var(--cyber-white);
    opacity: 0.6;
    margin: 10px 0;
    font-size: 0.9rem;
}

.credits strong {
    color: var(--cyber-cyan);
    font-weight: bold;
}

.credits-links {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.credits-links a {
    color: var(--cyber-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.credits-links a:hover {
    color: var(--cyber-white);
    text-shadow: 0 0 10px var(--cyber-cyan-glow);
}

/* ===================================
   Loading
   =================================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cyber-black);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--cyber-gray);
    border-top: 3px solid var(--cyber-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--cyber-cyan);
    font-size: 1rem;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .instructions {
        padding: 20px;
    }

    .instruction-item {
        font-size: 0.9rem;
    }

    .instruction-item i {
        font-size: 1.2rem;
    }

    #hud {
        top: 10px;
        right: 10px;
        gap: 10px;
    }

    .hud-item {
        padding: 8px 15px;
        font-size: 0.75rem;
    }

    .dialogue-box {
        width: 95%;
        padding: 20px;
        top: 70px;
    }

    #dialogue-text {
        font-size: 1rem;
        min-height: 80px;
    }

    .stats {
        flex-direction: column;
        gap: 30px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cyber-button {
        width: 100%;
        max-width: 300px;
    }

    .credits-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* ===================================
   Animaciones de entrada
   =================================== */
.screen.active > * {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.screen.active > *:nth-child(1) { animation-delay: 0.1s; }
.screen.active > *:nth-child(2) { animation-delay: 0.2s; }
.screen.active > *:nth-child(3) { animation-delay: 0.3s; }
.screen.active > *:nth-child(4) { animation-delay: 0.4s; }
.screen.active > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Controles Móviles
   =================================== */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 15px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 20px;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    max-height: 110px;
}

.mobile-controls > * {
    pointer-events: auto;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.25);
    border: 3px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: rgba(0, 240, 255, 0.3);
    transition: all 0.15s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    position: relative;
}

/* Labels para botones móviles */
.control-btn::after {
    content: attr(data-label);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--cyber-cyan);
    white-space: nowrap;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.control-btn:active {
    background: rgba(0, 240, 255, 0.6);
    transform: scale(0.92);
    box-shadow: 0 0 25px var(--cyber-cyan-glow);
}

.control-btn.jump {
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 85, 0.25);
    border-color: var(--cyber-red);
    color: var(--cyber-red);
    font-size: 30px;
}

.control-btn.jump:active {
    background: rgba(255, 0, 85, 0.6);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.6);
}

.control-btn.dash {
    width: 60px;
    height: 60px;
    margin-left: 8px;
}

.control-left {
    display: flex;
    gap: 10px;
}

.control-right {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* ===================================
   Sistema de Recompensas
   =================================== */
.reward-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(0, 240, 255, 0.05);
    border: 2px solid var(--cyber-cyan);
    border-radius: 10px;
    text-align: center;
}

.chest-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.cyber-button.special {
    background: linear-gradient(45deg, var(--cyber-cyan), var(--cyber-red));
    animation: pulse 2s infinite;
}

.reward-content {
    margin-top: 30px;
    animation: fadeInUp 0.8s ease-out;
}

.reward-content h3 {
    color: var(--cyber-cyan);
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.reward-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.reward-item {
    padding: 25px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid var(--cyber-cyan);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.reward-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--cyber-cyan-glow);
}

.reward-item i {
    font-size: 40px;
    color: var(--cyber-cyan);
    margin-bottom: 15px;
}

.reward-item h4 {
    color: var(--cyber-white);
    margin: 15px 0 10px;
    font-size: 1.2rem;
}

.reward-item p {
    color: var(--cyber-cyan);
    margin: 10px 0;
    font-size: 0.9rem;
}

.discount-code {
    display: inline-block;
    padding: 10px 20px;
    background: var(--cyber-black);
    color: var(--cyber-cyan);
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    border: 2px solid var(--cyber-cyan);
}

.discount-code:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--cyber-cyan);
    background: var(--cyber-cyan);
    color: var(--cyber-black);
}

.download-link,
.cta-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(0, 240, 255, 0.2);
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.download-link:hover,
.cta-link:hover {
    background: var(--cyber-cyan);
    color: var(--cyber-black);
}

/* ===================================
   Easter Egg
   =================================== */
.easter-egg {
    margin-top: 40px;
    padding: 20px;
    transition: all 0.5s ease;
}

.easter-egg:hover {
    background: rgba(0, 240, 255, 0.1);
    border-radius: 10px;
}

/* ===================================
   Animaciones adicionales
   =================================== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

/* ===================================
   Responsive para controles móviles
   =================================== */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    #game-canvas {
        /* Asegurar que el juego tenga suficiente espacio visible */
        height: calc(100vh - 130px) !important;
    }
    
    .instruction-item {
        display: none;
    }
    
    #hud {
        top: 10px;
        right: 10px;
        gap: 8px;
        font-size: 0.7rem;
    }

    .hud-item {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .dialogue-box {
        top: 60px;
        width: 85%;
        padding: 16px;
        max-width: calc(100vw - 40px);
    }

    #dialogue-text {
        font-size: 0.9rem;
        min-height: 50px;
    }
    
    .dialogue-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 8px;
        right: 8px;
        touch-action: manipulation;
    }
    
    .glitch-text {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .reward-items {
        grid-template-columns: 1fr;
    }
    
    .reward-section {
        padding: 20px;
    }
    
    .chest-icon {
        font-size: 40px;
    }
    
    .end-content {
        padding: 20px 15px;
        padding-bottom: 150px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .end-message p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .stats {
        flex-direction: column;
        gap: 30px;
        margin: 30px 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-buttons .cyber-button {
        width: 100%;
        font-size: 0.9rem;
    }
    
    .back-button {
        top: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .control-btn {
        width: 65px;
        height: 65px;
        font-size: 24px;
    }
    
    .control-btn.jump {
        width: 75px;
        height: 75px;
        font-size: 28px;
    }
    
    .control-btn.dash {
        width: 50px;
        height: 50px;
    }
    
    .mobile-controls {
        bottom: 10px;
        padding: 0 12px;
        max-height: 90px;
    }
    
    .dialogue-box {
        top: 50px;
    }
    
    .glitch-text {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .mobile-controls {
        bottom: 15px;
        padding: 0 15px;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
    }
    
    .control-btn.jump {
        width: 60px;
        height: 60px;
    }
    
    #hud {
        gap: 5px;
    }
    
    .hud-item {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* ===================================
   Animaciones para indicador de guardado y transiciones
   =================================== */
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

/* ===================================
   Sección de Logros
   =================================== */
.achievements-section {
    margin: 40px 0;
    padding: 30px;
    border: 2px solid var(--cyber-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.achievements-section h3 {
    text-align: center;
    color: var(--cyber-cyan);
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.achievement-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--cyber-cyan);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    animation: achievementGlow 2s infinite;
}

.achievement-item.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.achievement-name {
    color: var(--cyber-cyan);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
}

.achievement-desc {
    color: var(--cyber-white);
    font-size: 0.85rem;
    opacity: 0.8;
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
}

/* ===================================
   Botones de Compartir
   =================================== */
.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid;
    background: transparent;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.share-btn i {
    font-size: 1.2rem;
}

.share-btn.twitter {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-btn.twitter:hover {
    background: #1DA1F2;
    color: white;
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.5);
}

.share-btn.whatsapp {
    border-color: #25D366;
    color: #25D366;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    color: white;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
}

.share-btn.copy {
    border-color: var(--cyber-cyan);
    color: var(--cyber-cyan);
}

.share-btn.copy:hover {
    background: var(--cyber-cyan);
    color: var(--cyber-black);
    box-shadow: 0 0 20px var(--cyber-cyan-glow);
}
/* ===================================
   Notificación de Logros
   =================================== */
.achievement-notification {
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-notification .achievement-icon {
    font-size: 2.5rem;
}

.achievement-notification .achievement-title {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.achievement-notification .achievement-name {
    font-size: 1.1rem;
}

/* ===================================
   Efectos Mejorados de Logros
   =================================== */
.achievement-popup {
    font-family: 'Orbitron', monospace;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.achievement-icon {
    font-size: 2.5rem;
    min-width: 60px;
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.achievement-desc {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.2;
}

/* Animaciones de logros */
@keyframes achievementPop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes achievementFade {
    to {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
}

/* ===================================
   Sistema de Notificaciones Mejorado
   =================================== */
.notification {
    font-family: 'Orbitron', monospace;
    backdrop-filter: blur(10px);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.1rem;
}

.notification-text {
    flex: 1;
}

@keyframes slideOut {
    to {
        transform: translateX(320px);
        opacity: 0;
    }
}

/* ===================================
   Efectos de Dash Mejorados
   =================================== */
.dash-ghost {
    filter: blur(1px);
    mix-blend-mode: screen;
}

/* Efecto de estela del dash */
.dash-trail-element {
    filter: blur(2px);
    mix-blend-mode: lighten;
    border-radius: 4px;
}

/* Partículas de velocidad */
.speed-particle {
    filter: blur(0.5px);
    mix-blend-mode: screen;
}

/* ===================================
   Reducción de Movimiento (Accesibilidad)
   =================================== */
body.reduce-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

body.reduce-motion .achievement-item.unlocked {
    animation: none;
}

body.reduce-motion .glitch-text {
    animation: none;
}

body.reduce-motion .dash-ghost {
    animation: none;
    filter: none;
}

body.reduce-motion .dash-trail-element {
    filter: none;
}