/* Tirage du tarot oui / non (tarot-fr.js) : éventail de 22 cartes, emplacements, retournement 3D. */

.tarot-stage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: clamp(24px, 4vw, 44px); }
.tarot-stage .hero-intro { max-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tarot-stage .hero-lead { margin: 0 auto; }
.tarot-stage .hero-intro { order: 0; gap: 10px; }
.tarot-stage .hero-title { font-size: clamp(46px, 6vw, 78px); }
.tarot-stage .hero-title span { display: inline; }
.tarot-ask .suggestions-wrapper { order: 0; }
.tarot-ask .suggestion-btn { min-height: 38px; font-size: 14px; }
.tarot-again { margin-bottom: 8px; }

.tarot-ask { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.tarot-ask .ask-field { display: flex; gap: 8px; }
.tarot-ask .kit-input { flex: 1; }
.tarot-ask .suggestions-wrapper { max-width: none; }
.tarot-message { min-height: 1.3em; margin: 0; color: #ff9b9b; font-size: 14px; }
.kit-input.shake { animation: tarotShake 0.45s ease; border-color: #ff9b9b; }
@keyframes tarotShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.tarot-modes { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line-gold-3); background: rgba(255, 255, 255, 0.02); }
.tarot-modes button {
    border: 0; background: transparent; color: var(--muted); font: 500 14px/1 var(--sans);
    padding: 10px 18px; border-radius: 999px; cursor: pointer; transition: background 0.2s, color 0.2s;
}
.tarot-modes button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.tarot-modes button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.tarot-hint { margin: 0; color: var(--gold-hi); font-family: var(--serif); font-size: 22px; min-height: 1.3em; }

/* Éventail : chaque carte tourne autour d'un point situé loin sous le jeu. */
.tarot-fan {
    --cw: 74px; --step: 5deg; --orig: 380%;
    position: relative; width: 100%; max-width: 980px;
    height: calc(var(--cw) * 1.78 + 70px);
    margin-top: 8px;
}
.fan-card {
    --a: calc((var(--i) - 10.5) * var(--step));
    position: absolute; left: calc(50% - var(--cw) / 2); top: 34px;
    width: var(--cw); aspect-ratio: 440 / 783; padding: 0; cursor: pointer;
    border-radius: 8px; border: 1px solid var(--line-gold-3);
    transform-origin: 50% var(--orig);
    transform: rotate(var(--a));
    background:
        radial-gradient(circle at 50% 50%, rgba(226, 199, 126, 0.7) 0 5%, transparent 6%),
        radial-gradient(circle at 50% 50%, transparent 0 15%, rgba(226, 199, 126, 0.45) 16% 17%, transparent 18%),
        radial-gradient(circle at 50% 50%, transparent 0 24%, rgba(226, 199, 126, 0.25) 25% 26%, transparent 27%),
        repeating-linear-gradient(45deg, rgba(226, 199, 126, 0.09) 0 2px, transparent 2px 8px),
        repeating-linear-gradient(-45deg, rgba(226, 199, 126, 0.06) 0 2px, transparent 2px 8px),
        linear-gradient(165deg, var(--violet) 0%, #3a1426 55%, #150a10 100%);
    box-shadow: -4px 6px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(14, 10, 12, 0.85), inset 0 0 0 4px rgba(226, 199, 126, 0.4);
    transition: transform 0.25s ease, opacity 0.35s ease, box-shadow 0.25s ease, filter 0.25s;
    animation: fanIn 0.7s cubic-bezier(.2,.8,.2,1) backwards;
    animation-delay: calc(var(--i) * 22ms);
}
.fan-card:hover, .fan-card:focus-visible {
    transform: rotate(var(--a)) translateY(-18px);
    box-shadow: 0 0 26px rgba(226, 199, 126, 0.45), inset 0 0 0 3px rgba(14, 10, 12, 0.85), inset 0 0 0 4px var(--gold);
    outline: none; z-index: 5;
}
.fan-card.taken { opacity: 0; transform: rotate(var(--a)) translateY(-60px) scale(0.9); pointer-events: none; }
.tarot-fan.done .fan-card { opacity: 0.28; filter: grayscale(0.4); pointer-events: none; }
.tarot-fan.done .fan-card.taken { opacity: 0; }
@keyframes fanIn { from { transform: rotate(0deg); opacity: 0; } 30% { opacity: 1; } }

/* Emplacements des cartes tirées */
.tarot-slots { display: flex; justify-content: center; gap: clamp(12px, 3vw, 28px); width: 100%; }
.slot { width: clamp(140px, 18vw, 190px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.slot-card { position: relative; width: 100%; aspect-ratio: 440 / 783; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(.3,.7,.3,1); perspective: 1000px; }
.slot .face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.slot .back { border: 1px dashed var(--line-gold-3); background: rgba(255, 255, 255, 0.015); transition: background 0.3s; }
.slot.filled .back {
    border: 1px solid var(--line-gold-3);
    background:
        radial-gradient(circle at 50% 50%, rgba(226, 199, 126, 0.7) 0 5%, transparent 6%),
        radial-gradient(circle at 50% 50%, transparent 0 15%, rgba(226, 199, 126, 0.45) 16% 17%, transparent 18%),
        repeating-linear-gradient(45deg, rgba(226, 199, 126, 0.09) 0 2px, transparent 2px 8px),
        linear-gradient(165deg, var(--violet) 0%, #3a1426 55%, #150a10 100%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 4px rgba(14, 10, 12, 0.85), inset 0 0 0 5px rgba(226, 199, 126, 0.4);
    animation: slotIn 0.45s ease;
}
.slot .front { transform: rotateY(180deg); overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(226, 199, 126, 0.35); }
.slot .front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slot.flipped .slot-card { transform: rotateY(180deg); }
.slot-label { margin: 0; min-height: 2.6em; font-size: 14px; color: var(--muted); line-height: 1.35; }
.slot-label strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--text); }
@keyframes slotIn { from { transform: translateY(-30px) scale(0.92); opacity: 0; } }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 11px/1.6 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: middle; }
.badge-o { background: rgba(155, 231, 176, 0.14); color: #9be7b0; }
.badge-n { background: rgba(255, 155, 155, 0.14); color: #ff9b9b; }
.badge-p { background: rgba(226, 199, 126, 0.14); color: var(--gold-hi); }

/* Verdict */
.tarot-verdict {
    width: 100%; max-width: 980px; padding: clamp(20px, 4vw, 36px); border-radius: 22px;
    border: 1px solid var(--line-gold-2); background: radial-gradient(ellipse at top, rgba(226, 199, 126, 0.07), transparent 60%), rgba(255, 255, 255, 0.02);
    animation: slotIn 0.5s ease; scroll-margin-top: 90px;
}
.verdict-kicker { margin: 0; color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; }
.verdict-word { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(64px, 12vw, 112px); line-height: 1; color: var(--gold-hi); }
.verdict-o .verdict-word { color: #9be7b0; text-shadow: 0 0 40px rgba(155, 231, 176, 0.35); }
.verdict-n .verdict-word { color: #ff9b9b; text-shadow: 0 0 40px rgba(255, 155, 155, 0.3); }
.verdict-p .verdict-word { text-shadow: 0 0 40px rgba(226, 199, 126, 0.3); }
.verdict-count { margin: 8px 0 0; color: var(--muted); }
.verdict-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; text-align: left; }
.verdict-card { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.18); }
.verdict-card h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 24px; color: var(--text); }
.verdict-card p { margin: 0 0 10px; color: var(--body); }
.verdict-card .verdict-mots { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.verdict-card a { color: var(--gold-hi); font-size: 14px; }
.tarot-again { margin-top: 4px; }
.tarot-verdict[hidden], .tarot-again[hidden] { display: none !important; }
.tarot-credit { color: var(--dim); font-size: 13px; }

/* Page signification des arcanes */
.arcanes-liste { display: grid; gap: 22px; margin: 18px 0 36px; }
.arcane { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: start; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); scroll-margin-top: 90px; }
.arcane img { width: 120px; height: auto; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.arcane h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 28px; }
.arcane h2 span { font-family: var(--sans); font-size: 13px; color: var(--dim); margin-right: 8px; }
.arcane p { margin: 0 0 8px; }
.arcane .mots { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.arcanes-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.arcanes-index a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-chip); font-size: 14px; color: var(--soft); text-decoration: none; }
.arcanes-index a:hover { border-color: var(--gold); color: var(--gold-hi); }

@media (max-width: 760px) {
    .tarot-fan { --cw: 42px; --step: 3.3deg; --orig: 370%; height: calc(var(--cw) * 1.78 + 50px); }
    .fan-card { top: 26px; border-radius: 5px; }
    .fan-card:hover { transform: rotate(var(--a)) translateY(-10px); }
    .slot { width: 30vw; max-width: 170px; }
    .tarot-slots[data-total="1"] .slot { width: 46vw; max-width: 200px; }
    .slot-label strong { font-size: 16px; }
    .tarot-ask .ask-field { flex-direction: column; }
    .arcane { grid-template-columns: 80px 1fr; gap: 14px; padding: 14px; }
    .arcane img { width: 80px; }
    .arcane h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .fan-card, .slot-card, .slot.filled .back, .tarot-verdict { animation: none !important; transition: none !important; }
}
