/* ============================================================
   REAL TAROT - Estilos místicos
   Paleta: violeta profundo + dorado + estrellas
   ============================================================ */

:root {
    --bg-deep: #0a0518;
    --bg-mid: #1a0d2e;
    --bg-light: #2d1b4e;
    --gold: #d4af37;
    --gold-bright: #f0d062;
    --gold-soft: #c9a861;
    --purple: #6b4c9a;
    --purple-light: #9075c0;
    --text: #e8e0f3;
    --text-soft: #c9b6e4;
    --text-mute: #9080a8;
    --text-faint: #6a5a80;
    --shadow-gold: 0 0 30px rgba(212, 175, 55, 0.4);
    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   FONDO CÓSMICO ANIMADO
   ============================================================ */

.cosmos {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(107, 76, 154, 0.4), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(45, 27, 78, 0.6), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 13, 46, 0.8), transparent 70%),
        linear-gradient(180deg, #0a0518 0%, #1a0d2e 50%, #0a0518 100%);
    overflow: hidden;
}

.estrellas {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
}

.estrellas-1 {
    background-image:
        radial-gradient(1px 1px at 20px 30px, white, transparent),
        radial-gradient(1px 1px at 60px 80px, white, transparent),
        radial-gradient(1px 1px at 130px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 180px 100px, white, transparent),
        radial-gradient(2px 2px at 240px 40px, rgba(212,175,55,0.8), transparent),
        radial-gradient(1px 1px at 300px 90px, white, transparent);
    background-size: 350px 200px;
    animation: estrellas-drift 200s linear infinite;
    opacity: 0.7;
}

.estrellas-2 {
    background-image:
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 100px 20px, white, transparent),
        radial-gradient(1px 1px at 200px 120px, rgba(212,175,55,0.6), transparent),
        radial-gradient(1px 1px at 280px 60px, white, transparent);
    background-size: 400px 250px;
    animation: estrellas-drift 300s linear infinite reverse, parpadeo 4s ease-in-out infinite;
    opacity: 0.5;
}

.estrellas-3 {
    background-image:
        radial-gradient(2px 2px at 80px 100px, rgba(212,175,55,0.9), transparent),
        radial-gradient(1px 1px at 220px 30px, white, transparent),
        radial-gradient(1px 1px at 350px 150px, rgba(255,255,255,0.7), transparent);
    background-size: 500px 300px;
    animation: estrellas-drift 400s linear infinite, parpadeo 6s ease-in-out infinite alternate;
    opacity: 0.6;
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: nebula-drift 60s ease-in-out infinite;
}

.nebula-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.nebula-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -30s;
    opacity: 0.15;
}

@keyframes estrellas-drift {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

@keyframes parpadeo {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes nebula-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -30px) scale(1.1); }
}

/* ============================================================
   HEADER / LOGO
   ============================================================ */

.header {
    text-align: center;
    padding: 60px 0 30px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.logo-simbolo {
    font-size: 36px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    animation: brillo-suave 4s ease-in-out infinite;
}

.logo-texto {
    font-family: 'Cinzel', serif;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 600;
    letter-spacing: 8px;
    color: var(--gold);
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.5),
        0 0 40px rgba(212, 175, 55, 0.3);
    margin: 0;
}

.logo-sub {
    font-size: 16px;
    color: var(--text-soft);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    font-weight: 400;
}

@keyframes brillo-suave {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* ============================================================
   ORNAMENTOS Y TIPOGRAFÍA
   ============================================================ */

.ornamento {
    text-align: center;
    color: var(--gold-soft);
    font-size: 18px;
    letter-spacing: 4px;
    margin: 16px 0;
    opacity: 0.7;
}

.intro {
    text-align: center;
    padding: 30px 0 50px;
    max-width: 700px;
}

.intro-texto {
    font-size: 22px;
    line-height: 1.7;
    color: var(--text-soft);
    font-style: italic;
    font-weight: 400;
    margin: 16px 0;
}

/* ============================================================
   PASOS / SECCIONES
   ============================================================ */

.paso {
    display: none;
    padding: 40px 24px 60px;
    animation: aparecer 0.8s ease-out;
}

.paso-activo {
    display: block;
}

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

.paso-titulo {
    font-family: 'Cinzel', serif;
    font-size: clamp(24px, 4vw, 36px);
    color: var(--gold);
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-weight: 500;
}

.paso-titulo .numero {
    display: inline-block;
    color: var(--purple-light);
    font-size: 0.7em;
    margin-right: 12px;
    opacity: 0.8;
}

.subtitulo {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: var(--text);
    text-align: center;
    letter-spacing: 3px;
    margin: 30px 0 20px;
    font-weight: 400;
    text-transform: uppercase;
}

.instruccion {
    text-align: center;
    color: var(--text-soft);
    font-size: 18px;
    font-style: italic;
    margin-bottom: 30px;
}

/* ============================================================
   PASO 1: PREGUNTA
   ============================================================ */

.pregunta-wrapper {
    max-width: 700px;
    margin: 30px auto;
    position: relative;
}

#pregunta {
    width: 100%;
    min-height: 120px;
    padding: 20px 24px;
    background: rgba(45, 27, 78, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#pregunta:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    background: rgba(45, 27, 78, 0.7);
}

#pregunta::placeholder {
    color: var(--text-faint);
    font-style: italic;
}

.contador {
    text-align: right;
    color: var(--text-faint);
    font-size: 12px;
    font-family: 'Cinzel', serif;
    margin-top: 6px;
    letter-spacing: 1px;
}

/* ============================================================
   TIRADAS
   ============================================================ */

.tiradas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 30px auto;
}

.tirada-opcion {
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.6), rgba(26, 13, 46, 0.8));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tirada-opcion::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center top, rgba(212, 175, 55, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tirada-opcion:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(212, 175, 55, 0.1);
}

.tirada-opcion:hover::before {
    opacity: 1;
}

.tirada-opcion.seleccionada {
    border-color: var(--gold);
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.9), rgba(45, 27, 78, 0.6));
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
}

.tirada-opcion.seleccionada::before {
    opacity: 1;
}

.tirada-icono {
    font-size: 48px;
    color: var(--gold);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.tirada-opcion h4 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--text);
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 500;
}

.tirada-opcion p {
    color: var(--text-soft);
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.tirada-cartas {
    display: inline-block;
    color: var(--gold-soft);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    padding: 6px 14px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    text-transform: uppercase;
}

/* ============================================================
   BOTÓN MÍSTICO
   ============================================================ */

.btn-mistico {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 50%, var(--gold-soft) 100%);
    color: var(--bg-deep);
    border: none;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    margin: 30px auto;
    text-decoration: none;
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    width: fit-content;
}

.btn-mistico::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4), transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-mistico:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-mistico:hover::before {
    transform: translateX(100%);
}

.btn-mistico:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secundario {
    background: linear-gradient(135deg, rgba(107, 76, 154, 0.8), rgba(144, 117, 192, 0.8));
    color: var(--text);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-icono {
    font-size: 18px;
    line-height: 1;
}

/* ============================================================
   PASO 2: MEZCLA ANIMACIÓN
   ============================================================ */

.mezcla-anim {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 60px auto;
}

.carta-mezcla {
    position: absolute;
    width: 100px;
    height: 160px;
    background: linear-gradient(135deg, var(--bg-light), var(--bg-mid));
    border: 1px solid var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 36px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.carta-mezcla.c1 { animation: mezcla1 1.5s ease-in-out infinite; }
.carta-mezcla.c2 { animation: mezcla2 1.5s ease-in-out infinite 0.1s; }
.carta-mezcla.c3 { animation: mezcla3 1.5s ease-in-out infinite 0.2s; }
.carta-mezcla.c4 { animation: mezcla4 1.5s ease-in-out infinite 0.3s; }
.carta-mezcla.c5 { animation: mezcla5 1.5s ease-in-out infinite 0.4s; }

@keyframes mezcla1 {
    0%, 100% { transform: translate(-50%, -50%) rotate(-8deg) translateX(-40px); }
    50% { transform: translate(-50%, -50%) rotate(8deg) translateX(40px); }
}
@keyframes mezcla2 {
    0%, 100% { transform: translate(-50%, -50%) rotate(-4deg) translateX(-20px); }
    50% { transform: translate(-50%, -50%) rotate(4deg) translateX(20px); }
}
@keyframes mezcla3 {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes mezcla4 {
    0%, 100% { transform: translate(-50%, -50%) rotate(4deg) translateX(20px); }
    50% { transform: translate(-50%, -50%) rotate(-4deg) translateX(-20px); }
}
@keyframes mezcla5 {
    0%, 100% { transform: translate(-50%, -50%) rotate(8deg) translateX(40px); }
    50% { transform: translate(-50%, -50%) rotate(-8deg) translateX(-40px); }
}

.mezcla-estado {
    text-align: center;
    color: var(--gold-soft);
    font-style: italic;
    font-size: 18px;
    letter-spacing: 2px;
}

/* ============================================================
   PASO 3: MAZO PARA ELEGIR
   ============================================================ */

.mazo {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 1100px;
    margin: 30px auto;
    perspective: 1500px;
}

.carta-eleccion {
    width: 80px;
    height: 130px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: aparecer-carta 0.6s ease-out backwards;
}

@keyframes aparecer-carta {
    from { opacity: 0; transform: translateY(40px) rotateY(180deg); }
    to { opacity: 1; transform: translateY(0) rotateY(0); }
}

.carta-eleccion:hover {
    transform: translateY(-12px) rotateY(0deg) scale(1.05);
    z-index: 10;
}

.carta-eleccion.elegida {
    opacity: 0.2;
    pointer-events: none;
    transform: scale(0.85);
}

.carta-dorso {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #2d1b4e 0%, #1a0d2e 50%, #2d1b4e 100%);
    border: 2px solid var(--gold);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
    overflow: hidden;
}

.carta-dorso::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.carta-dorso::after {
    content: '𓂀';
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* ============================================================
   PASO 4: REVELACIÓN
   ============================================================ */

.cartas-reveladas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin: 40px 0;
    perspective: 1500px;
}

.carta-revelada {
    width: 200px;
    height: 320px;
    perspective: 1500px;
    position: relative;
}

.carta-flip {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.carta-flip.volteada {
    transform: rotateY(180deg);
}

.carta-cara, .carta-reverso {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.carta-reverso {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0d2e 50%, #2d1b4e 100%);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.carta-reverso::after {
    content: '𓂀';
    font-size: 56px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.carta-cara {
    transform: rotateY(180deg);
    background: linear-gradient(170deg, #2a1845 0%, #1f1238 50%, #2a1845 100%);
    border: 2px solid var(--gold);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(212, 175, 55, 0.3);
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.carta-numero {
    text-align: center;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 18px;
    letter-spacing: 3px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.carta-imagen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.15), transparent 70%);
    border-radius: 4px;
    position: relative;
}

.carta-simbolo {
    font-size: 88px;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.8);
    animation: simbolo-glow 3s ease-in-out infinite;
}

@keyframes simbolo-glow {
    0%, 100% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.6); }
    50% { text-shadow: 0 0 40px rgba(212, 175, 55, 1), 0 0 60px rgba(212, 175, 55, 0.5); }
}

.carta-nombre {
    text-align: center;
    color: var(--text);
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    margin-top: 8px;
    font-weight: 500;
}

.carta-posicion {
    position: absolute;
    bottom: -28px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--gold-soft);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ============================================================
   INTERPRETACIÓN
   ============================================================ */

.interpretacion {
    max-width: 800px;
    margin: 60px auto 30px;
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.7), rgba(26, 13, 46, 0.9));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 40px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-deep);
}

.interpretacion-bloque {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    animation: aparecer 0.8s ease-out backwards;
}

.interpretacion-bloque:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.interpretacion-titulo {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 22px;
    letter-spacing: 3px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.interpretacion-titulo .pos {
    color: var(--purple-light);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.interpretacion-keywords {
    color: var(--gold-soft);
    font-style: italic;
    font-size: 16px;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.interpretacion-texto {
    color: var(--text-soft);
    font-size: 18px;
    line-height: 1.8;
}

.interpretacion-final {
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.1), rgba(107, 76, 154, 0.1));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    padding: 24px;
    margin-top: 32px;
    text-align: center;
}

.interpretacion-final h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.interpretacion-final p {
    color: var(--text);
    font-size: 18px;
    font-style: italic;
    line-height: 1.7;
}

/* ============================================================
   ACCIONES FINALES
   ============================================================ */

.acciones-finales {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 40px 0;
}

.acciones-finales .btn-mistico {
    margin: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    text-align: center;
    padding: 60px 24px 40px;
    margin-top: 80px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.footer p {
    color: var(--text-mute);
    font-size: 14px;
    line-height: 1.6;
    max-width: 700px;
    margin: 12px auto;
}

.footer .copy {
    color: var(--text-faint);
    font-size: 12px;
    letter-spacing: 1px;
    margin-top: 24px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .header { padding: 40px 0 20px; }
    .logo { gap: 12px; }
    .logo-simbolo { font-size: 24px; }
    .logo-sub { font-size: 12px; letter-spacing: 2px; }
    .intro-texto { font-size: 18px; }
    .paso { padding: 20px 16px 40px; }

    .mazo { gap: 4px; }
    .carta-eleccion { width: 50px; height: 80px; }
    .carta-dorso::after { font-size: 18px; }

    .carta-revelada { width: 160px; height: 256px; }
    .carta-simbolo { font-size: 64px; }

    .interpretacion { padding: 24px 20px; }
    .interpretacion-titulo { font-size: 18px; }
    .interpretacion-texto { font-size: 16px; }
}

@media (max-width: 480px) {
    .carta-eleccion { width: 40px; height: 64px; }
    .carta-dorso::after { font-size: 14px; }
    .carta-revelada { width: 140px; height: 224px; }
    .carta-simbolo { font-size: 56px; }
    .btn-mistico { padding: 14px 24px; font-size: 14px; letter-spacing: 2px; }
}
