@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,wght@0,400;1,400&family=Syne:wght@600&family=Atkinson+Hyperlegible:wght@400&family=Space+Mono:wght@400&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cosmic: #0A0A1F;
    --nebula: #12103A;
    --cyan: #00E5FF;
    --magenta: #FF00E5;
    --gold: #FFD700;
    --spirit: #F0EDE8;
    --stardust: #9090A8;
    --void: #050510;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    background: var(--cosmic);
    color: var(--spirit);
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================================
   STAR BACKGROUND
   ============================================ */
#star-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.star-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--stardust);
    opacity: 0.08;
}

/* ============================================
   SNAP SECTIONS
   ============================================ */
.snap-section {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ============================================
   CRYSTAL BALL GRADIENT
   ============================================ */
.crystal-ball-gradient {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(0, 229, 255, 0.08) 0%,
        rgba(255, 0, 229, 0.05) 40%,
        rgba(255, 215, 0, 0.03) 70%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
    animation: crystalPulse 8s ease-in-out infinite;
}

.crystal-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.crystal-offset-1 { top: 15%; left: 55%; }
.crystal-offset-2 { bottom: 5%; right: 55%; }
.crystal-offset-3 { top: 25%; left: 25%; }

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

.crystal-center {
    animation: crystalPulseCenter 8s ease-in-out infinite;
}

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

/* ============================================
   ORACLE CHAMBER (HERO)
   ============================================ */
#oracle-chamber {
    background: linear-gradient(180deg, var(--cosmic) 0%, var(--nebula) 100%);
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.oracle-title {
    font-family: 'Bodoni Moda', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--cyan), var(--magenta), var(--gold), var(--cyan));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holoShimmer 8s ease infinite;
    opacity: 0;
    transition: opacity 1s ease;
}

.oracle-title.visible {
    opacity: 1;
}

@keyframes holoShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.oracle-question {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--stardust);
    margin-top: 24px;
    opacity: 0;
    transition: opacity 1s ease, color 1s ease;
}

.oracle-question.visible {
    opacity: 1;
    color: var(--spirit);
}

/* ============================================
   THEATER SECTIONS
   ============================================ */
.theater-section {
    background: linear-gradient(180deg, var(--cosmic) 0%, var(--void) 50%, var(--cosmic) 100%);
}

.section-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 800px;
    padding: 0 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.syne-header {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

.theater-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--spirit);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   VISUALIZATIONS
   ============================================ */
.viz-container {
    margin: 24px auto;
    display: flex;
    justify-content: center;
}

.curve-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s ease;
}

.curve-path.drawn {
    stroke-dashoffset: 0;
}

.tree-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.4s ease;
}

.tree-branch.drawn {
    stroke-dashoffset: 0;
}

.monte-dot {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.monte-dot.visible {
    opacity: 0.6;
}

/* ============================================
   PROBABILITY VALUES
   ============================================ */
.prob-value {
    margin-top: 16px;
}

.prob-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: var(--stardust);
}

.counter-value,
.data-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: var(--gold);
}

/* ============================================
   HORIZONTAL CARD SPREAD
   ============================================ */
#card-spread {
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    background: var(--void);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#card-spread::-webkit-scrollbar {
    display: none;
}

.horizontal-track {
    display: flex;
    gap: 0;
    width: max-content;
    height: 100%;
}

.prob-card {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.card-border-glow {
    position: absolute;
    inset: 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    pointer-events: none;
    background-image: linear-gradient(var(--void), var(--void)),
        linear-gradient(135deg, var(--cyan), var(--magenta), var(--gold), var(--cyan));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 100% 100%, 300% 300%;
    animation: holoShimmer 6s ease infinite;
    opacity: 0.5;
}

.card-title {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.card-value {
    font-family: 'Space Mono', monospace;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.card-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    max-width: 500px;
    text-align: center;
    color: var(--stardust);
    position: relative;
    z-index: 2;
}

/* ============================================
   ORACLE OUTPUT (FOOTER)
   ============================================ */
#oracle-output {
    background: linear-gradient(180deg, var(--void) 0%, var(--nebula) 50%, var(--cosmic) 100%);
}

.oracle-reading {
    text-align: center;
    position: relative;
    z-index: 5;
}

.reading-prefix {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--stardust);
    margin-bottom: 16px;
    display: block;
}

.reading-value {
    font-family: 'Space Mono', monospace;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--cyan), var(--magenta), var(--gold));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holoShimmer 8s ease infinite;
    margin-bottom: 20px;
}

.reading-declaration {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.08em;
    color: var(--spirit);
    opacity: 0;
    filter: blur(4px);
    transition: opacity 2s ease, filter 2s ease;
    max-width: 600px;
    margin: 0 auto;
}

.reading-declaration.clear {
    opacity: 1;
    filter: blur(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    html {
        scroll-snap-type: none;
    }
    .snap-section {
        min-height: 100vh;
        height: auto;
    }
    .prob-card {
        padding: 24px;
    }
}
