/*
 * Rarissime : la feuille de style unique du site public, et du jeu de l'accueil.
 * Direction artistique de l'app, « La Foule » (docs/product/da-v2.html) : chaque joueur est un point. Fonds Nuit et
 * Carbone, Braise (orange) pour Le Basique, Indigo nuit pour Le Rare, Point (gris) pour les autres joueurs, Craie pour
 * les actions ; police système, et Doto (police matricielle, réduite aux chiffres) pour les scores. Toujours en sombre.
 * Aucune police externe, aucun attribut style, aucune image matricielle.
 */

/* ---------- Jetons ---------- */
/* Le site n'a qu'un mode, sombre, comme l'app (apps/mobile/src/theme/colors.ts). */
:root {
  --sys: #0d0e12; /* Nuit */
  --card: #17191f; /* Carbone */
  --raised: #22252d;
  --plain: #15171c;
  --label: #ffffff;
  --label2: #a1a1aa;
  --label3: #6b6b74;
  --sep: #2e313a;
  --fill: #22252d;
  --orange: #ff8a4c; /* Braise */
  --indigo: #7d77ff; /* Indigo nuit */
  --dot: #30333d; /* Point */
  --chalk: #f2f3f6; /* Craie */
  --on-accent: #0d0e12;
  --ok: #30d158;
  --danger: #ff6961;
  /* Les variantes « texte » gardent un contraste d'au moins 4,5:1 sur Nuit et sur Carbone. */
  --orange-t: #ff8a4c;
  --indigo-t: #a7a1ff;
  --tint-o: #3a2418;
  --tint-i: #24224a;
  --bar: rgba(13, 14, 18, 0.78);
  --shadow: none;
  --focus: #a7a1ff;

  --f-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --max: 1080px;
  color-scheme: dark;
}

/* Doto Black (Oliver Lalan, SIL Open Font License 1.1, /fonts/Doto-OFL.txt), réduite aux chiffres des scores. */
@font-face {
  font-family: "Doto";
  src: url("/fonts/doto.woff") format("woff");
  font-weight: 900;
  font-display: swap;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--sys);
  color: var(--label);
  font: 17px/1.5 var(--f-text);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--f-display);
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--indigo-t);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--card);
  color: var(--label);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.narrow {
  max-width: calc(720px + 2 * var(--gutter));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- En-tête ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--sep);
}

/* Le retour à la ligne est un filet de sécurité (texte agrandi, police plus large) : à 320 px, tout tient sur une ligne. */
.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  min-height: 56px;
}

.top nav {
  margin-left: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--label);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand svg {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 0 0 0.5px var(--sep);
  flex: none;
}

.top nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top nav a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--label2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.top nav a:hover {
  color: var(--label);
  background: var(--fill);
}

.top nav a[aria-current="page"] {
  color: var(--label);
  font-weight: 600;
}

/* ---------- Boutons ---------- */
.store svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.store > span {
  display: grid;
  gap: 1px;
}

.store small {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

.store b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Sections ---------- */
.section {
  padding: 56px 0;
}

.section + .section {
  padding-top: 0;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 40em;
}

.section-head h2 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.section-head p {
  color: var(--label2);
  font-size: 18px;
}

/* Étapes */
.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border-radius: 22px;
  padding: 20px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow);
  align-content: start;
}

.steps li::before {
  content: counter(step);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--label);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.steps h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.steps p {
  color: var(--label2);
  font-size: 16px;
}

/* ---------- Le jeu (accueil) ---------- */
.game-wrap {
  max-width: calc(960px + 2 * var(--gutter));
}

.muted {
  color: var(--label2);
}

.small {
  font-size: 14px;
}

.game {
  padding: 28px 0 40px;
}

.game-head {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}

.date {
  color: var(--label2);
  font-size: 15px;
  font-weight: 600;
}

.game-head h1 {
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.lede {
  color: var(--label2);
  font-size: 17px;
  max-width: 36em;
  margin-top: 6px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label2);
}

.eyebrow.basique,
.basique .eyebrow,
span.basique,
b.basique {
  color: var(--orange-t);
}

.eyebrow.rare,
span.rare,
b.rare {
  color: var(--indigo-t);
}

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

/* Les tuiles */
.tiles {
  display: grid;
  gap: 14px;
}

.tile {
  display: grid;
  gap: 14px;
  align-content: start;
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  min-width: 0;
}

.tile-rule {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.example {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--raised);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 600;
}

.tile-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
}

.tile-score {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 4px;
  margin: 0;
}

.tile-score .chip {
  align-self: center;
}

.both-played,
.streak {
  margin-top: 14px;
  padding: 0 4px;
  font-size: 15px;
}

.streak {
  color: var(--label);
  font-weight: 600;
}

/* Les chiffres en points (Doto) */
.big-score,
.mid-score {
  font-family: "Doto", var(--f-display);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* L'espace de Doto est très large : « 1 sur 52 » et « 34 % » restent groupés. */
  word-spacing: -0.3em;
}

.big-score {
  font-size: 56px;
  margin: 0;
}

.mid-score {
  font-size: 38px;
}

.big-score.basique,
.mid-score.basique {
  color: var(--orange-t);
}

.big-score.rare,
.mid-score.rare {
  color: var(--indigo-t);
}

/* Les trames de points */
.dots {
  display: block;
  height: auto;
  max-width: 100%;
}

.dots.crowd {
  width: 100%;
  max-width: 352px;
}

.dots.score {
  width: 100%;
  max-width: 340px;
}

.dots.score.short {
  width: auto;
  max-width: 100%;
  height: 34px;
}

.dot.other {
  fill: var(--dot);
}

.dot.basique {
  fill: var(--orange);
}

.dot.rare {
  fill: var(--indigo);
}

.halo {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 1.4;
  opacity: 0.55;
}

/* Puces */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--fill);
  color: var(--label);
  overflow-wrap: anywhere;
}

.chip.small {
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.chip.basique {
  background: var(--tint-o);
  color: var(--orange-t);
}

.chip.rare {
  background: var(--tint-i);
  color: var(--indigo-t);
}

.chip.filled.basique {
  background: var(--orange);
  color: var(--on-accent);
}

.chip.filled.rare {
  background: var(--indigo);
  color: var(--on-accent);
}

.chip.neutral {
  background: var(--fill);
  color: var(--label2);
}

/* Boutons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  color: var(--label);
  background: var(--fill);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.button:hover {
  filter: brightness(1.08);
}

.button:active {
  transform: scale(0.98);
}

.button:disabled,
.button.inert {
  cursor: default;
  opacity: 0.5;
  filter: none;
  transform: none;
}

.button.wide {
  width: 100%;
  min-height: 52px;
}

.button.small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 15px;
}

.button.tint {
  background: var(--chalk);
  color: var(--on-accent);
}

.button.accent.basique {
  background: var(--orange);
  color: var(--on-accent);
}

.button.accent.rare {
  background: var(--indigo);
  color: var(--on-accent);
}

.button.neutral {
  background: var(--fill);
  color: var(--label);
}

.play-icon {
  font-size: 12px;
}

.link-button {
  border: 0;
  background: none;
  padding: 8px 0;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--indigo-t);
  cursor: pointer;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label2);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* Encarts */
.inline-message {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--raised);
  color: var(--label2);
  font-size: 15px;
}

.inline-message .title {
  color: var(--label);
  font-size: 17px;
  font-weight: 600;
}

.inline-message.danger .title,
.inline-message.danger > p:only-of-type {
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 8px;
}

.inline-message .button.neutral {
  background: var(--sep);
}

/* ---------- La partie (dialog) ---------- */
html.modal-open {
  overflow: hidden;
}

.play {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--plain);
  color: var(--label);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.play::backdrop {
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.play-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: max(14px, env(safe-area-inset-top, 0px)) var(--gutter) max(18px, env(safe-area-inset-bottom, 0px));
  gap: 20px;
}

.play-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-top.end {
  justify-content: flex-end;
}

.segments {
  flex: 1;
  display: flex;
  gap: 6px;
}

.segments span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--fill);
}

.basique .segments .done,
.basique .segments .now {
  background: var(--orange);
}

.rare .segments .done,
.rare .segments .now {
  background: var(--indigo);
}

.segments .now {
  opacity: 0.55;
}

.progress {
  color: var(--label2);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.play-question {
  display: grid;
  gap: 8px;
  animation: rise 0.25s ease;
}

.question {
  font-size: clamp(28px, 7vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hint {
  color: var(--label2);
}

.play-form {
  display: grid;
  gap: 8px;
}

.field {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--raised);
  border: 2px solid transparent;
}

.field:focus-within {
  border-color: var(--label3);
}

.basique .field:focus-within {
  border-color: var(--orange);
}

.rare .field:focus-within {
  border-color: var(--indigo);
}

.field.shake {
  animation: shake 0.22s ease;
}

.answer {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: 21px;
  font-weight: 600;
}

.answer::placeholder {
  color: var(--label3);
}

.answer:focus-visible {
  outline: 0;
}

.basique .answer {
  caret-color: var(--orange);
}

.rare .answer {
  caret-color: var(--indigo);
}

.feedback {
  min-height: 22px;
  padding: 0 4px;
  color: var(--label2);
  font-size: 15px;
}

.feedback.ok {
  color: var(--ok);
  font-weight: 600;
}

.play-actions {
  display: grid;
  gap: 8px;
}

/* La fin de partie */
.end-body {
  display: grid;
  gap: 14px;
  align-content: start;
  flex: 1;
}

.end-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.end-title:focus {
  outline: 0;
}

.end-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  animation: rise 0.4s ease 0.1s both;
}

.end-body > .dots {
  animation: fade 0.5s ease 0.25s both;
}

.list {
  margin-top: 8px;
}

.list-head {
  margin: 0 0 6px 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--label2);
}

.list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
}

.list li + li {
  border-top: 0.5px solid var(--sep);
}

.row-main {
  display: grid;
  gap: 1px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-main small {
  color: var(--label2);
  font-size: 13px;
}

.row-main b {
  font-size: 17px;
  font-weight: 600;
}

.list li.unknown .row-main b,
.row-main b.unknown {
  color: var(--label2);
  font-style: italic;
  font-weight: 500;
}

.row-value {
  display: grid;
  justify-items: end;
  flex: none;
  max-width: 45%;
  color: var(--label2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.row-value small {
  color: var(--label3);
  font-size: 12px;
}

.list-foot {
  margin: 6px 16px 0;
  color: var(--label2);
  font-size: 13px;
}

.app-nudge {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin-top: 6px;
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
}

.app-nudge .title {
  font-weight: 700;
}

.app-nudge .store {
  margin-top: 6px;
}

.end-actions {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

/* ---------- Les résultats d'hier ---------- */
.results {
  display: grid;
  gap: 14px;
  margin: 14px 0;
}

.result-card {
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  min-width: 0;
}

.result-card > header {
  display: grid;
  gap: 6px;
  padding: 16px 18px 14px;
}

.result-card h3.eyebrow {
  font-family: var(--f-text);
}

.not-played {
  font-size: 22px;
  font-weight: 700;
}

.q-row {
  border-top: 0.5px solid var(--sep);
}

.q-row summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px 10px 18px;
  cursor: pointer;
  list-style: none;
}

.q-row summary::-webkit-details-marker {
  display: none;
}

.q-row summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.q-row .row-main {
  flex: 1;
}

.chev {
  flex: none;
  color: var(--label3);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.q-row[open] .chev {
  transform: rotate(90deg);
}

.in-review {
  padding: 0 18px 8px;
}

.ranking-wrap {
  display: grid;
  gap: 4px;
  padding: 0 18px 14px;
}

.ranking {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.ranking.collapsed .extra {
  display: none;
}

.rk {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  column-gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 10px;
  font-size: 15px;
}

.rk .n {
  color: var(--label3);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.rk .w {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rk .p {
  color: var(--label2);
  font-variant-numeric: tabular-nums;
}

.rk .bar {
  grid-column: 2 / 4;
  height: 4px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--dot);
  width: var(--w, 2%);
}

.rk.me {
  background: var(--raised);
}

.rk.me .w {
  font-weight: 700;
}

.rk.me.basique .bar {
  background: var(--orange);
}

.rk.me.rare .bar {
  background: var(--indigo);
}

.rk .lbl {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  background: var(--fill);
  color: var(--label);
}

.rk.me.basique .lbl {
  background: var(--orange);
  color: var(--on-accent);
}

.rk.me.rare .lbl {
  background: var(--indigo);
  color: var(--on-accent);
}

/* ---------- L'app (le CTA) ---------- */
.app-card {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 26px 22px;
  border-radius: 28px;
  background: var(--card);
}

.app-card h2 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.perks {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.perks li {
  display: grid;
  gap: 2px;
  padding-left: 22px;
  position: relative;
}

.perks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
}

.perks li:nth-child(2)::before {
  background: var(--indigo);
}

.perks li:nth-child(3)::before {
  background: var(--chalk);
}

.perks span {
  color: var(--label2);
  font-size: 16px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 22px 10px 16px;
  border-radius: 14px;
  background: var(--chalk);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.1;
}

.store.soon {
  background: var(--fill);
  color: var(--label);
}

/* ---------- Les règles ---------- */
.rules {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.rule {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 22px;
  background: var(--card);
}

.rule h3 {
  display: grid;
  gap: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rule p {
  color: var(--label2);
  font-size: 16px;
}

/* ---------- Tes données ---------- */
.data-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--sep);
}

.data-card h2 {
  font-size: 20px;
  font-weight: 700;
}

.data-card p {
  font-size: 15px;
}

.player-id {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes shake {
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-4px);
  }
}

@media (min-width: 640px) {
  .play {
    width: min(560px, calc(100% - 32px));
    height: auto;
    max-height: calc(100% - 64px);
    margin: auto;
    border-radius: 28px;
  }

  .play-inner {
    min-height: 0;
    padding: 20px 24px 24px;
  }

  .tile {
    padding: 22px;
  }

  .app-card {
    padding: 36px 34px;
  }
}

@media (min-width: 760px) {
  .tiles,
  .rules {
    grid-template-columns: 1fr 1fr;
  }

  .game {
    padding-top: 44px;
  }
}

@media (min-width: 960px) {
  .results {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ---------- Pages de texte (confidentialité, support, mentions) ---------- */
.page-head {
  padding: 40px 0 24px;
  display: grid;
  gap: 10px;
}

.page-head h1 {
  font-size: clamp(36px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.page-head p {
  color: var(--label2);
  font-size: 18px;
}

.prose {
  display: grid;
  gap: 16px;
  padding-bottom: 56px;
}

.prose section {
  background: var(--card);
  border-radius: 20px;
  padding: 22px 20px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.prose h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prose h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose p,
.prose li,
.prose dd {
  color: var(--label2);
  font-size: 16px;
  line-height: 1.55;
}

.prose b,
.prose strong {
  color: var(--label);
  font-weight: 600;
}

.prose ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.prose dl {
  margin: 0;
  display: grid;
  gap: 0;
}

.prose dl div {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-top: 0.5px solid var(--sep);
}

.prose dl div:first-child {
  border-top: 0;
  padding-top: 0;
}

.prose dt {
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}

.prose dd {
  margin: 0;
}

.prose a {
  word-break: break-word;
}

.updated {
  font-size: 14px;
  color: var(--label2);
}

/* FAQ */
.faq {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.prose .faq-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--label2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 12px 0 -8px 20px;
  font-family: var(--f-text);
}

.faq details + details {
  border-top: 0.5px solid var(--sep);
  margin-left: 20px;
}

.faq details + details summary {
  padding-left: 0;
}

.faq details + details .answer {
  padding-left: 0;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  min-height: 52px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2.2px solid var(--label3);
  border-bottom: 2.2px solid var(--label3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.faq summary:focus-visible {
  outline-offset: -3px;
}

.faq .answer {
  padding: 0 20px 18px;
  display: grid;
  gap: 10px;
}

.faq .answer p,
.faq .answer li {
  color: var(--label2);
  font-size: 16px;
}

.faq .answer b {
  color: var(--label);
  font-weight: 600;
}

.faq .answer ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.contact {
  background: var(--card);
  border-radius: 20px;
  padding: 22px 20px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
  justify-items: start;
}

.contact h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact p,
.contact li {
  color: var(--label2);
  font-size: 16px;
}

.contact ul {
  margin: 0;
  padding-left: 20px;
}

.mail {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--indigo);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}

.mail:hover {
  filter: brightness(1.06);
}

/* 404 */
.lost {
  min-height: calc(100svh - 56px - 160px);
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 16px;
  padding: 56px 0;
}

.lost .big {
  color: var(--label);
  font-family: var(--f-display);
  font-size: clamp(72px, 22vw, 140px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.lost .big .o {
  color: var(--orange);
}

.lost .big .i {
  color: var(--indigo);
}

.lost h1 {
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lost p {
  color: var(--label2);
  max-width: 26em;
}

.back-home {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 14px;
  background: var(--label);
  color: var(--sys);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Pied de page ---------- */
.footer {
  border-top: 0.5px solid var(--sep);
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  font-size: 14px;
  color: var(--label2);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a {
  color: var(--label2);
  text-decoration: none;
  display: inline-block;
  padding: 6px 0;
}

.footer a:hover {
  color: var(--label);
  text-decoration: underline;
}

/* ---------- Grands écrans ---------- */
@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .prose section,
  .contact {
    padding: 26px 28px;
  }
}

/* Petits écrans (iPhone SE de 1re génération, 320 px) : la marque et « Confidentialité » tiennent dans la gouttière. */
@media (max-width: 380px) {
  .top .wrap {
    column-gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand svg {
    width: 28px;
    height: 28px;
  }

  .brand span {
    font-size: 16px;
  }

  .top nav ul {
    gap: 0;
  }

  .top nav a {
    padding: 8px 4px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .top,
  .footer,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose section {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
