/* Explain: Styles for the Ancestor Oracle card deck, spread, and text contrast. */
/* Oráculo de los Ancestros — mazo de cartas y tirada de tres cartas */
.ancestro-deck {
    position: relative;
    margin-top: 3.5rem;
}

.ancestro-stage {
    position: relative;
    margin: 0 auto;
    max-width: 23rem;
    aspect-ratio: 3 / 4;
    perspective: 1800px;
}

.ancestro-stack {
    position: absolute;
    inset: 0;
    transition: opacity 320ms ease, transform 320ms ease;
}

.ancestro-stack.is-hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.ancestro-back {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(88, 129, 87, 0.34);
    border-radius: 1.6rem;
    background:
        radial-gradient(circle at 50% 22%, rgba(217, 165, 160, 0.28), transparent 62%),
        linear-gradient(165deg, var(--oracle-gold-soft), var(--oracle-gold));
    box-shadow: var(--shadow-soft);
}

.ancestro-back:nth-child(1) { transform: translate(-0.5rem, 0.35rem) rotate(-3deg); }
.ancestro-back:nth-child(2) { transform: translate(0.5rem, 0.18rem) rotate(2.5deg); }
.ancestro-back:nth-child(3) { transform: translate(0, 0) rotate(0deg); }

.ancestro-back-frame {
    position: absolute;
    inset: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 1.1rem;
    pointer-events: none;
}

.ancestro-back-logo {
    width: 7.5rem;
    height: 7.5rem;
    object-fit: contain;
}

.ancestro-back-brand {
    margin-top: 0.6rem;
    font-size: 2.3rem;
    line-height: 1;
    color: var(--accent-color);
}

.ancestro-back-hint {
    margin-top: 1rem;
    padding: 0 1.2rem;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ancestro-card {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 320ms ease;
    opacity: 0;
    pointer-events: none;
}

.ancestro-card.is-visible { opacity: 1; pointer-events: auto; }
.ancestro-card.is-flipped { transform: rotateY(180deg); }

.ancestro-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    box-shadow: var(--shadow-soft);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ancestro-face-front {
    background:
        radial-gradient(circle at 50% 22%, rgba(217, 165, 160, 0.28), transparent 62%),
        linear-gradient(165deg, var(--oracle-gold-soft), var(--oracle-gold));
}

.ancestro-face-back {
    justify-content: flex-start;
    transform: rotateY(180deg);
    overflow: hidden;
    padding: 1.8rem 1.4rem 0.9rem;
    text-align: center;
    background:
        radial-gradient(circle at 50% 14%, rgba(88, 129, 87, 0.12), transparent 64%),
        linear-gradient(165deg, rgba(250, 249, 246, 0.99), rgba(244, 246, 238, 0.96));
}

.ancestro-body {
    width: 100%;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 0.4rem;
}

.ancestro-ornament {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 4rem;
    margin-bottom: 0.6rem;
    color: var(--oracle-gold);
}

.ancestro-lotus {
    width: 6.5rem;
    height: auto;
    color: var(--oracle-gold);
}

.ancestro-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.6rem;
    height: 4.6rem;
    margin-bottom: 0.35rem;
    overflow: hidden;
    border: 1px solid var(--rune-line-soft);
    border-radius: 999px;
    background: rgba(250, 249, 246, 0.72);
}

.ancestro-symbol-img {
    width: 58%;
    height: 58%;
    object-fit: contain;
}

.ancestro-card-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.ancestro-titulo {
    margin-top: 0.7rem;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.ancestro-mensaje {
    margin-top: 0.9rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--text-color);
}

.ancestro-divider {
    display: block;
    width: 3.6rem;
    height: 1px;
    margin: 1.1rem auto;
    background: var(--oracle-gold);
    opacity: 1;
}

.ancestro-block + .ancestro-block { margin-top: 0.95rem; }

.ancestro-block-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.ancestro-block-text {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-color);
}

.ancestro-card-footer {
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding-top: 0.9rem;
    font-family: var(--font-logo);
    font-size: 1.7rem;
    line-height: 1;
    text-transform: none;
    color: var(--oracle-gold);
}

.ancestro-slot {
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    background: rgba(250, 249, 246, 0.72);
    padding: 1.5rem 1.3rem;
    text-align: center;
}

.ancestro-slot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.4rem 1rem;
    color: var(--sage-dark);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ancestro-slot-question {
    margin-top: 0.9rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.ancestro-slot-result {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.ancestro-slot-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--text-color);
}

.ancestro-slot-text {
    margin-top: 0.5rem;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .ancestro-stage { max-width: 100%; }
    .ancestro-titulo { font-size: 1.3rem; }
    .ancestro-back-brand { font-size: 2rem; }
}