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

body {
    font-family: system-ui, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0f0f23 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* HUD */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-container, .level-container, .highscore-container {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.score-container {
    border-color: rgba(0, 255, 255, 0.5);
}

.level-container {
    border-color: rgba(255, 0, 255, 0.5);
}

.highscore-container {
    border-color: rgba(255, 215, 0, 0.5);
}

.label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.value {
    font-size: 28px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.level-container .value {
    color: #ff00ff;
}

.highscore-container .value {
    color: #ffd700;
}

.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    width: 200px;
    height: 12px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 0, 0, 0.3);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0066, #ff3366);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 102, 0.5);
}

.controls-hint {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, #00ffff, #ff00ff, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 8px;
}

.subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 40px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.game-over-title {
    font-size: 36px;
    font-weight: bold;
    color: #ff0066;
    text-shadow: 0 0 20px rgba(255, 0, 102, 0.5);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.level-up-title {
    font-size: 36px;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.final-score, .level-stats {
    margin-bottom: 30px;
}

.final-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.final-value, .stat-value {
    font-size: 56px;
    font-weight: bold;
    background: linear-gradient(135deg, #00ffff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.icon {
    font-size: 24px;
}

.highscore-display {
    font-size: 18px;
    color: rgba(255, 215, 0, 0.9);
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #00ffff, #00ff88);
    color: #0a0a1a;
    border: none;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .hud {
        padding: 10px;
        gap: 10px;
    }

    .hud-top {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .score-container, .level-container, .highscore-container {
        padding: 8px 12px;
    }

    .value {
        font-size: 20px;
    }

    .label {
        font-size: 10px;
    }

    .hud-bottom {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .health-bar {
        width: 150px;
    }

    .controls-hint {
        font-size: 9px;
        padding: 6px 12px;
    }

    .overlay-content {
        padding: 30px 20px;
    }

    .game-title {
        font-size: 32px;
        letter-spacing: 4px;
    }

    .game-over-title, .level-up-title {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .final-value, .stat-value {
        font-size: 40px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .value {
        font-size: 16px;
    }

    .label {
        font-size: 8px;
    }

    .game-title {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .game-over-title, .level-up-title {
        font-size: 20px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.score-container, .level-container, .highscore-container {
    animation: pulse 2s infinite;
}

.level-container {
    animation-delay: 0.5s;
}

.highscore-container {
    animation-delay: 1s;
}
