/* ===== Variables CSS ===== */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
}

/* ===== Reset y Estilos Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: var(--text-light);
    min-height: 100vh;
    font-size: clamp(15px, 0.3vw + 14px, 18px);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body.performance-mode,
body.performance-mode * {
    scroll-behavior: auto !important;
}

body.performance-mode .floating-particles,
body.performance-mode .splash-particles {
    pointer-events: none;
}

body.performance-mode .splash-particle:nth-child(n+13),
body.performance-mode .floating-particles .particle:nth-child(n+7) {
    display: none !important;
}

body.performance-mode .splash-particle,
body.performance-mode .particle,
body.performance-mode .splash-logo-img.active,
body.performance-mode .splash-title,
body.performance-mode .hero-icon,
body.performance-mode .btn-play-icon,
body.performance-mode .header-logo,
body.performance-mode .header-title h1,
body.performance-mode .code-bracket,
body.performance-mode .heart,
body.performance-mode .card-logo,
body.performance-mode .memory-stat.warning-pulse,
body.performance-mode .danger-item.hint-pulse {
    animation: none !important;
}

body.performance-mode .main-header,
body.performance-mode .main-footer,
body.performance-mode .developer-badge,
body.performance-mode .player-info,
body.performance-mode .game-content,
body.performance-mode .memory-stat,
body.performance-mode .game-over-screen {
    backdrop-filter: none !important;
}

body.performance-mode .main-header,
body.performance-mode .main-footer,
body.performance-mode .developer-badge,
body.performance-mode .player-info,
body.performance-mode .game-content,
body.performance-mode .memory-stat,
body.performance-mode #runnerCanvas,
body.performance-mode .phone-frame {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22) !important;
}

/* ===== Pantalla de Presentación (Splash) ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #0a0a0a 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: splashFadeIn 1s ease-in;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(16px, 2vw, 28px);
}

.splash-screen.active ~ .main-footer {
    display: none;
}

/* Partículas animadas del splash */
.splash-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.splash-particle {
    position: absolute;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.splash-particle:nth-child(1) { width: 8px; height: 8px; left: 10%; top: 20%; animation: floatParticle 8s infinite ease-in-out; }
.splash-particle:nth-child(2) { width: 12px; height: 12px; left: 20%; top: 80%; animation: floatParticle 12s infinite ease-in-out 1s; }
.splash-particle:nth-child(3) { width: 6px; height: 6px; left: 30%; top: 40%; animation: floatParticle 10s infinite ease-in-out 2s; }
.splash-particle:nth-child(4) { width: 10px; height: 10px; left: 40%; top: 60%; animation: floatParticle 15s infinite ease-in-out 0.5s; }
.splash-particle:nth-child(5) { width: 14px; height: 14px; left: 50%; top: 30%; animation: floatParticle 9s infinite ease-in-out 3s; }
.splash-particle:nth-child(6) { width: 7px; height: 7px; left: 60%; top: 70%; animation: floatParticle 11s infinite ease-in-out 1.5s; }
.splash-particle:nth-child(7) { width: 9px; height: 9px; left: 70%; top: 50%; animation: floatParticle 13s infinite ease-in-out 2.5s; }
.splash-particle:nth-child(8) { width: 11px; height: 11px; left: 80%; top: 25%; animation: floatParticle 14s infinite ease-in-out 0.8s; }
.splash-particle:nth-child(9) { width: 5px; height: 5px; left: 90%; top: 75%; animation: floatParticle 10s infinite ease-in-out 4s; }
.splash-particle:nth-child(10) { width: 13px; height: 13px; left: 15%; top: 45%; animation: floatParticle 16s infinite ease-in-out 1.2s; }
.splash-particle:nth-child(11) { width: 8px; height: 8px; left: 25%; top: 15%; animation: floatParticle 12s infinite ease-in-out 3.5s; }
.splash-particle:nth-child(12) { width: 10px; height: 10px; left: 35%; top: 85%; animation: floatParticle 9s infinite ease-in-out 2.2s; }
.splash-particle:nth-child(13) { width: 6px; height: 6px; left: 45%; top: 35%; animation: floatParticle 11s infinite ease-in-out 0.3s; }
.splash-particle:nth-child(14) { width: 12px; height: 12px; left: 55%; top: 65%; animation: floatParticle 14s infinite ease-in-out 4.5s; }
.splash-particle:nth-child(15) { width: 9px; height: 9px; left: 65%; top: 20%; animation: floatParticle 10s infinite ease-in-out 1.8s; }
.splash-particle:nth-child(16) { width: 11px; height: 11px; left: 75%; top: 55%; animation: floatParticle 13s infinite ease-in-out 3.2s; }
.splash-particle:nth-child(17) { width: 7px; height: 7px; left: 85%; top: 40%; animation: floatParticle 15s infinite ease-in-out 0.9s; }
.splash-particle:nth-child(18) { width: 14px; height: 14px; left: 95%; top: 90%; animation: floatParticle 8s infinite ease-in-out 2.8s; }
.splash-particle:nth-child(19) { width: 10px; height: 10px; left: 5%; top: 60%; animation: floatParticle 12s infinite ease-in-out 1.4s; }
.splash-particle:nth-child(20) { width: 8px; height: 8px; left: 12%; top: 10%; animation: floatParticle 11s infinite ease-in-out 3.8s; }
.splash-particle:nth-child(21) { width: 6px; height: 6px; left: 22%; top: 50%; animation: floatParticle 9s infinite ease-in-out 0.6s; }
.splash-particle:nth-child(22) { width: 13px; height: 13px; left: 32%; top: 75%; animation: floatParticle 14s infinite ease-in-out 4.2s; }
.splash-particle:nth-child(23) { width: 9px; height: 9px; left: 42%; top: 28%; animation: floatParticle 10s infinite ease-in-out 2.4s; }
.splash-particle:nth-child(24) { width: 11px; height: 11px; left: 52%; top: 82%; animation: floatParticle 13s infinite ease-in-out 1.6s; }
.splash-particle:nth-child(25) { width: 7px; height: 7px; left: 62%; top: 38%; animation: floatParticle 15s infinite ease-in-out 3.4s; }
.splash-particle:nth-child(26) { width: 12px; height: 12px; left: 72%; top: 12%; animation: floatParticle 8s infinite ease-in-out 0.7s; }
.splash-particle:nth-child(27) { width: 10px; height: 10px; left: 82%; top: 68%; animation: floatParticle 12s infinite ease-in-out 4.8s; }
.splash-particle:nth-child(28) { width: 8px; height: 8px; left: 92%; top: 42%; animation: floatParticle 11s infinite ease-in-out 2.6s; }
.splash-particle:nth-child(29) { width: 14px; height: 14px; left: 8%; top: 88%; animation: floatParticle 9s infinite ease-in-out 1.3s; }
.splash-particle:nth-child(30) { width: 6px; height: 6px; left: 18%; top: 55%; animation: floatParticle 14s infinite ease-in-out 3.9s; }
.splash-particle:nth-child(31) { width: 9px; height: 9px; left: 28%; top: 22%; animation: floatParticle 10s infinite ease-in-out 0.4s; }
.splash-particle:nth-child(32) { width: 11px; height: 11px; left: 38%; top: 72%; animation: floatParticle 13s infinite ease-in-out 4.6s; }
.splash-particle:nth-child(33) { width: 7px; height: 7px; left: 48%; top: 48%; animation: floatParticle 15s infinite ease-in-out 2.1s; }
.splash-particle:nth-child(34) { width: 13px; height: 13px; left: 58%; top: 8%; animation: floatParticle 8s infinite ease-in-out 1.7s; }
.splash-particle:nth-child(35) { width: 10px; height: 10px; left: 68%; top: 92%; animation: floatParticle 12s infinite ease-in-out 3.6s; }
.splash-particle:nth-child(36) { width: 8px; height: 8px; left: 78%; top: 33%; animation: floatParticle 11s infinite ease-in-out 0.2s; }
.splash-particle:nth-child(37) { width: 12px; height: 12px; left: 88%; top: 58%; animation: floatParticle 9s infinite ease-in-out 4.3s; }
.splash-particle:nth-child(38) { width: 6px; height: 6px; left: 98%; top: 18%; animation: floatParticle 14s infinite ease-in-out 2.7s; }
.splash-particle:nth-child(39) { width: 9px; height: 9px; left: 3%; top: 78%; animation: floatParticle 10s infinite ease-in-out 1.1s; }
.splash-particle:nth-child(40) { width: 11px; height: 11px; left: 13%; top: 63%; animation: floatParticle 13s infinite ease-in-out 3.7s; }
.splash-particle:nth-child(41) { width: 7px; height: 7px; left: 23%; top: 26%; animation: floatParticle 15s infinite ease-in-out 0.1s; }
.splash-particle:nth-child(42) { width: 14px; height: 14px; left: 33%; top: 95%; animation: floatParticle 8s infinite ease-in-out 4.9s; }
.splash-particle:nth-child(43) { width: 10px; height: 10px; left: 43%; top: 52%; animation: floatParticle 12s infinite ease-in-out 2.3s; }
.splash-particle:nth-child(44) { width: 8px; height: 8px; left: 53%; top: 14%; animation: floatParticle 11s infinite ease-in-out 1.9s; }
.splash-particle:nth-child(45) { width: 6px; height: 6px; left: 63%; top: 84%; animation: floatParticle 9s infinite ease-in-out 3.3s; }
.splash-particle:nth-child(46) { width: 13px; height: 13px; left: 73%; top: 44%; animation: floatParticle 14s infinite ease-in-out 0.5s; }
.splash-particle:nth-child(47) { width: 9px; height: 9px; left: 83%; top: 7%; animation: floatParticle 10s infinite ease-in-out 4.7s; }
.splash-particle:nth-child(48) { width: 11px; height: 11px; left: 93%; top: 66%; animation: floatParticle 13s infinite ease-in-out 2.9s; }
.splash-particle:nth-child(49) { width: 7px; height: 7px; left: 17%; top: 37%; animation: floatParticle 15s infinite ease-in-out 1.5s; }
.splash-particle:nth-child(50) { width: 12px; height: 12px; left: 27%; top: 99%; animation: floatParticle 8s infinite ease-in-out 4.1s; }

@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(30px, -40px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translate(-20px, -80px) scale(0.8);
        opacity: 0.8;
    }
    75% {
        transform: translate(40px, -60px) scale(1.1);
        opacity: 0.5;
    }
}

.splash-screen.fade-out {
    animation: splashFadeOut 0.8s ease-out forwards;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes splashFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.splash-content {
    text-align: center;
    padding: clamp(20px, 3vw, 40px);
    padding-top: clamp(28px, 7vh, 96px);
    width: min(100%, 760px);
    max-width: 760px;
    position: relative;
    z-index: 2;
}

.splash-logo {
    margin-bottom: clamp(20px, 4vh, 40px);
    animation: logoEntrance 1.5s ease-out;
    position: relative;
    width: clamp(150px, 26vw, 300px);
    height: clamp(150px, 26vw, 300px);
    margin-left: auto;
    margin-right: auto;
}

@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: scale(0.5) rotateY(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.splash-logo-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: min(100%, 300px);
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease, filter 1.5s ease;
}

.splash-logo-img.logo-img-1 {
    filter: drop-shadow(0 0 40px rgba(76, 175, 80, 0));
}

.splash-logo-img.logo-img-1.active {
    opacity: 1;
    animation: logoFogGreen 5s ease-in-out infinite;
}

.splash-logo-img.logo-img-2 {
    filter: drop-shadow(0 0 40px rgba(33, 150, 243, 0));
}

.splash-logo-img.logo-img-2.active {
    opacity: 1;
    animation: logoFogBlue 5s ease-in-out infinite;
}

.splash-logo-img.logo-img-3 {
    max-width: min(78%, 220px);
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0));
}

.splash-logo-img.logo-img-3.active {
    opacity: 1;
    animation: logoFogShield 5s ease-in-out infinite;
}

@keyframes logoFogGreen {
    0% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(76, 175, 80, 0.3)) blur(0px);
        transform: translate(-50%, -50%) scale(0.95);
    }
    15% {
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(76, 175, 80, 0.9)) 
                drop-shadow(0 0 20px rgba(76, 175, 80, 0.6))
                drop-shadow(0 0 25px rgba(76, 175, 80, 0.4));
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 18px rgba(76, 175, 80, 1)) 
                drop-shadow(0 0 24px rgba(76, 175, 80, 0.7))
                drop-shadow(0 0 30px rgba(76, 175, 80, 0.5));
        transform: translate(-50%, -50%) scale(1.02);
    }
    85% {
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(76, 175, 80, 0.9)) 
                drop-shadow(0 0 20px rgba(76, 175, 80, 0.6))
                drop-shadow(0 0 25px rgba(76, 175, 80, 0.4));
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(76, 175, 80, 0.3)) blur(0px);
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes logoFogBlue {
    0% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(33, 150, 243, 0.3)) blur(0px);
        transform: translate(-50%, -50%) scale(0.95);
    }
    15% {
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(33, 150, 243, 0.9)) 
                drop-shadow(0 0 20px rgba(33, 150, 243, 0.6))
                drop-shadow(0 0 25px rgba(33, 150, 243, 0.4));
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 18px rgba(33, 150, 243, 1)) 
                drop-shadow(0 0 24px rgba(33, 150, 243, 0.7))
                drop-shadow(0 0 30px rgba(33, 150, 243, 0.5));
        transform: translate(-50%, -50%) scale(1.02);
    }
    85% {
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(33, 150, 243, 0.9)) 
                drop-shadow(0 0 20px rgba(33, 150, 243, 0.6))
                drop-shadow(0 0 25px rgba(33, 150, 243, 0.4));
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(33, 150, 243, 0.3)) blur(0px);
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes logoFogShield {
    0% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.35)) blur(0px);
        transform: translate(-50%, -50%) scale(0.9);
    }
    15% {
        opacity: 1;
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95))
                drop-shadow(0 0 24px rgba(255, 179, 71, 0.65))
                drop-shadow(0 0 30px rgba(79, 172, 254, 0.35));
        transform: translate(-50%, -50%) scale(0.98);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1))
                drop-shadow(0 0 28px rgba(255, 179, 71, 0.72))
                drop-shadow(0 0 34px rgba(79, 172, 254, 0.42));
        transform: translate(-50%, -50%) scale(1.03);
    }
    85% {
        opacity: 1;
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95))
                drop-shadow(0 0 24px rgba(255, 179, 71, 0.65))
                drop-shadow(0 0 30px rgba(79, 172, 254, 0.35));
        transform: translate(-50%, -50%) scale(0.98);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.35)) blur(0px);
        transform: translate(-50%, -50%) scale(0.9);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 10px 30px rgba(76, 175, 80, 0.6));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 15px 40px rgba(76, 175, 80, 0.9));
    }
}

.splash-title {
    font-size: clamp(2rem, 4vw + 0.8rem, 3.5rem);
    margin: 0 auto clamp(12px, 2vh, 20px) auto;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleSlideIn 1s ease-out 0.5s backwards, gradientFlow 8s ease infinite;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: fit-content;
    flex-wrap: wrap;
}

.title-icon {
    width: clamp(48px, 6vw, 80px);
    height: clamp(48px, 6vw, 80px);
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.6));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

.splash-subtitle {
    font-size: clamp(1.05rem, 1.2vw + 0.8rem, 1.6rem);
    font-weight: 600;
    color: #FFD700;
    margin-bottom: clamp(24px, 5vh, 50px);
    animation: subtitleSlideIn 1s ease-out 0.7s backwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8),
                 0 0 20px rgba(255, 215, 0, 0.4);
}

@keyframes subtitleSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-play {
    background: linear-gradient(180deg, #8fb5ff 0%, #5f7ef0 42%, #4054c8 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: clamp(14px, 1.5vw + 10px, 22px) clamp(26px, 3vw + 12px, 58px);
    font-size: clamp(1.05rem, 1.5vw + 0.7rem, 2rem);
    font-weight: 800;
    border-radius: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1vw, 15px);
    min-width: min(280px, 100%);
    width: min(100%, 320px);
    box-shadow: 0 10px 22px rgba(18, 32, 92, 0.34), 0 3px 0 rgba(39, 58, 141, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(24, 35, 95, 0.28);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    animation: buttonEntrance 1s ease-out 0.9s backwards;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes buttonEntrance {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.btn-play::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    width: 84%;
    height: 48%;
    border-radius: 14px 14px 20px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 100%);
    opacity: 0.9;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.btn-play:hover::before {
    opacity: 1;
    transform: translateY(2px);
}

.btn-play:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(18, 32, 92, 0.42), 0 4px 0 rgba(39, 58, 141, 0.58), inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(24, 35, 95, 0.3);
    filter: brightness(1.04);
}

.btn-play:active {
    transform: translateY(4px);
    box-shadow: 0 6px 14px rgba(18, 32, 92, 0.24), 0 1px 0 rgba(39, 58, 141, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(24, 35, 95, 0.24);
}

.btn-play-icon {
    font-size: clamp(1.15em, 1vw + 0.9em, 1.4em);
    position: relative;
    z-index: 1;
    transform-origin: 50% 58%;
    animation: iconTilt 2.8s ease-in-out infinite;
}

@keyframes iconTilt {
    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }
    20% {
        transform: rotate(-8deg) scale(1.04);
    }
    40% {
        transform: rotate(6deg) scale(1.02);
    }
    60% {
        transform: rotate(-4deg) scale(1.05);
    }
    80% {
        transform: rotate(3deg) scale(1.01);
    }
}

.btn-play-text {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.splash-footer {
    margin-top: clamp(28px, 5vh, 60px);
    animation: footerFadeIn 1s ease-out 1.2s backwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: clamp(0.74rem, 0.4vw + 0.68rem, 0.9rem);
}

.splash-footer > span {
    opacity: 0;
    transform: translateY(8px);
    animation: creditReveal 0.55s ease-out forwards;
}

.splash-footer > span:nth-child(1) { animation-delay: 1.2s; }
.splash-footer > span:nth-child(2) { animation-delay: 1.28s; }
.splash-footer > span:nth-child(3) { animation-delay: 1.36s; }
.splash-footer > span:nth-child(4) { animation-delay: 1.44s; }
.splash-footer > span:nth-child(5) { animation-delay: 1.52s; }
.splash-footer > span:nth-child(6) { animation-delay: 1.6s; }
.splash-footer > span:nth-child(7) { animation-delay: 1.68s; }

@keyframes footerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes creditReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-code-bracket {
    font-size: 1.8em;
    font-weight: 900;
    color: #667eea;
    animation: bracketPulse 2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

.splash-separator {
    color: #667eea;
    font-size: 1em;
    font-weight: 300;
    opacity: 0.6;
    flex-shrink: 0;
}

.splash-dev-text {
    font-size: 1em;
    color: #8b9dc3;
    font-weight: 500;
    white-space: nowrap;
}

.splash-dev-text strong {
    color: #667eea;
    font-weight: 700;
}

.splash-dev-title {
    font-size: 1em;
    color: #8b9dc3;
    font-style: italic;
    white-space: nowrap;
}

.splash-copyright {
    font-size: 1em;
    color: #6c7a89;
    white-space: nowrap;
}

/* ===== Fondo Animado de Videojuego ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 50%, rgba(244, 67, 54, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(33, 150, 243, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(76, 175, 80, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 60% 90%, rgba(255, 152, 0, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    animation: gameBackground 20s ease-in-out infinite;
}

@keyframes gameBackground {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.05) rotate(1deg);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1) rotate(-1deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.05) rotate(0.5deg);
        opacity: 0.9;
    }
}

/* Partículas flotantes de peligro */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(244, 67, 54, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(33, 150, 243, 0.3), transparent),
        radial-gradient(3px 3px at 50% 50%, rgba(76, 175, 80, 0.3), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(255, 152, 0, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(156, 39, 176, 0.3), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 235, 59, 0.3), transparent),
        radial-gradient(2px 2px at 15% 90%, rgba(244, 67, 54, 0.3), transparent);
    background-size: 200% 200%;
    animation: particlesFloat 15s ease-in-out infinite;
}

@keyframes particlesFloat {
    0%, 100% {
        background-position: 0% 0%, 100% 0%, 50% 50%, 80% 20%, 20% 80%, 70% 60%, 40% 90%;
        opacity: 0.4;
    }
    25% {
        background-position: 100% 50%, 0% 100%, 30% 70%, 60% 40%, 40% 60%, 90% 40%, 20% 70%;
        opacity: 0.6;
    }
    50% {
        background-position: 50% 100%, 50% 50%, 70% 30%, 40% 80%, 60% 40%, 50% 80%, 60% 50%;
        opacity: 0.5;
    }
    75% {
        background-position: 0% 50%, 100% 100%, 90% 60%, 20% 60%, 80% 20%, 30% 70%, 80% 30%;
        opacity: 0.6;
    }
}

/* Efecto de escaneo tipo videojuego */
.screen {
    position: relative;
}

/* Brillo pulsante tipo arcade eliminado */

@keyframes arcadeGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ===== Partículas Flotantes con Iconos ===== */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-size: 2em;
    opacity: 0.6;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.5));
}

/* Animaciones individuales para cada partícula */
.particle-1 {
    top: 10%;
    left: 5%;
    animation: float1 15s infinite;
}

.particle-2 {
    top: 20%;
    left: 85%;
    animation: float2 18s infinite;
}

.particle-3 {
    top: 30%;
    left: 15%;
    animation: float3 20s infinite;
}

.particle-4 {
    top: 40%;
    left: 90%;
    animation: float4 17s infinite;
}

.particle-5 {
    top: 50%;
    left: 10%;
    animation: float5 19s infinite;
}

.particle-6 {
    top: 60%;
    left: 80%;
    animation: float6 16s infinite;
}

.particle-7 {
    top: 70%;
    left: 20%;
    animation: float7 21s infinite;
}

.particle-8 {
    top: 15%;
    left: 50%;
    animation: float8 14s infinite;
}

.particle-9 {
    top: 80%;
    left: 60%;
    animation: float9 22s infinite;
}

.particle-10 {
    top: 25%;
    left: 70%;
    animation: float10 18s infinite;
}

.particle-11 {
    top: 35%;
    left: 40%;
    animation: float11 16s infinite;
}

.particle-12 {
    top: 45%;
    left: 30%;
    animation: float12 20s infinite;
}

.particle-13 {
    top: 55%;
    left: 75%;
    animation: float13 17s infinite;
}

.particle-14 {
    top: 65%;
    left: 45%;
    animation: float14 19s infinite;
}

.particle-15 {
    top: 75%;
    left: 88%;
    animation: float15 15s infinite;
}

/* Keyframes para movimientos únicos */
@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -50px) rotate(90deg); }
    50% { transform: translate(-20px, -100px) rotate(180deg); }
    75% { transform: translate(50px, -70px) rotate(270deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-40px, 60px) rotate(-90deg); }
    50% { transform: translate(30px, 120px) rotate(-180deg); }
    75% { transform: translate(-50px, 80px) rotate(-270deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 100px) scale(1.3); }
}

@keyframes float4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(-60px, 40px) rotate(120deg) scale(0.8); }
    66% { transform: translate(-30px, 90px) rotate(240deg) scale(1.2); }
}

@keyframes float5 {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    50% { transform: translate(80px, -80px); opacity: 0.9; }
}

@keyframes float6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-50px, -40px) rotate(45deg); }
    50% { transform: translate(40px, -90px) rotate(90deg); }
    75% { transform: translate(-60px, -60px) rotate(135deg); }
}

@keyframes float7 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-100px) rotate(180deg); }
}

@keyframes float8 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, 50px) scale(1.2); }
    50% { transform: translate(-30px, 100px) scale(0.9); }
    75% { transform: translate(60px, 70px) scale(1.1); }
}

@keyframes float9 {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    33% { transform: translate(-70px, -60px); opacity: 0.8; }
    66% { transform: translate(50px, -40px); opacity: 0.7; }
}

@keyframes float10 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-80px, 80px) rotate(360deg); }
}

@keyframes float11 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -50px) scale(0.8); }
    66% { transform: translate(-40px, -80px) scale(1.3); }
}

@keyframes float12 {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    50% { transform: translate(70px, 90px); opacity: 0.9; }
}

@keyframes float13 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-50px, 50px) rotate(-90deg); }
    50% { transform: translate(40px, 100px) rotate(-180deg); }
    75% { transform: translate(-60px, 70px) rotate(-270deg); }
}

@keyframes float14 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -90px) scale(1.2); }
}

@keyframes float15 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.6; }
    25% { transform: translate(-40px, -50px) rotate(90deg); opacity: 0.8; }
    50% { transform: translate(30px, -100px) rotate(180deg); opacity: 0.9; }
    75% { transform: translate(-50px, -70px) rotate(270deg); opacity: 0.7; }
}

/* ===== Header Principal ===== */
.main-header {
    background: linear-gradient(135deg, rgba(22, 33, 62, 0.95) 0%, rgba(15, 52, 96, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(12px, 1.4vw, 15px) clamp(14px, 2vw, 20px);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.logo-container {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.header-logo {
    height: clamp(56px, 6vw, 80px);
    width: auto;
    max-width: clamp(100px, 12vw, 150px);
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.logo-left .header-logo {
    animation: floatLeft 3s ease-in-out infinite;
}

.logo-right .header-logo {
    animation: floatRight 3s ease-in-out infinite;
}

@keyframes floatLeft {
    0%, 100% {
        transform: translateY(0px) rotate(-2deg);
    }
    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes floatRight {
    0%, 100% {
        transform: translateY(0px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

.header-logo:hover {
    transform: scale(1.1);
}

.header-title {
    flex: 1;
    text-align: center;
    align-self: center;
}

.header-title h1 {
    font-size: clamp(1.35rem, 1.6vw + 0.9rem, 2rem);
    margin: 0;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-icon {
    width: clamp(34px, 4vw, 50px);
    height: clamp(34px, 4vw, 50px);
    filter: drop-shadow(0 2px 8px rgba(76, 175, 80, 0.5));
}

@keyframes titlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ===== Footer del Desarrollador ===== */
.main-footer {
    background: linear-gradient(135deg, rgba(15, 52, 96, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
    margin-top: auto;
    padding: 20px 0;
    position: relative;
    z-index: 1000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.developer-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1em;
    color: var(--text-gray);
    flex-wrap: wrap;
}

.developer-badge > span {
    opacity: 0.95;
}

.developer-badge.footer-awake > span {
    opacity: 0;
    transform: translateY(8px);
    animation: creditReveal 0.5s ease-out forwards;
}

.developer-badge.footer-awake > span:nth-child(1) { animation-delay: 0.04s; }
.developer-badge.footer-awake > span:nth-child(2) { animation-delay: 0.12s; }
.developer-badge.footer-awake > span:nth-child(3) { animation-delay: 0.2s; }
.developer-badge.footer-awake > span:nth-child(4) { animation-delay: 0.28s; }
.developer-badge.footer-awake > span:nth-child(5) { animation-delay: 0.36s; }
.developer-badge.footer-awake > span:nth-child(6) { animation-delay: 0.44s; }
.developer-badge.footer-awake > span:nth-child(7) { animation-delay: 0.52s; }

.code-bracket {
    font-size: 2.5em;
    font-weight: 900;
    color: #667eea;
    animation: bracketPulse 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5),
                 0 0 20px rgba(102, 126, 234, 0.3);
}

@keyframes bracketPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.82;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.94;
    }
}

.separator {
    color: #667eea;
    font-size: 1.2em;
    font-weight: 300;
    opacity: 0.6;
}

.dev-text {
    font-size: 1em;
    letter-spacing: 0.5px;
}

.heart {
    color: #e74c3c;
    animation: heartBeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.dev-text strong {
    color: #667eea;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.dev-title {
    font-size: 0.95em;
    color: #8b9dc3;
    font-style: italic;
}

.copyright {
    font-size: 0.9em;
    color: #6c7a89;
    letter-spacing: 0.3px;
}

.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(14px, 2vw, 20px);
    width: 100%;
    position: relative;
    z-index: 2;
}

body.gameplay-mode .container {
    max-width: min(100%, 1440px);
    padding-inline: clamp(8px, 1.4vw, 16px);
}

body[data-active-section="runnerContainer"] {
    background: #050816;
}

body[data-active-section="quizContainer"],
body[data-active-section="memoryContainer"],
body[data-active-section="dangerContainer"],
body[data-active-section="chatContainer"],
body[data-active-section="scenarioContainer"] {
    background: #07111f;
}

/* ===== Pantallas ===== */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Pantalla de Inicio ===== */
.hero {
    text-align: center;
    padding: clamp(12px, 2vw, 20px) clamp(12px, 2vw, 20px) clamp(24px, 4vw, 40px) clamp(12px, 2vw, 20px);
}

.hero h1 {
    font-size: clamp(1.8rem, 2.4vw + 1rem, 3rem);
    flex-wrap: wrap;
}

.hero h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hero-icon {
    width: clamp(40px, 5vw, 60px);
    height: clamp(40px, 5vw, 60px);
    filter: drop-shadow(0 3px 10px rgba(102, 126, 234, 0.6));
    animation: iconFloat 3s ease-in-out infinite;
}

.subtitle {
    font-size: clamp(1rem, 0.8vw + 0.9rem, 1.3rem);
    color: var(--text-gray);
    margin-bottom: 30px;
}

.player-info {
    background: var(--bg-light);
    padding: clamp(20px, 3vw, 30px);
    border-radius: var(--border-radius);
    margin: 30px auto;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-gray);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--bg-medium);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== Botones Estilo Videojuego ===== */
.btn {
    padding: 12px 30px;
    border: 3px solid;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 5px;
    display: inline-block;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
    vertical-align: middle;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    border-radius: 5px;
    pointer-events: none;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(180deg, #5cb85c 0%, #449d44 100%);
    border-color: #398439;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #6ec76e 0%, #5cb85c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(76, 175, 80, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    background: linear-gradient(180deg, #449d44 0%, #398439 100%);
}

.btn-secondary {
    background: linear-gradient(180deg, #5bc0de 0%, #31b0d5 100%);
    border-color: #269abc;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #6dd0ee 0%, #5bc0de 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(33, 150, 243, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    background: linear-gradient(180deg, #31b0d5 0%, #269abc 100%);
}

.btn-info {
    background: linear-gradient(180deg, #b45fbf 0%, #9c27b0 100%);
    border-color: #7b1fa2;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-info:hover {
    background: linear-gradient(180deg, #c46fcf 0%, #b45fbf 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(156, 39, 176, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-info:active {
    background: linear-gradient(180deg, #9c27b0 0%, #7b1fa2 100%);
}

.btn-danger {
    background: linear-gradient(180deg, #f44336 0%, #d32f2f 100%);
    border-color: #c62828;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #f55346 0%, #f44336 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(244, 67, 54, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-danger:active {
    background: linear-gradient(180deg, #d32f2f 0%, #c62828 100%);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
    border-width: 2px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-small:active {
    transform: translateY(3px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) !important;
    filter: grayscale(50%);
}

.menu-options {
    text-align: center;
    margin-top: 30px;
}

.menu-options .btn {
    min-width: 220px;
}

/* ===== Pantalla de Juego ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    z-index: 10;
}

.player-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.stat {
    font-size: 1.1em;
    font-weight: bold;
    white-space: nowrap;
}

.game-content {
    background: var(--bg-light);
    padding: clamp(18px, 3vw, 30px);
    border-radius: var(--border-radius);
    min-height: 400px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
    overflow: hidden;
}

body.heavy-gameplay-mode .game-content {
    padding: clamp(10px, 1.8vw, 18px);
}

body.gameplay-mode .game-content {
    width: 100%;
}

body.gameplay-mode .floating-particles,
body.heavy-gameplay-mode .floating-particles {
    opacity: 0.2;
}

body.heavy-gameplay-mode::before,
body.heavy-gameplay-mode::after {
    animation: none;
}

body.heavy-gameplay-mode .main-header,
body.heavy-gameplay-mode .main-footer,
body.heavy-gameplay-mode .runner-controls,
body.heavy-gameplay-mode .game-controls-info,
body.heavy-gameplay-mode .runner-info,
body.heavy-gameplay-mode .game-info {
    backdrop-filter: none;
}

.game-section {
    display: none;
}

.game-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

/* Excepción para el simulador de chat que necesita flex */
#scenarioContainer.active {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    inset: auto;
    min-height: clamp(640px, calc(100dvh - 210px), 980px);
    background: linear-gradient(135deg, #0a0a0a 0%, #16213e 50%, #0f3460 100%);
    z-index: 2;
    overflow: hidden;
    border-radius: 28px;
    padding: clamp(20px, 3vw, 34px);
    animation: none;
}

/* ===== Grid de Misiones ===== */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mission-card {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.mission-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.2), transparent);
    transition: left 0.5s ease;
}

.mission-card:hover::after {
    left: 100%;
}

.mission-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4), 0 12px 25px rgba(76, 175, 80, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #1e3a5f 0%, var(--bg-medium) 100%);
}

.mission-card:active {
    transform: translateY(-4px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 6px 15px rgba(76, 175, 80, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.mission-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.mission-card h3 {
    margin: 10px 0;
    color: var(--primary-color);
}

.mission-card p {
    color: var(--text-gray);
    margin-bottom: 10px;
}

.points {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

/* ===== TV Quiz Show ===== */
.tv-quiz-container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    border-radius: 20px;
    padding: clamp(18px, 3vw, 30px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #667eea, #764ba2);
    padding: clamp(16px, 2vw, 20px) clamp(18px, 3vw, 30px);
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    gap: 16px;
    flex-wrap: wrap;
}

.tv-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tv-icon {
    font-size: 2.5em;
    animation: tvBlink 2s ease-in-out infinite;
}

@keyframes tvBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tv-title {
    font-size: clamp(1.2rem, 1.3vw + 0.9rem, 1.8rem);
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.tv-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.score-value {
    font-size: clamp(1.4rem, 1.6vw + 0.8rem, 2rem);
    font-weight: bold;
    color: #ffd93d;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.5);
}

.tv-timer-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border: 2px solid rgba(78, 205, 196, 0.3);
}

.timer-label {
    font-size: 1.1em;
    font-weight: bold;
    color: #a8b2d1;
}

.timer-display {
    font-size: 2em;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 80px;
    text-align: center;
}

.timer-bar {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #2ecc71);
    transition: width 1s linear, background 0.3s ease;
    border-radius: 20px;
}

.tv-progress {
    text-align: center;
    font-size: 1.1em;
    color: #a8b2d1;
    margin-bottom: 25px;
    font-weight: 600;
}

.tv-host-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.host-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.host-avatar-large {
    font-size: 5em;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-radius: 50%;
    padding: 20px;
    border: 4px solid rgba(102, 126, 234, 0.5);
    animation: hostFloat 3s ease-in-out infinite;
}

@keyframes hostFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.host-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #4ecdc4;
    text-align: center;
}

.question-bubble {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 3px solid rgba(102, 126, 234, 0.4);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.question-bubble::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 30px;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 15px solid rgba(102, 126, 234, 0.4);
}

.bubble-content {
    font-size: 1.3em;
    line-height: 1.6;
    color: #fff;
    font-weight: 600;
}

.tv-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.tv-option-btn {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 3px solid rgba(102, 126, 234, 0.4);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.tv-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.tv-option-btn:hover::before {
    left: 100%;
}

.tv-option-btn:hover {
    transform: translateY(-5px);
    border-color: #4ecdc4;
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.3);
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(46, 204, 113, 0.3));
}

.tv-option-btn:active {
    transform: translateY(-2px);
}

.option-letter {
    font-size: 2em;
    font-weight: bold;
    color: #ffd93d;
    background: rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 217, 61, 0.5);
}

.option-text {
    flex: 1;
    font-size: 1.1em;
    color: #fff;
    font-weight: 600;
    text-align: left;
}

.tv-option-btn.correct {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4), rgba(39, 174, 96, 0.4));
    border-color: #2ecc71;
    animation: correctPulseTV 0.6s ease;
}

.tv-option-btn.correct .option-letter {
    background: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}

.tv-option-btn.incorrect {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.4), rgba(192, 57, 43, 0.4));
    border-color: #e74c3c;
    animation: shakeTV 0.5s ease;
}

.tv-option-btn.incorrect .option-letter {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

@keyframes correctPulseTV {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shakeTV {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.tv-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.tv-explanation {
    margin-top: 20px;
    animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.host-speech {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.host-avatar {
    font-size: 4em;
    animation: hostReaction 0.5s ease;
}

@keyframes hostReaction {
    0% { transform: scale(0.5) rotate(-20deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

.speech-bubble {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border: 3px solid rgba(78, 205, 196, 0.5);
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

.tv-explanation.success .speech-bubble {
    border-color: rgba(46, 204, 113, 0.6);
}

.tv-explanation.fail .speech-bubble {
    border-color: rgba(231, 76, 60, 0.6);
}

.tv-explanation.timeout .speech-bubble {
    border-color: rgba(241, 196, 15, 0.6);
}

.speech-bubble strong {
    font-size: 1.3em;
    display: block;
    margin-bottom: 10px;
}

.tv-explanation.success strong {
    color: #2ecc71;
}

.tv-explanation.fail strong {
    color: #e74c3c;
}

.tv-explanation.timeout strong {
    color: #f1c40f;
}

.speech-bubble p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #a8b2d1;
    margin-bottom: 15px;
}

.points-earned {
    color: #ffd93d !important;
    font-size: 1.2em !important;
    font-weight: bold !important;
    text-align: center;
    animation: pointsGlow 1s ease infinite;
}

@keyframes pointsGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(255, 217, 61, 0.5); }
    50% { text-shadow: 0 0 20px rgba(255, 217, 61, 0.8); }
}

.correct-answer-label {
    background: rgba(46, 204, 113, 0.2);
    border: 2px solid rgba(46, 204, 113, 0.5);
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 1.1em !important;
    color: #fff !important;
}

.correct-answer-text {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.1em;
}

.tv-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Resultados TV Quiz */
.tv-results {
    text-align: center;
}

.results-header {
    margin-bottom: 30px;
}

.results-icon {
    font-size: 5em;
    margin-bottom: 15px;
    animation: resultsBounce 1s ease infinite;
}

@keyframes resultsBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.results-title {
    font-size: 2.5em;
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 3px solid rgba(102, 126, 234, 0.4);
    border-radius: 15px;
    padding: 25px;
    min-width: 150px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd93d;
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1em;
    color: #a8b2d1;
    font-weight: 600;
}

.host-final-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 3px solid rgba(78, 205, 196, 0.4);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.final-speech-bubble {
    max-width: 600px;
}

.final-speech-bubble p {
    font-size: 1.2em;
    line-height: 1.6;
    color: #fff;
    margin-bottom: 10px;
}

.final-speech-bubble strong {
    color: #4ecdc4;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive TV Quiz */
@media (max-width: 768px) {
    .tv-quiz-container {
        padding: 20px;
    }

    .tv-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .tv-title {
        font-size: 1.4em;
    }

    .tv-host-section {
        flex-direction: column;
        align-items: center;
    }

    .host-character {
        min-width: auto;
    }

    .question-bubble::before {
        display: none;
    }

    .bubble-content {
        font-size: 1.1em;
    }

    .tv-options-grid {
        grid-template-columns: 1fr;
    }

    .results-title {
        font-size: 2em;
    }

    .results-stats {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== Quiz Antiguo (mantener por compatibilidad) ===== */
.quiz-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.question-container {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3em;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-medium);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    padding: 15px 20px;
    border: 3px solid var(--bg-dark);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-size: 1em;
    font-weight: 600;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    user-select: none;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}

.option-btn:hover {
    border-color: var(--primary-color);
    transform: translateX(8px);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 6px 15px rgba(76, 175, 80, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #1e3a5f 0%, var(--bg-medium) 100%);
}

.option-btn:active {
    transform: translateX(10px) translateY(3px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 0, 0, 0.4);
}

.option-btn.correct {
    background: linear-gradient(180deg, #5cb85c 0%, #449d44 100%);
    border-color: #398439;
    animation: correctPulse 0.5s ease;
}

.option-btn.incorrect {
    background: linear-gradient(180deg, #f44336 0%, #d32f2f 100%);
    border-color: #c62828;
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
}

.explanation {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

/* ===== Escenarios ===== */
.scenario-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.scenario-story {
    background: var(--bg-medium);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.8;
}

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-btn {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    padding: 18px 25px;
    border: 3px solid var(--bg-dark);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-size: 1.05em;
    font-weight: 600;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    user-select: none;
}

.choice-btn::before {
    content: '▶';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.8em;
    opacity: 0.7;
}

.choice-btn:hover {
    border-color: var(--secondary-color);
    transform: translateX(10px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(33, 150, 243, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    background: linear-gradient(180deg, #1e3a5f 0%, var(--bg-medium) 100%);
}

.choice-btn:active {
    transform: translateX(12px) translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 0, 0, 0.4);
}

.choice-btn.safe {
    background: linear-gradient(180deg, #5cb85c 0%, #449d44 100%);
    border-color: #398439;
    animation: correctPulse 0.6s ease;
}

.choice-btn.dangerous {
    background: linear-gradient(180deg, #f44336 0%, #d32f2f 100%);
    border-color: #c62828;
    animation: shake 0.6s ease;
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
}

.choice-btn {
    background: var(--bg-medium);
    color: var(--text-light);
    padding: 20px;
    border: 2px solid var(--bg-dark);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    font-size: 1em;
}

.choice-btn:hover {
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.choice-btn.safe {
    background: var(--success-color);
    border-color: var(--success-color);
}

.choice-btn.dangerous {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* ===== Simulador de Teléfono Móvil ===== */
.phone-simulator {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    min-height: 0;
    padding: 12px;
}

.phone-frame {
    width: min(100%, 420px);
    max-width: min(420px, calc(100vw - 24px));
    height: min(85dvh, 750px);
    max-height: calc(100dvh - 24px);
    min-height: clamp(500px, 72dvh, 680px);
    max-height: 750px;
    background: #1a1a1a;
    border-radius: clamp(24px, 4vw, 40px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 30px 90px rgba(0, 0, 0, 0.5),
        inset 0 0 0 8px #2a2a2a,
        inset 0 0 0 12px #1a1a1a,
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: phoneSlideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: Arial, Helvetica, sans-serif;
}

.phone-frame * {
    font-family: Arial, Helvetica, sans-serif;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
    z-index: 100;
}

@keyframes phoneSlideIn {
    from {
        opacity: 0;
        transform: translateY(34px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 28px;
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: #0a0a0a;
    color: #fff;
    font-size: 13px;
    height: 40px;
}

.status-time {
    font-weight: 600;
}

.status-icons {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, #1e3a5f 0%, #16213e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.back-btn, .menu-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s;
}

.back-btn:hover, .menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.chat-contact-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.contact-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.contact-details {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-status {
    font-size: 12px;
    color: #4caf50;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 0;
    background: linear-gradient(180deg, #0f1419 0%, #16213e 100%);
    scroll-behavior: smooth;
    min-height: 0;
    text-rendering: auto;
    -webkit-font-smoothing: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    opacity: 0;
    animation: messageSlide 0.4s ease forwards;
}

@keyframes messageSlide {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chat-message.show {
    opacity: 1;
}

.chat-message.them {
    justify-content: flex-start;
}

.chat-message.me {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-bubble {
    max-width: min(80%, 320px);
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    animation: bubblePop 0.24s ease forwards;
    text-rendering: auto;
    -webkit-font-smoothing: auto;
}

@keyframes bubblePop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-message.them .message-bubble {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-message.me .message-bubble {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    animation: messageSent 0.26s ease forwards;
}

@keyframes messageSent {
    from { opacity: 0; }
    to { opacity: 1; }
}

.me-bubble {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 6px 16px;
    background: linear-gradient(180deg, #16213e 0%, #0f1419 100%);
}

.typing-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.typing-bubble {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-choices {
    padding: 0 16px;
    background: linear-gradient(180deg, #10243f 0%, #09111f 100%);
    border-top: 0 solid transparent;
    box-shadow: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.32s ease, opacity 0.22s ease, padding 0.22s ease, border-top-width 0.22s ease;
    transform: none;
    position: relative;
}

.chat-choices.slide-up {
    max-height: min(34dvh, 250px);
    opacity: 1;
    transform: none;
    overflow-y: auto;
    padding-top: 6px;
    padding-bottom: 12px;
    border-top-width: 1px;
    border-top-color: rgba(33, 150, 243, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.choices-title {
    font-size: 13px;
    color: #9ec3f5;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.choice-bubble {
    background: linear-gradient(135deg, #1e3a5f 0%, #16213e 100%);
    color: #fff;
    padding: clamp(12px, 2.8vw, 14px) clamp(14px, 3vw, 18px);
    border: 2px solid rgba(33, 150, 243, 0.3);
    border-radius: 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-size: clamp(13px, 2.8vw, 14px);
    text-align: left;
    display: block;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    opacity: 0;
}

.choice-bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.choice-bubble:active::before {
    width: 300px;
    height: 300px;
}

.choice-bubble:hover {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.38);
}

.choice-bubble:active {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes choiceOptionIn {
    from {
        opacity: 0;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    to {
        opacity: 1;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

@keyframes choiceConfirm {
    0% {
        background: #134a7a;
        border-color: rgba(33, 150, 243, 0.22);
        box-shadow: none;
    }
    45% {
        background: #2a7fbd;
        border-color: rgba(176, 235, 255, 1);
        box-shadow: 0 0 0 3px rgba(120, 219, 255, 0.28);
    }
    100% {
        background: #0f5f95;
        border-color: rgba(120, 219, 255, 0.52);
        box-shadow: 0 0 0 2px rgba(120, 219, 255, 0.18);
    }
}

@keyframes choicesFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.choice-bubble.choice-selected {
    animation: choiceConfirm 0.52s ease forwards;
}

.chat-choices.choices-closing {
    animation: choicesFadeOut 0.22s ease forwards;
}

.chat-choices.slide-up .choice-bubble {
    animation: choiceOptionIn 0.34s ease forwards;
    animation-delay: var(--choice-delay, 0ms);
}

.chat-choices.selection-locked .choice-bubble {
    pointer-events: none;
    cursor: default;
}

.chat-choices.has-selection .choice-bubble:not(.choice-selected) {
    opacity: 0.38;
}

.chat-choices.choice-answered .choice-bubble:not(.choice-selected) {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow: hidden;
    transition: opacity 0.24s ease, max-height 0.24s ease, margin 0.24s ease, padding 0.24s ease, border-width 0.24s ease;
}

.chat-choices.choice-answered .choice-bubble.choice-selected {
    opacity: 1;
}

#scenarioContainer.active .choices-title,
#scenarioContainer.active .choice-bubble,
#scenarioContainer.active .choice-bubble:hover,
#scenarioContainer.active .choice-bubble:active {
    font-family: Arial, Helvetica, sans-serif !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: auto !important;
    text-shadow: none !important;
}

#scenarioContainer.active .choices-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 16px !important;
    opacity: 1 !important;
}

#scenarioContainer.active .choice-bubble,
#scenarioContainer.active .choice-bubble:hover,
#scenarioContainer.active .choice-bubble:active {
    padding: 12px 14px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    letter-spacing: 0 !important;
    filter: none !important;
    backdrop-filter: none !important;
    background: #134a7a !important;
    color: #f4fbff !important;
    border: 2px solid rgba(33, 150, 243, 0.22) !important;
    box-shadow: none !important;
}

#scenarioContainer.active .choice-bubble.choice-selected {
    animation: choiceConfirm 0.52s ease forwards !important;
}

#scenarioContainer.active .choice-bubble.choice-selected.choice-selected-safe {
    background: #1f7a57 !important;
    border-color: rgba(145, 255, 208, 0.75) !important;
}

#scenarioContainer.active .choice-bubble.choice-selected.choice-selected-risk {
    background: #a85c1e !important;
    border-color: rgba(255, 214, 147, 0.82) !important;
}

@media screen and (min-width: 700px) and (max-height: 900px) {
    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] #scenarioContainer.active {
        min-height: calc(100dvh - 110px) !important;
        padding: 10px 12px 14px !important;
        align-items: center !important;
        overflow: hidden !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .phone-simulator {
        min-height: calc(100dvh - 110px) !important;
        padding: 0 !important;
        align-items: center !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .phone-frame {
        width: 392px !important;
        min-width: 392px !important;
        max-width: 392px !important;
        min-height: min(820px, calc(100dvh - 126px)) !important;
        height: min(820px, calc(100dvh - 126px)) !important;
        max-height: min(820px, calc(100dvh - 126px)) !important;
        border-radius: 30px !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        box-shadow:
            0 20px 52px rgba(0, 0, 0, 0.5),
            inset 0 0 0 6px #252525,
            inset 0 0 0 10px #141414 !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .phone-frame::before {
        display: none !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-header {
        padding: 14px 16px !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-messages {
        padding: 16px 16px 2px !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-message {
        margin-bottom: 12px !important;
        opacity: 0 !important;
        animation: messageSlide 0.32s ease forwards !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-message.show {
        opacity: 1 !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-message.me .message-bubble,
    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .me-bubble {
        animation: messageSent 0.26s ease forwards !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .message-bubble,
    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choice-bubble {
        font-family: Arial, Helvetica, sans-serif !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .message-bubble {
        font-size: 16px !important;
        line-height: 21px !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .chat-choices {
        margin-top: -10px !important;
        padding: 4px 12px 0 !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choices-title {
        font-size: 13px !important;
        line-height: 16px !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choice-bubble,
    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choice-bubble:hover,
    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choice-bubble:active {
        font-size: 16px !important;
        line-height: 20px !important;
        transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease !important;
    }

    body:not(.mobile-touch-device)[data-active-section="scenarioContainer"] .choice-bubble.choice-selected {
        animation: choiceConfirm 0.52s ease forwards !important;
        box-shadow: 0 0 0 3px rgba(120, 219, 255, 0.24) !important;
    }
}

.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
}

.feedback-overlay.show {
    opacity: 1;
    transform: scale(1);
}

.feedback-overlay.safe {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
}

.feedback-overlay.dangerous {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
}

.feedback-content {
    text-align: center;
    max-width: min(100%, 300px);
}

.feedback-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.feedback-content h3 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 700;
}

.feedback-content p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.points-gained {
    font-size: 24px;
    font-weight: 700;
    margin: 16px 0;
    animation: pointsGlow 1s ease infinite;
}

@keyframes pointsGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    }
}

.btn-next {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #000;
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scenario-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #888;
}

@media (min-width: 1025px) {
    body[data-active-section="scenarioContainer"] .game-header {
        display: none;
    }

    body[data-active-section="scenarioContainer"] .game-content {
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    body[data-active-section="scenarioContainer"] .scenario-container {
        max-width: 1200px;
    }

    .phone-simulator {
        padding: 18px;
    }

    .phone-frame {
        width: min(100%, 520px);
        max-width: 520px;
        min-height: clamp(760px, 90dvh, 980px);
        height: min(92dvh, 980px);
        max-height: min(92dvh, 980px);
    }

    .chat-header {
        padding: 14px 18px;
    }

    .contact-avatar {
        width: 46px;
        height: 46px;
        font-size: 24px;
    }

    .contact-name {
        font-size: 17px;
    }

    .contact-status {
        font-size: 12px;
    }

    .chat-messages {
        padding: 20px 20px 12px;
    }

    .message-bubble {
        max-width: min(82%, 400px);
        animation: none;
    }

    .chat-message {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .chat-message.me .message-bubble {
        animation: none;
    }

    .chat-choices {
        padding: 14px 18px 18px;
    }

    .chat-choices.slide-up {
        max-height: min(30dvh, 280px);
    }
}

@media (min-width: 900px) and (min-height: 600px) and (pointer: fine) {
    body[data-active-section="scenarioContainer"] #scenarioContainer.active {
        min-height: calc(100dvh - 130px) !important;
        padding: 18px 24px 24px !important;
        align-items: center !important;
    }

    body[data-active-section="scenarioContainer"] .scenario-container {
        max-width: 1320px !important;
    }

    body[data-active-section="scenarioContainer"] .phone-simulator {
        padding: 0 !important;
    }

    body[data-active-section="scenarioContainer"] .phone-frame {
        width: min(100%, 520px) !important;
        max-width: 520px !important;
        min-height: min(920px, calc(100dvh - 150px)) !important;
        height: min(920px, calc(100dvh - 150px)) !important;
        max-height: min(920px, calc(100dvh - 150px)) !important;
        animation: none !important;
        transform: none !important;
        text-rendering: geometricPrecision !important;
        -webkit-font-smoothing: auto !important;
    }

    body[data-active-section="scenarioContainer"] .phone-frame::before {
        display: none !important;
    }

    body[data-active-section="scenarioContainer"] .chat-messages {
        padding: 22px 22px 0 !important;
        background: linear-gradient(180deg, #101823 0%, #182b4b 100%) !important;
    }

    body[data-active-section="scenarioContainer"] .typing-indicator {
        padding: 0 18px 4px !important;
        background: linear-gradient(180deg, #182b4b 0%, #14345c 100%) !important;
    }

    body[data-active-section="scenarioContainer"] .chat-choices {
        padding-left: 18px !important;
        padding-right: 18px !important;
        background: linear-gradient(180deg, #14345c 0%, #0a1424 100%) !important;
    }

    body[data-active-section="scenarioContainer"] .chat-choices.slide-up {
        padding-top: 2px !important;
        padding-bottom: 14px !important;
        max-height: min(32dvh, 320px) !important;
        border-top-width: 2px !important;
        border-top-color: rgba(78, 205, 196, 0.38) !important;
    }

    body[data-active-section="scenarioContainer"] .choices-title {
        margin-bottom: 6px !important;
        color: #b8d6ff !important;
        font-size: 14px !important;
    }

    body[data-active-section="scenarioContainer"] .message-bubble {
        max-width: min(84%, 420px) !important;
        font-size: 17px !important;
        line-height: 1.58 !important;
        animation: none !important;
    }

    body[data-active-section="scenarioContainer"] .chat-message {
        margin-bottom: 14px !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    body[data-active-section="scenarioContainer"] .message-time,
    body[data-active-section="scenarioContainer"] .contact-status,
    body[data-active-section="scenarioContainer"] .scenario-progress {
        font-size: 13px !important;
    }

    body[data-active-section="scenarioContainer"] .choice-bubble,
    body[data-active-section="scenarioContainer"] .choice-bubble:hover,
    body[data-active-section="scenarioContainer"] .choice-bubble:active {
        transform: none !important;
        filter: none !important;
        backdrop-filter: none !important;
        font-size: 15px !important;
        line-height: 1.45 !important;
    }

    body[data-active-section="scenarioContainer"] .choice-bubble::before {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #scenarioContainer.active {
        position: relative;
        inset: auto;
        min-height: 100dvh;
        align-items: flex-start;
        overflow-y: auto;
        padding: calc(env(safe-area-inset-top) + 8px) 0 calc(env(safe-area-inset-bottom) + 8px);
    }

    body[data-active-section="scenarioContainer"] .scenario-container {
        max-width: 100%;
        padding: 0;
    }

    .phone-simulator {
        align-items: flex-start;
        padding: 6px;
    }

    .phone-frame {
        max-width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
        min-height: min(620px, calc(100dvh - 12px));
    }

    .chat-messages {
        padding: 14px;
    }

    .message-bubble {
        max-width: min(82%, 300px);
    }
}

@media (max-width: 480px) {
    .phone-simulator {
        padding: 4px;
    }

    .phone-frame {
        max-width: calc(100vw - 8px);
        min-height: min(560px, calc(100dvh - 8px));
        border-radius: 24px;
        box-shadow:
            0 14px 36px rgba(0, 0, 0, 0.65),
            0 18px 56px rgba(0, 0, 0, 0.35),
            inset 0 0 0 5px #2a2a2a,
            inset 0 0 0 8px #1a1a1a,
            inset 0 1px 2px rgba(255, 255, 255, 0.08);
    }

    .phone-notch {
        width: 112px;
        height: 22px;
        border-radius: 0 0 14px 14px;
    }

    .phone-status-bar {
        height: 34px;
        padding: 6px 14px;
        font-size: 12px;
    }

    .status-icons {
        gap: 6px;
        font-size: 12px;
    }

    .chat-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .back-btn,
    .menu-btn {
        font-size: 20px;
        padding: 6px;
    }

    .contact-avatar {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .contact-name {
        font-size: 14px;
    }

    .contact-status {
        font-size: 11px;
    }

    .chat-messages {
        padding: 12px 10px;
    }

    .chat-message {
        gap: 6px;
        margin-bottom: 12px;
    }

    .message-avatar,
    .typing-avatar {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .message-bubble,
    .typing-bubble {
        padding: 10px 12px;
        border-radius: 16px;
    }

    .message-bubble {
        max-width: min(86%, 260px);
    }

    .chat-choices,
    .typing-indicator,
    .scenario-progress {
        padding-left: 10px;
        padding-right: 10px;
    }

    .chat-choices.slide-up {
        max-height: min(36dvh, 230px);
    }
}

@media (orientation: landscape) and (max-height: 540px) and (max-width: 900px) {
    #scenarioContainer.active {
        align-items: flex-start;
        overflow-y: auto;
        padding: 4px 0 calc(env(safe-area-inset-bottom) + 4px);
    }

    .phone-simulator {
        align-items: flex-start;
        padding: 4px;
    }

    .phone-frame {
        width: min(100%, 720px);
        max-width: calc(100vw - 8px);
        min-height: 0;
        height: auto;
        max-height: none;
        border-radius: 22px;
        box-shadow:
            0 10px 28px rgba(0, 0, 0, 0.55),
            0 16px 42px rgba(0, 0, 0, 0.28),
            inset 0 0 0 4px #2a2a2a,
            inset 0 0 0 7px #1a1a1a,
            inset 0 1px 2px rgba(255, 255, 255, 0.08);
    }

    .phone-notch {
        width: 108px;
        height: 18px;
    }

    .phone-status-bar {
        height: 28px;
        padding: 4px 12px;
        font-size: 11px;
    }

    .chat-header {
        padding: 8px 12px;
    }

    .contact-avatar {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .chat-messages {
        min-height: 180px;
        padding: 10px 12px;
    }

    .chat-message {
        margin-bottom: 10px;
    }

    .message-bubble {
        max-width: min(74%, 360px);
        padding: 9px 12px;
    }

    .typing-indicator {
        padding: 0 12px 8px;
    }

    .chat-choices {
        padding: 10px 12px;
    }

    .chat-choices.slide-up {
        max-height: min(42dvh, 180px);
    }

    .choice-bubble {
        margin-bottom: 8px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .scenario-progress {
        padding: 8px 12px;
        font-size: 12px;
    }
}

.scenario-score {
    color: #FFD700;
    font-weight: 700;
}

.results-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 30px;
    text-align: center;
    background: linear-gradient(180deg, #0f1419 0%, #16213e 100%);
    animation: resultsSlideIn 0.6s ease;
}

@keyframes resultsSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-emoji {
    font-size: 80px;
    margin-bottom: 20px;
    animation: emojiRotate 1s ease;
}

@keyframes emojiRotate {
    from {
        transform: rotate(-180deg) scale(0);
    }
    to {
        transform: rotate(0) scale(1);
    }
}

.results-screen h3 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #fff;
}

.results-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.result-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.result-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #ddd;
    max-width: 300px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.result-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

/* ===== Clasificación ===== */
.leaderboard-table {
    width: 100%;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.leaderboard-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.leaderboard-table th {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    padding: 15px;
    text-align: left;
    color: var(--primary-color);
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.leaderboard-table td {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-medium) 100%);
    padding: 15px;
    border: 2px solid var(--bg-dark);
    transition: all 0.2s ease;
}

.leaderboard-table tr {
    transition: all 0.2s ease;
}

.leaderboard-table tr:nth-child(even) {
    background: transparent;
}

.leaderboard-table tr:hover {
    transform: translateX(8px);
}

.leaderboard-table tbody tr:hover td {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), 0 6px 15px rgba(33, 150, 243, 0.3);
    background: linear-gradient(180deg, #1e3a5f 0%, var(--bg-light) 100%);
}

.rank-medal {
    font-size: 1.5em;
    margin-right: 10px;
    display: inline-block;
    animation: medalSpin 2s ease-in-out infinite;
}

@keyframes medalSpin {
    0%, 90%, 100% { transform: rotateY(0deg); }
    45% { transform: rotateY(180deg); }
}

/* ===== Torneos ===== */
.tournament-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-medium);
    border: 2px solid var(--bg-dark);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.tab-btn:hover {
    border-color: var(--primary-color);
}

.tournament-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border-left: 4px solid var(--secondary-color);
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tournament-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-active {
    background: var(--success-color);
}

.status-upcoming {
    background: var(--warning-color);
}

.status-finished {
    background: var(--text-gray);
}

.tournament-participants {
    margin-top: 15px;
}

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-medium);
    border-radius: 6px;
}

/* ===== Instrucciones ===== */
.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instruction-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.instruction-card.warning {
    border-left-color: var(--danger-color);
}

.instruction-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.instruction-card ul {
    list-style-position: inside;
    color: var(--text-gray);
}

.instruction-card li {
    margin-bottom: 8px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 3vw, 24px);
    background: rgba(3, 8, 20, 0.82);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    width: min(100%, 620px);
    margin: auto;
    padding: clamp(22px, 4vw, 38px);
    border-radius: 24px;
    max-height: min(88dvh, 900px);
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, rgba(18, 30, 56, 0.98) 0%, rgba(9, 15, 29, 0.98) 100%);
    border: 3px solid rgba(102, 126, 234, 0.42);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: modalSlideIn 0.4s ease;
    text-align: center;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    user-select: none;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: rotate(90deg) scale(1.06);
}

.close-modal:active {
    transform: rotate(90deg) scale(0.96);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-result-card {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 40%),
        linear-gradient(180deg, rgba(27, 46, 84, 0.98) 0%, rgba(10, 17, 33, 0.98) 100%);
}

.modal-result-icon {
    font-size: clamp(2.8rem, 9vw, 4.8rem);
    line-height: 1;
    margin-bottom: clamp(10px, 2.4vw, 18px);
}

.modal-result .modal-content {
    width: min(100%, 640px);
}

.modal-result[data-variant="warning"] .modal-content {
    border-color: rgba(255, 193, 7, 0.45);
}

.modal-result[data-variant="danger"] .modal-content {
    border-color: rgba(255, 107, 107, 0.45);
}

.modal-result[data-variant="success"] .modal-content {
    border-color: rgba(78, 205, 196, 0.45);
}

.modal-content h2 {
    margin-bottom: 14px;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.15;
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-result[data-variant="success"] .modal-content h2,
.modal-exit .modal-content h2 {
    background: linear-gradient(135deg, #4ecdc4, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-result-message,
.modal-message {
    font-size: clamp(1rem, 2.4vw, 1.15rem);
    color: #d6deef;
    line-height: 1.65;
}

.modal-result-message {
    display: grid;
    gap: 12px;
    margin-bottom: clamp(18px, 3vw, 28px);
}

.modal-result-message p,
.modal-message {
    margin: 0;
}

.modal-result-message strong {
    color: #ffffff;
}

.modal-result-message .points-earned,
.modal-result-message .correct-answer-label,
.modal-result-message .explanation {
    margin-inline: auto;
    width: min(100%, 100%);
}

/* Modal de confirmación */
.modal-confirm {
    text-align: center;
    width: min(100%, 560px);
}

.modal-confirm h2 {
    margin-bottom: 20px;
}

.modal-message {
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-buttons .btn {
    min-width: 160px;
}

.modal-settings .modal-content {
    width: min(100%, 560px);
    text-align: left;
}

.modal-settings .modal-content h2 {
    text-align: center;
    margin-bottom: 24px;
}

/* Settings modal small helpers */
.settings-row {
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.modal-settings .modal-content select,
.modal-settings .modal-content input[type="checkbox"] {
    font-size: 1em;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #ffffff;
    color: #000000;
}

.modal-settings .modal-content label {
    font-size: 1em;
    color: var(--text-gray);
}

@media (max-width: 768px) {
    .modal {
        padding: 10px;
        align-items: flex-start;
    }

    .modal.active {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .modal-content {
        width: 100%;
        max-height: none;
        border-radius: 20px;
    }

    .modal-buttons .btn {
        min-width: 0;
        width: 100%;
    }

    .settings-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 6px;
    }

    .modal-content {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .close-modal {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
    }

    .modal-result-message {
        gap: 10px;
    }
}

/* ===== Simulador de Chat ===== */
.chat-simulator {
    max-width: 600px;
    margin: 0 auto;
}

.chat-messages {
    background: var(--bg-dark);
    border-radius: var(--border-radius);
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
}

.message.stranger {
    background: var(--bg-medium);
    margin-right: auto;
}

.message.player {
    background: var(--primary-color);
    margin-left: auto;
    text-align: right;
}

.message-sender {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 5px;
}

.response-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Encuentra el Peligro ===== */
.spot-danger-game {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 2px rgba(255, 255, 255, 0.1),
                inset 0 0 30px rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.spot-danger-game::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.08) 0%, transparent 70%);
    animation: rotateBackground 40s linear infinite;
    pointer-events: none;
    will-change: transform;
}

@keyframes rotateBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(74, 144, 226, 0.3);
    backdrop-filter: blur(10px);
}

.level-info h2 {
    margin: 0;
    font-size: 2em;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.level-title {
    color: #4ecdc4;
    margin: 8px 0 0 0;
    font-size: 1.2em;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.game-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(78, 205, 196, 0.2));
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
                inset 0 0 15px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
    min-width: 100px;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-label {
    font-size: 0.95em;
    color: #4ecdc4;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-description {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(22, 33, 62, 0.7));
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid rgba(78, 205, 196, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                inset 0 0 20px rgba(78, 205, 196, 0.1);
    position: relative;
    z-index: 1;
}

.level-description p {
    margin: 8px 0;
    font-size: 1.15em;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.help-text {
    color: #4ecdc4 !important;
    font-size: 1em !important;
    font-weight: 600;
}

.danger-scene {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    border-radius: 20px;
    padding: 35px;
    min-height: 450px;
    position: relative;
    margin-bottom: 25px;
    border: 3px solid rgba(78, 205, 196, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 40px rgba(78, 205, 196, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        10vw 20vh 1px rgba(255, 255, 255, 0.5),
        25vw 40vh 1px rgba(255, 255, 255, 0.4),
        40vw 10vh 1px rgba(255, 255, 255, 0.6),
        55vw 60vh 1px rgba(255, 255, 255, 0.3),
        70vw 30vh 1px rgba(255, 255, 255, 0.5),
        85vw 70vh 1px rgba(255, 255, 255, 0.4),
        15vw 80vh 1px rgba(255, 255, 255, 0.6),
        30vw 50vh 1px rgba(255, 255, 255, 0.5),
        45vw 90vh 1px rgba(255, 255, 255, 0.3),
        60vw 15vh 1px rgba(255, 255, 255, 0.4),
        75vw 45vh 1px rgba(255, 255, 255, 0.6),
        90vw 25vh 1px rgba(255, 255, 255, 0.5),
        20vw 65vh 1px rgba(255, 255, 255, 0.4),
        35vw 35vh 1px rgba(255, 255, 255, 0.3),
        50vw 75vh 1px rgba(255, 255, 255, 0.5),
        65vw 5vh 1px rgba(255, 255, 255, 0.6),
        80vw 55vh 1px rgba(255, 255, 255, 0.4),
        5vw 45vh 1px rgba(255, 255, 255, 0.5),
        95vw 85vh 1px rgba(255, 255, 255, 0.3),
        12vw 12vh 1px rgba(255, 255, 255, 0.6);
    animation: particleFloat 25s linear infinite;
}

.particles-bg::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        8vw 70vh 1px rgba(255, 255, 255, 0.4),
        22vw 30vh 1px rgba(255, 255, 255, 0.5),
        38vw 85vh 1px rgba(255, 255, 255, 0.3),
        52vw 20vh 1px rgba(255, 255, 255, 0.6),
        68vw 55vh 1px rgba(255, 255, 255, 0.4),
        82vw 10vh 1px rgba(255, 255, 255, 0.5),
        18vw 60vh 1px rgba(255, 255, 255, 0.6),
        32vw 90vh 1px rgba(255, 255, 255, 0.3),
        48vw 40vh 1px rgba(255, 255, 255, 0.4),
        62vw 75vh 1px rgba(255, 255, 255, 0.5),
        78vw 25vh 1px rgba(255, 255, 255, 0.6),
        92vw 65vh 1px rgba(255, 255, 255, 0.4),
        28vw 15vh 1px rgba(255, 255, 255, 0.5),
        42vw 50vh 1px rgba(255, 255, 255, 0.3),
        58vw 80vh 1px rgba(255, 255, 255, 0.6),
        72vw 35vh 1px rgba(255, 255, 255, 0.4),
        88vw 95vh 1px rgba(255, 255, 255, 0.5),
        3vw 5vh 1px rgba(255, 255, 255, 0.6),
        97vw 48vh 1px rgba(255, 255, 255, 0.3),
        16vw 72vh 1px rgba(255, 255, 255, 0.5);
    animation: particleFloat 30s linear infinite;
    animation-delay: -15s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(30px);
        opacity: 0;
    }
}

.danger-scene::before {
    content: '🔍';
    position: absolute;
    font-size: 200px;
    opacity: 0.03;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    pointer-events: none;
    z-index: 0;
}

.danger-scene.profile {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(30, 60, 114, 0.3);
}

.danger-scene.profile::before {
    content: '👤';
}

.danger-scene.message {
    background: linear-gradient(135deg, #fc4a1a, #f7b733);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(252, 74, 26, 0.3);
}

.danger-scene.message::before {
    content: '📧';
}

.danger-scene.chat {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(17, 153, 142, 0.3);
}

.danger-scene.chat::before {
    content: '💬';
}

.danger-scene.post {
    background: linear-gradient(135deg, #ee0979, #ff6a00);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(238, 9, 121, 0.3);
}

.danger-scene.post::before {
    content: '📱';
}

.danger-scene.webpage {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 60px rgba(102, 126, 234, 0.3);
}

.danger-scene.webpage::before {
    content: '🌐';
}

.danger-item {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.95));
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.2s ease,
                box-shadow 0.2s ease;
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 75%;
    user-select: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    will-change: transform;
    z-index: 1;
}

.danger-item:hover:not(.checked) {
    transform: scale(1.12);
    border-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(255, 240, 240, 1));
    box-shadow: 0 0 25px rgba(255, 107, 107, 0.8), 
                0 0 40px rgba(255, 107, 107, 0.4),
                inset 0 0 15px rgba(255, 107, 107, 0.2);
    z-index: 10;
}

.item-text {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.item-icon {
    font-size: 1.5em;
}

.danger-item.checked.is-danger {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #27ae60;
    color: white;
    animation: correctPulse 0.4s ease;
    pointer-events: none;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); box-shadow: 0 0 40px rgba(46, 204, 113, 0.8); }
    100% { transform: scale(1); }
}

.danger-item.checked.is-danger .item-text {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.danger-item.checked:not(.is-danger) {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
    color: white;
    animation: wrongShake 0.4s ease;
    pointer-events: none;
}

.danger-item.checked:not(.is-danger) .item-text {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* Partículas de explosión */
@keyframes particleExplode {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0.2);
    }
}

.danger-particle {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    will-change: transform, opacity;
}

.danger-item.hint-pulse {
    animation: hintGlow 0.8s ease-in-out 3;
    border-color: #ffd93d !important;
}

@keyframes hintGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 217, 61, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 35px rgba(255, 217, 61, 0.9);
        transform: scale(1.08);
    }
}

/* ===== Guardian Runner ===== */
.runner-game {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.runner-stage-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.runner-game h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.runner-controls {
    background: var(--bg-medium);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.runner-controls p {
    margin: 8px 0;
    font-size: 1.1em;
}

.runner-info {
    display: flex;
    justify-content: space-around;
    background: var(--bg-medium);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.runner-hud {
    margin-bottom: 0;
}

.runner-info .info-item {
    font-size: clamp(1rem, 0.5vw + 0.95rem, 1.2rem);
    font-weight: bold;
}

.runner-stage,
.platformer-stage {
    width: 100%;
    margin: 0 auto;
}

.runner-stage {
    position: relative;
}

#runnerCanvas {
    display: block;
    width: 100%;
    max-width: 1320px;
    height: auto;
    aspect-ratio: 2 / 1;
    margin: 20px auto;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 10px 30px rgba(76, 175, 80, 0.3);
}

.runner-stage-message {
    min-height: 0;
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(88%, 520px);
    margin: 0;
    z-index: 4;
    pointer-events: none;
}

.runner-quick-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.runner-result-layout,
.game-result-layout {
    min-height: min(100dvh - 140px, 820px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 40px;
}

.runner-result-screen,
.game-result-screen {
    width: min(100%, 720px);
}

.runner-win-screen,
.game-result-screen.is-success {
    border-color: rgba(78, 205, 196, 0.45);
}

body.runner-playing[data-active-section="runnerContainer"] .game-content {
    overflow: hidden;
    overscroll-behavior: none;
}

body.runner-playing[data-active-section="runnerContainer"] .runner-stage,
body.runner-playing[data-active-section="runnerContainer"] #runnerCanvas {
    touch-action: none;
}

.touch-controls {
    display: none;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    width: min(100%, 900px);
    margin: 16px auto 0;
    touch-action: manipulation;
}

.runner-orientation-hint {
    display: none;
}

.landscape-lock-overlay {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: #000;
    z-index: 30;
}

.landscape-lock-overlay.active {
    display: flex;
}

.landscape-lock-card {
    width: min(92vw, 420px);
    padding: 28px 22px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.landscape-lock-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.landscape-lock-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.landscape-lock-card p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.86);
}

#runnerContainer.landscape-locked,
#platformerContainer.landscape-locked,
#runnerContainer.landscape-locked .runner-game,
#platformerContainer.landscape-locked .platformer-game,
#runnerContainer.landscape-locked .runner-stage,
#platformerContainer.landscape-locked .platformer-stage,
#runnerContainer.landscape-locked .game-content,
#platformerContainer.landscape-locked .game-content {
    background: #000 !important;
}

#runnerContainer.landscape-locked #runnerCanvas,
#platformerContainer.landscape-locked #gameCanvas,
#runnerContainer.landscape-locked .runner-info,
#platformerContainer.landscape-locked .game-info,
#runnerContainer.landscape-locked .runner-touch-controls,
#platformerContainer.landscape-locked .platformer-touch-controls,
#runnerContainer.landscape-locked .runner-stage-message,
#platformerContainer.landscape-locked #gameMessage {
    opacity: 0;
    pointer-events: none;
}

[data-orientation-lock]:disabled,
.touch-controls .touch-btn:disabled {
    opacity: 0.45;
    filter: grayscale(0.2);
    cursor: not-allowed;
}

.mobile-game-shell {
    width: 100%;
    min-height: 100%;
}

.touch-btn {
    flex: 1;
    min-height: 72px;
    border: 0;
    border-radius: 18px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.18);
    user-select: none;
    -webkit-user-select: none;
}

.touch-btn span {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.touch-btn-move {
    background: linear-gradient(180deg, #2e78ff 0%, #1847b8 100%);
}

.touch-btn-action {
    background: linear-gradient(180deg, #ff8c42 0%, #d95604 100%);
}

.touch-btn:active {
    transform: translateY(2px);
}

.touch-btn:disabled {
    opacity: 0.45;
    filter: grayscale(0.2);
}

.boss-message {
    background: linear-gradient(180deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    border: 3px solid #c62828;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 8px 20px rgba(244, 67, 54, 0.5);
    animation: bossAppear 0.5s ease;
}

@keyframes bossAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.danger-item.found-danger {
    background: var(--success-color);
    border-color: var(--success-color);
    animation: foundDanger 0.6s ease;
    pointer-events: none;
}

@keyframes foundDanger {
    0% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(5deg); }
    50% { transform: scale(0.9) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.danger-item.wrong-click {
    background: var(--bg-medium);
    border-color: var(--text-gray);
    opacity: 0.6;
    pointer-events: none;
}

.danger-item.missed-danger {
    background: var(--warning-color);
    border-color: var(--warning-color);
    animation: pulse 1s infinite;
}

.danger-item.hint-pulse {
    animation: hintGlow 1s ease-in-out 3;
    border-color: var(--warning-color) !important;
}

@keyframes hintGlow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
        transform: scale(1);
    }
    25% { 
        box-shadow: 0 0 30px rgba(255, 152, 0, 1), inset 0 0 20px rgba(255, 152, 0, 0.5);
        transform: scale(1.1);
    }
    75% { 
        box-shadow: 0 0 30px rgba(255, 152, 0, 1), inset 0 0 20px rgba(255, 152, 0, 0.5);
        transform: scale(1.1);
    }
}

@keyframes foundSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Estilos para resultados de juegos */
.results-summary {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    padding: 30px;
    border-radius: var(--border-radius);
    margin: 30px auto;
    max-width: 600px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 10px 30px rgba(76, 175, 80, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.results-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 25%, 
        var(--warning-color) 50%, 
        var(--danger-color) 75%, 
        var(--primary-color) 100%);
    animation: rainbowSlide 3s linear infinite;
}

@keyframes rainbowSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.result-score {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(76, 175, 80, 0.5);
    animation: scoreAppear 0.6s ease;
}

@keyframes scoreAppear {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

.result-percentage {
    font-size: 1.3em;
    color: var(--secondary-color);
    margin: 10px 0;
}

.result-message {
    font-size: 1.2em;
    color: var(--text-light);
    margin: 15px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(76, 175, 80, 0.3);
}

@keyframes hintPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }
}

.feedback-area {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.feedback-message {
    padding: 18px 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.15em;
    font-weight: 600;
    animation: slideInBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.feedback-correct {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.feedback-wrong {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.feedback-icon {
    font-size: 2em;
    animation: iconPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconPop {
    0% {
        transform: scale(0);
    }
    60% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.level-complete,
.time-up {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7), rgba(22, 33, 62, 0.9));
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    animation: fadeInScale 0.4s ease;
    border: 3px solid rgba(78, 205, 196, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
                inset 0 0 40px rgba(78, 205, 196, 0.1);
    position: relative;
    z-index: 1;
}

.level-complete h3,
.time-up h3 {
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-size: 2.5em;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bonus {
    color: #ffd93d;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.safety-tips {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid var(--primary-color);
}

.safety-tips h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.safety-tips ul {
    list-style-position: inside;
    color: var(--text-gray);
}

.safety-tips li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ===== Guardián Runner (Platformer) ===== */
.platformer-game {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-medium);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.info-left, .info-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.level-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.lives {
    font-size: 1.3em;
}

.game-score {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--warning-color);
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 1240px;
    height: auto;
    aspect-ratio: 8 / 5;
    margin: 0 auto;
    border: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    background: #1a1a2e;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.game-controls-info {
    background: var(--bg-medium);
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    text-align: center;
}

.game-controls-info p {
    margin: 5px 0;
    color: var(--text-gray);
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.game-message {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

.instructions-box,
.level-complete-msg,
.game-over-msg,
.game-won-msg,
.pause-msg {
    background: var(--bg-medium);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 500px;
    animation: fadeIn 0.5s ease;
}

.instructions-box h3,
.level-complete-msg h3,
.game-over-msg h3,
.game-won-msg h3,
.pause-msg h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8em;
}

.instructions-box ul {
    list-style-position: inside;
    text-align: left;
    margin: 15px auto;
    max-width: 400px;
}

.instructions-box li {
    margin: 10px 0;
    color: var(--text-gray);
}

.level-complete-msg,
.game-won-msg {
    border-left: 4px solid var(--success-color);
}

.game-over-msg {
    border-left: 4px solid var(--danger-color);
}

@keyframes floatUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Ajustes responsive para el platformer */
@media (max-width: 850px) {
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;

@media (max-width: 768px) {
    .splash-content {
        width: min(100%, 500px);
    }

    .splash-logo {
        width: clamp(220px, 68vw, 340px);
        height: clamp(220px, 68vw, 340px);
    }

    .splash-logo-img {
        max-width: 100% !important;
    }

    .splash-logo-img.logo-img-3 {
        max-width: min(88%, 280px) !important;
    }
}

@media (max-width: 480px) {
    .splash-content {
        width: min(100%, 420px);
    }

    .splash-logo {
        width: clamp(240px, 74vw, 320px);
        height: clamp(240px, 74vw, 320px);
    }

    .splash-logo-img.logo-img-3 {
        max-width: min(90%, 290px) !important;
    }
}
        gap: 10px;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* Header responsive */
    .main-header {
        position: relative;
    }

    .header-content {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .header-logo {
        height: 34px;
        max-width: 58px;
    }

    .header-title h1 {
        font-size: 1.02em;
        gap: 6px;
        flex-wrap: nowrap;
        text-align: center;
        line-height: 1.15;
        justify-content: center;
    }

    .logo-container {
        width: auto;
        justify-content: center;
        gap: 0;
    }

    .header-title {
        width: 100%;
        min-width: 0;
    }

    /* Footer responsive */
    .developer-badge {
        flex-direction: column;
        gap: 5px;
        font-size: 0.9em;
    }

    .hero h1 {
        font-size: 2.15em;
    }

    .subtitle {
        font-size: 1em;
    }

    .hero {
        padding: 12px 10px 18px;
    }

    .player-info {
        margin: 18px auto 16px;
        max-width: 420px;
        padding: 18px 14px;
        border-radius: 16px;
    }

    .player-info .btn-primary {
        width: 100%;
        margin: 6px 0 0;
    }

    .menu-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        max-width: 420px;
        margin: 18px auto 0;
        align-items: stretch;
    }

    .menu-options .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
        min-height: 48px;
        padding: 10px 12px;
        font-size: 0.78rem;
        letter-spacing: 0.6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }

    .menu-options #btnSettings {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 220px;
    }

    .mission-grid {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }

    .game-header > div {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .player-stats {
        justify-content: center;
        gap: 15px;
    }

    .stat {
        font-size: 0.95em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
        margin: 3px;
    }

    .btn-small {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .game-content {
        padding: 14px;
    }

    body.heavy-gameplay-mode .main-header,
    body.heavy-gameplay-mode .main-footer {
        display: none !important;
    }

    body.heavy-gameplay-mode .container {
        max-width: 100%;
        width: 100%;
        height: auto;
        padding: 0;
        margin: 0;
        position: relative;
        inset: auto;
        z-index: auto;
    }

    body.heavy-gameplay-mode #gameScreen {
        position: relative;
        inset: auto;
        z-index: auto;
        background: #08111f;
        overflow: visible;
    }

    body.heavy-gameplay-mode .game-header {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        z-index: auto;
        margin: 0 0 8px;
        min-height: 56px;
        padding: 9px 12px;
        border-radius: 0 0 16px 16px;
        background: rgba(8, 17, 31, 0.9);
        backdrop-filter: blur(8px);
    }

    body.heavy-gameplay-mode .game-header .player-stats {
        display: none;
    }

    body.heavy-gameplay-mode .game-header > div {
        justify-content: space-between;
    }

    body.heavy-gameplay-mode .game-content {
        position: relative;
        inset: auto;
        border-radius: 0;
        min-height: auto;
        height: auto;
        padding: 0;
        overflow: visible;
        overscroll-behavior: auto;
    }

    body.heavy-gameplay-mode .game-section.active {
        min-height: auto;
    }

    .quiz-container,
    .scenario-container,
    .memory-game-container,
    .runner-game,
    .platformer-game,
    .tv-quiz-container {
        max-width: 100%;
    }

    .mission-grid {
        gap: 15px;
    }

    .mission-card {
        min-height: 0;
    }

    .option-btn,
    .choice-btn {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .tournament-tabs {
        flex-direction: column;
    }
}

/* ===== Animaciones adicionales ===== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== Utilidades ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* ===== Memory Match Game ===== */
.memory-game-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

.quiz-container,
.scenario-container,
.tv-quiz-container {
    width: 100%;
    max-width: 1280px;
}

.memory-header {
    text-align: center;
    margin-bottom: 25px;
}

.memory-header h2 {
    font-size: 2.2em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.memory-instructions {
    font-size: 1.2em;
    color: #4ecdc4;
    font-weight: 600;
}

.memory-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.memory-stat {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.memory-stat .stat-icon {
    font-size: 1.5em;
}

.memory-stat .stat-label {
    color: #a8b2d1;
    font-weight: 600;
}

.memory-stat .stat-value {
    color: #ffd93d;
    font-size: 1.3em;
    font-weight: bold;
}

.memory-stat.warning-pulse {
    animation: warningPulse 0.5s ease infinite;
}

@keyframes warningPulse {
    0%, 100% { 
        border-color: rgba(231, 76, 60, 0.4);
        box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
    }
    50% { 
        border-color: rgba(231, 76, 60, 0.8);
        box-shadow: 0 8px 30px rgba(231, 76, 60, 0.6);
    }
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 920px;
    margin: 0 auto 30px;
    perspective: 1000px;
}

.memory-card {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.memory-card:hover {
    transform: translateY(-5px);
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.memory-card-front {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.card-logo {
    font-size: 3em;
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.memory-card-back {
    transform: rotateY(180deg);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.memory-card-back.threat {
    background: linear-gradient(135deg, #ee0979, #ff6a00);
}

.memory-card-back.solution {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.card-emoji {
    font-size: 3em;
    margin-bottom: 10px;
}

.card-name {
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.memory-card.matched .memory-card-back {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #27ae60;
    animation: matchedPulse 0.6s ease;
}

@keyframes matchedPulse {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.15); }
    100% { transform: rotateY(180deg) scale(1); }
}

.memory-card.shake {
    animation: cardShake 0.5s ease;
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

@keyframes matchParticle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0.3);
    }
}

.match-particle {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    will-change: transform, opacity;
}

.memory-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Game Over Screen */
.game-over-screen {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(22, 33, 62, 0.95));
    width: min(100%, 600px);
    padding: clamp(22px, 4vw, 40px);
    border-radius: 20px;
    max-width: 600px;
    margin: 0 auto;
    border: 3px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: fadeInScale 0.5s ease;
}

.game-over-icon {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: clamp(12px, 3vw, 20px);
    animation: iconBounce 1s ease infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.game-over-screen h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.game-over-message {
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    color: #4ecdc4;
    margin-bottom: clamp(18px, 4vw, 30px);
}

.game-over-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: clamp(16px, 3vw, 25px);
    border-radius: 15px;
    margin-bottom: clamp(18px, 4vw, 30px);
}

.final-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.final-stat:last-child {
    border-bottom: none;
}

.final-stat-label {
    color: #a8b2d1;
    font-weight: 600;
    text-align: left;
}

.final-stat-value {
    color: #fff;
    font-weight: bold;
    font-size: clamp(1rem, 2.6vw, 1.2rem);
    text-align: right;
}

.final-stat-value.highlight {
    color: #ffd93d;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.final-stat.bonus {
    border-top: 2px solid rgba(255, 217, 61, 0.3);
    padding-top: 15px;
}

.final-stat.bonus .final-stat-value {
    color: #2ecc71;
}

.game-over-tips {
    background: rgba(78, 205, 196, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid rgba(78, 205, 196, 0.3);
}

.game-over-tips h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
}

.game-over-tips ul {
    list-style: none;
    padding: 0;
}

.game-over-tips li {
    color: #a8b2d1;
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.game-over-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
    font-weight: bold;
}

.game-over-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-over-actions .btn {
    min-width: 190px;
}

/* Responsive para Memory Match */
@media (max-width: 768px) {
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .card-emoji {
        font-size: 2em;
    }

    .card-name {
        font-size: 0.75em;
    }

    .memory-header h2 {
        font-size: 1.8em;
    }

    .game-over-screen {
        padding: 25px;
    }

    .game-over-actions .btn {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .card-emoji {
        font-size: 1.5em;
    }

    .card-name {
        font-size: 0.65em;
    }

    .game-over-screen {
        border-width: 2px;
        border-radius: 18px;
    }

    .final-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .final-stat-value {
        text-align: left;
    }
}

@media (orientation: landscape) and (max-height: 540px) {
    .runner-result-layout {
        min-height: auto;
        padding: 12px 0 20px;
        align-items: flex-start;
    }

    .runner-result-screen {
        width: min(100%, 760px);
    }

    .game-over-screen {
        padding: 18px 20px;
    }

    .game-over-icon {
        font-size: 2.8rem;
        margin-bottom: 10px;
    }

    .game-over-screen h2 {
        margin-bottom: 10px;
    }

    .game-over-message,
    .game-over-stats {
        margin-bottom: 14px;
    }

    .game-over-actions {
        gap: 10px;
    }

    .game-over-actions .btn {
        min-width: 160px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}
/* ===== Responsive Global Mejorado ===== */

@media (max-width: 1024px) {
    .container {
        padding: 15px;
        max-width: 95%;
    }

    #runnerCanvas {
        max-width: 100%;
        height: auto;
    }

    .runner-game canvas {
        max-width: 100%;
        height: auto !important;
    }

    .splash-title {
        font-size: 2.5em;
    }

    .splash-subtitle {
        font-size: 1.2em;
    }

    .btn-play {
        font-size: 1.3em;
        padding: 18px 42px;
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    body.heavy-gameplay-mode {
        height: auto;
        overflow: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: auto;
        touch-action: manipulation;
    }

    .splash-title {
        font-size: 2em;
        padding: 0 20px;
    }

    .splash-subtitle {
        font-size: 1em;
    }

    .btn-play {
        font-size: 1.1em;
        padding: 16px 30px;
        min-width: 220px;
        border-radius: 16px;
    }

    .splash-logo-img {
        max-width: 100px !important;
        height: auto !important;
    }

    .title-icon {
        width: 50px !important;
        height: 50px !important;
    }

    .mission-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mission-card {
        padding: 20px;
    }

    #runnerCanvas,
    #gameCanvas {
        max-width: 100%;
        width: 100% !important;
        height: auto !important;
    }

    .runner-info,
    .game-info {
        flex-wrap: wrap;
        font-size: 0.9em;
    }

    .runner-controls,
    .game-controls-info,
    .runner-info,
    .game-info,
    .question-text,
    .scenario-story {
        padding: 14px;
    }

    .memory-game-container,
    .quiz-container,
    .scenario-container,
    .tv-quiz-container,
    .runner-game,
    .platformer-game {
        padding-left: 0;
        padding-right: 0;
    }

    .game-info {
        gap: 12px;
        padding: 14px 16px;
    }

    .info-left,
    .info-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    .touch-controls {
        display: flex;
    }

    .game-controls button {
        font-size: 0.9em;
        padding: 10px 20px;
    }

    #runnerCanvas,
    #gameCanvas {
        max-width: 100%;
        min-height: min(56vw, 360px);
    }

    body[data-active-section="runnerContainer"] .game-content,
    body[data-active-section="platformerContainer"] .game-content,
    body[data-active-section="quizContainer"] .game-content,
    body[data-active-section="memoryContainer"] .game-content,
    body[data-active-section="dangerContainer"] .game-content,
    body[data-active-section="chatContainer"] .game-content,
    body[data-active-section="scenarioContainer"] .game-content {
        padding: 0;
        background: #050816;
    }

    body[data-active-section="runnerContainer"] .game-content {
        inset: auto;
        min-height: auto;
        height: auto;
    }

    body[data-active-section="runnerContainer"] .game-header {
        display: none;
    }

    body[data-active-section="runnerContainer"] .runner-game,
    body[data-active-section="platformerContainer"] .platformer-game,
    body[data-active-section="quizContainer"] .tv-quiz-container,
    body[data-active-section="memoryContainer"] .memory-game-container,
    body[data-active-section="dangerContainer"] .spot-danger-game,
    body[data-active-section="chatContainer"] .chat-simulator,
    body[data-active-section="scenarioContainer"] .scenario-container {
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 8px;
        padding: 12px 8px calc(env(safe-area-inset-bottom) + 8px);
    }

    body[data-active-section="runnerContainer"] .runner-game {
        display: grid;
        grid-template-rows: auto auto auto;
        min-height: auto;
        padding: 0;
        gap: 8px;
    }

    body[data-active-section="runnerContainer"] #runnerContainer,
    body[data-active-section="platformerContainer"] #platformerContainer {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        background: #050816;
        z-index: auto;
    }

    body[data-active-section="runnerContainer"] .runner-game,
    body[data-active-section="platformerContainer"] .platformer-game {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        max-width: 100%;
        margin: 0;
        background: #050816;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    body[data-active-section="runnerContainer"] .runner-stage-shell {
        min-height: 0;
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
    }

    body[data-active-section="runnerContainer"] .runner-game h2 {
        display: none;
    }

    body[data-active-section="runnerContainer"] .runner-controls {
        display: none;
    }

    body[data-active-section="runnerContainer"] .runner-info {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        z-index: 3;
        margin: 0;
        padding: 8px 10px;
        gap: 8px;
        background: rgba(7, 17, 31, 0.82);
        border-width: 2px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
        backdrop-filter: blur(6px);
    }

    body[data-active-section="runnerContainer"] .runner-info .info-item {
        font-size: 0.84rem;
    }

    body[data-active-section="runnerContainer"] .runner-stage {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        inset: auto;
        min-height: auto;
        width: 100%;
        height: auto;
    }

    body[data-active-section="runnerContainer"] #runnerCanvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        max-height: none;
        min-height: min(56vw, 360px);
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        aspect-ratio: 2 / 1;
    }

    body[data-active-section="runnerContainer"] .runner-stage-message {
        position: absolute;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%);
        width: min(88%, 460px);
        z-index: 3;
        margin: 0;
    }

    body[data-active-section="runnerContainer"] .runner-quick-actions {
        position: relative;
        right: auto;
        bottom: auto;
        z-index: 3;
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
    }

    body[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        margin: 0;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    body[data-active-section="platformerContainer"] .game-info {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        z-index: 3;
        margin: 0;
        padding: 8px 10px;
        background: rgba(7, 17, 31, 0.82);
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
        backdrop-filter: blur(6px);
    }

    body[data-active-section="platformerContainer"] .platformer-stage {
        position: relative;
        inset: auto;
        width: 100%;
        height: auto;
        margin: 0;
    }

    body[data-active-section="platformerContainer"] #gameCanvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        min-height: min(62vw, 300px);
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        aspect-ratio: 8 / 5;
    }

    body[data-active-section="platformerContainer"] .platformer-touch-controls {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: 3;
        margin: 0;
        width: 100%;
        max-width: none;
    }

    body[data-active-section="platformerContainer"] .game-controls-info {
        display: none;
    }

    body[data-active-section="platformerContainer"] .game-buttons {
        position: relative;
        right: auto;
        top: auto;
        z-index: 3;
        display: flex;
        flex-direction: row;
        gap: 8px;
        margin: 0;
        justify-content: center;
    }

    body[data-active-section="platformerContainer"] .game-buttons .btn {
        margin: 0;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    body[data-active-section="platformerContainer"] #gameMessage {
        position: relative;
        left: 50%;
        top: auto;
        transform: translate(-50%, -50%);
        z-index: 3;
        width: min(88vw, 420px);
        min-height: 0;
        margin: 12px 0 0;
    }

    body[data-active-section="runnerContainer"] .runner-controls,
    body[data-active-section="platformerContainer"] .game-controls-info {
        margin-bottom: 8px;
    }

    body[data-active-section="quizContainer"] .tv-quiz-container,
    body[data-active-section="memoryContainer"] .memory-game-container,
    body[data-active-section="dangerContainer"] .spot-danger-game,
    body[data-active-section="chatContainer"] .chat-simulator,
    body[data-active-section="scenarioContainer"] .scenario-container {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    body[data-active-section="quizContainer"] .tv-quiz-container {
        justify-content: space-between;
    }

    body[data-active-section="quizContainer"] .tv-header,
    body[data-active-section="memoryContainer"] .memory-stats,
    body[data-active-section="dangerContainer"] .game-header-info {
        margin-bottom: 10px;
    }

    body[data-active-section="quizContainer"] .tv-host-section {
        gap: 12px;
        margin-bottom: 14px;
    }

    body[data-active-section="quizContainer"] .host-avatar-large {
        font-size: 3.5em;
        padding: 12px;
    }

    body[data-active-section="quizContainer"] .question-bubble {
        padding: 16px;
    }

    body[data-active-section="quizContainer"] .bubble-content {
        font-size: 1.06em;
        line-height: 1.45;
    }

    body[data-active-section="quizContainer"] .tv-option-btn {
        min-height: 78px;
        padding: 16px;
    }

    body[data-active-section="memoryContainer"] .memory-board {
        flex: 1;
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
        gap: 10px;
        min-height: 0;
    }

    body[data-active-section="memoryContainer"] .memory-controls,
    body[data-active-section="quizContainer"] .tv-controls,
    body[data-active-section="dangerContainer"] .game-controls {
        margin-top: auto;
        position: sticky;
        bottom: 0;
        padding: 10px 0 calc(env(safe-area-inset-bottom) + 6px);
        background: linear-gradient(180deg, rgba(7, 17, 31, 0) 0%, rgba(7, 17, 31, 0.88) 36%, rgba(7, 17, 31, 0.96) 100%);
        backdrop-filter: blur(4px);
        z-index: 5;
    }

    body[data-active-section="dangerContainer"] .spot-danger-game {
        padding: 8px;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        flex: 1;
        min-height: 0;
        padding: 18px;
        margin-bottom: 12px;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        min-height: 48px;
        max-width: 88%;
        padding: 10px 14px;
    }

    body[data-active-section="dangerContainer"] .item-text {
        font-size: 0.92rem;
    }

    body[data-active-section="chatContainer"] .chat-simulator,
    body[data-active-section="scenarioContainer"] .scenario-container {
        padding: 10px;
    }

    body[data-active-section="chatContainer"] .chat-messages {
        flex: 1;
        height: auto;
        min-height: 0;
    }

    body[data-active-section="runnerContainer"] .runner-touch-controls {
        width: 100%;
        max-width: none;
        margin: 0;
        padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
    }

    body[data-active-section="platformerContainer"] .platformer-game,
    body[data-active-section="quizContainer"] .tv-quiz-container,
    body[data-active-section="memoryContainer"] .memory-game-container,
    body[data-active-section="dangerContainer"] .spot-danger-game,
    body[data-active-section="chatContainer"] .chat-simulator,
    body[data-active-section="scenarioContainer"] .scenario-container {
        overflow: hidden;
    }

    .runner-stage,
    .platformer-stage,
    .tv-quiz-container,
    .memory-game-container,
    .scenario-container,
    .quiz-container {
        width: 100%;
        max-width: 100%;
    }

    .main-footer {
        font-size: 0.8em;
        padding: 15px;
    }

    .footer-content {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .splash-content {
        padding-top: 80px;
    }

    .splash-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .splash-subtitle {
        font-size: 0.9em;
    }

    .btn-play {
        font-size: 1em;
        padding: 14px 22px;
        min-width: 200px;
        letter-spacing: 1px;
    }

    .splash-footer {
        font-size: 0.7em;
        flex-wrap: wrap;
        padding: 10px;
        gap: 5px;
    }

    .splash-logo-img {
        max-width: 70px !important;
    }

    .title-icon {
        width: 40px !important;
        height: 40px !important;
    }

    .hero h2 {
        font-size: 1.8em;
    }

    .hero-icon {
        width: 40px !important;
        height: 40px !important;
    }

    .touch-controls {
        gap: 8px;
    }

    .touch-btn {
        min-height: 64px;
        border-radius: 16px;
        font-size: 1.3rem;
    }

    .touch-btn span {
        font-size: 0.72rem;
    }

    .header-content {
        padding: 8px 6px;
    }

    .header-logo {
        height: 36px;
        max-width: 72px;
    }

    .header-title h1 {
        font-size: 1.02em;
    }

    .runner-controls p,
    .game-controls-info p,
    .question-text,
    .scenario-story,
    .option-btn,
    .choice-btn {
        font-size: 0.95rem;
    }

    body.heavy-gameplay-mode .game-content {
        padding: 0;
        border-radius: 0;
    }

    body[data-active-section="runnerContainer"] .game-content,
    body[data-active-section="platformerContainer"] .game-content,
    body[data-active-section="quizContainer"] .game-content,
    body[data-active-section="memoryContainer"] .game-content,
    body[data-active-section="dangerContainer"] .game-content,
    body[data-active-section="chatContainer"] .game-content,
    body[data-active-section="scenarioContainer"] .game-content {
        inset: auto;
        min-height: auto;
        border-radius: 0;
    }

    body[data-active-section="runnerContainer"] .game-content {
        inset: auto;
        min-height: auto;
        height: auto;
    }

    body.heavy-gameplay-mode .game-header {
        min-height: 52px;
        padding: 8px 10px;
    }

    body.heavy-gameplay-mode .container {
        height: auto;
    }

    body.gameplay-mode .container {
        padding-inline: 6px;
    }

    #runnerCanvas,
    #gameCanvas {
        border-width: 2px;
        border-radius: 12px;
        margin: 12px auto;
        min-height: min(62vw, 300px);
    }

    body[data-active-section="quizContainer"] .tv-header,
    body[data-active-section="dangerContainer"] .game-header-info,
    body[data-active-section="memoryContainer"] .memory-stat {
        padding: 10px 12px;
    }

    body[data-active-section="quizContainer"] .tv-title {
        font-size: 1.05rem;
        letter-spacing: 1px;
    }

    body[data-active-section="quizContainer"] .tv-score,
    body[data-active-section="quizContainer"] .tv-logo {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    body[data-active-section="quizContainer"] .score-value {
        font-size: 1.45rem;
    }

    body[data-active-section="memoryContainer"] .memory-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    body[data-active-section="memoryContainer"] .memory-card-front,
    body[data-active-section="memoryContainer"] .memory-card-back {
        padding: 10px;
    }

    body[data-active-section="memoryContainer"] .card-emoji {
        font-size: 1.8em;
    }

    body[data-active-section="memoryContainer"] .card-name {
        font-size: 0.72em;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        min-height: 0;
        padding: 12px;
    }

    body[data-active-section="runnerContainer"] #runnerCanvas {
        min-height: min(62vw, 300px);
        max-height: none;
    }

    body[data-active-section="runnerContainer"] .runner-info {
        inset: 6px 6px auto 6px;
        padding: 7px 8px;
        gap: 6px;
    }

    body[data-active-section="runnerContainer"] .runner-info .info-item {
        font-size: 0.78rem;
    }

    body[data-active-section="runnerContainer"] .runner-quick-actions {
        right: 6px;
        bottom: 6px;
        gap: 6px;
    }

    body[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        padding: 7px 10px;
        font-size: 0.74rem;
    }

    body[data-active-section="platformerContainer"] .game-info {
        inset: 6px 6px auto 6px;
        padding: 7px 8px;
    }

    body[data-active-section="platformerContainer"] .level-name,
    body[data-active-section="platformerContainer"] .lives,
    body[data-active-section="platformerContainer"] .game-score {
        font-size: 0.88rem;
    }

    body[data-active-section="platformerContainer"] .game-buttons {
        right: 6px;
        top: 62px;
        gap: 6px;
    }

    body[data-active-section="platformerContainer"] .game-buttons .btn {
        padding: 7px 10px;
        font-size: 0.72rem;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        max-width: 92%;
        gap: 8px;
        padding: 8px 10px;
    }

    body[data-active-section="dangerContainer"] .item-icon {
        font-size: 1.2em;
    }

    body[data-active-section="chatContainer"] .chat-messages {
        height: auto;
        padding: 12px;
    }

    body[data-active-section="platformerContainer"] .platformer-game,
    body[data-active-section="quizContainer"] .tv-quiz-container,
    body[data-active-section="memoryContainer"] .memory-game-container,
    body[data-active-section="dangerContainer"] .spot-danger-game,
    body[data-active-section="chatContainer"] .chat-simulator,
    body[data-active-section="scenarioContainer"] .scenario-container {
        padding: 60px 6px calc(env(safe-area-inset-bottom) + 6px);
    }

    .memory-board {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .game-controls {
        flex-direction: column;
        gap: 10px;
    }

    .game-controls button {
        width: 100%;
        font-size: 0.85em;
    }

    .main-footer {
        font-size: 0.7em;
        padding: 10px;
    }

    .splash-separator {
        display: none;
    }
}

@media (pointer: coarse), (max-width: 1024px) {
    .touch-controls {
        display: flex;
    }

    .floating-particles {
        display: block;
        opacity: 0.26;
    }

    body::before,
    body::after {
        animation: none;
    }

    .splash-particle,
    .particle,
    .title-icon,
    .header-logo,
    .header-title h1,
    .memory-stat.warning-pulse,
    .danger-item.hint-pulse,
    .card-logo {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }

    .floating-particles .particle:nth-child(n+9) {
        display: none;
    }

    .splash-particle:nth-child(n+21) {
        display: none;
    }
}

@media (max-height: 900px) {
    .splash-content {
        padding-top: 24px;
        padding-bottom: 20px;
    }

    .splash-logo {
        width: clamp(130px, 22vh, 220px);
        height: clamp(130px, 22vh, 220px);
        margin-bottom: 18px;
    }

    .splash-subtitle {
        margin-bottom: 22px;
    }

    .splash-footer {
        margin-top: 24px;
    }
}

@media (max-height: 740px) {
    .splash-screen {
        align-items: flex-start;
    }

    .splash-content {
        padding-top: 12px;
    }

    .splash-logo {
        width: clamp(110px, 18vh, 170px);
        height: clamp(110px, 18vh, 170px);
        margin-bottom: 14px;
    }

    .splash-title {
        margin-bottom: 10px;
    }

    .splash-subtitle {
        font-size: 1rem;
        margin-bottom: 18px;
    }

    .btn-play {
        padding: 12px 24px;
    }

    .splash-footer {
        gap: 6px;
        margin-top: 18px;
    }
}

/* ===== Ajustes Finales Splash y Encuentra el Peligro ===== */
.splash-footer {
    width: min(100%, 720px);
    margin-inline: auto;
    padding: 12px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(9, 21, 40, 0.72), rgba(20, 55, 92, 0.48));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.splash-footer .splash-dev-text,
.splash-footer .splash-dev-title,
.splash-footer .splash-copyright {
    text-align: center;
}

body[data-active-section="dangerContainer"] .spot-danger-game {
    width: min(100%, 980px);
}

@media (max-width: 768px) {
    body[data-active-section="dangerContainer"] .spot-danger-game {
        padding: 12px 10px 16px;
        border-radius: 18px;
    }

    body[data-active-section="dangerContainer"] .game-header-info {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 12px;
        border-radius: 16px;
    }

    body[data-active-section="dangerContainer"] .level-info h2 {
        font-size: 1.4rem;
        line-height: 1.1;
    }

    body[data-active-section="dangerContainer"] .level-title {
        font-size: 0.96rem;
        line-height: 1.25;
    }

    body[data-active-section="dangerContainer"] .game-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-active-section="dangerContainer"] .stat-item {
        min-width: 0;
        padding: 10px 8px;
    }

    body[data-active-section="dangerContainer"] .stat-label {
        font-size: 0.72rem;
        text-align: center;
    }

    body[data-active-section="dangerContainer"] .stat-value {
        font-size: 1.15rem;
    }

    body[data-active-section="dangerContainer"] .level-description {
        padding: 14px 12px;
        margin-bottom: 14px;
        border-radius: 16px;
    }

    body[data-active-section="dangerContainer"] .level-description p {
        font-size: 0.96rem;
        line-height: 1.35;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        min-height: clamp(420px, 78vw, 560px);
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 18px;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        max-width: min(84%, 260px);
        min-height: 42px;
        padding: 8px 10px;
        gap: 8px;
        border-radius: 12px;
    }

    body[data-active-section="dangerContainer"] .item-text {
        font-size: 0.82rem;
        line-height: 1.22;
    }

    body[data-active-section="dangerContainer"] .item-icon {
        font-size: 1rem;
        flex-shrink: 0;
    }

    body[data-active-section="dangerContainer"] .feedback-message,
    body[data-active-section="dangerContainer"] .level-complete,
    body[data-active-section="dangerContainer"] .time-up {
        border-radius: 14px;
        padding: 12px;
    }

    body[data-active-section="dangerContainer"] .game-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body[data-active-section="dangerContainer"] .game-controls .btn {
        width: 100%;
        margin: 0;
    }

    .splash-footer {
        width: min(100%, 360px);
        gap: 6px 10px;
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .floating-particles {
        opacity: 0.2;
    }

    .floating-particles .particle:nth-child(n+7) {
        display: none;
    }

    .splash-particle:nth-child(n+15) {
        display: none;
    }

    .splash-footer {
        width: min(100%, 320px);
        padding: 10px 12px;
        gap: 4px 8px;
        font-size: 0.72rem;
    }

    .splash-footer .splash-code-bracket,
    .splash-footer .splash-separator {
        display: none;
    }

    body[data-active-section="dangerContainer"] .spot-danger-game {
        padding: 10px 8px 14px;
    }

    body[data-active-section="dangerContainer"] .game-stats {
        grid-template-columns: 1fr;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        min-height: clamp(440px, 104vw, 620px);
        padding: 10px;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        max-width: min(86%, 220px);
        padding: 7px 9px;
    }

    body[data-active-section="dangerContainer"] .item-text {
        font-size: 0.76rem;
    }
}

@media (max-width: 768px) {
    .splash-screen {
        padding: 16px 14px max(12px, env(safe-area-inset-bottom));
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .splash-content {
        width: min(100%, 440px);
        min-height: calc(100dvh - 32px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 28px 18px 112px;
    }

    .splash-logo {
        width: clamp(180px, 56vw, 280px);
        height: clamp(180px, 56vw, 280px);
        margin-bottom: 24px;
    }

    .splash-title {
        font-size: clamp(2rem, 6.8vw, 2.7rem);
        margin-bottom: 14px;
    }

    .splash-subtitle {
        max-width: 30ch;
        margin-bottom: 26px;
        font-size: clamp(1rem, 2.9vw, 1.16rem);
    }

    .splash-footer {
        position: absolute;
        left: 50%;
        bottom: max(10px, env(safe-area-inset-bottom));
        transform: translateX(-50%);
        width: min(calc(100% - 20px), 370px);
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .splash-content {
        width: min(100%, 390px);
        min-height: calc(100dvh - 20px);
        padding: 22px 14px 104px;
    }

    .splash-logo {
        width: clamp(190px, 62vw, 260px);
        height: clamp(190px, 62vw, 260px);
    }

    .splash-footer {
        width: min(calc(100% - 18px), 332px);
        bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* ===== Override Final Encuentra el Peligro ===== */
.spot-danger-game {
    background:
        radial-gradient(circle at top left, rgba(255, 230, 124, 0.16), transparent 26%),
        radial-gradient(circle at top right, rgba(78, 205, 196, 0.14), transparent 30%),
        linear-gradient(145deg, #071528 0%, #102744 45%, #16365c 100%);
}

.spot-danger-game::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.danger-scene {
    background: linear-gradient(160deg, rgba(7, 15, 27, 0.94), rgba(17, 36, 61, 0.88), rgba(25, 52, 84, 0.9));
}

.danger-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 35%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 34px);
    mix-blend-mode: screen;
    opacity: 0.45;
    pointer-events: none;
}

.danger-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(233, 241, 255, 0.94));
    border-radius: 14px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.danger-item.checked,
.danger-item.checked.is-danger,
.danger-item.checked:not(.is-danger) {
    background: linear-gradient(180deg, rgba(255, 244, 180, 0.98), rgba(255, 216, 109, 0.96));
    border-color: rgba(255, 157, 0, 0.95);
    color: #5b3900;
    box-shadow: 0 10px 24px rgba(255, 171, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transform: scale(1.06);
    pointer-events: auto;
    animation: none;
}

.danger-item.checked .item-text,
.danger-item.checked.is-danger .item-text,
.danger-item.checked:not(.is-danger) .item-text {
    color: #5b3900;
    text-shadow: none;
}

.danger-item.found-danger,
.danger-item.checked.found-danger,
.danger-item.checked.is-danger.found-danger {
    pointer-events: none;
}

.danger-item.wrong-click,
.danger-item.checked.wrong-click,
.danger-item.checked:not(.is-danger).wrong-click {
    pointer-events: none;
    color: white;
}

.danger-item.wrong-click .item-text,
.danger-item.checked.wrong-click .item-text {
    color: white;
}

.danger-item.locked {
    pointer-events: none;
}

.danger-ready-btn {
    min-width: 210px;
    padding: 13px 24px;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-radius: 10px;
    border: 2px solid #6f7782;
    color: #0f2745;
    text-shadow: none;
    background: linear-gradient(180deg, #fdfefe 0%, #dce5ef 48%, #b7c6d6 49%, #e8eef6 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 2px rgba(28, 44, 63, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -2px 0 rgba(111, 119, 130, 0.55);
    animation: readyDialogPulse 2.8s ease-in-out infinite;
}

.danger-ready-btn:hover {
    color: #081a30;
    background: linear-gradient(180deg, #ffffff 0%, #e8eff7 48%, #c4d2df 49%, #f4f7fb 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(83, 148, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 1), inset 0 -2px 0 rgba(111, 119, 130, 0.52);
}

.danger-ready-btn:disabled {
    opacity: 0.78;
    color: #5d6771;
    background: linear-gradient(180deg, #edf1f5 0%, #cbd5df 48%, #b5bec7 49%, #dae1e8 100%);
    transform: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 1px rgba(28, 44, 63, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -2px 0 rgba(111, 119, 130, 0.28);
    animation: none;
}

body[data-active-section="dangerContainer"] .spot-danger-game {
    width: min(100%, 980px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(16px, 2vw, 24px);
    border: 1px solid rgba(122, 194, 220, 0.18);
    box-shadow: 0 14px 34px rgba(0, 8, 20, 0.28);
}

body[data-active-section="dangerContainer"] .spot-danger-game::before,
body[data-active-section="dangerContainer"] .spot-danger-game::after,
body[data-active-section="dangerContainer"] .particles-bg,
body[data-active-section="dangerContainer"] .danger-scene::before,
body[data-active-section="dangerContainer"] .danger-scene::after {
    display: none;
}

body[data-active-section="dangerContainer"] .game-header-info {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 14px;
    align-items: stretch;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(10, 23, 40, 0.96), rgba(19, 47, 73, 0.92));
    border: 1px solid rgba(126, 214, 223, 0.16);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

body[data-active-section="dangerContainer"] .level-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

body[data-active-section="dangerContainer"] .game-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

body[data-active-section="dangerContainer"] .stat-item {
    min-width: 0;
    min-height: 78px;
    justify-content: center;
    padding: 10px 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(88, 171, 185, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-active-section="dangerContainer"] .level-description {
    margin-bottom: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(8, 18, 35, 0.94), rgba(14, 37, 58, 0.9));
    border: 1px solid rgba(126, 214, 223, 0.12);
}

body[data-active-section="dangerContainer"] .danger-scene {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 14px;
    min-height: 0;
    padding: 18px;
    margin-bottom: 0;
    border: 1px solid rgba(126, 214, 223, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: visible;
}

body[data-active-section="dangerContainer"] .danger-item {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100%;
    max-width: none;
    min-height: 74px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(163, 209, 227, 0.3);
    background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(225, 236, 246, 0.96));
    box-shadow: 0 8px 18px rgba(0, 14, 30, 0.16);
    backdrop-filter: none;
    will-change: auto;
    align-items: flex-start;
    z-index: 1;
}

body[data-active-section="dangerContainer"] .item-text {
    line-height: 1.35;
    font-size: 0.98rem;
    text-shadow: none;
}

body[data-active-section="dangerContainer"] .item-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
    margin-top: 1px;
}

body[data-active-section="dangerContainer"] .danger-item:hover:not(.checked) {
    transform: translateY(-2px);
    border-color: rgba(255, 107, 107, 0.55);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(240, 247, 252, 0.98));
    box-shadow: 0 10px 20px rgba(20, 44, 69, 0.18);
}

body[data-active-section="dangerContainer"] .danger-item.checked,
body[data-active-section="dangerContainer"] .danger-item.checked.is-danger,
body[data-active-section="dangerContainer"] .danger-item.checked:not(.is-danger) {
    transform: none;
}

body[data-active-section="dangerContainer"] .feedback-area {
    min-height: 58px;
}

body[data-active-section="dangerContainer"] .feedback-message {
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

body[data-active-section="dangerContainer"] .game-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
    gap: 10px;
}

body[data-active-section="dangerContainer"] .game-controls .btn {
    width: 100%;
    min-height: 50px;
    padding: 11px 12px;
    font-size: 0.92rem;
    line-height: 1.15;
}

body[data-active-section="dangerContainer"] .danger-ready-btn {
    min-width: 0;
}

@keyframes readyDialogPulse {
    0%, 100% {
        transform: translateY(0);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-1px);
        filter: brightness(1.03);
    }
}

@keyframes sceneWarningShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
}

.danger-scene.scene-warning {
    animation: sceneWarningShake 0.35s ease;
}

@media (max-width: 768px) {
    #homeScreen .menu-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 460px);
    }

    #homeScreen .menu-options #btnSettings {
        grid-column: auto;
    }

    body[data-active-section="dangerContainer"] .spot-danger-game {
        padding: 14px 10px 16px;
        gap: 10px;
        border-radius: 20px;
    }

    body[data-active-section="dangerContainer"] .game-header-info {
        grid-template-columns: 1fr;
        padding: 12px 10px;
        gap: 10px;
    }

    body[data-active-section="dangerContainer"] .game-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    body[data-active-section="dangerContainer"] .stat-item {
        min-height: 62px;
        padding: 8px 6px;
    }

    body[data-active-section="dangerContainer"] .stat-label {
        font-size: 0.64rem;
        line-height: 1.1;
        text-align: center;
    }

    body[data-active-section="dangerContainer"] .stat-value {
        font-size: 1rem;
        line-height: 1;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 0;
        padding: 10px;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        min-height: 66px;
        padding: 12px 12px;
    }

    body[data-active-section="dangerContainer"] .level-description {
        padding: 12px 10px;
    }

    body[data-active-section="dangerContainer"] .level-description p {
        font-size: 0.92rem;
        line-height: 1.28;
    }

    body[data-active-section="dangerContainer"] .feedback-area {
        min-height: 50px;
    }

    body[data-active-section="dangerContainer"] .feedback-message {
        padding: 10px 12px;
        gap: 10px;
        font-size: 0.92rem;
    }

    body[data-active-section="dangerContainer"] .feedback-icon {
        font-size: 1.35rem;
    }

    body[data-active-section="dangerContainer"] .game-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        margin-top: 0;
        gap: 8px;
    }

    body[data-active-section="dangerContainer"] .game-controls .btn {
        width: 100%;
        min-height: 46px;
        font-size: 0.84rem;
        padding: 10px 8px;
        line-height: 1.15;
    }

    body[data-active-section="dangerContainer"] .danger-ready-btn {
        grid-column: 1 / -1;
        min-height: 58px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    #homeScreen .menu-options {
        grid-template-columns: 1fr;
        width: min(100%, 320px);
    }

    body[data-active-section="dangerContainer"] .game-controls {
        grid-template-columns: 1fr;
        position: static;
        padding: 4px 0 calc(env(safe-area-inset-bottom) + 6px);
        background: none;
    }

    body[data-active-section="dangerContainer"] .game-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body[data-active-section="dangerContainer"] .stat-item:first-child {
        grid-column: 1 / -1;
        min-height: 58px;
    }

    body[data-active-section="dangerContainer"] .danger-scene {
        min-height: 0;
        padding: 8px;
    }

    body[data-active-section="dangerContainer"] .danger-item {
        min-height: 62px;
        padding: 11px 10px;
    }

    body[data-active-section="dangerContainer"] .danger-ready-btn {
        order: -1;
        min-height: 62px;
        font-size: 0.98rem;
    }

    body[data-active-section="dangerContainer"] .game-controls .btn {
        min-height: 44px;
        font-size: 0.82rem;
    }
}

/* Canvas responsive universal */
canvas {
    max-width: 100%;
    height: auto;
}

@media (max-width: 360px) {
    .logo-right {
        display: none;
    }

    .header-content {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .header-logo {
        height: 34px;
        max-width: 64px;
    }

    .header-title h1 {
        font-size: 0.96em;
        justify-content: flex-start;
        text-align: left;
    }

    .hero {
        padding-bottom: 14px;
    }

    .hero h1 {
        font-size: 1.85em;
        gap: 10px;
    }

    .subtitle {
        font-size: 0.88rem;
        margin-bottom: 18px;
    }

    .player-info {
        padding: 14px 12px;
        margin-top: 14px;
    }

    .menu-options {
        grid-template-columns: 1fr;
        max-width: 280px;
        gap: 8px;
    }

    .menu-options #btnSettings {
        grid-column: auto;
        max-width: none;
    }
}

@media (orientation: portrait) and (max-width: 1024px) {
    body.mobile-touch-device[data-active-section="runnerContainer"] .landscape-lock-overlay.active,
    body.mobile-touch-device[data-active-section="platformerContainer"] .landscape-lock-overlay.active {
        display: flex;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    body.mobile-touch-device:not(.runner-playing) {
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-touch-device:not(.heavy-gameplay-mode) .container,
    body.mobile-touch-device:not(.heavy-gameplay-mode) .screen.active {
        overflow: visible;
    }

    body.mobile-touch-device:not(.heavy-gameplay-mode) #homeScreen,
    body.mobile-touch-device:not(.heavy-gameplay-mode) #leaderboardScreen,
    body.mobile-touch-device:not(.heavy-gameplay-mode) #tournamentScreen,
    body.mobile-touch-device:not(.heavy-gameplay-mode) #instructionsScreen {
        min-height: max-content;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .game-content {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-game {
        min-height: max-content;
        overflow: visible;
        padding: 0;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 108px;
        grid-template-rows: auto auto auto;
        align-items: start;
        gap: 10px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
        margin: 0;
        grid-column: 1 / -1;
        grid-row: 1;
        padding: 8px 10px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] #runnerCanvas {
        width: 100% !important;
        min-height: clamp(240px, 52vw, 420px);
        max-height: none;
        border: 2px solid rgba(0, 235, 170, 0.7);
        border-radius: 12px;
        box-shadow: 0 0 0 1px rgba(0, 235, 170, 0.18), 0 12px 28px rgba(0, 0, 0, 0.28);
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage {
        min-height: auto;
        grid-column: 1;
        grid-row: 2 / span 2;
        align-self: start;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-controls {
        width: 100%;
        max-width: none;
        margin-top: 0;
        grid-column: 1;
        grid-row: 3;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
        left: auto;
        right: auto;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions {
        grid-column: 2;
        grid-row: 2;
        position: sticky;
        top: clamp(36px, 10vh, 72px);
        align-self: center;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        width: 108px;
        margin: 0;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-message {
        bottom: 10px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.76rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn {
        min-height: 56px;
        font-size: 1.2rem;
    }

    body[data-active-section="quizContainer"] .tv-options-grid,
    body[data-active-section="memoryContainer"] .memory-board {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (orientation: landscape) and (max-width: 667px) {
    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-shell {
        grid-template-columns: minmax(0, 1fr) 92px;
        gap: 8px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
        padding: 7px 8px;
        gap: 6px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item {
        font-size: 0.74rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] #runnerCanvas {
        min-height: clamp(210px, 50vw, 290px);
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions {
        width: 92px;
        gap: 6px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        width: 100%;
        padding: 8px 6px;
        font-size: 0.68rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn {
        min-height: 48px;
        font-size: 1rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn span {
        font-size: 0.66rem;
    }
}

@media (orientation: landscape) and (min-width: 668px) and (max-width: 844px) {
    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-shell {
        grid-template-columns: minmax(0, 1fr) 104px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] #runnerCanvas {
        min-height: clamp(230px, 50vw, 360px);
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions {
        width: 104px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        width: 100%;
        padding: 9px 8px;
        font-size: 0.74rem;
    }
}

@media (orientation: landscape) and (min-width: 845px) and (max-width: 1024px) {
    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-shell {
        grid-template-columns: minmax(0, 1fr) 124px;
        gap: 12px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
        padding: 9px 12px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item {
        font-size: 0.84rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] #runnerCanvas {
        min-height: clamp(280px, 44vw, 430px);
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions {
        width: 124px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions .btn {
        width: 100%;
        padding: 10px 10px;
        font-size: 0.8rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn {
        min-height: 60px;
        font-size: 1.25rem;
    }
}
    body[data-active-section="dangerContainer"] .danger-scene {
        min-height: calc(100dvh - 200px);
    }

@media screen and (min-width: 960px) and (min-height: 600px) {
    body[data-active-section="scenarioContainer"] #scenarioContainer.active {
        min-height: calc(100dvh - 106px) !important;
        padding: 8px 16px 14px !important;
        align-items: center !important;
        overflow: hidden !important;
    }

    body[data-active-section="scenarioContainer"] .game-content {
        overflow: visible !important;
    }

    body[data-active-section="scenarioContainer"] #scenarioContainer.active,
    body[data-active-section="scenarioContainer"] .scenario-container {
        gap: 0 !important;
        padding: 0 !important;
        max-width: 1240px !important;
        min-height: calc(100dvh - 106px) !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body[data-active-section="scenarioContainer"] .phone-simulator {
        min-height: calc(100dvh - 106px) !important;
        padding: 0 !important;
        align-items: center !important;
    }

    body[data-active-section="scenarioContainer"] .phone-frame {
        width: 384px !important;
        max-width: 384px !important;
        min-width: 384px !important;
        aspect-ratio: 9 / 19.5 !important;
        min-height: min(832px, calc(100dvh - 104px)) !important;
        height: min(832px, calc(100dvh - 104px)) !important;
        max-height: min(832px, calc(100dvh - 104px)) !important;
        border-radius: 34px !important;
        animation: none !important;
        transform: none !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
        box-shadow:
            0 24px 60px rgba(0, 0, 0, 0.6),
            inset 0 0 0 7px #252525,
            inset 0 0 0 11px #141414,
            inset 0 1px 2px rgba(255, 255, 255, 0.08) !important;
    }

    body[data-active-section="scenarioContainer"] .phone-frame::before {
        display: none !important;
    }

    body[data-active-section="scenarioContainer"] .chat-header {
        padding: 16px 18px !important;
    }

    body[data-active-section="scenarioContainer"] .phone-status-bar,
    body[data-active-section="scenarioContainer"] .status-time,
    body[data-active-section="scenarioContainer"] .status-icons,
    body[data-active-section="scenarioContainer"] .contact-name,
    body[data-active-section="scenarioContainer"] .contact-status,
    body[data-active-section="scenarioContainer"] .message-bubble,
    body[data-active-section="scenarioContainer"] .message-time,
    body[data-active-section="scenarioContainer"] .scenario-progress,
    body[data-active-section="scenarioContainer"] .scenario-score {
        font-family: Arial, Helvetica, sans-serif !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
        text-shadow: none !important;
        letter-spacing: 0 !important;
    }

    body[data-active-section="scenarioContainer"] .phone-status-bar {
        font-size: 12px !important;
        line-height: 16px !important;
        font-weight: 700 !important;
    }

    body[data-active-section="scenarioContainer"] .status-icons {
        font-size: 12px !important;
    }

    body[data-active-section="scenarioContainer"] .contact-name {
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 18px !important;
        line-height: 22px !important;
        font-weight: 700 !important;
    }

    body[data-active-section="scenarioContainer"] .contact-status {
        font-size: 12px !important;
        line-height: 16px !important;
        font-weight: 700 !important;
    }

    body[data-active-section="scenarioContainer"] .chat-messages {
        padding: 18px 20px 2px !important;
        background: #13253c !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
    }

    body[data-active-section="scenarioContainer"] .chat-message {
        margin-bottom: 14px !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    body[data-active-section="scenarioContainer"] .chat-message:last-child {
        margin-bottom: 4px !important;
    }

    body[data-active-section="scenarioContainer"] .message-bubble,
    body[data-active-section="scenarioContainer"] .chat-message.me .message-bubble,
    body[data-active-section="scenarioContainer"] .chat-message.them .message-bubble {
        max-width: min(84%, 420px) !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 16px !important;
        line-height: 22px !important;
        font-weight: 700 !important;
        animation: none !important;
        transform: none !important;
        filter: none !important;
        backdrop-filter: none !important;
        background-image: none !important;
    }

    body[data-active-section="scenarioContainer"] .chat-message.them .message-bubble {
        background-color: #2a3c50 !important;
    }

    body[data-active-section="scenarioContainer"] .chat-message.me .message-bubble,
    body[data-active-section="scenarioContainer"] .me-bubble {
        background-color: #1565a5 !important;
    }

    body[data-active-section="scenarioContainer"] .message-time {
        font-size: 11px !important;
        line-height: 14px !important;
        font-weight: 700 !important;
        opacity: 0.92 !important;
    }

    body[data-active-section="scenarioContainer"] .typing-indicator {
        padding: 0 18px 0 !important;
        background: #13253c !important;
    }

    body[data-active-section="scenarioContainer"] .chat-choices {
        margin-top: -12px !important;
        padding: 4px 12px 0 !important;
        background: #153455 !important;
        transform: none !important;
        transition: max-height 0.2s ease, opacity 0.15s ease, padding 0.15s ease !important;
        filter: none !important;
        backdrop-filter: none !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
    }

    body[data-active-section="scenarioContainer"] .chat-choices.slide-up {
        padding-top: 4px !important;
        padding-bottom: 10px !important;
        max-height: min(35dvh, 320px) !important;
        border-top: 0 !important;
        box-shadow: none !important;
    }

    body[data-active-section="scenarioContainer"] .choices-title {
        margin-bottom: 5px !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 16px !important;
        opacity: 1 !important;
    }

    body[data-active-section="scenarioContainer"] .choice-bubble,
    body[data-active-section="scenarioContainer"] .choice-bubble:hover,
    body[data-active-section="scenarioContainer"] .choice-bubble:active {
        margin-bottom: 7px !important;
        padding: 12px 14px !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 20px !important;
        letter-spacing: 0 !important;
        transform: none !important;
        filter: none !important;
        backdrop-filter: none !important;
        text-rendering: auto !important;
        -webkit-font-smoothing: auto !important;
        background: #134a7a !important;
        color: #f4fbff !important;
        border-color: rgba(33, 150, 243, 0.22) !important;
        box-shadow: none !important;
        text-shadow: none !important;
        transition: background 0.14s ease, border-color 0.14s ease !important;
    }

    body[data-active-section="scenarioContainer"] .choice-bubble::before {
        display: none !important;
    }

    body[data-active-section="scenarioContainer"] .scenario-progress,
    body[data-active-section="scenarioContainer"] .scenario-score {
        font-size: 11px !important;
        line-height: 14px !important;
        font-weight: 700 !important;
    }
}

/* ===== Ajustes Finales Home / Hostinger ===== */
.main-header {
    background: linear-gradient(135deg, rgba(7, 17, 31, 0.94) 0%, rgba(15, 52, 96, 0.9) 100%);
    border-bottom: 1px solid rgba(78, 205, 196, 0.18);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: minmax(88px, 112px) minmax(0, 1fr) minmax(88px, 112px);
    gap: clamp(12px, 2vw, 24px);
    padding: 12px clamp(14px, 3vw, 26px);
}

.header-title h1 {
    font-size: clamp(1.1rem, 1vw + 0.9rem, 1.7rem);
    letter-spacing: 0.02em;
}

#homeScreen .player-info {
    background: linear-gradient(180deg, rgba(15, 52, 96, 0.95) 0%, rgba(9, 24, 44, 0.98) 100%);
    border: 1px solid rgba(78, 205, 196, 0.16);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

#homeScreen .menu-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    width: min(100%, 760px);
    margin: 24px auto 0;
    align-items: stretch;
}

#homeScreen .menu-options .btn {
    width: 100%;
    min-width: 0;
    min-height: 62px;
    margin: 0;
    padding: 14px 18px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    font-size: 0.95rem;
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.34), 0 14px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    animation: homeMenuReveal 0.46s ease both;
}

#homeScreen .menu-options .btn:nth-child(1) { animation-delay: 0.04s; }
#homeScreen .menu-options .btn:nth-child(2) { animation-delay: 0.1s; }
#homeScreen .menu-options .btn:nth-child(3) { animation-delay: 0.16s; }
#homeScreen .menu-options .btn:nth-child(4) { animation-delay: 0.22s; }

#homeScreen .menu-options #btnSettings {
    grid-column: auto;
    max-width: none;
    justify-self: stretch;
}

@keyframes homeMenuReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-footer {
    padding: 18px 0 22px;
    border-top: 2px solid rgba(78, 205, 196, 0.22);
}

.footer-content {
    display: flex;
    justify-content: center;
}

.developer-badge {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 14px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(12, 23, 42, 0.88), rgba(18, 49, 82, 0.74));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 28px rgba(0, 0, 0, 0.22);
    gap: 10px 14px;
}

.code-bracket {
    font-size: 1.85em;
}

.dev-text,
.dev-title,
.copyright {
    text-align: center;
}

.separator {
    opacity: 0.4;
}

body[data-active-section="memoryContainer"] .memory-game-container {
    width: min(100%, 920px);
    padding: clamp(10px, 3vw, 18px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

body[data-active-section="memoryContainer"] .memory-stats {
    gap: 12px;
    margin-bottom: 6px;
}

body[data-active-section="memoryContainer"] .memory-stat {
    padding: 12px 16px;
}

body[data-active-section="memoryContainer"] .memory-board {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(8px, 1.8vw, 14px) !important;
    width: min(100%, 720px) !important;
    max-width: 720px !important;
    margin: 0 auto 8px !important;
}

body[data-active-section="memoryContainer"] .memory-card-front,
body[data-active-section="memoryContainer"] .memory-card-back {
    padding: clamp(8px, 1.8vw, 12px);
    border-radius: 14px;
}

body[data-active-section="memoryContainer"] .card-emoji {
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    margin-bottom: 6px;
}

body[data-active-section="memoryContainer"] .card-name {
    font-size: clamp(0.58rem, 1.5vw, 0.82rem);
    line-height: 1.15;
}

body[data-active-section="memoryContainer"] .memory-controls {
    position: static;
    margin-top: 4px;
    padding: 0;
    background: none;
    backdrop-filter: none;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 24px;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-shell {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
    order: 1;
    margin: 0;
    padding: 10px 12px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(47, 60, 60, 0.92) 0%, rgba(26, 35, 37, 0.96) 100%);
    border: 1px solid rgba(196, 212, 205, 0.2);
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(56px, auto);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    line-height: 1.25;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item strong {
    display: block;
    margin-top: 4px;
    font-size: 0.92rem;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item-boss {
    display: block;
    grid-column: 1 / -1;
    min-height: 56px;
    visibility: hidden;
    opacity: 0.45;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item-boss.is-active {
    visibility: visible;
    opacity: 1;
    border-color: rgba(255, 107, 107, 0.34);
    background: linear-gradient(180deg, rgba(129, 30, 30, 0.34) 0%, rgba(74, 14, 14, 0.24) 100%);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage {
    order: 2;
    min-height: auto;
    position: relative;
    padding: 18px 16px 14px;
    border-radius: 28px 28px 22px 22px;
    background: linear-gradient(180deg, #c7cfbf 0%, #9fa995 100%);
    border: 1px solid rgba(34, 45, 40, 0.26);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.72), 0 18px 34px rgba(0, 0, 0, 0.24);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage::before {
    content: '';
    position: absolute;
    inset: 10px 10px auto;
    height: calc(100% - 20px);
    border-radius: 22px 22px 16px 16px;
    background: linear-gradient(180deg, rgba(88, 95, 91, 0.96) 0%, rgba(44, 50, 47, 0.98) 100%);
    z-index: 0;
}

body.mobile-touch-device[data-active-section="runnerContainer"] #runnerCanvas {
    width: 100% !important;
    min-height: clamp(250px, 62vw, 380px);
    margin: 0 auto;
    position: relative;
    z-index: 1;
    border: 10px solid #45504b;
    border-radius: 14px;
    background: #95a584;
    box-shadow: inset 0 0 0 2px rgba(207, 224, 190, 0.22), 0 14px 30px rgba(0, 0, 0, 0.24);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-stage-message {
    bottom: 10px;
    z-index: 2;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions {
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 0;
    align-items: stretch;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-quick-actions .btn {
    width: 100%;
    margin: 0;
    min-height: 48px;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-controls {
    order: 4;
    margin-bottom: 0;
    display: none;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-mobile-console {
    order: 5;
    width: 100%;
    position: relative;
    padding: 16px 16px 22px;
    border-radius: 24px 24px 38px 24px;
    background: linear-gradient(180deg, #d7dfca 0%, #a9b39d 100%);
    border: 1px solid rgba(38, 47, 41, 0.26);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.72), 0 18px 30px rgba(0, 0, 0, 0.18);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-mobile-console::after {
    content: '';
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 18px;
    border-radius: 999px;
    background: repeating-linear-gradient(90deg, rgba(76, 86, 78, 0.26) 0 4px, rgba(76, 86, 78, 0) 4px 8px);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-inline: 4px;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-brand {
    color: #38453e;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-led {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #ffec9c 0%, #ff6a3d 45%, #9b2617 100%);
    box-shadow: 0 0 10px rgba(255, 106, 61, 0.6);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 132px);
    gap: 14px;
    width: 100%;
    margin: 0;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn {
    min-height: 72px;
    color: #f8fbf5;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-dpad {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-action-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-actions {
    order: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0 0 14px;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-actions .btn {
    min-height: 46px;
    min-width: 0;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    line-height: 1.1;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn-dpad {
    background: linear-gradient(180deg, #4c5652 0%, #2a302d 100%);
    border-radius: 18px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn-console-action {
    min-width: 110px;
    min-height: 110px;
    border-radius: 999px;
    background: linear-gradient(180deg, #a43463 0%, #712145 100%);
    font-size: 1.9rem;
    letter-spacing: 0.06em;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28), inset 0 3px 0 rgba(255, 255, 255, 0.16);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn-console-action span {
    font-size: 0.74rem;
    min-height: 0.9rem;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn:disabled {
    opacity: 0.72;
    filter: grayscale(0.1);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn[data-action="shoot"]:not(:disabled) {
    box-shadow: 0 0 0 3px rgba(255, 236, 156, 0.16), 0 12px 22px rgba(0, 0, 0, 0.28), inset 0 3px 0 rgba(255, 255, 255, 0.16);
}

body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item,
body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-top,
body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-actions .btn,
body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn span {
    text-transform: uppercase;
}

body.mobile-touch-device[data-active-section="runnerContainer"] .landscape-lock-overlay,
body.mobile-touch-device[data-active-section="runnerContainer"] .landscape-lock-overlay.active {
    display: none !important;
}

@media (max-width: 768px) {
    #homeScreen .menu-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 460px);
        gap: 10px;
        margin-top: 18px;
    }

    #homeScreen .menu-options .btn {
        min-height: 52px;
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .developer-badge {
        padding: 14px 16px;
    }
}

@media (max-width: 540px) {
    #homeScreen .menu-options {
        grid-template-columns: 1fr;
        width: min(100%, 320px);
    }

    #homeScreen .menu-options #btnSettings {
        max-width: none;
    }

    .developer-badge {
        gap: 6px;
    }

    .code-bracket,
    .separator {
        display: none;
    }

    body[data-active-section="memoryContainer"] .memory-board {
        gap: 7px !important;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-controls {
        grid-template-columns: 1fr;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info {
        grid-template-columns: 1fr 1fr;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item-boss {
        min-height: 52px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-console-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-dpad {
        grid-template-columns: 1fr 1fr;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-action-cluster {
        justify-content: flex-start;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .touch-btn-console-action {
        width: 100%;
        min-width: 0;
        min-height: 82px;
        border-radius: 22px;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item {
        padding: 8px;
        font-size: 0.72rem;
    }

    body.mobile-touch-device[data-active-section="runnerContainer"] .runner-info .info-item strong {
        font-size: 0.84rem;
    }
}

/* ===== Ajustes Finales Quiz Movil ===== */
body[data-active-section="quizContainer"] .tv-quiz-container {
    width: min(100%, 940px);
}

@media (max-width: 768px) {
    body[data-active-section="quizContainer"] .tv-quiz-container {
        padding: 14px 12px 18px;
        border-radius: 18px;
        min-height: auto;
    }

    body[data-active-section="quizContainer"] .tv-header {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        padding: 14px 14px 16px;
        margin-bottom: 14px;
        border-radius: 16px;
    }

    body[data-active-section="quizContainer"] .tv-logo {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    body[data-active-section="quizContainer"] .tv-icon {
        font-size: 1.8rem;
    }

    body[data-active-section="quizContainer"] .tv-title {
        font-size: 1rem;
        letter-spacing: 0.08em;
        line-height: 1.15;
    }

    body[data-active-section="quizContainer"] .tv-score {
        align-items: center;
    }

    body[data-active-section="quizContainer"] .score-label {
        font-size: 0.72rem;
    }

    body[data-active-section="quizContainer"] .score-value {
        font-size: 1.45rem;
    }

    body[data-active-section="quizContainer"] .tv-timer-container {
        display: grid;
        grid-template-columns: auto auto 1fr;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 12px;
        margin-bottom: 12px;
        border-radius: 14px;
    }

    body[data-active-section="quizContainer"] .timer-label {
        font-size: 0.82rem;
    }

    body[data-active-section="quizContainer"] .timer-display {
        min-width: auto;
        font-size: 1.35rem;
        justify-self: start;
    }

    body[data-active-section="quizContainer"] .timer-bar {
        grid-column: 1 / -1;
        height: 10px;
    }

    body[data-active-section="quizContainer"] .tv-progress {
        margin-bottom: 12px;
        font-size: 0.86rem;
    }

    body[data-active-section="quizContainer"] .tv-host-section {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        margin-bottom: 14px;
    }

    body[data-active-section="quizContainer"] .host-character {
        min-width: 0;
        gap: 6px;
    }

    body[data-active-section="quizContainer"] .host-avatar-large {
        font-size: 2.4rem;
        padding: 10px;
        border-width: 3px;
    }

    body[data-active-section="quizContainer"] .host-name {
        font-size: 0.72rem;
        line-height: 1.1;
    }

    body[data-active-section="quizContainer"] .question-bubble {
        padding: 14px 14px 14px 16px;
        border-radius: 16px;
    }

    body[data-active-section="quizContainer"] .question-bubble::before {
        display: none;
    }

    body[data-active-section="quizContainer"] .bubble-content {
        font-size: 0.98rem;
        line-height: 1.42;
    }

    body[data-active-section="quizContainer"] .tv-options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    body[data-active-section="quizContainer"] .tv-option-btn {
        min-height: 68px;
        padding: 12px 12px 12px 10px;
        gap: 10px;
        border-radius: 14px;
        align-items: flex-start;
    }

    body[data-active-section="quizContainer"] .option-letter {
        width: 38px;
        height: 38px;
        font-size: 1.15rem;
        margin-top: 2px;
    }

    body[data-active-section="quizContainer"] .option-text {
        font-size: 0.94rem;
        line-height: 1.32;
    }

    body[data-active-section="quizContainer"] .tv-explanation {
        margin-top: 10px;
    }

    body[data-active-section="quizContainer"] .host-speech {
        gap: 10px;
        align-items: stretch;
    }

    body[data-active-section="quizContainer"] .host-avatar {
        font-size: 2.4rem;
        flex-shrink: 0;
    }

    body[data-active-section="quizContainer"] .speech-bubble {
        padding: 14px;
        border-radius: 14px;
    }

    body[data-active-section="quizContainer"] .speech-bubble strong {
        font-size: 1.02rem;
        margin-bottom: 8px;
    }

    body[data-active-section="quizContainer"] .speech-bubble p {
        font-size: 0.92rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    body[data-active-section="quizContainer"] .correct-answer-label {
        padding: 10px 12px;
        margin: 10px 0;
        font-size: 0.94rem !important;
    }

    body[data-active-section="quizContainer"] .tv-controls {
        margin-top: 10px;
        padding-top: 8px;
    }

    body[data-active-section="quizContainer"] .tv-controls .btn {
        width: min(100%, 240px);
        min-height: 46px;
    }

    body[data-active-section="quizContainer"] .results-header {
        margin-bottom: 18px;
    }

    body[data-active-section="quizContainer"] .results-icon {
        font-size: 3.2rem;
        margin-bottom: 8px;
    }

    body[data-active-section="quizContainer"] .results-title {
        font-size: 1.5rem;
        line-height: 1.15;
    }

    body[data-active-section="quizContainer"] .results-stats {
        gap: 10px;
        margin-bottom: 16px;
    }

    body[data-active-section="quizContainer"] .stat-card {
        width: 100%;
        min-width: 0;
        padding: 16px 14px;
    }

    body[data-active-section="quizContainer"] .stat-value {
        font-size: 1.7rem;
    }

    body[data-active-section="quizContainer"] .stat-label {
        font-size: 0.86rem;
    }

    body[data-active-section="quizContainer"] .host-final-message {
        gap: 12px;
        padding: 16px 14px;
        margin-bottom: 16px;
        border-radius: 16px;
    }

    body[data-active-section="quizContainer"] .final-speech-bubble p {
        font-size: 0.95rem;
        line-height: 1.42;
    }

    body[data-active-section="quizContainer"] .results-actions,
    body[data-active-section="quizContainer"] .game-over-actions {
        gap: 10px;
    }

    body[data-active-section="quizContainer"] .results-actions .btn,
    body[data-active-section="quizContainer"] .game-over-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    body[data-active-section="quizContainer"] .tv-quiz-container {
        padding: 10px 10px 16px;
        border-radius: 14px;
    }

    body[data-active-section="quizContainer"] .tv-header {
        padding: 12px 10px 14px;
    }

    body[data-active-section="quizContainer"] .tv-title {
        font-size: 0.92rem;
        letter-spacing: 0.05em;
    }

    body[data-active-section="quizContainer"] .tv-timer-container {
        grid-template-columns: 1fr auto;
    }

    body[data-active-section="quizContainer"] .timer-label {
        justify-self: start;
    }

    body[data-active-section="quizContainer"] .timer-display {
        font-size: 1.2rem;
    }

    body[data-active-section="quizContainer"] .tv-host-section {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 8px;
    }

    body[data-active-section="quizContainer"] .host-avatar-large {
        font-size: 2rem;
        padding: 8px;
    }

    body[data-active-section="quizContainer"] .host-name {
        font-size: 0.64rem;
    }

    body[data-active-section="quizContainer"] .question-bubble {
        padding: 12px;
    }

    body[data-active-section="quizContainer"] .bubble-content {
        font-size: 0.92rem;
    }

    body[data-active-section="quizContainer"] .tv-option-btn {
        min-height: 62px;
        padding: 10px;
        gap: 8px;
    }

    body[data-active-section="quizContainer"] .option-letter {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    body[data-active-section="quizContainer"] .option-text {
        font-size: 0.88rem;
    }

    body[data-active-section="quizContainer"] .host-speech {
        gap: 8px;
    }

    body[data-active-section="quizContainer"] .host-avatar {
        font-size: 2rem;
    }

    body[data-active-section="quizContainer"] .speech-bubble {
        padding: 12px;
    }

    body[data-active-section="quizContainer"] .speech-bubble p,
    body[data-active-section="quizContainer"] .final-speech-bubble p {
        font-size: 0.88rem;
    }
}