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

:root {
    --cream: #F5F0E8;
    --charcoal: #2D2520;
    --terracotta: #D17A5C;
    --teal: #5C8B87;
    --ochre: #D9A668;
    --rust: #A95540;
    --slate: #5A5450;
    --brown-light: #C4AE9A;
    --grid: rgba(45, 37, 32, 0.06);
}

[data-theme="dark"] {
    --cream: #3A3935;
    --charcoal: #F5F0E8;
    --terracotta: #E89A7C;
    --teal: #7CABA7;
    --ochre: #E8C088;
    --rust: #C97560;
    --slate: #C8BFB5;
    --brown-light: #B39A88;
    --grid: rgba(245, 240, 232, 0.08);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    transition: background 0.4s ease, color 0.4s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.header {
    margin-bottom: 3rem;
}

.title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
}

.divider {
    width: 60px;
    height: 3px;
    background: var(--terracotta);
    margin: 1.5rem auto 2rem;
}

.instruction {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--charcoal);
    opacity: 0.8;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto 2rem;
}

.simon-btn {
    aspect-ratio: 1;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    opacity: 0.7;
    border-radius: 8px;
}

.simon-btn:hover {
    opacity: 0.85;
}

.simon-btn.active {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 0 30px currentColor;
}

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

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

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

.btn-slate {
    background: #5A758B;
    color: #5A758B;
}

.progress {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-top: 0;
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.skip-btn,
.start-btn {
    padding: 0.875rem 2rem;
    background: transparent;
    border: 1px solid var(--charcoal);
    color: var(--charcoal);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.start-btn {
    background: var(--terracotta);
    color: var(--cream);
    border-color: var(--terracotta);
}

.skip-btn {
    margin-top: 1rem;
}

.skip-btn:hover,
.start-btn:hover {
    background: var(--charcoal);
    color: var(--cream);
    border-color: var(--charcoal);
}

.label {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--charcoal);
    color: var(--cream);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.sequence-display {
    margin: 0.5rem 0 1rem;
    font-size: 2rem;
    min-height: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.sequence-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    opacity: 0.3;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.sequence-dot.active {
    opacity: 1;
    transform: scale(1.3);
    box-shadow: 0 0 10px currentColor;
}

/* Playful theme toggle */
.theme-toggle {
    position: fixed;
    top: 3rem;
    right: 4rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--terracotta);
    color: var(--cream);
    border: 4px solid var(--charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.75rem;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
    background: var(--teal);
    transform: scale(1.1) rotate(15deg);
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .title {
        font-size: 2rem;
    }

    .game-board {
        gap: 0.5rem;
    }
}

@media (max-width: 380px) {
    .title {
        font-size: 1.75rem;
    }

    .start-btn,
    .skip-btn {
        padding: 0.75rem 1.5rem;
    }

    .simon-btn {
        font-size: 1.25rem;
    }
}