:root {
    --bg-color: #0d0e12;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #4f46e5;
    --text-color: #f5f5f7;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100dvh;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    opacity: 0.7;
    font-weight: 300;
}

#game-wrapper {
    position: relative;
    flex: 1;
    background: radial-gradient(circle at center, #1a1c24 0%, #0d0e12 100%);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

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

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.controls {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

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

.stat-item {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count {
    font-variant-numeric: tabular-nums;
}

.actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.speed-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}

.speed-control label {
    font-size: 0.8rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-color);
}

button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

button.primary {
    background: var(--accent-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
}

button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

#overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 10;
}

#overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.winner-announcement {
    text-align: center;
    animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#winner-emoji {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
}

#winner-text {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

#restart-btn {
    background: white;
    color: black;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
}

#restart-btn:hover {
    background: #e5e5e5;
}

.hidden {
    display: none !important;
}

@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
        gap: 1rem;
    }

    .stats {
        width: 100%;
        justify-content: space-around;
    }

    .actions {
        width: 100%;
        justify-content: space-between;
    }
}