:root {
    --primary: #636E72;
    --secondary: #B2BEC3;
    --accent: #00B894;
    --accent-glow: rgba(0, 184, 148, 0.3);
    --background: #0F1215;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.1);
    --text: #F5F5F5;
    --text-dim: #B2BEC3;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--background);
    color: var(--text);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 2rem;
    overflow: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
    height: 100%;
    align-items: center;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

main {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    display: block;
    max-width: 100%;
    max-height: 70vh;
}

footer {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

button {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    border-color: var(--secondary);
}

button:active {
    transform: translateY(0);
}

button.primary {
    background: var(--accent);
    color: var(--background);
    border: none;
}

button.primary:hover {
    background: #00d1a7;
    box-shadow: 0 0 20px var(--accent-glow);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #1A1D21;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.settings-group {
    margin-bottom: 2rem;
}

.settings-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-dim);
}

.difficulty-options {
    display: grid;
    grid-template-cols: repeat(3, 1fr);
    gap: 0.5rem;
}

.difficulty-btn {
    padding: 0.5rem;
    font-size: 0.875rem;
    justify-content: center;
}

.difficulty-btn.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.win-message {
    text-align: center;
}

.win-message h2 {
    color: var(--accent);
}

.win-time {
    font-size: 3rem;
    font-weight: 800;
    margin: 1rem 0;
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }
    .stats {
        gap: 1rem;
    }
    .stat-value {
        font-size: 1rem;
    }
}
