:root {
    color-scheme: light;
    --bg: linear-gradient(135deg, #f7efe4 0%, #f1f5ff 100%);
    --panel: rgba(255, 255, 255, 0.86);
    --text: #1d2433;
    --muted: #5f6b85;
    --button-bg: #1f5eff;
    --button-text: #ffffff;
    --button-alt-bg: #e7ecf8;
    --button-alt-text: #1d2433;
    --ball-bg: #ffffff;
    --ball-border: #ccd5ea;
    --shadow: 0 20px 45px rgba(41, 61, 120, 0.15);
}

body.dark-mode {
    color-scheme: dark;
    --bg: linear-gradient(135deg, #10131d 0%, #1c2233 100%);
    --panel: rgba(19, 24, 37, 0.88);
    --text: #eef2ff;
    --muted: #b3bfd9;
    --button-bg: #8db0ff;
    --button-text: #10131d;
    --button-alt-bg: #27314a;
    --button-alt-text: #eef2ff;
    --ball-bg: #141b2b;
    --ball-border: #31405f;
    --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg);
    color: var(--text);
    transition: background 0.25s ease, color 0.25s ease;
}

.container {
    width: min(100%, 560px);
    text-align: center;
    padding: 32px 28px;
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: left;
}

button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

#theme-toggle-btn {
    padding: 10px 16px;
    background: var(--button-alt-bg);
    color: var(--button-alt-text);
    white-space: nowrap;
}

#generator-btn {
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--button-bg);
    color: var(--button-text);
    margin-bottom: 28px;
}

#numbers-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 58px;
}

.number {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ball-bg);
    border: 1px solid var(--ball-border);
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.08);
}

@media (max-width: 520px) {
    .container {
        padding: 24px 18px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    h1 {
        text-align: center;
    }
}
