/* ── 리셋 ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
    background: #F0EFF3;
    min-height: 100vh;
    min-height: 100dvh;
    color: #1A1A1A;
    padding: 0 0 60px;
    margin: 0;
}

/* 전체 콘텐츠 중앙 정렬 래퍼 */
body > * {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ── 스크린리더 전용 ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── 상단 헤더 ── */
.top-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 14px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1A1A1A;
    font-weight: 600;
}

.header-line {
    width: 100%;
    height: 1px;
    background: #C8C7CC;
    margin-bottom: 32px;
}

/* ── 네비게이션 ── */
.nav {
    width: 100%;
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nav a {
    color: #999;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.15s;
}

.nav a:hover {
    color: #1A1A1A;
}

.nav a.active {
    color: #1A1A1A;
    font-weight: 700;
}

/* ── 타이틀 ── */
.site-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.1;
}

/* ── 페이지 콘텐츠 ── */
.page-content {
    width: 100%;
    max-width: 560px;
}

.page-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 24px 0 10px;
}

.page-content p {
    font-size: 0.9rem;
    line-height: 1.75;
    color: #444;
    margin-bottom: 12px;
}

.page-content ul {
    font-size: 0.9rem;
    line-height: 1.75;
    color: #444;
    margin-bottom: 12px;
    padding-left: 20px;
}

.page-content a {
    color: #1A1A1A;
    font-weight: 600;
}

/* ── 카드 ── */
.card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
}

/* ── 구분선 ── */
.divider {
    height: 1px;
    background: #D5D4D8;
    margin: 24px 0;
}

/* ── 탭 ── */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    width: 100%;
}

.tab {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    color: #AAAAAA;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    border-bottom: 2px solid #E8E7EB;
    letter-spacing: 0.01em;
    outline: none;
}

.tab.active {
    color: #1A1A1A;
    border-bottom-color: #1A1A1A;
}

.tab:hover:not(.active) {
    color: #666;
}

.tab:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: -2px;
    border-radius: 4px;
}

/* ── 패널 ── */
.panel {
    width: 100%;
}

.panel[hidden] {
    display: none;
}

/* ── 섹션 ── */
.section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.draw-day {
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
}

/* ── 마감 카운트다운 ── */
.countdown {
    font-size: 0.82rem;
    font-weight: 700;
    color: #D4443B;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #FDF2F1;
    border-radius: 8px;
    text-align: center;
}

.countdown.closed {
    color: #999;
    background: #F0EFF3;
}

.section-divider {
    height: 1px;
    background: #D5D4D8;
    margin-bottom: 24px;
}

/* ── 게임 수 선택 ── */
.game-count {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.game-count label {
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
}

.game-count select {
    background: #fff;
    border: 1px solid #D5D4D8;
    color: #1A1A1A;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    font-weight: 500;
    min-height: 44px;
}

.game-count select:focus {
    border-color: #1A1A1A;
}

.price-hint {
    color: #999;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── 결과 영역 ── */
.results-card {
    background: #fff;
    border-radius: 14px;
    padding: 4px 16px;
    margin-bottom: 8px;
    min-height: 0;
}

.results-card:empty {
    display: none;
}

/* ── 로또 볼 ── */
.lotto-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-height: 48px;
}

.ball {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 800;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.ball.show {
    opacity: 1;
}

/* 정적 볼 (당첨번호 표시용) */
.ball.static {
    opacity: 1;
}

.ball.range-1 { background: #F5DEB3; color: #8B6914; }
.ball.range-2 { background: #C6DEF1; color: #2B5F8A; }
.ball.range-3 { background: #F0C4C4; color: #993333; }
.ball.range-4 { background: #D5D5D5; color: #4A4A4A; }
.ball.range-5 { background: #C4DFC4; color: #2D6B2D; }

/* ── 연금복권 ── */
.pension-result {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 48px;
}

.pension-group {
    background: #1A1A1A;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.pension-group.show, .pension-group.static {
    opacity: 1;
}

.pension-separator {
    font-size: 1rem;
    color: #C8C7CC;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pension-separator.show, .pension-separator.static {
    opacity: 1;
}

.pension-digit {
    width: 40px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    background: #F7F7F9;
    border: 1px solid #E0DFE3;
    color: #1A1A1A;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.pension-digit.show, .pension-digit.static {
    opacity: 1;
}

/* ── 버튼 ── */
.btn-area {
    text-align: center;
    margin-top: 24px;
}

.generate-btn {
    width: 100%;
    padding: 16px 36px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    background: #1A1A1A;
    color: #fff;
    letter-spacing: 0.02em;
    min-height: 52px;
}

.generate-btn:hover {
    background: #333;
}

.generate-btn:active {
    transform: scale(0.98);
    background: #000;
}

.generate-btn:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: 2px;
}

/* ── 다중 게임 결과 ── */
.multi-result {
    padding: 16px 0;
    border-bottom: 1px solid #F0EFF3;
}

.multi-result:last-child {
    border-bottom: none;
}

.multi-result .game-label {
    font-size: 0.72rem;
    color: #BBBBBB;
    margin-bottom: 10px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.multi-result .lotto-balls,
.multi-result .pension-result {
    min-height: auto;
}

/* ── 당첨번호 섹션 ── */
.winning-section {
    margin-bottom: 32px;
}

.winning-card {
    background: #F9F6F0;
    border-radius: 14px;
    padding: 6px 0;
    overflow: hidden;
    border-left: 3px solid #D4A843;
}

.winning-round {
    padding: 18px 20px;
    border-bottom: 1px solid #EDE9E0;
}

.winning-round:last-child {
    border-bottom: none;
}

.winning-round .round-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.winning-round .round-number {
    font-size: 0.85rem;
    font-weight: 800;
    color: #B8942E;
}

.winning-round .round-date {
    font-size: 0.72rem;
    color: #999;
    font-weight: 500;
}

.winning-round .prize-info {
    font-size: 0.82rem;
    font-weight: 700;
    color: #D4A843;
    margin-bottom: 12px;
}

.winning-round .prize-info .winners {
    font-size: 0.72rem;
    font-weight: 500;
    color: #999;
    margin-left: 6px;
}

/* 연금복권 당첨금 테이블 */
.pension-prize-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-bottom: 14px;
}

.pension-prize-table th {
    text-align: left;
    font-weight: 600;
    color: #999;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 6px 8px;
    border-bottom: 1px solid #E8E4D8;
}

.pension-prize-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #F0ECE2;
    color: #555;
}

.pension-prize-table tr:last-child td {
    border-bottom: none;
}

.pension-prize-table .rank {
    font-weight: 700;
    color: #B8942E;
    width: 44px;
}

.pension-prize-table .condition {
    color: #777;
}

.pension-prize-table .amount {
    font-weight: 700;
    color: #1A1A1A;
    text-align: right;
    white-space: nowrap;
}

.pension-prize-table tr.highlight td {
    background: rgba(212, 168, 67, 0.08);
}

.pension-prize-table tr.bonus-row td {
    border-top: 1px solid #E0DCD0;
}

.winning-round .prize-info {
    line-height: 1.7;
}

.winning-round .lotto-balls {
    gap: 5px;
    min-height: auto;
}

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

/* 당첨번호 카드 위 연금복권 스타일 */
.winning-round .pension-group {
    background: #B8942E;
    color: #fff;
}

.winning-round .pension-digit {
    background: #fff;
    border-color: #E0DCD4;
    color: #1A1A1A;
}

.winning-round .pension-separator {
    color: #CCC;
}

/* ── 히스토리 ── */
.history-section {
    margin-top: 32px;
    width: 100%;
}

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

.history-header h3 {
    font-size: 0.8rem;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.clear-btn {
    background: none;
    border: 1px solid #D5D4D8;
    color: #999;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    min-height: 36px;
}

.clear-btn:hover {
    color: #1A1A1A;
    border-color: #1A1A1A;
}

.clear-btn:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: 1px;
}

.history-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.history-item .time {
    color: #BBBBBB;
    font-size: 0.72rem;
    min-width: 42px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.history-balls {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.history-balls .mini-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.history-pension-nums {
    display: flex;
    gap: 4px;
    align-items: center;
}

.history-pension-nums .mini-digit {
    background: #F0EFF3;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1A1A1A;
}

.history-pension-nums .mini-group {
    background: #1A1A1A;
    color: #fff;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 4px;
}

/* ── 폼 ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D5D4D8;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fff;
    min-height: 44px;
}

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

.form-group input:focus,
.form-group textarea:focus {
    border-color: #1A1A1A;
}

.submit-btn {
    padding: 14px 32px;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    background: #1A1A1A;
    color: #fff;
    min-height: 48px;
    transition: background 0.15s;
}

.submit-btn:hover {
    background: #333;
}

/* ── 정보성 콘텐츠 (홈 하단) ── */
.info-content {
    width: 100%;
    margin-top: 40px;
}

.info-section {
    margin-bottom: 28px;
}

.info-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1A1A1A;
}

.info-section p {
    font-size: 0.88rem;
    line-height: 1.75;
    color: #555;
    margin-bottom: 8px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 8px;
}

.compare-table th,
.compare-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #E8E7EB;
    text-align: center;
}

.compare-table thead th {
    font-weight: 700;
    color: #1A1A1A;
    background: #F7F7F9;
    border-bottom: 2px solid #D5D4D8;
}

.compare-table td.label {
    font-weight: 600;
    color: #888;
    text-align: left;
}

.faq-item {
    margin-bottom: 16px;
}

.faq-item h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 6px;
}

.faq-item p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #666;
}

/* ── 푸터 ── */
footer {
    margin-top: 48px;
    color: #C8C7CC;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.8;
    width: 100%;
}

footer a {
    color: #999;
    text-decoration: none;
}

footer a:hover {
    color: #1A1A1A;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

/* ── 모바일 최적화 ── */
@media (max-width: 480px) {
    body {
        padding: 0 0 48px;
    }

    body > * {
        padding-left: 16px;
        padding-right: 16px;
    }

    .site-title {
        font-size: 1.8rem;
        margin-bottom: 24px;
    }

    .top-header {
        padding: 20px 0 12px;
        font-size: 0.65rem;
    }

    .header-line {
        margin-bottom: 24px;
    }

    .tabs {
        margin-bottom: 24px;
    }

    .tab {
        font-size: 0.9rem;
        padding: 12px 0;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .section-divider {
        margin-bottom: 20px;
    }

    .game-count {
        margin-bottom: 20px;
    }

    .results-card {
        padding: 2px 12px;
        border-radius: 12px;
    }

    .multi-result {
        padding: 14px 0;
    }

    .ball {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }

    .lotto-balls {
        gap: 5px;
    }

    .pension-digit {
        width: 36px;
        height: 44px;
        font-size: 1.05rem;
    }

    .pension-group {
        padding: 8px 14px;
        font-size: 1rem;
    }

    .pension-result {
        gap: 4px;
    }

    .btn-area {
        margin-top: 20px;
    }

    .generate-btn {
        min-height: 50px;
        border-radius: 10px;
    }

    .winning-round {
        padding: 14px 16px;
    }

    .winning-round .ball {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
    }

    .nav {
        gap: 14px;
    }

    .card {
        padding: 20px 16px;
    }
}
