/* ========== CONTROLES MÓVILES AGRUPADOS 📱 ========== */

#mobile-controls {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 50;
    display: none;
    background: rgba(10, 15, 35, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 12px;
    border: 1px solid rgba(0, 220, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: auto;
    max-width: 180px;
}

#dpad {
    display: grid;
    grid-template-columns: 50px 50px 50px;
    grid-template-rows: 50px 50px 50px;
    gap: 4px;
    margin: 0 auto;
}

.dpad-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(0, 220, 255, 0.25);
    border-radius: 12px;
    color: rgba(0, 220, 255, 0.8);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(0, 220, 255, 0.2);
}

.dpad-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px;
    background: linear-gradient(135deg, 
        rgba(0, 220, 255, 0.1),
        rgba(255, 51, 102, 0.1),
        rgba(0, 220, 255, 0.1)
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dpad-btn:hover::before {
    opacity: 1;
}

.dpad-btn:active {
    transform: scale(0.88);
    border-color: #00e0ff;
    box-shadow: 0 0 25px rgba(0, 220, 255, 0.3), inset 0 0 15px rgba(0, 220, 255, 0.08);
    color: #ffffff;
    text-shadow: 0 0 25px rgba(0, 220, 255, 0.6);
}

.dpad-up {
    border-color: rgba(0, 224, 255, 0.3);
    color: #00e0ff;
}

.dpad-up:active {
    border-color: #00e0ff;
    box-shadow: 0 0 25px rgba(0, 224, 255, 0.4);
}

.dpad-down {
    border-color: rgba(255, 51, 102, 0.3);
    color: #ff3366;
}

.dpad-down:active {
    border-color: #ff3366;
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.4);
}

.dpad-left {
    border-color: rgba(0, 255, 170, 0.3);
    color: #00ffaa;
}

.dpad-left:active {
    border-color: #00ffaa;
    box-shadow: 0 0 25px rgba(0, 255, 170, 0.4);
}

.dpad-right {
    border-color: rgba(255, 221, 0, 0.3);
    color: #ffdd00;
}

.dpad-right:active {
    border-color: #ffdd00;
    box-shadow: 0 0 25px rgba(255, 221, 0, 0.4);
}

.dpad-center {
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.6rem;
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.15);
    cursor: default;
    box-shadow: none;
    animation: none;
}

.dpad-center::before,
.dpad-center::after {
    display: none;
}

.dpad-center:hover {
    transform: none;
    box-shadow: none;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

/* ========== BOTONES DE ACCIÓN AGRUPADOS ========== */

#action-controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    background: rgba(10, 15, 35, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 12px 10px;
    border: 1px solid rgba(0, 220, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#shoot-btn-mobile {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 40% 35%, rgba(255, 50, 50, 0.3), rgba(255, 50, 50, 0.1));
    border: 2px solid rgba(255, 100, 100, 0.5);
    border-radius: 50%;
    font-size: 1.6rem;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    position: relative;
}

#shoot-btn-mobile::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, 
        rgba(255, 50, 50, 0.1),
        rgba(255, 100, 100, 0.2),
        rgba(255, 50, 50, 0.1)
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#shoot-btn-mobile:hover::before {
    opacity: 1;
}

#shoot-btn-mobile:active {
    background: radial-gradient(circle at 40% 35%, rgba(255, 50, 50, 0.6), rgba(255, 50, 50, 0.3));
    transform: scale(0.88);
    box-shadow: 0 0 40px rgba(255, 50, 50, 0.5), inset 0 0 30px rgba(255, 50, 50, 0.2);
    border-color: #ff6666;
}

#power-btn-mobile {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 40% 35%, rgba(255, 200, 0, 0.2), rgba(255, 200, 0, 0.05));
    border: 2px solid rgba(255, 200, 0, 0.3);
    border-radius: 50%;
    font-size: 1.3rem;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.1);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    opacity: 0.5;
    position: relative;
}

#power-btn-mobile:active {
    transform: scale(0.88);
}

#power-btn-mobile.ready {
    opacity: 1;
    background: radial-gradient(circle at 40% 35%, rgba(255, 200, 0, 0.3), rgba(255, 200, 0, 0.1));
    border-color: rgba(255, 200, 0, 0.6);
    animation: powerBtnBlink 0.6s ease-in-out infinite alternate;
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.2);
}

#power-btn-mobile.ready:active {
    background: radial-gradient(circle at 40% 35%, rgba(255, 200, 0, 0.6), rgba(255, 200, 0, 0.3));
    transform: scale(0.88);
    box-shadow: 0 0 50px rgba(255, 200, 0, 0.5);
}

@keyframes powerBtnBlink {
    from { 
        box-shadow: 0 0 20px rgba(255, 200, 0, 0.3);
        border-color: rgba(255, 200, 0, 0.5);
    }
    to { 
        box-shadow: 0 0 40px rgba(255, 200, 0, 0.6), 0 0 60px rgba(255, 150, 0, 0.3);
        border-color: rgba(255, 200, 0, 0.9);
    }
}

/* Mostrar controles en móviles */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    #mobile-controls { display: block; }
    #action-controls { display: flex; }
    #shoot-btn-mobile { display: flex; }
    #power-btn-mobile { display: flex; }
}

@media (max-width: 768px) {
    #mobile-controls { 
        display: block;
        padding: 10px;
        bottom: 20px;
        left: 15px;
        max-width: 160px;
    }
    
    #action-controls { 
        display: flex;
        padding: 10px 8px;
        bottom: 20px;
        right: 15px;
        gap: 8px;
    }
    
    #dpad {
        grid-template-columns: 44px 44px 44px;
        grid-template-rows: 44px 44px 44px;
        gap: 3px;
    }
    
    .dpad-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 10px;
    }
    
    #shoot-btn-mobile {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }
    
    #power-btn-mobile {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    #mobile-controls { 
        padding: 8px;
        bottom: 15px;
        left: 10px;
        max-width: 140px;
        border-radius: 14px;
    }
    
    #action-controls { 
        padding: 8px 6px;
        bottom: 15px;
        right: 10px;
        gap: 6px;
        border-radius: 14px;
    }
    
    #dpad {
        grid-template-columns: 38px 38px 38px;
        grid-template-rows: 38px 38px 38px;
        gap: 2px;
    }
    
    .dpad-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        border-radius: 8px;
        border-width: 1px;
    }
    
    #shoot-btn-mobile {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        border-width: 1.5px;
    }
    
    #power-btn-mobile {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        border-width: 1.5px;
    }
}

/* ========== CANVAS PRINCIPAL 🎨 ========== */
#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

/* ========== BOTÓN DE PANTALLA COMPLETA ⛶ ========== */
#fullscreen-btn {
    position: absolute;
    top: 18px;
    right: 130px;
    z-index: 20;
    background: rgba(8, 12, 30, 0.7);
    border: 2px solid rgba(0, 220, 255, 0.45);
    color: rgba(0, 220, 255, 0.8);
    font-size: 1.5rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.18);
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    line-height: 1;
    padding: 0;
}

#fullscreen-btn:hover {
    background: rgba(0, 220, 255, 0.2);
    border-color: #00e0ff;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 220, 255, 0.5);
    transform: scale(1.1);
}

#fullscreen-btn:active {
    transform: scale(0.9);
}

/* ========== BOTÓN DE SONIDO ========== */
#sound-btn {
    position: absolute;
    top: 18px;
    right: 75px;
    z-index: 20;
    background: rgba(8, 12, 30, 0.7);
    border: 2px solid rgba(0, 220, 255, 0.45);
    color: rgba(0, 220, 255, 0.8);
    font-size: 1.3rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.18);
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    line-height: 1;
    padding: 0;
}

#sound-btn:hover {
    background: rgba(0, 220, 255, 0.2);
    border-color: #00e0ff;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 220, 255, 0.5);
    transform: scale(1.1);
}

#sound-btn:active {
    transform: scale(0.9);
}

#sound-btn.muted {
    border-color: rgba(255, 50, 50, 0.5);
    color: rgba(255, 50, 50, 0.8);
}

#sound-btn.muted:hover {
    border-color: #ff3366;
    box-shadow: 0 0 25px rgba(255, 50, 50, 0.5);
}

/* ========== HUD ========== */
#hud {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    gap: 10px;
    flex-wrap: wrap;
}

.hud-item {
    background: rgba(8, 12, 30, 0.8);
    border: 2px solid rgba(0, 220, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    box-shadow: 0 0 18px rgba(0, 200, 255, 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    min-width: 90px;
    justify-content: center;
}

.hud-icon {
    font-size: 1.3rem;
}

.hud-value {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    font-size: 1.3rem;
    min-width: 24px;
    text-align: center;
}

.power-bar-container {
    width: 60px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(0, 220, 255, 0.3);
}

.power-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffdd00, #ffaa00);
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.6);
    transition: width 0.3s ease;
}

.power-bar-fill.ready {
    animation: powerBlink 0.5s ease-in-out infinite alternate;
}

@keyframes powerBlink {
    from { box-shadow: 0 0 15px rgba(255, 200, 0, 0.8); }
    to { box-shadow: 0 0 30px rgba(255, 200, 0, 1), 0 0 50px rgba(255, 150, 0, 0.6); }
}

#power-indicator {
    border-color: #ffdd00 !important;
    animation: powerIndicatorBlink 0.5s ease-in-out infinite alternate;
}

#power-indicator span {
    color: #ffdd00;
    font-size: 0.8rem;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.8);
}

@keyframes powerIndicatorBlink {
    from { 
        box-shadow: 0 0 15px rgba(255, 200, 0, 0.6);
        background: rgba(8, 12, 30, 0.8);
    }
    to { 
        box-shadow: 0 0 30px rgba(255, 200, 0, 1), 0 0 50px rgba(255, 150, 0, 0.8);
        background: rgba(255, 200, 0, 0.15);
    }
}

.hidden {
    display: none !important;
}

.hud-glow {
    animation: hudPulse 0.7s ease-out;
}

@keyframes hudPulse {
    0% {
        transform: scale(1);
        border-color: rgba(0, 220, 255, 0.45);
        box-shadow: 0 0 18px rgba(0, 200, 255, 0.18);
    }
    40% {
        transform: scale(1.2);
        border-color: #ff3366;
        box-shadow: 0 0 35px #ff3366, 0 0 55px rgba(0, 220, 255, 0.7);
    }
    100% {
        transform: scale(1);
        border-color: rgba(0, 220, 255, 0.45);
        box-shadow: 0 0 18px rgba(0, 200, 255, 0.18);
    }
}

/* ========== MODAL DE PREGUNTA - VERSIÓN COMPACTA ========== */

#question-modal {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    background: rgba(10, 15, 35, 0.85);
    border: 2px solid rgba(0, 224, 255, 0.4);
    box-shadow: 0 -4px 30px rgba(0, 224, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 18px 14px;
    border-radius: 14px 14px 8px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 92vw;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#question-modal.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
    pointer-events: none;
}

#question-modal:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

#question-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 14px #00e0ff;
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    line-height: 1.3;
}

.options-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.option-card {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(0, 224, 255, 0.4);
    color: #ffffff;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.option-card:hover {
    background: rgba(0, 224, 255, 0.25);
    border-color: #00e0ff;
    box-shadow: 0 0 20px rgba(0, 224, 255, 0.35);
    transform: translateY(-2px);
}

.option-card:active {
    transform: scale(0.94);
    transition: transform 0.08s ease;
}

.key-badge {
    background: #00e0ff;
    color: #050510;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.75rem;
    letter-spacing: 0;
}

.option-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.timer-bar-container {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 2px;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00e0ff, #ff3366);
    transition: width 0.1s linear;
}

#feedback-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    min-height: 16px;
    margin: 0;
    line-height: 1.2;
}

/* --- MÓVILES: MODAL ULTRA COMPACTO --- */
@media (max-width: 600px) {
    #question-modal {
        position: absolute;
        top: auto;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        min-width: unset;
        width: auto;
        max-width: 94vw;
        padding: 8px 12px 10px;
        border-radius: 10px 10px 6px 6px;
        gap: 6px;
        border-width: 1.5px;
        box-shadow: 0 -2px 15px rgba(0, 224, 255, 0.12);
    }

    #question-modal.hidden {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
        pointer-events: none;
    }

    #question-modal:not(.hidden) {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        pointer-events: all;
    }

    #question-text {
        font-size: 0.9rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        margin: 0;
        padding: 0 2px;
        line-height: 1.2;
        text-shadow: 0 0 8px rgba(0, 224, 255, 0.3);
    }

    .options-row {
        display: flex;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 5px;
        width: 100%;
        justify-content: center;
    }

    .option-card {
        padding: 4px 6px;
        font-size: 0.7rem;
        gap: 3px;
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        border-width: 1.5px;
        border-radius: 6px;
        white-space: nowrap;
        transition: all 0.15s ease;
    }

    .option-card:active {
        transform: scale(0.92);
        background: rgba(0, 224, 255, 0.3);
    }

    .key-badge {
        padding: 1px 4px;
        font-size: 0.55rem;
        border-radius: 3px;
        min-width: 14px;
        text-align: center;
        background: #00e0ff;
        color: #050510;
        font-weight: 900;
    }

    .option-value {
        font-size: 0.8rem;
        font-weight: 700;
    }

    .timer-bar-container {
        height: 3px;
        margin-top: 2px;
        border-radius: 2px;
    }

    #feedback-text {
        font-size: 0.65rem;
        min-height: 12px;
        margin: 0;
        padding: 0 2px;
        line-height: 1.2;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 400px) {
    #question-modal {
        padding: 6px 8px 8px;
        max-width: 96vw;
        bottom: 10px;
        gap: 4px;
    }

    #question-text {
        font-size: 0.8rem;
    }

    .option-card {
        padding: 3px 4px;
        font-size: 0.6rem;
        gap: 2px;
    }

    .key-badge {
        padding: 1px 3px;
        font-size: 0.5rem;
        min-width: 12px;
    }

    .option-value {
        font-size: 0.7rem;
    }

    .options-row {
        gap: 3px;
    }
}

/* ========== MENSAJE DE ROTACIÓN ========== */
#rotate-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 4, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    color: white;
    font-family: 'Orbitron', sans-serif;
}

#rotate-message.show {
    display: flex;
}

#rotate-message .rotate-icon {
    font-size: 5rem;
    animation: rotatePhone 2s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

#rotate-message h2 {
    font-size: 1.8rem;
    color: #00e0ff;
    text-shadow: 0 0 20px rgba(0, 224, 255, 0.5);
    margin-bottom: 15px;
}

#rotate-message p {
    font-size: 1.1rem;
    color: #ccddff;
    max-width: 400px;
    margin-bottom: 25px;
    font-family: 'Rajdhani', sans-serif;
    line-height: 1.6;
}

.rotate-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.rotate-btn {
    padding: 12px 30px;
    border: 2px solid rgba(0, 224, 255, 0.5);
    border-radius: 50px;
    background: rgba(0, 224, 255, 0.1);
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.rotate-btn:hover {
    background: rgba(0, 224, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 224, 255, 0.3);
}

.rotate-btn:active {
    transform: scale(0.95);
}

.rotate-btn.continue-btn {
    border-color: rgba(255, 200, 0, 0.6);
    background: rgba(255, 200, 0, 0.1);
    color: #ffdd00;
}

.rotate-btn.continue-btn:hover {
    background: rgba(255, 200, 0, 0.2);
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.3);
}

/* ========== PANTALLAS ========== */
#start-screen, #story-screen, #journey-end-screen, #game-over-screen, #giant-ship-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 4, 20, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    transition: opacity 0.5s ease;
    cursor: default;
}

#start-screen.hidden, #story-screen.hidden, #journey-end-screen.hidden, #game-over-screen.hidden, #giant-ship-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-box {
    background: rgba(15, 20, 45, 0.7);
    border: 2px solid rgba(0, 224, 255, 0.5);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 0 50px rgba(0, 180, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 550px;
    width: 90%;
}

.story-box {
    max-width: 600px;
}

.story-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    color: #ccddff;
    line-height: 1.8;
    margin: 20px 0;
    text-align: left;
}

.story-text p {
    margin-bottom: 15px;
}

.story-highlight {
    color: #ffdd00 !important;
    font-weight: 700;
    font-size: 1.2rem !important;
    text-align: center !important;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.6);
}

.glow-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #00e0ff;
    text-shadow: 0 0 25px #00e0ff, 0 0 50px #ff3366;
    letter-spacing: 2px;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1rem;
    color: #ccddff;
    margin-bottom: 25px;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
    font-weight: 500;
}

.selector-box {
    margin: 18px 0 25px;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    color: #cceeff;
}

.selector-box select {
    background: #0a1030;
    color: #00e0ff;
    border: 2px solid #00e0ff;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(0, 224, 255, 0.2);
    transition: all 0.3s ease;
}

.selector-box select:hover {
    box-shadow: 0 0 25px rgba(0, 224, 255, 0.5);
    border-color: #ff3366;
}

.selector-box select option {
    background: #0a1030;
    color: #ffffff;
}

.glow-button {
    background: linear-gradient(135deg, #00c8ff, #ff3366);
    border: none;
    color: #ffffff;
    padding: 15px 45px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.5);
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.glow-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 45px rgba(255, 51, 102, 0.8), 0 0 70px rgba(0, 200, 255, 0.6);
}

.glow-button:active {
    transform: scale(0.94);
}

.danger-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff3366;
    text-shadow: 0 0 30px #ff3366, 0 0 60px #ff0000;
    letter-spacing: 2px;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 15px;
}

.final-score {
    font-size: 1.3rem;
    color: #ffeebb;
    margin-bottom: 22px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

#final-stars, #end-powder-delivered, #end-powder-lost, #final-powder-lost, #story-powder {
    color: #ffdd00;
    font-size: 1.6rem;
    font-weight: 900;
    text-shadow: 0 0 15px #ffdd00;
}

#speed-warning {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ff4444;
    text-shadow: 0 0 15px #ff0000, 0 0 30px #ff3366;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#speed-warning.active {
    opacity: 1;
    animation: warningBlink 0.5s ease-in-out infinite alternate;
}

@keyframes warningBlink {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

#powder-warning {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffaa00;
    text-shadow: 0 0 15px #ffaa00, 0 0 30px #ff6600;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#powder-warning.active {
    opacity: 1;
    animation: powderWarningBlink 0.4s ease-in-out 3;
}

@keyframes powderWarningBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.giant-ship-container {
    margin: 20px 0;
    animation: giantShipPulse 2s ease-in-out infinite;
}

@keyframes giantShipPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#giant-ship-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.6), 0 0 80px rgba(255, 0, 0, 0.3);
    border: 3px solid rgba(255, 50, 50, 0.6);
}

/* ========== MEDIA QUERIES ADICIONALES ========== */

@media (max-width: 768px) {
    #fullscreen-btn {
        right: 75px;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        top: 12px;
    }
    
    #sound-btn {
        right: 125px;
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        top: 12px;
    }

    #hud {
        gap: 5px;
        right: 60px;
        top: 12px;
    }

    .hud-item {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 4px;
        min-width: auto;
        border-radius: 20px;
    }

    .hud-icon {
        font-size: 0.9rem;
    }

    .hud-value {
        font-size: 0.9rem;
        min-width: 18px;
    }

    .power-bar-container {
        width: 40px;
        height: 6px;
    }

    #power-indicator span {
        font-size: 0.6rem;
    }

    .glow-title {
        font-size: 1.5rem;
    }

    .glow-button {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .menu-box {
        padding: 25px 20px;
        max-width: 95%;
    }

    .story-text {
        font-size: 0.95rem;
    }

    #rotate-message h2 {
        font-size: 1.4rem;
    }

    #rotate-message p {
        font-size: 0.95rem;
    }

    .rotate-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    #rotate-message .rotate-icon {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    #fullscreen-btn {
        right: 65px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
        top: 10px;
    }
    
    #sound-btn {
        right: 105px;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        top: 10px;
    }

    .hud-item {
        padding: 4px 8px;
        font-size: 0.65rem;
        gap: 3px;
    }

    .hud-icon {
        font-size: 0.75rem;
    }

    .hud-value {
        font-size: 0.75rem;
        min-width: 14px;
    }

    .power-bar-container {
        width: 30px;
        height: 5px;
    }

    .glow-title {
        font-size: 1.2rem;
    }

    .glow-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .menu-box {
        padding: 20px 15px;
    }

    #rotate-message h2 {
        font-size: 1.2rem;
    }

    #rotate-message p {
        font-size: 0.85rem;
    }

    .rotate-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    #rotate-message .rotate-icon {
        font-size: 3rem;
    }
}