/* ===========================
   천기누설 운세 - 스타일시트
   동양풍 신비로운 디자인
   =========================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a2e;
    --bg-purple: #1a0a3e;
    --gold: #d4af37;
    --gold-light: #f0c040;
    --gold-bright: #ffd700;
    --red-dark: #8b0000;
    --red: #c0392b;
    --jade: #2e8b57;
    --text-light: #f5f0e1;
    --text-gold: #e8d5a3;
    --text-muted: #a099b0;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(212, 175, 55, 0.3);
    --card-hover: rgba(212, 175, 55, 0.15);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.2);
    --font-serif: 'Noto Serif KR', serif;
    --font-sans: 'Noto Sans KR', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-purple) 50%, #0d0d3b 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===========================
   별 & 구름 배경 애니메이션
   =========================== */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    opacity: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--max-opacity, 1); transform: scale(1); }
}

#clouds-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    width: 200px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatCloud var(--duration) linear infinite;
    opacity: 0;
}

@keyframes floatCloud {
    0% { transform: translateX(-220px); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateX(calc(100vw + 220px)); opacity: 0; }
}

/* ===========================
   광고 슬롯
   =========================== */

/* 사이드 광고 (좌/우) - 데스크탑 전용 */
.ad-sidebar {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: auto;
    flex-direction: column;
    gap: 16px;
}

.ad-sidebar-left {
    left: 16px;
}

.ad-sidebar-right {
    right: 16px;
}

.ad-slot-side {
    width: 160px;
    min-height: 400px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 하단 배너 광고 */
.ad-banner-wrap {
    margin: 20px auto 0;
    max-width: 680px;
}

.ad-slot-banner {
    width: 100%;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 광고 플레이스홀더 (실제 AdSense 적용 시 제거) */
.ad-placeholder {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: rgba(160, 153, 176, 0.3);
    letter-spacing: 0.15em;
    user-select: none;
}

/* 데스크탑(1200px+)에서만 사이드 광고 표시 */
@media (min-width: 1200px) {
    .ad-sidebar {
        display: flex;
    }

    /* 사이드 광고가 있으니 본문이 겹치지 않도록 여유 확보 */
    #app {
        max-width: 820px;
        margin: 0 auto;
    }
}

/* 초대형 화면에서 사이드 광고 위치 조정 */
@media (min-width: 1500px) {
    .ad-sidebar-left {
        left: calc(50% - 720px);
    }

    .ad-sidebar-right {
        right: calc(50% - 720px);
    }
}

/* 모바일에서 하단 배너 약간 축소 */
@media (max-width: 480px) {
    .ad-slot-banner {
        min-height: 60px;
    }
}

/* ===========================
   SPA 스크린 전환
   =========================== */
#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.screen {
    display: none;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

.screen.active {
    display: block;
}

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

/* ===========================
   메인 화면
   =========================== */
.main-header {
    text-align: center;
    padding: 40px 0 30px;
}

.moon-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--gold-light), var(--gold));
    box-shadow: 0 0 40px rgba(240, 192, 64, 0.4), 0 0 80px rgba(240, 192, 64, 0.2);
    position: relative;
    animation: moonPulse 4s ease-in-out infinite;
}

.moon-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 18px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, transparent 0%, rgba(10, 10, 46, 0.3) 100%);
}

@keyframes moonPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(240, 192, 64, 0.4), 0 0 80px rgba(240, 192, 64, 0.2); }
    50% { box-shadow: 0 0 60px rgba(240, 192, 64, 0.6), 0 0 120px rgba(240, 192, 64, 0.3); }
}

.site-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    letter-spacing: 0.3em;
    margin-bottom: 8px;
}

.site-subtitle {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-gold);
    letter-spacing: 0.5em;
    margin-bottom: 12px;
}

.site-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 카테고리 그리드 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 10px 0 40px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-card:hover::before,
.category-card:focus::before {
    left: 100%;
}

.category-card:hover,
.category-card:focus {
    background: var(--card-hover);
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold);
    outline: none;
}

.card-icon {
    font-size: 2.2rem;
    display: block;
}

.card-label {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===========================
   뒤로가기 버튼
   =========================== */
.btn-back {
    background: none;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-gold);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

/* ===========================
   입력 화면
   =========================== */
.input-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 0;
}

.screen-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.screen-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    font-weight: 500;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 10px;
}

.select-wrap {
    position: relative;
}

.select-wrap.full-width {
    width: 100%;
}

.select-wrap select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.select-wrap::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    pointer-events: none;
}

.select-wrap select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.select-wrap select option {
    background: #1a1a4e;
    color: var(--text-light);
}

/* 성별 버튼 */
.gender-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gender-option input {
    display: none;
}

.gender-btn {
    display: block;
    text-align: center;
    padding: 14px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.04);
}

.gender-option input:checked + .gender-btn {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    color: var(--gold-light);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.gender-btn:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.6);
}

/* 운세 보기 버튼 */
.btn-fortune {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 30px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    border: none;
    border-radius: 12px;
    color: var(--bg-dark);
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-fortune:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.4);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: btnGlow 3s ease-in-out infinite;
}

@keyframes btnGlow {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* ===========================
   결과 화면
   =========================== */
.result-container {
    padding: 20px 0 40px;
}

/* 사주팔자 표시 */
.saju-display {
    margin: 24px 0;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.section-label {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 20px;
}

.saju-pillars {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pillar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pillar-top,
.pillar-bottom {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 8px;
}

.pillar-top {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--gold-light);
}

.pillar-bottom {
    background: rgba(46, 139, 87, 0.12);
    border: 1px solid rgba(46, 139, 87, 0.4);
    color: #6dca8d;
}

/* 오행 차트 */
.ohang-display {
    margin: 24px 0;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.ohang-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ohang-bar {
    display: grid;
    grid-template-columns: 40px 1fr 30px;
    align-items: center;
    gap: 12px;
}

.ohang-name {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.3;
}

[data-element="wood"] .ohang-name { color: #4caf50; }
[data-element="fire"] .ohang-name { color: #f44336; }
[data-element="earth"] .ohang-name { color: #ff9800; }
[data-element="metal"] .ohang-name { color: #e0e0e0; }
[data-element="water"] .ohang-name { color: #2196f3; }

.bar-track {
    height: 20px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-out;
    width: 0;
}

[data-element="wood"] .bar-fill { background: linear-gradient(90deg, #2e7d32, #4caf50); }
[data-element="fire"] .bar-fill { background: linear-gradient(90deg, #c62828, #f44336); }
[data-element="earth"] .bar-fill { background: linear-gradient(90deg, #e65100, #ff9800); }
[data-element="metal"] .bar-fill { background: linear-gradient(90deg, #9e9e9e, #e0e0e0); }
[data-element="water"] .bar-fill { background: linear-gradient(90deg, #1565c0, #2196f3); }

.ohang-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

/* 운세 텍스트 */
.fortune-text-area {
    margin: 24px 0;
}

.fortune-section {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin-bottom: 16px;
    animation: textFadeIn 0.8s ease-out;
}

.fortune-section h3 {
    font-family: var(--font-serif);
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.fortune-section p {
    line-height: 1.8;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

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

/* 행운 정보 */
.luck-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.luck-item {
    text-align: center;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.luck-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.luck-value {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--gold-light);
    font-weight: 700;
}

/* 버튼 영역 */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn-action {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gold);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
}

.btn-action.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--bg-dark);
    border: none;
    font-weight: 700;
}

.btn-action.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

/* ===========================
   타로카드 화면
   =========================== */
.tarot-container {
    padding: 20px 0 40px;
    text-align: center;
}

.tarot-progress {
    margin: 20px 0;
    font-size: 1rem;
    color: var(--gold-light);
}

.progress-labels {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 10px;
}

.prog-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.prog-label.active {
    color: var(--gold-light);
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.prog-label.done {
    color: var(--jade);
    border-color: var(--jade);
    background: rgba(46, 139, 87, 0.1);
}

/* 타로 카드 부채꼴 배열 */
.tarot-spread {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 30px 0;
    min-height: 250px;
}

.tarot-card {
    width: 60px;
    height: 96px;
    perspective: 600px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tarot-card:hover:not(.selected):not(.disabled) {
    transform: translateY(-10px);
}

.tarot-card.selected {
    transform: translateY(-14px);
    pointer-events: none;
}

.tarot-card.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.tarot-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.tarot-card.selected .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    text-align: center;
}

.tarot-card-back {
    background: linear-gradient(135deg, #1a0a3e 0%, #2a1a5e 50%, #1a0a3e 100%);
    border: 2px solid var(--gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.tarot-card-back::before {
    content: '☆';
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0.6;
}

.tarot-card-back::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 5px;
}

.tarot-card-front {
    background: linear-gradient(135deg, #f5f0e1, #e8d5a3);
    border: 2px solid var(--gold);
    transform: rotateY(180deg);
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    color: var(--bg-dark);
}

.tarot-card-front .card-symbol {
    font-size: 1.4rem;
}

.tarot-card-front .card-name {
    font-family: var(--font-serif);
    font-size: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.tarot-card-front .card-number {
    font-size: 0.5rem;
    color: var(--red-dark);
}

/* ===========================
   타로 결과 화면
   =========================== */
.tarot-result-container {
    padding: 20px 0 40px;
}

.tarot-cards-result {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.tarot-result-card {
    width: 200px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    animation: cardReveal 0.6s ease-out both;
}

.tarot-result-card:nth-child(2) { animation-delay: 0.2s; }
.tarot-result-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes cardReveal {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tarot-result-card .position-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tarot-result-card .card-visual {
    font-size: 2.5rem;
    margin: 8px 0;
}

.tarot-result-card .card-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--gold-light);
    font-weight: 700;
    margin-bottom: 4px;
}

.tarot-result-card .card-direction {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.tarot-result-card .card-meaning {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
}

/* 종합 해석 */
.tarot-synthesis {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin: 24px 0;
}

.tarot-synthesis h3 {
    font-family: var(--font-serif);
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 12px;
    text-align: center;
}

.tarot-synthesis p {
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ===========================
   로딩 애니메이션
   =========================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 46, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-serif);
    color: var(--gold-light);
    font-size: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===========================
   반응형 디자인
   =========================== */

/* 태블릿 */
@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .site-title {
        font-size: 3rem;
    }

    .site-subtitle {
        font-size: 1.5rem;
    }

    .category-card {
        padding: 30px 20px;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .saju-pillars {
        gap: 24px;
    }

    .pillar-top,
    .pillar-bottom {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .tarot-card {
        width: 70px;
        height: 110px;
    }

    .tarot-result-card {
        width: 220px;
    }
}

/* 데스크탑 */
@media (min-width: 1024px) {
    .screen {
        padding: 30px;
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .main-header {
        padding: 60px 0 40px;
    }

    .moon-icon {
        width: 100px;
        height: 100px;
    }

    .site-title {
        font-size: 3.5rem;
    }

    .tarot-card {
        width: 76px;
        height: 120px;
    }

    .tarot-card-front .card-symbol {
        font-size: 1.8rem;
    }

    .tarot-card-front .card-name {
        font-size: 0.6rem;
    }
}

/* 스크롤바 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* 공유 토스트 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gold);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 200;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===========================
   네비게이션
   =========================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 46, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 640px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 46, 0.96);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }
}

/* ===========================
   푸터
   =========================== */
.site-footer {
    position: relative;
    z-index: 1;
    background: rgba(5, 5, 20, 0.8);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    margin-top: 60px;
    padding: 40px 20px 0;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 30px;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 0.9rem;
    color: var(--text-gold);
    margin-bottom: 12px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    text-align: center;
    padding: 16px 0;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===========================
   메인 콘텐츠 섹션 (index.html)
   =========================== */
.content-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.content-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.content-section > p {
    line-height: 1.8;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 20px;
    text-align: center;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.content-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
}

.content-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.content-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-light);
}

/* 이용 방법 */
.howto-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.howto-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--bg-dark);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50%;
}

.howto-step h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.howto-step p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
}

.howto-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.text-link {
    color: var(--gold-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link:hover {
    color: var(--gold-bright);
}

/* ===========================
   법적 페이지 (privacy, terms)
   =========================== */
.legal-page {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.legal-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.legal-updated {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.legal-section {
    margin-bottom: 32px;
}

.legal-section h2 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.legal-section p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 10px;
}

.legal-section ul {
    list-style: none;
    margin: 10px 0;
}

.legal-section li {
    position: relative;
    padding-left: 20px;
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 6px;
}

.legal-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

/* ===========================
   소개 페이지 (about.html)
   =========================== */
.about-page {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.about-hero {
    text-align: center;
    padding: 40px 0;
}

.about-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    margin-bottom: 8px;
}

.about-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--text-gold);
    letter-spacing: 0.3em;
    margin-bottom: 16px;
}

.about-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.about-section > p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.about-feature {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.about-feature h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.about-feature p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.about-cta {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.about-cta h2 {
    border-bottom: none;
    text-align: center;
}

.about-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.about-buttons .btn-action {
    flex: 0 0 auto;
    padding: 14px 28px;
    text-decoration: none;
    text-align: center;
}

/* ===========================
   가이드 페이지 (guide.html)
   =========================== */
.guide-page {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.guide-hero {
    text-align: center;
    padding: 40px 0 20px;
}

.guide-main-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    margin-bottom: 12px;
}

.guide-intro {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* 목차 */
.guide-toc {
    margin: 30px 0;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.guide-toc h2 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 14px;
    text-align: center;
}

.guide-toc ol {
    list-style: decimal;
    padding-left: 24px;
}

.guide-toc li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* 가이드 아티클 */
.guide-article {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
}

.guide-section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 16px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.guide-article > p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.guide-article h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--gold-light);
    margin: 24px 0 12px;
}

/* 가이드 테이블 */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.guide-table th,
.guide-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.guide-table th {
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-light);
    font-weight: 700;
    font-size: 0.85rem;
}

.guide-table td {
    color: var(--text-light);
}

.guide-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* 가이드 그리드 (천간/지지) */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.guide-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 12px;
}

.guide-item h3 {
    font-size: 1rem;
    margin: 0 0 8px;
}

.guide-item p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 4px;
}

/* 오행 색상 강조 */
.element-wood { border-left: 3px solid #4caf50; }
.element-fire { border-left: 3px solid #f44336; }
.element-earth { border-left: 3px solid #ff9800; }
.element-metal { border-left: 3px solid #e0e0e0; }
.element-water { border-left: 3px solid #2196f3; }

/* 가이드 리스트 */
.guide-list {
    list-style: none;
    margin: 12px 0;
}

.guide-list li {
    position: relative;
    padding-left: 20px;
    font-size: 0.93rem;
    line-height: 1.8;
    margin-bottom: 8px;
}

.guide-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

/* 타로 가이드 그리드 */
.tarot-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.tarot-guide-card {
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    position: relative;
}

.tg-number {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bg-dark);
    background: var(--gold);
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    margin-bottom: 8px;
}

.tarot-guide-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--gold-light);
    margin: 0 0 10px;
}

.tarot-guide-card p {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 6px;
}

/* 팁 그리드 */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.tip-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 12px;
}

.tip-card h3 {
    font-size: 1rem;
    margin: 0 0 10px;
}

.tip-card p {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* 가이드 CTA */
.guide-cta {
    text-align: center;
    margin-top: 30px;
    padding: 24px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 12px;
}

.guide-cta p {
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.guide-cta .btn-action {
    display: inline-block;
    padding: 14px 32px;
    text-decoration: none;
}

/* 가이드 반응형 */
@media (max-width: 640px) {
    .guide-grid,
    .tarot-guide-grid {
        grid-template-columns: 1fr;
    }

    .guide-table {
        font-size: 0.8rem;
    }

    .guide-table th,
    .guide-table td {
        padding: 8px 6px;
    }

    .guide-article {
        padding: 20px 16px;
    }

    .guide-main-title {
        font-size: 1.7rem;
    }

    .about-title {
        font-size: 2rem;
    }
}
