:root {
    --primary: #00B894;
    --secondary: #55EFC4;
    --accent: #FDCB6E;
    --background: #0A1A14;
    --border-radius: 12px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.3s;
    --glass-bg: rgba(10, 26, 20, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    user-select: none;
}

body {
    background-color: var(--background);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #0f241c; /* Slightly lighter than pure background for grid contrast */
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

/* Top Bar */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    pointer-events: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.resource-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
}

.label {
    opacity: 0.7;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bottom Bar */
#bottom-bar {
    display: flex;
    justify-content: center;
    pointer-events: auto;
    margin-bottom: 20px;
}

.action-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.4);
}

.action-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

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

/* Selection Panel */
#selection-panel {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    pointer-events: auto;
    width: 300px;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

#selection-panel.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

#selection-title {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 18px;
}

#selection-details {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
}

/* Start / Game Over Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 26, 20, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: opacity var(--transition-speed);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(0, 184, 148, 0.5);
}

p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.8;
}

.primary-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(253, 203, 110, 0.4);
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(253, 203, 110, 0.6);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
