/*!
 * Thème « Deux camps » — Jeu Tu Préfères
 *
 * Chargé après design-system.css et components.css : il en garde l'échelle
 * d'espacements et les composants, et leur donne une identité.
 *
 * La règle qui tient tout le reste : la sarcelle désigne l'option A, le corail
 * l'option B, le jaune le « OU » et le choix du joueur. Aucune autre couleur
 * vive. Les actions neutres (suivante, connexion…) sont à l'encre.
 *
 * Fichier référencé avec ?v=YYYYMMDD : bumper la version à chaque modification.
 */

/* ==========================================================================
   Polices — auto-hébergées (sous-ensemble latin : couvre fr, es, pt, en)
   ========================================================================== */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/figtree-latin.woff2') format('woff2');
}

/* ==========================================================================
   Jetons
   ========================================================================== */

:root {
  --jtp-a: #1b6f7c;
  --jtp-a-deep: #0f4a52;
  --jtp-a-soft: #d6ebed;
  --jtp-b: #f98253;
  --jtp-b-deep: #b8471c;
  --jtp-b-soft: #fde3d7;
  --jtp-pop: #ffd23f;
  --jtp-pop-ink: #231a00;
  --jtp-ink: #0d2226;
  --jtp-ground: #edf3f2;
  --jtp-surface: #ffffff;
  --jtp-surface-2: #f5f9f8;
  --jtp-line: #d3dfdd;
  --jtp-muted: #56696c;
  --jtp-trash: #2a0c10;

  --jtp-font-display: 'Bricolage Grotesque', 'Arial Rounded MT Bold', 'Segoe UI', system-ui, sans-serif;
  --jtp-font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --jtp-r-lg: 22px;
  --jtp-r-md: 14px;
  --jtp-shadow: 0 1px 2px rgba(13, 34, 38, .06), 0 12px 32px -12px rgba(13, 34, 38, .18);

  /* Les composants existants lisent ces jetons : on les aligne sur le thème. */
  --color-primary: var(--jtp-a);
  --color-secondary: var(--jtp-b);
  --gradient-primary: var(--jtp-a);
  --gradient-hero: linear-gradient(135deg, var(--jtp-a-deep) 0%, var(--jtp-a) 100%);
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
  font-family: var(--jtp-font-body);
  background-color: var(--jtp-ground);
  color: var(--jtp-ink);
}

h1, h2, h3,
.hero-title {
  font-family: var(--jtp-font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

:focus-visible {
  outline: 3px solid var(--jtp-pop);
  outline-offset: 3px;
}

.text-gray-900 { color: var(--jtp-ink) !important; }
.text-gray-600 { color: var(--jtp-muted) !important; }

/* Lu par les moteurs et les lecteurs d'écran, invisible à l'œil. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
  background: var(--jtp-surface);
  box-shadow: none;
  border-bottom: 1px solid var(--jtp-line);
}

.navbar-item,
.navbar-link {
  font-weight: 600;
  color: var(--jtp-muted);
}

.navbar-item i,
.navbar-link i {
  display: none;
}

.navbar-dropdown .navbar-item i {
  display: inline-block;
  width: 1.1em;
  color: var(--jtp-a);
}

.navbar-item:hover,
.navbar-link:hover {
  background: var(--jtp-surface-2);
  color: var(--jtp-ink);
  transform: none;
}

.navbar-end .btn-primary,
.navbar-end .btn-primary:hover {
  background: transparent;
  color: var(--jtp-ink);
  border: 1.5px solid var(--jtp-line);
}

.navbar-end .btn-primary i { display: none; }

/* La série : votes d'affilée, dans la barre du haut. Vide tant qu'on n'a pas joué. */
.jtp-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--jtp-surface-2);
  border: 1px solid var(--jtp-line);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font: 700 14px/1 var(--jtp-font-body);
  font-variant-numeric: tabular-nums;
  color: var(--jtp-ink);
  white-space: nowrap;
}

.jtp-streak svg { width: 18px; height: 18px; flex: none; }
.jtp-streak.is-bump { animation: jtp-bump .5s ease; }
.jtp-streak.is-milestone { animation: jtp-milestone 1.2s ease; }

button.jtp-streak { cursor: pointer; }
.jtp-streak__label { font-weight: 600; color: var(--jtp-muted); }

@keyframes jtp-bump { 40% { transform: scale(1.18); } }

@keyframes jtp-milestone {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, .9); transform: scale(1); }
  30% { transform: scale(1.25); background: var(--jtp-pop); }
  100% { box-shadow: 0 0 0 16px rgba(255, 210, 63, 0); transform: scale(1); }
}

.jtp-streak-wrap { position: relative; display: inline-flex; }
.jtp-streak-wrap[hidden] { display: none; }

/* La bulle d'explication, sous la pastille. */
.jtp-streak__tip {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 60;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--jtp-ink);
  color: #fff;
  font: 600 13.5px/1.4 var(--jtp-font-body);
  box-shadow: 0 12px 30px -10px rgba(13, 34, 38, .5);
  animation: jtp-rise .3s ease;
}

.jtp-streak__tip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 22px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}

.jtp-streak__tip[hidden] { display: none; }

/* ==========================================================================
   Boutons
   ========================================================================== */

.btn {
  font-family: var(--jtp-font-body);
  font-weight: 700;
  border-radius: 999px;
}

.btn-primary {
  background: var(--jtp-ink);
  color: var(--jtp-ground);
  border: 0;
}

.btn-primary:hover:not(:disabled) {
  background: #1d3c42;
  color: #fff;
}

.btn-secondary {
  background: var(--jtp-surface);
  color: var(--jtp-ink);
  border: 1.5px solid var(--jtp-line);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--jtp-surface-2);
  color: var(--jtp-ink);
  border-color: var(--jtp-ink);
}

/* ==========================================================================
   Pied de page
   ========================================================================== */

.footer {
  background: var(--jtp-ink);
  margin-top: var(--space-16);
}

.footer-title { font-family: var(--jtp-font-display); }

/* ==========================================================================
   Le duel
   Un partial (question/_duel.html.twig), un moteur (js/jtp-play.js).
   Côte à côte en large, empilé quand le conteneur est étroit : la règle suit la
   largeur du conteneur et non celle de l'écran, pour que le même duel tienne
   dans la page question comme dans le bandeau de l'accueil.
   ========================================================================== */

.jtp-duel-host {
  container-type: inline-size;
  --jtp-pct-size: clamp(48px, 8cqi, 84px);
}

.jtp-duel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  height: clamp(320px, 38cqi, 440px);
  border-radius: var(--jtp-r-lg);
  overflow: hidden;
  background: var(--jtp-ink);
}

.jtp-side {
  --c: var(--jtp-a);
  --cd: var(--jtp-a-deep);
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(150deg, var(--c), var(--cd));
  isolation: isolate;
  cursor: pointer;
  font: inherit;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.jtp-side--b { --c: var(--jtp-b); --cd: var(--jtp-b-deep); }

.jtp-side img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s;
}

/* Voile au pied de l'image : le libellé reste lisible quelle que soit l'illustration. */
.jtp-side.has-img::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--cd) 92%, transparent) 100%);
}

.jtp-side__tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--cd);
  font: 800 19px/40px var(--jtp-font-display);
  text-align: center;
}

.jtp-side__label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  font: 700 clamp(21px, 3cqi, 32px)/1.1 var(--jtp-font-display);
  letter-spacing: -.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  transition: transform .35s;
}

/* Sans illustration : le texte en grand, centré, sur la couleur du camp. */
.jtp-side:not(.has-img) .jtp-side__label {
  top: 64px;
  bottom: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(22px, 3.6cqi, 38px);
}

.jtp-side__res {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 0 22px 20px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s .1s, transform .45s .1s;
}

.jtp-side__pct {
  font: 800 var(--jtp-pct-size)/.9 var(--jtp-font-display);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.jtp-side__bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
}

.jtp-side__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #fff;
  transition: width 1s cubic-bezier(.2, .7, .2, 1) .2s;
}

.jtp-side__votes {
  font: 600 13px/1 var(--jtp-font-body);
  opacity: .85;
}

.jtp-side__mine {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--jtp-pop);
  color: var(--jtp-pop-ink);
  font: 800 12px/1 var(--jtp-font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(.8);
  transition: .3s .15s;
}

.jtp-or {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--jtp-pop);
  color: var(--jtp-pop-ink);
  font: 800 20px/1 var(--jtp-font-display);
  text-transform: uppercase;
  box-shadow: 0 0 0 6px var(--jtp-ink), 0 10px 24px rgba(0, 0, 0, .35);
  pointer-events: none;
  transition: transform .4s;
}

@media (hover: hover) {
  .jtp-duel:not(.is-voted) .jtp-side:hover img { transform: scale(1.045); }
  .jtp-duel:not(.is-voted) .jtp-side:hover .jtp-side__label { transform: translateY(-4px); }
}

.jtp-duel:not(.is-voted) .jtp-side:active { filter: brightness(.95); }

.jtp-duel.is-busy .jtp-side { cursor: progress; }

/* Après le vote */
.jtp-duel.is-voted .jtp-side { cursor: default; }
.jtp-duel.is-voted .jtp-side__res { opacity: 1; transform: none; }
.jtp-duel.is-voted .jtp-side__label { transform: translateY(calc(-1 * (var(--jtp-pct-size) + 48px))); }
.jtp-duel.is-voted .jtp-side:not(.has-img) .jtp-side__label { transform: none; top: 64px; bottom: auto; font-size: clamp(19px, 2.8cqi, 28px); }
.jtp-duel.is-voted .jtp-side:not(.is-chosen) img { filter: saturate(.35) brightness(.7); }
.jtp-duel.is-voted .jtp-side.is-chosen { box-shadow: inset 0 0 0 5px var(--jtp-pop); }
.jtp-duel.is-voted .jtp-side.is-chosen .jtp-side__mine { opacity: 1; transform: none; }
.jtp-duel.is-voted .jtp-or { transform: scale(.72); }

/* Empilé : deux bandeaux paysage, qui reçoivent tels quels les images 1080x592 du Studio. */
@container (max-width: 560px) {
  .jtp-duel-host { --jtp-pct-size: clamp(40px, 13cqi, 60px); }
  .jtp-duel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: clamp(440px, 128cqi, 540px);
    border-radius: 20px;
  }
  .jtp-side__label { left: 18px; right: 18px; bottom: 18px; font-size: clamp(20px, 6.4cqi, 28px); }
  .jtp-side:not(.has-img) .jtp-side__label { top: 56px; bottom: 40px; font-size: clamp(21px, 7cqi, 30px); }
  .jtp-side__res { padding: 0 18px 16px; }
  .jtp-side__tag { top: 12px; left: 12px; width: 34px; height: 34px; font-size: 16px; line-height: 34px; }
  .jtp-side__mine { top: 12px; right: 12px; }
  .jtp-or { width: 56px; height: 56px; font-size: 17px; box-shadow: 0 0 0 5px var(--jtp-ink), 0 8px 18px rgba(0, 0, 0, .35); }
  .jtp-duel.is-voted .jtp-side__label { transform: translateY(calc(-1 * (var(--jtp-pct-size) + 42px))); }
  .jtp-duel.is-voted .jtp-side:not(.has-img) .jtp-side__label { top: 52px; font-size: clamp(17px, 5.4cqi, 22px); }
}

/* Sous le duel : l'indice avant le vote, le verdict et la suite après. */
.jtp-duel__after {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  min-height: 52px;
  margin-top: 14px;
}

.jtp-duel__hint {
  margin: 0;
  color: var(--jtp-muted);
  font-size: 15px;
}

.jtp-duel__verdict {
  margin: 0;
  font: 700 18px/1.3 var(--jtp-font-display);
  color: var(--jtp-ink);
}

.jtp-duel__verdict b { color: var(--jtp-a); }
.jtp-duel__verdict.is-minority b { color: var(--jtp-b-deep); }

.jtp-duel__error {
  flex-basis: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--jtp-r-md);
  background: #fdecea;
  color: #8a1c12;
  font-weight: 600;
  font-size: 14px;
}

.jtp-kbd {
  display: inline-block;
  font: 600 12px/1 var(--jtp-font-body);
  border: 1px solid var(--jtp-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--jtp-surface);
  color: var(--jtp-ink);
}

@media (hover: none) {
  .jtp-kbd-hint { display: none; }
}

.jtp-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--jtp-line);
  background: transparent;
  color: var(--jtp-ink);
  font: 700 16px/1 var(--jtp-font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}

.jtp-next:hover { border-color: var(--jtp-ink); color: var(--jtp-ink); }

/* Après le vote, « Suivante » devient l'action principale. */
.is-voted-host .jtp-next {
  background: var(--jtp-ink);
  border-color: var(--jtp-ink);
  color: var(--jtp-ground);
}

.is-voted-host .jtp-next:hover { background: #1d3c42; color: #fff; }

.jtp-next i { transition: transform .2s; }
.is-voted-host .jtp-next i { animation: jtp-nudge 1.2s ease-in-out infinite; }

@keyframes jtp-nudge { 50% { transform: translateX(4px); } }

.jtp-swipe-hint {
  display: none;
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--jtp-muted);
}

@media (hover: none) and (max-width: 767px) {
  .is-voted-host[data-mode="page"] .jtp-swipe-hint { display: block; }
}

/* Départ vers la question suivante : la page s'efface au lieu de clignoter. */
.jtp-leaving { opacity: .35; transition: opacity .2s; }

/* ==========================================================================
   Lignes de question (listes, thèmes, « de la même catégorie », accueil)
   ========================================================================== */

.jtp-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.jtp-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 14px;
  padding: 14px 18px;
  background: var(--jtp-surface);
  border: 1px solid var(--jtp-line);
  border-radius: var(--jtp-r-md);
  color: var(--jtp-ink);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}

a.jtp-row:hover { border-color: var(--jtp-a); color: var(--jtp-ink); }

.jtp-row__a,
.jtp-row__b {
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.jtp-row__b { text-align: right; }

.jtp-row__or {
  font: 800 12px/1 var(--jtp-font-display);
  text-transform: uppercase;
  color: var(--jtp-muted);
}

.jtp-split {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
}

.jtp-split i { display: block; border-radius: 99px; background: var(--jtp-a); min-width: 3px; }
.jtp-split i + i { background: var(--jtp-b); }

.jtp-split-nums {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 700 13px/1 var(--jtp-font-body);
  font-variant-numeric: tabular-nums;
}

.jtp-split-nums span:first-child { color: var(--jtp-a); }
.jtp-split-nums span:last-child { color: var(--jtp-b-deep); }
.jtp-split-nums .jtp-split-total { color: var(--jtp-muted); font-weight: 600; }

/* Ligne jouable : deux boutons ; le résultat se révèle au clic. */
.jtp-row--play { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding: 8px; }

.jtp-row__pick {
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--jtp-surface-2);
  color: var(--jtp-ink);
  font: 600 15px/1.3 var(--jtp-font-body);
  text-align: left;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.jtp-row__pick--b { text-align: right; }
.jtp-row__pick--a:hover { border-color: var(--jtp-a); background: var(--jtp-a-soft); }
.jtp-row__pick--b:hover { border-color: var(--jtp-b); background: var(--jtp-b-soft); }
.jtp-row--play .jtp-row__or { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--jtp-pop); color: var(--jtp-pop-ink); font-size: 11px; }
/* Le résultat reste caché tant que le joueur n'a pas choisi. */
.jtp-row--play .jtp-split,
.jtp-row--play .jtp-split-nums { display: none; }
.jtp-row--play.is-voted .jtp-split,
.jtp-row--play.is-voted .jtp-split-nums { display: flex; }
.jtp-row--play.is-voted .jtp-row__pick { cursor: default; }
.jtp-row--play.is-voted .jtp-row__pick.is-chosen { border-color: var(--jtp-pop); background: #fff7d6; }
/* Ligne-lien (accueil, pages catégorie) : les options mènent à la page de la question. */
a.jtp-row__pick { display: flex; align-items: center; text-decoration: none; }
a.jtp-row__pick--b { justify-content: flex-end; }
.jtp-row--play .jtp-split,
.jtp-row--play .jtp-split-nums { margin-inline: 6px; }

.jtp-row__foot {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 4px;
  font-size: 14px;
  color: var(--jtp-muted);
}

.jtp-row__foot a { color: var(--jtp-ink); font-weight: 700; text-decoration: none; }
.jtp-row__foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .jtp-row { padding: 12px 14px; gap: 6px 10px; }
  .jtp-row__pick { font-size: 14px; padding: 10px; }
}

/* ==========================================================================
   Sections de page (accueil, listes)
   ========================================================================== */

.jtp-page {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 16px;
}

.jtp-sec { padding-block: 40px 8px; }

.jtp-sec__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
}

.jtp-sec__title {
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--jtp-ink);
}

.jtp-sec__kicker { margin: 0; color: var(--jtp-muted); font-size: 16px; max-width: 60ch; }

/* max-width plutôt que nowrap : au zoom texte 200 %, le lien passe à la ligne au lieu de sortir de l'écran. */
.jtp-sec__more { max-width: 100%; font-weight: 700; color: var(--jtp-ink); text-decoration: none; }
.jtp-sec__more:hover { text-decoration: underline; color: var(--jtp-ink); }

.jtp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--jtp-line);
  background: var(--jtp-surface);
  color: var(--jtp-muted);
  font: 700 12px/1 var(--jtp-font-body);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
}

.jtp-chip__live { width: 7px; height: 7px; border-radius: 50%; background: var(--jtp-b); }

/* Couvertures de catégories */
.jtp-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.jtp-cat {
  container-type: inline-size;
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--jtp-r-md);
  overflow: hidden;
  background: var(--k, var(--jtp-a));
  color: #fff;
  text-decoration: none;
}

.jtp-cat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s;
}

.jtp-cat::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 20, 22, .78));
}

.jtp-cat:hover { color: #fff; }
.jtp-cat:hover img { transform: scale(1.05); }

.jtp-cat__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -60%;
  font-size: 44px;
  opacity: .35;
}

.jtp-cat__name {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  font: 700 19px/1.1 var(--jtp-font-display);
  /* Dans une tuile étroite, la police rétrécit plutôt que de couper le nom
     (« Dilemmes impossibles » dans les autres sélections d'une page de thème). */
  font-size: clamp(12.5px, 7.4cqi, 19px);
  /* Une seule ligne : un nom qui passe à la ligne remonte au-dessus de ses voisins
     et casse l'alignement de la grille. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jtp-cat__flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff;
  color: #6d0f19;
  font: 800 12px/1 var(--jtp-font-body);
}

@media (max-width: 860px) {
  .jtp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Tuile étroite (139 px à 320 px d'écran) : on gagne de la place sur les marges,
   la taille de police suit déjà la largeur de la tuile (voir .jtp-cat__name). */
@container (max-width: 175px) {
  .jtp-cat__name { left: 10px; right: 10px; }
}

/* Cartes de quiz */
.jtp-quizzes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 860px) {
  .jtp-quizzes { grid-template-columns: 1fr; }
}

.jtp-quiz {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--jtp-surface);
  border: 1px solid var(--jtp-line);
  border-radius: var(--jtp-r-md);
  color: var(--jtp-ink);
  text-decoration: none;
  transition: border-color .2s;
}

.jtp-quiz:hover { border-color: var(--jtp-a); color: var(--jtp-ink); }

.jtp-quiz__img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  object-fit: cover;
  background: var(--jtp-a-soft);
}

.jtp-quiz__body { display: grid; gap: 10px; align-content: start; padding: 16px 18px 18px; }
.jtp-quiz__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--jtp-muted); font-size: 14px; }
.jtp-quiz__title { margin: 0; font-size: 20px; font-weight: 700; color: var(--jtp-ink); }
.jtp-quiz__meta { margin: 0; color: var(--jtp-muted); font-size: 14px; }
.jtp-quiz__meta b { color: var(--jtp-ink); }

.jtp-progress { height: 6px; border-radius: 99px; overflow: hidden; background: var(--jtp-surface-2); }
.jtp-progress i { display: block; height: 100%; width: 0; background: var(--jtp-a); }

/* Emplacement publicitaire : repéré, jamais entre le vote et son résultat. */
.jtp-adslot {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  margin-top: 32px;
}

/* Contenu éditorial (texte SEO + FAQ) */
.jtp-editorial {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  padding-block: 44px 8px;
}

.jtp-editorial h2 { margin: 0 0 12px; font-size: 26px; font-weight: 800; color: var(--jtp-ink); }
.jtp-editorial p { color: var(--jtp-muted); font-size: 16px; line-height: 1.65; max-width: 64ch; margin: 0 0 12px; }
.jtp-editorial a { color: var(--jtp-a); font-weight: 600; }

.jtp-faq details { border-top: 1px solid var(--jtp-line); padding-block: 14px; }
.jtp-faq details:last-child { border-bottom: 1px solid var(--jtp-line); }
.jtp-faq summary { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.jtp-faq summary::-webkit-details-marker { display: none; }
.jtp-faq summary::after { content: '+'; font: 700 20px/1 var(--jtp-font-display); color: var(--jtp-a); }
.jtp-faq details[open] summary::after { content: '–'; }
.jtp-faq details p { margin: 10px 0 0; }
.jtp-faq h3 { display: inline; font: inherit; margin: 0; }

.jtp-theme-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.jtp-theme-chips a { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--jtp-line); background: var(--jtp-surface); color: var(--jtp-ink); font-weight: 600; text-decoration: none; }
.jtp-theme-chips a:hover { border-color: var(--jtp-a); color: var(--jtp-a); }

@media (max-width: 860px) {
  .jtp-editorial { grid-template-columns: 1fr; gap: 20px; }
}

/* ==========================================================================
   Profil — débloqué tous les 10 votes
   ========================================================================== */

.jtp-profile {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  width: min(460px, calc(100% - 32px));
  translate: -50% 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: var(--jtp-surface);
  border: 1px solid var(--jtp-line);
  box-shadow: 0 20px 50px -12px rgba(13, 34, 38, .45);
  animation: jtp-rise .45s cubic-bezier(.2, .7, .2, 1);
}

.jtp-profile[hidden] { display: none; }

@keyframes jtp-rise { from { opacity: 0; transform: translateY(24px); } }

.jtp-profile__ring {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(var(--jtp-a) 0 var(--maj, 50%), var(--jtp-b) 0);
}

.jtp-profile__ring span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--jtp-surface);
  font: 800 15px/1 var(--jtp-font-display);
  color: var(--jtp-ink);
}

.jtp-profile__eyebrow { margin: 0; font: 700 11px/1.2 var(--jtp-font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--jtp-muted); }
.jtp-profile__title { margin: 4px 0; font: 800 20px/1.15 var(--jtp-font-display); color: var(--jtp-ink); }
.jtp-profile__text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--jtp-muted); }
.jtp-profile__actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.jtp-profile__actions button { padding: 10px 16px; border-radius: 999px; font: 700 14px/1 var(--jtp-font-body); cursor: pointer; }
.jtp-profile__share { background: var(--jtp-ink); color: var(--jtp-ground); border: 0; }
.jtp-profile__close { background: transparent; color: var(--jtp-ink); border: 1.5px solid var(--jtp-line); }

/* ==========================================================================
   Accessibilité : mouvement réduit
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .jtp-duel *, .jtp-row *, .jtp-profile, .jtp-streak, .jtp-streak__tip, .jtp-cat img, .jtp-next i {
    transition: none !important;
    animation: none !important;
  }
}

/* La série dans la barre : à côté du logo en large, poussée à droite sur mobile. */
.navbar-brand .jtp-streak-wrap { margin-left: var(--space-3); }

@media (max-width: 991px) {
  .navbar-brand { flex: 1; }
  .navbar-brand .jtp-streak-wrap { margin-left: auto; }
  .navbar-brand .jtp-streak-wrap + .navbar-burger { margin-left: var(--space-2); }
  /* Pastille poussée à droite : la bulle s'ouvre vers la gauche. */
  .jtp-streak__tip { left: auto; right: 0; }
  .jtp-streak__tip::before { left: auto; right: 22px; }
}

/* Sur téléphone, « Suivante » prend toute la largeur : c'est l'évidence après le vote. */
@container (max-width: 560px) {
  .jtp-duel__after .jtp-next { flex: 1 1 100%; justify-content: center; }
  .jtp-duel__verdict { font-size: 17px; }
}

.jtp-row__foot a { white-space: nowrap; }

/* L'action « jouer » sur fond encre : le jaune du « OU ». */
.jtp-btn-pop,
.jtp-btn-pop:hover {
  gap: 10px;
  background: var(--jtp-pop);
  color: var(--jtp-pop-ink);
  border: 0;
}

.jtp-btn-pop:hover { filter: brightness(1.05); }
