:root {
    --primary-blue: #3498db;
    --primary-yellow: #f1c40f;
    --primary-purple: #9b59b6;
    --primary-orange: #e67e22;
    --primary-red: #e74c3c;
    --bg-dark: #1a1a2e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --neon-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Fredoka', sans-serif;
    color: white;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#bg-canvas {
    z-index: 1;
}

#game-canvas {
    z-index: 2;
}

/* Top HUD */
#top-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
    pointer-events: none;
    box-sizing: border-box;
}

.resource-group {
    display: flex;
    gap: 20px;
}

.resource {
    background: var(--glass-bg);
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

#wave-info {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--primary-yellow);
    text-shadow: 0 0 10px var(--primary-yellow);
}

/* Wave Progress */
#wave-progress-container {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#wave-enemies {
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: bold;
}

#progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 0.3s;
}

/* Bottom HUD */
#bottom-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
    box-sizing: border-box;
}

.action-buttons {
    display: flex;
    gap: 30px;
}

.main-action {
    width: 140px;
    height: 140px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, var(--primary-blue), #2980b9);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.main-action:hover {
    transform: translateY(-5px) scale(1.05);
    filter: brightness(1.2);
}

.main-action:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.btn-text {
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-cost {
    font-size: 0.9rem;
    color: var(--primary-yellow);
    margin-top: 5px;
}

#summon-btn {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

#upgrade-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.modal {
    background: rgba(30, 30, 50, 0.9);
    padding: 60px;
    border-radius: 40px;
    text-align: center;
    border: 3px solid var(--primary-blue);
    width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    background: linear-gradient(to bottom, #fff, var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.modal p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    font-size: 1.2rem;
}

#start-game-btn,
#restart-btn {
    background: var(--primary-yellow);
    color: #000;
    border: none;
    padding: 20px 60px;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s;
}

#start-game-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--primary-yellow);
}

.hidden {
    display: none !important;
}