/* 3D Particle Storm - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
}

/* Loading Screen */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.particle-loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
}

.particle-loader::before,
.particle-loader::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #00ffff;
    border-radius: 50%;
    animation: particleFloat 2s ease-in-out infinite;
}

.particle-loader::before {
    left: 0;
    animation-delay: 0s;
}

.particle-loader::after {
    right: 0;
    animation-delay: 1s;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 0.7; }
}

.loading-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-content p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Game UI */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.ui-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.ui-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.score-display,
.energy-display,
.level-display,
.fps-display,
.particles-display {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.label {
    color: #00ffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.value {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.energy-bar {
    width: 80px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 5px;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 100%;
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 46, 0.9) 50%, rgba(22, 33, 62, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.start-content {
    text-align: center;
    color: #fff;
    max-width: 500px;
    padding: 40px;
}

.start-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

.controls-info {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.key {
    font-weight: 700;
    color: #00ffff;
    font-family: 'Courier New', monospace;
}

.desc {
    color: #fff;
    opacity: 0.8;
}

.start-btn {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(26, 26, 46, 0.95) 50%, rgba(22, 33, 62, 0.95) 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(15px);
}

.game-over-content {
    text-align: center;
    color: #fff;
    max-width: 500px;
    padding: 40px;
}

.game-over-content h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff0000, #ff6600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-stats {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.restart-btn,
.menu-btn {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.restart-btn {
    background: linear-gradient(45deg, #00ffff, #0080ff);
    color: #000;
}

.menu-btn {
    background: linear-gradient(45deg, #ff00ff, #8000ff);
    color: #fff;
}

.restart-btn:hover,
.menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Pause Screen */
.pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 150;
    backdrop-filter: blur(5px);
}

.pause-content {
    text-align: center;
    color: #fff;
}

.pause-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #00ffff;
}

.pause-content p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ui-top,
    .ui-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .score-display,
    .energy-display,
    .level-display,
    .fps-display,
    .particles-display {
        min-width: auto;
        width: 100%;
        justify-content: space-between;
    }
    
    .start-content h1 {
        font-size: 2rem;
    }
    
    .controls-info {
        gap: 10px;
    }
    
    .control-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .restart-btn,
    .menu-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .ui-top,
    .ui-bottom {
        padding: 0 10px;
    }
    
    .start-content,
    .game-over-content {
        padding: 20px;
    }
    
    .start-content h1 {
        font-size: 1.8rem;
    }
    
    .score-display,
    .energy-display,
    .level-display,
    .fps-display,
    .particles-display {
        padding: 8px 12px;
    }
    
    .label {
        font-size: 0.8rem;
    }
    
    .value {
        font-size: 1rem;
    }
}

/* Performance optimizations */
.game-ui * {
    will-change: transform;
}

.start-screen,
.game-over-screen,
.pause-screen {
    will-change: opacity;
}

/* Hide elements when not needed */
.hidden {
    display: none !important;
}

/* Smooth transitions */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
