:root {
    --bg-color: #0F1215;
    --sidebar-color: #161B22;
    --primary-color: #636E72;
    --secondary-color: #B2BEC3;
    --accent-color: #00B894;
    --text-color: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 95vw;
    max-width: 800px;
    aspect-ratio: 4 / 3;
    background: var(--bg-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: crisp-edges;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(15, 18, 21, 0.8);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
}

h1 {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.2rem;
    color: var(--accent-color);
    text-shadow: 0 0 30px rgba(0, 184, 148, 0.5);
    margin-bottom: 0.5rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(0, 184, 148, 0.3); }
    to { text-shadow: 0 0 40px rgba(0, 184, 148, 0.7); }
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.controls {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-weight: 600;
}

.btn-primary, .btn-secondary {
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

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

.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.hud-item {
    background: var(--card-bg);
    padding: 8px 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    font-weight: 700;
    color: var(--secondary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hud-item span {
    color: var(--accent-color);
}

#level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.level-btn {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    transition: all 0.2s ease;
}

.level-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.level-btn.locked {
    opacity: 0.3;
    cursor: not-allowed;
}
