/* ============================================================
   TAROT PREGUNTA FIJA
   Estética: oscuro místico, dorado, cartas con flip 3D
   ============================================================ */

:root {
    --tp-bg:           #0a0a12;
    --tp-bg-alt:       #12121e;
    --tp-surface:      #181828;
    --tp-border:       #2a2a42;
    --tp-border-light: #3d3d5a;
    --tp-white:        #f0ece4;
    --tp-white-dim:    #a09888;
    --tp-gold:         #c8a84e;
    --tp-gold-light:   #dcc060;
    --tp-gold-glow:    rgba(200,168,78,0.25);
    --tp-card-back:    #1a1530;

    --font-display: 'Cinzel', serif;
    --font-body:    'Cormorant Garamond', serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

.tp-container {
    position: relative;
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
    font-family: var(--font-body);
    color: var(--tp-white);
    background: var(--tp-bg);
    min-height: 100vh;
    overflow: hidden;
}

/* ── Backgrounds ──────────────────────────────────────────── */
.tp-bg-grain {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}
.tp-bg-glow {
    position: fixed; top: -15%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 400px; pointer-events: none; z-index: 0;
    background: radial-gradient(ellipse at center, rgba(200,168,78,0.06) 0%, transparent 65%);
}

.tp-section { position: relative; z-index: 1; }
.hidden { display: none !important; }

/* ── Hero ──────────────────────────────────────────────────── */
.tp-hero {
    text-align: center;
    padding: 1.5rem 0 1rem;
    position: relative; z-index: 1;
}
.tp-hero__symbol {
    font-size: 2rem;
    color: var(--tp-gold);
    opacity: 0.7;
    margin-bottom: 0.3rem;
}
.tp-hero__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--tp-gold);
    letter-spacing: 0.04em;
    text-shadow: 0 2px 15px var(--tp-gold-glow);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}
.tp-hero__subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--tp-white-dim);
    font-style: italic;
}

/* ── Progress ──────────────────────────────────────────────── */
.tp-progress {
    text-align: center;
    margin-bottom: 1.2rem;
    position: relative; z-index: 1;
}
.tp-progress__text {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--tp-white-dim);
    letter-spacing: 0.04em;
}
.tp-progress__bar {
    width: 100%; max-width: 200px; height: 3px;
    background: var(--tp-border); border-radius: 2px;
    margin: 0.5rem auto 0; overflow: hidden;
}
.tp-progress__fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--tp-gold), var(--tp-gold-light));
    border-radius: 2px; transition: width 0.4s ease;
}

/* ── Deck grid ─────────────────────────────────────────────── */
.tp-deck__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 540px;
    margin: 0 auto;
}

.tp-card {
    width: calc((100% - 2.5rem) / 6);
    aspect-ratio: 2/3;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tp-card__back {
    width: 100%; height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #1e1840 0%, #2a2050 50%, #1a1535 100%);
    border: 1.5px solid var(--tp-border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.tp-card__pattern {
    text-align: center;
}
.tp-card__pattern span {
    font-size: 1rem;
    color: var(--tp-gold);
    opacity: 0.25;
}

.tp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.tp-card:hover .tp-card__back {
    border-color: var(--tp-border-light);
}

/* Selected — golden glow pulsante */
.tp-card.selected .tp-card__back {
    border-color: var(--tp-gold);
    box-shadow: 0 0 18px var(--tp-gold-glow);
    animation: gold-pulse 1.8s ease-in-out infinite;
}
.tp-card.selected .tp-card__pattern span {
    opacity: 0.8;
    color: var(--tp-gold-light);
}

@keyframes gold-pulse {
    0%, 100% { box-shadow: 0 0 12px var(--tp-gold-glow); }
    50%      { box-shadow: 0 0 28px rgba(200,168,78,0.45); }
}

.tp-card.disabled {
    opacity: 0.25;
    pointer-events: none;
    transform: scale(0.95);
}

/* ── Revealed cards (with flip) ────────────────────────────── */
.tp-reading__cards {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tp-revealed {
    text-align: center;
    width: 110px;
    perspective: 600px;
}

.tp-revealed__flipper {
    width: 110px;
    height: 165px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-revealed__flipper.flipped {
    transform: rotateY(180deg);
}

.tp-revealed__back,
.tp-revealed__front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tp-revealed__back {
    background: linear-gradient(145deg, #1e1840 0%, #2a2050 50%, #1a1535 100%);
    border: 1.5px solid var(--tp-gold);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px var(--tp-gold-glow);
}

.tp-revealed__front {
    transform: rotateY(180deg);
    border: 1.5px solid var(--tp-border-light);
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.tp-revealed__front img {
    width: 100%; height: 100%; object-fit: cover;
}

.tp-revealed__name {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tp-gold);
    margin-top: 0.5rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: opacity 0.5s ease 0.8s;
}

.tp-revealed__flipper.flipped ~ .tp-revealed__name {
    opacity: 1;
}

/* ── Reading card ──────────────────────────────────────────── */
.tp-reading { padding: 1rem 0; }

.tp-reading__card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    max-width: 520px;
    margin: 0 auto 1.5rem;
    position: relative; overflow: hidden;
}
.tp-reading__card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--tp-gold), transparent);
    opacity: 0.4;
}

.tp-reading__loading { text-align: center; padding: 1rem 0; }

.tp-spinner {
    width: 38px; height: 38px; margin: 0 auto 1rem;
    border: 3px solid var(--tp-border);
    border-top-color: var(--tp-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tp-reading__loading p {
    font-style: italic; color: var(--tp-white-dim);
    animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.tp-reading__result { text-align: center; animation: fadeIn 0.7s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.tp-reading__ornament {
    color: var(--tp-gold); opacity: 0.35;
    font-size: 0.8rem; letter-spacing: 0.5em; margin: 0.4rem 0;
}
.tp-reading__text {
    font-family: var(--font-body);
    font-size: 1.1rem; font-weight: 400;
    line-height: 1.8; color: var(--tp-white);
    padding: 0.8rem 0; white-space: pre-wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */
.tp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.85rem 2rem; border: none; border-radius: var(--radius-md);
    font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
    letter-spacing: 0.04em; cursor: pointer; transition: all 0.3s;
    width: 100%; max-width: 280px;
}
.tp-reading .tp-btn { display: flex; margin: 0 auto; }

.tp-btn--primary {
    background: linear-gradient(135deg, var(--tp-gold) 0%, #a0802e 100%);
    color: var(--tp-bg); box-shadow: 0 4px 18px var(--tp-gold-glow);
}
.tp-btn--primary:hover { transform: translateY(-2px); filter: brightness(1.1); }

.tp-btn--secondary {
    background: transparent; color: var(--tp-gold);
    border: 1.5px solid var(--tp-border-light);
}
.tp-btn--secondary:hover { border-color: var(--tp-gold); background: rgba(200,168,78,0.06); }
.tp-btn--small { padding: 0.6rem 1.4rem; font-size: 0.85rem; width: auto; max-width: none; }
.tp-btn__icon { font-size: 1em; }

/* ── Modal ─────────────────────────────────────────────────── */
.tp-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.tp-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.tp-modal__content {
    position: relative; background: var(--tp-surface); border: 1px solid var(--tp-border);
    border-radius: var(--radius-lg); padding: 2rem 1.5rem; max-width: 400px; width: 100%;
    text-align: center; animation: modal-in 0.3s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: scale(1); } }
.tp-modal__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.tp-modal__title { font-family: var(--font-display); font-size: 1.2rem; color: var(--tp-gold); margin-bottom: 0.75rem; }
.tp-modal__message { font-size: 0.95rem; color: var(--tp-white-dim); line-height: 1.6; margin-bottom: 1.5rem; }
.tp-modal__buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
    .tp-container { padding: 1.5rem 1rem 2rem; }
    .tp-hero__title { font-size: 1.5rem; }
    .tp-deck__grid { max-width: 400px; }
    .tp-card { width: calc((100% - 1.2rem) / 4); }
    .tp-revealed { width: 90px; }
    .tp-revealed__flipper { width: 90px; height: 135px; }
    .tp-reading__card { padding: 1.5rem 1.1rem; }
    .tp-reading__text { font-size: 1rem; }
}

@media (max-width: 360px) {
    .tp-hero__title { font-size: 1.3rem; }
    .tp-deck__grid { max-width: 300px; }
    .tp-card { width: calc((100% - 0.8rem) / 3); }
    .tp-revealed { width: 80px; }
    .tp-revealed__flipper { width: 80px; height: 120px; }
    .tp-revealed__name { font-size: 0.6rem; }
}

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