@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");
@import url("https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap");

:root {
    --page-background: #f7f1e5;
    --surface: #fffaf0;
    --surface-muted: #eee2c8;
    --text-color: #20382e;
    --muted-text: #637469;
    --heading-color: #0f2e25;
    --border-color: #dccba6;
    --accent: #b98a32;
    --accent-dark: #8d6822;
    --accent-soft: #f0dfb5;
    --warning-soft: #fff4d4;
    --shadow: 0 14px 34px rgba(63, 48, 24, 0.12);
    --radius: 8px;
}

body[data-theme="dark"] {
    --page-background: #0f2e25;
    --surface: #163d32;
    --surface-muted: #1d4a3e;
    --text-color: #f6f1e7;
    --muted-text: #d4c8ad;
    --heading-color: #fff9ec;
    --border-color: #375f50;
    --accent: #d6a84f;
    --accent-dark: #f0c76a;
    --accent-soft: #314f34;
    --warning-soft: #3d331c;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(214, 168, 79, 0.14), transparent 30rem),
        linear-gradient(135deg, var(--page-background), color-mix(in srgb, var(--page-background) 82%, var(--accent) 18%));
    color: var(--text-color);
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
    line-height: 1.7;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(14px);
}

.brand {
    color: var(--heading-color);
    font-family: "Gowun Dodum", "Pretendard", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    color: var(--muted-text);
    font-size: 0.95rem;
    font-weight: 700;
}

.site-nav a,
.site-footer a {
    text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
    color: var(--accent);
}

.theme-toggle,
.button {
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-toggle {
    padding: 0.55rem 0.8rem;
    background: var(--surface-muted);
    color: var(--heading-color);
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
}

.button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.button.secondary {
    background: var(--surface);
    color: var(--heading-color);
}

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

.button.primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.full-width {
    width: 100%;
}

main {
    width: 100%;
}

.section-band {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    min-height: calc(100vh - 86px);
}

.hero-copy h1,
.narrow-page h1 {
    max-width: 820px;
    margin: 0;
    color: var(--heading-color);
    font-family: "Gowun Dodum", "Pretendard", sans-serif;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.lead {
    max-width: 720px;
    color: var(--muted-text);
    font-size: 1.12rem;
}

.eyebrow {
    margin: 0 0 0.65rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-actions,
.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.hero-note,
.winning-preview,
.tool-panel,
.insight-panel,
.info-card,
.history-panel,
.lookup-panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-note,
.winning-preview,
.history-panel,
.lookup-panel {
    padding: 1.25rem;
}

.hero-note strong,
.info-card h3,
.insight-panel h3,
.history-panel h3,
.lookup-panel h3 {
    color: var(--heading-color);
    font-family: "Gowun Dodum", "Pretendard", sans-serif;
}

.hero-note p,
.fine-print,
.status-message {
    color: var(--muted-text);
    font-size: 0.95rem;
}

.section-heading {
    max-width: 780px;
    margin-bottom: 1.5rem;
}

.section-heading h2,
.article-body h2,
.policy-body h2 {
    margin: 0;
    color: var(--heading-color);
    font-family: "Gowun Dodum", "Pretendard", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.18;
}

.section-heading p,
.article-body p,
.policy-body p {
    color: var(--muted-text);
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

.tool-panel,
.insight-panel {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.numbers-container,
.combination-balls,
.winning-balls {
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 44px));
    gap: 0.75rem;
    align-items: center;
}

.number-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12), 0 10px 18px rgba(16, 32, 51, 0.12);
    overflow: hidden;
    position: relative;
    transform: scale(0.88);
    animation: pop-in 0.28s ease forwards;
}

.number-circle::after {
    content: "";
    position: absolute;
    inset: -35%;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 248, 220, 0.72) 48%, transparent 62%);
    opacity: 0;
    transform: translateX(-70%) rotate(10deg);
    pointer-events: none;
}

.generated-ball {
    opacity: 0;
    transform: translateY(8px) scale(0.08) rotate(-8deg);
    filter: brightness(1.8) saturate(1.2);
    box-shadow: 0 0 0 rgba(246, 218, 144, 0), 0 0 28px rgba(246, 218, 144, 0.75);
    animation: craft-ball 1.18s cubic-bezier(0.16, 0.92, 0.22, 1.08) forwards;
}

.generated-ball::after {
    animation: lucky-shine 1.18s ease forwards;
}

.generated-ball::before {
    content: "";
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(246, 218, 144, 0.72);
    border-radius: inherit;
    opacity: 0;
    transform: scale(0.55);
    pointer-events: none;
    animation: craft-ring 1.18s ease-out forwards;
}

.bonus-ball {
    outline: 3px solid var(--accent-soft);
}

.bonus-plus {
    color: var(--muted-text);
    font-weight: 900;
    text-align: center;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.filter-panel {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.control-field {
    display: grid;
    gap: 0.4rem;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    color: var(--heading-color);
    font-weight: 800;
}

.check-field input {
    width: auto;
}

.control-field span,
.picker-header h3 {
    color: var(--heading-color);
    font-weight: 900;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.picker-header h3,
.picker-header p {
    margin: 0;
}

.picker-header p {
    color: var(--muted-text);
    font-size: 0.92rem;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0.45rem;
}

.pick-number {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--heading-color);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.pick-number.fixed {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.pick-number.excluded {
    background: transparent;
    border-color: #d64545;
    color: #d64545;
    text-decoration: line-through;
}

.selection-summary {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.9rem;
    background: var(--surface-muted);
    border-radius: var(--radius);
}

.selection-summary p {
    margin: 0;
    color: var(--muted-text);
}

.selection-summary strong {
    color: var(--heading-color);
    margin-right: 0.5rem;
}

.budget-field {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

.budget-field span {
    color: var(--heading-color);
    font-weight: 900;
}

.status-message.warning {
    color: #d64545;
    font-weight: 800;
}

.match-summary {
    display: grid;
    gap: 0.25rem;
    margin-top: 1rem;
    padding: 0.85rem;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--heading-color);
}

.match-summary strong {
    font-weight: 900;
}

.match-summary span {
    color: var(--text-color);
    font-size: 0.95rem;
}

.combinations-list {
    display: grid;
    gap: 0.5rem;
    max-height: none;
    overflow: auto;
    padding-right: 0.25rem;
}

.combination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.62rem 0.7rem;
    background: var(--surface-muted);
    border-radius: var(--radius);
}

.combination-row strong {
    color: var(--heading-color);
    min-width: 3.6rem;
    white-space: nowrap;
}

.winning-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.recent-draws {
    padding: 0;
    background: transparent;
    border: 0;
}

.recent-draws summary {
    margin-bottom: 0.75rem;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading h2,
.panel-heading h3 {
    margin: 0;
}

.winning-list {
    display: grid;
    gap: 0.75rem;
}

.winning-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: var(--radius);
}

.winning-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.winning-title strong {
    color: var(--heading-color);
}

.winning-title span,
.empty-card,
.loading-card {
    color: var(--muted-text);
}

.lookup-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

@keyframes craft-ball {
    0% {
        opacity: 0;
        filter: brightness(1.9) saturate(1.2);
        box-shadow: 0 0 0 rgba(246, 218, 144, 0), 0 0 34px rgba(246, 218, 144, 0.72);
        transform: translateY(8px) scale(0.08) rotate(-8deg);
    }

    16% {
        opacity: 1;
        filter: brightness(2.15) saturate(1.35);
        box-shadow: 0 0 0 8px rgba(246, 218, 144, 0.14), 0 0 38px rgba(246, 218, 144, 0.9);
        transform: translateY(4px) scale(0.18) rotate(-8deg);
    }

    28% {
        opacity: 0.35;
        filter: brightness(1.2) saturate(1);
        box-shadow: 0 0 0 2px rgba(246, 218, 144, 0.05), 0 0 16px rgba(246, 218, 144, 0.28);
        transform: translateY(4px) scale(0.16) rotate(-6deg);
    }

    38% {
        opacity: 1;
        filter: brightness(2.05) saturate(1.28);
        box-shadow: 0 0 0 10px rgba(246, 218, 144, 0.12), 0 0 34px rgba(246, 218, 144, 0.82);
        transform: translateY(2px) scale(0.24) rotate(-5deg);
    }

    48% {
        opacity: 0.5;
        filter: brightness(1.25) saturate(1);
        box-shadow: 0 0 0 3px rgba(246, 218, 144, 0.06), 0 0 14px rgba(246, 218, 144, 0.24);
        transform: translateY(2px) scale(0.2) rotate(-4deg);
    }

    66% {
        opacity: 1;
        filter: brightness(1.34) saturate(1.16);
        box-shadow: 0 0 0 4px rgba(246, 218, 144, 0.1), 0 0 24px rgba(246, 218, 144, 0.54);
        transform: translateY(-3px) scale(1.16) rotate(3deg);
    }

    82% {
        opacity: 1;
        filter: brightness(1.08) saturate(1.08);
        box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12), 0 10px 18px rgba(16, 32, 51, 0.12);
        transform: translateY(0) scale(0.94) rotate(0deg);
    }

    100% {
        opacity: 1;
        filter: brightness(1) saturate(1);
        box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.12), 0 10px 18px rgba(16, 32, 51, 0.12);
        transform: translateY(0) scale(1);
    }
}

@keyframes craft-ring {
    0% {
        opacity: 0;
        transform: scale(0.42);
    }

    18% {
        opacity: 0.18;
        transform: scale(0.55);
    }

    38% {
        opacity: 0.55;
        transform: scale(0.82);
    }

    66% {
        opacity: 0.82;
        transform: scale(1.18);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

@keyframes lucky-shine {
    0% {
        opacity: 0;
        transform: translateX(-70%) rotate(10deg);
    }

    35% {
        opacity: 0;
    }

    62% {
        opacity: 0.85;
    }

    100% {
        opacity: 0;
        transform: translateX(70%) rotate(10deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .number-circle,
    .generated-ball,
    .generated-ball::before,
    .generated-ball::after {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.stats-list {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0;
}

.stats-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-list dt {
    color: var(--muted-text);
    font-weight: 700;
}

.stats-list dd {
    margin: 0;
    color: var(--heading-color);
    font-weight: 900;
    text-align: right;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.info-card {
    padding: 1.2rem;
}

.info-card h3 {
    margin: 0 0 0.5rem;
}

.info-card p {
    margin: 0;
    color: var(--muted-text);
}

.article-section {
    width: 100%;
    max-width: none;
    background: var(--surface-muted);
}

.article-body {
    width: min(880px, calc(100% - 2rem));
    margin: 0 auto;
}

.faq-list {
    display: grid;
    gap: 0.75rem;
}

details {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}

summary {
    color: var(--heading-color);
    cursor: pointer;
    font-weight: 900;
}

details p {
    color: var(--muted-text);
}

.narrow-page {
    width: min(820px, calc(100% - 2rem));
    margin: 0 auto;
}

.form-group {
    display: grid;
    gap: 0.4rem;
}

label {
    color: var(--heading-color);
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-color);
    font: inherit;
    padding: 0.8rem 0.9rem;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--accent-soft);
    border-color: var(--accent);
}

.required {
    color: #d64545;
}

.policy-body {
    max-width: 760px;
}

.policy-body h2 {
    margin-top: 2rem;
    font-size: 1.35rem;
}

.policy-body a {
    color: var(--accent);
    font-weight: 800;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem clamp(1rem, 4vw, 3rem);
    border-top: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--muted-text);
}

.site-footer strong {
    color: var(--heading-color);
}

.site-footer p {
    margin: 0.25rem 0 0;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 0.9rem;
    font-weight: 800;
}

@media (max-width: 860px) {
    .site-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.1rem;
    }

    .hero,
    .tool-layout,
    .content-grid,
    .winning-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 2.5rem;
    }

    .number-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .site-footer {
        flex-direction: column;
    }

    .site-footer nav {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .site-header {
        padding: 0.85rem 1rem;
    }

    .theme-toggle {
        width: auto;
    }

    .hero-copy h1,
    .narrow-page h1 {
        font-size: 2.35rem;
    }

    .numbers-container {
        gap: 0.5rem;
    }

    .control-grid,
    .filter-grid,
    .lookup-form {
        grid-template-columns: 1fr;
    }

    .picker-header,
    .panel-heading,
    .winning-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .number-circle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .combination-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-actions .button,
    .tool-actions .button {
        width: 100%;
    }
}
