:root {
    --corredor-header-h: 100px;
    --player-size: clamp(36px, 5.5vh, 52px);
    --question-size: clamp(52px, 8vh, 76px);
    --obstacle-size: clamp(44px, 6.5vh, 64px);
    --player-bottom: clamp(88px, 16vh, 130px);
    --brand-primary: #667eea;
    --brand-secondary: #764ba2;
    --brand-accent: var(--brand-accent);
    --brand-player: #FF6B6B;
    --brand-player-dark: #EE5A24;
    --brand-genio: #4ECDC4;
    --brand-question: var(--brand-accent);
    --brand-question-border: #FFA500;
    --brand-bg-from: #667eea;
    --brand-bg-to: #764ba2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--brand-bg-from) 0%, var(--brand-bg-to) 100%);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

#game-container {
    width: 100%;
    max-width: 1200px;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Pantalla de inicio */
.logo-start {
    max-width: 200px;
    max-height: 120px;
    width: auto;
    height: auto;
    margin-bottom: 20px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

#start-screen h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#start-screen h2 {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.player-selection {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.player-btn {
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#corredor-btn {
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    color: white;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-player) 30%, transparent);
}

#corredor-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(255, 107, 107, 0.4);
}

#genio-btn {
    background: linear-gradient(45deg, var(--brand-genio), #44a08d);
    color: white;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-genio) 30%, transparent);
}

#genio-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(78, 205, 196, 0.4);
}

.start-actions {
    margin-top: 30px;
}

/* Botón de pantalla completa */
.fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
    min-width: 220px;
}

.fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    background: linear-gradient(45deg, #45a049, #4CAF50);
}

.fullscreen-btn:active {
    transform: translateY(0);
}

.fullscreen-btn.is-active {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.35);
}

.fullscreen-btn-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Modo pantalla completa cuando el navegador no expone la Fullscreen API (p. ej. iOS) */
html.pseudo-fullscreen,
html.pseudo-fullscreen body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    inset: 0;
    overscroll-behavior: none;
}

html.pseudo-fullscreen #game-container {
    max-width: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
}

/* ===== INTERFAZ DEL CORREDOR MEJORADA ===== */

/* Header compacto y moderno del corredor */
#corredor-screen {
    padding: 0;
    justify-content: stretch;
    align-items: stretch;
    height: 100%;
}

.corredor-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    height: var(--corredor-header-h);
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    z-index: 100;
}

.corredor-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.corredor-hint {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--brand-accent);
    text-shadow: 0 1px 4px rgba(0,0,0,0.45);
    white-space: nowrap;
}

.logo-header {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.corredor-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 12px 18px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    min-width: 120px;
}

.stat-card:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #FFFFFF;
}

.timer-card .stat-value {
    color: var(--brand-accent);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#game-area {
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
    position: relative;
    background:
        linear-gradient(180deg, #4b6cb7 0%, #1f3b6e 42%, #0d2a24 100%);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    outline: none;
    margin-top: 0;
    animation: none;
}

/* Efectos de fondo dinámicos */
#game-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(173, 216, 230, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 224, 0.2) 0%, transparent 50%);
    animation: backgroundParticles 15s linear infinite;
    pointer-events: none;
}

#game-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 25%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.1) 100%);
    animation: backgroundShimmer 8s ease-in-out infinite;
    pointer-events: none;
}

#game-area:focus {
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 0 3px rgba(255, 107, 107, 0.5);
}

#platforms-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
}

.column {
    flex: 1;
    position: relative;
    border-right: 2px dashed rgba(255,255,255,0.22);
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.12) 100%);
    cursor: pointer;
}

.column:nth-child(2) {
    background: linear-gradient(180deg, rgba(255,215,0,0.08) 0%, rgba(0,0,0,0.16) 100%);
}

.column:last-child {
    border-right: none;
}

.platform {
    position: absolute;
    width: var(--obstacle-size);
    height: var(--obstacle-size);
    background: linear-gradient(180deg, #ff6b5b, #c0392b);
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(255, 68, 68, 0.45);
    border: 3px solid #8b1e12;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.platform.special {
    background: linear-gradient(180deg, #ffb347, #e67e22);
    border-color: #c45c12;
}

.question-item {
    position: absolute;
    width: var(--question-size);
    height: var(--question-size);
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-question);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--question-size) * 0.55);
    font-weight: bold;
    color: #333;
    border: 3px solid var(--brand-question-border);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.55);
    animation: questionGlow 1.6s ease-in-out infinite;
    z-index: 15;
    pointer-events: none;
}

@keyframes questionGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.45); }
    50% { box-shadow: 0 0 22px rgba(255, 215, 0, 0.95); }
}

#capture-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--player-bottom);
    height: calc(var(--player-size) + 20px);
    pointer-events: none;
    z-index: 4;
    border-top: 2px dashed rgba(255, 215, 0, 0.55);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.12), rgba(255, 215, 0, 0));
}

#lane-controls {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 30;
}

#lane-controls button {
    min-width: 68px;
    min-height: 44px;
    border: 2px solid rgba(255,255,255,0.45);
    border-radius: 12px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
}

#lane-controls button.active {
    background: rgba(255, 215, 0, 0.4);
    border-color: var(--brand-accent);
}

@keyframes dangerPulse {
    0%, 100% { 
        box-shadow: 0 6px 12px rgba(255, 68, 68, 0.6);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 16px rgba(255, 68, 68, 0.8);
        transform: scale(1.02);
    }
}


@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-52%); }
    20%, 40%, 60%, 80% { transform: translateX(-48%); }
}

@keyframes dramaticShake {
    0%, 100% { 
        transform: translateX(-50%) translateY(0) rotate(0deg); 
    }
    10% { 
        transform: translateX(-55%) translateY(-5px) rotate(-5deg); 
    }
    20% { 
        transform: translateX(-45%) translateY(5px) rotate(5deg); 
    }
    30% { 
        transform: translateX(-60%) translateY(-8px) rotate(-8deg); 
    }
    40% { 
        transform: translateX(-40%) translateY(8px) rotate(8deg); 
    }
    50% { 
        transform: translateX(-65%) translateY(-10px) rotate(-10deg); 
    }
    60% { 
        transform: translateX(-35%) translateY(10px) rotate(10deg); 
    }
    70% { 
        transform: translateX(-50%) translateY(0) rotate(0deg); 
    }
    80% { 
        transform: translateX(-45%) translateY(-3px) rotate(-2deg); 
    }
    90% { 
        transform: translateX(-55%) translateY(3px) rotate(2deg); 
    }
}

@keyframes flashEffect {
    0% { 
        background: rgba(255, 0, 0, 0.3);
        opacity: 1;
    }
    50% { 
        background: rgba(255, 0, 0, 0.6);
        opacity: 1;
    }
    100% { 
        background: rgba(255, 0, 0, 0);
        opacity: 0;
    }
}

@keyframes crashTextEffect {
    0% { 
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    40% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    60% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    80% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

@keyframes pointsLossEffect {
    0% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        color: #ff4444;
    }
    20% { 
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
        color: #ff6666;
    }
    40% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        color: #ff8888;
    }
    60% { 
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
        color: #ffaaaa;
    }
    80% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
        color: #ffcccc;
    }
    100% { 
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        color: #ffeeee;
    }
}

@keyframes pointsGainedEffect {
    0% { 
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
    }
    20% { 
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
    40% { 
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    60% { 
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
    80% { 
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }
    100% { 
        transform: translateX(-50%) scale(0.9);
        opacity: 0;
    }
}

#corredor-player {
    position: absolute;
    width: var(--player-size);
    height: var(--player-size);
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    bottom: var(--player-bottom);
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: left 0.18s ease;
    animation: playerGlow 2s infinite;
    pointer-events: none;
}

/* Llamas de cohete - esferas súper rápidas y densas */
#corredor-player .trail-sphere {
    position: absolute;
    top: 20px;
    left: 50%;
    width: 22px;
    height: 22px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame3 0.6s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player .trail-sphere-2 {
    position: absolute;
    top: 25px;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame4 0.7s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player .trail-sphere-3 {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 18px;
    height: 18px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame5 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player .trail-sphere-4 {
    position: absolute;
    top: 35px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame6 0.9s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player .trail-sphere-5 {
    position: absolute;
    top: 40px;
    left: 50%;
    width: 14px;
    height: 14px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame7 1.0s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player .trail-sphere-6 {
    position: absolute;
    top: 45px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame8 1.1s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Llamas de cohete - esferas súper densas y rápidas */
#corredor-player::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame1 0.4s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#corredor-player::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 26px;
    height: 26px;
    background: linear-gradient(45deg, var(--brand-player), var(--brand-player-dark));
    border-radius: 50%;
    transform: translateX(-50%);
    animation: rocketFlame2 0.5s linear infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}


/* Animaciones del jugador */
@keyframes playerGlow {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 20px rgba(255, 107, 107, 0.4);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 30px rgba(255, 107, 107, 0.8);
    }
}

/* Animaciones de llamas de cohete súper rápidas */
@keyframes rocketFlame1 {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateX(-50%) translateY(15px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(25px) scale(0.5);
    }
}

@keyframes rocketFlame2 {
    0% {
        opacity: 0.9;
        transform: translateX(-50%) translateY(0) scale(0.9);
    }
    40% {
        opacity: 0.6;
        transform: translateX(-50%) translateY(18px) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.4);
    }
}

@keyframes rocketFlame3 {
    0% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0) scale(0.8);
    }
    30% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(20px) scale(0.6);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(35px) scale(0.3);
    }
}

@keyframes rocketFlame4 {
    0% {
        opacity: 0.7;
        transform: translateX(-50%) translateY(0) scale(0.7);
    }
    25% {
        opacity: 0.4;
        transform: translateX(-50%) translateY(22px) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(40px) scale(0.2);
    }
}

@keyframes rocketFlame5 {
    0% {
        opacity: 0.6;
        transform: translateX(-50%) translateY(0) scale(0.6);
    }
    20% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(25px) scale(0.4);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(45px) scale(0.1);
    }
}

@keyframes rocketFlame6 {
    0% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(0) scale(0.5);
    }
    15% {
        opacity: 0.2;
        transform: translateX(-50%) translateY(28px) scale(0.3);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(50px) scale(0.1);
    }
}

@keyframes rocketFlame7 {
    0% {
        opacity: 0.4;
        transform: translateX(-50%) translateY(0) scale(0.4);
    }
    10% {
        opacity: 0.1;
        transform: translateX(-50%) translateY(30px) scale(0.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(55px) scale(0.05);
    }
}

@keyframes rocketFlame8 {
    0% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(0) scale(0.3);
    }
    5% {
        opacity: 0.1;
        transform: translateX(-50%) translateY(32px) scale(0.1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(60px) scale(0.02);
    }
}



/* Pantalla del Genio */
#question-area {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* ===== INTERFAZ DEL GENIO MEJORADA ===== */

/* Encabezado fijo del genio */
.genio-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    z-index: 100;
}

.genio-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.genio-title h2 {
    font-size: 2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.genio-stats {
    display: flex;
    gap: 30px;
    margin: 10px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4CAF50;
}

.genio-alerts {
    min-height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.genio-alert {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.genio-alert-info {
    background: rgba(33, 150, 243, 0.3);
    color: #81C784;
    border-color: rgba(33, 150, 243, 0.4);
}

.genio-alert-success {
    background: rgba(76, 175, 80, 0.3);
    color: #A5D6A7;
    border-color: rgba(76, 175, 80, 0.4);
}

.genio-alert-warning {
    background: rgba(255, 193, 7, 0.3);
    color: #FFF176;
    border-color: rgba(255, 193, 7, 0.4);
}

.genio-alert-error {
    background: rgba(244, 67, 54, 0.3);
    color: #EF9A9A;
    border-color: rgba(244, 67, 54, 0.4);
}

/* Marca de agua del logo en pantalla del Genio */
.genio-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 70vh;
    width: auto;
    max-width: 90vw;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
    object-fit: contain;
    filter: grayscale(0.3);
}

/* Área central del genio */
.genio-content {
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    z-index: 2;
}

/* Mensaje de espera */
.waiting-card {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255,255,255,0.2);
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.waiting-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.waiting-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--brand-accent);
}

.waiting-card p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Contenido de pregunta */
.question-content {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255,255,255,0.2);
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.question-header {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    text-align: center;
    color: #FFFFFF;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.option-btn {
    padding: 20px 25px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.option-btn:active {
    transform: translateY(-1px);
}

.question-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 25px;
    border: 2px solid rgba(255,255,255,0.2);
}

.timer-label {
    font-size: 1rem;
    opacity: 0.8;
}

.timer-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-player);
}

.timer-unit {
    font-size: 1rem;
    opacity: 0.8;
}

/* Animaciones */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 768px) {
    .genio-watermark {
        height: 60vh;
        opacity: 0.12;
    }
    
    .genio-stats {
        gap: 20px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .waiting-card, .question-content {
        padding: 30px 20px;
    }
}

.option-btn.correct {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-color: #4CAF50;
}

.option-btn.incorrect {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    border-color: #f44336;
}

.timer {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--brand-accent);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}


/* Pantalla de resultados */
.final-scores {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
}

.score-card {
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 80px;
}

.score-card h3 {
    font-size: 0.6rem;
    margin-bottom: 4px;
    color: var(--brand-accent);
}

.score-card p {
    font-size: 0.45rem;
    margin: 2px 0;
}

.total-score {
    text-align: center;
    margin: 20px 0;
}

.total-score h3 {
    font-size: 2rem;
    color: var(--brand-accent);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.restart-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .logo-start {
        max-width: 150px;
        max-height: 90px;
        margin-bottom: 15px;
    }
    
    .logo-header {
        max-width: 70px;
        max-height: 70px;
    }
    
    .logo-results {
        max-width: 120px;
        max-height: 70px;
        margin-bottom: 10px;
    }
    
    .player-selection {
        flex-direction: column;
        align-items: center;
    }
    
    .player-btn {
        width: 200px;
    }
    
    .corredor-header {
        flex-direction: column;
        height: auto;
        min-height: 96px;
        padding: 8px 12px;
        gap: 8px;
    }

    :root {
        --corredor-header-h: auto;
        --player-bottom: clamp(78px, 18vh, 120px);
    }

    .corredor-hint {
        font-size: 0.75rem;
    }
    
    .corredor-title {
        flex-direction: column;
        gap: 8px;
    }
    
    .genio-title {
        flex-direction: column;
        gap: 8px;
    }
    
    .corredor-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 8px 12px;
    }
    
    #game-area {
        height: auto;
        margin-top: 0;
        flex: 1;
        min-height: 0;
    }
    
    #options-container {
        grid-template-columns: 1fr;
    }
    
    .final-scores {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        margin: 8px 0;
    }
    
    .score-card {
        min-width: 60px;
        padding: 6px;
    }
    
    .score-card h3 {
        font-size: 0.5rem;
        margin-bottom: 3px;
    }
    
    .score-card p {
        font-size: 0.35rem;
        margin: 1px 0;
    }
}

/* Estilos para el timer del juego */
.timer-display {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--brand-accent);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

.timer-display.warning {
    color: #FF5722;
    animation: pulse-warning 1s infinite;
}

.timer-display.danger {
    color: #F44336;
    animation: pulse-danger 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse-danger {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Animación para el icono de pregunta */
@keyframes questionPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 165, 0, 0.4);
    }
    50% { 
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 165, 0, 0.6);
    }
}

/* ===== PANTALLA DE RESULTADOS MEJORADA ===== */

.results-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px;
    text-align: center;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.results-header {
    margin-bottom: 25px;
}

.logo-results {
    max-width: 150px;
    max-height: 90px;
    width: auto;
    height: auto;
    margin-bottom: 15px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.trophy-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: trophyBounce 2s infinite;
}

.results-title {
    font-size: 2.5rem;
    color: var(--brand-accent);
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: titleGlow 3s infinite;
}

.results-subtitle {
    font-size: 1rem;
    color: #B0BEC5;
    margin: 0;
    font-style: italic;
}

.score-display {
    margin-bottom: 25px;
}

.score-card {
    background: linear-gradient(135deg, var(--brand-accent), var(--brand-question-border));
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 auto;
    max-width: 350px;
    animation: scoreCardFloat 3s infinite;
}

.score-icon {
    font-size: 2.5rem;
}

.score-content h2 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.3rem;
}

.score-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
}

.score-value span:first-child {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.score-label {
    font-size: 1rem;
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: statCardSlide 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 1rem;
    margin-bottom: 4px;
}

.stat-content h3 {
    font-size: 1rem;
    margin: 0 0 4px 0;
    color: var(--brand-accent);
    font-weight: bold;
}

.stat-content p {
    margin: 0;
    color: #B0BEC5;
    font-size: 0.6rem;
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 180px;
    justify-content: center;
}

.action-btn.primary {
    background: linear-gradient(135deg, #4CAF50, #45A049);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

.results-footer {
    margin-top: 15px;
}

.encouragement-text {
    color: #B0BEC5;
    font-size: 1rem;
    font-style: italic;
    margin: 0;
}

/* Animaciones para la pantalla de resultados */
@keyframes trophyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 30px rgba(255, 215, 0, 0.6); }
}

@keyframes scoreCardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes statCardSlide {
    0% { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Responsive para pantalla de resultados */
@media (max-width: 1024px) {
    .results-container {
        padding: 15px 15px;
        height: 100vh;
    }
    
    .results-title {
        font-size: 2.2rem;
    }
    
    .trophy-icon {
        font-size: 2.5rem;
    }
    
    .score-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    
    .stat-card {
        padding: 6px;
    }
    
    .stat-content h3 {
        font-size: 0.8rem;
    }
    
    .stat-content p {
        font-size: 0.5rem;
    }
    
    .stat-icon {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .results-actions {
        margin-bottom: 15px;
    }
    
    .action-btn {
        min-width: 160px;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .results-container {
        padding: 10px 10px;
    }
    
    .results-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .action-btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Estilos para la pantalla de idle */
.idle-content {
    text-align: center;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.idle-content h2 {
    color: var(--brand-accent);
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.idle-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.idle-info p {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #E0E0E0;
}

.player-status {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.status-item:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--brand-accent);
    transform: translateY(-2px);
}

.status-icon {
    font-size: 1.5rem;
}

.status-item span:last-child {
    font-weight: bold;
    color: var(--brand-accent);
}

.start-game-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    margin: 30px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-game-btn:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
}

.start-game-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.game-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-info p {
    margin: 10px 0;
    color: #B0B0B0;
    font-size: 1.1rem;
}

/* Responsive para pantalla de idle */
@media (max-width: 768px) {
    .player-status {
        flex-direction: column;
        align-items: center;
    }
    
    .status-item {
        width: 100%;
        max-width: 300px;
    }
    
    .start-game-btn {
        padding: 15px 30px;
        font-size: 1.3rem;
    }
}

/* Estilos para botón de volver a idle */
.return-idle-btn {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
    margin: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.return-idle-btn:hover {
    background: linear-gradient(45deg, #F57C00, #FF9800);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.4);
}

.return-idle-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

/* Instrucciones de control eliminadas - interfaz más limpia */

/* Efectos de optimización del tablero */
.element-moving {
    transition: all 0.3s ease !important;
    transform: translateX(-50%) scale(1.1) !important;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.8) !important;
}

.element-optimized {
    transition: all 0.5s ease !important;
    transform: translateX(-50%) scale(1) !important;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.6) !important;
}

/* Efecto de resolución de colisión */
@keyframes resolveCollision {
    0% {
        transform: translateX(-50%) scale(1.2);
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.8);
    }
    50% {
        transform: translateX(-50%) scale(0.9);
        box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.4);
    }
}

.collision-resolved {
    animation: resolveCollision 0.6s ease-out;
}

/* Efecto pulsante para obstáculos */
@keyframes obstaclePulse {
    0% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Efecto de destrucción de obstáculos */
@keyframes obstacleDestroy {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-50%) scale(0.3);
        opacity: 0;
    }
}

.obstacle-destroyed {
    animation: obstacleDestroy 0.3s ease-out forwards !important;
}

/* Animaciones de fondo dinámicas */
@keyframes backgroundShift {
    0%, 100% {
        background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    }
    25% {
        background: linear-gradient(180deg, #B0E0E6 0%, #90EE90 100%);
    }
    50% {
        background: linear-gradient(180deg, #ADD8E6 0%, #98FB98 100%);
    }
    75% {
        background: linear-gradient(180deg, #87CEEB 0%, #F0E68C 100%);
    }
}

@keyframes backgroundParticles {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0.3;
    }
}

@keyframes backgroundShimmer {
    0%, 100% {
        opacity: 0.1;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.3;
        transform: translateX(100%);
    }
}

/* Animaciones para efectos de captura */
@keyframes captureExplosion {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), var(--end-y)) scale(0.3);
    }
}

@keyframes captureWave {
    0% {
        opacity: 1;
        transform: scale(1);
        border-width: 3px;
    }
    100% {
        opacity: 0;
        transform: scale(3);
        border-width: 1px;
    }
}

/* Estilos para obstáculos estándar */
.platform {
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.platform:hover {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}
