/* ============================================================
   Tarot - Quantum Circle Theme
   塔罗占卜 - 量子圆圈主题
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
    --bg-deep: #06060f;
    --bg-cosmic: #0a0a1e;
    --purple-darkest: #0a0418;
    --purple-dark: #150a2e;
    --purple-mid: #2d1b4e;
    --purple-glow: #7b4fbf;
    --blue-cosmic: #0a1030;
    --gold: #c9a84c;
    --gold-light: #f0d78c;
    --gold-pale: #faf0d7;
    --gold-dark: #8b6914;
    --copper: #b87333;
    --text-primary: #e0d5c0;
    --text-secondary: #a898b8;
    --text-muted: #6a5a7a;
    --card-back-bg: #120824;
    --card-border: #3a2560;
    --danger-red: #c0392b;
    --success-green: #27ae60;
    --star-white: #ffffff;
    --shadow-gold: 0 0 30px rgba(201, 168, 76, 0.3);
    --shadow-purple: 0 0 40px rgba(123, 79, 191, 0.4);
    --font-display: 'Georgia', 'Times New Roman', 'STSong', serif;
    --font-body: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Quantum Background ===== */
.quantum-bg {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, #1a0a35 0%, transparent 55%),
        radial-gradient(ellipse at 75% 35%, #0a1035 0%, transparent 45%),
        radial-gradient(ellipse at 25% 65%, #150a2e 0%, transparent 45%),
        linear-gradient(180deg, #06060f 0%, #0a0a1e 35%, #0a0418 100%);
}

/* Background image overlay - load tarot-bg.jpg if exists, otherwise invisible */
.quantum-bg::before {
    content: '';
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('/static/img/tarot-bg.jpg') center/cover no-repeat;
    opacity: 0.25;
    pointer-events: none;
    z-index: -1;
}

/* ===== Stars Container ===== */
.stars-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.star {
    position: absolute; border-radius: 50%; background: #fff;
    animation: twinkle var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
}
@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.8); }
}

/* Cosmic nebula overlay */
.cosmic-nebula {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: -1;
    background:
        radial-gradient(ellipse at 25% 40%, rgba(74, 44, 122, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 25%, rgba(30, 50, 100, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 45% 75%, rgba(45, 27, 78, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 55% 45%, rgba(123, 79, 191, 0.05) 0%, transparent 60%);
}

/* ===== Navbar ===== */
.navbar-mystic {
    background: linear-gradient(180deg, rgba(10, 4, 24, 0.97) 0%, rgba(15, 8, 30, 0.88) 100%);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    backdrop-filter: blur(12px);
    padding: 8px 0;
    position: sticky; top: 0; z-index: 1000;
    position: relative; overflow: hidden;
}
/* 导航栏微光扫过效果 */
.navbar-mystic::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.05), transparent);
    animation: navShine 5s ease-in-out infinite;
    pointer-events: none;
}
.navbar-mystic .container-custom {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
    color: var(--gold-light);
    font-family: var(--font-display);
    font-size: 1.3rem; letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.35);
    text-decoration: none; white-space: nowrap;
}
.nav-brand:hover { color: var(--gold-light); text-shadow: 0 0 25px rgba(201, 168, 76, 0.6); }
.brand-icon { font-size: 0.85rem; }
.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
    color: var(--text-secondary) !important; text-decoration: none;
    font-size: 0.85rem; padding: 6px 10px; border-radius: 4px;
    transition: all 0.3s; white-space: nowrap;
}
.nav-link:hover { color: var(--gold-light) !important; background: rgba(201, 168, 76, 0.08); }
.nav-link.active { color: var(--gold) !important; }
.nav-link-admin { border: 1px solid rgba(201, 168, 76, 0.3); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--gold); margin: 4px 0; border-radius: 2px; transition: 0.3s; }

/* ===== Main Content ===== */
.main-content { position: relative; z-index: 1; padding-bottom: 80px; }

/* ===== Hero Section ===== */
.hero-section {
    text-align: center; padding: 30px 20px 10px; position: relative;
}
.hero-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 400px; height: 200px;
    background: radial-gradient(ellipse, rgba(123, 79, 191, 0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 2.2rem; color: var(--gold-light);
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.4);
    letter-spacing: 6px; margin-bottom: 6px;
}
.hero-subtitle {
    color: var(--text-secondary); font-size: 0.95rem; letter-spacing: 2px;
}
.hero-divider {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; margin-top: 14px;
}
.divider-line { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider-line:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.divider-star { color: var(--gold); font-size: 0.7rem; }

/* ===== Particle Canvas ===== */
#particle-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 50;
}

/* ============================================================
   TAROT CARD GRID - 网格行列布局
   ============================================================ */
.tarot-circle-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 10px auto 0;
    padding: 20px 10px;
}

/* Card grid wrapper - 三行布局 */
.tarot-card-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    perspective: 1000px;
    padding: 4px;
}

/* 单行容器 */
.tarot-column {
    display: flex;
    justify-content: center;
}

/* ===== Individual Tarot Card ===== */
.tarot-card {
    width: 100px;
    height: 154px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s ease,
                filter 0.3s ease,
                z-index 0.2s ease;
    z-index: 1;
    /* 洗牌动画初始状态：不可见，等JS设置位置后再显示 */
    opacity: 0;
    transform: scale(0) rotate(180deg) translateY(-200px);
    /* 行内重叠：只露出约四分之一 */
    margin-left: -75px;
}

/* 牌已就位（洗牌完成后） */
.tarot-card.settled {
    opacity: 1;
    transform: scale(1) rotate(0deg) translateY(0);
}

/* Card inner - the visual card face */
.card-face {
    width: 100%; height: 100%;
    border-radius: 8px;
    border: 2px solid var(--card-border);
    background-color: var(--card-back-bg);
    background-image: url('/static/img/card-back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(123, 79, 191, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Mystical back design - 仅作为无图片时的降级显示 */
.card-face::before {
    content: '';
    position: absolute; inset: 6px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 5px;
    display: none; /* 有 card-back.png 时隐藏装饰层 */
}
.card-face::after {
    content: '✦';
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 2rem; color: rgba(201, 168, 76, 0.3);
    text-shadow: 0 0 15px rgba(201, 168, 76, 0.3);
    display: none; /* 有 card-back.png 时隐藏装饰层 */
}
.card-back-pattern {
    position: absolute; inset: 12px;
    border-radius: 3px;
    display: none; /* 有 card-back.png 时隐藏装饰层 */
}

/* Card hover glow + 能量脉动 */
.tarot-card:not(.drawn):hover {
    z-index: 15 !important;
}
.tarot-card:not(.drawn):hover .card-face {
    border-color: rgba(201, 168, 76, 0.6);
    box-shadow:
        0 4px 25px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(201, 168, 76, 0.2),
        inset 0 0 30px rgba(123, 79, 191, 0.12);
    animation: cardPulse 1.5s ease-in-out infinite alternate;
    transform: scale(1.08) translateY(-8px);
}

/* Highlighted card (first click - stopped state) */
.tarot-card.highlighted {
    z-index: 20 !important;
}
.tarot-card.highlighted .card-face {
    border-color: var(--gold) !important;
    background-color: var(--card-back-bg);
    background-image: url('/static/img/card-back.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow:
        0 8px 35px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(201, 168, 76, 0.35),
        0 0 60px rgba(201, 168, 76, 0.15),
        inset 0 0 40px rgba(123, 79, 191, 0.15) !important;
    transform: scale(1.12) translateY(-6px);
}
.tarot-card.highlighted .card-face::after {
    color: rgba(201, 168, 76, 0.9);
    text-shadow: 0 0 25px rgba(201, 168, 76, 0.8);
}

/* Drawn card - flipped, shows card info */
.tarot-card.drawn {
    z-index: 30 !important;
    pointer-events: none;
}
.tarot-card.drawn .card-face {
    border-color: var(--gold-light) !important;
    background: linear-gradient(135deg, #1a0f35 0%, #251545 100%);
    box-shadow:
        0 8px 35px rgba(0, 0, 0, 0.5),
        0 0 35px rgba(201, 168, 76, 0.45),
        0 0 70px rgba(201, 168, 76, 0.2) !important;
    animation: cardFlipReveal 0.8s ease-out forwards;
}
.tarot-card.drawn .card-face::after {
    content: attr(data-label);
    font-size: 0.85rem; font-family: var(--font-body);
    color: var(--gold-light);
    white-space: nowrap;
}

@keyframes cardFlipReveal {
    0% { transform: rotateY(180deg) scale(1.15); opacity: 0.3; filter: brightness(2); }
    40% { transform: rotateY(90deg) scale(1.25); opacity: 0.7; }
    70% { transform: rotateY(-10deg) scale(1.12); filter: brightness(1.3); }
    100% { transform: rotateY(0deg) scale(1.1); opacity: 1; filter: brightness(1); }
}

.tarot-card.drawn .card-back-pattern { opacity: 0.3; }

/* Draw number badge */
.draw-badge {
    position: absolute;
    top: -10px; right: -10px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #1a0a2e;
    font-weight: bold; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(201, 168, 76, 0.6);
    z-index: 40;
    animation: badgePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes badgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ============================================================
   Instruction Area
   ============================================================ */
.draw-instruction {
    text-align: center; padding: 10px 20px;
}
.instruction-text {
    color: var(--text-secondary); font-size: 0.9rem; letter-spacing: 1px;
}
.step-indicator { color: var(--gold); }
.highlight { color: var(--gold-light); font-weight: bold; }
.highlight-gold { color: var(--gold); font-weight: bold; font-size: 1.1rem; }
.card-counter { margin-top: 6px; color: var(--text-secondary); }
.counter-number {
    font-family: var(--font-display); font-size: 1.6rem;
    color: var(--gold-light); text-shadow: 0 0 12px rgba(201,168,76,0.5);
}
.counter-total { color: var(--text-muted); }

/* ============================================================
   Question + Submit Area
   ============================================================ */
.question-submit-area {
    text-align: center; padding: 10px 20px 5px; max-width: 500px; margin: 0 auto;
}
.question-submit-area.active { display: block; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-label {
    display: block; color: var(--text-secondary); font-size: 0.95rem;
    margin-bottom: 8px; letter-spacing: 1px;
}
.question-label i { color: var(--gold); margin-right: 6px; }

.mystic-input {
    width: 100%; padding: 14px 18px;
    background: rgba(20, 10, 40, 0.6);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 10px;
    color: var(--text-primary); font-size: 0.95rem;
    font-family: var(--font-body);
    resize: none; outline: none;
    transition: all 0.3s;
}
.mystic-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.15), inset 0 0 20px rgba(123, 79, 191, 0.05);
}
.mystic-input::placeholder { color: var(--text-muted); }

.question-footer {
    display: flex; justify-content: flex-end; margin-top: 6px;
}
.char-count { color: var(--text-muted); font-size: 0.8rem; }

/* Submit Button */
.btn-mystic-submit {
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 16px; padding: 14px 40px;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2c7a 50%, #2d1b4e 100%);
    border: 2px solid var(--gold);
    border-radius: 50px;
    color: var(--gold-light); font-size: 1.1rem; font-family: var(--font-display);
    letter-spacing: 3px; cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 25px rgba(201, 168, 76, 0.2);
}
.btn-mystic-submit:hover {
    background: linear-gradient(135deg, #3d2860 0%, #5a3a90 50%, #3d2860 100%);
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.4);
    border-color: var(--gold-light);
    transform: translateY(-2px);
}
.btn-mystic-submit:active { transform: scale(0.97); }
.btn-mystic-submit i { font-size: 1rem; }
.btn-mystic-submit:disabled {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
    filter: grayscale(30%);
}
.btn-mystic-submit.ready {
    animation: pulseReady 1.5s ease-in-out infinite;
}
@keyframes pulseReady {
    0%, 100% { box-shadow: 0 0 25px rgba(201,168,76,0.2); }
    50% { box-shadow: 0 0 45px rgba(201,168,76,0.6); }
}
@keyframes navShine {
    0%, 100% { left: -40%; }
    50% { left: 120%; }
}
@keyframes cardPulse {
    0% { box-shadow: 0 4px 25px rgba(0,0,0,0.5), 0 0 15px rgba(201,168,76,0.1); }
    100% { box-shadow: 0 4px 30px rgba(0,0,0,0.5), 0 0 30px rgba(201,168,76,0.3); }
}

/* ============================================================
   Reading Result Area
   ============================================================ */
.reading-result-section {
    display: none;
    padding: 30px 20px 60px; max-width: 900px; margin: 0 auto;
    animation: fadeInUp 0.8s ease;
}
.reading-result-section.active { display: block; }

.result-header { text-align: center; margin-bottom: 30px; }
.result-title {
    font-family: var(--font-display); font-size: 1.6rem;
    color: var(--gold-light); letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(201,168,76,0.3);
}
.title-star { font-size: 0.7rem; }
.result-question {
    color: var(--text-secondary); margin-top: 6px; font-style: italic;
}

.positions-row {
    display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 30px;
}
.drawn-card-display {
    flex: 1; min-width: 180px; max-width: 250px;
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px; padding: 20px 15px; text-align: center;
}
.drawn-card-display .position-tag {
    display: inline-block; padding: 3px 14px;
    background: rgba(201, 168, 76, 0.15);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 20px;
    color: var(--gold); font-size: 0.8rem; letter-spacing: 2px;
    margin-bottom: 10px;
}
.drawn-card-display .card-name {
    font-family: var(--font-display); font-size: 1.1rem;
    color: var(--gold-light); margin: 8px 0 4px;
}
.drawn-card-display .card-keywords {
    color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 10px;
}
.drawn-card-display .card-meaning {
    color: var(--text-primary); font-size: 0.85rem; line-height: 1.6;
    text-align: left;
}
.reversed-badge {
    display: inline-block; padding: 2px 10px;
    background: rgba(192, 57, 43, 0.2); color: #e74c3c;
    border-radius: 10px; font-size: 0.75rem; margin-left: 6px;
}

.reading-actions {
    display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
    margin-top: 30px;
}
.btn-mystic {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px;
    border-radius: 30px; font-size: 0.95rem; cursor: pointer;
    transition: all 0.3s; border: none; letter-spacing: 1px;
}
.btn-mystic-primary {
    background: linear-gradient(135deg, #c9a84c, #8b6914);
    color: #1a0a2e; font-weight: bold;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}
.btn-mystic-primary:hover {
    box-shadow: 0 0 35px rgba(201, 168, 76, 0.5);
    transform: translateY(-2px);
}
.btn-mystic-outline {
    background: transparent; color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.4);
}
.btn-mystic-outline:hover {
    background: rgba(201, 168, 76, 0.08);
    border-color: var(--gold);
}

/* ============================================================
   Loading Overlay
   ============================================================ */
.loading-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(6, 6, 15, 0.85); z-index: 2000;
    align-items: center; justify-content: center; flex-direction: column;
    backdrop-filter: blur(4px);
}
.loading-overlay.active { display: flex; }
.crystal-ball {
    width: 60px; height: 60px; border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(201,168,76,0.3), rgba(123,79,191,0.2));
    animation: crystalPulse 1.5s ease-in-out infinite;
    position: relative;
}
.crystal-ball-inner {
    position: absolute; top: 15%; left: 20%;
    width: 30%; height: 30%; border-radius: 50%;
    background: rgba(255,255,255,0.3);
}
@keyframes crystalPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(201,168,76,0.3); }
    50% { transform: scale(1.1); box-shadow: 0 0 40px rgba(201,168,76,0.5); }
}
.loading-text { color: var(--text-secondary); margin-top: 18px; font-size: 0.95rem; letter-spacing: 2px; }
.loading-dots { display: flex; gap: 8px; margin-top: 10px; }
.loading-dots .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold);
    animation: dotBounce 1.2s ease-in-out infinite;
}
.loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer-mystic {
    position: relative; z-index: 1;
    background: rgba(10, 4, 24, 0.9);
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    padding: 30px 20px; text-align: center;
}
.footer-brand {
    font-family: var(--font-display); color: var(--gold-light);
    font-size: 1rem; letter-spacing: 3px; margin-bottom: 6px;
}
.footer-disclaimer {
    color: var(--text-muted); font-size: 0.8rem; margin-bottom: 4px;
}
.footer-notice {
    color: rgba(201, 168, 76, 0.5); font-size: 0.72rem;
    max-width: 480px; margin: 4px auto 0; line-height: 1.6;
}
.footer-copyright { color: var(--text-muted); font-size: 0.75rem; }

/* ============================================================
   Toast
   ============================================================ */
.toast-mystic {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: 8px; font-size: 0.9rem;
    z-index: 3000; animation: toastIn 0.4s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast-mystic.success { background: rgba(39,174,96,0.9); color: #fff; }
.toast-mystic.error { background: rgba(192,57,43,0.9); color: #fff; }
.toast-mystic.warning { background: rgba(201,168,76,0.9); color: #1a0a2e; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .hero-title { font-size: 1.5rem; letter-spacing: 3px; }
    .hero-subtitle { font-size: 0.8rem; }
    .nav-links { display: none; flex-direction: column;
        position: absolute; top: 100%; left: 0; width: 100%;
        background: rgba(10, 4, 24, 0.97); padding: 10px;
        border-bottom: 1px solid rgba(201,168,76,0.15);
    }
    .nav-links.open,
    .nav-links.nav-open { display: flex; }
    .nav-toggle { display: block; }
    .tarot-card { width: 78px; height: 120px; margin-left: -58px; }
    .tarot-card-grid { gap: 10px; padding: 4px; }
    .tarot-card.highlighted .card-face { transform: scale(1.12) translateY(-6px); }
    .tarot-card.drawn .card-face { transform: scale(1.08) translateY(-2px); }
    .card-face::after { font-size: 1.3rem; }
    .tarot-card.drawn .card-face::after { font-size: 0.7rem; }
    .draw-badge { width: 22px; height: 22px; font-size: 0.7rem; top: -8px; right: -8px; }
    .positions-row { gap: 10px; }
    .drawn-card-display { min-width: 140px; padding: 14px 10px; }
    .btn-mystic-submit { padding: 12px 30px; font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .tarot-card { width: 62px; height: 96px; margin-left: -46px; }
    .tarot-card-grid { gap: 6px; padding: 2px; }
    .card-face::after { font-size: 1rem; }
    .tarot-card.drawn .card-face::after { font-size: 0.55rem; }
    .hero-title { font-size: 1.2rem; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--purple-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-glow); }

/* ============================================================
   COMMON PAGE STYLES (Wiki, Forum, Suggestion, Coffee, etc.)
   ============================================================ */

/* Page Hero */
.page-hero { text-align: center; padding: 40px 20px 20px; }
.page-title {
    font-family: var(--font-display); font-size: 2rem;
    color: var(--gold-light); letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(201,168,76,0.3);
}
.page-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-top: 6px; letter-spacing: 2px; }
.title-star { color: var(--gold); font-size: 0.7rem; margin: 0 6px; }

/* ===== Wiki Page ===== */
.wiki-section { max-width: 700px; margin: 0 auto; padding: 0 20px; }
.wiki-card {
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px; overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.wiki-card-header { padding: 24px 24px 0; text-align: center; }
.wiki-category-badge {
    display: inline-block; padding: 4px 16px;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 20px; color: var(--gold); font-size: 0.8rem; margin-bottom: 12px;
}
.wiki-title { color: var(--gold-light); font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 2px; }
.wiki-card-body { padding: 20px 24px; }
.wiki-content { color: var(--text-primary); font-size: 0.95rem; line-height: 2; text-align: left; }
.wiki-content p { margin-bottom: 12px; }
.wiki-card-footer { padding: 0 24px 20px; text-align: center; }
.wiki-date { color: var(--text-muted); font-size: 0.8rem; }
.wiki-empty { text-align: center; padding: 60px 20px; }
.wiki-empty-icon { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.wiki-empty h3 { color: var(--text-secondary); margin-bottom: 8px; }
.wiki-empty p { color: var(--text-muted); font-size: 0.9rem; }
.wiki-actions { text-align: center; margin-top: 20px; }

/* ===== Forum List ===== */
.forum-section { max-width: 800px; margin: 0 auto; padding: 0 20px 40px; }
.forum-header-actions { text-align: right; margin-bottom: 20px; }
.forum-post-list { display: flex; flex-direction: column; gap: 14px; }
.forum-post-card {
    display: block; text-decoration: none !important;
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 10px; padding: 18px 20px;
    transition: all 0.3s;
}
.forum-post-card:hover {
    border-color: rgba(201, 168, 76, 0.4);
    background: rgba(30, 15, 50, 0.6);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.1);
}
.post-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.post-card-title {
    color: var(--gold-light); font-size: 1.05rem; font-family: var(--font-display);
    letter-spacing: 1px; margin: 0; flex: 1;
}
.post-title-icon { color: var(--gold); font-size: 0.7rem; }
.post-has-image { color: var(--gold); font-size: 0.85rem; }
.post-card-preview { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; margin: 0; }
.post-card-footer { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(201,168,76,0.08); }
.post-author, .post-time { color: var(--text-muted); font-size: 0.8rem; }
.post-author i, .post-time i { margin-right: 4px; }
.forum-empty { text-align: center; padding: 60px 20px; }
.forum-empty-icon { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.forum-empty h3 { color: var(--text-secondary); margin-bottom: 8px; }
.forum-empty p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* Pagination */
.pagination-mystic { display: flex; justify-content: center; margin-top: 30px; }
.pagination-list { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.page-item .page-link {
    display: block; padding: 8px 14px;
    background: rgba(30, 15, 50, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 6px; color: var(--text-secondary);
    text-decoration: none; font-size: 0.9rem; transition: all 0.3s;
}
.page-item .page-link:hover { border-color: var(--gold); color: var(--gold-light); }
.page-item.active .page-link { background: rgba(201, 168, 76, 0.15); border-color: var(--gold); color: var(--gold-light); }
.page-item.disabled .page-link { opacity: 0.4; cursor: not-allowed; }

/* ===== Forum Detail - Enhanced Mystic Design ===== */
.detail-section { max-width: 900px; margin: 0 auto; padding: 0 20px 40px; }
.detail-back { max-width: 900px; margin: 0 auto; padding: 20px 20px 0; }
.btn-back-mystic {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.9rem; padding: 8px 16px;
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 20px; transition: all 0.3s;
}
.btn-back-mystic:hover { border-color: var(--gold); color: var(--gold-light); }

.detail-card-mystic {
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}
.rejection-warning {
    display: flex; gap: 14px; align-items: flex-start;
    background: rgba(192, 57, 43, 0.08);
    border-bottom: 1px solid rgba(192, 57, 43, 0.25);
    padding: 18px 24px;
}
.rejection-warning.pending-notice {
    background: rgba(201, 168, 76, 0.08);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
}
.rejection-icon { font-size: 1.5rem; color: var(--danger-red); padding-top: 2px; }
.pending-notice .rejection-icon { color: var(--gold); }
.rejection-content h4 {
    color: var(--danger-red); font-size: 0.95rem; margin-bottom: 4px;
}
.pending-notice .rejection-content h4 { color: var(--gold); }
.rejection-reason { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 4px; }
.rejection-reason strong { color: var(--danger-red); }
.rejection-hint { color: var(--text-muted); font-size: 0.8rem; margin: 0; }
.pending-notice .rejection-content p { color: var(--text-secondary); font-size: 0.88rem; margin: 0; }

.detail-card-mystic .detail-header { padding: 28px 28px 0; }
.detail-card-mystic .detail-title {
    color: var(--gold-light); font-family: var(--font-display);
    font-size: 1.5rem; letter-spacing: 2px; margin-bottom: 10px; line-height: 1.4;
}
.detail-title-star { color: var(--gold); font-size: 0.8rem; margin-right: 8px; }
.detail-status-badge { margin-bottom: 14px; }
.badge-approved {
    display: inline-block; padding: 4px 14px;
    background: rgba(39, 174, 96, 0.12);
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 14px; color: var(--success-green); font-size: 0.8rem;
}
.badge-pending {
    display: inline-block; padding: 4px 14px;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 14px; color: var(--gold); font-size: 0.8rem;
}
.badge-rejected {
    display: inline-block; padding: 4px 14px;
    background: rgba(192, 57, 43, 0.12);
    border: 1px solid rgba(192, 57, 43, 0.3);
    border-radius: 14px; color: var(--danger-red); font-size: 0.8rem;
}

.detail-card-mystic .detail-meta {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    padding: 0 28px; margin-top: 8px; margin-bottom: 4px;
}
.detail-author, .detail-time, .detail-review-time {
    color: var(--text-muted); font-size: 0.82rem;
}
.detail-author i, .detail-time i, .detail-review-time i { margin-right: 4px; }
.detail-divider { color: var(--purple-mid); }

.detail-card-mystic .detail-body { padding: 24px 28px; }
.detail-card-mystic .detail-content {
    color: var(--text-primary); font-size: 0.95rem;
    line-height: 2; text-align: left; white-space: pre-line;
}
.detail-card-mystic .detail-image { text-align: center; margin-top: 20px; }
.detail-card-mystic .detail-img {
    max-width: 100%; max-height: 400px; border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.detail-card-mystic .detail-footer {
    display: flex; gap: 12px; flex-wrap: wrap;
    padding: 0 28px 28px; margin-top: 10px;
}

/* ===== Suggestion Form ===== */
.form-section { max-width: 800px; margin: 0 auto; padding: 0 20px 40px; }
.form-card-mystic {
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px; padding: 30px;
}
.form-group-mystic { margin-bottom: 20px; }
.form-label-mystic {
    display: block; color: var(--text-secondary);
    font-size: 0.9rem; margin-bottom: 8px;
}
.form-label-mystic i { color: var(--gold); margin-right: 6px; }
.form-help { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }
.mystic-textarea { min-height: 120px; }
.form-actions { text-align: center; margin-top: 24px; }
.form-message { text-align: center; padding: 40px 20px; }
.form-message-success h3 { color: var(--gold-light); margin: 12px 0 8px; }
.form-message-success p { color: var(--text-secondary); }
.success-icon { font-size: 3rem; color: var(--gold); margin-bottom: 10px; }
.success-sub { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }
.form-message-error { color: var(--danger-red); }

/* ===== Coffee Page ===== */
.coffee-section { max-width: 600px; margin: 0 auto; padding: 0 20px 40px; }
.coffee-card {
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px; padding: 30px; text-align: center;
}
.coffee-thanks { margin-bottom: 24px; }
.coffee-icon-animated { font-size: 3rem; color: var(--gold); margin-bottom: 16px; }
.coffee-icon-animated i { display: inline-block; animation: float 2s ease-in-out infinite; }
.coffee-thanks h2 { color: var(--gold-light); font-family: var(--font-display); letter-spacing: 3px; }
.coffee-intro { color: var(--text-secondary); font-size: 0.9rem; margin-top: 10px; line-height: 1.7; }

/* Disclaimer */
.disclaimer-box {
    background: rgba(192, 57, 43, 0.08);
    border: 2px solid rgba(192, 57, 43, 0.35);
    border-radius: 10px; padding: 20px; margin-bottom: 24px; text-align: left;
}
.disclaimer-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.disclaimer-header i { color: var(--danger-red); font-size: 1.2rem; }
.disclaimer-header h3 { color: var(--danger-red); font-size: 1rem; margin: 0; }
.disclaimer-body p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 6px; padding-left: 4px; }
.disclaimer-body p i { color: var(--gold); margin-right: 6px; font-size: 0.75rem; }
.disclaimer-love { color: var(--gold-light) !important; font-weight: bold; }

/* QR Code */
.qrcode-area { margin-bottom: 24px; text-align: center; }
.qrcode-label { margin-bottom: 16px; color: var(--text-secondary); font-size: 0.9rem; }
.qrcode-img-wrap { display: inline-block; }
.qrcode-img-wrap .qrcode-img { max-width: 220px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.qrcode-img-wrap .qrcode-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 200px; height: 200px; background: rgba(30,15,50,0.6); border: 2px dashed rgba(201,168,76,0.3); border-radius: 10px; margin: 0 auto; }
.qrcode-img-wrap .qrcode-icon { font-size: 3rem; color: var(--text-muted); }
.qrcode-img-wrap .qrcode-text { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.qrcode-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 10px; }
.coffee-blessing { margin-top: 20px; }
.blessing-text { color: var(--gold); font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 2px; }

/* ===== Footer Stars (legacy support) ===== */
.footer-stars { display: none; }
.footer-content { text-align: center; }

/* ===== Reading Result Card: better line breaks ===== */
.drawn-card-display .card-meaning {
    white-space: pre-line; word-break: break-word;
    line-height: 1.8; text-align: left; font-size: 0.88rem;
}
.drawn-card-display .card-name {
    white-space: normal; word-break: break-word;
}
.positions-row {
    display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 30px;
}
.drawn-card-display {
    flex: 1 1 220px; min-width: 180px; max-width: 280px;
    background: rgba(20, 10, 40, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px; padding: 20px 18px;
}

/* ===== Forum Create: File Upload ===== */
.file-upload-area {
    border: 2px dashed rgba(201, 168, 76, 0.3);
    border-radius: 10px; padding: 30px; text-align: center;
    cursor: pointer; transition: all 0.3s;
    background: rgba(20, 10, 40, 0.3);
    position: relative;
}
.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--gold); background: rgba(30, 15, 50, 0.5);
}
.file-input-hidden { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.upload-icon { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 10px; }
.upload-text { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 6px; }
.upload-hint { color: var(--text-muted); font-size: 0.78rem; }
.file-preview { position: relative; }
.file-preview .preview-img { max-width: 100%; max-height: 300px; border-radius: 8px; }
.file-remove-btn {
    position: absolute; top: 8px; right: 8px;
    background: rgba(192, 57, 43, 0.9); color: #fff;
    border: none; border-radius: 50%; width: 28px; height: 28px;
    cursor: pointer; font-size: 0.8rem; line-height: 1;
}

/* ===== Poster Page ===== */
.poster-section { max-width: 750px; margin: 0 auto; padding: 20px 20px 40px; }
.poster-container {
    background: linear-gradient(135deg, #120824 0%, #1a1035 50%, #120824 100%);
    border: 2px solid rgba(201, 168, 76, 0.35);
    border-radius: 16px; padding: 30px 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(201, 168, 76, 0.15);
}
.poster-header { text-align: center; margin-bottom: 24px; position: relative; }
.poster-header-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 100px;
    background: radial-gradient(ellipse, rgba(123, 79, 191, 0.15) 0%, transparent 70%);
    pointer-events: none;
}
.poster-title {
    font-family: var(--font-display); font-size: 1.8rem;
    color: var(--gold-light); letter-spacing: 6px; margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(201,168,76,0.3);
}
.poster-subtitle { color: var(--text-secondary); font-size: 0.9rem; letter-spacing: 3px; }
.poster-divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; }
.poster-divider-line { flex: 1; height: 1px; max-width: 80px; background: linear-gradient(90deg, transparent, rgba(201,168,76,0.4)); }
.poster-divider-line:last-child { background: linear-gradient(90deg, rgba(201,168,76,0.4), transparent); }
.poster-divider-icon { color: var(--gold); font-size: 0.8rem; }
.poster-question { text-align: center; margin-bottom: 24px; }
.poster-question-label { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 2px; margin-bottom: 8px; }
.poster-question-label i { color: var(--gold); margin-right: 4px; }
.poster-question-text { color: var(--gold-light); font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 2px; font-style: italic; }
.poster-no-question { font-style: italic; color: var(--text-muted); }
.poster-cards { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.poster-card {
    flex: 1 1 160px; min-width: 140px; max-width: 200px;
    background: rgba(20, 10, 40, 0.4);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 10px; padding: 16px 12px; text-align: center;
}
.poster-card-position {
    display: inline-block; padding: 3px 14px;
    background: rgba(201,168,76,0.12); color: var(--gold);
    border-radius: 12px; font-size: 0.78rem; letter-spacing: 2px; margin-bottom: 10px;
}
.poster-card-image-wrapper { position: relative; margin-bottom: 10px; }
.poster-card-placeholder {
    width: 100%; aspect-ratio: 3/4; max-height: 160px;
    background: rgba(20, 10, 40, 0.6);
    border: 1px solid rgba(201,168,76,0.15);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}
.placeholder-icon { font-size: 2.5rem; opacity: 0.4; }
.poster-card-image { max-width: 100%; max-height: 200px; border-radius: 8px; }
.poster-card-orientation { text-align: center; margin-top: 6px; }
.orientation-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 0.75rem; }
.upright-badge { background: rgba(39,174,96,0.15); color: var(--success-green); }
.reversed-badge { background: rgba(192,57,43,0.15); color: var(--danger-red); }
.poster-card-info { margin-top: 8px; }
.poster-card-name { color: var(--gold-light); font-family: var(--font-display); font-size: 1rem; margin-bottom: 2px; }
.poster-card-name-en { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 6px; }
.poster-card-keywords { color: var(--text-secondary); font-size: 0.78rem; }
.poster-reading { margin-bottom: 20px; }
.poster-reading-title { color: var(--gold-light); text-align: center; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 3px; margin-bottom: 16px; }
.meaning-position-label {
    color: var(--gold); font-size: 0.9rem; margin: 12px 0 6px;
    font-family: var(--font-display); letter-spacing: 1px;
}
.meaning-orientation-tag { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 0.7rem; margin-left: 6px; }
.meaning-orientation-tag.upright { background: rgba(39,174,96,0.15); color: var(--success-green); }
.meaning-orientation-tag.reversed { background: rgba(192,57,43,0.15); color: var(--danger-red); }
.meaning-text { color: var(--text-primary); font-size: 0.85rem; line-height: 1.7; }
.poster-footer { text-align: center; margin-top: 20px; }
.poster-date { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 6px; }
.poster-disclaimer { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 4px; }
.poster-brand {
    font-family: var(--font-display); color: var(--gold-light);
    font-size: 1rem; letter-spacing: 4px; margin-top: 10px;
}
.poster-actions {
    display: flex; gap: 12px; justify-content: center;
    flex-wrap: wrap; margin-top: 24px;
}

/* ===== Form Success/Error Messages ===== */
.form-message-success { color: var(--success-green); background: rgba(39,174,96,0.1); padding: 12px 16px; border-radius: 8px; }
.form-message-error { color: var(--danger-red); background: rgba(192,57,43,0.1); padding: 12px 16px; border-radius: 8px; }

