/* Pimoo Pixel : feuille de style unique. Charte PIMOO : corail, ambre, canard sur creme, trait brun. */

@font-face {
  font-family: 'Fredoka';
  src: url('/polices/fredoka.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/polices/nunito.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --corail: #f58a5e;
  --corail-fonce: #b4532c;
  --ambre: #e0aa38;
  --canard: #27889b;
  --canard-fonce: #1b6372;
  --creme: #fff8f3;
  --brume: #f3ebe4;
  --encre: #2c2320;
  --trait: #5a4034;
  --doux: #6e5a50;
  --succes: #2f7d4f;
  --alerte: #b03a2e;
  --rayon: 18px;
  --ombre: 0 3px 0 var(--trait);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --haut-entete: 60px;
  --haut-onglets: 64px;
  color-scheme: light;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--creme);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--creme);
  overscroll-behavior: none;
}

h1,
h2,
h3 {
  font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.1rem;
}
h2 small {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--doux);
}
p {
  margin: 0 0 0.75em;
}
a {
  color: var(--canard-fonce);
  font-weight: 700;
}
img {
  max-width: 100%;
  height: auto;
}
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--canard);
  outline-offset: 2px;
}

button,
a,
[role='button'],
[role='tab'],
[role='radio'],
summary {
  touch-action: manipulation;
}
button,
.bouton,
.onglets a,
[role='tab'],
[role='radio'],
summary {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  color: var(--encre);
}

.evitement {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--encre);
  color: var(--creme);
  border-radius: 10px;
}
.evitement:focus {
  top: 8px;
}

/* ------------------------------------------------------------ boutons */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2.5px solid var(--trait);
  border-radius: 999px;
  background: #fff;
  color: var(--encre);
  font: 700 1rem/1.1 'Nunito', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--ombre);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.bouton:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 1px 0 var(--trait);
}
.bouton.accent {
  background: var(--corail);
  color: var(--encre);
}
.bouton.petit {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 0.9375rem;
}
.bouton.grand {
  min-height: 56px;
  padding: 14px 28px;
  font-size: 1.125rem;
}
.bouton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bouton-icone,
.bouton-rond {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2.5px solid var(--trait);
  border-radius: 50%;
  background: #fff;
  color: var(--encre);
  font: 700 1.5rem/1 'Fredoka', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: var(--ombre);
  transition: transform 140ms var(--ease-out);
}
.bouton-icone:active,
.bouton-rond:active {
  transform: scale(0.94);
}
.bouton-rond[aria-pressed='true'],
.bouton-rond[aria-expanded='true'] {
  background: var(--canard);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .bouton:hover {
    background: var(--brume);
  }
  .bouton.accent:hover {
    background: #f79c76;
  }
  .bouton-rond:hover,
  .bouton-icone:hover {
    background: var(--brume);
  }
  .bouton-rond[aria-pressed='true']:hover,
  .bouton-rond[aria-expanded='true']:hover {
    background: var(--canard-fonce);
  }
  .onglets a:hover {
    color: var(--encre);
  }
  [role='tab']:hover {
    background: var(--brume);
  }
  .case-album:hover {
    transform: translateY(-2px);
  }
}

/* ------------------------------------------------------------- entete */

.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--haut-entete) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  background: var(--creme);
  border-bottom: 2.5px solid var(--trait);
}
.marque {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--encre);
  text-decoration: none;
  font: 600 1.15rem/1 'Fredoka', system-ui, sans-serif;
}
.marque img {
  height: 28px;
  width: auto;
  border-radius: 10px;
}
.ressources {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  font-size: 0.9375rem;
}
.jauge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}
.jauge b {
  font: 600 1.125rem/1 'Fredoka', system-ui, sans-serif;
}
.jauge .reserve {
  color: var(--canard-fonce);
  font-weight: 800;
}
.pastille-balle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--corail);
  border: 2px solid var(--trait);
}
.minuteur {
  color: var(--doux);
  font-size: 0.875rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .minuteur {
    display: none;
  }
}

/* ------------------------------------------------------------- ecrans */

main {
  outline: none;
}
.ecran {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(var(--haut-onglets) + 32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.chapo {
  font-size: 1.0625rem;
  color: var(--doux);
}
.note {
  font-size: 0.875rem;
  color: var(--doux);
}
.chargement {
  color: var(--doux);
  text-align: center;
  padding: 40px 0;
}
.erreur {
  color: var(--alerte);
  font-weight: 700;
  min-height: 1.5em;
  margin: 6px 0 0;
}

.carte {
  background: #fff;
  border: 2.5px solid var(--trait);
  border-radius: var(--rayon);
  padding: 18px;
  margin: 0 0 16px;
  box-shadow: var(--ombre);
}
.carte.vide {
  text-align: center;
}
.carte.vide img {
  display: block;
  margin: 0 auto 8px;
}

.etiquette {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brume);
  font-size: 0.875rem;
  font-weight: 700;
}

ul.simple,
ol.etapes {
  margin: 0;
  padding-left: 1.2em;
}
ul.simple li,
ol.etapes li {
  margin-bottom: 8px;
}

.liens {
  text-align: center;
}

/* accueil */
.heros {
  display: grid;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.heros .mascotte {
  justify-self: center;
  width: min(220px, 55vw);
}
.surtitre {
  margin: 0;
  font: 700 0.875rem/1 'Nunito', system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--corail-fonce);
}
.stats-direct b {
  font: 600 1.25rem/1 'Fredoka', system-ui, sans-serif;
}
@media (min-width: 640px) {
  .heros {
    grid-template-columns: 220px 1fr;
  }
}

.formulaire label {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}
.formulaire .ligne {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.formulaire input {
  flex: 1 1 180px;
  min-height: 48px;
  padding: 10px 14px;
  border: 2.5px solid var(--trait);
  border-radius: 14px;
  background: var(--creme);
}
details.carte summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}
details.carte[open] summary {
  margin-bottom: 12px;
}

/* barres de progression */
.barre {
  position: relative;
  height: 14px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: var(--brume);
  overflow: hidden;
}
.remplissage {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: var(--corail);
  transition: transform 400ms var(--ease-out);
}
.palier {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--trait);
  opacity: 0.45;
}
.palier.atteint {
  background: var(--canard-fonce);
  opacity: 1;
}

/* missions */
.missions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.mission-tete,
.mission-pied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mission-tete {
  margin-bottom: 6px;
}
.mission-tete span {
  font-variant-numeric: tabular-nums;
  color: var(--doux);
  font-weight: 700;
}
.mission-pied {
  margin-top: 8px;
  font-size: 0.9375rem;
}
.mission.finie .remplissage {
  background: var(--canard);
}

/* onglets internes (classements) */
.onglets-internes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 2px 2px 12px;
  margin: 0 -2px 4px;
}
[role='tab'] {
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: #fff;
  color: var(--encre);
  font: 700 0.9375rem/1 'Nunito', system-ui, sans-serif;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
[role='tab']:active {
  transform: scale(0.97);
}
[role='tab'][aria-selected='true'] {
  background: var(--encre);
  color: var(--creme);
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tableau th,
.tableau td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1.5px solid var(--brume);
}
.tableau th:last-child,
.tableau td:last-child {
  text-align: right;
}
.tableau td:first-child {
  width: 3.5em;
  font-weight: 800;
}
.tableau tr.moi td {
  background: #fde6dc;
  font-weight: 800;
}

/* evenements */
.evenements {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.evenement {
  padding: 14px;
  border-radius: 14px;
  border: 2px solid var(--trait);
  background: var(--creme);
}
.evenement .barre {
  margin: 8px 0 4px;
}

/* saisons */
.saisons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.saisons .carte img {
  float: right;
  margin-left: 12px;
}

/* profil */
.profil-tete h1 {
  margin-bottom: 4px;
}
.titre-joueur {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--ambre);
  font-weight: 800;
}
.profil-tete .barre {
  margin-bottom: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.stat {
  display: grid;
  padding: 10px;
  border-radius: 14px;
  background: var(--brume);
}
.stat b {
  font: 600 1.4rem/1.1 'Fredoka', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 0.875rem;
  color: var(--doux);
}
.badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.badges li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 2px solid var(--trait);
  border-radius: 14px;
  font-size: 0.875rem;
}
.badges li b {
  font-size: 1rem;
}
.badges .obtenu {
  background: #fbefd2;
}
.badges .verrouille {
  border-style: dashed;
  color: var(--doux);
  background: var(--creme);
}

.reglage {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  flex-wrap: wrap;
}
.reglage input[type='checkbox'] {
  width: 24px;
  height: 24px;
  accent-color: var(--canard);
}
.reglage input[type='range'] {
  flex: 1 1 160px;
  min-height: 44px;
  accent-color: var(--corail);
}
.reglage select {
  min-height: 44px;
  padding: 6px 10px;
  border: 2px solid var(--trait);
  border-radius: 12px;
  background: #fff;
}

/* ---------------------------------------------------------- la machine */

body[data-ecran='jeu'] {
  overflow: hidden;
}
.ecran-jeu {
  position: fixed;
  inset: 0;
  max-width: none;
  padding: 0;
  margin: 0;
  background: var(--brume);
  overflow: hidden;
}
#toile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.hud-haut {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.bouton-album,
.fermer-album {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 6px;
  border: 2.5px solid var(--trait);
  border-radius: 50%;
  background: var(--creme);
  color: var(--encre);
  box-shadow: var(--ombre);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 140ms var(--ease-out);
}
.bouton-album {
  grid-column: 4;
}

/* Retour a PIMOO : le logo que l'enfant connait, pas un mot a lire. */
.bouton-pimoo {
  grid-column: 3;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2.5px solid var(--trait);
  border-radius: 50%;
  background: var(--creme);
  box-shadow: var(--ombre);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  transition: transform 140ms var(--ease-out);
}
.bouton-pimoo img {
  /* Le logo est large (trois pour un) : un carre l'ecrasait. */
  width: 50px;
  height: auto;
}
.bouton-pimoo:active {
  transform: scale(0.95);
}
.voile-carte .bouton-pimoo {
  grid-column: auto;
}
.bouton-album svg {
  width: 42px;
  height: 42px;
}
.bouton-album:active,
.fermer-album:active {
  transform: scale(0.95);
}
.bouton-album.gagne {
  animation: gagne 360ms var(--ease-out);
}

/* L'album : une grande grille d'images, sans un mot. */
.album {
  z-index: 6;
  background: rgb(243 235 228 / 0.97);
  overscroll-behavior: contain;
  overflow-y: auto;
}
.album .voile-carte {
  position: relative;
  width: min(100%, 640px);
  padding-top: 64px;
}
.fermer-album {
  position: absolute;
  top: 0;
  right: 0;
}
.fermer-album svg {
  width: 28px;
  height: 28px;
}
.album-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 14px;
  width: 100%;
}
.case-album {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 8px;
  border: 3px dashed rgb(90 64 52 / 0.35);
  border-radius: 22px;
  background: rgb(255 248 243 / 0.6);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 140ms var(--ease-out);
}
.case-album img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Figurine pas encore trouvee : on ne voit que sa silhouette. */
  filter: brightness(0);
  opacity: 0.16;
}
.case-album.obtenue {
  border: 3px solid var(--trait);
  background: var(--creme);
  box-shadow: var(--ombre);
}
.case-album.obtenue img {
  filter: none;
  opacity: 1;
}
.case-album b {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 34px;
  padding: 2px 8px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: var(--ambre);
  font: 600 1rem/1.2 'Fredoka', system-ui, sans-serif;
}
/* Les gros lots, en tete de l'album, dans un cadre dore. */
.case-album.exceptionnel {
  border-color: rgb(224 170 56 / 0.6);
}
.case-album.exceptionnel.obtenue {
  border-color: var(--trait);
  background: radial-gradient(circle at 50% 40%, #fff1c9, var(--ambre));
}
.case-album:active {
  transform: scale(0.97);
}
.case-album.gagne {
  animation: gagne 360ms var(--ease-out);
}

/* La figurine gagnee traverse l'ecran jusqu'a l'album. */
.trophee {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 8;
  width: 160px;
  height: 160px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 0 rgb(90 64 52 / 0.35));
  will-change: transform, opacity;
}
.trophee.nouvelle {
  filter: drop-shadow(0 0 18px rgb(255 233 168 / 0.95)) drop-shadow(0 6px 0 rgb(90 64 52 / 0.35));
}

/* Collection dans le coin des parents. */
.collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.collection li {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px;
  border: 2px solid var(--brume);
  border-radius: 14px;
  text-align: center;
}
.collection li.exceptionnel {
  border-color: var(--ambre);
}
.collection img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.collection .manquante img {
  filter: brightness(0);
  opacity: 0.16;
}
.collection .manquante b {
  color: var(--doux);
  font-weight: 600;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ----------------------------------------------------- barre d'onglets */

.onglets {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: calc(var(--haut-onglets) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--creme);
  border-top: 2.5px solid var(--trait);
}
.onglets a {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  color: var(--doux);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  transition: transform 120ms var(--ease-out);
}
.onglets a:active {
  transform: scale(0.94);
}
.onglets svg {
  width: 26px;
  height: 26px;
}
.onglets a[aria-current='page'] {
  color: var(--corail-fonce);
}
.pastille {
  position: absolute;
  top: 8px;
  left: calc(50% + 8px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--corail);
  border: 2px solid var(--trait);
}
@media (max-width: 360px) {
  .onglets span {
    font-size: 0.6875rem;
  }
}

/* ---------------------------------------------- annonces et fenetre */

.annonces {
  position: fixed;
  left: 50%;
  top: calc(var(--haut-entete) + env(safe-area-inset-top, 0px) + 96px);
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100% - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}
.annonce {
  padding: 10px 16px;
  border: 2px solid var(--trait);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ombre);
  font-weight: 700;
  text-align: center;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  @starting-style {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
}
.annonce.sortie {
  opacity: 0;
  transform: translateY(-6px);
}
.annonce-succes {
  background: #e3f3e9;
}
.annonce-alerte {
  background: #fde6dc;
}

.fenetre {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 48px);
  padding: 24px 20px 20px;
  border: 2.5px solid var(--trait);
  border-radius: 22px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 4px 0 var(--trait);
  overscroll-behavior: contain;
  opacity: 1;
  transform: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.fenetre:not([open]) {
  opacity: 0;
  transform: scale(0.96);
}
@starting-style {
  .fenetre[open] {
    opacity: 0;
    transform: scale(0.96);
  }
}
.fenetre::backdrop {
  background: rgb(44 35 32 / 0.45);
}
.fenetre .fermer {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--encre);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.fenetre .bouton {
  margin: 6px 6px 0 0;
}
.code {
  display: block;
  margin: 12px 0;
  padding: 12px;
  border: 2px dashed var(--trait);
  border-radius: 12px;
  background: #fff;
  font: 700 1rem/1.4 ui-monospace, Consolas, monospace;
  word-break: break-all;
  user-select: all;
}
.bilan img {
  display: block;
  margin: 0 auto 8px;
}
.podium {
  padding-left: 1.4em;
}

/* --------------------------------------------------------- hors ligne */

body.hors-ligne .entete::after {
  content: 'Connexion perdue, on réessaie…';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 6px;
  padding: 4px 12px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: var(--ambre);
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
}

/* ------------------------------------------------------- mode petits */

body:not(.parents) .parents-seulement {
  display: none;
}

.stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 2.5px solid var(--trait);
  border-radius: 999px;
  background: var(--creme);
  box-shadow: var(--ombre);
  pointer-events: auto;
}
.stock-piece {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.stock-piece i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--trait);
  background: radial-gradient(circle at 34% 30%, #fff1c9 0 18%, var(--ambre) 19% 62%, #a87510 63%);
}
.stock b {
  min-width: 2ch;
  font: 600 1.75rem/1 'Fredoka', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.stock.vide b {
  color: var(--alerte);
}
.stock.gagne {
  animation: gagne 360ms var(--ease-out);
}
@keyframes gagne {
  40% {
    transform: scale(1.12);
  }
}


.coin-parents {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2.5px solid var(--trait);
  border-radius: 50%;
  background: var(--creme);
  color: var(--doux);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 140ms var(--ease-out);
}
.coin-parents:active {
  transform: scale(0.95);
}
.coin-parents .anneau {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  transform: rotate(-90deg);
}
.coin-parents .anneau circle {
  fill: none;
  stroke: var(--canard);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 200ms var(--ease-out);
}
.coin-parents.appui .anneau circle {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1500ms linear;
}

.reaction {
  position: absolute;
  left: max(8px, env(safe-area-inset-left, 0px));
  bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 104px);
  z-index: 3;
  width: auto;
  height: 120px;
  pointer-events: none;
  transform-origin: bottom center;
  animation: reaction 1600ms var(--ease-out) both;
}
@keyframes reaction {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
  18%,
  80% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

.voile {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(255 248 243 / 0.92);
  animation: apparait 240ms var(--ease-out) both;
}
@keyframes apparait {
  from {
    opacity: 0;
  }
}
.reassort {
  background: rgb(44 35 32 / 0.45);
}
.reassort-carte {
  gap: 12px;
  padding: 20px 28px 24px;
  border: 4px solid var(--trait);
  border-radius: 28px;
  background: var(--creme);
  box-shadow: 0 8px 0 var(--trait);
}
.reassort-carte > img {
  max-height: 18dvh;
}
.reassort-texte {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--corail-fonce);
}
.reassort-lots {
  display: flex;
  gap: 10px;
  min-height: 64px;
}
.reassort-lots img {
  width: auto;
  height: 64px;
  animation: lot-pose 900ms var(--ease-out) both;
}
.reassort-lots img:nth-child(2) {
  animation-delay: 700ms;
}
.reassort-lots img:nth-child(3) {
  animation-delay: 1400ms;
}
@keyframes lot-pose {
  from {
    opacity: 0;
    transform: translateY(-36px) scale(0.9);
  }
}
.reassort-barre {
  width: min(240px, 60vw);
  height: 16px;
  overflow: hidden;
  border: 3px solid var(--trait);
  border-radius: 999px;
  background: var(--brume);
}
.reassort-barre span {
  display: block;
  height: 100%;
  background: var(--ambre);
  transform-origin: left;
  transform: scaleX(0);
}
@media (prefers-reduced-motion: reduce) {
  .reassort-lots img {
    animation: none;
  }
}
.voile-carte {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}
.voile-carte img {
  width: auto;
  max-height: 32dvh;
}
.titre-jeu {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--corail-fonce);
}
.retour-pieces {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--encre);
}
.horloge {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.fond-horloge {
  fill: var(--creme);
  stroke: var(--brume);
  stroke-width: 12;
}
.aiguille {
  fill: none;
  stroke: var(--canard);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset 1000ms linear;
}
.piece-horloge {
  fill: var(--ambre);
  stroke: var(--trait);
  stroke-width: 3;
}
.bouton-jouer {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  padding: 0;
  border: 4px solid var(--trait);
  border-radius: 50%;
  background: var(--corail);
  color: var(--creme);
  box-shadow: 0 6px 0 var(--trait);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
  animation: invite 1600ms ease-in-out infinite;
}
.bouton-jouer svg {
  width: 64px;
  height: 64px;
  margin-left: 8px;
}
.bouton-jouer:active {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 var(--trait);
  animation: none;
}
@keyframes invite {
  50% {
    transform: scale(1.05);
  }
}

.hud-gauche {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
/* Les autres enfants autour de la machine : des petites tetes, et leur nombre. */
.joueurs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px 4px 6px;
  border: 2.5px solid var(--trait);
  border-radius: 999px;
  background: var(--creme);
  box-shadow: var(--ombre);
}
/* Une tete de Pimoo sur une pastille de la couleur des pieces du joueur (moi : or). */
.tete {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin-right: -6px;
  border: 2.5px solid var(--couleur-bord, var(--trait));
  border-radius: 50%;
  background: var(--couleur, var(--creme));
}
.tete img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.joueurs .tete.moi {
  width: 38px;
  height: 38px;
  margin-right: 0;
  box-shadow: 0 0 0 3px var(--creme), 0 0 0 5px var(--ambre);
}

/* Le fil des gains des autres enfants : une tete en couleur et ce qu'il a gagne. */
.gains-autres {
  position: absolute;
  z-index: 2;
  top: calc(max(10px, env(safe-area-inset-top, 0px)) + 78px);
  left: max(12px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.gains-autres li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 2px solid var(--trait);
  border-radius: 999px;
  background: rgba(255, 248, 243, 0.94);
  box-shadow: 0 2px 0 var(--trait);
  transform-origin: left center;
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}
@starting-style {
  .gains-autres li {
    opacity: 0;
    transform: translateX(-16px) scale(0.95);
  }
}
.gains-autres li.gros {
  border-color: var(--ambre);
  box-shadow: 0 2px 0 var(--trait), 0 0 14px rgba(224, 170, 56, 0.55);
}
.gains-autres li.sortie {
  opacity: 0;
  transform: translateX(-12px) scale(0.97);
}
.gains-autres .tete {
  margin-right: 0;
}
.gains-autres .lot {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.gain-pieces {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gain-pieces b {
  font: 600 1.15rem/1 'Fredoka', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.mini-piece {
  width: 20px;
  height: 14px;
  border: 2px solid var(--couleur-bord, var(--trait));
  border-radius: 50%;
  background: var(--couleur, var(--ambre));
}

/* L'avancee de la collection : un anneau autour de l'album (figurines) et six points (gros lots). */
.bouton-album {
  position: relative;
}
.bouton-album::before {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(var(--ambre) calc(var(--avance, 0) * 1turn), rgba(90, 64, 52, 0.18) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  transition: background 400ms var(--ease-out);
}
.avance-gros {
  position: absolute;
  left: 50%;
  bottom: -22px;
  display: flex;
  gap: 3px;
  transform: translateX(-50%);
}
.avance-gros i {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--trait);
  border-radius: 50%;
  background: var(--creme);
}
.avance-gros i.trouve {
  background: var(--ambre);
  box-shadow: 0 0 6px rgba(224, 170, 56, 0.9);
}
.joueurs b {
  margin-left: 12px;
  font: 600 1.25rem/1 'Fredoka', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------- moins d'animations */

@media (prefers-reduced-motion: reduce) {
  .gains-autres li {
    transition: opacity 200ms linear;
  }
  .gains-autres li.sortie {
    transform: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* La roue des figurines qui manquent (pas de doublon). */
.roue {
  background: rgb(44 35 32 / 0.55);
}
.roue-carte {
  gap: 22px;
}
.roue-cadre {
  position: relative;
  width: min(84vw, 52dvh, 420px);
  aspect-ratio: 1;
}
.roue-fleche {
  position: absolute;
  top: -16px;
  left: 50%;
  z-index: 1;
  translate: -50% 0;
  border-top: 34px solid var(--trait);
  border-right: 20px solid transparent;
  border-left: 20px solid transparent;
  filter: drop-shadow(0 3px 0 var(--creme));
}
.roue-disque {
  position: absolute;
  inset: 0;
  border: 6px solid var(--trait);
  border-radius: 50%;
  box-shadow: 0 8px 0 var(--trait), inset 0 0 0 6px rgb(255 255 255 / 0.35);
  will-change: transform;
}
.roue-disque::after {
  content: '';
  position: absolute;
  inset: 41%;
  border: 5px solid var(--trait);
  border-radius: 50%;
  background: var(--creme);
}
.roue-bras {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.roue-bras img {
  position: absolute;
  top: 5%;
  left: 50%;
  width: var(--taille, 16%);
  height: auto;
  max-height: none;
  translate: -50% 0;
  filter: drop-shadow(0 2px 0 rgb(0 0 0 / 0.25));
  transition: scale 320ms var(--ease-out);
}
.roue-bras.gagne img {
  scale: 1.7;
}
.roue-start:disabled {
  opacity: 0.5;
  animation: none;
  cursor: default;
}
