/* Accueil, écran de jeu (maillot, parcours, indices, réponse), transition. */

/* ================= Accueil ================= */
.hero { text-align: center; padding-top: 18px; margin-bottom: 14px; }
.hero__logo { margin: 0; display: flex; justify-content: center; }

/* ---------- Logo : le mot FLOQUÉ tout en jaune ---------- */
.logo { --logo-size: clamp(4rem, min(28vw, 9vh), 9rem); display: inline-block; font-size: var(--logo-size); line-height: 1; }
.logo__word {
  display: block; padding: 0.1em 0.04em 0;
  font-family: var(--font-display); font-weight: 900; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--yellow);
  text-shadow: 0 0.05em 0 var(--ink), 0.03em 0 0 var(--ink), -0.03em 0 0 var(--ink), 0 -0.03em 0 var(--ink);
}
.logo--small { --logo-size: clamp(2.6rem, 7vh, 3.8rem); }
.hero__slogan { margin-top: 2px; font-weight: 800; font-size: 1rem; color: var(--white); text-shadow: 0 2px 0 var(--ink); }

.ticket { display: flex; flex-direction: column; gap: 16px; }
.ticket__number {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  padding: 6px 16px 4px;
  color: var(--ink);
  background: var(--yellow);
  border: var(--border);
  border-radius: 999px;
  transform: rotate(-2deg);
}
.pseudo__label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.pseudo__input {
  font: inherit; font-size: 1.15rem; font-weight: 700;
  padding: 12px 16px;
  border: var(--border); border-radius: 14px;
  background: var(--panel);
}
.pseudo__error { margin-top: 6px; color: var(--red); font-weight: 700; }
.pseudo__error:empty { display: none; }
.pseudo__hello { font-weight: 800; font-size: 1.2rem; }
.rules { display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.rules li { padding-left: 4px; }

@keyframes bounce { 50% { transform: translateY(-12px) rotate(25deg); } }

/* ================= Écran de jeu : tout tient sur un écran (pas de scroll) ================= */
.screen--game { height: 100vh; height: 100dvh; gap: clamp(4px, 0.8vh, 8px); padding: clamp(6px, 1.2vh, 10px) 12px calc(6px + env(safe-area-inset-bottom)); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: clamp(4px, 0.9vh, 8px) 12px;
  color: var(--white); background: var(--ink);
  border: var(--border); border-radius: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.topbar__main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar__count { font-family: var(--font-display); font-weight: 900; font-size: 1.45rem; line-height: 1; }
.topbar__stats { display: flex; gap: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar__stats b { font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; }

/* ----- Maillot mystère ----- */
.stage { flex: 1 1 0; min-height: 56px; display: flex; justify-content: center; }
.jersey {
  --jersey: #1b2160; --trim: #2f3aa8; --flock: #ffd62e;
  position: relative; height: 100%; display: flex; justify-content: center;
}
.jersey__svg { display: block; height: 100%; width: auto; max-width: 100%; filter: drop-shadow(0 4px 0 rgba(13, 15, 43, 0.35)); }
.jersey__ground { fill: rgba(13, 15, 43, 0.18); }
.jersey__body { fill: var(--jersey); transition: fill 0.8s ease; }
.jersey__trim { fill: var(--trim); transition: fill 0.8s ease; }
.jersey__collar { fill: none; stroke: var(--trim); stroke-width: 10; stroke-linecap: round; transition: stroke 0.8s ease; }
.jersey__outline { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.jersey__shadow { fill: #000; opacity: 0.16; }
.jersey__fold { fill: none; stroke: #000; stroke-opacity: 0.1; stroke-width: 3; }
.jersey__name {
  font-family: var(--font-display); font-weight: 900; font-size: 50px; fill: var(--flock);
  stroke: rgba(0, 0, 0, 0.25); stroke-width: 1.5px; paint-order: stroke; opacity: 0;
}
.jersey__question {
  font-family: var(--font-display); font-weight: 900; font-size: 150px; fill: var(--yellow);
  stroke: var(--ink); stroke-width: 7px; paint-order: stroke; stroke-linejoin: round;
  transform-box: fill-box; transform-origin: center; animation: wobble 2.4s ease-in-out infinite;
}
@keyframes wobble { 50% { transform: translateY(-4px) rotate(4deg); } }

/* Révélé : le "?" disparaît, le nom est floqué au centre du dos */
.jersey.is-revealed .jersey__question { display: none; }
.jersey.is-revealed .jersey__name { opacity: 1; animation: flock-in 0.6s 0.3s both cubic-bezier(0.2, 1.3, 0.5, 1); }
.jersey.is-found { --jersey: var(--jersey-vivid); --trim: #ffffff; --flock: #ffffff; }
.jersey.is-failed { --jersey: #a2a7ba; --trim: #dfe2ec; --flock: #3a3f57; }
.jersey.is-failed .jersey__svg { filter: grayscale(0.6) drop-shadow(0 4px 0 rgba(13, 15, 43, 0.3)); }
@keyframes flock-in { from { opacity: 0; transform: translateY(14px) scale(0.6); } }
.jersey--small { height: clamp(120px, 24vh, 190px); }
.jersey.is-instant .jersey__body, .jersey.is-instant .jersey__trim, .jersey.is-instant .jersey__collar { transition-duration: 0.01ms; }

/* Révélation : le maillot (plus grand) et le parcours se regroupent au centre de l'écran */
.screen--game.is-revealed .stage { flex: 0 0 auto; height: min(46vh, 400px); }
.screen--game.is-revealed .reveal-banner { margin-top: auto; }
.screen--game.is-revealed .career { margin-bottom: auto; }
.reveal-banner { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; color: var(--white); text-shadow: 0 3px 0 var(--ink); animation: pop 0.5s cubic-bezier(0.2, 1.3, 0.5, 1); }
.reveal-banner__title {
  font-family: var(--font-display); font-weight: 900; font-size: 2.4rem; line-height: 1; text-transform: uppercase; text-shadow: none;
  padding: 4px 18px 2px; color: var(--ink); background: var(--yellow); border: var(--border); border-radius: 999px; transform: rotate(-2deg);
}
.reveal-banner__points { font-weight: 800; font-size: 1.1rem; }
.reveal-banner__points strong { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 1; }

/* ----- Parcours : liste verticale numérotée, une ligne compacte par club ----- */
.career {
  --row-h: clamp(21px, 3.4vh, 38px);   /* si l'écran est court, ce sont d'abord le maillot puis ces lignes qui rétrécissent */
  --badge: clamp(17px, 2.9vh, 30px);
  display: grid; gap: 3px 8px; padding: 6px 8px; border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
  grid-auto-flow: column;                                  /* on remplit chaque colonne de haut en bas, jamais en zigzag */
  grid-template-rows: repeat(var(--rows), auto);
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}
.club {
  display: grid; grid-template-columns: 1.2em var(--badge) minmax(0, 1fr) auto; align-items: center; gap: 6px;
  min-height: var(--row-h); padding: 2px 6px 2px 4px;
  background: var(--panel); border-radius: 10px;
  animation: club-in 0.5s both; animation-delay: calc(var(--i) * 90ms);
}
@keyframes club-in { from { opacity: 0; transform: translateX(-10px) scale(0.96); } }
.club__num { font-size: 0.66rem; font-weight: 800; text-align: center; opacity: 0.45; font-variant-numeric: tabular-nums; }
.club__name { font-size: clamp(0.68rem, 1.5vh, 0.82rem); font-weight: 800; line-height: 1.05; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.club__years { font-family: var(--font-display); font-weight: 900; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 2 colonnes (plus de 8 clubs) : lignes plus serrées pour que les noms longs tiennent */
.career[style*="--cols: 2"] { gap: 3px 6px; padding: 6px; }
.career[style*="--cols: 2"] .club { grid-template-columns: 11px var(--badge) minmax(0, 1fr) auto; gap: 3px; padding: 2px 3px; }
.career[style*="--cols: 2"] .club__num { font-size: 0.6rem; }
.career[style*="--cols: 2"] .club__name { font-size: 0.62rem; }
.career[style*="--cols: 2"] .club__years { font-size: 0.76rem; }
.career[style*="--cols: 3"] .club__name { font-size: 0.55rem; }
.badge {
  display: grid; place-items: center;
  width: var(--badge, 30px); height: var(--badge, 30px); padding: 2px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden;
}
.badge img { max-width: 100%; max-height: 100%; object-fit: contain; }
.badge__fallback { display: grid; place-items: center; width: 100%; height: 100%; padding: 1px; font-size: 0.4rem; font-weight: 800; line-height: 1; text-align: center; overflow: hidden; border-radius: 5px; }

/* ----- Indices ----- */
.help { display: flex; flex-direction: column; gap: clamp(3px, 0.7vh, 6px); }
.tags { display: flex; flex-wrap: nowrap; gap: 5px; }  /* les 3 étiquettes restent sur une seule ligne */
.tags:empty { display: none; }
.tag { padding: 1px 10px; font-size: min(0.92rem, 3.7vw); white-space: nowrap; font-weight: 800; background: var(--white); border: var(--border); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.tag--new { animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.5, 1); }
.hint-card {
  width: 100%; padding: clamp(4px, 0.9vh, 8px) 12px;
  font-family: var(--font-display); font-weight: 900; font-size: clamp(1.05rem, 2.5vh, 1.3rem); line-height: 1.05; text-align: center;
  color: var(--ink); background: var(--yellow);
  border: var(--border); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
  cursor: pointer; animation: pop 0.45s cubic-bezier(0.2, 1.3, 0.5, 1);
}
.hint-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* ----- Réponse ----- */
.answer { display: flex; flex-direction: column; gap: clamp(4px, 0.9vh, 8px); padding: clamp(6px, 1.1vh, 10px); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); overflow: visible; }
.answer.is-hidden { display: none; }
.answer__field { position: relative; }
.answer__input {
  width: 100%; font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--ink);
  padding: clamp(6px, 1.1vh, 10px) 14px; background: var(--white); border: var(--border); border-radius: 12px;
}
.answer .btn { font-size: clamp(1.1rem, 2.6vh, 1.3rem); padding: 0.3em 1em; }
.suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5;
  background: var(--white); border: var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.suggest[hidden] { display: none; }
.suggest__item { width: 100%; padding: 8px 14px; font: inherit; font-size: 1rem; font-weight: 700; text-align: left; background: none; border: 0; cursor: pointer; }
.suggest__item:hover, .suggest__item:focus-visible { background: var(--yellow); }
.suggest li + li { border-top: 2px solid var(--panel); }
.answer__feedback { font-size: clamp(0.78rem, 1.7vh, 0.9rem); font-weight: 700; line-height: 1.2; color: var(--red); }
.answer__feedback:empty { display: none; }
.give-up { text-align: center; line-height: 1; }
.give-up .link-btn { padding: 2px 8px; font-size: 0.9rem; }

/* ================= Transition ================= */
.transition { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.transition__headline {
  font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 1; text-transform: uppercase;
  padding: 4px 18px 2px; color: var(--ink); background: var(--yellow); border: var(--border); border-radius: 999px; transform: rotate(-2deg);
}
.transition--failed .transition__headline { background: #ff6b8e; }
.transition--abandon .transition__headline { background: #c9cde0; }
.transition__answer { font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; line-height: 1; text-transform: uppercase; }
.transition__phrase { font-weight: 700; font-size: 1.1rem; max-width: 22rem; }
.transition__points { font-weight: 800; font-size: 1.05rem; }
.transition__points-value { font-family: var(--font-display); font-weight: 900; font-size: 3.2rem; line-height: 1; }
.screen--transition { justify-content: center; min-height: 100vh; min-height: 100dvh; }

/* ---------- Écran d'attente (avant le lancement) ---------- */
.waiting { align-items: center; text-align: center; }
.waiting__title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; line-height: 1.1; }
.waiting__count { margin: 0; font-weight: 700; }
.waiting__count .countdown__time { display: block; margin-top: 4px; font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; font-variant-numeric: tabular-nums; }
