/* ============================================
   KASUMI'S SANCTUARY — Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink-deep: #0a0b14;
    --ink-mid: #13122a;
    --ink-wash: #1e1a35;
    --sakura: #FFB7C5;
    --sakura-deep: #e8879b;
    --sakura-pale: #ffd4de;
    --moonlight: #c8d4f0;
    --lantern: #ffe4c4;
    --gold: #d4a574;
    --gold-bright: #e8c08a;
    --text-primary: #e4e0ef;
    --text-secondary: #9b97b0;
    --text-muted: #6a6580;
    --glass-bg: rgba(12, 10, 24, 0.55);
    --glass-border: rgba(255, 183, 197, 0.08);
    --card-radius: 14px;
}
/* ============================================
   ARCHIVE LIST
   ============================================ */
.archive-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 183, 197, 0.15) transparent;
}
.archive-list::-webkit-scrollbar {
    width: 4px;
}
.archive-list::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 197, 0.15);
    border-radius: 2px;
}
.archive-item {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(255, 183, 197, 0.2);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}
.archive-item:hover {
    background: rgba(255, 183, 197, 0.05);
    border-left-color: var(--sakura);
}
.archive-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--sakura-pale);
    margin-bottom: 4px;
}
.archive-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'EB Garamond', 'Noto Serif JP', Georgia, serif;
    background: var(--ink-deep);
    color: var(--text-primary);
}

/* ============================================
   PANORAMIC ROOM BACKGROUND
   Mouse-trackable 4032x1152 image
   ============================================ */

.room-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.room-panorama {
    position: absolute;
    height: 110%;
    width: auto;
    min-width: 110%;
    top: -5%;
    left: 50%;
    transform: translate(-50%, 0);
    object-fit: cover;
    user-select: none;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* ============================================
   VIDEO / PLACEHOLDER LAYER
   Centered 2016x1152, scaled to viewport height
   ============================================ */

.video-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}

.video-layer video,
.video-layer .scene-placeholder {
    height: 110vh;
    width: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    max-width: none;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* ============================================
   EDGE FADE — dissolves left and right sides into darkness
   ============================================ */

.edge-fade {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    /* Fades the sides into the black background, masking video seams */
    background:
        /* Left fade */
        linear-gradient(90deg, var(--ink-deep) 0%, rgba(10, 11, 20, 0.95) 5%, rgba(10, 11, 20, 0.6) 15%, transparent 35%),
        /* Right fade */
        linear-gradient(270deg, var(--ink-deep) 0%, rgba(10, 11, 20, 0.95) 5%, rgba(10, 11, 20, 0.6) 15%, transparent 35%);
}

/* ============================================
   PARTICLE CANVAS
   ============================================ */

#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

/* ============================================
   FORTUNE REVEAL OVERLAY
   Full screen white/black fade for fortune
   ============================================ */

.fortune-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.fortune-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.fortune-overlay.good {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.97) 0%, rgba(255, 248, 240, 0.95) 40%, rgba(255, 240, 230, 0.9) 100%);
}

.fortune-overlay.bad {
    background: radial-gradient(ellipse at center, rgba(15, 10, 25, 0.97) 0%, rgba(5, 5, 15, 0.98) 100%);
}

.fortune-reveal-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) 0.4s;
}

.fortune-overlay.active .fortune-reveal-content {
    opacity: 1;
    transform: translateY(0);
}

/* Good fortune text = dark on white */
.fortune-overlay.good .fortune-reveal-content {
    color: #2d2535;
}

.fortune-overlay.good .reveal-type {
    color: #b8860b;
    text-shadow: 0 0 20px rgba(184, 134, 11, 0.3);
}

.fortune-overlay.good .reveal-message {
    color: #3d3545;
}

/* Bad fortune text = light on dark */
.fortune-overlay.bad .fortune-reveal-content {
    color: #e4e0ef;
}

.fortune-overlay.bad .reveal-type {
    color: #dc3545;
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
}

.fortune-overlay.bad .reveal-message {
    color: #9b97b0;
}

.reveal-type {
    font-family: 'Noto Serif JP', serif;
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 8px;
}

.reveal-type-en {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    letter-spacing: 5px;
    margin-bottom: 30px;
    opacity: 0.7;
}

.reveal-message {
    font-family: 'EB Garamond', serif;
    font-size: 1.35rem;
    line-height: 2;
    font-style: italic;
    margin-bottom: 30px;
}

.reveal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.reveal-btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.reveal-btn.accept {
    background: rgba(184, 134, 11, 0.15);
    border-color: rgba(184, 134, 11, 0.4);
    color: #b8860b;
}

.fortune-overlay.bad .reveal-btn.accept {
    background: rgba(255, 183, 197, 0.1);
    border-color: rgba(255, 183, 197, 0.3);
    color: var(--sakura);
}

.reveal-btn.tie {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.fortune-overlay.good .reveal-btn.tie {
    background: rgba(139, 90, 60, 0.1);
    border-color: rgba(139, 90, 60, 0.3);
    color: #8b5a3c;
}

.reveal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Tarot card in reveal overlay */
.reveal-tarot-card {
    width: 200px;
    height: 292px;
    margin: 0 auto 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.6s ease;
}

.reveal-tarot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reveal-tarot-card.reversed {
    transform: rotate(180deg);
}

.reveal-orientation {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
    opacity: 0.6;
}

/* ============================================
   UI LAYER — Panels and navigation
   ============================================ */

.ui-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* ============================================
   AUDIO CONTROLS (Top Right)
   ============================================ */

.audio-controls {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    gap: 15px;
    z-index: 20;
    pointer-events: all;
}

.audio-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 38px;
    height: 38px;
    opacity: 0.35;
    transition: opacity 0.3s ease, transform 0.2s ease, filter 0.3s ease;
    filter: grayscale(100%) brightness(0.6);
}

.audio-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.audio-btn:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.audio-btn.active {
    opacity: 1;
    filter: grayscale(0%) brightness(1);
}

/* ============================================
   FLIP TOGGLE BUTTON
   ============================================ */

.flip-toggle,
.expand-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 38px;
    height: 38px;
    opacity: 0.35;
    transition: opacity 0.3s ease, transform 0.2s ease, filter 0.3s ease;
    filter: grayscale(100%) brightness(0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.flip-toggle img,
.expand-toggle img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.flip-toggle:hover,
.expand-toggle:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.flip-toggle.active,
.expand-toggle.active {
    opacity: 1;
    filter: grayscale(0%) brightness(1);
}

/* Labels hidden - icons only */
.flip-toggle .flip-label,
.expand-toggle .flip-label {
    display: none;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */

.tab-nav {
    display: flex;
    justify-content: center;
    gap: 3px;
    padding: 12px 20px 0;
    pointer-events: all;
    position: relative;
    z-index: 15;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: transparent;
    transition: background 0.4s ease;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(15, 13, 28, 0.7);
}

.tab-btn.active {
    color: var(--sakura);
    background: rgba(15, 13, 28, 0.75);
    border-color: rgba(255, 183, 197, 0.1);
}

.tab-btn.active::after {
    background: linear-gradient(90deg, transparent, var(--sakura), transparent);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-label {
    font-size: 0.82rem;
}

/* ============================================
   TAB PANELS
   ============================================ */

.tab-panel {
    display: none;
    flex: 1;
    pointer-events: all;
    overflow: hidden;
}

.tab-panel.active {
    display: flex;
}

.panel-scroll {
    width: 420px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 25px 40px;
    margin-right: 40px;
    margin-left: auto;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 183, 197, 0.15) transparent;
}

/* Flipped state - panel on left */
.panel-scroll.flipped {
    margin-left: 40px;
    margin-right: auto;
}

/* Expanded state - larger panel (~800px, double size) */
.panel-scroll.expanded {
    width: 800px;
}

.panel-scroll.expanded.flipped {
    margin-left: 40px;
    margin-right: auto;
}

.panel-scroll::-webkit-scrollbar {
    width: 4px;
}

.panel-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 197, 0.15);
    border-radius: 2px;
}

/* ============================================
   JOURNAL HEADER
   ============================================ */

.journal-header {
    position: relative;
    padding-left: 18px;
    margin-bottom: 20px;
}

.journal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--sakura), var(--sakura-deep), transparent);
    border-radius: 1px;
}

.journal-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--sakura);
    text-shadow: 0 0 25px rgba(255, 183, 197, 0.25);
    letter-spacing: 6px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.journal-subtitle {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 3px;
}

.kanji-mark {
    position: absolute;
    right: 0;
    top: -5px;
    font-family: 'Noto Serif JP', serif;
    font-size: 3.5rem;
    color: rgba(255, 183, 197, 0.06);
    font-weight: 300;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

/* ============================================
   GLASS CARDS
   ============================================ */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 28px 24px;
    margin-bottom: 18px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 183, 197, 0.2), transparent);
}

/* ============================================
   JOURNAL ENTRY
   ============================================ */

.entry-date {
    font-family: 'Inter', sans-serif;
}

.entry-countdown {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #a89f91;
    margin-top: 0.25rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.entry-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.15rem;
    line-height: 2.1;
    color: var(--text-primary);
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.entry-text p {
    margin-bottom: 16px;
    text-indent: 1.2em;
}

.entry-text p:first-child {
    text-indent: 0;
}

.entry-text p:first-child::first-letter {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    float: left;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 5px;
    color: var(--sakura);
    text-shadow: 0 0 15px rgba(255, 183, 197, 0.3);
    font-style: normal;
    font-weight: 600;
}

.entry-text p:last-child {
    margin-bottom: 0;
}

.loading-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-size: 0.85rem;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

.demo-badge,
.cached-badge {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-style: normal;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: rgba(255, 183, 197, 0.04);
    border: 1px solid rgba(255, 183, 197, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 14px;
    color: var(--text-muted);
}

/* ============================================
   ASK / SPEAK WITH HER
   ============================================ */

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--sakura);
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 4px;
}

.section-title.gold {
    color: var(--gold);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 16px;
}

.text-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 183, 197, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    resize: none;
    min-height: 70px;
    transition: all 0.4s ease;
    line-height: 1.6;
}

.text-input:focus {
    outline: none;
    border-color: rgba(255, 183, 197, 0.25);
    box-shadow: 0 0 20px rgba(255, 183, 197, 0.03);
    background: rgba(0, 0, 0, 0.35);
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.12);
    font-style: italic;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(255, 183, 197, 0.08), rgba(212, 165, 116, 0.05));
    border: 1px solid rgba(255, 183, 197, 0.2);
    color: var(--sakura);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    border-color: rgba(255, 183, 197, 0.45);
    box-shadow: 0 0 15px rgba(255, 183, 197, 0.08);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.status-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.response-box {
    margin-top: 18px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-left: 2px solid rgba(255, 183, 197, 0.2);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    line-height: 1.9;
    color: var(--text-primary);
    display: none;
    animation: fadeUp 0.6s ease;
}

.error-box {
    margin-top: 12px;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-style: normal;
    color: #ff9a9a;
    display: none;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FORTUNE CARDS (Crystal + Tarot shared)
   ============================================ */

.fortune-intro {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 22px;
}

.btn-fortune {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.12) 0%, rgba(255, 183, 197, 0.08) 100%);
    border: 1px solid rgba(212, 165, 116, 0.25);
    border-radius: 10px;
    color: var(--gold-bright);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.btn-fortune::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(255, 183, 197, 0.15));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-fortune:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-fortune:hover:not(:disabled) {
    border-color: rgba(212, 165, 116, 0.5);
    box-shadow: 0 0 25px rgba(212, 165, 116, 0.1);
    transform: translateY(-2px);
}

.btn-fortune:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-fortune-text {
    position: relative;
    z-index: 1;
}

.tarot-btn {
    background: linear-gradient(135deg, rgba(100, 80, 160, 0.12), rgba(255, 183, 197, 0.08));
    border-color: rgba(150, 120, 200, 0.25);
    color: #c8b4e8;
}

.tarot-btn:hover:not(:disabled) {
    border-color: rgba(150, 120, 200, 0.5);
    box-shadow: 0 0 25px rgba(150, 120, 200, 0.1);
}

/* Fortune result inside card */
.fortune-result,
.tarot-result {
    animation: fadeUp 0.6s ease;
}

.fortune-type {
    font-family: 'Noto Serif JP', serif;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 4px;
}

.fortune-type-en {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-align: center;
    letter-spacing: 3px;
    opacity: 0.6;
    margin-bottom: 16px;
}

.fortune-message {
    font-size: 1.1rem;
    line-height: 1.9;
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-tie {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    color: #e88;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tie:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
}

.tie-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.tied-display {
    text-align: center;
    animation: fadeUp 0.6s ease;
}

.tied-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.tied-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.8;
}

.fortune-timer {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 14px;
    letter-spacing: 1px;
}

/* ============================================
   TAROT CARD DISPLAY (3D flip)
   ============================================ */

.tarot-card-display {
    width: 160px;
    height: 234px;
    margin: 0 auto 20px;
    perspective: 1000px;
}

.tarot-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tarot-card-inner.flipped {
    transform: rotateY(180deg);
}

.tarot-card-inner.reversed {
    transform: rotateY(180deg) rotate(180deg);
}

.tarot-card-back,
.tarot-card-front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.tarot-card-back {
    background: linear-gradient(135deg, #1a1430, #2d2050, #1a1430);
    border: 2px solid rgba(150, 120, 200, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-design {
    font-size: 3rem;
    color: rgba(150, 120, 200, 0.3);
    animation: cardPulse 3s ease-in-out infinite;
}

@keyframes cardPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.tarot-card-front {
    transform: rotateY(180deg);
}

.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tarot-reading {
    text-align: center;
    animation: fadeUp 0.6s ease 0.5s both;
}

.tarot-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #c8b4e8;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tarot-orientation {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tarot-meaning {
    font-size: 1.05rem;
    line-height: 1.8;
    font-style: italic;
    color: var(--text-secondary);
}

/* ============================================
   FORTUNE HISTORY
   ============================================ */

.history-card {
    padding: 20px;
}

.fortune-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.history-item {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.history-item:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-item .history-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.95);
    border: 1px solid rgba(255, 183, 197, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.history-item:hover .history-tooltip {
    opacity: 1;
}

.history-tooltip .ht-type {
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.history-tooltip .ht-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.history-tooltip .ht-msg {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}

.history-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* Tarot history items show card thumbnail */
.history-item.tarot-history-item {
    border-radius: 4px;
    width: 36px;
    height: 52px;
}

.history-item.tarot-history-item.reversed img {
    transform: rotate(180deg);
}

/* ============================================
   DECORATIVE
   ============================================ */

.brush-divider {
    width: 100%;
    height: 16px;
    position: relative;
    margin: 4px 0;
}

.brush-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 183, 197, 0.12), rgba(212, 165, 116, 0.08), transparent);
}

.brush-divider::after {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.4rem;
    color: rgba(255, 183, 197, 0.15);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.08);
    letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 10;
    pointer-events: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUp 0.8s ease forwards;
}

/* Tarot cards float up animation */
@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.8);
    }

    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tarot-card-display.float-in {
    animation: floatUp 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .panel-scroll {
        width: 100%;
        margin-left: 0;
        padding: 15px 18px 40px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    .tab-label {
        display: none;
    }

    .tab-icon {
        font-size: 1.3rem;
    }

    .journal-title {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }

    .edge-fade {
        background:
            linear-gradient(90deg, rgba(10, 11, 20, 0.9) 0%, transparent 20%),
            linear-gradient(270deg, rgba(10, 11, 20, 0.9) 0%, transparent 20%),
            linear-gradient(180deg, rgba(10, 11, 20, 0.5) 0%, transparent 10%),
            linear-gradient(0deg, rgba(10, 11, 20, 0.7) 0%, transparent 15%);
    }
}