@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0a2e 50%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    display: none;
    border: 3px solid #00ffff;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    background: rgba(10, 10, 30, 0.9);
}

/* Neon Text Effect */
.neon-text {
    font-size: 4rem;
    font-weight: 900;
    text-align: center;
    color: #00ffff;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff,
        0 0 40px #0099ff,
        0 0 70px #0099ff,
        0 0 80px #0099ff,
        0 0 100px #0099ff;
    animation: flicker 3s infinite alternate;
    margin-bottom: 2rem;
}

@keyframes flicker {

    0%,
    18%,
    22%,
    25%,
    53%,
    57%,
    100% {
        text-shadow:
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff,
            0 0 40px #0099ff,
            0 0 70px #0099ff,
            0 0 80px #0099ff,
            0 0 100px #0099ff;
    }

    20%,
    24%,
    55% {
        text-shadow: none;
    }
}

.game-over-title {
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 30px #ff00ff,
        0 0 40px #ff0099,
        0 0 70px #ff0099;
}

/* Menu Styles */
.menu {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3.5rem 2rem 2rem 2rem;
    position: relative;
    background: rgba(10, 10, 30, 0.8);
    border: 2px solid #00ffff;
    border-radius: 20px;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    max-width: 800px;
}

.menu.active {
    display: flex;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
}

/* Neon Button */
.neon-button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 3rem;
    background: transparent;
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #00ffff;
}

.neon-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.neon-button:hover::before {
    left: 100%;
}

.neon-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        inset 0 0 10px rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
}

.neon-button:active {
    transform: scale(0.98);
}

/* Back Button */
.back-button {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    background: transparent;
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px #00ffff;
    z-index: 10;
}

.back-button:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateX(-3px);
}

.back-button:active {
    transform: translateX(-1px) scale(0.98);
}

/* Stats */
.stats {
    margin-top: 2rem;
    text-align: center;
    font-size: 1.2rem;
}

.stats p {
    margin: 0.5rem 0;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

/* Controls Info */
.controls-info,
.power-ups-info {
    text-align: left;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.controls-info p,
.power-ups-info p {
    margin: 0.8rem 0;
    font-size: 1rem;
}

.power-ups-info h3 {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    margin-bottom: 1rem;
}

/* Shop */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    width: 100%;
}

.shop-item {
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid #00ffff;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.shop-item:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateY(-5px);
}

.shop-item h3 {
    color: #00ffff;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.shop-item p {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.shop-item .price {
    color: #ffff00;
    font-weight: bold;
    font-size: 1.1rem;
}

.shop-item button {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    background: transparent;
    color: #00ffff;
    border: 1px solid #00ffff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-item button:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.shop-item button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item.owned {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

#hud.active {
    display: flex;
}

.hud-item {
    background: rgba(10, 10, 30, 0.8);
    padding: 0.8rem 1.5rem;
    border: 2px solid #00ffff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    font-size: 1.2rem;
}

.hud-label {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    margin-right: 0.5rem;
}

#score,
#level {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 5px #ffff00;
}

/* Energy Bar */
.energy-bar-container {
    display: flex;
    align-items: center;
}

.energy-bar {
    width: 150px;
    height: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 10px;
    overflow: hidden;
    margin-left: 0.5rem;
}

.energy-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ffff, #0099ff);
    box-shadow: 0 0 10px #00ffff;
    transition: width 0.1s ease;
}

/* Active Powerups */
#active-powerups {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.powerup-indicator {
    padding: 0.5rem 1rem;
    background: rgba(255, 0, 255, 0.2);
    border: 1px solid #ff00ff;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Game Over Stats */
.game-over-stats {
    text-align: center;
    margin: 2rem 0;
    font-size: 1.5rem;
}

.game-over-stats p {
    margin: 1rem 0;
}

.game-over-stats span {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 10px #ffff00;
}

/* Particles */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
}

/* Screen Shake */
@keyframes shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translate(-5px, 5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translate(5px, -5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Mobile Controls */
#mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    pointer-events: none;
    z-index: 1000;
}

#arrow-controls {
    position: fixed;
    bottom: 40px;
    left: 20px;
    display: flex;
    gap: 15px;
    pointer-events: all;
}

.arrow-button {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    background: rgba(0, 255, 255, 0.2);
    border: 3px solid #00ffff;
    color: #00ffff;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arrow-button:active {
    transform: scale(0.9);
    background: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

#dash-button {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 0, 255, 0.3);
    border: 3px solid #ff00ff;
    color: #ff00ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 0 0 10px #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}

#dash-button:active {
    transform: scale(0.95);
    background: rgba(255, 0, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .neon-text {
        font-size: 2.5rem;
    }

    .neon-button {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }

    .menu {
        padding: 3.5rem 1rem 1rem 1rem;
        max-width: 90%;
    }

    #mobile-controls {
        display: block;
    }

    #game-canvas {
        max-width: 100vw;
        max-height: 100vh;
    }
}

/* Menu Scroll */
.menu {
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Pause Menu - Overlay Centrado */
#pause-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

#pause-menu.active {
    display: flex;
}

.pause-content {
    background: rgba(10, 10, 30, 0.95);
    border: 3px solid #00ffff;
    border-radius: 20px;
    padding: 3rem 4rem;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    max-width: 400px;
}

.pause-content h2 {
    margin-bottom: 2rem;
}
/* Rotate overlay: hidden by default, only shows on mobile portrait */
#rotate-overlay {
    display: none;
}

@media (max-width: 768px) and (orientation: portrait) {
    #rotate-overlay {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 99999;
        background: rgba(10, 10, 30, 0.97);
        align-items: center;
        justify-content: center;
        text-align: center;
        color: #00ffff;
        font-family: 'Orbitron', sans-serif;
    }

    .rotate-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
}
