:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --dark: #2f2f2f;
    --glass: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --bg-grad: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-grad);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.money-display {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 15px;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
}

.cannon-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.cannon-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cannon-btn .charge-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.1);
}

#cannon-fill {
    height: 100%;
    width: 0%;
    background: #00ccff;
    box-shadow: 0 0 10px #00ccff;
}

.bottom-bar {
    pointer-events: auto;
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
}

.control-panel {
    display: flex;
    gap: 20px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    padding: 15px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    align-items: center;
}

.upgrade-btn {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 15px;
    padding: 10px;
    color: white;
    cursor: pointer;
    min-width: 120px;
}

.upgrade-btn:hover:not(:disabled) { background: rgba(255, 215, 0, 0.4); }

.upgrade-btn .lvl { font-weight: 800; color: #ffd700; }
.upgrade-btn .cost { font-size: 0.8rem; opacity: 0.8; }

#unit-buttons {
    display: flex;
    gap: 10px;
}

.unit-btn {
    width: 80px;
    height: 100px;
    border-radius: 15px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    color: white;
}

.unit-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.25);
    border-color: white;
}

.unit-btn:active:not(:disabled) {
    transform: scale(0.95);
}

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

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

.unit-btn .cost {
    font-size: 0.9rem;
    font-weight: 700;
}

.unit-btn .cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0,0,0,0.5);
    transition: height 0.1s linear;
}

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

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

.message-box {
    text-align: center;
    color: white;
}

.message-box h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

.message-box button {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    border: none;
    background: #4ecdc4;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-box button:hover {
    transform: scale(1.1);
}
