/* rodamemo fortune.rodamemo.com 공통 스타일 */
:root {
    --bg-color: #0d0b1d;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-bg-strong: rgba(255, 255, 255, 0.09);
    --border-color: rgba(255, 255, 255, 0.12);
    --primary-purple: #8b5cf6;
    --accent-gold: #f59e0b;
    --accent-pink: #ec4899;
    --text-main: #f3f4f6;
    --text-sub: #9ca3af;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 40%);
}

a { color: inherit; }

/* Top Family Links Nav */
header.family-nav {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-logo span { color: var(--accent-gold); }

.family-links {
    display: flex;
    gap: 12px;
    list-style: none;
    flex-wrap: wrap;
}

.family-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.family-links a:hover, .family-links a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* 2단 서브 내비게이션 (운세 도구 전체) — 화면 폭에 따라 자동으로 여러 줄로 줄바꿈되어 항목이 잘리지 않음 */
nav.tool-nav {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 10px 16px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

nav.tool-nav a {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}
nav.tool-nav a.active {
    color: #fff;
    background: var(--primary-purple);
    border-color: var(--primary-purple);
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 680px;
    padding: 24px 16px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Service Mode Tab */
.tab-menu {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-purple);
    color: #fff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.hero-section {
    text-align: center;
    padding: 10px 0;
}

.hero-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-sub);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 10px;
}
.form-row .form-group { flex: 1; margin-bottom: 0; }

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-input, select.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.radio-group {
    display: flex;
    gap: 8px;
}
.radio-group label {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.25);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
}
.radio-group input { display: none; }
.radio-group input:checked + span,
.radio-group label:has(input:checked) {
    color: #fff;
}
.radio-group label:has(input:checked) {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-purple), #6366f1);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Test Section UI */
.test-progress {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.test-progress-bar {
    height: 100%;
    width: 20%;
    background: var(--accent-pink);
    transition: width 0.3s ease;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

.option-btn {
    width: 100%;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: var(--accent-pink);
}

/* Result Section Common */
.result-section {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fortune-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.fortune-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
    text-align: center;
}

.score-box {
    background: rgba(0,0,0,0.25);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.score-box .label { font-size: 0.8rem; color: var(--text-sub); }
.score-box .value { font-size: 1.2rem; font-weight: 800; color: var(--accent-gold); margin-top: 4px; }

.fortune-text {
    line-height: 1.6;
    color: #e5e7eb;
    font-size: 0.98rem;
    margin-bottom: 16px;
    white-space: pre-line;
}

/* 사주 8자 표 */
.saju-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
    text-align: center;
}
.saju-col { display: flex; flex-direction: column; gap: 6px; }
.saju-col .pillar-label { font-size: 0.75rem; color: var(--text-sub); font-weight: 600; }
.saju-cell {
    border-radius: 10px;
    padding: 10px 4px;
    border: 1px solid var(--border-color);
    font-weight: 800;
}
.saju-cell .hanja { font-size: 1.3rem; display: block; }
.saju-cell .hangul { font-size: 0.72rem; opacity: 0.85; display: block; margin-top: 2px; }

.oheng-목 { background: rgba(34, 197, 94, 0.22); color: #4ade80; }
.oheng-화 { background: rgba(239, 68, 68, 0.22); color: #f87171; }
.oheng-토 { background: rgba(217, 119, 6, 0.25); color: #fbbf24; }
.oheng-금 { background: rgba(226, 232, 240, 0.18); color: #f1f5f9; }
.oheng-수 { background: rgba(59, 130, 246, 0.22); color: #60a5fa; }

.oheng-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.82rem; }
.oheng-bar-row .oheng-label { width: 34px; font-weight: 700; }
.oheng-bar-track { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); overflow: hidden; }
.oheng-bar-fill { height: 100%; border-radius: 5px; }
.oheng-bar-row .oheng-count { width: 20px; text-align: right; color: var(--text-sub); }

/* Lotto Section */
.lotto-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.lotto-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.lotto-balls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.b-yellow { background: #eab308; }
.b-blue   { background: #3b82f6; }
.b-red    { background: #ef4444; }
.b-gray   { background: #6b7280; }
.b-green  { background: #10b981; }

.btn-lotto-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: var(--accent-gold);
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 10px;
}

/* Share Grid */
.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.share-btn {
    border: none;
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kakao { background: #FEE500; color: #3c1e1e; }
.facebook { background: #1877F2; }
.twitter { background: #000000; border: 1px solid #333; }
.threads { background: #101010; border: 1px solid #333; }
.naver { background: #03C75A; }
.copy { background: #4B5563; }

/* 카테고리 그리드 (홈) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 14px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.15s, background 0.15s;
}
.category-card:hover { background: var(--card-bg-strong); transform: translateY(-2px); }
.category-card .icon { font-size: 1.6rem; }
.category-card .title { font-weight: 800; font-size: 0.98rem; }
.category-card .desc { font-size: 0.78rem; color: var(--text-sub); line-height: 1.4; }

/* 연령대 탭 */
.age-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.age-tabs button {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.25);
    color: var(--text-sub);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.age-tabs button.active { background: var(--accent-pink); color: #fff; border-color: var(--accent-pink); }

/* 아티클 목록 */
.article-list { display: flex; flex-direction: column; gap: 10px; }
.article-item {
    display: block;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    text-decoration: none;
    color: var(--text-main);
}
.article-item .a-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 4px; }
.article-item .a-desc { font-size: 0.82rem; color: var(--text-sub); line-height: 1.5; }
.article-item .a-tag { display: inline-block; margin-top: 8px; font-size: 0.72rem; color: var(--accent-gold); font-weight: 700; }

/* 아티클 본문(prose) */
.prose h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; line-height: 1.4; }
.prose h2 { font-size: 1.15rem; font-weight: 800; margin: 26px 0 10px; color: #fff; }
.prose h3 { font-size: 1rem; font-weight: 700; margin: 18px 0 8px; color: var(--accent-gold); }
.prose p { line-height: 1.8; color: #e5e7eb; font-size: 0.96rem; margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 14px 20px; color: #e5e7eb; line-height: 1.8; font-size: 0.96rem; }
.prose li { margin-bottom: 4px; }
.prose .byline { color: var(--text-sub); font-size: 0.8rem; margin-bottom: 20px; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.85rem; }
.prose th, .prose td { border: 1px solid var(--border-color); padding: 8px 10px; text-align: center; }
.prose th { background: rgba(255,255,255,0.06); }
.prose blockquote {
    border-left: 3px solid var(--primary-purple);
    padding: 10px 16px;
    background: rgba(139,92,246,0.08);
    border-radius: 0 10px 10px 0;
    margin-bottom: 14px;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.disclaimer {
    font-size: 0.76rem;
    color: var(--text-sub);
    line-height: 1.6;
    padding: 12px 14px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
}

.main-blog-banner {
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.main-blog-banner a {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.related-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.related-links a {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-sub);
}

.ad-slot {
    width: 100%;
    min-width: 250px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-slot .ad-label {
    font-size: 0.68rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.view-counter {
    display: inline-flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-sub);
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    align-self: center;
}
.view-counter b { color: var(--accent-gold); }

footer {
    margin-top: auto;
    padding: 24px 16px;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

footer a { color: var(--text-sub); text-decoration: underline; }
footer .foot-links { margin-top: 6px; }
footer .foot-desc { margin-top: 10px; font-size: 0.74rem; opacity: 0.8; max-width: 500px; margin-left: auto; margin-right: auto; }

@media (max-width: 380px) {
    .category-grid { grid-template-columns: 1fr; }
    .share-grid { grid-template-columns: repeat(2, 1fr); }
}
