* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687083;
    --border: #d7dce6;
    --button: #1d4ed8;
    --button-text: #ffffff;
    --button-hover: #1e40af;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.14);
    --ball-bg: #ffffff;
    --ball-border: #cfd6e3;
}

body.dark-mode {
    color-scheme: dark;
    --bg: #121621;
    --panel: #1d2433;
    --text: #f5f7fb;
    --muted: #aeb7c8;
    --border: #394356;
    --button: #60a5fa;
    --button-text: #0f172a;
    --button-hover: #93c5fd;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    --ball-bg: #283244;
    --ball-border: #4b5568;
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 180ms ease, color 180ms ease;
}

.container {
    text-align: center;
    width: min(92vw, 520px);
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

h1 {
    margin: 0;
    font-size: clamp(28px, 6vw, 42px);
    line-height: 1.1;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--ball-bg);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

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

.theme-toggle:focus-visible,
#generate-btn:focus-visible {
    outline: 3px solid var(--button);
    outline-offset: 3px;
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 50px;
}

.lotto-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--ball-bg);
    border: 2px solid var(--ball-border);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

#generate-btn {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    color: var(--button-text);
    background: var(--button);
    border: 0;
    border-radius: 8px;
    transition: background-color 180ms ease, transform 180ms ease;
}

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