/* =================================
   Nocturna｜夜諭 - 網站樣式表
   版本: 2.1
   重構內容: 程式碼整理、選擇器優化、媒體查詢統一
   ================================= */

/* ========== 字體導入 ========== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Noto+Sans+TC:wght@400;500;600&family=Noto+Serif+TC:wght@500;600;700&family=Philosopher:wght@400;700&display=swap');

/* ========== CSS 變數系統 ========== */
:root {
    /* 顏色系統 */
    --primary-gold: #d4af37;
    --primary-gold-light: #ffd700;
    --primary-gold-dark: #b8860b;
    --dark-red: #8b0000;
    --dark-red-darker: #4a0000;
    --deep-purple: #1a1a2e;
    --mystic-blue: #16213e;
    --error-red: #ff6b6b;
    --error-red-dark: #ff4757;
    --warning-orange: #ffa500;
    
    /* 透明度變體 */
    --gold-alpha-10: rgba(212, 175, 55, 0.1);
    --gold-alpha-20: rgba(212, 175, 55, 0.2);
    --gold-alpha-30: rgba(212, 175, 55, 0.3);
    --gold-alpha-60: rgba(212, 175, 55, 0.6);
    --gold-alpha-80: rgba(212, 175, 55, 0.8);
    --gold-alpha-90: rgba(212, 175, 55, 0.9);
    --black-alpha-50: rgba(0, 0, 0, 0.5);
    --black-alpha-60: rgba(0, 0, 0, 0.6);
    --black-alpha-70: rgba(0, 0, 0, 0.7);
    --black-alpha-80: rgba(0, 0, 0, 0.8);
    --black-alpha-90: rgba(0, 0, 0, 0.9);
    
    /* 漸變效果 */
    --gradient-red-dark: linear-gradient(135deg, var(--dark-red), var(--dark-red-darker));
    --gradient-gold: linear-gradient(45deg, var(--primary-gold), var(--primary-gold-dark));
    --gradient-bg: linear-gradient(135deg, #0a0a0a 0%, var(--deep-purple) 50%, var(--mystic-blue) 100%);
    
    /* 間距系統 */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-2xl: 40px;
    --spacing-3xl: 50px;
    
    /* 圓角系統 */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 15px;
    --radius-2xl: 20px;
    --radius-round: 50%;
    --radius-pill: 25px;
    
    /* 陰影系統 */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 15px 50px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 0 15px rgba(212, 175, 55, 0.5);
    --shadow-gold-strong: 0 0 40px rgba(212, 175, 55, 0.8);
    
    /* 過渡效果 */
    --transition-fast: all 0.15s ease;
    --transition-default: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-smooth: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 字體系統 */
    --font-primary: 'Cinzel', 'Noto Sans TC', sans-serif;
    --font-title: 'Cinzel', 'Noto Serif TC', serif;
    --font-subtitle: 'Philosopher', 'Noto Serif TC', serif;
    
    /* Z-index 層級 */
    --z-particles: -1;
    --z-base: 1;
    --z-navbar: 9999;
    --z-modal: 10000;
    --z-modal-overlay: 10001;
}

/* ========== 基礎重置 ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-bg);
    color: var(--primary-gold);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    background-attachment: scroll;
}

/* ========== 導航列 ========== */
.navbar { display: none !important; }

.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.95) 0%, rgba(26, 26, 46, 0.9) 100%);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    z-index: var(--z-navbar);
    border-bottom: 1px solid var(--gold-alpha-30);
    animation: navbarSlideDown 0.5s ease-out;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--spacing-sm);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: var(--transition-default);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-xl);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gold-alpha-30);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--gold-alpha-20), transparent);
    transition: left 0.6s ease;
}

.navbar-brand:hover::before { left: 100%; }

.navbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-logo :is(svg, img) {
    filter: drop-shadow(0 2px 8px var(--gold-alpha-60));
    transition: var(--transition-default);
}

.navbar-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.navbar-name {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--primary-gold);
    font-weight: 600;
    line-height: 1;
    text-shadow: 0 2px 8px var(--gold-alpha-60);
    transition: var(--transition-default);
}

.navbar-subtitle {
    font-family: var(--font-subtitle);
    font-size: 0.9rem;
    color: var(--gold-alpha-80);
    font-style: italic;
    line-height: 1;
    margin-top: 2px;
    transition: var(--transition-default);
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 1;
    min-width: 0;
}

/* 導航按鈕通用樣式 */
.nav-history-btn,
.lang-toggle-btn,
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--black-alpha-60);
    color: var(--primary-gold);
    border: 2px solid var(--gold-alpha-60);
    padding: var(--spacing-sm) 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition-default);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-history-btn::before,
.lang-toggle-btn::before,
.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--gold-alpha-30) 0%, transparent 70%);
    transition: var(--transition-default);
    transform: translate(-50%, -50%);
}

.history-icon,
.lang-icon,
.theme-icon {
    font-size: 1.2rem;
}

.history-text,
.lang-text,
.theme-text {
    font-weight: 600;
}

.history-badge {
    background: var(--error-red-dark);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: var(--spacing-sm);
    min-width: 18px;
    height: 18px;
    display: none !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    animation: badgePulse 2s ease-in-out infinite;
}

/* ========== 主容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 90px var(--spacing-lg) var(--spacing-lg);
    position: relative;
    z-index: var(--z-base);
}

/* ========== 魔法粒子效果 ========== */
.magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-particles);
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary-gold);
    border-radius: var(--radius-round);
    animation: float 6s infinite linear;
    opacity: 0;
}

/* ========== 頁面標題區 ========== */
.header {
    text-align: center;
    padding: var(--spacing-3xl) 0 var(--spacing-2xl) 0;
    border-bottom: 2px solid var(--primary-gold);
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.title {
    font-family: var(--font-title);
    font-size: 3.2rem;
    color: var(--primary-gold);
    text-shadow: 0 0 20px var(--primary-gold), 0 0 40px var(--primary-gold);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.subtitle {
    font-family: var(--font-subtitle);
    font-size: 1.3rem;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: var(--spacing-lg);
}

.ornament {
    text-align: center;
    font-size: 2.2rem;
    color: var(--primary-gold);
    margin: 25px 0;
    animation: ornamentGlow 4s ease-in-out infinite;
}

/* ========== 步驟容器 ========== */
.step {
    display: none;
    animation: fadeInUp 0.8s ease-out;
}

.step.active {
    display: block;
}

/* ========== 按鈕系統 ========== */
.btn {
    background: var(--gradient-red-dark);
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.2rem;
    font-family: var(--font-primary);
    cursor: pointer;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-gold);
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--gold-alpha-30) 0%, transparent 70%);
    transition: var(--transition-smooth);
    transform: translate(-50%, -50%);
}

/* ========== 牌陣選擇 ========== */
.spread-selection {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.spread-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.spread-card {
    background: var(--black-alpha-80);
    border: 2px solid var(--gold-alpha-60);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl) 25px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.spread-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--gold-alpha-10), transparent);
    transition: left 0.5s;
}

.spread-card:hover::before,
.spread-card.active::before {
    left: 100%;
}

.spread-card.active {
    border-color: var(--primary-gold);
    background: var(--gold-alpha-10);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--gold-alpha-30);
}

.spread-icon {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-lg);
    display: block;
    filter: drop-shadow(0 0 10px var(--primary-gold));
    animation: iconFloat 3s ease-in-out infinite;
}

.spread-card h3 {
    font-family: var(--font-subtitle);
    font-size: 1.8rem;
    color: var(--primary-gold);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
}

.spread-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gold-alpha-90);
    margin-bottom: 25px;
    text-align: left;
}

.spread-detail {
    background: rgba(139, 0, 0, 0.6);
    padding: 12px var(--spacing-lg);
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-gold);
    border: 1px solid var(--gold-alpha-30);
    display: inline-block;
    margin-top: var(--spacing-sm);
}

/* ========== 問題輸入表單 ========== */
.question-form {
    text-align: center;
    background: var(--black-alpha-80);
    padding: var(--spacing-3xl);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--primary-gold);
    box-shadow: var(--shadow-gold);
    backdrop-filter: blur(10px);
}

.question-input {
    width: 100%;
    max-width: 600px;
    padding: 18px 25px;
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-xl);
    color: var(--primary-gold);
    font-size: 1.2rem;
    font-family: var(--font-primary);
    margin: 25px 0;
    transition: var(--transition-default);
}

.question-input:focus {
    outline: none;
    border-color: var(--primary-gold-light);
    box-shadow: 0 0 25px var(--gold-alpha-60);
    background: rgba(26, 26, 46, 1);
}

.question-input::placeholder {
    color: var(--gold-alpha-60);
}

#choiceInputs .question-input {
    margin: var(--spacing-md) 0;
    border-color: var(--warning-orange);
}

#spreadDescription {
    animation: fadeInUp 0.6s ease-out;
}

#spreadDescription h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

#spreadDescription h3::before,
#spreadDescription h3::after {
    content: '✦';
    font-size: 1rem;
    opacity: 0.8;
}

/* ========== 洗牌動畫 ========== */
.shuffle-animation {
    text-align: center;
    padding: 80px 0;
    position: relative;
}

.card-stack {
    display: inline-block;
    position: relative;
    width: 120px;
    height: 180px;
    margin: 0 auto;
}

.shuffling-card {
    position: absolute;
    width: 90px;
    height: 140px;
    background: var(--gradient-red-dark);
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-lg);
    animation: shuffleEnhanced 2s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

.shuffling-card:nth-child(1) { animation-delay: 0s; z-index: 3; }
.shuffling-card:nth-child(2) { animation-delay: 0.3s; z-index: 2; }
.shuffling-card:nth-child(3) { animation-delay: 0.6s; z-index: 1; }

.shuffling-card::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary-gold);
    text-shadow: 0 0 10px var(--primary-gold);
    animation: spin 2s linear infinite;
}

.mystical-loading {
    margin-top: var(--spacing-2xl);
    font-size: 1.1rem;
    opacity: 0.8;
    animation: mysticalPulse 2s ease-in-out infinite;
}

/* ========== 選牌區域 ========== */
.cards-container {
    width: 100%;
    margin: var(--spacing-3xl) 0;
    min-height: 450px;
    position: relative;
}

.cards-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--spacing-xl) 0 120px 0;
    position: relative;
}

.cards-scroll-wrapper::-webkit-scrollbar {
    height: 10px;
}

.cards-scroll-wrapper::-webkit-scrollbar-track {
    background: var(--gold-alpha-10);
    border-radius: var(--radius-lg);
}

.cards-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--gradient-gold);
    border-radius: var(--radius-lg);
}

.cards-fan {
    position: relative;
    width: fit-content;
    height: 350px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0 auto;
    padding: 0 60px;
}

.scroll-hint {
    text-align: center;
    color: var(--primary-gold);
    opacity: 0.8;
    font-size: 1.1rem;
    margin-bottom: 25px;
    animation: scrollPulse 3s ease-in-out infinite;
}

.progress {
    text-align: center;
    margin: 25px 0;
    font-size: 1.2rem;
    color: var(--primary-gold);
    font-weight: 600;
}

.progress-bar {
    width: 300px;
    height: 8px;
    background: var(--gold-alpha-20);
    border-radius: var(--spacing-sm);
    margin: var(--spacing-md) auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--primary-gold-light));
    border-radius: var(--spacing-sm);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--primary-gold);
}

/* ========== 塔羅牌樣式 ========== */
.tarot-card {
    width: 85px;
    height: 140px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: var(--transition-smooth);
    transform-origin: center center;
    margin: 0 -12px;
    flex-shrink: 0;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    transform-origin: center center;
    z-index: 1;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    padding: var(--spacing-sm);
    backface-visibility: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

.card-back {
    background: var(--gradient-red-dark);
    color: var(--primary-gold);
    position: relative;
    overflow: hidden;
}

.card-back.lenormand-card-back {
    background: #e7ddcf url('../images/lenormand/card-back.jpg') center / cover no-repeat;
}

.card-back.lenormand-card-back::before,
.card-back.lenormand-card-back::after {
    display: none;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-sm);
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="20" fill="none" stroke="%23d4af37" stroke-width="2" opacity="0.3"/><circle cx="20" cy="20" r="5" fill="%23d4af37" opacity="0.4"/><circle cx="80" cy="80" r="5" fill="%23d4af37" opacity="0.4"/><circle cx="80" cy="20" r="5" fill="%23d4af37" opacity="0.4"/><circle cx="20" cy="80" r="5" fill="%23d4af37" opacity="0.4"/></svg>') center/cover;
}

.card-back::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.2rem;
    color: var(--primary-gold);
    text-shadow: 0 0 15px var(--primary-gold);
    animation: cardPulse 3s ease-in-out infinite;
}

.card-front {
    background: var(--gradient-gold);
    color: var(--dark-red);
    font-weight: bold;
    transform: rotateY(180deg);
    position: relative;
}

.card-front::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid var(--dark-red);
    border-radius: var(--radius-sm);
}

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

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

.tarot-card.selected {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(60%);
    transform: scale(0.95);
}

.tarot-card.flipped.selected {
    animation: selectedCardGlow 2s ease-in-out infinite alternate;
}

.card-select-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-round);
    transform: translate(-50%, -50%) scale(0);
    animation: selectRipple 0.6s ease-out;
    pointer-events: none;
}

.tarot-card.reversed .card-front,
.tarot-card.flipped.reversed .card-front {
    transform: rotateY(180deg) !important;
}

.reversed-label {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background: linear-gradient(45deg, var(--warning-orange), #ff8c00) !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.7rem !important;
    font-weight: bold !important;
    z-index: 10 !important;
    box-shadow: var(--shadow-sm) !important;
    animation: labelPulse 2s ease-in-out infinite;
}

/* ========== 結果展示 ========== */
.selected-cards {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--spacing-3xl);
    margin: var(--spacing-3xl) 0;
    flex-wrap: wrap;
    width: 100%;
}

.selected-card-container {
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.selected-card {
    width: 220px;
    height: 350px;
    background: var(--gradient-gold);
    border: 3px solid var(--dark-red);
    border-radius: 18px;
    color: var(--dark-red);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    animation: cardReveal 0.8s ease-out;
}

.selected-card::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px solid var(--dark-red);
    border-radius: var(--radius-lg);
}

.card-label {
    margin-top: var(--spacing-lg);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-gold);
    text-shadow: 0 0 15px var(--primary-gold);
    font-family: var(--font-subtitle);
}

.card-name {
    font-size: 1.1rem;
    margin-top: var(--spacing-md);
    font-weight: 600;
    opacity: 0.9;
}

.card-interpretation {
    margin-top: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--black-alpha-70);
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-gold);
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
    text-align: left;
    max-width: 450px;
}

/* ========== 增強載入動畫 ========== */
.enhanced-loading {
    text-align: center;
    padding: 60px var(--spacing-lg);
    position: relative;
}

.mystic-symbols {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
    position: relative;
    height: 120px;
}

.symbol {
    font-size: 3rem;
    color: var(--primary-gold);
    animation: symbolRotate 3s linear infinite;
    filter: drop-shadow(0 0 10px var(--primary-gold));
}

.symbol:nth-child(1) { animation-delay: 0s; }
.symbol:nth-child(2) { animation-delay: 0.5s; }
.symbol:nth-child(3) { animation-delay: 1s; }

.energy-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-round);
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: energyPulse 2s ease-in-out infinite;
}

.progress-container {
    margin: var(--spacing-2xl) 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-text {
    font-size: 1.2rem;
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    min-height: 30px;
    transition: var(--transition-slow);
}

.enhanced-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--gold-alpha-20);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.enhanced-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-gold-light) 50%, var(--primary-gold) 100%);
    border-radius: var(--radius-xl);
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 0 15px var(--primary-gold);
    position: relative;
}

.enhanced-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

.mystical-quotes {
    margin: var(--spacing-xl) 0;
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.9;
    line-height: 1.6;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quote-fade {
    animation: quoteFade 4s ease-in-out infinite;
}

/* ========== 歷史記錄頁面 ========== */
.history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.history-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px var(--spacing-md);
    border: 2px solid var(--primary-gold);
    border-radius: var(--radius-pill);
    background: var(--black-alpha-70);
    color: var(--primary-gold);
    font-size: 1rem;
    font-family: var(--font-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-gold-light);
    box-shadow: var(--shadow-gold);
    background: var(--black-alpha-90);
}

.search-input::placeholder {
    color: var(--gold-alpha-60);
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-gold);
    cursor: pointer;
    font-size: 1.2rem;
    padding: var(--spacing-xs);
    border-radius: var(--radius-round);
    transition: var(--transition-default);
}

.search-btn:hover {
    background: var(--gold-alpha-20);
}

.controls-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
}

.filter-dropdown {
    background: var(--black-alpha-80);
    color: var(--primary-gold);
    border: 2px solid var(--gold-alpha-60);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-default);
    flex: 1;
    min-width: 120px;
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px var(--gold-alpha-30);
}

.filter-dropdown option {
    background: var(--deep-purple);
    color: var(--primary-gold);
}

.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--black-alpha-80);
    padding: var(--spacing-xs);
    border-radius: var(--radius-pill);
    border: 2px solid var(--gold-alpha-60);
}

.view-btn {
    padding: 8px var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--primary-gold);
    border-radius: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-default);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.view-btn.active {
    background: var(--primary-gold);
    color: var(--dark-red);
}

.view-btn:hover:not(.active) {
    background: var(--gold-alpha-20);
}

.clear-records-btn {
    background: rgba(139, 0, 0, 0.8);
    color: var(--error-red);
    border: 2px solid var(--error-red);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-default);
    white-space: nowrap;
    flex-shrink: 0;
}

.clear-records-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--error-red-dark);
    color: var(--error-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* 記錄卡片 */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: var(--spacing-2xl);
    justify-content: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--spacing-lg);
}

.records-list {
    display: none;
}

.record-card {
    background: var(--black-alpha-80);
    border: 2px solid var(--gold-alpha-60);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-default);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.record-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--gold-alpha-10), transparent);
    transition: left 0.5s ease;
}

.record-card:hover::before {
    left: 100%;
}

.record-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--gold-alpha-30);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.record-date {
    font-size: 0.9rem;
    color: var(--gold-alpha-80);
    font-family: var(--font-primary);
}

.record-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--gold-alpha-80);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-round);
    transition: var(--transition-default);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    background: var(--gold-alpha-20);
    color: var(--primary-gold);
    transform: scale(1.1);
}

.action-btn.favorite-btn.active {
    color: var(--primary-gold-light);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.action-btn.favorite-btn:not(.active) {
    color: var(--gold-alpha-80);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: var(--radius-round);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.action-btn.clicked::before {
    width: 100px;
    height: 100px;
}

.record-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
    font-family: var(--font-primary);
}

.record-cards-preview {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-md);
    justify-content: center;
}

.card-mini {
    width: 35px;
    height: 55px;
    background: var(--gradient-red-dark);
    border: 1px solid var(--primary-gold);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    transition: var(--transition-default);
}

.card-mini:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.card-mini.reversed::after {
    content: '🔄';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.6rem;
    background: var(--warning-orange);
    border-radius: var(--radius-round);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-summary {
    font-size: 0.9rem;
    color: var(--gold-alpha-90);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-subtitle);
}

.record-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gold-alpha-80);
}

.record-tags {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.tag {
    background: var(--gold-alpha-20);
    color: var(--primary-gold);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    border: 1px solid var(--gold-alpha-30);
    font-family: var(--font-primary);
}

.record-stats {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.page-btn {
    padding: 8px 12px;
    border: 2px solid var(--gold-alpha-60);
    background: transparent;
    color: var(--primary-gold);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-default);
    font-family: var(--font-primary);
    font-weight: 600;
    min-width: 40px;
}

.page-btn:hover, 
.page-btn.active {
    background: var(--primary-gold);
    color: var(--dark-red);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 60px var(--spacing-lg);
    color: var(--gold-alpha-80);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    animation: emptyFloat 3s ease-in-out infinite;
}

.empty-state h3 {
    font-family: var(--font-subtitle);
    color: var(--primary-gold);
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.empty-state p {
    font-family: var(--font-primary);
    margin-bottom: var(--spacing-lg);
}

/* ========== 主題系統 ========== */

/* 米白色優雅主題 */
[data-theme="light"] {
    /* 主色調 - 米白金色系 */
    --primary-gold: #C9A961;
    --primary-gold-light: #E8D4A0;
    --primary-gold-dark: #A08952;
    --dark-red: #8B7355;
    --dark-red-darker: #6B5744;
    
    /* 背景色 - 淺色系 */
    --deep-purple: #F5F3EF;
    --mystic-blue: #EAE6DF;
    
    /* 錯誤與警告色 */
    --error-red: #C85A54;
    --error-red-dark: #B04940;
    --warning-orange: #E8A562;
    
    /* 透明度變體 - 改成淺色 */
    --gold-alpha-10: rgba(201, 169, 97, 0.1);
    --gold-alpha-20: rgba(201, 169, 97, 0.2);
    --gold-alpha-30: rgba(201, 169, 97, 0.3);
    --gold-alpha-60: rgba(201, 169, 97, 0.6);
    --gold-alpha-80: rgba(201, 169, 97, 0.8);
    --gold-alpha-90: rgba(201, 169, 97, 0.9);
    --black-alpha-50: rgba(255, 255, 255, 0.4);
    --black-alpha-60: rgba(255, 255, 255, 0.5);
    --black-alpha-70: rgba(255, 255, 255, 0.6);
    --black-alpha-80: rgba(255, 255, 255, 0.7);
    --black-alpha-90: rgba(255, 255, 255, 0.8);
    
    /* 漸變效果 - 米白色系 */
    --gradient-red-dark: linear-gradient(135deg, #E8D4A0, #C9A961);
    --gradient-gold: linear-gradient(45deg, #E8D4A0, #C9A961);
    --gradient-bg: linear-gradient(135deg, #FDFCFA 0%, #F5F3EF 50%, #EAE6DF 100%);
    
    /* 陰影效果 - 柔和 */
    --shadow-sm: 0 2px 5px rgba(139, 115, 85, 0.15);
    --shadow-md: 0 5px 15px rgba(139, 115, 85, 0.2);
    --shadow-lg: 0 10px 30px rgba(139, 115, 85, 0.25);
    --shadow-xl: 0 15px 50px rgba(139, 115, 85, 0.3);
    --shadow-gold: 0 0 15px rgba(201, 169, 97, 0.4);
    --shadow-gold-strong: 0 0 30px rgba(201, 169, 97, 0.6);
}

/* 背景 */
[data-theme="light"] body {
    background: var(--gradient-bg);
    color: #94440a;
}

/* 標題文字 - 深棕色易讀 */
[data-theme="light"] .title {
    color: #94440a !important;
    text-shadow: 0 2px 8px rgba(90, 74, 56, 0.2);
}

[data-theme="light"] .subtitle {
    color: #6B5744 !important;
}

[data-theme="light"] .ornament {
    color: var(--primary-gold) !important;
}

/* 所有標題統一 */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: #94440a !important;
}

/* 段落文字 */
[data-theme="light"] p {
    color: #94440a !important;
}

/* 強調文字 */
[data-theme="light"] strong {
    color: #3E3020 !important;
    font-weight: 700;
}

/* 導航列 */
[data-theme="light"] .navbar-fixed {
    background: linear-gradient(180deg, rgba(253, 252, 250, 0.98) 0%, rgba(245, 243, 239, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 169, 97, 0.3);
    box-shadow: 0 2px 15px rgba(139, 115, 85, 0.1);
}

[data-theme="light"] .navbar-brand {
    background: rgba(245, 243, 239, 0.6);
    border: 1px solid rgba(201, 169, 97, 0.3);
}

[data-theme="light"] .navbar-brand::before {
    background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.15), transparent);
}

[data-theme="light"] .navbar-name {
    color: #94440a !important;
}

[data-theme="light"] .navbar-subtitle {
    color: var(--primary-gold);
}

[data-theme="light"] .nav-history-btn,
[data-theme="light"] .lang-toggle-btn,
[data-theme="light"] .theme-toggle-btn {
    background: rgba(245, 243, 239, 0.8);
    color: #94440a !important;
    border-color: rgba(201, 169, 97, 0.5);
}

/* 頁面標題區 */
[data-theme="light"] .header {
    border-bottom: 2px solid var(--primary-gold);
}

/* 按鈕 */
[data-theme="light"] .btn {
    background: linear-gradient(135deg, #E8D4A0, #C9A961);
    color: #3E3020 !important;
    border-color: var(--primary-gold-dark);
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
    font-weight: 600;
}

/* 牌陣卡片 */
[data-theme="light"] .spread-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(201, 169, 97, 0.5);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .spread-card h3 {
    color: #94440a !important;
}

[data-theme="light"] .spread-card p {
    color: #6B5744 !important;
}

[data-theme="light"] .spread-card.active {
    border-color: var(--primary-gold);
    background: rgba(232, 212, 160, 0.2);
    box-shadow: 0 15px 40px rgba(201, 169, 97, 0.25);
}

[data-theme="light"] .spread-detail {
    background: rgba(201, 169, 97, 0.2);
    color: #94440a !important;
    border-color: var(--primary-gold);
}

[data-theme="light"] .spread-icon {
    filter: drop-shadow(0 0 10px rgba(201, 169, 97, 0.5));
}

/* 問題輸入 */
[data-theme="light"] .question-form {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(139, 115, 85, 0.15);
}

[data-theme="light"] .question-form h2,
[data-theme="light"] .question-form p {
    color: #94440a !important;
}

[data-theme="light"] .question-input {
    background: rgba(245, 243, 239, 0.9);
    border-color: var(--primary-gold);
    color: #94440a !important;
}

[data-theme="light"] .question-input:focus {
    border-color: var(--primary-gold-light);
    box-shadow: 0 0 20px rgba(201, 169, 97, 0.3);
    background: rgba(253, 252, 250, 1);
}

[data-theme="light"] .question-input::placeholder {
    color: rgba(90, 74, 56, 0.5) !important;
}

[data-theme="light"] #spreadDescription {
    background: rgba(255, 255, 255, 0.4) !important;
    border: 2px solid var(--primary-gold);
    backdrop-filter: blur(8px);
}

[data-theme="light"] #spreadDescription h3 {
    color: #94440a !important;
}

[data-theme="light"] #spreadDescription p {
    color: #6B5744 !important;
}

/* 塔羅牌 */
[data-theme="light"] .card-back {
    background: linear-gradient(135deg, #E8D4A0, #C9A961);
    color: #6B5744;
}

[data-theme="light"] .card-back::before {
    border-color: #6B5744;
}

[data-theme="light"] .card-back::after {
    color: #6B5744;
    text-shadow: 0 0 10px rgba(107, 87, 68, 0.3);
}

[data-theme="light"] .card-front {
    background: linear-gradient(135deg, #FDFCFA, #F5F3EF);
    color: var(--primary-gold-dark);
}

[data-theme="light"] .card-front::before {
    border-color: var(--primary-gold);
}

[data-theme="light"] .shuffling-card {
    background: linear-gradient(135deg, #E8D4A0, #C9A961);
    border-color: var(--primary-gold-dark);
}

[data-theme="light"] .shuffling-card::after {
    color: #6B5744;
}

/* 進度條 */
[data-theme="light"] .progress {
    color: #94440a !important;
}

[data-theme="light"] .progress-bar {
    background: rgba(201, 169, 97, 0.2);
}

[data-theme="light"] .progress-fill {
    background: linear-gradient(90deg, var(--primary-gold), var(--primary-gold-light));
    box-shadow: 0 0 10px rgba(201, 169, 97, 0.5);
}

[data-theme="light"] .scroll-hint {
    color: #94440a !important;
}

/* 結果卡片 */
[data-theme="light"] .selected-card {
    background: linear-gradient(135deg, #FDFCFA, #F5F3EF);
    border-color: var(--primary-gold-dark);
    color: #6B5744;
    box-shadow: 0 15px 50px rgba(139, 115, 85, 0.2);
}

[data-theme="light"] .selected-card::before {
    border-color: var(--primary-gold);
}

[data-theme="light"] .card-label {
    color: #94440a !important;
    text-shadow: 0 0 8px rgba(90, 74, 56, 0.2);
}

[data-theme="light"] .card-name {
    color: #94440a !important;
}

[data-theme="light"] .card-interpretation {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--primary-gold);
    color: #6B5744 !important;
}

/* 增強載入 */
[data-theme="light"] .symbol {
    color: var(--primary-gold);
    filter: drop-shadow(0 0 10px rgba(201, 169, 97, 0.5));
}

[data-theme="light"] .energy-circle {
    border-color: var(--primary-gold);
}

[data-theme="light"] .progress-text {
    color: #94440a !important;
}

[data-theme="light"] .enhanced-progress-bar {
    background: rgba(201, 169, 97, 0.2);
}

[data-theme="light"] .enhanced-progress-fill {
    background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-gold-light) 50%, var(--primary-gold) 100%);
    box-shadow: 0 0 15px rgba(201, 169, 97, 0.5);
}

[data-theme="light"] .mystical-loading,
[data-theme="light"] .mystical-quotes {
    color: #6B5744 !important;
}

/* 歷史記錄 */
[data-theme="light"] .record-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(201, 169, 97, 0.5);
}

[data-theme="light"] .record-card:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(201, 169, 97, 0.25);
}

[data-theme="light"] .record-question {
    color: #94440a !important;
}

[data-theme="light"] .record-summary {
    color: #6B5744 !important;
}

[data-theme="light"] .record-date,
[data-theme="light"] .record-meta {
    color: #8B7355;
}

[data-theme="light"] .search-input {
    background: rgba(245, 243, 239, 0.8);
    border-color: var(--primary-gold);
    color: #94440a !important;
}

[data-theme="light"] .search-input:focus {
    background: rgba(253, 252, 250, 0.95);
    box-shadow: 0 0 15px rgba(201, 169, 97, 0.3);
}

[data-theme="light"] .search-input::placeholder {
    color: rgba(90, 74, 56, 0.5) !important;
}

[data-theme="light"] .search-btn {
    color: var(--primary-gold-dark);
}

[data-theme="light"] .search-btn:hover {
    background: rgba(201, 169, 97, 0.15);
}

[data-theme="light"] .filter-dropdown {
    background: rgba(245, 243, 239, 0.9);
    border-color: rgba(201, 169, 97, 0.5);
    color: #94440a !important;
}

[data-theme="light"] .filter-dropdown:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(201, 169, 97, 0.2);
}

[data-theme="light"] .filter-dropdown option {
    background: #F5F3EF;
    color: #94440a;
}

[data-theme="light"] .view-toggle {
    background: rgba(245, 243, 239, 0.9);
    border-color: rgba(201, 169, 97, 0.5);
}

[data-theme="light"] .view-btn {
    color: #94440a !important;
}

[data-theme="light"] .view-btn.active {
    background: var(--primary-gold);
    color: #FDFCFA;
}

[data-theme="light"] .view-btn:hover:not(.active) {
    background: rgba(201, 169, 97, 0.15);
}

[data-theme="light"] .clear-records-btn {
    background: rgba(200, 90, 84, 0.15);
    color: var(--error-red-dark);
    border-color: var(--error-red);
}

[data-theme="light"] .clear-records-btn:hover {
    background: rgba(200, 90, 84, 0.25);
    border-color: var(--error-red-dark);
}

[data-theme="light"] .page-btn {
    border-color: rgba(201, 169, 97, 0.5);
    color: #94440a !important;
}

[data-theme="light"] .page-btn:hover,
[data-theme="light"] .page-btn.active {
    background: var(--primary-gold);
    color: #FDFCFA;
    border-color: var(--primary-gold);
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
}

[data-theme="light"] .card-mini {
    background: linear-gradient(135deg, #E8D4A0, #C9A961);
    border-color: var(--primary-gold-dark);
}

[data-theme="light"] .tag {
    background: rgba(201, 169, 97, 0.2);
    color: #94440a !important;
    border-color: var(--primary-gold);
}

[data-theme="light"] .action-btn {
    color: #8B7355;
}

[data-theme="light"] .action-btn:hover {
    background: rgba(201, 169, 97, 0.15);
    color: var(--primary-gold-dark);
}

[data-theme="light"] .action-btn.favorite-btn.active {
    color: var(--primary-gold);
    text-shadow: 0 0 8px rgba(201, 169, 97, 0.6);
}

[data-theme="light"] .empty-state {
    color: #8B7355;
}

[data-theme="light"] .empty-state h3 {
    color: #94440a !important;
}

/* ========== 結果頁面專用優化 ========== */

/* 用戶問題框 - 淺色背景 */
[data-theme="light"] #userQuestion {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid var(--primary-gold) !important;
    color: #94440a !important;
}

[data-theme="light"] #userQuestion strong {
    color: #3E3020 !important;
}

/* AI 解讀框 - 淺色背景 */
[data-theme="light"] .ai-interpretation {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid var(--primary-gold) !important;
    color: #94440a !important;
}

[data-theme="light"] .ai-interpretation > div:first-child {
    color: #3E3020 !important;
    font-weight: 700;
}

[data-theme="light"] .ai-interpretation strong {
    color: #3E3020 !important;
}

[data-theme="light"] .ai-interpretation div {
    color: #94440a !important;
}

/* 確保所有結果區域文字可見 */
[data-theme="light"] #resultsContainer,
[data-theme="light"] #resultsContainer * {
    color: #94440a !important;
}

[data-theme="light"] #resultsContainer strong {
    color: #3E3020 !important;
}

[data-theme="light"] #resultsContainer .ornament {
    color: var(--primary-gold) !important;
}

/* 選中卡片顯示區 */
[data-theme="light"] .selected-cards-display {
    background: transparent !important;
}

[data-theme="light"] .selected-cards-display > div {
    background: rgba(255, 255, 255, 0.4) !important;
}

/* 強制覆蓋 inline styles 的深色背景 */
[data-theme="light"] [style*="rgba(0,0,0,0.7)"],
[data-theme="light"] [style*="rgba(0, 0, 0, 0.7)"] {
    background: rgba(255, 255, 255, 0.5) !important;
    color: #94440a !important;
}

[data-theme="light"] [style*="rgba(0,0,0,0.6)"],
[data-theme="light"] [style*="rgba(0, 0, 0, 0.6)"] {
    background: rgba(255, 255, 255, 0.4) !important;
    color: #94440a !important;
}

[data-theme="light"] [style*="rgba(0,0,0,0.8)"],
[data-theme="light"] [style*="rgba(0, 0, 0, 0.8)"] {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #94440a !important;
}

/* 載入進度區 */
[data-theme="light"] .enhanced-loading {
    background: transparent !important;
}

[data-theme="light"] .progress-container {
    background: rgba(255, 255, 255, 0.4);
    padding: 20px;
    border-radius: 15px;
}

/* 明亮主題 - 桌面端特效 */
@media (min-width: 769px) and (hover: hover) {
    [data-theme="light"] .navbar-brand:hover {
        box-shadow: 0 8px 25px rgba(201, 169, 97, 0.3);
    }
    
    [data-theme="light"] .navbar-brand:hover .navbar-logo :is(svg, img) {
        filter: drop-shadow(0 4px 12px rgba(201, 169, 97, 0.6));
    }
    
    [data-theme="light"] .nav-history-btn:hover,
    [data-theme="light"] .lang-toggle-btn:hover,
    [data-theme="light"] .theme-toggle-btn:hover {
        background: rgba(232, 212, 160, 0.3);
        box-shadow: 0 4px 15px rgba(201, 169, 97, 0.2);
    }
    
    [data-theme="light"] .btn:hover {
        background: linear-gradient(135deg, #F0DFB5, #D4B672);
        box-shadow: 0 6px 20px rgba(201, 169, 97, 0.4);
    }
    
    [data-theme="light"] .spread-card:hover {
        box-shadow: 0 20px 50px rgba(201, 169, 97, 0.3);
    }
    
    [data-theme="light"] .tarot-card:hover:not(.selected):not(.flipped) {
        box-shadow: 0 25px 50px rgba(201, 169, 97, 0.5);
    }
}

/* 米白主題 - 移動端背景 */
@media (hover: none) {
    [data-theme="light"] body::after {
        background: 
            radial-gradient(circle at 20% 30%, rgba(201, 169, 97, 0.08) 0%, transparent 30%),
            radial-gradient(circle at 80% 20%, rgba(201, 169, 97, 0.06) 0%, transparent 25%),
            radial-gradient(circle at 40% 70%, rgba(201, 169, 97, 0.07) 0%, transparent 35%),
            linear-gradient(135deg, rgba(253, 252, 250, 0.5) 0%, rgba(245, 243, 239, 0.5) 50%, rgba(234, 230, 223, 0.5) 100%);
        opacity: 1;
    }
}

/* ========== 動畫定義 ========== */
@keyframes navbarSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

@keyframes float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10px) scale(1); opacity: 0; }
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px var(--primary-gold), 0 0 40px var(--primary-gold); transform: scale(1); }
    to { text-shadow: 0 0 25px var(--primary-gold), 0 0 50px var(--primary-gold), 0 0 75px var(--primary-gold); transform: scale(1.01); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: rotate(0deg); }
    50% { opacity: 1; transform: rotate(180deg); }
}

@keyframes ornamentGlow {
    0%, 100% { text-shadow: 0 0 10px var(--primary-gold); }
    50% { text-shadow: 0 0 20px var(--primary-gold), 0 0 30px var(--primary-gold-light); }
}

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

@keyframes shuffleEnhanced {
    0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
    25% { transform: translateX(-40px) rotate(-20deg) scale(1.1); }
    75% { transform: translateX(40px) rotate(20deg) scale(1.1); }
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes mysticalPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; color: var(--primary-gold-light); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes cardPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes selectRipple {
    to { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

@keyframes selectedCardGlow {
    from { box-shadow: 0 0 20px var(--gold-alpha-60); }
    to { box-shadow: 0 0 30px var(--gold-alpha-90); }
}

@keyframes labelPulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes cardReveal {
    from { opacity: 0; transform: rotateY(90deg) scale(0.8); }
    to { opacity: 1; transform: rotateY(0) scale(1); }
}

@keyframes symbolRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes energyPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes quoteFade {
    0%, 20%, 80%, 100% { opacity: 0.9; }
    40%, 60% { opacity: 0.6; }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

@keyframes favoriteClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes deleteShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@keyframes shareBouce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes tagPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 var(--gold-alpha-80); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* ========== 桌面端專屬效果(hover 支持) ========== */
@media (min-width: 769px) and (hover: hover) {
    /* 星星背景 */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="%23d4af37" opacity="0.3"><animate attributeName="opacity" values="0.3;0.8;0.3" dur="3s" repeatCount="indefinite"/></circle><circle cx="5" cy="5" r="0.3" fill="%23d4af37" opacity="0.2"><animate attributeName="opacity" values="0.2;0.6;0.2" dur="4s" repeatCount="indefinite"/></circle><circle cx="15" cy="15" r="0.2" fill="%23d4af37" opacity="0.4"><animate attributeName="opacity" values="0.4;0.9;0.4" dur="2s" repeatCount="indefinite"/></circle></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>') repeat;
        z-index: var(--z-particles);
        will-change: auto;
    }
    
    /* 標題動畫 */
    .title {
        animation: titleGlow 3s ease-in-out infinite alternate;
    }
    
    .title::after {
        content: '✨';
        position: absolute;
        top: -10px;
        right: -30px;
        font-size: 1.5rem;
        animation: sparkle 2s ease-in-out infinite;
    }
    
    /* Hover 效果 */
    .navbar-brand:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
        border-color: var(--primary-gold);
        background: var(--black-alpha-60);
    }
    
    .navbar-brand:hover .navbar-logo :is(svg, img) {
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.8));
    }
    
    .navbar-brand:hover .navbar-name {
        color: var(--primary-gold-light);
        text-shadow: 0 2px 12px rgba(255, 215, 0, 0.8);
    }
    
    .navbar-brand:hover .navbar-subtitle {
        color: rgba(255, 215, 0, 0.9);
    }
    
    .nav-history-btn:hover::before,
    .lang-toggle-btn:hover::before,
    .theme-toggle-btn:hover::before {
        width: 120px;
        height: 120px;
    }
    
    .nav-history-btn:hover,
    .lang-toggle-btn:hover,
    .theme-toggle-btn:hover {
        border-color: var(--primary-gold);
        background: var(--gold-alpha-10);
        transform: translateY(-2px);
        box-shadow: var(--shadow-gold);
    }
    
    .btn:hover::before {
        width: 300px;
        height: 300px;
    }
    
    .btn:hover {
        background: linear-gradient(45deg, #a00000, #600000);
        box-shadow: var(--shadow-gold-strong);
        transform: translateY(-3px) scale(1.05);
    }
    
    .spread-card:hover {
        border-color: var(--primary-gold);
        background: rgba(212, 175, 55, 0.05);
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 50px rgba(212, 175, 55, 0.4);
    }
    
    .tarot-card:hover:not(.selected):not(.flipped) {
        transform: translateY(-25px) scale(1.15);
        z-index: 100;
        box-shadow: 0 25px 50px rgba(212, 175, 55, 0.8);
    }
    
    .tarot-card.flipped:hover {
        transform: none !important;
    }
    
    .tarot-card.reversed:hover .card-front,
    .tarot-card.flipped.reversed:hover .card-front {
        transform: rotateY(180deg) !important;
    }
}

/* ========== 移動端優化(無 hover) ========== */
@media (hover: none) {
    .magic-particles {
        display: none !important;
    }
    
    /* Touch 反饋 */
    .navbar-brand:active {
        transform: scale(0.98);
        background: var(--gold-alpha-10);
    }
    
    .nav-history-btn:active,
    .lang-toggle-btn:active,
    .theme-toggle-btn:active {
        transform: scale(0.95);
        background: var(--gold-alpha-10);
    }
    
    .btn:active {
        background: linear-gradient(45deg, #a00000, #600000);
        box-shadow: 0 0 30px var(--gold-alpha-60);
        transform: scale(0.95);
    }
    
    .spread-card:active {
        transform: scale(0.98);
        background: var(--gold-alpha-10);
    }
    
    .tarot-card:active:not(.selected) {
        transform: scale(1.05);
        z-index: 100;
    }
    
    /* 移動端背景 */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: 
            radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 30%),
            radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 25%),
            radial-gradient(circle at 40% 70%, rgba(212, 175, 55, 0.12) 0%, transparent 35%),
            radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 20%),
            radial-gradient(circle at 10% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 28%),
            url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><defs><pattern id="static-stars" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.8" fill="%23d4af37" opacity="0.4"/><circle cx="30" cy="20" r="0.5" fill="%23d4af37" opacity="0.3"/><circle cx="20" cy="35" r="0.6" fill="%23d4af37" opacity="0.35"/><circle cx="35" cy="8" r="0.4" fill="%23d4af37" opacity="0.25"/><circle cx="5" cy="25" r="0.7" fill="%23d4af37" opacity="0.3"/></pattern></defs><rect width="200" height="200" fill="url(%23static-stars)"/></svg>') repeat,
            linear-gradient(135deg, rgba(139, 0, 0, 0.1) 0%, rgba(26, 26, 46, 0.1) 50%, rgba(22, 33, 62, 0.1) 100%);
        z-index: var(--z-particles);
        opacity: 0.7;
    }
}

/* ========== 響應式設計 - 統一媒體查詢 ========== */

/* 平板橫屏 (≤1200px) */
@media (max-width: 1200px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .records-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: 1000px;
    }
}

/* 平板直屏 / 大手機 (≤768px) */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
        margin-top: 90px;
    }
    
    .navbar-container {
        padding: 12px var(--spacing-md);
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .navbar-brand {
        gap: 12px;
        padding: 8px 12px;
    }
    
    .navbar-logo :is(svg, img) {
        width: 35px;
        height: 35px;
    }
    
    .navbar-name {
        font-size: 1.5rem;
    }
    
    .navbar-subtitle {
        font-size: 0.8rem;
    }
    
    .title {
        font-size: 2.4rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .tarot-card {
        width: 75px;
        height: 125px;
        margin: 0 -10px;
    }
    
    .selected-card {
        width: 200px;
        height: 320px;
    }
    
    .question-form {
        padding: var(--spacing-2xl) 25px;
    }
    
    .spread-options {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 var(--spacing-sm);
    }
    
    .spread-card {
        padding: 25px var(--spacing-lg);
    }
    
    .spread-icon {
        font-size: 3rem;
    }
    
    .spread-card h3 {
        font-size: 1.6rem;
    }
    
    .spread-card p {
        font-size: 0.95rem;
    }
    
    .record-card {
        width: 320px;
    }
    
    .records-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-md);
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        order: 1;
        min-width: auto;
        margin-bottom: 0;
    }
    
    .controls-section {
        order: 2;
        justify-content: space-between;
        margin-bottom: var(--spacing-md);
    }
    
    .filters-section {
        order: 3;
        justify-content: stretch;
    }
    
    .filter-dropdown {
        min-width: 100px;
    }
    
    .view-toggle {
        flex: 1;
        margin-top: 0;
    }
    
    .clear-records-btn {
        flex-shrink: 0;
    }
    
    .reversed-label {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
        top: -6px !important;
        right: -6px !important;
    }
    
    .tarot-card .card-front img {
        border-radius: var(--radius-sm);
    }
}

/* 小手機 (≤480px) */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
        margin-top: 75px;
    }
    
    .navbar-container {
        padding: 8px var(--spacing-md);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
        text-align: left;
    }
    
    .navbar-brand {
        gap: var(--spacing-sm);
        padding: 6px var(--spacing-sm);
    }
    
    .navbar-logo :is(svg, img) {
        width: 30px;
        height: 30px;
    }
    
    .navbar-name {
        font-size: 1.3rem;
    }
    
    .navbar-subtitle {
        font-size: 0.75rem;
    }
    
    .nav-history-btn, 
    .lang-toggle-btn,
    .theme-toggle-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        gap: 4px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .history-text, 
    .lang-text,
    .theme-text {
        display: none;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .tarot-card {
        width: 65px;
        height: 110px;
        margin: 0 -8px;
    }
    
    .selected-card {
        width: 180px;
        height: 290px;
        font-size: 0.9rem;
    }
    
    .question-form {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .cards-fan {
        padding: 0 var(--spacing-xl);
    }
    
    .spread-selection {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .spread-card {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .spread-icon {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-md);
    }
    
    .spread-card h3 {
        font-size: 1.4rem;
        margin-bottom: var(--spacing-md);
    }
    
    .spread-card p {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .spread-detail {
        font-size: 0.85rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .records-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }
    
    .record-card {
        max-width: none;
    }
    
    .filters-section {
        gap: 8px;
    }
    
    .filter-dropdown {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: 90px;
    }
    
    .controls-section {
        gap: var(--spacing-sm);
    }
    
    .view-toggle {
        gap: 3px;
        padding: 3px;
    }
    
    .view-btn {
        padding: 6px var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .clear-records-btn {
        padding: 6px var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .reversed-label {
        font-size: 0.55rem !important;
        padding: 1px 3px !important;
        top: -5px !important;
        right: -5px !important;
    }
    
    .tarot-card .card-front img {
        border-radius: 6px;
    }
}

/* 極小手機 (≤360px) */
@media (max-width: 360px) {
    .nav-history-btn, 
    .lang-toggle-btn,
    .theme-toggle-btn {
        padding: 6px 8px;
        min-width: 40px;
    }
    
    .filters-section {
        flex-direction: column;
    }
    
    .filter-dropdown {
        min-width: auto;
        width: 100%;
    }
}

/* 超小屏幕 (≤320px) */
@media (max-width: 320px) {
    .clear-records-btn span {
        display: none;
    }
    
    .clear-records-btn {
        padding: 8px 12px;
    }
}

/* 打印樣式 */
@media print {
    .navbar-fixed,
    .magic-particles,
    .btn,
    .action-btn,
    .pagination {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ========== Original palette refinement ========== */
:root {
    --primary-gold: #c9a55c;
    --primary-gold-light: #e6cd91;
    --primary-gold-dark: #9f7b37;
    --dark-red: #7b1f2d;
    --dark-red-darker: #3e1019;
    --deep-purple: #121224;
    --mystic-blue: #171a31;
    --gradient-bg: linear-gradient(145deg, #080912 0%, #121224 48%, #171a31 100%);
    --black-alpha-60: rgba(7, 8, 17, 0.72);
    --black-alpha-70: rgba(7, 8, 17, 0.8);
    --black-alpha-80: rgba(7, 8, 17, 0.88);
}

html { scroll-padding-top: 104px; }

body {
    color: #eee5d3;
    background:
        radial-gradient(circle at 78% 16%, rgba(123, 31, 45, 0.13), transparent 30rem),
        radial-gradient(circle at 12% 78%, rgba(70, 61, 112, 0.12), transparent 28rem),
        var(--gradient-bg);
}

.navbar-fixed {
    min-height: 82px;
    background: rgba(8, 9, 18, 0.9);
    border-bottom: 1px solid rgba(201, 165, 92, 0.22);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px) saturate(125%);
    animation: none;
}

.navbar-container {
    min-height: 82px;
    max-width: 1240px;
    padding: 11px 26px;
}

.navbar-brand {
    padding: 7px 10px;
    background: transparent;
    border-color: transparent;
    backdrop-filter: none;
}

.navbar-logo :is(svg, img) { width: 34px; height: 34px; filter: drop-shadow(0 3px 8px rgba(201, 165, 92, 0.28)); }
.navbar-name {
    color: #e4ca8d;
    font-family: var(--font-title);
    font-size: 1.15rem;
    letter-spacing: 0.09em;
    text-shadow: none;
}
.navbar-subtitle { color: #a89f90; font-family: 'Noto Sans TC', sans-serif; font-size: 0.72rem; font-style: normal; letter-spacing: 0.1em; }
.navbar-controls { gap: 8px; }
.nav-history-btn, .lang-toggle-btn, .theme-toggle-btn {
    min-height: 40px;
    padding: 8px 14px;
    color: #d8cbaF;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(201, 165, 92, 0.18);
    border-radius: 10px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.86rem;
    box-shadow: none;
}
.history-icon, .lang-icon, .theme-icon { font-size: 1rem; filter: grayscale(0.25); }

.container {
    max-width: 1240px;
    padding: 108px 24px 40px;
}

.header {
    padding: 34px 0 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(201, 165, 92, 0.24);
}
.title {
    color: #dfc582;
    font-family: var(--font-title);
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    letter-spacing: 0.08em;
    text-shadow: 0 8px 30px rgba(201, 165, 92, 0.18);
    animation: none !important;
}
.title::after { display: none; }
.subtitle { color: #b7ad9f; font-family: var(--font-subtitle); font-style: normal; }
.ornament { color: var(--primary-gold); text-shadow: none; animation: none; opacity: 0.78; }

.step { animation: fadeInUp 0.48s ease-out; }

#step1.active,
.spread-selection,
.question-form {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(22, 22, 43, 0.9), rgba(10, 11, 23, 0.88));
    border: 1px solid rgba(201, 165, 92, 0.24);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(14px);
}

#step1.active {
    min-height: 510px;
    padding: clamp(45px, 8vw, 90px) clamp(22px, 6vw, 74px);
    display: grid;
    place-items: center;
}

#step1.active::before,
.spread-selection::before,
.question-form::before {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    top: -150px;
    right: -110px;
    border: 1px solid rgba(201, 165, 92, 0.13);
    border-radius: 50%;
    box-shadow: 0 0 0 28px rgba(201, 165, 92, 0.025), 0 0 0 58px rgba(201, 165, 92, 0.018);
    pointer-events: none;
}

#step1 h2,
.spread-selection h2,
.question-form h2,
#step4 > h2,
#step5 h2,
#step6 > h2 {
    color: #f1e8d7;
    font-family: var(--font-subtitle) !important;
    font-weight: 700;
    letter-spacing: 0.025em;
}

#step1 p,
.spread-selection > p,
.question-form > p { color: #c2b9aa; font-family: 'Noto Sans TC', sans-serif; }

.btn {
    min-height: 50px;
    padding: 13px 27px;
    color: #f2dfae;
    background: linear-gradient(135deg, #7b1f2d, #551721);
    border: 1px solid rgba(230, 205, 145, 0.72);
    border-radius: 10px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 28px rgba(62, 16, 25, 0.3);
}

.spread-selection { padding: clamp(32px, 5vw, 62px); }
.spread-options { gap: 18px; }
.spread-card {
    min-height: 280px;
    padding: 28px 24px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(201, 165, 92, 0.15);
    border-radius: 16px;
    box-shadow: none;
}
.spread-card.active {
    background: linear-gradient(145deg, rgba(123, 31, 45, 0.24), rgba(201, 165, 92, 0.045));
    border-color: rgba(201, 165, 92, 0.68);
    box-shadow: 0 0 0 3px rgba(201, 165, 92, 0.065);
}
.spread-icon { font-size: 2.7rem; filter: sepia(0.25) saturate(0.8); }
.spread-card h3 { color: #e1c783; font-family: var(--font-subtitle); font-size: 1.42rem; }
.spread-card p { color: #bcb3a5; font-family: 'Noto Sans TC', sans-serif; line-height: 1.75; }
.spread-detail { color: #d4bc7f; background: rgba(201, 165, 92, 0.07); border-color: rgba(201, 165, 92, 0.2); }

.question-form { padding: clamp(34px, 6vw, 68px); }
.question-input,
.search-input,
.filter-dropdown {
    color: #eee5d3;
    background: rgba(5, 6, 14, 0.62);
    border: 1px solid rgba(201, 165, 92, 0.28);
    border-radius: 10px;
    font-family: 'Noto Sans TC', sans-serif;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.question-input:focus, .search-input:focus, .filter-dropdown:focus {
    border-color: #c9a55c;
    box-shadow: 0 0 0 4px rgba(201, 165, 92, 0.075);
}
.question-input::placeholder, .search-input::placeholder { color: #7f786f; }

.cards-container,
.progress,
#userQuestion,
.ai-interpretation,
.record-card,
.empty-state {
    background: rgba(12, 13, 27, 0.78);
    border-color: rgba(201, 165, 92, 0.2);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}
.scroll-hint { color: #b8ab94; animation: none; }
.selected-card { border-color: rgba(201, 165, 92, 0.54); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3); }

@media (min-width: 769px) and (hover: hover) {
    .navbar-brand:hover { transform: none; background: rgba(201, 165, 92, 0.04); border-color: rgba(201, 165, 92, 0.15); box-shadow: none; }
    .nav-history-btn:hover, .lang-toggle-btn:hover, .theme-toggle-btn:hover { background: rgba(201, 165, 92, 0.08); border-color: rgba(201, 165, 92, 0.36); transform: translateY(-1px); box-shadow: none; }
    .btn:hover { background: linear-gradient(135deg, #8e2938, #641c28); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(62, 16, 25, 0.36); }
    .spread-card:hover { background: rgba(201, 165, 92, 0.045); border-color: rgba(201, 165, 92, 0.4); transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18); }
}

@media (max-width: 768px) {
    .navbar-container { min-height: 72px; padding: 9px 15px; }
    .container { margin-top: 0; padding: 92px 14px 28px; }
    .header { padding-top: 22px; }
    #step1.active { min-height: 460px; }
}

@media (max-width: 600px) {
    .navbar-brand { gap: 8px; padding: 4px; }
    .navbar-logo :is(svg, img) { width: 30px; height: 30px; }
    .navbar-name { font-size: 0.95rem; }
    .navbar-subtitle { display: none; }
    .navbar-controls { gap: 3px; }
    .nav-history-btn, .lang-toggle-btn, .theme-toggle-btn { min-width: 34px; padding: 7px; }
    .history-text, .lang-text, .theme-text { display: none; }
    .title { font-size: 2rem; }
    .subtitle { font-size: 0.95rem; }
    #step1.active { padding: 40px 18px; border-radius: 17px; }
    #step1 h2, .spread-selection h2, .question-form h2 { font-size: 1.8rem !important; line-height: 1.45; }
    .spread-selection, .question-form { border-radius: 17px; }
}

/* ========== Refined tarot archive cards ========== */
.records-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
    gap: 22px;
    align-items: stretch;
}

.record-card {
    display: flex;
    min-height: 440px;
    max-width: 360px;
    padding: 22px;
    flex-direction: column;
    color: #d9cfbd;
    background:
        radial-gradient(circle at 92% 4%, rgba(123,31,45,.16), transparent 10rem),
        linear-gradient(150deg, rgba(20,20,39,.98), rgba(9,10,21,.96));
    border: 1px solid rgba(201,165,92,.2);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(0,0,0,.2);
}

.record-card::before {
    inset: 10px;
    width: auto;
    height: auto;
    background: none;
    border: 1px solid rgba(201,165,92,.07);
    border-radius: 12px;
    pointer-events: none;
}

.record-card-accent {
    position: absolute;
    top: 0;
    left: 22px;
    width: 54px;
    height: 2px;
    background: linear-gradient(90deg, #7b1f2d, #c9a55c);
    box-shadow: 0 0 12px rgba(201,165,92,.24);
}

.record-header { position: relative; z-index: 2; margin-bottom: 20px; }
.record-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #d5c49c;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .82rem;
    font-weight: 500;
}
.record-date span { color: #746e64; font-size: .68rem; font-weight: 400; }
.record-mode-badge {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 8px;
    color: #bda56d;
    background: rgba(201,165,92,.055);
    border: 1px solid rgba(201,165,92,.15);
    border-radius: 999px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .64rem;
}

.record-actions { gap: 5px; }
.record-actions .action-btn {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: #8d8578;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(201,165,92,.1);
    border-radius: 9px;
}
.record-actions .action-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.record-actions .favorite-btn.active { color: #ddbf76; background: rgba(201,165,92,.09); text-shadow: none; }
.record-actions .favorite-btn.active svg { fill: rgba(201,165,92,.34); }
.record-actions .delete-btn { color: #9d6970; }

.record-eyebrow {
    margin-bottom: 7px;
    color: #827b70;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: .12em;
}
.record-question {
    min-height: 58px;
    margin-bottom: 18px;
    color: #ece1ca;
    font-family: var(--font-subtitle);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.65;
}

.record-cards-preview {
    min-height: 78px;
    margin: 0 -5px 18px;
    padding: 11px 8px;
    align-items: center;
    background: rgba(0,0,0,.15);
    border-top: 1px solid rgba(201,165,92,.08);
    border-bottom: 1px solid rgba(201,165,92,.08);
}
.record-cards-preview .card-mini {
    width: 36px;
    height: 58px;
    overflow: hidden;
    border-color: rgba(201,165,92,.4);
    border-radius: 4px;
    box-shadow: 0 5px 12px rgba(0,0,0,.24);
}
.record-cards-preview .card-mini img { width: 100%; height: 100%; object-fit: cover; }
.record-cards-preview .card-mini img.is-reversed,
.record-cards-preview .card-mini-fallback.is-reversed { transform: rotate(180deg); }
.card-mini-fallback { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 1rem; }
.card-mini.reversed::after {
    content: '↻';
    top: -3px;
    right: -3px;
    width: 13px;
    height: 13px;
    color: #2a180f;
    background: #c99a5c;
    font-size: .55rem;
}
.record-more-cards { color: #9f8a5e; font-family: 'Noto Sans TC', sans-serif; font-size: .7rem; }

.record-summary {
    display: block;
    margin-bottom: 16px;
    color: #aaa092;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .79rem;
    line-height: 1.65;
}
.record-summary > span { display: block; margin-bottom: 5px; color: #9d854e; font-size: .62rem; font-weight: 600; letter-spacing: .1em; }
.record-summary p { margin: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.record-tags { margin: auto 0 14px; }
.record-tags .tag { padding: 3px 7px; color: #a99465; background: rgba(201,165,92,.05); border-color: rgba(201,165,92,.12); font-family: 'Noto Sans TC', sans-serif; }
.record-meta { padding-top: 13px; border-top: 1px solid rgba(201,165,92,.1); color: #777166; font-family: 'Noto Sans TC', sans-serif; }
.record-type { color: #9b8d71; }
.record-stats { gap: 12px; font-size: .7rem; }

@media (min-width: 769px) and (hover: hover) {
    .record-card:hover { border-color: rgba(201,165,92,.48); transform: translateY(-5px); box-shadow: 0 22px 55px rgba(0,0,0,.32); }
    .record-card:hover::before { left: 10px; }
    .record-actions .action-btn:hover { color: #d8c28b; background: rgba(201,165,92,.08); border-color: rgba(201,165,92,.28); transform: translateY(-1px); }
    .record-actions .delete-btn:hover { color: #db8994; background: rgba(170,64,78,.09); border-color: rgba(200,89,103,.28); }
}

@media (max-width: 600px) {
    .records-grid { grid-template-columns: 1fr; padding: 0; }
    .record-card { min-height: 420px; max-width: none; padding: 20px; }
    .record-actions .action-btn { min-width: 38px; min-height: 38px; }
}

/* ========== Results, history tools, network and accessibility ========== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.network-status {
    position: fixed;
    z-index: 11000;
    top: 88px;
    left: 50%;
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    color: #e9dfca;
    background: #263b32;
    border: 1px solid #66806f;
    border-radius: 10px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .82rem;
    box-shadow: 0 10px 28px rgba(0,0,0,.3);
    transform: translateX(-50%);
}
.network-status[hidden] { display: none; }
.network-status.is-offline { background: #551d27; border-color: #a8515f; }

:where(button, input, select, textarea, [role="button"], [role="radio"]):focus-visible {
    outline: 3px solid #e6cd91 !important;
    outline-offset: 3px !important;
}

.result-page-title { margin-bottom: 24px; text-align: center; font-family: var(--font-subtitle); font-size: clamp(1.9rem, 4vw, 2.4rem); }
#resultsContainer.selected-cards { display: block; margin: 28px 0; }
.result-question {
    max-width: 820px;
    margin: 0 auto 28px;
    padding: 20px 26px;
    color: #d8cdb8;
    text-align: center;
    background: rgba(10,11,23,.74);
    border-left: 3px solid #8a2635;
    border-radius: 8px 14px 14px 8px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}
.result-summary,
.result-section {
    max-width: 940px;
    margin: 0 auto 28px;
    padding: clamp(24px, 5vw, 42px);
    background: rgba(10,11,23,.8);
    border: 1px solid rgba(201,165,92,.2);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(0,0,0,.19);
}
.result-summary { text-align: center; background: linear-gradient(145deg, rgba(123,31,45,.18), rgba(10,11,23,.86)); }
.result-summary h3 { max-width: 760px; margin: 12px auto 0; color: #eee4d0; font-family: var(--font-subtitle); font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 500; line-height: 1.75; }
.result-section-kicker { color: #bb9b56; font-family: 'Noto Sans TC', sans-serif; font-size: .7rem; font-weight: 600; letter-spacing: .15em; }
.result-section-heading { margin-bottom: 26px; text-align: center; }
.result-section-heading h2 { margin-top: 7px; color: #ead8ae; font-family: var(--font-subtitle); font-size: 1.45rem; }
.result-cards-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.result-card-item { width: 150px; padding: 14px 12px 16px; text-align: center; background: rgba(255,255,255,.025); border: 1px solid rgba(201,165,92,.15); border-radius: 13px; }
.result-card-image { width: 92px; height: 150px; margin: 0 auto 12px; overflow: hidden; border: 1px solid rgba(201,165,92,.48); border-radius: 7px; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.result-card-image.is-reversed { transform: rotate(180deg); }
.result-card-image img { width: 100%; height: 100%; object-fit: cover; }
.result-card-position { color: #aa8d4e; font-family: 'Noto Sans TC', sans-serif; font-size: .68rem; }
.result-card-item h3 { margin: 5px 0 8px; color: #e2d5be; font-family: 'Noto Sans TC', sans-serif; font-size: .78rem; line-height: 1.4; }
.result-orientation { padding: 3px 7px; border-radius: 999px; font-family: 'Noto Sans TC', sans-serif; font-size: .65rem; }
.result-orientation.upright { color: #a9c4ac; background: rgba(103,139,106,.13); }
.result-orientation.reversed { color: #d8ad76; background: rgba(174,109,56,.13); }

/* 結果頁牌陣：保留抽牌順序，同時呈現各牌陣的實際空間關係 */
.result-cards-grid:is(.result-layout-core, .result-layout-choice, .result-layout-love, .result-layout-career, .result-layout-horseshoe, .result-layout-celtic, .result-layout-lenormand_nine) {
    display: grid;
    align-items: start;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    overflow-x: auto;
    padding: 8px 4px 18px;
}
.result-layout-core { grid-template-columns: repeat(2, 150px); }
.result-layout-choice { grid-template-columns: repeat(3, 150px); }
.result-layout-choice [data-spread-slot="1"] { grid-area: 1 / 1; }
.result-layout-choice [data-spread-slot="2"] { grid-area: 1 / 3; }
.result-layout-choice [data-spread-slot="3"] { grid-area: 2 / 1; }
.result-layout-choice [data-spread-slot="4"] { grid-area: 2 / 3; }
.result-layout-choice [data-spread-slot="5"] { grid-area: 3 / 2; }
.result-layout-love { grid-template-columns: repeat(3, 150px); }
.result-layout-love [data-spread-slot="1"] { grid-area: 1 / 1; }
.result-layout-love [data-spread-slot="2"] { grid-area: 2 / 1; }
.result-layout-love [data-spread-slot="3"] { grid-area: 1 / 3; }
.result-layout-love [data-spread-slot="4"] { grid-area: 2 / 3; }
.result-layout-love [data-spread-slot="5"] { grid-area: 3 / 2; }
.result-layout-career { grid-template-columns: repeat(3, 150px); }
.result-layout-career [data-spread-slot="1"] { grid-area: 2 / 2; }
.result-layout-career [data-spread-slot="2"] { grid-area: 1 / 2; }
.result-layout-career [data-spread-slot="3"] { grid-area: 2 / 3; }
.result-layout-career [data-spread-slot="4"] { grid-area: 3 / 2; }
.result-layout-career [data-spread-slot="5"] { grid-area: 2 / 1; }
.result-layout-horseshoe { grid-template-columns: repeat(7, 126px); }
.result-layout-horseshoe .result-card-item,
.result-layout-celtic .result-card-item { width: 126px; }
.result-layout-horseshoe [data-spread-slot="1"] { grid-area: 3 / 1; }
.result-layout-horseshoe [data-spread-slot="2"] { grid-area: 2 / 2; }
.result-layout-horseshoe [data-spread-slot="3"] { grid-area: 1 / 3; }
.result-layout-horseshoe [data-spread-slot="4"] { grid-area: 1 / 4; }
.result-layout-horseshoe [data-spread-slot="5"] { grid-area: 1 / 5; }
.result-layout-horseshoe [data-spread-slot="6"] { grid-area: 2 / 6; }
.result-layout-horseshoe [data-spread-slot="7"] { grid-area: 3 / 7; }
.result-layout-celtic { grid-template-columns: repeat(7, 126px); }
.result-layout-celtic [data-spread-slot="1"] { grid-area: 3 / 3; }
.result-layout-celtic [data-spread-slot="2"] { grid-area: 3 / 4; }
.result-layout-celtic [data-spread-slot="3"] { grid-area: 4 / 3; }
.result-layout-celtic [data-spread-slot="4"] { grid-area: 2 / 3; }
.result-layout-celtic [data-spread-slot="5"] { grid-area: 3 / 2; }
.result-layout-celtic [data-spread-slot="6"] { grid-area: 3 / 5; }
.result-layout-celtic [data-spread-slot="7"] { grid-area: 4 / 7; }
.result-layout-celtic [data-spread-slot="8"] { grid-area: 3 / 7; }
.result-layout-celtic [data-spread-slot="9"] { grid-area: 2 / 7; }
.result-layout-celtic [data-spread-slot="10"] { grid-area: 1 / 7; }
.result-layout-lenormand_nine { grid-template-columns: repeat(3, 150px); }
.result-layout-lenormand_five,
.result-layout-lenormand_seven {
    display: grid;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    padding-bottom: 18px;
}
.result-layout-lenormand_five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.result-layout-lenormand_seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.result-layout-lenormand_five .result-card-item,
.result-layout-lenormand_seven .result-card-item { width: 100%; min-width: 0; }

.result-cards-grid:is(.result-layout-horseshoe, .result-layout-celtic) {
    width: 100%;
    overflow: visible;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.result-cards-grid:is(.result-layout-horseshoe, .result-layout-celtic) .result-card-item {
    width: 100%;
    min-width: 0;
    padding: clamp(4px, 1vw, 10px);
}
.result-cards-grid:is(.result-layout-horseshoe, .result-layout-celtic, .result-layout-lenormand_five, .result-layout-lenormand_seven) .result-card-image {
    width: min(72%, 82px);
    height: auto;
    aspect-ratio: 92 / 150;
}
.result-cards-grid:is(.result-layout-horseshoe, .result-layout-celtic, .result-layout-lenormand_five, .result-layout-lenormand_seven) .result-card-item h3 {
    overflow-wrap: anywhere;
    font-size: clamp(.56rem, 1.2vw, .75rem);
}
.result-reading { max-width: 820px; }
.result-reading-body { color: #d4caba; font-family: 'Noto Sans TC', sans-serif; font-size: 1rem; line-height: 1.95; }
.result-reading-body p { margin: 0 0 1.35em; }
.result-reading-body p:last-child { margin-bottom: 0; }
.result-reading-body strong { color: #e5ca8c; font-weight: 600; }
.result-reading-body ul,
.result-reading-body ol,
#modalContent ul,
#modalContent ol { margin: .35em 0 1.35em; padding-left: 1.55em; }
.result-reading-body li,
#modalContent li { margin-bottom: .7em; padding-left: .25em; }
.result-reading-body li::marker,
#modalContent li::marker { color: #c9a55c; font-weight: 700; }

/* History detail — visual layer only; modal scrolling behavior stays unchanged. */
.archive-modal {
    padding: 0 18px;
    background: rgba(3, 4, 12, .9) !important;
    backdrop-filter: blur(10px);
}
.archive-modal-shell {
    max-width: 940px !important;
    margin: 108px auto 44px !important;
    overflow: hidden;
    color: #d8d0c2;
    background:
        radial-gradient(circle at 50% 0, rgba(96, 70, 119, .13), transparent 28rem),
        linear-gradient(150deg, #151528, #0c0d1c 72%) !important;
    border: 1px solid rgba(201, 165, 92, .34) !important;
    border-radius: 22px !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .025);
}
.archive-modal-shell::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b9954f, transparent);
}
.archive-modal-close {
    z-index: 3;
    display: grid !important;
    width: 42px;
    height: 42px;
    padding: 0 !important;
    place-items: center;
    color: #bda66f !important;
    background: rgba(6, 7, 17, .5) !important;
    border: 1px solid rgba(201, 165, 92, .2) !important;
    border-radius: 50%;
    font: 400 1.45rem/1 sans-serif !important;
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.archive-modal-close:hover { color: #f0dca8 !important; border-color: rgba(201, 165, 92, .6) !important; transform: rotate(5deg); }
.archive-modal-content { padding: 44px clamp(22px, 5vw, 58px) 38px !important; font-family: 'Noto Sans TC', sans-serif; }

/* Header */
.archive-modal-content > div:first-child { margin: 8px 0 34px !important; }
.archive-modal-content > div:first-child::before { content: 'READING ARCHIVE'; display: block; margin-bottom: 9px; color: #89764e; font: 600 .62rem 'Noto Sans TC', sans-serif; letter-spacing: .25em; }
.archive-modal-content > div:first-child h2 { margin-bottom: 8px !important; color: #e4c982 !important; font-size: clamp(1.65rem, 4vw, 2.15rem); font-weight: 500; }
.archive-modal-content > div:first-child p { color: #8f887c !important; font-size: .78rem !important; }

/* Shared panels */
.archive-modal-content > div:nth-child(2),
.archive-modal-content > div:nth-child(4),
.archive-modal-content > div:nth-child(5),
.archive-modal-content > div:nth-child(6),
.archive-modal-content > div:nth-child(7) {
    padding: clamp(20px, 4vw, 28px) !important;
    background: rgba(255, 255, 255, .022) !important;
    border: 1px solid rgba(201, 165, 92, .13) !important;
    border-radius: 16px !important;
}
.archive-modal-content h3 { color: #bda468 !important; font-size: 1.05rem !important; font-weight: 500; letter-spacing: .02em; }

/* Question */
.archive-modal-content > div:nth-child(2) { position: relative; overflow: hidden; border-left: 3px solid rgba(185, 149, 79, .7) !important; }
.archive-modal-content > div:nth-child(2)::after { content: '“'; position: absolute; right: 20px; bottom: -44px; color: rgba(201, 165, 92, .055); font: 9rem Georgia, serif; }
.archive-modal-content > div:nth-child(2) p { position: relative; z-index: 1; margin-bottom: 0; color: #e3dbcf !important; font-size: clamp(1rem, 2.4vw, 1.16rem) !important; line-height: 1.85 !important; }

/* Drawn cards */
.archive-modal-content > div:nth-child(3) { margin: 34px 0 !important; }
.archive-modal-content > div:nth-child(3) > h3 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.archive-modal-content > div:nth-child(3) > h3::before,
.archive-modal-content > div:nth-child(3) > h3::after { content: '✦'; color: #79663d; font-size: .72rem; }
.archive-modal-content > div:nth-child(3) > div > div {
    width: 148px;
    padding: 13px 10px 16px !important;
    background: rgba(255, 255, 255, .018) !important;
    border: 1px solid rgba(201, 165, 92, .18) !important;
    border-radius: 13px !important;
}
.archive-modal-content > div:nth-child(3) > div > div > div:nth-child(2) { color: #9c834e !important; font-size: .7rem !important; }
.archive-modal-content > div:nth-child(3) > div > div > div:nth-child(3) { min-height: 2.8em; color: #ded4c3 !important; font-size: .8rem !important; line-height: 1.4; }

/* Reading and personal notes */
.archive-modal-content > div:nth-child(4) > div { color: #d4ccbf !important; font-size: .95rem; line-height: 1.95 !important; }
.archive-modal-content > div:nth-child(4) strong { color: #ddc27f; }
.archive-modal-content > div:nth-child(5) label { color: #a28e61 !important; font-size: .78rem; }
.archive-modal-content textarea,
.archive-modal-content input {
    color: #ddd3c2 !important;
    background: rgba(4, 5, 14, .48) !important;
    border: 1px solid rgba(201, 165, 92, .24) !important;
    font-family: 'Noto Sans TC', sans-serif !important;
}
.archive-modal-content textarea:focus,
.archive-modal-content input:focus { border-color: rgba(201, 165, 92, .62) !important; outline: 3px solid rgba(201, 165, 92, .08); }

/* Stats and actions */
.archive-modal-content > div:nth-child(7) { background: rgba(6, 7, 17, .35) !important; }
.archive-modal-content > div:nth-child(7) strong { color: #d7c59e; }
.archive-modal-content > div:last-child { gap: 10px !important; }
.archive-modal-content > div:last-child button {
    min-height: 44px;
    padding: 10px 18px !important;
    color: #c7b177 !important;
    background: transparent !important;
    border: 1px solid rgba(201, 165, 92, .34) !important;
    border-radius: 999px !important;
    font-family: 'Noto Sans TC', sans-serif !important;
    font-size: .78rem;
}
.archive-modal-content > div:last-child button:hover { color: #17111d !important; background: #c9a55c !important; border-color: #c9a55c !important; }
.archive-modal-content > div:last-child button:last-child { color: #d28d89 !important; border-color: rgba(190, 91, 86, .4) !important; }

@media (max-width: 680px) {
    .archive-modal { padding: 0 7px; }
    .archive-modal-shell { margin: 76px auto 20px !important; border-radius: 16px !important; }
    .archive-modal-content { padding: 42px 13px 22px !important; }
    .archive-modal-content > div:nth-child(3) > div { gap: 9px !important; }
    .archive-modal-content > div:nth-child(3) > div > div { width: calc(50% - 5px); max-width: none !important; }
    .archive-modal-content > div:nth-child(7) { gap: 10px; flex-wrap: wrap; }
    .archive-modal-content > div:nth-child(7) > div { min-width: 28%; }
    .archive-modal-content > div:last-child { display: grid !important; grid-template-columns: 1fr 1fr; }
    .archive-modal-content > div:last-child button:last-child { grid-column: 1 / -1; }
}
.result-action-bar {
    position: sticky;
    z-index: 100;
    bottom: 14px;
    display: flex;
    max-width: 820px;
    margin: 24px auto 0;
    padding: 12px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(8,9,18,.94);
    border: 1px solid rgba(201,165,92,.25);
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(0,0,0,.35);
    backdrop-filter: blur(16px);
}
.result-action-bar .btn { min-height: 44px; padding: 10px 16px; font-size: .84rem; }
.result-footer { margin-top: 38px; text-align: center; }

.history-privacy { margin-top: 12px; color: #938a7d !important; font-family: 'Noto Sans TC', sans-serif; font-size: .8rem; }
.history-data-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.history-tool-btn {
    min-height: 40px;
    padding: 8px 13px;
    color: #cfbb8b;
    background: rgba(201,165,92,.04);
    border: 1px solid rgba(201,165,92,.25);
    border-radius: 9px;
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .78rem;
}
.undo-delete-notice {
    position: fixed;
    z-index: 12000;
    left: 50%;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    color: #eee3cc;
    background: #171827;
    border: 1px solid rgba(201,165,92,.35);
    border-radius: 11px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .84rem;
    box-shadow: 0 14px 38px rgba(0,0,0,.38);
    transform: translateX(-50%);
}
.undo-delete-notice button { padding: 5px 9px; color: #e5ca8c; background: rgba(201,165,92,.08); border: 1px solid rgba(201,165,92,.35); border-radius: 7px; cursor: pointer; }
.record-card:focus-visible { transform: translateY(-3px); border-color: #e6cd91; }

@media (pointer: coarse) {
    button,
    .action-btn,
    .page-btn,
    [role="button"],
    [role="radio"] { min-width: 44px; min-height: 44px; }
}

@media (min-width: 769px) and (hover: hover) {
    .history-tool-btn:hover { color: #f0dda9; background: rgba(201,165,92,.1); border-color: rgba(201,165,92,.5); }
}

@media (max-width: 600px) {
    .network-status { top: 74px; }
    .result-question { padding: 16px; }
    .result-summary, .result-section { padding: 22px 15px; border-radius: 15px; }
    .result-cards-grid { gap: 8px; }
    .result-card-item { width: calc(50% - 6px); }
    .result-reading-body { font-size: .94rem; line-height: 1.85; }
    .result-action-bar { bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; }
    .result-action-bar .btn:last-child { grid-column: 1 / -1; }
    .history-data-actions { flex-wrap: wrap; }

    .result-layout-core,
    .result-layout-choice,
    .result-layout-love,
    .result-layout-career,
    .result-layout-lenormand_nine { gap: 6px; }
    .result-layout-core { grid-template-columns: repeat(2, 104px); }
    .result-layout-choice,
    .result-layout-love,
    .result-layout-career,
    .result-layout-lenormand_nine { grid-template-columns: repeat(3, 94px); }
    .result-layout-core .result-card-item,
    .result-layout-choice .result-card-item,
    .result-layout-love .result-card-item,
    .result-layout-career .result-card-item,
    .result-layout-lenormand_nine .result-card-item { width: 100%; padding: 9px 5px 11px; }
    .result-layout-core .result-card-image,
    .result-layout-choice .result-card-image,
    .result-layout-love .result-card-image,
    .result-layout-career .result-card-image,
    .result-layout-lenormand_nine .result-card-image { width: 58px; height: 96px; }
    .result-cards-grid.result-layout-horseshoe,
    .result-cards-grid.result-layout-celtic {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
    }
    .result-layout-horseshoe [data-spread-slot="1"] { grid-area: 1 / 1; }
    .result-layout-horseshoe [data-spread-slot="2"] { grid-area: 2 / 1; }
    .result-layout-horseshoe [data-spread-slot="3"] { grid-area: 3 / 2; }
    .result-layout-horseshoe [data-spread-slot="4"] { grid-area: 3 / 3; }
    .result-layout-horseshoe [data-spread-slot="5"] { grid-area: 3 / 4; }
    .result-layout-horseshoe [data-spread-slot="6"] { grid-area: 2 / 5; }
    .result-layout-horseshoe [data-spread-slot="7"] { grid-area: 1 / 5; }
    .result-layout-celtic [data-spread-slot="1"] { grid-area: 3 / 2; }
    .result-layout-celtic [data-spread-slot="2"] { grid-area: 3 / 3; }
    .result-layout-celtic [data-spread-slot="3"] { grid-area: 4 / 2; }
    .result-layout-celtic [data-spread-slot="4"] { grid-area: 2 / 2; }
    .result-layout-celtic [data-spread-slot="5"] { grid-area: 3 / 1; }
    .result-layout-celtic [data-spread-slot="6"] { grid-area: 3 / 4; }
    .result-layout-celtic [data-spread-slot="7"] { grid-area: 4 / 5; }
    .result-layout-celtic [data-spread-slot="8"] { grid-area: 3 / 5; }
    .result-layout-celtic [data-spread-slot="9"] { grid-area: 2 / 5; }
    .result-layout-celtic [data-spread-slot="10"] { grid-area: 1 / 5; }

    .result-layout-three,
    .result-layout-insight,
    .result-layout-growth,
    .result-layout-yesno,
    .result-layout-lenormand_three,
    .result-layout-lenormand_yesno {
        display: grid;
        grid-template-columns: repeat(3, 94px);
        justify-content: center;
        gap: 6px;
    }
    .result-layout-three .result-card-item,
    .result-layout-insight .result-card-item,
    .result-layout-growth .result-card-item,
    .result-layout-yesno .result-card-item,
    .result-layout-lenormand_three .result-card-item,
    .result-layout-lenormand_yesno .result-card-item { width: 100%; padding: 9px 5px 11px; }
    .result-layout-three .result-card-image,
    .result-layout-insight .result-card-image,
    .result-layout-growth .result-card-image,
    .result-layout-yesno .result-card-image,
    .result-layout-lenormand_three .result-card-image,
    .result-layout-lenormand_yesno .result-card-image { width: 58px; height: 96px; }

    .result-layout-lenormand_five,
    .result-layout-lenormand_seven { gap: 4px; }
    .result-layout-lenormand_five .result-card-item,
    .result-layout-lenormand_seven .result-card-item { width: 100%; padding: 5px 2px 8px; }
    .result-cards-grid:is(.result-layout-horseshoe, .result-layout-celtic, .result-layout-lenormand_five, .result-layout-lenormand_seven) .result-card-position {
        font-size: .52rem;
        line-height: 1.25;
    }
}

/* ========== Guided reading experience ========== */
.reading-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 760px;
    margin: 0 auto 26px;
    padding: 14px 22px;
    background: rgba(10, 11, 23, 0.72);
    border: 1px solid rgba(201, 165, 92, 0.18);
    border-radius: 14px;
}

.reading-steps[hidden] { display: none; }

.reading-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #777165;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.8rem;
}

.reading-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(50% + 39px);
    width: calc(100% - 78px);
    height: 1px;
    background: rgba(201, 165, 92, 0.16);
}

.reading-step span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid #655f54;
    border-radius: 50%;
    font-size: 0.7rem;
}

.reading-step strong { font-weight: 500; }
.reading-step.active { color: #ecd79f; }
.reading-step.active span { color: #170d10; background: #c9a55c; border-color: #c9a55c; box-shadow: 0 0 18px rgba(201,165,92,.2); }
.reading-step.completed { color: #aaa08d; }
.reading-step.completed span { color: #d9c58f; background: rgba(201,165,92,.08); border-color: #9f7b37; }
.reading-step.completed:not(:last-child)::after { background: rgba(201,165,92,.45); }

/* Keep the call to action visible without an oversized landing screen. */
.header { padding-top: 20px; padding-bottom: 20px; margin-bottom: 20px; }
.header .ornament { margin: 14px 0; font-size: 1.55rem; }
#step1.active { min-height: 420px; padding-block: 48px; }
#step1.active h2 { margin: 22px 0 !important; }
#step1.active p { margin: 20px 0 !important; }
#step1.active .ornament { margin: 14px 0; }

.flow-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-secondary {
    color: #c9b887;
    background: transparent;
    border-color: rgba(201, 165, 92, 0.35);
    box-shadow: none;
}

.btn:disabled {
    color: #777165;
    background: #24222a;
    border-color: #47423c;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.question-meta {
    display: flex;
    justify-content: space-between;
    min-height: 24px;
    margin: -16px 2px 18px;
    color: #887f72;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.76rem;
}

.field-error { color: #dc8792; }
.question-input.input-error { border-color: #c85967; box-shadow: 0 0 0 4px rgba(200,89,103,.09); }

.question-examples {
    margin: 4px 0 26px;
    text-align: left;
}

.examples-label {
    color: #a99f90;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.82rem;
}

.examples-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.refresh-examples {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 5px 9px;
    color: #a99b7a;
    background: transparent;
    border: 1px solid rgba(201,165,92,.18);
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .7rem;
    transition: all .2s ease;
}

.refresh-examples span[aria-hidden="true"] { font-size: .9rem; transition: transform .25s ease; }

.example-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
    padding: 8px 12px;
    color: #cdbb90;
    background: rgba(201,165,92,.055);
    border: 1px solid rgba(201,165,92,.2);
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.78rem;
    transition: all .2s ease;
}

.focus-skip {
    margin-top: 30px;
    padding: 10px 18px;
    color: #d6c28e;
    background: transparent;
    border: 1px solid rgba(201,165,92,.3);
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
}

.tarot-card.selecting { pointer-events: none; opacity: 0.82; }
.tarot-card.selected { cursor: pointer; }
.card-position-badge {
    position: absolute;
    z-index: 12;
    left: 50%;
    bottom: -34px;
    max-width: 130px;
    padding: 5px 9px;
    color: #f0dda9;
    background: #661b27;
    border: 1px solid rgba(230,205,145,.55);
    border-radius: 999px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .68rem;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
    box-shadow: 0 6px 16px rgba(0,0,0,.28);
}

.selection-actions {
    position: sticky;
    z-index: 120;
    bottom: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    max-width: 820px;
    margin: 44px auto 0;
    padding: 12px;
    background: rgba(8,9,18,.94);
    border: 1px solid rgba(201,165,92,.28);
    border-radius: 15px;
    box-shadow: 0 14px 38px rgba(0,0,0,.38);
    backdrop-filter: blur(16px);
}

.selection-status {
    color: #aaa08d;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .82rem;
    text-align: center;
}

@media (min-width: 769px) and (hover: hover) {
    .btn-secondary:hover { color: #ecd79f; background: rgba(201,165,92,.07); border-color: rgba(201,165,92,.55); box-shadow: none; }
    .example-chip:hover, .focus-skip:hover, .refresh-examples:hover { color: #f0dda9; background: rgba(201,165,92,.11); border-color: rgba(201,165,92,.45); }
    .refresh-examples:hover span[aria-hidden="true"] { transform: rotate(180deg); }
}

@media (max-width: 600px) {
    .reading-steps { margin-bottom: 16px; padding: 11px 8px; }
    .reading-step { gap: 5px; font-size: .68rem; }
    .reading-step span { width: 22px; height: 22px; }
    .reading-step:not(:last-child)::after { display: none; }
    #step1.active { min-height: 390px; padding-block: 34px; }
    .question-meta { margin-top: -12px; }
    .example-chips { display: grid; }
    .example-chip { width: 100%; text-align: left; }
    .selection-actions { bottom: 8px; grid-template-columns: auto 1fr; gap: 8px; }
    .selection-actions .selection-status { grid-column: 1 / -1; grid-row: 1; }
    .selection-actions .btn { min-height: 44px; padding: 10px 14px; font-size: .86rem; }
}

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

/* ========== Honest reading wait state ========== */
.honest-loading {
    max-width: 850px;
    margin: 0 auto;
    padding: clamp(26px, 5vw, 48px);
    text-align: center;
    background: rgba(10, 11, 23, 0.82);
    border: 1px solid rgba(201, 165, 92, 0.22);
    border-radius: 20px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
}

.waiting-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 7px;
    min-height: 112px;
    margin-bottom: 28px;
}

.waiting-card {
    display: flex;
    width: 68px;
    flex-direction: column;
    gap: 7px;
    align-items: center;
}

.waiting-card img {
    display: block;
    width: 54px;
    height: 88px;
    object-fit: cover;
    border: 1px solid rgba(201, 165, 92, 0.55);
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(0,0,0,.28);
}

.waiting-card img.is-reversed { transform: rotate(180deg); }
.waiting-card span {
    overflow: hidden;
    width: 100%;
    color: #a99f90;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .66rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.honest-loading .mystic-symbols {
    height: 180px;
    margin: 2px 0 12px;
    transform: scale(.82);
}

.honest-loading .energy-circle {
    border-style: solid;
    border-color: rgba(201, 165, 92, 0.48);
    animation: honestOrbit 8s linear infinite;
}

.honest-loading .energy-circle::before,
.honest-loading .energy-circle::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    top: 18px;
    left: 22px;
    background: #c9a55c;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(201,165,92,.5);
}
.honest-loading .energy-circle::after { inset: auto 22px 18px auto; width: 4px; height: 4px; }
.honest-loading .symbol { animation: waitingSymbol 2.8s ease-in-out infinite; }

.reading-wait-copy { max-width: 560px; margin: 0 auto; }
.reading-wait-copy .progress-text {
    margin-bottom: 7px;
    color: #e4ca8d;
    font-family: var(--font-subtitle);
    font-size: 1.25rem;
}
.reading-elapsed {
    color: #81796d;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .78rem;
}
.reading-elapsed strong { min-width: 1.5em; color: #b5a889; font-weight: 500; }
.reading-wait-detail {
    min-height: 24px;
    margin-top: 12px;
    color: #aaa092;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .86rem;
    line-height: 1.65;
}

.reading-tip {
    max-width: 560px;
    margin: 24px auto 0;
    padding: 14px 18px;
    color: #a99f90;
    background: rgba(201,165,92,.045);
    border: 1px solid rgba(201,165,92,.13);
    border-radius: 12px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .82rem;
    line-height: 1.65;
}
.reading-tip-label {
    display: block;
    margin-bottom: 4px;
    color: #c5ad72;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .12em;
}
.reading-tip p { margin: 0; }

.cancel-reading-btn {
    margin-top: 20px;
    padding: 7px 12px;
    color: #8f877b;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: .76rem;
}

.reading-message-card {
    max-width: 680px;
    margin: 20px auto;
    padding: clamp(34px, 6vw, 60px);
    color: #ddd2bd;
    text-align: center;
    background: rgba(10,11,23,.82);
    border: 1px solid rgba(201,165,92,.22);
    border-radius: 18px;
}
.reading-message-icon {
    display: grid;
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    place-items: center;
    color: #d2b66f;
    border: 1px solid rgba(201,165,92,.4);
    border-radius: 50%;
    font-family: var(--font-title);
    font-size: 1.35rem;
}
.reading-message-card h3 { margin-bottom: 12px; color: #ead69f; font-family: var(--font-subtitle); }
.reading-message-card p { color: #aaa092; font-family: 'Noto Sans TC', sans-serif; line-height: 1.7; }
.reading-message-card .flow-actions { margin-top: 26px; }
.reading-message-card.is-error { border-color: rgba(200,89,103,.35); }
.reading-message-card.is-error .reading-message-icon { color: #dc8792; border-color: rgba(220,135,146,.45); }
.reading-preserved-note { margin-top: 10px; color: #c5ad72 !important; font-size: .82rem; }

@keyframes honestOrbit {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes waitingSymbol {
    0%, 100% { opacity: .45; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

@media (min-width: 769px) and (hover: hover) {
    .cancel-reading-btn:hover { color: #c6b993; border-bottom-color: rgba(201,165,92,.35); }
}

@media (max-width: 600px) {
    .honest-loading { padding: 24px 14px 30px; }
    .waiting-cards {
        width: min(100%, 260px);
        min-height: 96px;
        margin-right: auto;
        margin-left: auto;
        gap: 10px 5px;
    }
    .waiting-card { width: 48px; flex: 0 0 48px; }
    .waiting-card img { width: 40px; height: 65px; }
    .waiting-card span { font-size: .58rem; }
    .honest-loading .mystic-symbols { margin-top: -5px; transform: scale(.7); }
    .reading-wait-copy .progress-text { font-size: 1.08rem; }
}

/* ========== Navigation actions: fixed dark theme ========== */
.navbar-controls { gap: 10px; }

.nav-history-btn,
.lang-toggle-btn {
    min-height: 42px;
    gap: 9px;
    padding: 9px 16px;
    color: #e7d8b6;
    background: linear-gradient(180deg, rgba(201, 165, 92, 0.075), rgba(201, 165, 92, 0.025));
    border: 1px solid rgba(201, 165, 92, 0.3);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    letter-spacing: 0.06em;
}

.history-icon,
.lang-icon {
    display: inline-grid;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    place-items: center;
    color: #cfad65;
    filter: none;
}

.history-icon svg,
.lang-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-text,
.lang-text {
    color: inherit;
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 500;
}

.lang-toggle-btn { min-width: 92px; justify-content: center; }

@media (min-width: 769px) and (hover: hover) {
    .nav-history-btn:hover,
    .lang-toggle-btn:hover {
        color: #f0dfb5;
        background: linear-gradient(180deg, rgba(201, 165, 92, 0.14), rgba(123, 31, 45, 0.08));
        border-color: rgba(230, 205, 145, 0.58);
        transform: translateY(-1px);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 600px) {
    .navbar-controls { gap: 6px; }
    .nav-history-btn,
    .lang-toggle-btn { min-width: 38px; min-height: 38px; padding: 8px 10px; }
    .history-text,
    .lang-text { display: none; }
    .history-icon,
    .lang-icon { width: 18px; height: 18px; flex-basis: 18px; }
}

/* ========== Divination system chooser and Lenormand foundation ========== */
.divination-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 280px));
    justify-content: center;
    gap: 18px;
    margin: 34px auto 8px;
}

.divination-option {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 170px;
    padding: 26px 22px;
    color: #d9ccb6;
    background: rgba(10, 11, 23, .78);
    border: 1px solid rgba(201, 165, 92, .32);
    border-radius: 17px;
    cursor: pointer;
    font: inherit;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.divination-option:hover,
.divination-option:focus-visible {
    transform: translateY(-4px);
    background: rgba(201, 165, 92, .08);
    border-color: rgba(201, 165, 92, .72);
    outline: none;
}

.divination-option-icon { color: #c9a55c; font-size: 2.3rem; }
.divination-option strong { color: #e5ca8c; font-family: 'Philosopher', serif; font-size: 1.35rem; }
.divination-option small { color: #a99f90; font-size: .82rem; line-height: 1.6; }

.lenormand-foundation {
    max-width: 680px;
    margin: 0 auto;
    padding: 38px 28px;
    background: rgba(10, 11, 23, .78);
    border: 1px solid rgba(201, 165, 92, .3);
    border-radius: 18px;
}

.lenormand-foundation[hidden],
.spread-options[hidden],
.spread-card[hidden],
#confirmSpreadBtn[hidden] { display: none !important; }
.lenormand-foundation-symbol { color: #c9a55c; font-size: 3rem; }
.lenormand-foundation h3 { margin: 10px 0 14px; color: #e5ca8c; font-family: 'Philosopher', serif; font-size: 1.55rem; }
.lenormand-foundation p { margin-bottom: 18px !important; color: #cfc3b1; font-size: .95rem !important; }
.lenormand-foundation code { color: #c9a55c; font-size: .82rem; overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .divination-options { grid-template-columns: 1fr; gap: 12px; margin-top: 25px; }
    .divination-option { min-height: 138px; padding: 20px 16px; }
}
