/* Accueil : simulateur de tirage, parcours en 3 étapes, FAQ. Couleurs via les jetons du thème. */
.hp-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hp-eyebrow span { color: var(--red); margin-right: 4px; }
.hp-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* Couleurs par rareté */
[data-tier="common"] { --tier: #8a939e; } [data-tier="uncommon"] { --tier: #3fbf7f; } [data-tier="rare"] { --tier: #4f8dff; }
[data-tier="epic"] { --tier: #a66bff; } [data-tier="legendary"] { --tier: #efb53c; } [data-tier="mythic"] { --tier: #e43d45; }
[data-tier="secret"] { --tier: #ff5fb4; } [data-tier="divine"] { --tier: #7fe3ff; } [data-tier="signature"] { --tier: #efc66b; }

/* ---------- Simulateur ---------- */
.hp-draw { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px 56px; align-items: center; }
.hp-draw-copy h2 { margin: 0 0 14px; }
.hp-draw-copy > p:not(.hp-eyebrow):not(.hp-note) { color: var(--muted); max-width: 52ch; }
.hp-draw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 22px 0 18px; }
.hp-draw-actions .v2-button[disabled] { opacity: .7; cursor: progress; }
.hp-draw-score { display: flex; gap: 12px; margin: 0; }
.hp-draw-score div { flex: 1; max-width: 200px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.hp-draw-score dt { font-size: 12px; color: var(--muted); }
.hp-draw-score dd { margin: 4px 0 0; font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.hp-draw-score dd[data-tier] { color: var(--tier); text-shadow: 0 0 18px color-mix(in srgb, var(--tier) 45%, transparent); }
.hp-note { margin: 12px 0 0; font-size: 12.5px; color: var(--faint); }

.hp-stage { position: relative; display: grid; justify-items: center; gap: 14px; perspective: 1100px; padding: 18px 0; isolation: isolate; }
.hp-stage::before { content: ""; position: absolute; z-index: -1; inset: 6% 14%; border-radius: 50%; filter: blur(46px); opacity: .55;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tier, var(--red)) 70%, transparent), transparent); transition: background .5s ease; }
.hp-card { --rx: 0deg; --ry: 0deg; position: relative; width: min(250px, 64vw); aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 14px; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .25s ease-out; }
.hp-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.hp-card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.75,.25,1); border-radius: inherit; }
.hp-card.is-flipped .hp-card-inner { transform: rotateY(180deg); }
.hp-card.is-shuffling .hp-card-inner { animation: hp-shuffle .38s ease-in-out; }
.hp-card-back, .hp-card-front { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.hp-card-back { display: grid; place-content: center; justify-items: center; gap: 8px; color: #fff4dc;
  background: radial-gradient(120% 80% at 50% 0%, rgba(239, 198, 107, .35), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #8f1d26, #3a0b10 70%);
  box-shadow: inset 0 0 0 2px rgba(239, 198, 107, .75), inset 0 0 0 7px #3a0b10, inset 0 0 0 8px rgba(239, 198, 107, .4), 0 24px 50px rgba(0, 0, 0, .35); }
.hp-card-back img { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(239, 198, 107, .8), 0 0 30px rgba(239, 198, 107, .45); }
.hp-card-back b { font-size: 20px; letter-spacing: .04em; }
.hp-card-back small { font-size: 12px; opacity: .8; letter-spacing: .08em; text-transform: uppercase; }
.hp-card-front { transform: rotateY(180deg); background: #111;
  box-shadow: 0 0 0 2px var(--tier, var(--gold)), 0 0 34px color-mix(in srgb, var(--tier, var(--gold)) 55%, transparent), 0 24px 50px rgba(0, 0, 0, .35); }
.hp-card-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-card-front::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, .45), transparent 45%); }
.hp-stage:hover .hp-card-front::after { opacity: .9; }
.hp-card[data-tier="divine"] .hp-card-front::before, .hp-card[data-tier="signature"] .hp-card-front::before, .hp-card[data-tier="secret"] .hp-card-front::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: color-dodge; opacity: .45;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .7) 45%, transparent 60%) 0 0 / 250% 100%; animation: hp-holo 2.6s linear infinite; }
.hp-card-label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 26px 14px 12px; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .82)); color: #fff; }
.hp-card-label b { font-size: 16px; }
.hp-card-label small { font-size: 12px; color: var(--tier, var(--gold)); font-weight: 700; }
.hp-result { min-height: 1.5em; margin: 0; text-align: center; font-weight: 700; color: var(--text); }
.hp-result b { color: var(--tier); filter: brightness(.92); }
.hp-burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
.hp-burst i { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 2px; background: var(--tier); box-shadow: 0 0 10px var(--tier); rotate: 45deg; }

.hp-ladder { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.hp-ladder:empty { display: none; }
.hp-ladder li { position: relative; display: grid; gap: 2px; padding: 10px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden;
  transition: border-color .3s, transform .3s, box-shadow .3s; }
.hp-ladder li::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--fill); background: var(--tier); opacity: .85; }
.hp-ladder b { font-size: 13px; color: var(--tier); filter: brightness(.9); }
.hp-ladder span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hp-ladder li.is-hit { border-color: var(--tier); transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--tier) 30%, transparent); }

/* ---------- Étapes ---------- */
.hp-step-list { counter-reset: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.hp-step-list li { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 22px 22px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  background: var(--public-card, var(--surface)); overflow: hidden; transition: border-color .3s, transform .3s, box-shadow .3s; }
.hp-step-list li::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; transform: scaleX(.18); transform-origin: left;
  background: linear-gradient(90deg, var(--red), var(--gold)); transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.hp-step-list li:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: var(--shadow); }
.hp-step-list li:hover::before { transform: scaleX(1); }
.hp-step-num { align-self: flex-start; font-size: 44px; line-height: 1; font-weight: 900; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--red), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-step-list h3 { margin: 0; font-size: 19px; }
.hp-step-list p { margin: 0; color: var(--muted); font-size: 14.5px; }
.hp-step-actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hp-copy { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--button-radius);
  background: var(--control-bg); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.hp-copy:hover { border-color: var(--gold); }
.hp-copy.is-copied { border-color: var(--green); color: var(--green); }

/* ---------- FAQ ---------- */
.hp-faq-list { display: grid; gap: 10px; max-width: 860px; }
.hp-faq-list details { border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); background: var(--public-card, var(--surface)); transition: border-color .25s, box-shadow .25s; }
.hp-faq-list details[open] { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
.hp-faq-list summary { position: relative; list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; font-weight: 750; font-size: 16px; color: var(--text); }
.hp-faq-list summary::-webkit-details-marker { display: none; }
.hp-faq-list summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: linear-gradient(var(--red), var(--red)) center / 10px 2px no-repeat, linear-gradient(var(--red), var(--red)) center / 2px 10px no-repeat;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: transform .3s ease, background-size .3s ease; }
.hp-faq-list details[open] summary::after { transform: rotate(180deg); background-size: 10px 2px, 2px 0; }
.hp-faq-list summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: inherit; }
.hp-faq-list summary + div { overflow: hidden; }
.hp-faq-list summary + div p { margin: 0; padding: 0 20px 18px; color: var(--muted); max-width: 70ch; }
.hp-faq-list a { color: var(--gold); }

@keyframes hp-shuffle { 0%, 100% { transform: translateY(0) rotateZ(0); } 30% { transform: translateY(-10px) rotateZ(-3deg); } 65% { transform: translateY(-4px) rotateZ(3deg); } }
@keyframes hp-holo { from { background-position: 150% 0; } to { background-position: -150% 0; } }

@media (max-width: 960px) {
  .hp-draw { grid-template-columns: 1fr; }
  .hp-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hp-step-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hp-ladder li { padding: 8px 8px 12px; }
  .hp-draw-score dd { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-card, .hp-card-inner, .hp-ladder li, .hp-step-list li, .hp-step-list li::before, .hp-faq-list summary::after { transition: none !important; }
  .hp-card.is-shuffling .hp-card-inner, .hp-card-front::before { animation: none !important; }
}
html[data-reduced-motion="true"] :is(.hp-card, .hp-card-inner, .hp-ladder li, .hp-step-list li, .hp-step-list li::before) { transition: none !important; }
html[data-reduced-motion="true"] :is(.hp-card.is-shuffling .hp-card-inner, .hp-card-front::before) { animation: none !important; }

/* Tirage réel (membre connecté) */
.hp-draw-live { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 0; padding: 10px 14px; max-width: 520px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.hp-draw-live[hidden] { display: none; }
.hp-draw-live label { display: flex; align-items: center; gap: 10px; flex: 1 1 230px; min-width: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.hp-draw-live select { flex: 1 1 150px; min-width: 0; max-width: 100%; padding: 7px 10px; font: 600 14px var(--sans, inherit); text-overflow: ellipsis; }
.hp-live-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); animation: hp-live 2s ease-out infinite; }
@keyframes hp-live { 70% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.hp-luck { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #1b1406; background: var(--gold, #efc66b); }
.hp-luck[hidden] { display: none; }
.hp-result-extra { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hp-draw-actions .v2-button[disabled] span { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .hp-live-dot { animation: none; } }
