/*
  Miette : la page est fabriquée comme l'interface du jeu. Des autocollants plats sur le parquet,
  cartes crème au trait d'encre, ombre portée fixe vers le bas à droite, sans dégradé ni relief.
  Le cyan est réservé à Miette (et au bouton principal, comme en jeu). Texte en SF heavy,
  chiffres en SF Rounded. Images dessinées par le moteur du jeu (tools/flat, mode « site »).
*/
:root {
  --cream: #f6eedc;
  --cream-deep: #e9d3a6;
  --ink: #2a2230;
  --ink-soft: #5d5466;
  --night: #4a3f55;
  --cyan: #22c3e6;
  --cyan-shade: #1690b0;
  --wood: #d9a066;
  /* couleurs des stats, comme dans le jeu (StatKind.fam, teinte d'ombre pour le texte) */
  --hp: #b33a3a;
  --atk: #c0652a;
  --def: #3a62a8;
  --agi: #3e8e4c;
  --spd: #c99a2e;
  --line: 3px;
  --drop: 7px 9px 0 rgba(42, 34, 48, 0.22);
  --text: -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 500 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--cyan-shade); }
:focus-visible { outline: 3px solid var(--cyan-shade); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }

h1, h2, h3, .logo { font-weight: 900; letter-spacing: -0.02em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); margin: 0 0 clamp(20px, 3vw, 36px); }

/* En-tête : une pastille crème posée sur la page, comme le HUD. */
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  border-bottom: var(--line) solid var(--ink);
  background: var(--cream);
}
.logo { font-size: 1.6rem; text-decoration: none; }
.logo::before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin: -0.3em 0.35em -0.3em 0;
  vertical-align: middle;
  background: url("miette.png") center / contain no-repeat;
}
.top nav { display: flex; gap: 4px 20px; flex-wrap: wrap; font-weight: 800; }
.top nav a { text-decoration: none; padding: 10px 0; }
.top nav a:hover, .top nav a[aria-current] {
  text-decoration: underline var(--cyan);
  text-decoration-thickness: 4px;
  text-underline-offset: 0.4em;
}
@media (max-width: 560px) {
  .top { gap: 0 14px; }
  .logo { font-size: 1.35rem; }
  .top nav { gap: 0 14px; font-size: 0.95rem; }
}

/* Boutons : capsule au trait d'encre, ombre fixe. Le bouton App Store est cyan, comme « Jouer » en jeu. */
.store, .prose .button {
  display: inline-block;
  margin: 0;
  padding: 0.8rem 1.4rem;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--cyan);
  color: var(--ink);
  font: 900 1.15rem/1.2 var(--text);
  text-decoration: none;
  box-shadow: 4px 5px 0 var(--ink);
  transition: translate 120ms ease-out, box-shadow 120ms ease-out;
}
.store:hover, .prose .button:hover { translate: 2px 3px; box-shadow: 2px 2px 0 var(--ink); }
.store.soon { background: var(--cream); box-shadow: none; translate: none; }
/* Les deux stores côte à côte ; Google Play en crème pour ne pas doubler le cyan. */
.stores { display: flex; flex-wrap: wrap; justify-content: inherit; gap: 12px 14px; margin: 0; }
.stores .store { padding: 0.7rem 1.1rem; font-size: 1rem; white-space: nowrap; }
.stores .store + .store { background: var(--cream); }

/* Scène d'ouverture : le parquet du jeu, vu de dessus ; la carte du titre posée dessus comme un panneau. */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 34rem) 1fr;
  align-items: center;
  min-height: min(82vh, 760px);
  padding: clamp(28px, 6vw, 88px) var(--gutter);
  background: var(--wood) url("scene.png") center / cover no-repeat;
  border-bottom: var(--line) solid var(--ink);
  overflow: hidden;
}
.card {
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--drop);
}
.stage .card { padding: clamp(22px, 4vw, 40px); }
.title { margin: 0; font-size: clamp(3.4rem, 1.8rem + 7vw, 7rem); line-height: 0.9; }
.pitch { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); margin: 1.1rem 0 1.5rem; }
.stage .note { margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; align-items: end; min-height: 0; padding-top: 64vw; background-position: 72% top; background-size: 150% auto; }
}

/* L'absorption : chaque insecte, ce qu'il laisse. Les pastilles reprennent les couleurs des stats. */
.absorb { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.absorb > p { max-width: 36em; font-size: 1.15rem; margin: 0 0 clamp(28px, 4vw, 48px); }
.bugs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 860px) { .bugs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
.bugs li { padding: 18px 18px 22px; text-align: center; }
.bugs img { width: min(150px, 80%); display: block; margin: -6px auto 4px; transition: rotate 220ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.bugs li:nth-child(odd) img { rotate: -6deg; }
.bugs li:nth-child(even) img { rotate: 5deg; }
.bugs li:hover img { rotate: 0deg; }
.bugs h3 { font-size: 1.4rem; margin: 0 0 0.6rem; }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 2.5px solid currentColor;
  border-radius: 999px;
  font: 800 0.95rem/1.4 var(--round);
  background: var(--cream);
}
.chip.hp { color: var(--hp); }
.chip.atk { color: var(--atk); }
.chip.def { color: var(--def); }
.chip.agi { color: var(--agi); }
.chip.spd { color: var(--spd); }

/* Une run : trois étapes numérotées, sur le fond de nuit du jeu. */
.loop { padding: clamp(56px, 8vw, 112px) var(--gutter); background: var(--night); color: var(--cream); border-block: var(--line) solid var(--ink); }
.loop ol { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); margin: 0; padding: 0; }
.loop li { counter-increment: step; }
.loop li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 1rem;
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font: 900 1.6rem/1 var(--round);
  box-shadow: 4px 5px 0 var(--ink);
}
.loop h3 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.loop p { margin: 0; color: #e6dccb; max-width: 26em; }
@media (max-width: 760px) { .loop ol { grid-template-columns: 1fr; } }

/* Captures : trois écrans du jeu, posés comme des autocollants. */
.shots { padding: clamp(56px, 8vw, 112px) var(--gutter) clamp(40px, 6vw, 80px); overflow: hidden; }
.shots ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); align-items: start; }
.shots li { margin: 0; }
.shots img { display: block; width: 100%; border: var(--line) solid var(--ink); border-radius: 28px; box-shadow: var(--drop); }
.shots li:nth-child(1) { rotate: -2deg; }
.shots li:nth-child(2) { rotate: 1.5deg; translate: 0 28px; }
.shots li:nth-child(3) { rotate: -1deg; }
.shots p { margin: 0.9rem 0 0; text-align: center; font-weight: 800; }
@media (max-width: 760px) {
  .shots ul { grid-template-columns: repeat(3, 72%); overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 24px; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .shots li { scroll-snap-align: center; }
  .shots li:nth-child(2) { translate: 0 0; }
}

/* La maison : Miette équipée de pièces d'insectes, et ce que contient le jeu. */
.house {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(56px, 8vw, 112px) var(--gutter);
  background: var(--cream-deep);
  border-block: var(--line) solid var(--ink);
}
.house > img { width: min(420px, 100%); justify-self: center; rotate: 4deg; }
.house > div > p { max-width: 34em; font-size: 1.12rem; margin: 0 0 1.4rem; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.facts li { padding: 0.8rem 1rem; font-weight: 700; line-height: 1.35; }
.facts strong { display: block; font: 900 1.6rem/1.1 var(--round); }
@media (max-width: 760px) {
  .house { grid-template-columns: 1fr; }
  .house > img { width: min(260px, 70%); }
}
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } }

/* L'achat : la règle du jeu, dite simplement, et ce qu'il n'y a pas. */
.deal { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.deal > p { max-width: 36em; font-size: 1.15rem; margin: 0 0 1.6rem; }
.nope { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 14px; }
.nope li { padding: 0.55rem 1.1rem; border-radius: 999px; font-weight: 800; }
.nope li:nth-child(odd) { rotate: -1.5deg; }
.nope li:nth-child(even) { rotate: 1.2deg; }

.last {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(40px, 6vw, 88px) var(--gutter);
}
.last img { width: clamp(140px, 20vw, 220px); flex: none; rotate: -6deg; }
.last h2 { margin: 0 0 0.3rem; }
.last p { margin: 0 0 1.4rem; font-size: 1.15rem; }
@media (max-width: 560px) { .last { flex-direction: column; align-items: flex-start; } }

/* Pages longues : en-tête sur le parquet, puis une carte crème de lecture. */
.doc-head {
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(28px, 4vw, 48px);
  background: var(--wood) url("scene.png") center 40% / cover no-repeat;
  border-bottom: var(--line) solid var(--ink);
}
.doc-head h1 {
  display: inline-block;
  margin: 0;
  padding: 0.35em 0.6em 0.4em;
  font-size: clamp(2.2rem, 1.3rem + 4vw, 4.6rem);
  line-height: 0.95;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--drop);
  max-width: 100%;
}
.updated { display: table; margin: 0.9rem 0 0; padding: 0.2rem 0.8rem; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--cream); font-weight: 700; font-size: 0.95rem; }
.reading {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 40rem);
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 56px) var(--gutter) clamp(56px, 8vw, 112px);
}
.toc { position: sticky; top: 20px; align-self: start; }
.toc > p { margin: 0 0 0.6rem; font-weight: 900; font-size: 1.1rem; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: var(--line) solid var(--ink); }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.toc a:hover { color: var(--ink); box-shadow: inset 4px 0 0 var(--cyan); }
@media (max-width: 860px) {
  .reading { grid-template-columns: 1fr; }
  .toc { position: static; }
}
.prose { font-size: 1.08rem; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose .lede { font-size: 1.28rem; line-height: 1.5; font-weight: 700; }
.prose h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin: 2.8rem 0 0.7rem; scroll-margin-top: 20px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--cyan-shade); }
.prose strong { font-weight: 800; }
.prose a { text-decoration-color: var(--cyan); }
.prose .hint { color: var(--ink-soft); font-size: 0.98rem; }
.prose .contact { margin: 1.8rem 0 0.8rem; }
.prose kbd { font: 800 0.9em var(--round); padding: 0 0.4em; border: 2px solid var(--ink); border-radius: 6px; background: #fff8ea; }

/* Pied de page : l'encre referme la page ; une fourmi passe la tête par-dessus. */
.bottom {
  position: relative;
  margin-top: 64px;
  padding: 56px var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--cream);
}
.bottom::before {
  content: "";
  position: absolute;
  right: 10%;
  top: -64px;
  width: 104px;
  height: 104px;
  rotate: 12deg;
  background: url("bug-fourmi.png") center / contain no-repeat;
}
.bottom nav { display: flex; flex-wrap: wrap; gap: 6px 32px; font: 900 1.3rem/1.3 var(--text); }
.bottom nav a { text-decoration: none; padding: 6px 0; }
.bottom nav a:hover { color: var(--cyan); }
.bottom p { margin: 1.4rem 0 0; color: #c9bfd2; font-size: 0.92rem; }
/* Menu des langues : un <details> dont la liste flotte par-dessus la page, sans rien décaler. */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu .globe { flex: none; }
.lang-menu .chevron { flex: none; transition: transform 0.15s ease; }
.lang-menu[open] .chevron { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--drop);
}
.top nav .lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.top nav .lang-menu a:hover { background: var(--cream-deep); text-decoration: none; }
.top nav .lang-menu a[aria-current] { font-weight: 800; text-decoration: none; }
.lang-menu .check { flex: none; color: var(--cyan-shade); }
/* Sur téléphone, le menu passe à la ligne sous le logo : la liste s'aligne sur la marge droite de
   l'en-tête, pour ne jamais dépasser de l'écran. */
@media (max-width: 560px) {
  .top { position: relative; }
  .lang-menu { position: static; }
  .lang-menu ul { top: calc(100% - 8px); right: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  .lang-menu .chevron { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bugs img, .store, .prose .button { transition: none; }
}

/* Titres d'un seul long mot (« Datenschutzerklärung ») : coupés avec un trait d'union plutôt que de dépasser de l'écran. */
.doc-head h1 { hyphens: auto; overflow-wrap: break-word; }
