:root {
    --bg-cream: #f8f2e8;
    --bg-mint: #d8eadf;
    --bg-orange: #f6c28b;
    --ink: #172126;
    --muted: #5b666d;
    --card: rgba(255, 252, 247, 0.7);
    --line: rgba(23, 33, 38, 0.08);
    --shadow: 0 24px 80px rgba(73, 56, 29, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Sans KR", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 30%),
        radial-gradient(circle at bottom right, rgba(247, 161, 76, 0.18), transparent 26%),
        linear-gradient(135deg, var(--bg-cream), var(--bg-mint) 58%, #f7efe3);
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    filter: blur(6px);
    pointer-events: none;
}

body::before {
    width: 16rem;
    height: 16rem;
    top: 4rem;
    right: 6rem;
    background: rgba(255, 190, 92, 0.24);
}

body::after {
    width: 12rem;
    height: 12rem;
    bottom: 4rem;
    left: 4rem;
    background: rgba(90, 160, 132, 0.16);
}

.page-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.hero-panel,
.history-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 32px;
    background: var(--card);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 40px;
}

.history-panel {
    padding: 32px 24px;
}

.eyebrow {
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b06b24;
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 0.95;
    max-width: 10ch;
}

h2 {
    font-size: 1.8rem;
}

.hero-copy {
    max-width: 42rem;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.7;
}

.generator-card {
    margin-top: 36px;
    padding: 26px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
}

.card-topline,
.card-footer,
.history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-label,
.meta-label,
.draw-time {
    font-size: 0.94rem;
}

.card-label,
.meta-label {
    color: var(--muted);
}

.draw-time {
    color: #2f6c56;
    font-weight: 700;
}

.numbers-container {
    min-height: 138px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
}

.placeholder-copy,
.history-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.number,
.history-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
}

.number {
    width: 78px;
    height: 78px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.55);
    font-size: 1.5rem;
    animation: rise-in 0.5s ease both;
}

.history-ball {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
}

.tier-yellow {
    background: linear-gradient(135deg, #ffe08a, #f3af43);
    color: #6f4300;
}

.tier-blue {
    background: linear-gradient(135deg, #89d0ff, #2a8bdc);
    color: #083c74;
}

.tier-red {
    background: linear-gradient(135deg, #ffa59e, #ee6658);
    color: #7a180f;
}

.tier-gray {
    background: linear-gradient(135deg, #d7dde3, #95a4b3);
    color: #31414c;
}

.tier-green {
    background: linear-gradient(135deg, #a5efb8, #39a46c);
    color: #124b30;
}

.result-meta strong {
    display: block;
    margin-top: 4px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.7rem;
}

.generate-btn {
    border: 0;
    border-radius: 999px;
    padding: 16px 24px;
    font: inherit;
    font-weight: 800;
    color: #fffdf8;
    cursor: pointer;
    background: linear-gradient(135deg, #1f3d35, #2d7f61);
    box-shadow: 0 14px 28px rgba(45, 127, 97, 0.24);
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(45, 127, 97, 0.3);
}

.generate-btn:active {
    transform: translateY(0);
}

.history-header {
    margin-bottom: 18px;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-item {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.history-meta {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.history-meta strong {
    font-family: "Space Grotesk", sans-serif;
    color: #1f3d35;
}

.history-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 920px) {
    .page-shell {
        grid-template-columns: 1fr;
        padding: 24px 0 40px;
    }

    .hero-panel,
    .history-panel {
        padding: 24px;
    }

    h1 {
        max-width: none;
        font-size: clamp(2.2rem, 11vw, 3.4rem);
    }

    .card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .generate-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .numbers-container {
        gap: 10px;
    }

    .number {
        width: 64px;
        height: 64px;
        font-size: 1.2rem;
    }
}
