/* =====================================================================
   ANIMAI — Tarocchi Gratis — pagina "Oracolo".
   Additivo su tarocchi-gratis.css. L'hero è un'immagine (mani + cerchio)
   con l'OCCHIO sovrapposto e animato, agganciato al centro del cerchio.
   Lo stepper è sovrapposto nella fascia bassa (sui polsi).
   Tutto scoped a .tg-wrap--oracolo / .tg-or-*.
   ===================================================================== */

.tg-wrap--oracolo {
    --or-violet: #a06bff;
    --or-violet-2: #6d3fd0;
    --or-gold: #E8B75A;
    --or-cream: #f4e9c8;
    --or-serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
    --or-sc: "Cormorant SC", "Cormorant", Georgia, serif;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}
.tg-wrap--oracolo > .tg-breadcrumb { display: none; }

/* L'hero ha il suo cielo (sfondo1). Spegni il cielo + le stelle di base di
   .tg-wrap (pseudo larghi 100vw) che altrimenti spuntano dietro e attorno
   all'immagine. Solo l'hero, non l'editoriale (.tg-doc ha gli pseudo già a
   content:none). Padding a 0 cosi' l'immagine sta a filo. */
.tg-wrap--oracolo:not(.tg-doc) { padding: 0; }
.tg-wrap--oracolo:not(.tg-doc)::before,
.tg-wrap--oracolo:not(.tg-doc)::after { content: none; background: none; }

/* ---- ART: sfondo (mani + cerchio) + occhio agganciato ---- */
.tg-or-art { position: relative; width: 100vw; margin-left: calc(50% - 50vw); }
.tg-or-scene { position: relative; width: 100%; }
.tg-or-bg { display: block; width: 100%; height: auto; }
.tg-or-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 52%, rgba(8,5,20,.5) 86%, rgba(8,5,20,.85) 100%);
}

/* occhio: posizione approvata (top 36% / larghezza 13% del cerchio) */
.tg-or-eye {
    position: absolute;
    top: 36%;
    left: 50%;
    width: 13%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.tg-or-eye::before {
    content: "";
    position: absolute;
    inset: -70% -35%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(160,107,255,.42), transparent 70%);
    animation: tg-or-aura 4.4s ease-in-out infinite;
}
.tg-or-eye img {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: center;
    filter: drop-shadow(0 0 12px rgba(160,107,255,.85));
    animation: tg-or-wake 1.1s ease .3s both, tg-or-blink 5.6s ease-in-out 1.6s infinite;
}
@keyframes tg-or-wake { 0% { transform: scaleY(.05); } 100% { transform: scaleY(1); } }
@keyframes tg-or-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.07); } 98% { transform: scaleY(1); } }
@keyframes tg-or-aura { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.14); } }

/* ---- stepper + no-JS: sovrapposti nella fascia bassa ---- */
.tg-or-art > .tg-app,
.tg-or-art > .tg-nojs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 13%;
    z-index: 3;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Responso: il messaggio puo' essere lungo. Ancoralo in ALTO (sotto il menu) e
   fallo crescere verso il basso, cosi' l'inizio non viene mai tagliato.
   :has() -> vale solo per lo step del responso, non per nome/domanda/carte. */
.tg-or-art > .tg-app:has(.tg-or-responso) {
    top: 8%;
    bottom: auto;
}
/* quando il JS nasconde il fallback (o l'app è ancora vuota) [hidden] deve vincere sul display:flex qui sopra */
.tg-or-art > .tg-app[hidden],
.tg-or-art > .tg-nojs[hidden] { display: none; }
.tg-or-step { width: 100%; display: flex; flex-direction: column; align-items: center; }

.tg-or-h1, .tg-or-title {
    font-family: var(--or-sc);
    font-weight: 700;
    color: #efe6ff;
    letter-spacing: .02em;
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    margin: 0;
    text-shadow: 0 0 24px rgba(160,107,255,.6), 0 2px 12px rgba(0,0,0,.9);
}
.tg-or-tag {
    font-family: var(--or-serif);
    font-style: italic;
    color: #e2d4ff;
    font-size: clamp(1.05rem, 2.3vw, 1.5rem);
    margin: .25rem 0 0;
    text-shadow: 0 2px 12px rgba(0,0,0,.95);
}
.tg-or-prompt {
    font-family: var(--or-serif);
    font-style: italic;
    color: #ecdfff;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    margin: 1rem 0 .7rem;
    text-shadow: 0 2px 10px rgba(0,0,0,.95);
}

/* campo (nome / domanda) con cornice a vetro */
.tg-or-field {
    position: relative;
    width: min(520px, 100%);
    margin-left: auto;
    margin-right: auto;
    border-radius: 999px;
    background: rgba(20,10,40,.72);
    border: 1px solid rgba(160,107,255,.45);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}
.tg-or-field--area { border-radius: 20px; }
.tg-or-field input,
.tg-or-field textarea {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: #f3ecff;
    font: 500 1.1rem/1.4 var(--or-serif);
    text-align: center;
    padding: 1rem 1.3rem;
}
.tg-or-field textarea { resize: vertical; min-height: 78px; font-size: 1.02rem; }
.tg-or-field input::placeholder,
.tg-or-field textarea::placeholder { color: #a99cc9; }

.tg-or-domanda .tg-suggerite {
    display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
    max-width: 620px; margin: 0 auto .9rem;
}
.tg-or-domanda .tg-suggerite button {
    white-space: normal; background: rgba(18,10,38,.6);
    border: 1px solid rgba(160,107,255,.34); border-radius: 999px;
    color: #e7dcff; font: 600 .88rem/1 var(--sans, inherit);
    padding: .6rem 1rem; min-height: 40px; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.tg-or-domanda .tg-suggerite button:hover { border-color: rgba(200,167,255,.85); background: rgba(40,20,80,.7); }
.tg-or-domanda .tg-counter { color: #b9a9e0; margin: .3rem 0 0; }

/* CTA viola luminoso */
.tg-btn.tg-cta-oracolo {
    margin-top: 1.1rem;
    background: linear-gradient(100deg, var(--or-violet-2), var(--or-violet));
    color: #fff; border: 0; position: relative;
    min-height: 54px; padding: 0 2.2rem; border-radius: 999px;
    font-family: var(--or-serif); font-size: 1.12rem; letter-spacing: .02em;
}
.tg-btn.tg-cta-oracolo::before {
    content: ""; position: absolute; inset: -3px; border-radius: 999px; z-index: -1;
    background: linear-gradient(100deg, var(--or-violet), var(--or-gold));
    filter: blur(10px); opacity: .55; animation: tg-or-aura 2.8s ease-in-out infinite;
}
.tg-btn.tg-cta-oracolo:disabled { opacity: .5; }

/* ---- primitive riusate dallo stepper ---- */
/* ventaglio (si pesca 1) */
.tg-siono-fan {
    position: relative; display: flex; justify-content: center; align-items: flex-start;
    flex-wrap: nowrap; gap: 0; margin: .4rem auto 0; width: 100%;
    height: clamp(120px, 20vw, 190px); overflow: visible;
}
.tg-siono-fan__card {
    --w: clamp(56px, 12vw, 104px); width: var(--w); aspect-ratio: 2/3;
    margin: 0 calc(var(--w) * -0.2); padding: 0; border: 0; background: none; cursor: pointer;
    border-radius: 12px; transform-origin: bottom center;
    transition: transform .2s ease, filter .2s ease;
    filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); min-height: 44px;
}
.tg-siono-fan__card img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 12px; }
.tg-siono-fan__card:nth-child(1) { transform: rotate(-21deg) translateY(26px); z-index: 1; }
.tg-siono-fan__card:nth-child(2) { transform: rotate(-14deg) translateY(12px); z-index: 2; }
.tg-siono-fan__card:nth-child(3) { transform: rotate(-7deg)  translateY(3px);  z-index: 3; }
.tg-siono-fan__card:nth-child(4) { transform: rotate(0deg)   translateY(-2px); z-index: 4; }
.tg-siono-fan__card:nth-child(5) { transform: rotate(7deg)   translateY(3px);  z-index: 3; }
.tg-siono-fan__card:nth-child(6) { transform: rotate(14deg)  translateY(12px); z-index: 2; }
.tg-siono-fan__card:nth-child(7) { transform: rotate(21deg)  translateY(26px); z-index: 1; }
.tg-siono-fan__card:hover, .tg-siono-fan__card:focus-visible {
    transform: translateY(-18px) scale(1.06); filter: drop-shadow(0 16px 26px rgba(160,107,255,.5)); outline: none; z-index: 9;
}
.tg-siono-fan__card.is-chosen { transform: translateY(-24px) scale(1.08); outline: 2px solid var(--or-violet); z-index: 9; }

/* carta singola centrata */
.tg-cards--one { display: flex; justify-content: center; margin-top: .6rem; }
.tg-cards--one .tg-card { width: clamp(140px, 32vw, 190px); }

/* attesa + puntini */
.tg-or-responso .tg-waiting { padding: 1rem 0; }
.tg-or-responso .tg-waiting p,
.tg-waiting__msg {
    font-family: var(--or-serif); font-style: italic; color: #e2d4ff;
    font-size: clamp(1.15rem, 3vw, 1.7rem); text-shadow: 0 2px 14px rgba(0,0,0,.8); margin: 0;
}
.tg-dots span { opacity: .18; animation: tg-or-dot 1.4s infinite; }
.tg-dots span:nth-child(2) { animation-delay: .22s; }
.tg-dots span:nth-child(3) { animation-delay: .44s; }
@keyframes tg-or-dot { 0%, 80%, 100% { opacity: .18; } 40% { opacity: 1; } }

/* pannello messaggio (leggibile) */
.tg-or-messaggio {
    max-width: 620px; margin: 1rem auto 0; text-align: left;
    background: rgba(10,7,26,.82); border: 1px solid rgba(160,107,255,.3);
    border-radius: 18px; padding: clamp(1.1rem,3vw,1.6rem); box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.tg-or-messaggio p { color: #ece7f5; font-size: 1.04rem; line-height: 1.76; margin: 0; }
.tg-or-messaggio p + p { margin-top: 1rem; }
.tg-or-esito-card { margin-bottom: .2rem; }

/* footer del responso: i bottoni "ghost" (Copia, Condividi) sul cielo si
   vedevano poco -> riempimento viola scuro + bordo netto, testo chiaro. */
.tg-or-responso .tg-btn--ghost {
    background: rgba(30, 16, 58, .92);
    border: 1px solid rgba(160, 107, 255, .85);
    color: #f1e9ff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.tg-or-responso .tg-btn--ghost:hover,
.tg-or-responso .tg-btn--ghost:focus-visible {
    background: rgba(58, 32, 104, .96);
    border-color: #c8a7ff;
    color: #ffffff;
}

/* responso: carta a fianco (sinistra), messaggio a destra; su mobile impilati.
   Il footer (permalink/azioni) va a capo a tutta larghezza. */
.tg-or-responso #tg-esito {
    display: grid;
    grid-template-columns: 1fr auto 1fr;   /* carta | messaggio (centrato) | equilibrio */
    align-items: start;
    justify-items: center;
    gap: clamp(1rem, 3vw, 2rem);
    width: 100%;
}
.tg-or-responso .tg-or-esito-card { grid-column: 1; justify-self: end; align-self: start; margin: 0; }
.tg-or-responso .tg-or-esito-card .tg-card { width: clamp(150px, 16vw, 200px); }
.tg-or-responso #tg-esito .tg-or-messaggio { grid-column: 2; width: min(520px, 92vw); max-width: 520px; margin-top: 0; }
.tg-or-responso #tg-esito #tg-or-footer { grid-column: 1 / -1; width: 100%; }
/* Finestra stretta / tablet / cell: il responso NON è più sovrapposto. L'hero
   resta un banner e la lettura scorre SOTTO in colonna (carta sopra, testo
   sotto), così restringendo la pagina il testo non finisce mai sull'editoriale.
   :has() → vale solo per lo step del responso, non per nome/domanda/carte. */
@media (max-width: 1300px) {
    .tg-or-art > .tg-app:has(.tg-or-responso) {
        position: static;
        top: auto;
        bottom: auto;
        padding: 1.5rem 1rem 2.5rem;
    }
    .tg-or-responso #tg-esito {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 640px;
        margin: 0 auto;
    }
    .tg-or-responso .tg-or-esito-card { grid-column: auto; justify-self: center; margin: 0 0 1rem; }
    .tg-or-responso .tg-or-esito-card .tg-card { width: clamp(150px, 34vw, 200px); }
    .tg-or-responso #tg-esito .tg-or-messaggio { grid-column: auto; width: 100%; max-width: 100%; }
    .tg-or-responso #tg-esito #tg-or-footer { grid-column: auto; }
}

/* ---- editoriale (colonna singola, scoped a --oracolo) ---- */
.tg-wrap--oracolo.tg-doc { max-width: 1100px; padding-left: clamp(1.25rem,3vw,2rem); padding-right: clamp(1.25rem,3vw,2rem); margin: 0 auto; }
.tg-wrap--oracolo .tg-intro__head,
.tg-wrap--oracolo .tg-intro__cols,
.tg-wrap--oracolo .tg-faq__inner {
    max-width: min(620px, 100%); margin-left: auto; margin-right: auto;
}
.tg-wrap--oracolo .tg-intro__cols { grid-template-columns: minmax(0,1fr); }

/* ---- desktop: hero un filo più contenuto in altezza ---- */
/* niente cap: l'hero è a tutta larghezza (vedi .tg-or-art sopra) */

/* ---- mobile: l'immagine resta leggibile, occhio invariato (agganciato) ---- */
@media (max-width: 700px) {
    /* l'immagine su cell è bassa: niente overlay, hero come banner e
       contenuto in colonna sotto. L'occhio resta agganciato (vive in .tg-or-scene). */
    .tg-or-art > .tg-app, .tg-or-art > .tg-nojs {
        position: static;
        padding: 1.4rem 1rem 2.2rem;
    }
    .tg-or-h1, .tg-or-title { font-size: clamp(1.8rem, 8vw, 2.6rem); }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .tg-or-eye img, .tg-or-eye::before, .tg-btn.tg-cta-oracolo::before,
    .tg-dots span, .tg-siono-fan__card { animation: none; transition: none; }
    .tg-dots span { opacity: 1; }
}
