:root {
    --bg-color: #0f172a;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-color: #f8fafc;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 750px;
    height: 650px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--glass-border);
    background-color: #000;
    overflow: hidden;
}

canvas {
    display: block;
    outline: none; /* remove focus outline */
}

/* UI Layer Overlays */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

#ui-layer.hidden, .hidden {
    display: none !important;
}

.game-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
    animation: float 3s ease-in-out infinite;
}

.title-box h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(96, 165, 250, 0.3);
}

.subtitle {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Button Styling */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 16px 48px;
    font-size: 1.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Menu Pages */
.menu-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 600px;
}

.map-grid .map-btn:last-child {
    grid-column: span 2;
}

/* Config Panel Inputs */
.config-panel {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 300px;
}

.config-panel label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
}

.select-input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--primary);
    color: white;
    font-size: 1.1rem;
    outline: none;
}

#win-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: white;
    font-size: 3rem;
    z-index: 50;
}

#win-text {
    font-size: 4rem;
    font-weight: 800;
    color: #facc15;
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.8);
    margin-bottom: 2rem;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
