/* ============================================================
   ORÁCULO DE LA SUERTE v1 — STYLES
   Tema: noche mística — violeta profundo + oro envejecido
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   VARIABLES
   ──────────────────────────────────────────────────────────── */
:root {
    --bg-deep:        #0E0B1E;
    --bg-surface:     #16122E;
    --bg-card:        #1D1840;
    --bg-glass:       rgba(29, 24, 64, 0.65);

    --gold:           #C9A84C;
    --gold-light:     #E8D48B;
    --gold-dim:       #8B7430;

    --violet:         #7B5EA7;
    --violet-glow:    #A78BFA;

    --text-primary:   #F0ECE2;
    --text-secondary: #9B95B0;
    --text-muted:     #6B6480;

    --border-subtle:  rgba(201, 168, 76, 0.15);
    --shadow-gold:    rgba(201, 168, 76, 0.20);
    --shadow-violet:  rgba(123, 94, 167, 0.25);

    --font-display:   'Cinzel Decorative', 'Cinzel', serif;
    --font-body:      'Crimson Pro', 'Georgia', serif;

    --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ────────────────────────────────────────────────────────────
   RESET / BASE
   ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.oraculo-container {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
    padding: 24px 16px 60px;
}

/* ────────────────────────────────────────────────────────────
   FONDO ESTRELLADO
   ──────────────────────────────────────────────────────────── */
.bg-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-stars::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(123, 94, 167, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, rgba(201, 168, 76, 0.06) 0%, transparent 55%);
}

.star {
    position: absolute;
    border-radius: 50%;
    background: var(--gold-light);
    opacity: 0;
    animation: twinkle ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%   { opacity: 0;   transform: scale(0.6); }
    100% { opacity: 0.8; transform: scale(1); }
}

/* Todo el contenido por encima del fondo */
.oraculo-container > *:not(.bg-stars) {
    position: relative;
    z-index: 1;
}

/* ────────────────────────────────────────────────────────────
   HERO
   ──────────────────────────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 32px 16px 16px;
    max-width: 720px;
    margin: 0 auto;
}

.hero-sigil {
    width: 110px;
    height: 110px;
    margin: 0 auto 24px;
    color: var(--gold);
    animation: sigil-float 7s var(--ease-out) infinite;
    filter: drop-shadow(0 0 18px var(--shadow-gold));
}

.hero-sigil svg {
    width: 100%;
    height: 100%;
}

@keyframes sigil-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-12px) rotate(4deg); }
}

.app-title {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 2px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 45%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-star {
    display: inline-block;
    font-size: 0.6em;
    animation: pulse-star 3s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes pulse-star {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

.app-subtitle {
    font-size: clamp(0.95rem, 2.4vw, 1.2rem);
    color: var(--text-secondary);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* ────────────────────────────────────────────────────────────
   PANTALLA INICIAL — TIRADA
   ──────────────────────────────────────────────────────────── */
.draw-section {
    max-width: 480px;
    margin: 48px auto 0;
    text-align: center;
}

.draw-card-wrapper {
    margin-bottom: 32px;
}

/* Carta (dorso) */
.draw-card {
    width: 190px;
    height: 285px;
    margin: 0 auto 20px;
    perspective: 900px;
    cursor: pointer;
}

.draw-card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.7s var(--ease-out);
    transform-style: preserve-3d;
}

.draw-card.flipping .draw-card-inner {
    transform: rotateY(180deg) scale(0.92);
}

.draw-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 14px;
}

.draw-card-back {
    background: linear-gradient(160deg, #1B1444 0%, #2A1F5E 50%, #1B1444 100%);
    border: 2px solid var(--gold-dim);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.50),
        0 0 40px var(--shadow-violet);
    transition: box-shadow 0.35s ease, transform 0.35s var(--ease-out);
}

.draw-card:hover .draw-card-back {
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.55),
        0 0 60px var(--shadow-violet),
        0 0 24px var(--shadow-gold);
    transform: translateY(-6px);
}

.card-back-pattern {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-border {
    position: absolute;
    inset: 10px;
    border: 1.5px solid var(--gold-dim);
    border-radius: 8px;
    opacity: 0.45;
}

.card-back-symbol {
    font-size: 3.5rem;
    color: var(--gold);
    opacity: 0.5;
    animation: symbol-breathe 4s ease-in-out infinite;
    text-shadow: 0 0 24px var(--shadow-gold);
}

@keyframes symbol-breathe {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50%      { opacity: 0.65; transform: scale(1.08); }
}

.draw-hint {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.3px;
}

/* Form & botón */
#oraculo-form {
    margin-top: 8px;
}

.draw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    color: var(--bg-deep);
    border: none;
    border-radius: 12px;
    padding: 17px 36px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.draw-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.draw-btn:hover::before {
    opacity: 1;
}

.draw-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px var(--shadow-gold);
}

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

.btn-text,
.btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon {
    font-size: 1.2em;
}

/* ────────────────────────────────────────────────────────────
   PANTALLA DE RESULTADO
   ──────────────────────────────────────────────────────────── */
.result-section {
    max-width: 640px;
    margin: 40px auto 0;
    text-align: center;
}

/* Carta revelada */
.revealed-card-wrapper {
    margin-bottom: 40px;
}

.revealed-card {
    display: inline-block;
    position: relative;
}

.revealed-card-img {
    width: 220px;
    max-width: 60vw;
    height: auto;
    border-radius: 14px;
    border: 2px solid var(--gold-dim);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.50),
        0 0 50px var(--shadow-violet),
        0 0 20px var(--shadow-gold);
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 4vw, 1.9rem);
    color: var(--gold-light);
    margin-top: 24px;
    letter-spacing: 1.5px;
}

.card-symbolism {
    font-size: 1.05rem;
    color: var(--violet-glow);
    font-style: italic;
    font-weight: 300;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

/* Interpretación */
.interpretation-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 36px 32px;
    margin: 0 auto 36px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(201, 168, 76, 0.08);
    text-align: left;
}

.interpretation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.interp-icon {
    font-size: 1.6rem;
}

.interp-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold);
    letter-spacing: 1px;
    font-weight: 400;
}

.interpretation-text {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text-primary);
}

/* Botón nueva tirada */
.new-draw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold-dim);
    border-radius: 12px;
    padding: 15px 36px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.new-draw-btn:hover {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    color: var(--bg-deep);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--shadow-gold);
}

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

/* ────────────────────────────────────────────────────────────
   UTILITY
   ──────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .oraculo-container {
        padding: 16px 12px 48px;
    }

    .hero-section {
        padding: 24px 12px 12px;
    }

    .hero-sigil {
        width: 80px;
        height: 80px;
        margin-bottom: 18px;
    }

    .draw-card {
        width: 160px;
        height: 240px;
    }

    .card-back-symbol {
        font-size: 2.8rem;
    }

    .draw-btn {
        font-size: 1.05rem;
        padding: 15px 28px;
    }

    .revealed-card-img {
        width: 180px;
    }

    .interpretation-box {
        padding: 28px 20px;
    }

    .interpretation-text {
        font-size: 1.02rem;
        line-height: 1.75;
    }

    .new-draw-btn {
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 380px) {
    .hero-sigil {
        width: 64px;
        height: 64px;
    }

    .draw-card {
        width: 140px;
        height: 210px;
    }

    .revealed-card-img {
        width: 155px;
    }
}
