:root {
    --bg-color: #1A0A14;
    --primary: #FD79A8;
    --secondary: #FFCCCC;
    --accent: #00CEC9;
    --glass: rgba(26, 10, 20, 0.7);
    --glass-border: rgba(253, 121, 168, 0.3);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--secondary);
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks through to canvas unless on UI element */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.stats {
    display: flex;
    gap: 15px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary);
}

.player-stats { color: var(--accent); }
.enemy-stats { color: var(--primary); }

#controls-bottom {
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 10px;
    height: 140px;
}

.panel {
    width: 48%;
    display: flex;
    flex-direction: column;
}

.panel h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--secondary);
    text-align: center;
}

.scroll-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scroll-list::-webkit-scrollbar { display: none; }

.item-card {
    min-width: 80px;
    height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    font-size: 12px;
    text-align: center;
    color: #fff;
    padding: 5px;
}

.item-card:hover {
    background: rgba(253, 121, 168, 0.2);
    transform: translateY(-2px);
}

.item-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.item-card .cost {
    color: #FFD700; /* Gold */
    font-weight: bold;
    margin-top: 4px;
}

.item-card .name {
    font-weight: 600;
}

/* Specific item colors/styles */
.tower-icon, .unit-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
    border-radius: 50%;
    background: #ccc;
}

#wave-info {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: auto;
}

#game-over-screen.hidden { display: none; }

#game-over-title {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--primary);
}

#restart-btn {
    padding: 15px 40px;
    font-size: 20px;
    background: var(--accent);
    border: none;
    border-radius: 30px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent);
}

@media (max-width: 600px) {
    #controls-bottom {
        flex-direction: column;
        height: auto;
    }
    .panel {
        width: 100%;
        margin-bottom: 10px;
    }
    .item-card {
        min-width: 60px;
        height: 70px;
        font-size: 10px;
    }
    .tower-icon, .unit-icon {
        width: 20px;
        height: 20px;
    }
}
