*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-accent: #dbeafe;
    --surface: #ffffff;
    --surface-strong: #e2e8f0;
    --text: #1f2933;
    --text-muted: #52616b;
    --accent: #0ea5a4;
    --accent-strong: #0f766e;
    --border: rgba(15, 23, 42, 0.12);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body.theme-dark {
    color-scheme: dark;
    --bg: #0b1220;
    --bg-accent: #1e293b;
    --surface: #0f172a;
    --surface-strong: #1e293b;
    --text: #e2e8f0;
    --text-muted: #a4b2c8;
    --accent: #38bdf8;
    --accent-strong: #0ea5e9;
    --border: rgba(148, 163, 184, 0.25);
    --shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
}

body {
    font-family: 'Nanum Gothic', 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 40px 20px;
    background: radial-gradient(circle at top, var(--bg-accent) 0%, var(--bg) 45%, var(--bg) 100%);
    color: var(--text);
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    background: radial-gradient(circle at 20% 20%, rgba(14, 165, 164, 0.18), transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.18), transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(14, 165, 164, 0.12), transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.container {
    width: min(700px, 100%);
    text-align: center;
    background-color: var(--surface);
    padding: 36px clamp(20px, 5vw, 50px) 40px;
    border-radius: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

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

h1 {
    margin: 0;
    font-family: 'Montserrat', 'Nanum Gothic', sans-serif;
    font-size: clamp(28px, 4vw, 36px);
    letter-spacing: 0.02em;
}

.sub-title {
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: 15px;
}

#generate {
    background-color: var(--accent);
    color: #f8fafc;
    border: none;
    padding: 14px 34px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    margin-bottom: 32px;
    transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 25px rgba(14, 165, 164, 0.25);
}

#generate:hover {
    background-color: var(--accent-strong);
    transform: translateY(-1px);
}

.ghost-button {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.ghost-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(14, 165, 164, 0.08);
}

.numbers-container {
    display: grid;
    gap: 16px;
}

.numbers-set {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    animation: float-in 0.4s ease both;
}

.set-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 6px;
}

.number {
    width: 50px;
    height: 50px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@keyframes float-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    #generate {
        width: 100%;
    }

    .numbers-set {
        justify-content: flex-start;
    }
}
