:root {
    color-scheme: light dark;
    --bg: #f7f7fb;
    --bg-alt: #ffffff;
    --fg: #17171f;
    --muted: #6b6b76;
    --border: #e3e3ea;
    --card-bg: #ffffff;
    --accent: #FEE500;       /* 카카오 옐로 */
    --accent-fg: #191600;
    --accent-2: #3b5bdb;
    --danger: #c92a2a;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(20, 20, 30, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --bg-alt: #18181b;
        --fg: #f0f0f3;
        --muted: #9c9ca6;
        --border: #2c2c31;
        --card-bg: #1c1c20;
        --accent: #FEE500;
        --accent-fg: #191600;
        --accent-2: #7691f5;
        --danger: #ff6b6b;
        --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
}

a { color: inherit; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.brand {
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
    color: var(--fg);
    white-space: nowrap;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    flex: 1;
}

.topbar nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
}

.topbar nav a:hover { color: var(--fg); }

.auth-area {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* [CLAUDE 수정 - 추가] 2026-07-22 - 모바일에서 헤더 nav/버튼 텍스트가 flex 자식 요소로
# 지나치게 눌려서 한글이 글자 단위로 세로 줄바꿈되던 문제 수정. white-space: nowrap으로
# 텍스트가 단어(글자) 단위로 깨지지 않게 하고, flex-wrap으로 공간이 부족하면 통째로
# 다음 줄로 넘어가게 함(글자가 쪼개지는 대신 항목 단위로 줄바꿈됨) */
@media (max-width: 720px) {
    .topbar-inner {
        padding: 12px 16px;
        gap: 8px 14px;
    }
    .topbar nav {
        order: 3;
        flex: 1 1 100%;
        gap: 6px 14px;
    }
    .topbar nav a {
        font-size: 0.86rem;
    }
    .auth-area {
        margin-left: auto;
    }
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 버튼 ---------- */
.primary-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-fg);
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}
.primary-btn:hover { opacity: 0.92; }
.primary-btn.small { padding: 7px 14px; font-size: 0.88rem; }

.ghost-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.88rem;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--accent-2); }

.inline-form { display: inline-block; }

/* ---------- 히어로 ---------- */
.hero {
    padding: 88px 20px 64px;
    text-align: center;
}
.hero h1 {
    font-size: 2.6rem;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}
.hero .highlight { color: var(--accent-2); }
.hero p.lead {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto 32px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 섹션 공용 ---------- */
section { padding: 64px 0; }
section h2 {
    font-size: 1.7rem;
    text-align: center;
    margin: 0 0 8px;
}
section .section-sub {
    text-align: center;
    color: var(--muted);
    margin: 0 0 40px;
}

/* ---------- 기능 카드 그리드 ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.feature-card .icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.feature-card.clickable {
    display: block;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.feature-card.clickable:hover {
    transform: translateY(-3px);
    border-color: var(--accent-2);
}
.feature-card-more {
    display: block;
    margin-top: 14px;
    color: var(--accent-2);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- 기능 상세 페이지 ---------- */
.feature-detail-inner {
    max-width: 720px;
    padding-top: 32px;
    padding-bottom: 80px;
}
.back-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 28px;
}
.back-link:hover { color: var(--fg); }

.feature-detail-head { text-align: center; margin-bottom: 36px; }
.feature-detail-icon { font-size: 2.6rem; margin-bottom: 12px; }
.feature-detail-head h1 { margin: 0 0 10px; font-size: 1.8rem; }
.feature-detail-tagline { color: var(--accent-2); font-weight: 700; margin: 0 0 14px; }
.feature-detail-desc { color: var(--muted); max-width: 520px; margin: 0 auto; }

.feature-detail-cta { text-align: center; margin-top: 36px; }

/* ---------- 카카오톡 대화창 목업 ---------- */
.phone-frame {
    max-width: 380px;
    margin: 0 auto;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 14px 0 0;
    overflow: hidden;
}
.phone-notch {
    width: 90px;
    height: 18px;
    background: var(--border);
    border-radius: 999px;
    margin: 0 auto 10px;
}
.kakao-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}
.kakao-chat-back, .kakao-chat-menu { color: var(--muted); font-size: 1.1rem; }
.kakao-chat-title { flex: 1; text-align: center; font-size: 0.95rem; }

.kakao-chat-body {
    background: #ababab14;
    background-color: rgba(150, 150, 160, 0.08);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 640px;
    overflow-y: auto;
}

.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-row.theirs { align-items: flex-start; gap: 8px; }

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.chat-col { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.chat-name { font-size: 0.76rem; color: var(--muted); margin-left: 2px; }

.chat-bubble {
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(20, 20, 30, 0.06);
}
.chat-bubble.mine {
    background: var(--accent);
    color: var(--accent-fg);
    border-bottom-right-radius: 4px;
    max-width: 78%;
}
.chat-bubble.theirs {
    background: var(--card-bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.image-bubble { padding: 6px; }
.image-bubble-img {
    display: block;
    width: 100%;
    border-radius: 10px;
}

/* ---------- 관리자 대시보드 목업(브라우저 프레임) ---------- */
.browser-frame {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.browser-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}
.browser-dots span {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    margin-right: 5px;
}
.browser-url {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.76rem;
    color: var(--muted);
    text-align: center;
}
.browser-body { padding: 22px; background: var(--card-bg); }

.admin-panel { margin-bottom: 24px; }
.admin-panel:last-child { margin-bottom: 0; }
.admin-panel h4 { margin: 0 0 12px; font-size: 0.9rem; color: var(--muted); }

.toggle-list { display: flex; flex-direction: column; gap: 8px; }
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
}
.toggle-pill {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
}
.toggle-pill::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}
.toggle-pill.on { background: #40c057; }
.toggle-pill.on::after { left: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
}
.stat-card .stat-value { font-weight: 800; font-size: 1.1rem; }
.stat-card .stat-label { color: var(--muted); font-size: 0.74rem; margin-top: 4px; }

/* ---------- 요금제: 기능 선택 UI ---------- */
.feature-picker { margin-bottom: 22px; }
.feature-picker-label { font-size: 0.9rem; margin-bottom: 12px; }
.feature-picker-label strong { color: var(--accent-2); }
.feature-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.feature-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    cursor: pointer;
}
.feature-picker-item:has(input:checked) {
    border-color: var(--accent-2);
    background: rgba(59, 91, 219, 0.08);
}
.feature-picker-item:has(input:disabled:not(:checked)) {
    opacity: 0.4;
    cursor: not-allowed;
}
.feature-picker-icon { font-size: 1.1rem; }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 요금제 전용 페이지 ---------- */
.pricing-hero { text-align: center; padding: 60px 20px 20px; }
.pricing-hero h1 { font-size: 2rem; margin: 0 0 12px; }
.pricing-hero p { color: var(--muted); }

.pricing-compare-wrap { overflow-x: auto; margin: 40px 0; }
.pricing-compare {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
.pricing-compare th, .pricing-compare td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 0.88rem;
}
.pricing-compare th:first-child, .pricing-compare td:first-child { text-align: left; }
.pricing-compare thead th { color: var(--muted); font-weight: 600; }
.pricing-compare .check-yes { color: #2f9e44; font-weight: 700; }
.pricing-compare .check-no { color: var(--border); }

/* ---------- 요금제 ---------- */
.pricing-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 280px;
    text-align: center;
    box-shadow: var(--shadow);
}
.plan-card .plan-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.plan-card .plan-price { font-size: 2rem; font-weight: 800; margin: 12px 0; }
.plan-card .plan-price small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.plan-card .plan-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; min-height: 40px; }

/* ---------- 카드형 컨텐츠(마이페이지/구독 등) ---------- */
.page-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card h2 { margin-top: 0; font-size: 1.25rem; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge.active { background: rgba(64, 192, 87, 0.18); color: #2f9e44; }
.badge.pending, .badge.past_due { background: rgba(250, 176, 5, 0.2); color: #e8590c; }
.badge.cancelled, .badge.expired { background: rgba(255, 107, 107, 0.18); color: var(--danger); }

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 9px 6px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    white-space: nowrap;
}
.data-table th { color: var(--muted); font-weight: 600; }
/* [CLAUDE 수정 - 추가] 2026-07-23 - 낚시 랭킹처럼 컬럼이 많은 표는 모바일 폭에 다 안 들어가서
   셀이 짓눌려 글자가 세로로 쪼개지던 문제(위 white-space: nowrap과 세트) - 표 자체를
   가로 스크롤 가능한 컨테이너로 감싸서, 안 들어가면 눌리는 대신 옆으로 스크롤되게 함 */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 6px;
}
/* [CLAUDE 수정 - 추가] 2026-07-22 - "게임별 순위" 페이지에서 로그인한 본인의 행을 강조 표시 */
.data-table tr.my-rank-row { background: rgba(64, 192, 87, 0.12); font-weight: 600; }

/* [CLAUDE 수정 - 추가] 2026-07-22 - "게임별 순위" 페이지의 카테고리 탭 / 방·전체 서브탭 */
.rank-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.rank-cat-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}
.rank-cat-btn.is-active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
    font-weight: 600;
}
.rank-scope-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.rank-scope-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.84rem;
    cursor: pointer;
    white-space: nowrap;
}
.rank-scope-btn.is-active {
    border-color: var(--accent-2);
    color: var(--accent-2);
    font-weight: 600;
}

/* ---------- 로그인 ---------- */
.login-wrap {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    text-align: center;
    padding: 40px 20px;
}
.kakao-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: var(--accent-fg);
    padding: 13px 26px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
}

/* ---------- 게시판 ---------- */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.post-list { border-top: 2px solid var(--fg); }
.post-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--fg);
}
.post-row .title { flex: 1; }
.post-row .pinned { color: var(--accent-2); font-weight: 700; margin-right: 6px; }
.post-row .meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.post-detail-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.post-content { white-space: pre-wrap; line-height: 1.8; margin-bottom: 32px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 6px; font-size: 0.88rem; color: var(--muted); }
.form-field input[type="text"],
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--fg);
    font: inherit;
}
.form-field textarea { min-height: 160px; resize: vertical; }

.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 4px; }

.empty-hint { color: var(--muted); padding: 40px 0; text-align: center; }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 28px 20px;
}
.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.85rem;
}
.footer-inner p { margin: 4px 0; }
.footer-legal-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.footer-legal-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
}
.footer-legal-nav a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- 법적 고지 문서(이용약관/개인정보처리방침/환불정책) ---------- */
.legal-doc { font-size: 0.92rem; line-height: 1.9; }
.legal-doc p { margin: 0 0 22px; }
.legal-doc p:last-child { margin-bottom: 0; }
