:root {
    --bg-top: #f5f8ff;
    --bg-bottom: #e7efff;
    --text: #111827;
    --muted: #4b5563;
    --card: #ffffff;
    --line: #dbe4f2;
    --accent: #03c75a;
    --accent-dark: #02a44a;
    --point: #2563eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text);
    font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    background:
        radial-gradient(circle at 5% 15%, rgba(37, 99, 235, 0.08), transparent 30%),
        radial-gradient(circle at 95% 90%, rgba(3, 199, 90, 0.12), transparent 35%),
        linear-gradient(165deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.container {
    width: min(720px, 100%);
}

.hero {
    text-align: center;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f5132;
    background: #d1fae5;
}

.description {
    margin: 0 auto 14px;
    max-width: 560px;
    color: var(--muted);
    line-height: 1.55;
}

.feature-chips {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.feature-chips li {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #dbeafe;
}

.result-card,
.guide-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.result-card {
    padding: 24px 18px;
}

.result-label {
    margin: 0 0 12px;
    text-align: center;
    font-size: 1.02rem;
    font-weight: 700;
}

.lotto-numbers {
    min-height: 62px;
    margin: 2px 0 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.number {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.2);
    transform: translateY(8px) scale(0.92);
    opacity: 0;
    animation: rise-in 420ms ease forwards;
}

.number:nth-child(1) { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.number:nth-child(2) { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.number:nth-child(3) { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.number:nth-child(4) { background: linear-gradient(135deg, #059669, #10b981); }
.number:nth-child(5) { background: linear-gradient(135deg, #65a30d, #84cc16); }

.status-text {
    margin: 0;
    min-height: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

#generate-btn {
    margin-top: 16px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(3, 199, 90, 0.28);
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

#generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(3, 170, 78, 0.35);
}

#generate-btn:active {
    transform: translateY(1px);
}

#generate-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.15) brightness(0.96);
    box-shadow: 0 8px 18px rgba(21, 62, 148, 0.25);
}

.guide-card {
    margin-top: 12px;
    padding: 14px 16px;
}

.guide-title {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0b3b73;
}

.guide-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #334155;
}

.ai-card {
    margin-top: 12px;
    padding: 18px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 8px;
}

.ai-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.ai-description {
    margin: 0 0 4px;
    font-size: 0.92rem;
    color: var(--muted);
}

.ai-card label {
    margin-top: 4px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.ai-card input[type="url"],
.ai-card input[type="file"] {
    width: 100%;
    border: 1px solid #d4deee;
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    color: var(--text);
    background: #fbfdff;
}

.ai-card input:focus {
    outline: 2px solid #bfdbfe;
    border-color: #93c5fd;
}

.ai-btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(90deg, var(--point) 0%, #0ea5e9 100%);
    cursor: pointer;
}

.ai-btn-secondary {
    background: linear-gradient(90deg, #0284c7 0%, #0d9488 100%);
}

.ai-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.preview-image {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    padding: 8px;
}

.ai-status {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #334155;
}

.prediction-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.prediction-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 9px 10px;
    background: #f8fbff;
    font-size: 0.9rem;
}

.prediction-list li strong {
    color: #1d4ed8;
}

.contact-card {
    margin-top: 12px;
    padding: 18px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.contact-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.contact-description {
    margin: 6px 0 12px;
    font-size: 0.92rem;
    color: var(--muted);
}

.partner-form {
    display: grid;
    gap: 8px;
}

.partner-form label {
    margin-top: 4px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.partner-form input,
.partner-form textarea {
    width: 100%;
    border: 1px solid #d4deee;
    border-radius: 10px;
    padding: 12px 12px;
    font: inherit;
    color: var(--text);
    background: #fbfdff;
}

.partner-form input:focus,
.partner-form textarea:focus {
    outline: 2px solid #bfdbfe;
    border-color: #93c5fd;
}

.partner-form textarea {
    resize: vertical;
}

.contact-submit {
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(90deg, var(--point) 0%, #0ea5e9 100%);
    cursor: pointer;
}

.contact-submit:hover {
    filter: brightness(1.03);
}

.number--shuffling {
    animation: shuffle-flicker 220ms ease infinite alternate;
}

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

@keyframes shuffle-flicker {
    from {
        transform: scale(0.92);
        filter: brightness(0.98);
    }
    to {
        transform: scale(1.02);
        filter: brightness(1.06);
    }
}

@media (max-width: 560px) {
    body {
        padding: 16px;
    }

    .result-card {
        padding: 20px 14px;
    }

    .number {
        width: 48px;
        height: 48px;
    }

    .feature-chips li {
        font-size: 0.82rem;
    }
}

.side-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    min-height: 600px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid #dbe4f2;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(4px);
    z-index: 4;
}

.side-ad-left {
    left: max(12px, calc((100vw - 720px) / 2 - 210px));
}

.side-ad-right {
    right: max(12px, calc((100vw - 720px) / 2 - 210px));
}

.side-ad .adsbygoogle {
    width: 160px;
    min-height: 600px;
}

@media (max-width: 1200px) {
    .side-ad {
        display: none;
    }
}
