@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

:root {
    --bg-deep: #06030f;
    --bg-mid: #0e0a1a;
    --bg-card: rgba(18, 10, 36, 0.88);
    --bg-card-hover: rgba(28, 16, 52, 0.92);
    --gold: #c9a96e;
    --gold-light: #f0d48a;
    --gold-dim: #8a7444;
    --gold-faint: rgba(201,169,110,0.08);
    --purple: #9b59b6;
    --purple-deep: #2d1b69;
    --purple-light: #c39bd3;
    --teal: #2dd4bf;
    --teal-dim: #1a6b5a;
    --text-primary: #e8e0f0;
    --text-secondary: #a89bc2;
    --text-dim: #6b5d82;
    --danger: #e74c3c;
    --fire: #e74c3c;
    --water: #3498db;
    --earth: #8B6914;
    --air: #9b59b6;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(201,169,110,0.1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --line: rgba(201,169,110,0.12);
    --line-strong: rgba(201,169,110,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 40%, rgba(45, 27, 105, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 15%, rgba(155, 89, 182, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 85%, rgba(201, 169, 110, 0.06) 0%, transparent 50%);
}

/* Subtle noise texture overlay */
body::after {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
    font-family: 'Cinzel', 'Noto Serif SC', serif;
    color: var(--gold);
    letter-spacing: 0.05em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ============ Decorative Elements ============ */

.divider {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin: 28px 0; color: var(--gold-dim); font-size: 0.6rem;
    letter-spacing: 0.5em; user-select: none;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.ornament {
    text-align: center; color: var(--gold-dim); font-size: 0.5rem;
    letter-spacing: 1em; margin: 20px 0; user-select: none; opacity: 0.6;
}

/* Thin decorative line at top of cards */
.card::before {
    content: ''; display: block; width: 40px; height: 1px; margin: 0 auto 18px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ============ Layout ============ */

.container {
    max-width: 480px; margin: 0 auto; padding: 0 20px;
    position: relative; z-index: 1;
}

.page-header {
    text-align: center; padding: 40px 0 20px;
}
.page-header .logo-text {
    font-family: 'Cinzel', serif; font-size: 2rem; font-weight: 700;
    color: var(--gold); text-shadow: 0 0 40px rgba(201,169,110,0.3);
    letter-spacing: 0.15em;
}
.page-header .logo-sub {
    font-size: 0.8rem; color: var(--text-dim);
    letter-spacing: 0.3em; margin-top: 4px;
}

/* ============ Cards ============ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    position: relative;
}

.card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}

.card-title {
    font-size: 0.95rem; color: var(--gold);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
    letter-spacing: 0.08em;
}
.card-title .icon { font-size: 1.1rem; }

/* ============ Form Elements ============ */

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

.form-label {
    display: block; font-size: 0.82rem; color: var(--text-dim);
    margin-bottom: 8px; letter-spacing: 0.08em;
}

.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

select, input[type="text"], input[type="number"], textarea {
    width: 100%; padding: 12px 16px;
    background: rgba(6, 3, 15, 0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Noto Serif SC', serif;
    font-size: 0.88rem; outline: none;
    transition: var(--transition);
    appearance: none; -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a96e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 1px var(--gold-dim), 0 0 20px rgba(201,169,110,0.08);
}

textarea { resize: vertical; min-height: 80px; }

/* ============ Gender Toggle ============ */

.gender-toggle { display: flex; gap: 10px; }

.gender-option {
    flex: 1; padding: 14px; text-align: center;
    background: rgba(6, 3, 15, 0.7);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition); font-size: 0.88rem;
}
.gender-option:hover { border-color: var(--gold-dim); }
.gender-option.active {
    border-color: var(--gold); background: rgba(201,169,110,0.07);
    box-shadow: 0 0 20px rgba(201,169,110,0.08);
}
.gender-option .emoji { font-size: 1.4rem; display: block; margin-bottom: 4px; }

/* ============ Buttons ============ */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; border: none; border-radius: var(--radius-sm);
    font-family: 'Noto Serif SC', serif; font-size: 0.95rem;
    cursor: pointer; transition: var(--transition); letter-spacing: 0.1em;
    position: relative; overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    color: var(--bg-deep); font-weight: 600;
    box-shadow: 0 4px 24px rgba(201,169,110,0.25);
    width: 100%;
}
.btn-primary::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    transform: translateX(-100%); transition: transform 0.6s ease;
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 32px rgba(201,169,110,0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: transparent; border: 1px solid var(--gold-dim); color: var(--gold);
}
.btn-secondary:hover { background: rgba(201,169,110,0.08); }

/* ============ Progress ============ */

.progress-bar {
    width: 100%; height: 2px;
    background: var(--line); border-radius: 1px;
    margin: 20px 0; overflow: hidden;
}
.progress-bar .fill {
    height: 100%; border-radius: 1px;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light));
    transition: width 0.6s ease;
    box-shadow: 0 0 8px rgba(201,169,110,0.4);
}

.step-indicator {
    text-align: center; font-size: 0.75rem;
    color: var(--text-dim); letter-spacing: 0.25em;
}

/* ============ Result: Reading Cards ============ */

.reading-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

/* Subtle top accent line */
.reading-card::before {
    content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.reading-card .r-title {
    font-size: 0.92rem; color: var(--gold);
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 8px;
    letter-spacing: 0.08em; font-weight: 500;
}

.reading-card .r-body {
    font-size: 0.86rem; color: var(--text-secondary);
    line-height: 2.1;
}

/* ============ Loading ============ */

.loading-overlay {
    position: fixed; inset: 0; background: var(--bg-deep);
    z-index: 1000; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 24px;
}

.loading-orb {
    width: 70px; height: 70px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--purple-deep));
    animation: pulse-orb 2s ease-in-out infinite;
    box-shadow: 0 0 60px rgba(201,169,110,0.25);
}

.loading-text {
    font-size: 0.85rem; color: var(--text-dim);
    letter-spacing: 0.2em; animation: fade-text 2s ease-in-out infinite;
}

/* ============ Followup ============ */

.followup-box { margin-top: 24px; }
.followup-input-row { display: flex; gap: 10px; }
.followup-input-row input { flex: 1; }
.followup-input-row .btn { padding: 12px 20px; white-space: nowrap; }

.followup-history { margin-top: 16px; }

.followup-item {
    margin-bottom: 16px; padding: 16px;
    background: rgba(6,3,15,0.5); border-radius: var(--radius-sm);
    border-left: 2px solid var(--gold-dim);
}
.followup-item .fq { font-size: 0.82rem; color: var(--gold); margin-bottom: 8px; }
.followup-item .fa { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.9; }

/* ============ Animations ============ */

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

@keyframes pulse-orb {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes fade-text {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.fade-in { animation: fadeIn 0.5s ease forwards; }

/* ============ Toast ============ */

.toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-card); border: 1px solid var(--gold-dim);
    color: var(--text-primary); padding: 12px 28px;
    border-radius: var(--radius-sm); font-size: 0.82rem;
    z-index: 9999; transition: transform 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); }

/* ============ Responsive ============ */

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .page-header .logo-text { font-size: 1.6rem; }
}

/* ============ Scrollbar ============ */

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
