/* ── Auth ─────────────────────────────────────────────────────── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    min-height: 56px;
    gap: 12px;
}

.site-title-img {
    height: 52px;
    width: auto;
    display: block;
}

#auth-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

#auth-login-btn {
    background: rgba(201,169,110,0.12);
    border: 1px solid rgba(201,169,110,0.4);
    color: #c9a96e;
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 8px 22px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
#auth-login-btn:hover { background: rgba(201,169,110,0.22); }

#user-status {
    display: flex;
    align-items: center;
    gap: 10px;
}
#user-email-display {
    color: rgba(245,240,232,0.6);
    font-size: 12px;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
#auth-logout-btn {
    background: transparent;
    border: 1px solid rgba(201,169,110,0.3);
    color: rgba(201,169,110,0.7);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 14px;
    cursor: pointer;
}
#auth-logout-btn:hover { border-color: rgba(201,169,110,0.6); color: #c9a96e; }

#auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.auth-modal-box {
    position: relative;
    background: rgba(18,8,35,0.97);
    border: 1px solid rgba(201,169,110,0.3);
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: 340px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(245,240,232,0.4);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}
.auth-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(201,169,110,0.2);
    padding-bottom: 12px;
}
.auth-tab {
    background: none;
    border: none;
    color: rgba(245,240,232,0.4);
    font-size: 14px;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.auth-tab.active {
    color: #c9a96e;
    background: rgba(201,169,110,0.1);
}
.auth-error {
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(229,115,115,0.1);
    border-radius: 8px;
    border: 1px solid rgba(229,115,115,0.3);
}
.auth-modal-box input[type="email"],
.auth-modal-box input[type="password"] {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(201,169,110,0.25);
    border-radius: 8px;
    color: rgba(245,240,232,0.9);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s;
}
.auth-modal-box input:focus { border-color: rgba(201,169,110,0.6); }
.auth-submit-btn {
    background: rgba(201,169,110,0.15);
    border: 1px solid rgba(201,169,110,0.5);
    color: #c9a96e;
    font-size: 13px;
    letter-spacing: 0.1em;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.auth-submit-btn:hover { background: rgba(201,169,110,0.25); }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-note {
    font-size: 12px;
    color: rgba(245,240,232,0.45);
    text-align: center;
    line-height: 1.5;
}
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(245,240,232,0.9);
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}
.auth-google-btn:hover { background: rgba(255,255,255,0.13); }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(245,240,232,0.3);
    font-size: 11px;
    letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(201,169,110,0.15);
}
/* ── End Auth ─────────────────────────────────────────────────── */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201, 169, 110, 0.25); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 169, 110, 0.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(201, 169, 110, 0.25) transparent; }

:root {
    /* Color Variables */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --border-color: #e5e5e5;

    /* Font Variables */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Crimson Pro', Georgia, serif;
}

[data-theme="dark"] {
    --text-primary: rgba(245, 240, 232, 0.92);
    --text-secondary: rgba(245, 240, 232, 0.42);
    --text-light: rgba(245, 240, 232, 0.22);
    --bg-primary: rgba(10, 8, 18, 0.98);
    --bg-secondary: rgba(20, 16, 34, 0.8);
    --border-color: rgba(201, 169, 110, 0.12);
    --bg-body: radial-gradient(ellipse at 50% 35%, #1e0d3a 0%, #110828 35%, #080514 65%, #030209 100%);
    /* Astronomical Observatory palette */
    --gold: #c9a96e;
    --gold-dim: rgba(201, 169, 110, 0.35);
    --gold-border: rgba(201, 169, 110, 0.2);
    --ivory: #f5f0e8;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.055);
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-body, linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%));
    min-height: 100vh;
    padding: 8px 20px;
    padding-bottom: 100px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: min(960px, 100%);
    margin: 0 auto;
}

.app-shell {
    min-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
}

.main-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 三卡位 + 輪盤/結果同一區 */
.play-surface {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.play-surface:has(> .triple-strip--complete) {
    flex: 0 0 auto;
}

.wheel-card-column {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.play-surface .triple-strip {
    margin-bottom: 8px;
}

/* When all cards drawn, collapse the empty wheel column so content stacks naturally */
.triple-strip--complete ~ .wheel-card-column {
    display: none;
}

.play-surface .card-display {
    margin-bottom: 0;
}


/* 頂部三卡位 */
.triple-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.triple-slot {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 6px 10px;
    text-align: center;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

/* 與輪盤單張牌同比例（約 118×188），飛牌動畫落點對齊此區域 */
.triple-slot-dropzone {
    width: 100%;
    max-width: 60px;
    aspect-ratio: 118 / 188;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: max-width 0.7s cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* 三张全部抽完后放大——三张牌共占约半屏 */
.triple-strip--complete .triple-slot-dropzone {
    max-width: min(28vw, 220px);
}

.triple-strip--complete .triple-slot-filled {
    border: none;
    background: transparent;
}

.triple-strip--complete .triple-slot-filled .triple-slot-dropzone {
    border: none;
    background: transparent;
}

@keyframes card-meaning-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 完成态文字行 */
.triple-ai-row {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
    animation: card-meaning-in 0.5s 0.3s ease both;
    opacity: 0;
    animation-fill-mode: forwards;
}

.triple-meanings-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
    animation: card-meaning-in 0.6s 0.7s ease both;
    opacity: 0;
    animation-fill-mode: forwards;
}

.triple-meaning-block {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 13px;
    font-style: italic;
    color: rgba(245, 240, 232, 0.55);
    line-height: 1.7;
    text-align: center;
    padding: 0 8px;
}

.triple-slot-dropzone--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(201, 169, 110, 0.03);
    border: 1px dashed rgba(201, 169, 110, 0.2);
}

.triple-slot-filled .triple-slot-dropzone {
    border: none;
    background: transparent;
}

.triple-slot-filled {
    border-color: transparent;
    background: transparent;
}

.triple-slot-label {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 400;
    color: rgba(201, 169, 110, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.triple-slot-name {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 400;
    color: rgba(245, 240, 232, 0.88);
    line-height: 1.3;
}

.triple-slot-orient {
    font-family: var(--font-heading);
    font-size: 10px;
    color: rgba(201, 169, 110, 0.65);
    font-style: italic;
}

.triple-slot-placeholder {
    font-size: 11px;
    color: rgba(245, 240, 232, 0.18);
    letter-spacing: 0.03em;
}

.triple-slot-hint {
    font-size: 9px;
    color: rgba(245, 240, 232, 0.12);
    margin-top: 1px;
    letter-spacing: 0.05em;
}

.triple-slot-thumb-wrap {
    width: 40px;
    height: 60px;
    margin: 4px auto 2px;
    border-radius: 6px;
    overflow: hidden;
    border: none;
    background: transparent;
    flex-shrink: 0;
}

/* 牌位內與輪盤同比例鋪滿，對齊飛牌落點 */
.triple-slot-dropzone .triple-slot-thumb-wrap {
    width: 100%;
    height: 100%;
    margin: 0;
    min-height: 0;
    border-radius: 11px;
}

.triple-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    vertical-align: middle;
    mix-blend-mode: multiply;
}

.triple-thumb--rev {
    transform: rotate(180deg);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 12px;
}

header h1 {
    font-family: var(--font-heading);
    font-size: clamp(36px, 6vw, 52px);
    font-weight: 300;
    letter-spacing: 0.18em;
    margin-bottom: 0;
    background: linear-gradient(160deg, #f0e0b8 0%, #c9a96e 50%, #9a6e30 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 24px rgba(201, 169, 110, 0.22));
}

/* thin rule under header title */
header::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.4), transparent);
    margin: 12px auto 0;
}

/* Spread Selection */
.spread-selection {
    margin-bottom: 20px;
    width: 100%;
    overflow: visible;
}

.spread-selection h2 {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(201, 169, 110, 0.4);
    margin-bottom: 10px;
}

.spread-cards {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
}

/* hide horizontal scrollbar track for clean look */
.spread-cards::-webkit-scrollbar { height: 2px; }
.spread-cards::-webkit-scrollbar-track { background: transparent; }
.spread-cards::-webkit-scrollbar-thumb { background: rgba(201, 169, 110, 0.2); border-radius: 1px; }

/* Slim pill cards */
.spread-card {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid rgba(201, 169, 110, 0.13);
    border-radius: 100px; /* pill */
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.spread-card:hover {
    border-color: rgba(201, 169, 110, 0.38);
    background: rgba(201, 169, 110, 0.05);
}

.spread-card.selected {
    background: rgba(201, 169, 110, 0.09);
    border-color: rgba(201, 169, 110, 0.5);
}

.spread-card h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(245, 240, 232, 0.65);
    margin: 0;
}

.spread-card.selected h3 {
    color: #c9a96e;
}

.spread-card .card-count {
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(201, 169, 110, 0.35);
    font-family: var(--font-body);
}

.spread-card.selected .card-count {
    color: rgba(201, 169, 110, 0.6);
}

/* hide description entirely — pill is clean */
.spread-card .description {
    display: none;
}

/* Card Display */
.card-display {
    flex: 1;
    min-height: min(44vh, 440px);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.spread-info {
    text-align: center;
    margin-bottom: 16px;
}

.spread-info h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    color: rgba(245, 240, 232, 0.78);
}

.spread-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Empty Card Slot */
.card-slot {
    background: rgba(201, 169, 110, 0.02);
    border: 1px dashed rgba(201, 169, 110, 0.12);
    border-radius: 2px;
    padding: 20px;
    text-align: center;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0.5;
}

.card-slot-icon {
    font-size: 48px;
    opacity: 0.3;
}

.card-slot-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-position {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}

.sparkle-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 14px;
    letter-spacing: 0.03em;
    color: rgba(245, 240, 232, 0.28);
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.card-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(201, 169, 110, 0.2);
    border-color: rgba(201, 169, 110, 0.4);
}

.card-item.selected {
    border-color: rgba(201, 169, 110, 0.5);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.card-image {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 2 / 3;
    background: transparent;
    border: none;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-face-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    z-index: 2;
    border-radius: 0;
    box-shadow: none;
}

.card-image .card-image-placeholder {
    display: none;
    z-index: 1;
}

.card-image--missing .card-face-img {
    display: none;
}

.card-image--missing .card-image-placeholder {
    display: flex;
}

.card-image--missing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
}

.card-item:hover .card-image {
    box-shadow: none;
}

/* 僅在無圖（emoji 佔位）時顯示底紋，有牌圖時不畫任何疊層 */
.card-image--missing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 15px,
            rgba(139, 92, 246, 0.08) 15px,
            rgba(139, 92, 246, 0.08) 30px
        );
    opacity: 0.5;
    z-index: 0;
}

.card-image-placeholder {
    font-size: 64px;
    z-index: 1;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.card-item:hover .card-image-placeholder {
    transform: scale(1.1);
}

.card-item.reversed .card-image {
    transform: rotate(180deg);
}


.card-position {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    color: rgba(245, 240, 232, 0.9);
}

.card-name-cn {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.card-orientation {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.orientation-upright {
    background: rgba(201, 169, 110, 0.08);
    color: rgba(201, 169, 110, 0.7);
    border: 1px solid rgba(201, 169, 110, 0.18);
}

.orientation-reversed {
    background: rgba(201, 169, 110, 0.04);
    color: rgba(201, 169, 110, 0.45);
    border: 1px solid rgba(201, 169, 110, 0.12);
}

/* V-Shape Layout */
.v-shape-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.v-shape-top {
    /* Advice card at top */
}

.v-shape-middle {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.v-shape-left,
.v-shape-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    max-width: 300px;
}

.v-shape-bottom {
    /* Current situation at bottom */
}

/* AI Button Section */
.ai-button-section {
    margin-bottom: 20px;
    padding: 0;
    display: flex;
    justify-content: center;
}

.btn-ai-primary {
    padding: 10px 36px;
    background: transparent;
    color: rgba(201, 169, 110, 0.85);
    border: 1px solid rgba(201, 169, 110, 0.32);
    border-radius: 100px; /* pill */
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.btn-ai-primary .sparkle {
    font-size: 11px;
    opacity: 0.7;
}

.btn-ai-primary:hover {
    background: rgba(201, 169, 110, 0.08);
    border-color: rgba(201, 169, 110, 0.6);
    color: #c9a96e;
    box-shadow: 0 0 24px rgba(201, 169, 110, 0.12);
}

/* Question Section */
.question-section {
    background: transparent;
    border-radius: 0;
    padding: 8px 0 20px;
    margin-bottom: 16px;
    box-shadow: none;
}

.question-section h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: rgba(201, 169, 110, 0.45);
    margin-bottom: 12px;
}

#user-question {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(201, 169, 110, 0.22);
    border-radius: 1px;
    background: rgba(201, 169, 110, 0.018);
    color: rgba(245, 240, 232, 0.82);
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 16px;
    font-style: italic;
    line-height: 1.7;
    resize: none;
    min-height: 88px;
    margin-bottom: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

#user-question::placeholder {
    color: rgba(255, 255, 255, 0.16);
    font-style: italic;
}

#user-question:focus {
    outline: none;
    border-color: rgba(201, 169, 110, 0.55);
    box-shadow: 0 0 24px rgba(201, 169, 110, 0.05), inset 0 0 20px rgba(201, 169, 110, 0.015);
}

.btn-analyze {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 24px;
    background: transparent;
    color: rgba(201, 169, 110, 0.8);
    border: 1px solid rgba(201, 169, 110, 0.28);
    border-radius: 1px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn-analyze .sparkle { font-size: 11px; opacity: 0.65; }

.btn-analyze:hover:not(:disabled) {
    background: rgba(201, 169, 110, 0.07);
    border-color: rgba(201, 169, 110, 0.55);
    color: #c9a96e;
    box-shadow: 0 0 20px rgba(201, 169, 110, 0.1);
}

.btn-analyze:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* AI Analysis */
.ai-analysis {
    background: rgba(12, 10, 22, 0.7);
    border: 1px solid rgba(201, 169, 110, 0.16);
    border-radius: 2px;
    padding: 20px 22px 22px;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 0 rgba(201, 169, 110, 0.06);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.1);
}

.analysis-header h3 {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(201, 169, 110, 0.55);
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: rgba(245, 240, 232, 0.25);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s ease;
    padding: 0;
}

.btn-close:hover {
    color: rgba(201, 169, 110, 0.7);
}

.analysis-content {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.85;
    color: rgba(245, 240, 232, 0.72);
    white-space: pre-wrap;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(6, 5, 14, 0.92) 0%, rgba(6, 5, 14, 0.72) 70%, transparent 100%);
    border-top: none;
    padding: 14px 20px 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    box-shadow: none;
    z-index: 1000;
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    pointer-events: auto;
}

.action-buttons .container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.draw-step-hint {
    display: none;
}

.step-hint {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: rgba(201, 169, 110, 0.75);
    text-align: center;
    pointer-events: none;
    padding: 2px 8px;
    white-space: normal;
    max-width: 280px;
    line-height: 1.5;
}

.intro-action-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.intro-expand-link {
    background: none;
    border: none;
    color: rgba(201, 169, 110, 0.75);
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(201, 169, 110, 0.3);
}

.intro-expand-link:hover {
    color: rgba(201, 169, 110, 1);
}

.intro-mode-hint {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.28);
    letter-spacing: 0.03em;
    text-align: center;
    max-width: 300px;
    line-height: 1.6;
}

.intro-draw-hint {
    color: rgba(201, 169, 110, 0.55);
    letter-spacing: 0.08em;
    font-size: 13px;
}

.wheel-guide-hint {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.28);
    text-align: center;
    margin: 6px 0 0;
    animation: fadeOutSlow 1s ease-out 7s both;
}

@keyframes fadeOutSlow {
    to { opacity: 0; pointer-events: none; }
}

.btn-primary,
.btn-secondary {
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ensure buttons are always clickable when visible */
.btn-primary[style*="display: flex"],
.btn-secondary[style*="display: flex"] {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1001 !important;
    position: relative;
}

/* Primary: pill draw button */
.btn-primary {
    background: none;
    border: none;
    color: rgba(201, 169, 110, 0.5);
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
    padding: 8px 16px;
    border-radius: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(201, 169, 110, 0.3);
    transition: color 0.2s ease;
    width: auto;
    min-width: unset;
}

.btn-primary .icon { display: none; }

.btn-primary:hover {
    color: rgba(201, 169, 110, 0.85);
    text-decoration-color: rgba(201, 169, 110, 0.6);
}

/* Secondary: ghost reset button */
.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 7px 28px;
    border-radius: 100px;
    transition: border-color 0.3s ease, color 0.3s ease;
    width: auto;
    min-width: 160px;
}

.btn-secondary .icon { font-size: 11px; }

.btn-secondary:hover {
    border-color: rgba(201, 169, 110, 0.3);
    color: rgba(201, 169, 110, 0.65);
}

/* Card Interpretation Modal */
.card-interpretation {
    background: rgba(10, 8, 20, 0.65);
    border: 1px solid rgba(201, 169, 110, 0.12);
    border-radius: 2px;
    padding: 18px 20px;
    margin-top: 12px;
}

.interpretation-section {
    margin-bottom: 14px;
}

.interpretation-section h4 {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(201, 169, 110, 0.45);
    margin-bottom: 6px;
}

.interpretation-section p {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    font-style: italic;
    color: rgba(245, 240, 232, 0.68);
}

.meaning-upright,
.meaning-reversed {
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.meaning-upright {
    background: rgba(201, 169, 110, 0.05);
    border-left: 2px solid rgba(201, 169, 110, 0.35);
}

.meaning-reversed {
    background: rgba(201, 169, 110, 0.025);
    border-left: 2px solid rgba(201, 169, 110, 0.18);
}

/* Loading State */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 50%;
    border-top-color: rgba(201, 169, 110, 0.7);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
        letter-spacing: 0.14em;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .v-shape-middle {
        flex-direction: column;
    }

    .v-shape-left,
    .v-shape-right {
        max-width: 100%;
    }

    .btn-primary {
        min-width: 140px;
        padding: 10px 24px;
        font-size: 12px;
    }

    .btn-secondary {
        min-width: 110px;
        padding: 7px 18px;
        font-size: 12px;
    }

    .cam-icon {
        padding: 0 12px;
        height: 40px;
        font-size: 11px;
    }

    .site-title-img {
        height: 30px;
    }

    .wheel-scene {
        min-height: min(42vh, 320px);
        perspective: 420px;
    }

    .triple-strip {
        gap: 4px;
        padding: 4px 2px;
    }

    .triple-slot {
        padding: 0 2px 6px;
    }

    .triple-slot-label {
        font-size: 9px;
        letter-spacing: 0.08em;
    }

    .triple-strip--complete .triple-slot-dropzone {
        max-width: min(26vw, 100px);
    }

    #auth-bar {
        flex-shrink: 1;
        min-width: 0;
    }

    #user-status {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
    }

    #user-email-display {
        max-width: 120px;
    }

    .site-title {
        flex-shrink: 0;
    }
}


/* 首屏：單張牌，開掌後展開輪盤 */
.intro-hero-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: min(44vh, 400px);
    padding: 8px 0 0;
    position: relative;
}

.intro-hero-stage .btn-intro-expand {
    font-size: 12px;
    padding: 8px 20px;
    background: rgba(10, 5, 25, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: rgba(201, 169, 110, 0.4);
    white-space: nowrap;
}

.intro-gesture-hint {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.04em;
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
}

.intro-hero-card {
    width: min(220px, 52vw);
    aspect-ratio: 2 / 3;
    border-radius: 3.5%;
    border: none;
    outline: none;
    box-shadow: none;
    animation: introHeroPulse 3.2s ease-in-out infinite;
}

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

.sigil-inline {
    width: 36%;
    max-width: 180px;
    margin: 0 auto;
    transform: perspective(120px) rotateX(78deg);
    transform-origin: 50% 0%;
    pointer-events: none;
    animation: sigil-glow-pulse 3.8s ease-in-out infinite;
}

.sigil-wheel {
    width: 75%;
    max-width: 460px;
    margin: 0px auto 0;
    position: relative;
    z-index: 0;
    transform: perspective(200px) rotateX(75deg);
    transform-origin: 50% 0%;
    pointer-events: none;
    opacity: 0;
    animation: sigil-wheel-container-in 0.18s ease-out 0.05s both,
               sigil-glow-pulse 3.8s 1.85s ease-in-out infinite;
}

/* Container just fades in instantly so SVG strokes can do all the drama */
@keyframes sigil-wheel-container-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Per-element stroke-draw animations ── */

/* Outer ring (circumference ≈ 446) */
@keyframes sigil-draw-outer-ring {
    0%   { stroke-dashoffset: 446; opacity: 0.9; }
    100% { stroke-dashoffset: 0;   opacity: 1; }
}

/* Inner ring (circumference ≈ 352) */
@keyframes sigil-draw-inner-ring {
    0%   { stroke-dashoffset: 352; opacity: 0.9; }
    100% { stroke-dashoffset: 0;   opacity: 1; }
}

/* Pentagram (perimeter ≈ 580) */
@keyframes sigil-draw-pentagram {
    0%   { stroke-dashoffset: 580; opacity: 0.9; }
    100% { stroke-dashoffset: 0;   opacity: 1; }
}

/* Crescent circles (full circle circumference ≈ 446, mask makes it appear as crescent) */
@keyframes sigil-draw-crescent {
    0%   { stroke-dashoffset: 446; opacity: 0.9; }
    100% { stroke-dashoffset: 0;   opacity: 1; }
}

/* Glow bloom on the container filter during entrance, settles to idle */
@keyframes sigil-wheel-bloom {
    0% {
        filter:
            drop-shadow(0 0 60px rgba(201, 169, 110, 1))
            drop-shadow(0 0 120px rgba(201, 169, 110, 0.95))
            drop-shadow(0 0 180px rgba(180, 80, 255, 0.7))
            brightness(5);
    }
    30% {
        filter:
            drop-shadow(0 0 30px rgba(201, 169, 110, 0.95))
            drop-shadow(0 0 70px rgba(201, 169, 110, 0.75))
            drop-shadow(0 0 110px rgba(180, 80, 255, 0.55))
            brightness(2.5);
    }
    100% {
        filter:
            drop-shadow(0 0 10px rgba(201, 169, 110, 0.65))
            drop-shadow(0 0 28px rgba(201, 169, 110, 0.4))
            drop-shadow(0 0 52px rgba(160, 60, 240, 0.3));
    }
}

/* Apply bloom animation to the SVG inside .sigil-wheel */
.sigil-wheel svg {
    animation: sigil-wheel-bloom 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

/* Outer ring draw */
.sigil-wheel .sw-outer-ring {
    stroke-dasharray: 446;
    stroke-dashoffset: 446;
    animation: sigil-draw-outer-ring 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.08s both;
}

/* Inner ring draw */
.sigil-wheel .sw-inner-ring {
    stroke-dasharray: 352;
    stroke-dashoffset: 352;
    animation: sigil-draw-inner-ring 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.58s both;
}

/* Pentagram draw */
.sigil-wheel .sw-pentagram {
    stroke-dasharray: 580;
    stroke-dashoffset: 580;
    animation: sigil-draw-pentagram 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.92s both;
}

/* Left crescent draw */
.sigil-wheel .sw-crescent-left {
    stroke-dasharray: 446;
    stroke-dashoffset: 446;
    animation: sigil-draw-crescent 0.35s cubic-bezier(0.4, 0, 0.2, 1) 1.45s both;
}

/* Right crescent draw */
.sigil-wheel .sw-crescent-right {
    stroke-dasharray: 446;
    stroke-dashoffset: 446;
    animation: sigil-draw-crescent 0.35s cubic-bezier(0.4, 0, 0.2, 1) 1.65s both;
}

/* Center dot appears last with a pop */
.sigil-wheel .sw-center-dot {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: sigil-center-dot-appear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 1.82s both;
}
@keyframes sigil-center-dot-appear {
    0%   { opacity: 0;   transform: scale(5); }
    55%  { opacity: 1; }
    100% { opacity: 1;   transform: scale(1); }
}

/* Radial burst glow — scales outward and fades */
.sigil-wheel .sw-burst-glow {
    transform-box: fill-box;
    transform-origin: center;
    animation: sigil-burst-glow-fade 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
@keyframes sigil-burst-glow-fade {
    0%   { opacity: 0.95; transform: scale(1); }
    20%  { opacity: 0.75; }
    100% { opacity: 0;    transform: scale(28); }
}

.intro-hint-bar {
    display: none !important;
}

.intro-hero-hint {
    display: none;
}

.wheel-scene--burst {
    animation: wheelBurstIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wheelBurstIn {
    from {
        opacity: 0.4;
        transform: scale(0.82);
        filter: blur(1.5px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: none;
    }
}

/* 3D Wheel */
.wheel-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    margin: 4px 0 16px;
    padding: 8px 16px;
}

.wheel-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

.btn-wheel-pause {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 0.12em;
    padding: 10px 18px;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: auto;
    margin-bottom: 0;
}

.btn-wheel-pause:hover {
    border-color: rgba(201, 169, 110, 0.4);
    color: rgba(201, 169, 110, 0.8);
}

.wheel-scene {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: min(60vh, 540px);
    height: auto;
    perspective: 680px;
    perspective-origin: center 42%;
    user-select: none;
    touch-action: none;
    cursor: grab;
    /* 必須可見，否則選中牌的 box-shadow / drop-shadow 外光暈會被裁掉 */
    overflow: visible;
    border-radius: 18px;
    background: transparent;
    border: none;
    outline: none;
}

.wheel-scene.dragging {
    cursor: grabbing;
}

.card-wheel {
    position: absolute;
    top: 49%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

.wheel-card {
    position: absolute;
    width: 102px;
    height: 164px;
    margin: -82px 0 0 -51px;
    transform-style: preserve-3d;
    transition: filter 100ms linear;
}

/* 五张牌：单张更大、更像参考图前排弧形 */
.wheel-five .wheel-card {
    width: 118px;
    height: 188px;
    margin: -94px 0 0 -59px;
}

/* 停牌時：正朝向使用者、z 最大的一張（內圈 + 外光；勿依賴會被父層裁切的外擴陰影） */
.wheel-five .wheel-card.wheel-card--selected {
    z-index: 2000 !important;
}

.wheel-five .wheel-card.wheel-card--selected .wheel-card-inner.wheel-card-back {
    box-shadow:
        inset 0 0 0 3px rgba(255, 245, 200, 1),
        inset 0 0 32px rgba(180, 120, 255, 0.55),
        inset 0 0 60px rgba(255, 255, 255, 0.12);
}

/* 選中牌外緣高亮層（疊在牌背上，pointer-events 關閉） */
.wheel-five .wheel-card.wheel-card--selected .wheel-card-inner.wheel-card-back::after {
    content: '';
    position: absolute;
    inset: -3px;
    z-index: 3;
    border-radius: 14px;
    pointer-events: none;
    box-shadow:
        0 0 0 2px rgba(255, 230, 160, 0.95),
        0 0 24px rgba(200, 150, 255, 0.95),
        0 0 48px rgba(130, 80, 220, 0.75);
}

.wheel-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 3.5%;
    border: none;
    outline: none;
    background:
        radial-gradient(circle at 50% 22%, rgba(255,255,255,0.18), transparent 40%),
        linear-gradient(160deg, #1d2140 0%, #111523 60%, #0f1220 100%);
    box-shadow: none;
    display: grid;
    place-items: center;
}

.wheel-card-inner.wheel-card-back {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
}

.wheel-card-inner::before {
    display: none;
}

.wheel-card-inner.wheel-card-back::before {
    display: none;
}

.wheel-moon {
    font-size: 26px;
    color: rgba(252, 238, 201, 0.9);
    text-shadow: 0 2px 10px rgba(252, 238, 201, 0.35);
}

.wheel-hub {
    position: absolute;
    left: 50%;
    bottom: 36px;
    width: 270px;
    height: 270px;
    transform: translateX(-50%);
    pointer-events: none;
}

.hub-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 110, 0.25);
    transform: translate(-50%, -50%);
}

.ring-outer {
    width: 220px;
    height: 220px;
}

.ring-middle {
    width: 166px;
    height: 166px;
    border-color: rgba(201, 169, 110, 0.18);
}

.ring-inner {
    width: 110px;
    height: 110px;
    border-color: rgba(201, 169, 110, 0.12);
}

.hub-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(201, 169, 110, 0.15);
    box-shadow: 0 0 12px rgba(201, 169, 110, 0.3);
}

/* 飛牌幽靈：固定比例、圓角與牌背一致 */
.card-flight-ghost {
    position: fixed;
    z-index: 10050;
    pointer-events: none;
    border-radius: 12px;
    box-sizing: border-box;
    will-change: left, top, width, height;
}

.card-flight-ghost--rev {
    transform: rotate(180deg);
}

/* ===== 极简摄像头控制 ===== */

/* 主图标按钮 */
.cam-icon {
    position: relative;
    width: auto;
    height: 44px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(201, 169, 110, 0.12);
    border: 1px solid rgba(201, 169, 110, 0.6);
    border-radius: 100px;
    color: rgba(201, 169, 110, 0.95);
    cursor: pointer;
    z-index: 1100;
    min-width: 160px;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    animation: cam-breathe 3s ease-in-out infinite;
}

.cam-footer-label {
    font-size: 14px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
}

.cam-icon:hover {
    color: #c9a96e;
    border-color: rgba(201, 169, 110, 0.8);
    background: rgba(201, 169, 110, 0.18);
}

/* 激活状态 */
.cam-icon.cam-active {
    color: #c9a96e;
    border-color: rgba(201, 169, 110, 0.9);
    background: rgba(201, 169, 110, 0.2);
    animation: none;
}

/* 追踪状态 */
.cam-icon.cam-tracking {
    color: rgba(74, 222, 128, 0.9);
    border-color: rgba(74, 222, 128, 0.5);
    animation: none;
}

/* 呼吸动画（待机） */
@keyframes cam-breathe {
    0%, 100% { transform: scale(0.92); opacity: 0.6; }
    50% { transform: scale(1.0); opacity: 1; }
}

/* 激活波纹 */
.cam-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(201, 169, 110, 0.5);
    opacity: 0;
    pointer-events: none;
}

.cam-icon.cam-active .cam-pulse {
    animation: cam-ripple 2s ease-out infinite;
}

@keyframes cam-ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* 摄像头小窗 */
.cam-preview {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 120px;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(201, 169, 110, 0.2);
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at center, black 60%, transparent 100%);
    mask-image: radial-gradient(ellipse 90% 90% at center, black 60%, transparent 100%);
}

.cam-preview.cam-preview--visible {
    opacity: 1;
    pointer-events: auto;
}

.cam-preview.cam-preview--folded {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(74, 222, 128, 0.8);
    border: none;
    -webkit-mask-image: none;
    mask-image: none;
}

#gesture-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    display: block;
}

#gesture-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

.cam-preview-fold {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 8px;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.cam-preview:hover .cam-preview-fold {
    opacity: 1;
}

/* 实时手势引导文字 — ritual readout 风格 */
.gesture-hint {
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    color: rgba(201, 169, 110, 1);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1200;
    white-space: nowrap;
    text-shadow: 0 0 24px rgba(201, 169, 110, 0.8);
}

.gesture-hint.hint-visible {
    opacity: 1;
}

/* 停牌选中牌脉冲动画（ECG 节律，2.4s 心跳） */
@keyframes tarot-pulse {
    0%   { filter: drop-shadow(0 0 10px rgba(230,200,255,0.5))  drop-shadow(0 0 20px rgba(120,80,200,0.3))  brightness(1.0); }
    30%  { filter: drop-shadow(0 0 20px rgba(230,200,255,0.98)) drop-shadow(0 0 40px rgba(120,80,200,0.7))  brightness(1.15); }
    35%  { filter: drop-shadow(0 0 22px rgba(255,230,255,1.0))  drop-shadow(0 0 44px rgba(140,80,220,0.8))  brightness(1.18); }
    60%  { filter: drop-shadow(0 0 14px rgba(230,200,255,0.6))  drop-shadow(0 0 28px rgba(120,80,200,0.4))  brightness(1.05); }
    100% { filter: drop-shadow(0 0 10px rgba(230,200,255,0.5))  drop-shadow(0 0 20px rgba(120,80,200,0.3))  brightness(1.0); }
}

.wheel-card--selected {
    animation: tarot-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Sigil Ground (Triple Moon + Pentagram) ── */
.sigil-ground {
    width: 36%;
    max-width: 180px;
    margin: -8px auto 0;
    transform: perspective(120px) rotateX(78deg);
    transform-origin: 50% 0%;
    pointer-events: none;
    flex-shrink: 0;
    animation: sigil-glow-pulse 3.8s ease-in-out infinite;
}

.sigil-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

@keyframes sigil-glow-pulse {
    0%, 100% {
        opacity: 0.42;
        filter:
            drop-shadow(0 0 5px rgba(201, 169, 110, 0.4))
            drop-shadow(0 0 16px rgba(160, 60, 240, 0.18));
    }
    50% {
        opacity: 0.78;
        filter:
            drop-shadow(0 0 10px rgba(201, 169, 110, 0.72))
            drop-shadow(0 0 28px rgba(201, 169, 110, 0.45))
            drop-shadow(0 0 52px rgba(160, 60, 240, 0.38));
    }
}

/* ── Global text scale-up ── */
.triple-slot-label       { font-size: 13px; }
.triple-slot-name        { font-size: 22px; }
.triple-slot-orient      { font-size: 15px; }
.triple-slot-placeholder { font-size: 13px; }
.triple-slot-hint        { font-size: 11px; }
.triple-meaning-block    { font-size: 16px; }
.spread-card h3          { font-size: 16px; }
.spread-card .card-count { font-size: 12px; }
.card-name               { font-size: 22px; }
.card-name-cn            { font-size: 16px; }
.card-position           { font-size: 16px; }
.card-slot-text          { font-size: 16px; }
.empty-state p           { font-size: 16px; }
.btn-primary             { font-size: 16px; }
.btn-secondary           { font-size: 14px; }
.btn-analyze             { font-size: 15px; }
.btn-ai-primary          { font-size: 16px; }
.analysis-content        { font-size: 17px; }
.question-section h3     { font-size: 18px; }
.intro-hero-hint         { font-size: 15px; color: rgba(255,255,255,0.55); }


/* ── Payment Modal ─────────────────────────────────────────────────────────── */
#payment-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
}

.payment-modal-box {
    max-width: 380px;
    width: 92vw;
    padding: 32px 28px 28px;
    max-height: 90vh;
    overflow-y: auto;
}

.payment-modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
    color: #c9a96e;
    text-align: center;
    margin: 0 0 8px;
}

.payment-modal-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.5;
}

.pay-option {
    border: 1px solid rgba(201,169,110,0.2);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: rgba(201,169,110,0.04);
}

.pay-option--highlight {
    border-color: rgba(201,169,110,0.55);
    background: rgba(201,169,110,0.09);
}

.pay-option-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(201,169,110,0.7);
    margin-bottom: 4px;
}

.pay-option-price {
    font-family: var(--font-heading);
    font-size: 26px;
    color: #e8d5a3;
    line-height: 1.1;
    margin-bottom: 4px;
}

.pay-option-period {
    font-size: 14px;
    color: rgba(232,213,163,0.6);
}

.pay-option-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 12px;
    line-height: 1.4;
}

.pay-btn {
    width: 100%;
    padding: 9px 0;
    border-radius: 20px;
    border: 1px solid rgba(201,169,110,0.5);
    background: rgba(201,169,110,0.12);
    color: #c9a96e;
    font-size: 13px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s;
}

.pay-btn:hover { background: rgba(201,169,110,0.22); }
.pay-btn:disabled { opacity: 0.5; cursor: default; }

.pay-btn--sub {
    background: rgba(201,169,110,0.2);
    border-color: rgba(201,169,110,0.7);
}
