/* ============================================================
   오늘의 은혜 — "새벽 묵상" 디자인 시스템 (2026-07 리디자인)
   쪽빛 밤이 여명으로 밝아오는 하늘 아래, 한지 위에 먹으로 쓴 말씀.
   금박 포인트와 붉은 낙관이 하루의 은혜를 봉인한다.
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 먹과 종이 */
    --ink: #2a2620;            /* 먹빛 본문 */
    --ink-soft: #57503f;       /* 옅은 먹 */
    --ink-faint: #8b8271;      /* 담묵 */
    --paper: #f4edda;          /* 한지 바탕 */
    --paper-deep: #ecdfc3;     /* 그늘진 한지 */
    --card: #fbf6e9;           /* 밝은 한지 카드 */

    /* 쪽빛 밤과 여명 */
    --night: #101b2e;
    --indigo: #1d3252;
    --indigo-soft: #2c4a74;
    --dawn-glow: rgba(214, 168, 84, 0.28);

    /* 금박과 낙관 */
    --gold: #b08a3e;
    --gold-bright: #d8b269;
    --gold-pale: #eddec0;
    --dan: #a84532;            /* 붉은 인주(낙관) */
    --dan-soft: #f0ded4;

    /* 상태색 (한복 담채) */
    --success: #4f7040;
    --warning: #a06b23;
    --danger: #a84532;

    --border: #ded1b2;
    --shadow-sm: 0 2px 8px rgba(42, 34, 18, 0.08);
    --shadow-md: 0 8px 24px rgba(42, 34, 18, 0.12);
    --shadow-lg: 0 18px 50px rgba(16, 20, 30, 0.35);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --serif: 'Gowun Batang', 'Noto Serif KR', serif;
    --display: 'Hahmlet', 'Noto Serif KR', serif;
    --sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 구버전 호환 토큰 */
    --primary: #1d3252;
    --primary-light: #2c4a74;
    --accent: #b08a3e;
    --accent-light: #d8b269;
    --bg-main: #f4edda;
    --bg-card: #fbf6e9;
    --text-dark: #2a2620;
    --text-medium: #57503f;
    --text-light: #8b8271;
    --text-muted: #8b8271;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    min-height: 100vh;
    color: var(--ink);
    /* 여명이 밝아오는 쪽빛 밤하늘 */
    background:
        radial-gradient(130% 55% at 50% 102%, var(--dawn-glow) 0%, rgba(214, 168, 84, 0.06) 45%, transparent 70%),
        linear-gradient(180deg, var(--night) 0%, #15243d 48%, var(--indigo) 100%);
    background-attachment: fixed;
}

/* 한지 결 (전면 그레인) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)' opacity='0.9'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}

/* 한지 두루마리 본문 기둥 */
.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.52 0 0 0 0 0.45 0 0 0 0 0.30 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23h)'/%3E%3C/svg%3E"),
        linear-gradient(180deg, var(--paper) 0%, #f1e8d0 100%);
    box-shadow: var(--shadow-lg);
}

::selection {
    background: var(--gold-pale);
    color: var(--ink);
}

/* Sections */
.section {
    display: none;
    min-height: 100vh;
}

.section.active {
    display: block;
    animation: sectionIn 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== INTRO SECTION ========== */
.intro-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 26px 40px;
    text-align: center;
    position: relative;
}

.logo-area {
    margin-bottom: 26px;
    position: relative;
}

.dove-icon {
    font-size: 58px;
    margin-bottom: 18px;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(42, 34, 18, 0.18));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

.intro-content h1 {
    font-family: var(--display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.06em;
    line-height: 1.2;
}

/* 제목 좌우 붓선 */
.tagline {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--ink-soft);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tagline::before,
.tagline::after {
    content: '';
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.tagline::after {
    background: linear-gradient(90deg, var(--gold), transparent);
}

/* 오늘 날짜 — 밤하늘 패널 위 여명 */
.today-info {
    position: relative;
    overflow: hidden;
    color: #f2ead6;
    padding: 18px 36px 16px;
    border-radius: var(--radius-lg);
    margin: 26px 0 8px;
    background:
        radial-gradient(120% 90% at 50% 115%, var(--dawn-glow), transparent 60%),
        linear-gradient(170deg, var(--night) 0%, var(--indigo) 78%, var(--indigo-soft) 100%);
    border: 1px solid rgba(216, 178, 105, 0.35);
    box-shadow: inset 0 0 30px rgba(9, 14, 24, 0.5), var(--shadow-md);
}

/* 패널 속 별 */
.today-info::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 18% 30%, rgba(255,255,255,0.8), transparent 55%),
        radial-gradient(1px 1px at 72% 18%, rgba(255,255,255,0.6), transparent 55%),
        radial-gradient(1.5px 1.5px at 86% 42%, rgba(240, 226, 190, 0.7), transparent 55%),
        radial-gradient(1px 1px at 38% 14%, rgba(255,255,255,0.5), transparent 55%),
        radial-gradient(1px 1px at 55% 38%, rgba(255,255,255,0.35), transparent 55%);
}

.today-info p {
    position: relative;
    font-size: 0.9rem;
    color: rgba(242, 234, 214, 0.85);
}

.today-info p:first-child {
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.12rem;
    margin-bottom: 4px;
    color: #f6efdd;
    letter-spacing: 0.03em;
}

/* 연속 묵상 배지 — 여명의 불씨 */
.streak-badge {
    position: relative;
    display: inline-block;
    margin-top: 10px;
    padding: 5px 16px;
    background: linear-gradient(135deg, rgba(216, 178, 105, 0.22), rgba(216, 178, 105, 0.08));
    border: 1px solid rgba(216, 178, 105, 0.55);
    border-radius: 100px;
    font-size: 0.84rem !important;
    font-weight: 700;
    color: var(--gold-bright) !important;
    letter-spacing: 0.02em;
}

.intro-desc {
    margin: 26px 0 6px;
}

.intro-desc p {
    font-size: 0.93rem;
    color: var(--ink-soft);
    margin: 9px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Main Button — 금박 위의 먹글씨 */
.main-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(160deg, #caa257 0%, var(--gold-bright) 45%, #b98f42 100%);
    color: #241d0e;
    border: 1px solid rgba(120, 88, 30, 0.45);
    padding: 17px 46px;
    font-family: var(--sans);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(150, 110, 40, 0.45), inset 0 1px 0 rgba(255, 245, 220, 0.6);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-top: 22px;
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(150, 110, 40, 0.55), inset 0 1px 0 rgba(255, 245, 220, 0.6);
}

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

/* 금박 광택 스윕 */
.main-btn.pulse::after {
    content: '';
    position: absolute;
    top: -20%;
    bottom: -20%;
    width: 36%;
    left: -50%;
    background: linear-gradient(105deg, transparent, rgba(255, 250, 235, 0.55), transparent);
    transform: skewX(-18deg);
    animation: sheen 3.2s ease-in-out infinite;
}

@keyframes sheen {
    0%, 55% { left: -50%; }
    85%, 100% { left: 130%; }
}

.btn-icon {
    font-size: 1.25rem;
}

.text-btn {
    background: none;
    border: none;
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 0.93rem;
    cursor: pointer;
    padding: 12px;
    margin-top: 14px;
    transition: color 0.2s;
    text-underline-offset: 4px;
}

.text-btn:hover {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--gold);
}

.disclaimer {
    font-size: 0.76rem;
    color: var(--ink-faint);
    margin-top: 30px;
    max-width: 320px;
    line-height: 1.6;
}

.intro-links {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 18px;
}

.intro-links .text-btn {
    font-size: 0.9rem;
    color: var(--ink-soft);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 9px 18px;
    margin-top: 0;
    background: rgba(251, 246, 233, 0.65);
    transition: all 0.2s;
}

.intro-links .text-btn:hover {
    text-decoration: none;
    border-color: var(--gold);
    color: var(--ink);
    background: var(--card);
}

/* ========== INPUT SECTION ========== */
.form-container {
    min-height: 100vh;
    padding: 46px 26px 40px;
}

.form-header {
    text-align: center;
    margin-bottom: 34px;
}

.form-header h2 {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.form-header p {
    color: var(--ink-faint);
    font-size: 0.95rem;
}

/* 헤더 아래 장식선 */
.form-header::after {
    content: '✦';
    display: block;
    margin-top: 14px;
    color: var(--gold);
    font-size: 0.7rem;
    letter-spacing: 0;
    position: relative;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-group {
    margin-bottom: 22px;
}

.input-group.half {
    flex: 1;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
    font-size: 0.93rem;
}

.label-icon {
    font-size: 1.05rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--sans);
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: var(--card);
    box-shadow: inset 0 1px 3px rgba(42, 34, 18, 0.05);
}

.input-group textarea {
    line-height: 1.65;
    resize: vertical;
    min-height: 84px;
    font-family: var(--serif);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: #fffcf3;
    box-shadow: 0 0 0 3px rgba(176, 138, 62, 0.16);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #b3a88f;
}

.input-group input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 52px;
}

.hint {
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin-top: 7px;
}

/* ========== LOADING SECTION ========== */
.loading-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

/* 여명 속 십자가 */
.loading-cross {
    position: relative;
    font-size: 72px;
    color: var(--gold);
    margin-bottom: 34px;
    animation: crossGlow 2.2s ease-in-out infinite alternate;
    text-shadow: 0 0 30px rgba(216, 178, 105, 0.55);
}

.loading-cross::before {
    content: '';
    position: absolute;
    inset: -46px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(216, 178, 105, 0.28) 0%, transparent 65%);
    animation: halo 2.2s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes crossGlow {
    from { opacity: 0.72; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1.05); }
}

@keyframes halo {
    from { transform: scale(0.9); opacity: 0.6; }
    to { transform: scale(1.15); opacity: 1; }
}

.loading-text {
    margin-bottom: 30px;
}

.loading-main {
    font-family: var(--display);
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.loading-sub {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--ink-soft);
    transition: opacity 0.25s ease;
    min-height: 1.6em;
}

.loading-dots {
    display: flex;
    gap: 9px;
}

.loading-dots span {
    width: 9px;
    height: 9px;
    background: var(--gold);
    border-radius: 50%;
    animation: ember 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(216, 178, 105, 0.7);
}

.loading-dots span:nth-child(2) { animation-delay: 0.22s; }
.loading-dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes ember {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-12px); opacity: 1; }
}

/* ========== RESULT SECTION ========== */
.result-container {
    position: relative;
    padding: 22px 18px 44px;
}

/* 결과 카드들 순차 등장 */
.section.active .result-container > * {
    animation: riseIn 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.section.active .result-container > *:nth-child(2) { animation-delay: 0.05s; }
.section.active .result-container > *:nth-child(3) { animation-delay: 0.12s; }
.section.active .result-container > *:nth-child(4) { animation-delay: 0.19s; }
.section.active .result-container > *:nth-child(5) { animation-delay: 0.26s; }
.section.active .result-container > *:nth-child(6) { animation-delay: 0.33s; }
.section.active .result-container > *:nth-child(7) { animation-delay: 0.40s; }
.section.active .result-container > *:nth-child(8) { animation-delay: 0.46s; }
.section.active .result-container > *:nth-child(9) { animation-delay: 0.52s; }
.section.active .result-container > *:nth-child(10) { animation-delay: 0.58s; }

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

/* 새벽 하늘 헤더 */
.result-header {
    position: relative;
    overflow: hidden;
    color: #f2ead6;
    padding: 30px 24px 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 22px;
    background:
        radial-gradient(130% 80% at 50% 118%, var(--dawn-glow), transparent 62%),
        linear-gradient(172deg, var(--night) 0%, var(--indigo) 72%, var(--indigo-soft) 100%);
    border: 1px solid rgba(216, 178, 105, 0.35);
    box-shadow: inset 0 0 40px rgba(9, 14, 24, 0.5), var(--shadow-md);
}

.result-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 15% 24%, rgba(255,255,255,0.75), transparent 55%),
        radial-gradient(1px 1px at 80% 16%, rgba(255,255,255,0.55), transparent 55%),
        radial-gradient(1.5px 1.5px at 68% 34%, rgba(240, 226, 190, 0.65), transparent 55%),
        radial-gradient(1px 1px at 32% 12%, rgba(255,255,255,0.45), transparent 55%);
}

.result-date {
    position: relative;
    font-size: 0.86rem;
    color: rgba(242, 234, 214, 0.75);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.result-header h2 {
    position: relative;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.38rem;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.overall-fortune {
    position: relative;
    background: rgba(9, 14, 24, 0.35);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(216, 178, 105, 0.25);
}

.fortune-label {
    font-size: 0.8rem;
    color: rgba(242, 234, 214, 0.7);
    margin-bottom: 8px;
    letter-spacing: 0.14em;
}

.fortune-stars {
    font-size: 1.7rem;
    letter-spacing: 6px;
    margin-bottom: 8px;
    color: var(--gold-bright);
    text-shadow: 0 0 14px rgba(216, 178, 105, 0.5);
}

.fortune-word {
    font-family: var(--display);
    font-size: 1.22rem;
    font-weight: 700;
    color: #f6efdd;
    letter-spacing: 0.06em;
}

/* ===== 오늘의 말씀 — 성경 인쇄 지면 ===== */
.main-verse-card {
    position: relative;
    background: var(--card);
    padding: 34px 26px 26px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-bottom: 22px;
    border: 1px solid var(--border);
}

/* 이중 괘선 (인쇄 지면) */
.main-verse-card::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(176, 138, 62, 0.4);
    border-radius: 3px;
    pointer-events: none;
}

/* 붉은 낙관 */
.main-verse-card::after {
    content: '은혜';
    position: absolute;
    right: 20px;
    bottom: 52px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dan);
    color: #f8efe2;
    font-family: var(--display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.15;
    border-radius: 7px;
    transform: rotate(4deg);
    box-shadow: 0 2px 6px rgba(120, 40, 24, 0.35), inset 0 0 6px rgba(60, 16, 8, 0.4);
    opacity: 0.92;
    writing-mode: vertical-rl;
}

.verse-badge {
    position: absolute;
    top: -13px;
    left: 22px;
    background: linear-gradient(160deg, #caa257, var(--gold-bright));
    color: #241d0e;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid rgba(120, 88, 30, 0.4);
    box-shadow: 0 3px 8px rgba(150, 110, 40, 0.3);
    z-index: 1;
}

.main-verse-card blockquote {
    font-family: var(--serif);
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 2.05;
    color: var(--ink);
    margin: 14px 6px 18px;
    padding: 0;
    border: none;
    word-break: keep-all;
}

/* 서두 인용 부호 */
.main-verse-card blockquote::first-letter {
    color: var(--dan);
}

.main-verse-card cite {
    display: block;
    text-align: right;
    font-style: normal;
    font-family: var(--serif);
    font-weight: 700;
    color: var(--gold);
    font-size: 0.92rem;
    padding-right: 56px;
    letter-spacing: 0.05em;
}

/* ===== AI 맞춤 묵상 — 먹으로 쓴 답신 ===== */
.ai-reflection-card {
    position: relative;
    background: linear-gradient(180deg, #f3ecd8 0%, var(--paper-deep) 100%);
    padding: 32px 26px 26px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    margin-bottom: 22px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--indigo);
}

.ai-reflection-card .verse-badge {
    background: linear-gradient(160deg, var(--indigo), var(--indigo-soft));
    color: #f2ead6;
    border-color: rgba(16, 27, 46, 0.5);
    box-shadow: 0 3px 8px rgba(16, 27, 46, 0.3);
}

.ai-reflection-card p {
    font-family: var(--serif);
    font-size: 1.03rem;
    line-height: 2;
    color: var(--ink);
    margin-top: 12px;
    white-space: pre-line;
    word-break: keep-all;
}

/* ===== 운세 카테고리 카드 ===== */
.fortune-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.fortune-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left-width: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fortune-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 카테고리별 먹선 색 */
.fortune-card.overall      { border-left-color: var(--indigo); }
.fortune-card.relationship { border-left-color: #8a5a83; }
.fortune-card.mission      { border-left-color: var(--gold); }
.fortune-card.finance      { border-left-color: var(--success); }
.fortune-card.health       { border-left-color: var(--dan); }

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

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

.card-header h3 {
    flex: 1;
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
}

.card-rating {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.card-rating.excellent { background: #e2ead4; color: #3c5628; border: 1px solid #c3d1a8; }
.card-rating.good      { background: #dde6ee; color: #24486e; border: 1px solid #b9c9da; }
.card-rating.normal    { background: #f2e6c9; color: #77531a; border: 1px solid #ddc593; }
.card-rating.caution   { background: #f0dcd3; color: #8c3a28; border: 1px solid #dcb7a7; }

.fortune-card p {
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--ink-soft);
    word-break: keep-all;
}

/* ===== 오늘 조심할 것 — 붉은 먹 경계 ===== */
.warning-card {
    background: linear-gradient(180deg, #f5e6dc 0%, var(--dan-soft) 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid #dcb7a7;
    border-left: 4px solid var(--dan);
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.warning-header span {
    font-size: 1.2rem;
}

.warning-header h3 {
    font-size: 0.98rem;
    color: var(--dan);
    font-weight: 700;
}

.warning-card > p {
    font-size: 0.94rem;
    line-height: 1.75;
    color: #6d3524;
    word-break: keep-all;
}

/* ===== 오늘의 은혜 포인트 — 금박 문갑 ===== */
.lucky-card {
    position: relative;
    background: var(--card);
    padding: 26px 22px 22px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid var(--gold-pale);
    box-shadow: var(--shadow-sm);
}

.lucky-card h3 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lucky-card h3::before,
.lucky-card h3::after {
    content: '';
    flex: 0 0 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.lucky-card h3::after {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.lucky-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lucky-item {
    background: linear-gradient(180deg, #f6efdd, #f0e6cc);
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--gold-pale);
}

.lucky-label {
    display: block;
    font-size: 0.72rem;
    color: var(--ink-faint);
    margin-bottom: 6px;
    letter-spacing: 0.06em;
}

.lucky-value {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ink);
    font-size: 0.92rem;
}

/* ===== 오늘의 기도 — 쪽빛 저녁 기도 ===== */
.prayer-card {
    position: relative;
    overflow: hidden;
    color: #eef2f8;
    padding: 28px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    background:
        radial-gradient(120% 90% at 50% 118%, rgba(216, 178, 105, 0.18), transparent 60%),
        linear-gradient(170deg, #182a47 0%, var(--indigo) 100%);
    border: 1px solid rgba(216, 178, 105, 0.3);
    box-shadow: inset 0 0 30px rgba(9, 14, 24, 0.45), var(--shadow-sm);
}

.prayer-card h3 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #f2ead6;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 0.05em;
}

.prayer-card > p {
    font-family: var(--serif);
    font-size: 1.01rem;
    line-height: 2;
    color: #e8ecf4;
    text-align: center;
    word-break: keep-all;
    white-space: pre-line;
}

.prayer-ending {
    margin-top: 14px;
    font-weight: 700;
    color: var(--gold-bright) !important;
    letter-spacing: 0.04em;
}

/* ===== 오늘의 실천 ===== */
.action-card {
    background: linear-gradient(180deg, #eaeedd 0%, #dfe6cb 100%);
    padding: 24px 22px;
    border-radius: var(--radius-md);
    margin-bottom: 26px;
    border: 1px solid #c8d3ab;
    border-left: 4px solid var(--success);
}

.action-card h3 {
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 700;
    color: #3c5628;
    margin-bottom: 14px;
    text-align: center;
    letter-spacing: 0.04em;
}

.action-item {
    background: rgba(251, 246, 233, 0.85);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--serif);
    font-size: 0.99rem;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    line-height: 1.7;
    border: 1px dashed #b5c294;
    word-break: keep-all;
}

/* ===== 결과 액션 버튼 ===== */
.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--sans);
    font-size: 0.99rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.02em;
}

.action-btn.share {
    background: linear-gradient(170deg, var(--indigo) 0%, var(--indigo-soft) 100%);
    color: #f2ead6;
    border: 1px solid rgba(16, 27, 46, 0.5);
    box-shadow: 0 4px 14px rgba(16, 27, 46, 0.3);
}

.action-btn.save {
    background: linear-gradient(160deg, #caa257 0%, var(--gold-bright) 100%);
    color: #241d0e;
    border: 1px solid rgba(120, 88, 30, 0.45);
    box-shadow: 0 4px 14px rgba(150, 110, 40, 0.35);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Settings Icon Button */
.settings-icon-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(251, 246, 233, 0.8);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon-btn:hover {
    opacity: 1;
    border-color: var(--gold);
    transform: rotate(30deg);
}

/* ========== SETTINGS SECTION ========== */
.settings-container {
    padding: 42px 18px 40px;
    max-width: 480px;
    margin: 0 auto;
}

.settings-header {
    text-align: center;
    margin-bottom: 26px;
}

.settings-header h2 {
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.04em;
}

.settings-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.settings-card h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
}

.settings-info p {
    margin: 8px 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.settings-info strong {
    color: var(--ink-faint);
    font-weight: 500;
    margin-right: 4px;
}

.settings-desc {
    color: var(--ink-faint);
    font-size: 0.88rem;
    margin-bottom: 14px;
    line-height: 1.6;
}

.settings-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: 1.5px solid var(--indigo);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--indigo);
    font-family: var(--sans);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.settings-btn:hover {
    background: var(--indigo);
    color: #f2ead6;
}

.settings-btn.primary {
    background: linear-gradient(170deg, var(--indigo) 0%, var(--indigo-soft) 100%);
    color: #f2ead6;
    border-color: rgba(16, 27, 46, 0.5);
}

.settings-btn.primary:hover {
    filter: brightness(1.12);
}

.settings-btn.danger {
    border-color: var(--dan);
    color: var(--dan);
}

.settings-btn.danger:hover {
    background: var(--dan);
    color: #f8efe2;
}

.danger-zone {
    border: 1px solid #dcb7a7;
    background: linear-gradient(180deg, #f5e8e0, var(--dan-soft));
}

.sync-options {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

/* Code Display */
.code-display,
.code-input-area {
    text-align: center;
    padding: 22px 20px;
    background: linear-gradient(180deg, #f6efdd, #f0e6cc);
    border: 1px solid var(--gold-pale);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.code-label {
    font-size: 0.85rem;
    color: var(--ink-faint);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

.code-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--indigo);
    letter-spacing: 10px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 0 rgba(255, 252, 240, 0.8);
}

.code-timer {
    font-size: 0.88rem;
    color: var(--warning);
    margin-top: 8px;
    font-weight: 600;
}

.code-input-area input {
    display: block;
    width: 100%;
    max-width: 210px;
    margin: 12px auto;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    background: var(--card);
    color: var(--ink);
}

.code-input-area input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 62, 0.16);
}

.code-input-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.code-input-buttons .settings-btn {
    flex: 1;
    margin-top: 0;
}

/* ========== SYNC SECTION ========== */
.sync-container {
    padding: 60px 22px 40px;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    min-height: 100vh;
}

.sync-header {
    margin-bottom: 30px;
}

.sync-header h2 {
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

.sync-header p {
    color: var(--ink-faint);
    font-size: 0.95rem;
}

.sync-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.sync-instruction {
    color: var(--ink-soft);
    margin-bottom: 20px;
    font-size: 0.93rem;
}

.sync-card input {
    display: block;
    width: 100%;
    max-width: 210px;
    margin: 0 auto 20px;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    background: #fffcf3;
    color: var(--ink);
}

.sync-card input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(176, 138, 62, 0.16);
}

.sync-card .main-btn {
    margin: 0 auto;
}

/* Saved User Area */
.saved-user-greeting {
    font-family: var(--serif);
    font-size: 1.08rem;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 4px;
}

/* ========== 모달 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 22, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: modalIn 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(18px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f6efdd, transparent);
}

.modal-header h3 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ink-faint);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-body {
    padding: 16px;
}

/* 저장 옵션 버튼 */
.save-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(180deg, #f6efdd, #f1e8d2);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 12px;
    font-family: var(--sans);
}

.save-option-btn:last-child {
    margin-bottom: 0;
}

.save-option-btn:hover {
    border-color: var(--gold);
    background: #fffcf3;
}

.save-option-btn:active {
    transform: scale(0.98);
}

.save-option-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.save-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.save-option-text strong {
    font-size: 0.98rem;
    color: var(--ink);
}

.save-option-text span {
    font-size: 0.83rem;
    color: var(--ink-faint);
}

/* ========== 토스트 ========== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--ink);
    color: #f4edda;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 0.93rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(216, 178, 105, 0.4);
}

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

.toast.success { background: #33402a; border-color: rgba(163, 190, 120, 0.5); }
.toast.error   { background: #4d2318; border-color: rgba(220, 150, 120, 0.5); }
.toast.info    { background: var(--indigo); border-color: rgba(216, 178, 105, 0.4); }

/* ========== 보관함 ========== */
.archive-container {
    min-height: 100vh;
    padding: 46px 20px 40px;
}

.archive-header {
    text-align: center;
    margin-bottom: 28px;
}

.archive-header h2 {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.archive-header p {
    color: var(--ink-faint);
    font-size: 0.93rem;
}

.archive-header::after {
    content: '✦';
    display: block;
    margin-top: 12px;
    color: var(--gold);
    font-size: 0.65rem;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 보관함 항목 — 서표(책갈피) */
.archive-item {
    position: relative;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
}

.archive-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.archive-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.archive-date {
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.03em;
}

.archive-delete-btn {
    background: none;
    border: none;
    color: var(--ink-faint);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 8px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.archive-delete-btn:hover {
    color: var(--dan);
    background: var(--dan-soft);
}

.archive-verse {
    font-family: var(--serif);
    font-size: 0.99rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.8;
    margin-bottom: 6px;
    word-break: keep-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-ref {
    font-size: 0.83rem;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.archive-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.archive-meta span:first-child {
    color: var(--gold);
    letter-spacing: 2px;
}

.archive-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--ink-faint);
}

.archive-empty p:first-child {
    font-family: var(--serif);
    font-size: 1.08rem;
    margin-bottom: 8px;
    color: var(--ink-soft);
}

.archive-hint {
    font-size: 0.88rem;
}

/* 보관함에서 결과 보기 */
.archive-result-badge {
    display: inline-block;
    background: var(--gold-pale);
    color: var(--ink);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 16px;
    border: 1px solid var(--gold);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 380px) {
    .intro-content h1 {
        font-size: 2rem;
    }

    .main-btn {
        padding: 15px 34px;
        font-size: 1rem;
    }

    .lucky-items {
        grid-template-columns: 1fr;
    }

    .code-number {
        font-size: 1.9rem;
        letter-spacing: 5px;
    }

    .main-verse-card blockquote {
        font-size: 1.12rem;
    }
}
