/* =========================================================
   PAGE « LES QUALIFIÉS »
   Héros : grand mot en fond, vague de cartes au premier plan.
   Mur : grille de toutes les cartes, filtrable par jeu.
   S'appuie sur les tokens de styles.css.
   ========================================================= */

.qpage{ --q-ease-out:cubic-bezier(.2,.8,.2,1); --q-spring:cubic-bezier(.34,1.56,.64,1); }

/* ---------- Carte joueur (réutilisée dans le héros et le mur) ---------- */
.pcard, .pslot{
  position:relative; display:block; aspect-ratio:242/330;
  container-type:inline-size; color:#fff; text-decoration:none;
  --rx:0deg; --ry:0deg; --mx:50%; --my:40%;
  transform:perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition:transform var(--dur-3) var(--q-ease-out);
  -webkit-tap-highlight-color:transparent;
}
.pcard-frame, .pslot-frame{
  position:absolute; left:0; right:0; bottom:0; height:74.55%;
  border-radius:12px; overflow:hidden; z-index:1;
  border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(165deg, #2C0F8F 0%, #17004F 58%, #0B0026 100%);
  transition:border-color var(--dur-2) var(--ease), box-shadow var(--dur-3) var(--ease), transform var(--dur-3) var(--q-ease-out);
}
/* lumière qui suit le pointeur, derrière le joueur */
.pcard-sheen{
  position:absolute; inset:0; opacity:0;
  background:radial-gradient(circle at var(--mx) var(--my), rgba(142,107,255,.55), rgba(94,50,215,0) 62%);
  transition:opacity var(--dur-3) var(--ease);
}
.pcard-city{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--display-wide); font-style:italic; font-size:17cqw; letter-spacing:.01em;
  color:rgba(255,255,255,.07); text-transform:uppercase; white-space:nowrap;
  transition:transform 900ms var(--q-ease-out), color var(--dur-3) var(--ease);
}
.pcard-photo{
  position:absolute; left:50%; z-index:2; display:block; max-width:none; pointer-events:none; user-select:none;
  transform:translateX(-50%); transform-origin:50% 100%;
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.4));
  transition:transform 520ms var(--q-ease-out), filter var(--dur-3) var(--ease);
}
.pcard-logo{
  position:absolute; left:50%; top:52.73%; width:47.11%; height:auto; z-index:4; pointer-events:none;
  transform:translate(-50%,-50%); filter:drop-shadow(0 2px 8px rgba(0,0,0,.6));
  transition:transform var(--dur-3) var(--q-ease-out), opacity var(--dur-3) var(--ease), filter var(--dur-3) var(--ease);
}
/* fondu bas : garantit la lisibilité du nom par-dessus le portrait */
.pcard::after{
  content:""; position:absolute; left:1px; right:1px; bottom:1px; height:34%; z-index:3;
  border-radius:0 0 11px 11px; pointer-events:none;
  background:linear-gradient(to top, rgba(11,0,38,.95) 18%, rgba(11,0,38,0));
}
.pcard-info{
  position:absolute; left:0; right:0; bottom:0; z-index:5;
  padding:0 5cqw 5.5cqw; text-align:center; display:flex; flex-direction:column; align-items:center;
}
.pcard-pseudo, .pslot-label{
  font-family:var(--display); font-size:9.2cqw; line-height:1.05;
  letter-spacing:var(--tracking-blunt); text-transform:uppercase; white-space:nowrap;
}
.pcard-sub{
  margin-top:1.6cqw; font-family:var(--body); font-weight:700; font-size:4.4cqw;
  letter-spacing:.08em; text-transform:uppercase; color:var(--violet-200); white-space:nowrap;
}

/* survol / focus */
.pcard:is(:hover, :focus-visible) .pcard-frame{
  border-color:rgba(185,165,255,.38);
  box-shadow:0 18px 40px -24px rgba(94,50,215,.6), inset 0 0 0 1px rgba(185,165,255,.08);
}
.pcard:is(:hover, :focus-visible) .pcard-sheen{ opacity:.55; }
.pcard:is(:hover, :focus-visible) .pcard-city{ transform:translateX(-7%); color:rgba(255,255,255,.12); }
.pcard:is(:hover, :focus-visible) .pcard-photo{ transform:translateX(-50%) translateY(-2%) scale(1.025); filter:drop-shadow(0 14px 20px rgba(0,0,0,.45)); }
.pcard:is(:hover, :focus-visible) .pcard-logo{ transform:translate(-50%,-50%) scale(1.06); }
.pcard:focus-visible, .pslot:focus-visible{ outline:none; }
.pcard:focus-visible .pcard-frame, .pslot:focus-visible .pslot-frame{ outline:2px solid #fff; outline-offset:3px; }

/* ---------- Cases vides ---------- */
.pslot-frame{
  background:rgba(255,255,255,.025);
  border:1px dashed rgba(255,255,255,.22);
  display:flex; align-items:center; justify-content:center;
}
.pslot-star{
  position:relative; z-index:1; width:20cqw; height:20cqw; margin-top:-40%;
  background:rgba(255,255,255,.22);
  clip-path:polygon(100% 50%,61.5% 61.5%,50% 100%,38.4% 61.5%,0 50%,38.4% 38.5%,50% 0,61.5% 38.5%);
  transition:background var(--dur-3) var(--ease), transform 700ms var(--q-spring);
}
.pslot-q{
  position:relative; z-index:1; margin-top:-44%;
  font-family:var(--display-wide); font-size:26cqw; line-height:1; color:rgba(255,255,255,.14);
  transition:color var(--dur-3) var(--ease), transform 700ms var(--q-spring);
}
.pslot-logo{ opacity:.32; filter:grayscale(1) drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.pslot::after{ display:none; }
.pslot-label{ color:rgba(255,255,255,.62); font-size:8.4cqw; transition:color var(--dur-2) var(--ease); }
.pslot .pcard-sub{ color:rgba(255,255,255,.4); }

/* place à prendre sur une étape à venir : l'étoile respire */
.pslot.is-open .pslot-star{ background:rgba(255,72,72,.55); animation:qbreathe 2.8s ease-in-out infinite; }
.pslot.is-open .pslot-label{ color:var(--red); }
.pslot.is-future .pslot-frame{ border-color:rgba(255,255,255,.13); }
.pslot.is-future .pslot-star{ width:16cqw; height:16cqw; margin-top:-22%; background:rgba(255,255,255,.14); }
.pslot.is-future .pslot-label{ color:rgba(255,255,255,.4); }
.pslot.is-future .pcard-sub{ color:rgba(255,255,255,.26); }
@keyframes qbreathe{ 0%,100%{ transform:scale(1); opacity:.75; } 50%{ transform:scale(1.14); opacity:1; } }

a.pslot:is(:hover, :focus-visible) .pslot-frame{ border-color:rgba(185,165,255,.7); background:rgba(94,50,215,.12); }
a.pslot:is(:hover, :focus-visible) .pslot-logo{ opacity:.9; filter:none; transform:translate(-50%,-50%) scale(1.05); }
a.pslot:is(:hover, :focus-visible) .pslot-q{ color:rgba(185,165,255,.55); transform:rotate(-8deg) scale(1.08); }
a.pslot:is(:hover, :focus-visible) .pslot-label{ color:#fff; }
.pslot.is-open:is(:hover, :focus-visible) .pslot-star{ animation:none; background:var(--red); transform:rotate(90deg) scale(1.2); }
.pslot.is-open:is(:hover, :focus-visible) .pslot-label{ color:var(--red); }
.pslot.is-open:is(:hover, :focus-visible) .pslot-frame{ border-color:rgba(255,72,72,.7); background:rgba(255,72,72,.06); }
.pslot.is-future:hover .pslot-star{ transform:rotate(90deg); }

/* =========================================================
   HÉROS
   ========================================================= */
.qhero{
  position:relative; overflow:hidden; isolation:isolate; color:#fff;
  min-height:clamp(660px, calc(100svh - 72px), 960px);
  background:#07001C;
  --px:0; --py:0;
  --W:clamp(124px, 14vw, 226px);
}
.qhero-glow{
  position:absolute; inset:-10%; z-index:-1; pointer-events:none;
  background:
    radial-gradient(ellipse 34% 44% at 50% 50%, rgba(142,107,255,.55), rgba(142,107,255,0) 70%),
    radial-gradient(ellipse 58% 66% at 50% 54%, rgba(94,50,215,.62), rgba(46,15,148,.25) 52%, rgba(7,0,28,0) 78%);
  animation:qglow 9s ease-in-out infinite alternate;
}
@keyframes qglow{ from{ opacity:.9; transform:scale(1); } to{ opacity:1; transform:scale(1.03); } }

/* grand mot de fond */
.qhero-word{
  position:absolute; left:0; right:0; top:7%; bottom:24%; z-index:0;
  display:flex; flex-direction:column; align-items:center; justify-content:space-between;
  font-family:var(--display-wide); text-transform:uppercase; line-height:.9;
  font-size:clamp(60px, 13.4vw, 208px); letter-spacing:calc(-.01em + var(--tracking-blunt));
  transform:translate3d(calc(var(--px) * -10px), calc(var(--py) * -6px), 0);
  transition:transform 900ms var(--q-ease-out);
  pointer-events:none; user-select:none;
}
.qhero-word span{
  background:linear-gradient(180deg, rgba(185,165,255,.95) 0%, rgba(142,107,255,.6) 48%, rgba(94,50,215,.08) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:qword 1.4s var(--q-ease-out) both;
}
.qhero-word span:first-child{ transform:translateX(-2.42em); animation-delay:.05s; }
.qhero-word span:last-child{ animation-delay:.18s; }
@keyframes qword{ from{ opacity:0; letter-spacing:.18em; filter:blur(14px); } to{ opacity:1; filter:blur(0); } }

/* repères dans les coins */
.qhero-tick{
  position:absolute; z-index:2; margin:0; display:flex; align-items:center; gap:10px;
  font-family:var(--body); font-size:11px; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:rgba(255,255,255,.72); white-space:nowrap;
  animation:qfade 1s ease 1.1s both;
}
.qhero-tick i{ display:block; width:24px; height:7px; background:linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.1)); }
.t-tl{ top:8%; left:5%; }
.t-tr{ top:20%; right:5%; }
.t-bl{ bottom:11%; left:6%; }
.t-br{ bottom:11%; right:6%; }
@keyframes qfade{ from{ opacity:0; } to{ opacity:1; } }

/* la vague de cartes */
.qhero-stage{
  list-style:none; margin:0; padding:0;
  position:absolute; left:50%; top:47%; width:0; height:0; z-index:1;
  transform:translate3d(calc(var(--px) * 8px), calc(var(--py) * 6px), 0);
  transition:transform 900ms var(--q-ease-out);
}
.qhero-slot{
  --y:0; --s:1; --o:0; --depth:0;
  position:absolute; width:var(--W);
  left:calc(var(--i) * var(--W) * .94 - var(--W) / 2);
  top:calc(var(--W) * -.68 + var(--W) * var(--y));
  z-index:calc(10 - var(--o));
  scale:var(--s);
  transform:translate3d(calc(var(--px) * var(--depth) * .6px), calc(var(--py) * var(--depth) * .4px), 0);
  transition:transform 900ms var(--q-ease-out);
  animation:qrise 1.1s var(--q-ease-out) both;
  animation-delay:calc(.25s + var(--o) * .09s);
}
.qhero-slot:nth-child(1){ --y:.04;  --o:3; --depth:6;  --s:.92; }
.qhero-slot:nth-child(2){ --y:.36;  --o:2; --depth:10; --s:.96; }
.qhero-slot:nth-child(3){ --y:-.02; --o:1; --depth:14; }
.qhero-slot:nth-child(4){ --y:-.3;  --o:0; --depth:20; --s:1.12; }
.qhero-slot:nth-child(5){ --y:.02;  --o:1; --depth:14; }
.qhero-slot:nth-child(6){ --y:.38;  --o:2; --depth:10; --s:.96; }
.qhero-slot:nth-child(7){ --y:.06;  --o:3; --depth:6;  --s:.92; }
.qhero-slot:hover{ z-index:30; }
@keyframes qrise{ from{ opacity:0; translate:0 140px; } to{ opacity:1; translate:0 0; } }

.qhero-slot .pcard{ animation:qfloat 8s ease-in-out infinite alternate; animation-delay:calc(var(--i) * -1.3s); }
.qhero-slot .pcard .pcard-frame{ box-shadow:0 30px 60px -30px rgba(0,0,0,.8); }
.qhero-slot .pcard:hover{ transform:perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.02); }
@keyframes qfloat{ from{ translate:0 0; } to{ translate:0 -7px; } }

/* texte du héros */
.qhero-copy{
  position:absolute; left:0; right:0; bottom:var(--s6); z-index:3;
  display:flex; flex-direction:column; align-items:center; text-align:center;
  animation:qfade 1s ease .9s both;
}
.qhero-lede{
  margin:0 0 var(--s4); max-width:44ch;
  font-family:var(--body); font-size:16px; line-height:1.55; color:rgba(255,255,255,.82);
}
.qhero-cta{
  display:inline-flex; align-items:center; gap:10px; padding:11px 22px;
  border:1px solid rgba(255,255,255,.32); border-radius:999px;
  font-family:var(--body); font-size:13px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:#fff; text-decoration:none; background:rgba(255,255,255,.04);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  transition:background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.qhero-cta span{ display:inline-block; transition:transform var(--dur-3) var(--q-spring); }
.qhero-cta:hover, .qhero-cta:focus-visible{ background:#fff; border-color:#fff; color:var(--ink-800); }
.qhero-cta:hover span{ transform:translateY(4px); }
.qhero-cta:focus-visible{ outline:2px solid #fff; outline-offset:3px; }

/* =========================================================
   LE MUR
   ========================================================= */
.qwall{ background:linear-gradient(180deg, #07001C 0%, var(--ink-900) 22%); padding-top:var(--s7); }
.qwall-head{ margin-bottom:var(--s6); }

.qfilter{
  position:relative; display:inline-flex; flex-wrap:wrap; gap:2px; padding:4px; margin-bottom:var(--s7);
  border:1px solid var(--line-dark); border-radius:999px; background:rgba(255,255,255,.04);
}
.qfilter-pill{
  position:absolute; top:4px; left:4px; height:calc(100% - 8px); width:0; border-radius:999px; background:#fff;
  box-shadow:0 6px 20px -6px rgba(142,107,255,.8);
  transition:transform 520ms var(--q-spring), width 520ms var(--q-spring);
}
.qfilter-btn{
  position:relative; z-index:1; appearance:none; border:0; background:none; cursor:pointer;
  padding:10px 18px; border-radius:999px;
  font-family:var(--body); font-size:14px; font-weight:600; color:rgba(255,255,255,.72);
  transition:color var(--dur-2) var(--ease);
}
.qfilter-btn b{ margin-left:4px; font-weight:700; font-size:12px; opacity:.55; font-variant-numeric:tabular-nums; }
.qfilter-btn:hover{ color:#fff; }
.qfilter-btn.is-active{ color:var(--ink-800); }
.qfilter-btn:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

.wall{
  list-style:none; margin:0; padding:0;
  display:grid; grid-template-columns:repeat(auto-fill, minmax(178px, 1fr)); gap:var(--s6) var(--s4);
}
.wall-item{ position:relative; }
.wall-item.is-out{ display:none; }

/* entrée en cascade (uniquement si le JS est là) */
.q-js .wall-item{ opacity:0; transform:translateY(34px) scale(.97); }
.q-js .wall-item.is-in{
  opacity:1; transform:none;
  transition:opacity 700ms var(--ease), transform 900ms var(--q-ease-out);
  transition-delay:var(--d, 0ms);
}

@media (max-width:900px){
  .t-tr, .t-bl{ display:none; }
}
@media (max-width:720px){
  .qhero{ --W:36vw; min-height:680px; }
  .qhero-stage{ top:40%; }
  .qhero-slot{ left:calc(var(--i) * var(--W) * .84 - var(--W) / 2); }
  .qhero-word{ font-size:14.6vw; top:13%; bottom:38%; }
  .qhero-word span:first-child{ transform:none; }
  .t-tl{ top:5%; } .t-br{ display:none; }
  .qhero-copy{ bottom:var(--s5); padding-inline:var(--s4); }
  .qhero-lede{ font-size:15px; }
  .qfilter{ display:flex; border-radius:18px; }
  .qfilter-pill{ display:none; }
  .qfilter-btn{ flex:1 1 auto; padding:9px 12px; font-size:13px; }
  .qfilter-btn.is-active{ background:#fff; }
  .wall{ grid-template-columns:repeat(2, 1fr); gap:var(--s5) var(--s3); }
}

@media (prefers-reduced-motion:reduce){
  .qhero-glow, .qhero-word span, .qhero-tick, .qhero-slot, .qhero-slot .pcard, .qhero-copy, .pslot.is-open .pslot-star{ animation:none !important; }
  .qhero-word, .qhero-stage, .qhero-slot{ transition:none; }
  .q-js .wall-item{ opacity:1; transform:none; }
  .pcard, .pslot{ transform:none !important; }
}

/* repère des cases vides : au-dessus du logo du jeu, jamais dessous */
.pslot-star, .pslot-q{ position:absolute; left:50%; top:14%; translate:-50% 0; margin:0; }
.pslot-q{ top:6%; }
.pslot.is-future .pslot-star{ top:30%; margin:0; }

/* qualifié sans fiche publiée : carte pleine (c'est un vrai qualifié),
   étoile contour à la place du portrait */
.pslot.is-anon .pslot-frame{
  border-style:solid; border-color:rgba(255,255,255,.12);
  background:linear-gradient(165deg, #2C0F8F 0%, #17004F 58%, #0B0026 100%);
}
.pslot.is-anon .pslot-star{
  top:16%; width:30cqw; height:30cqw;
  background:linear-gradient(160deg, var(--violet-200), var(--violet-500));
  filter:drop-shadow(0 0 14px rgba(142,107,255,.7));
}
.pslot.is-anon .pslot-frame::before{
  content:""; position:absolute; left:50%; top:31%; width:70%; aspect-ratio:1; translate:-50% -50%;
  border-radius:50%; background:radial-gradient(circle, rgba(142,107,255,.35), rgba(142,107,255,0) 70%);
}
.pslot.is-anon .pslot-logo{ opacity:1; filter:drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.pslot.is-anon .pslot-label{ color:#fff; }
.pslot.is-anon .pcard-sub{ color:var(--violet-200); }
.pslot.is-anon:is(:hover, :focus-visible) .pslot-frame{ border-color:rgba(185,165,255,.55); background:linear-gradient(165deg, #3A19A8 0%, #1C0560 58%, #0B0026 100%); }
.pslot.is-anon:is(:hover, :focus-visible) .pslot-star{ background:#fff; transform:rotate(90deg) scale(1.1); }
.pslot.is-anon:is(:hover, :focus-visible) .pslot-logo{ opacity:1; }
