* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #4a9eff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3),
                inset 0 0 50px rgba(0, 0, 0, 0.5);
}

#ui-overlay {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

#stats {
    display: flex;
    gap: 30px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 25px;
    border: 2px solid #4a9eff;
}

#stats span {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

#wave-display {
    color: #ffcc00 !important;
}

#health-display {
    color: #ff4444 !important;
}

#score-display {
    color: #44ff44 !important;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 8px;
}

.overlay h1 {
    color: #4a9eff;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.8);
    animation: pulse 2s infinite;
}

.overlay p {
    color: #ccc;
    font-size: 20px;
    margin-bottom: 15px;
}

.controls-info {
    background: rgba(74, 158, 255, 0.1);
    padding: 20px 40px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.controls-info p {
    margin: 10px 0;
    font-size: 16px;
}

.overlay button {
    background: linear-gradient(135deg, #4a9eff 0%, #2d7dd2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.overlay button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.6);
}

.hidden {
    display: none !important;
}

#wave-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    text-align: center;
}

#wave-announcement h2 {
    color: #ffcc00;
    font-size: 64px;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.8),
                 0 0 60px rgba(255, 204, 0, 0.4);
    animation: waveIn 0.5s ease-out, waveOut 0.5s ease-in 1.5s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes waveIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes waveOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(1.5);
        opacity: 0;
    }
}

#final-score, #final-wave {
    color: #ffcc00;
    font-weight: bold;
}

.ai-toggle-btn {
    background: linear-gradient(135deg, #666 0%, #444 100%);
    color: #fff;
    border: 2px solid #888;
    padding: 5px 15px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.ai-toggle-btn.active {
    background: linear-gradient(135deg, #00cc66 0%, #009944 100%);
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

#ai-status {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid #00cc66;
    color: #00ff88;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

.wave-selector {
    margin: 20px 0;
    text-align: center;
}

.wave-selector label {
    display: block;
    color: #4a9eff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}

.wave-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto;
}

.wave-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #555;
    background: rgba(50, 50, 50, 0.8);
    color: #aaa;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wave-btn:hover {
    border-color: #4a9eff;
    color: #fff;
    background: rgba(74, 158, 255, 0.2);
    transform: scale(1.1);
}

.wave-btn.selected {
    border-color: #ffcc00;
    background: linear-gradient(135deg, #ffcc00 0%, #ff9900 100%);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}
