:root {
    --bg-1: #f8fafc;
    --bg-2: #e9eef8;
    --text: #0f172a;
    --muted: #64748b;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-border: rgba(148, 163, 184, 0.24);
    --button: #0f172a;
    --button-hover: #1e293b;
    --result-bg: rgba(255, 255, 255, 0.62);
    --result-border: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] {
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --surface: rgba(30, 41, 59, 0.88);
    --surface-border: rgba(148, 163, 184, 0.16);
    --button: #6366f1;
    --button-hover: #4f46e5;
    --result-bg: rgba(15, 23, 42, 0.55);
    --result-border: rgba(148, 163, 184, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Pretendard", "Noto Sans KR", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 5% 10%, rgba(255,255,255,0.15) 0%, transparent 36%),
        radial-gradient(circle at 90% 85%, #d8e3ff 0%, transparent 42%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
    display: grid;
    place-items: center;
    padding: 24px;
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: blur(8px);
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, background 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.app {
    width: min(560px, 100%);
}

.card {
    backdrop-filter: blur(8px);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 34px 24px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
}

.eyebrow {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 8px 0 10px;
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1.15;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.draw-button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 24px;
    background: var(--button);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.draw-button:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.result {
    margin-top: 22px;
    padding: 16px;
    border-radius: 16px;
    background: var(--result-bg);
    border: 1px solid var(--result-border);
}

.result-label {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.numbers-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.numbers-list li {
    width: 52px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    transform: translateY(8px) scale(0.92);
    opacity: 0;
    animation: pop-in 0.36s ease forwards;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.timestamp {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ball-yellow { background: #f59e0b; }
.ball-blue { background: #3b82f6; }
.ball-red { background: #ef4444; }
.ball-gray { background: #64748b; }
.ball-green { background: #10b981; }

.contact-card,
.disqus-card {
    margin-top: 24px;
}

.contact-card h2,
.disqus-card h2 {
    margin: 8px 0 10px;
    font-size: clamp(24px, 3.5vw, 30px);
}

.contact-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: var(--result-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--button);
}

@keyframes pop-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .card {
        border-radius: 20px;
        padding: 26px 16px;
    }

    .numbers-list li {
        width: 46px;
        font-size: 16px;
    }
}
