:root {
    --bg-primary: #f3f6fb;
    --bg-secondary: #ffffff;
    --bg-accent: #e7f8f2;
    --text-primary: #18212f;
    --text-secondary: #5b6575;
    --shadow-color: rgba(15, 23, 42, 0.12);
    --button-bg: #0d9f6e;
    --button-bg-hover: #0a855c;
    --button-text: #ffffff;
    --toggle-bg: #dce5f1;
    --toggle-text: #18212f;
}

body[data-theme='dark'] {
    --bg-primary: #08131a;
    --bg-secondary: #112029;
    --bg-accent: #16313b;
    --text-primary: #f4fbff;
    --text-secondary: #9fb4bf;
    --shadow-color: rgba(0, 0, 0, 0.38);
    --button-bg: #3fd0a3;
    --button-bg-hover: #30ba90;
    --button-text: #08131a;
    --toggle-bg: #223844;
    --toggle-text: #f4fbff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at top, var(--bg-accent), var(--bg-primary) 55%);
    color: var(--text-primary);
    transition: background 0.25s ease, color 0.25s ease;
}

.container {
    width: min(100%, 460px);
    text-align: center;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 24px 60px var(--shadow-color);
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.theme-label,
.subtitle {
    color: var(--text-secondary);
}

.theme-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.theme-toggle {
    border: none;
    border-radius: 999px;
    background-color: var(--toggle-bg);
    color: var(--toggle-text);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.4rem);
}

.subtitle {
    margin: 0.85rem 0 2rem;
    line-height: 1.5;
}

.lotto-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
    margin: 2rem 0;
}

.lotto-ball {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.generate-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background-color: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.generate-btn:hover {
    background-color: var(--button-bg-hover);
    transform: translateY(-1px);
}

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

    .toolbar {
        gap: 0.75rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-toggle {
        width: 100%;
    }
}
