/* Design system Mystigrille — JEU : plateau, cases, jetons, phrases à lire, écran de partie. */

/* ── Phrase à lire ── */
.lire { font-family: var(--police-lecture); font-weight: 700; line-height: 1.3; }
.lire--cp1 { font-size: var(--lecture-cp1); line-height: 1.55; }
.lire--cp2 { font-size: var(--lecture-cp2); }
.lire--cp3 { font-size: var(--lecture-cp3); }
.lire--ce1 { font-size: var(--lecture-ce1); }
.lire--ce2 { font-size: var(--lecture-ce2); }
.lire--histoire { font-weight: 400; }
.lire .cle { background: linear-gradient(transparent 58%, var(--couleur-surlignage) 58%); }
.lire .muet { font-style: normal; color: var(--couleur-lettre-muette); }
/* Un mot ne se coupe jamais entre deux syllabes */
.lire .mot { white-space: nowrap; }
/* Arc sous chaque syllabe (début de CP) */
.lire .syl {
  display: inline-block;
  padding-bottom: 6px;
  margin: 0 1px;
  background: radial-gradient(ellipse 50% 100% at 50% 0, transparent calc(100% - 2.5px), var(--couleur-arc-syllabe) calc(100% - 2.5px) 100%, transparent 100%) bottom / 100% 7px no-repeat;
}

/* ── Carte d'indice ── */
.indice { display: flex; align-items: center; gap: 10px; }
.indice .lire { flex: 1; min-width: 0; }

/* ── Plateau ── */
.plateau-cadre { padding: 6px; border-width: 3px; border-radius: var(--rayon-xl); box-shadow: var(--levre-l); }
.plateau {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  border: var(--trait-plateau) solid var(--couleur-trait);
  border-radius: 10px;
  overflow: hidden;
  container-type: inline-size;
}
.case {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--couleur-trait-fin);
  border-bottom: 1px solid var(--couleur-trait-fin);
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.case--mur-droit { border-right: var(--trait-plateau) solid var(--couleur-trait); }
.case--mur-bas { border-bottom: var(--trait-plateau) solid var(--couleur-trait); }
.case--bord-droit { border-right: 0; }
.case--bord-bas { border-bottom: 0; }
.sol-chambre { background: var(--sol-chambre); }
.sol-cuisine { background: var(--sol-cuisine); }
.sol-salon { background: var(--sol-salon); }
.sol-jardin { background: var(--sol-jardin); }
.sol-bain { background: var(--sol-bain); }
.sol-garage { background: var(--sol-garage); }
.case__objet { position: absolute; width: 88%; height: 88%; pointer-events: none; }
.case__croix { width: 34%; height: 34%; pointer-events: none; }
.case__piece {
  position: absolute; left: 3px; top: 3px; z-index: 2;
  font: 700 clamp(9px, calc(100cqw / var(--n) / 5.2), 13px)/1.5 var(--police-interface);
  background: var(--couleur-surface);
  border: 2px solid var(--couleur-trait);
  border-radius: var(--rayon-s);
  padding: 0 5px;
  white-space: nowrap;
  pointer-events: none;
}
.jeton {
  position: relative; z-index: 1;
  width: 78%; height: 78%;
  border-radius: 22%;
  border: var(--trait) solid var(--couleur-trait);
  box-shadow: var(--levre-s);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.jeton img { width: 90%; }
.jeton--objet { align-items: center; }
.jeton--objet img { width: 82%; }
.jeton--choisi { border: 3px solid var(--couleur-selection); box-shadow: var(--levre-selection); }
.jeton--fantome { border: 3px dashed var(--couleur-selection); box-shadow: none; background: rgba(255, 255, 255, 0.55) !important; }
.jeton--fantome img { opacity: 0.45; }
.fond-lili { background: var(--jeton-lili); }
.fond-tom { background: var(--jeton-tom); }
.fond-mila { background: var(--jeton-mila); }
.fond-rudy { background: var(--jeton-rudy); }
.fond-sami { background: var(--jeton-sami); }
.fond-nono { background: var(--jeton-nono); }
.fond-mystere { background: var(--jeton-mystere); }

/* ── Écran de partie : une colonne sur téléphone, deux à partir de la tablette en paysage ── */
.partie { display: flex; flex-direction: column; gap: var(--espace-3); flex: 1; }
.partie__panneau { display: flex; flex-direction: column; gap: var(--espace-3); flex: 1; }
.jetons { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 6px; }
@media (min-width: 860px) {
  .partie { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: var(--espace-6); align-items: start; }
  .partie__plateau { max-width: min(600px, calc(100dvh - 150px)); }
}
