/* ============================================================
   ORÁCULO BELLINE v1 — Styles
   Aesthetic: Dark mystical · Gold accents · Elegant serif
   ============================================================ */

/* ── Reset & Variables ───────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette */
    --bg-deep:         #0a0a12;
    --bg-card:         #111120;
    --bg-surface:      #16162a;
    --bg-glass:        rgba(22, 22, 42, 0.65);

    --gold-100:        #f5e6b8;
    --gold-200:        #e8d08e;
    --gold-300:        #d4a853;
    --gold-400:        #c49b3a;
    --gold-500:        #a07d2a;
    --gold-600:        #8b6914;

    --text-primary:    #e8e0d0;
    --text-secondary:  #a8a090;
    --text-muted:      #706858;

    /* Typography */
    --ff-display:      'Cinzel Decorative', serif;
    --ff-body:         'Cormorant Garamond', serif;

    /* Spacing */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2.5rem;
    --space-2xl: 4rem;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-gold: 0 0 20px rgba(212, 168, 83, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ─────────────────────────────────────────────────── */
.belline-container {
    font-family: var(--ff-body);
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-deep);
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Subtle background texture */
.belline-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(212, 168, 83, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(100, 80, 40, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Screen System ────────────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: var(--space-xl) var(--space-md);
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    animation: screenFadeIn 0.6s var(--ease-out-expo) both;
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Ornaments ────────────────────────────────────────────── */
.ornament {
    width: min(240px, 60vw);
    color: var(--gold-300);
    flex-shrink: 0;
}

.ornament--top  { margin-bottom: var(--space-lg); }
.ornament--bottom { margin-top: var(--space-lg); }

/* ── SCREEN 1: Intro ──────────────────────────────────────── */
.intro__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
    max-width: 480px;
}

/* Eye icon */
.intro__eye {
    width: 80px;
    color: var(--gold-300);
    animation: eyePulse 3s ease-in-out infinite;
}

.eye-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.3));
}

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

/* Title */
.intro__title {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    line-height: 1.1;
}

.intro__title-pre {
    font-family: var(--ff-body);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--gold-200);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.intro__title-main {
    font-family: var(--ff-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 8vw, 3.8rem);
    color: var(--gold-100);
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(212, 168, 83, 0.25);
}

/* Description */
.intro__description {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.7;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    cursor: pointer;
    font-family: var(--ff-body);
    transition: all 0.35s var(--ease-out-expo);
    -webkit-tap-highlight-color: transparent;
}

/* Primary button */
.btn--reveal {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: var(--bg-deep);
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.9em 2em;
    border-radius: 60px;
    box-shadow:
        0 4px 24px rgba(212, 168, 83, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-top: var(--space-md);
}

.btn--reveal:hover {
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(212, 168, 83, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--reveal:active {
    transform: translateY(0);
}

.btn--reveal .btn__icon {
    width: 18px;
    height: 18px;
    display: flex;
    transition: transform 0.3s var(--ease-out-expo);
}

.btn--reveal:hover .btn__icon {
    transform: translateX(3px);
}

.btn--reveal .btn__icon svg {
    width: 100%;
    height: 100%;
}

/* New reading button */
.btn--new-reading {
    background: transparent;
    color: var(--gold-300);
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.8em 1.8em;
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 60px;
    margin-top: var(--space-xl);
}

.btn--new-reading:hover {
    background: rgba(212, 168, 83, 0.08);
    border-color: rgba(212, 168, 83, 0.5);
    transform: translateY(-2px);
}

.btn__icon-left,
.btn__icon-right {
    font-size: 0.75em;
    opacity: 0.6;
}

/* ── SCREEN 2: Shuffle ────────────────────────────────────── */
.shuffle__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.shuffle__cards {
    position: relative;
    width: 140px;
    height: 200px;
}

.shuffle__card {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    background:
        linear-gradient(145deg, #1e1e3a, #141428);
    border: 1px solid rgba(212, 168, 83, 0.25);
    box-shadow: var(--shadow-card);
    transform-origin: center bottom;
    animation: shuffleFan 2.8s var(--ease-out-expo) both;
    animation-delay: calc(var(--i) * 0.07s);
}

/* Card back pattern */
.shuffle__card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: calc(var(--radius-md) - 3px);
}

.shuffle__card::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    color: var(--gold-300);
    opacity: 0.5;
}

@keyframes shuffleFan {
    0% {
        transform: rotate(0deg) translateY(0);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    30% {
        transform:
            rotate(calc((var(--i) - var(--total) / 2) * 8deg))
            translateY(calc(var(--i) * -3px));
    }
    60% {
        transform:
            rotate(calc((var(--i) - var(--total) / 2) * -6deg))
            translateY(calc(var(--i) * -2px));
    }
    80% {
        transform: rotate(0deg) translateY(0);
        opacity: 1;
    }
    100% {
        transform: rotate(0deg) translateY(-30px);
        opacity: 0;
    }
}

.shuffle__text {
    font-family: var(--ff-body);
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    animation: textPulse 1.4s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* ── SCREEN 3: Result ─────────────────────────────────────── */
.screen--result {
    justify-content: flex-start;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
    gap: 0;
}

/* Card wrapper */
.result__card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s var(--ease-out-expo);
}

.screen--result.revealed .result__card-wrapper {
    opacity: 1;
    transform: translateY(0);
}

/* Card */
.result__card {
    width: min(220px, 55vw);
    aspect-ratio: 2 / 3;
    perspective: 800px;
}

.result__card-inner {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 168, 83, 0.2),
        var(--shadow-gold);
    animation: cardReveal 1s var(--ease-out-back) 0.2s both;
}

.screen--result:not(.revealed) .result__card-inner {
    animation: none;
    opacity: 0;
}

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

.result__card-front {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
}

.result__card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card title */
.result__card-title {
    font-family: var(--ff-display);
    font-weight: 700;
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    color: var(--gold-100);
    text-align: center;
    letter-spacing: 0.04em;
    text-shadow: 0 0 30px rgba(212, 168, 83, 0.2);
}

/* Reading text area */
.result__reading {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s var(--ease-out-expo) 0.35s;
}

.screen--result.revealed .result__reading {
    opacity: 1;
    transform: translateY(0);
}

.result__section {
    text-align: center;
}

.result__label {
    font-family: var(--ff-body);
    font-weight: 600;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: var(--gold-400);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-sm);
}

.result__text {
    font-size: clamp(1rem, 2.5vw, 1.12rem);
    line-height: 1.8;
    color: var(--text-secondary);
}

.result__text--simbolismo {
    font-style: italic;
    color: var(--gold-200);
    font-weight: 300;
}

.result__text--interpretacion {
    color: var(--text-primary);
}

/* Divider */
.result__divider {
    width: min(200px, 50vw);
    margin: 0 auto;
    color: var(--gold-300);
}

.result__divider svg {
    width: 100%;
    height: auto;
}

/* New reading button wrapper — opacity animated */
.btn--new-reading {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s var(--ease-out-expo) 0.6s,
                transform 0.6s var(--ease-out-expo) 0.6s,
                background 0.35s, border-color 0.35s;
}

.screen--result.revealed .btn--new-reading {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .screen {
        padding: var(--space-lg) var(--space-md);
    }

    .intro__eye {
        width: 64px;
    }

    .result__card {
        width: min(180px, 50vw);
    }

    .result__reading {
        padding: 0 var(--space-sm);
    }

    .shuffle__cards {
        width: 110px;
        height: 160px;
    }
}

@media (min-width: 768px) {
    .screen--result {
        padding-top: var(--space-2xl);
    }

    .result__card {
        width: 240px;
    }

    .result__reading {
        gap: var(--space-xl);
    }
}

@media (min-width: 1024px) {
    .screen--result {
        flex-direction: column;
        align-items: center;
    }
}

/* ── Accessibility ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
.btn:focus-visible {
    outline: 2px solid var(--gold-300);
    outline-offset: 3px;
}
