:root {
    --parchment-bg: #EFE0C1;
    --parchment-card: #FCF6E8;
    --parchment-card-alt: #F4E7CC;
    --velvet-deep: #2A1331;
    --velvet-mid: #3B1B43;
    --gold-leaf: #D49B38;
    --gold-bright: #F4D27A;
    --crimson-seal: #8B1E3F;
    --ink-dark: #2B1710;
    --ink-muted: #6A4A3A;
}

body {
    background-color: var(--parchment-bg);
    color: var(--ink-dark);
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 90% 55% at 50% 0%, rgba(139, 30, 63, 0.14), transparent 65%),
        radial-gradient(ellipse 65% 55% at 12% 35%, rgba(212, 155, 56, 0.18), transparent 60%),
        radial-gradient(ellipse 65% 55% at 88% 75%, rgba(88, 28, 135, 0.12), transparent 65%),
        linear-gradient(180deg, #F4E8CF 0%, #EAD6B1 52%, #E2C89C 100%);
}

/* Sacred celestial watermark & warm incense aura behind manuscript */
.mystic-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mystic-mandala {
    position: absolute;
    top: -120px;
    right: -140px;
    width: 680px;
    height: 680px;
    opacity: 0.14;
    color: #7C3AED;
    animation: slowOrbit 90s linear infinite;
}

.mystic-mandala-bottom {
    position: absolute;
    bottom: -180px;
    left: -160px;
    width: 560px;
    height: 560px;
    opacity: 0.11;
    color: #9A3412;
    animation: slowOrbit 120s linear infinite reverse;
}

@keyframes slowOrbit {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Royal Plum Velvet Sanctuary (Top Header & Sacred Palm Scanner Altar) */
.mystic-velvet {
    position: relative;
    background:
        radial-gradient(circle at 22% 18%, rgba(212, 155, 56, 0.18) 0%, transparent 48%),
        radial-gradient(circle at 82% 85%, rgba(159, 32, 66, 0.28) 0%, transparent 52%),
        linear-gradient(155deg, #3D1C46 0%, #2B1333 52%, #441B3B 100%);
    border: 1px solid rgba(226, 178, 84, 0.48);
    box-shadow:
        inset 0 1px 0 rgba(255, 236, 179, 0.2),
        0 20px 48px -18px rgba(45, 16, 48, 0.45);
    color: #FDF3DC;
}

/* Antique Samut-Khoi Parchment Cards */
.oracle-card {
    position: relative;
    background: linear-gradient(180deg, #FCF7EB 0%, #F4E6C9 100%);
    border: 1px solid rgba(176, 122, 38, 0.42);
    box-shadow:
        inset 0 0 0 3px rgba(212, 155, 56, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 14px 36px -18px rgba(64, 28, 22, 0.25);
    color: var(--ink-dark);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.oracle-card:hover {
    border-color: rgba(168, 102, 24, 0.65);
    box-shadow:
        inset 0 0 0 3px rgba(212, 155, 56, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 42px -18px rgba(92, 25, 45, 0.3);
}

.oracle-card-crimson {
    background: linear-gradient(180deg, #FDF4EE 0%, #F5DFD6 100%);
    border: 1px solid rgba(139, 30, 63, 0.38);
}

/* Ornamental Gold Divider Line */
.oracle-gold-line {
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 155, 56, 0.35) 20%,
        rgba(244, 210, 122, 0.9) 50%,
        rgba(212, 155, 56, 0.35) 80%,
        transparent 100%
    );
}

/* Crimson Wax-Seal & Gold-Leaf Primary CTA */
.oracle-cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #A32449 0%, #7C1534 100%);
    color: #FFF7E4;
    border: 1px solid rgba(244, 210, 122, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 182, 0.45),
        0 10px 26px -6px rgba(124, 21, 52, 0.55);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.oracle-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 182, 0.6),
        0 14px 32px -6px rgba(139, 30, 63, 0.65);
}

.oracle-cta:active {
    transform: translateY(0);
}

/* Burnished Gold-Leaf Action Button */
.oracle-btn-gold {
    background: linear-gradient(180deg, #F3CF7A 0%, #CC8F28 100%);
    color: #2B1316;
    border: 1px solid rgba(255, 244, 212, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 250, 230, 0.75),
        0 8px 20px -6px rgba(180, 118, 22, 0.5);
    transition: transform 0.15s ease, filter 0.2s ease;
}

.oracle-btn-gold:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* Velvet secondary button (inside dark velvet panels) */
.oracle-btn-velvet {
    background: rgba(255, 243, 214, 0.08);
    color: #FCEFD4;
    border: 1px solid rgba(226, 178, 84, 0.38);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.oracle-btn-velvet:hover {
    background: rgba(255, 243, 214, 0.16);
    border-color: rgba(244, 210, 122, 0.7);
}

/* Parchment secondary button (inside ivory parchment cards) */
.oracle-btn-parchment {
    background: rgba(139, 30, 63, 0.06);
    color: #4E271E;
    border: 1px solid rgba(176, 122, 38, 0.42);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.oracle-btn-parchment:hover {
    background: rgba(139, 30, 63, 0.12);
    border-color: rgba(139, 30, 63, 0.5);
}

/* Sacred Astrolabe Mirror Grid (No black!) */
.mystic-mirror-grid {
    background-color: #27122E;
    background-size: 32px 32px;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(212, 155, 56, 0.14) 0%, transparent 70%),
        linear-gradient(to right, rgba(226, 178, 84, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(226, 178, 84, 0.07) 1px, transparent 1px);
}

/* Golden Oracle Scan Sweep */
@keyframes scanSweep {
    0% {
        top: -4%;
        opacity: 0;
    }
    15% {
        opacity: 0.75;
    }
    85% {
        opacity: 0.75;
    }
    100% {
        top: 102%;
        opacity: 0;
    }
}

.scan-laser {
    position: absolute;
    left: 0;
    right: 0;
    top: -4%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(244, 210, 122, 0.75), #FFF4D2, rgba(244, 210, 122, 0.75), transparent);
    box-shadow: 0 0 16px 2px rgba(226, 178, 84, 0.45);
    animation: scanSweep 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

/* Custom scrollbar matching antique gold & plum */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: #E8D5B2;
}

::-webkit-scrollbar-thumb {
    background: #B07C3A;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B1E3F;
}

.caliper-point {
    cursor: grab;
    transition: transform 0.1s ease;
}

.caliper-point:active {
    cursor: grabbing;
    transform: scale(1.25);
}
