:root {
  --fond: #eef8f7;
  --carte: #ffffff;
  --turquoise: #1f8f8c;
  --turquoise-clair: #d6efed;
  --corail: #ef7b5c;
  --jaune: #ffd466;
  --encre: #1f5fa8;
  --texte: #213a3d;
  --doux: #5d7477;
  --fantome: #e4ecee;
  --ligne: #a9c6e8;
  --vert: #2eaa5c;
  --police: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: var(--police); font-size: 17px; line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--turquoise); }

.haut { text-align: center; padding: 22px 16px 6px; }
.marque { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--turquoise); font-weight: 700; }
h1 { margin: 4px 0 4px; font-size: clamp(24px, 5vw, 34px); line-height: 1.15; }
.intro { margin: 0 auto; max-width: 34em; color: var(--doux); }

main { max-width: 980px; margin: 0 auto; padding: 12px 16px 24px; }

.atelier { background: var(--carte); border-radius: 22px; padding: 12px 12px 16px; box-shadow: 0 6px 24px rgba(31, 143, 140, .12); }
.scene { position: relative; }
#tableau { display: block; width: 100%; height: min(62vh, 600px); touch-action: manipulation; }
#ardoise { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
.nom-lettre { position: absolute; left: 10px; top: 4px; background: #fff; padding: 0 6px; border-radius: 6px; margin: 0; font-size: 14px; color: var(--doux); }

.lignes line { stroke-width: 7; vector-effect: non-scaling-stroke; }
.lignes .l-base { stroke: var(--ligne); stroke-width: 2.4; }
.lignes .l-x { stroke: var(--ligne); stroke-width: 1.6; stroke-dasharray: 6 6; }
.lignes .l-fine { stroke: #d5e3f3; stroke-width: 1.2; }
.fantome path { fill: none; stroke: var(--fantome); stroke-linecap: round; stroke-linejoin: round; }
.fleche { fill: none; stroke: #8fb3b6; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.encre path { fill: none; stroke: var(--encre); stroke-linecap: round; stroke-linejoin: round; }
.departs .depart { fill: var(--vert); }
.departs .num { fill: #fff; font-family: var(--police); font-weight: 800; text-anchor: middle; }
.stylo { fill: var(--corail); stroke: #fff; stroke-width: 8; }
#tableau.atoi .fantome path { stroke: #d7e3e6; }

.commandes { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.gros {
  border: 0; border-radius: 999px; padding: 14px 24px; min-height: 54px; font-size: 19px; font-weight: 800;
  background: var(--turquoise); color: #fff; box-shadow: 0 3px 0 #16706e;
}
.gros:active { transform: translateY(2px); box-shadow: 0 1px 0 #16706e; }
.gros.bis { background: var(--jaune); color: #4a3a00; box-shadow: 0 3px 0 #d9ad37; }
.gros.bis[aria-pressed="true"] { background: var(--corail); color: #fff; box-shadow: 0 3px 0 #c95a3e; }
.nav {
  width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--turquoise-clair); background: #fff;
  font-size: 32px; line-height: 1; color: var(--turquoise); font-weight: 700; padding: 0 0 4px;
}
.options { display: flex; gap: 10px 16px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.vitesse { display: inline-flex; background: var(--turquoise-clair); border-radius: 999px; padding: 4px; }
.vitesse button { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700; color: var(--turquoise); min-height: 40px; }
.vitesse button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.lien { border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--turquoise); text-decoration: none; padding: 8px 6px; }
.lien:hover { text-decoration: underline; }

.alphabet h2 { font-size: 20px; margin: 26px 4px 10px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.grille button { background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 6px 4px; aspect-ratio: 1 / 1.15; display: flex; }
.grille button svg { width: 100%; height: 100%; }
.grille button path { fill: none; stroke: var(--texte); stroke-width: 72; stroke-linecap: round; stroke-linejoin: round; }
.grille button[aria-current="true"] { border-color: var(--corail); background: #fff5f1; }

.parents { background: var(--carte); border-radius: 18px; margin-top: 24px; padding: 4px 18px; }
.parents summary { font-weight: 800; padding: 12px 0; cursor: pointer; color: var(--turquoise); }
.parents ul { padding-left: 20px; margin-top: 0; }
.parents li { margin-bottom: 8px; }

.bas { text-align: center; color: var(--doux); font-size: 14px; padding: 10px 16px 32px; max-width: 640px; margin: 0 auto; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  main { padding: 8px 10px 20px; }
  .atelier { padding: 8px 6px 14px; }
  #tableau { height: 50vh; }
  .gros { padding: 10px 14px; font-size: 16px; min-height: 48px; }
  .nav { width: 44px; height: 44px; font-size: 26px; }
  .commandes { gap: 6px; flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .gros:active { transform: none; } }
