:root {
  --ground: #FFFBEA; --surface: #FFFFFF; --ink: #2B241D; --muted: #7A6E4E; --line: #EFE3B8;
  --accent: #F5C21B; --accent-ink: #2B241D; --accent-soft: #FFF3C2; --amber: #9A6400; --blue: #1F5C8B;
  --ok: #2E7D4F; --ok-soft: #DDF0E4; --warn: #A33A2A; --warn-soft: #F8E0DB;
  --font-ui: "Nunito Sans", "Segoe UI", Roboto, system-ui, sans-serif; --font-read: "Andika", Verdana, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font-ui); }
a { color: var(--blue); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand svg { width: 30px; height: 30px; }
.brand .logo { width: 36px; height: 36px; object-fit: contain; }
nav { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; }
nav a { text-decoration: none; color: var(--ink); }
nav a.muted { color: var(--muted); font-weight: 600; }
.wrap { max-width: 860px; margin: 0 auto; padding-block: 18px 60px; padding-inline: 16px; }
.pied { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px; }
h1 { font-size: 1.6rem; margin: 0 0 6px; text-wrap: balance; }
h2 { font-size: 1.2rem; margin: 26px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
p.lead { color: var(--muted); margin: 0 0 16px; max-width: 62ch; }
.flash { padding: 10px 14px; border-radius: 12px; margin: 0 0 14px; font-weight: 700; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.erreur { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font: 800 1rem var(--font-ui); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.sec { background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.btn.petit { padding: 7px 12px; font-size: .9rem; min-height: 36px; }
.btn.danger { background: var(--warn-soft); color: var(--warn); }
.btn:disabled { opacity: .5; cursor: default; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
form.simple label { display: block; font-weight: 700; margin: 14px 0 4px; }
form.simple .aide { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
input[type=text], input[type=number], input[type=email], input[type=password], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 1rem var(--font-ui); background: var(--surface); color: var(--ink); }
textarea { min-height: 120px; font-family: var(--font-read); font-size: 1.05rem; line-height: 1.6; }
textarea.court { min-height: 150px; }
input[type=text].code { font-size: 1.4rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.deux { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.trois { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .deux, .trois { grid-template-columns: 1fr; } }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.liste li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.liste .t { font-weight: 800; }
.liste .m { color: var(--muted); font-size: .88rem; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 800; background: var(--accent-soft); color: var(--amber); }
.tag.bleu { background: #E3EEF7; color: var(--blue); }
.tag.vert { background: var(--ok-soft); color: var(--ok); }
.lien { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.lien code { font-size: 1.05rem; font-weight: 800; word-break: break-all; }
.enreg { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; }
.enreg .etat { font-weight: 700; margin-top: 8px; }
.enreg .rec { color: var(--warn); }
audio { width: 100%; margin-top: 8px; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filtres a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; color: var(--ink); background: var(--surface); }
.filtres a.on { background: var(--accent); border-color: var(--accent); }
.colonnes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-family: var(--font-read); font-size: .95rem; margin-top: 8px; }
.colonnes div { background: var(--ground); border-radius: 10px; padding: 8px; }
.colonnes b { display: block; font: 800 .72rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.apercu { font-family: var(--font-read); color: var(--muted); font-size: .95rem; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.check input { width: 20px; height: 20px; margin-top: 3px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.code-neuf { font-size: 1.6rem; font-weight: 800; letter-spacing: .12em; }
.etapes { counter-reset: e; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.etapes li { display: flex; gap: 12px; align-items: flex-start; }
.etapes li::before { counter-increment: e; content: counter(e); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--amber); font-weight: 800; display: grid; place-items: center; }

.etape { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.etape .num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.etape b { min-width: 9.5em; }
.etape select { flex: 1 1 220px; width: auto; }
.etape .acts { display: flex; gap: 4px; margin-left: auto; }
.etape .acts button { border: 1px solid var(--line); background: var(--ground); color: var(--ink); border-radius: 8px; width: 34px; height: 34px; font-weight: 800; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }


/* ---------- le cahier de sons (v4) ---------- */
@font-face { font-family: "Borel"; src: url("fonts/Borel-Regular.ttf") format("truetype"); font-display: swap; }
.sons-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.son-vignette { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; background: #fff; border: 1px solid #eadfb8; border-radius: 14px; text-decoration: none; color: inherit; text-align: center; }
.son-vignette:hover { border-color: #F5C21B; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.son-grand { font-family: Andika, "Nunito Sans", sans-serif; font-size: 2.6rem; font-weight: 800; line-height: 1; color: #C62828; }
.son-graph { font-size: .95rem; color: #1F5C8B; font-weight: 600; }
.son-vignette img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; }
.son-vide { width: 100%; max-width: 120px; aspect-ratio: 1; border: 2px dashed #eadfb8; border-radius: 12px; }
.son-vide.grand { max-width: 320px; display: flex; align-items: center; justify-content: center; color: #999; }
.son-mot { font-family: Andika, sans-serif; font-size: 1.1rem; }
.fiche-son { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid #eadfb8; border-radius: 18px; padding: 18px; }
.fiche-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fiche-haut { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.fiche-son-grand { font-family: Andika, sans-serif; font-size: 6rem; font-weight: 800; line-height: 1; color: #C62828; }
.fiche-graphemes { display: flex; flex-wrap: wrap; gap: 8px; max-width: 320px; }
.graph { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #E8F0F7; color: #1F5C8B; font-family: Andika, sans-serif; font-weight: 700; font-size: 1.3rem; }
.fiche-image { display: flex; justify-content: center; margin: 14px 0; }
.fiche-image img { max-width: 320px; width: 100%; aspect-ratio: 1; object-fit: contain; }
.fiche-mot { text-align: center; }
.fiche-mot .script { font-family: Andika, sans-serif; font-size: 2.4rem; }
.fiche-mot .script b { color: #C62828; }
.fiche-mot .cursive { font-family: Borel, cursive; font-size: 2.6rem; color: #1F5C8B; margin-top: 4px; }
.fiche-exemples { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; font-family: Andika, sans-serif; font-size: 1.3rem; }
.fiche-exemples b { color: #C62828; }
.fiche-exemples .graph { font-size: 1rem; padding: 2px 9px; margin-right: 6px; }
@media (max-width: 480px) { .fiche-son-grand { font-size: 4.5rem; } .fiche-mot .script, .fiche-mot .cursive { font-size: 2rem; } }

body.cadre .wrap { padding-top: 6px; } body.cadre footer { display: none; }

/* v5.1 — catalogue des jeux */
.jeux-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.jeu-carte { display: flex; flex-direction: column; gap: 8px; }
.jeu-tete { display: flex; align-items: center; gap: 12px; }
.jeu-tete .son-grand { font-size: 2.2rem; min-width: 56px; text-align: center; }
.jeu-carte details summary { cursor: pointer; font-weight: 700; }
.jeu-liste { margin: 0 0 4px; padding-left: 18px; }
.jeu-liste li { margin: 2px 0; }

/* v5.4 — images des jeux, contrôle de la voix */
.img-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.img-carte { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; text-align: center; }
.img-carte img, .img-vide { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #fff; }
.img-vide { display: flex; align-items: center; justify-content: center; color: #C62828; border: 2px dashed #C62828; font-size: .85rem; }
.img-carte.sans { border-color: #C62828; }
.img-mot { font-family: Andika, sans-serif; font-size: 1.05rem; }
.voix-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.voix-table th, .voix-table td { padding: 5px 8px; border-bottom: 1px solid #eadfb8; text-align: left; }
.voix-table .lecture { font-family: Andika, sans-serif; font-size: 1.15rem; }
.voix-table .dit { color: #1F5C8B; }
.voix-table input[type=radio] { width: 20px; height: 20px; }
.img-form { width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.img-form textarea { width: 100%; font-size: .78rem; padding: 4px 6px; border: 1px solid #eadfb8; border-radius: 8px; resize: vertical; }
.one-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 10px; font-size: .85rem; margin-bottom: 6px; }
.one-jeux label { margin: 0; font-weight: 400; display: flex; gap: 4px; align-items: center; }
.one-jeux input { width: auto; }
.btn.danger { color: #C62828; border-color: #e0b4b4; }
.btn.danger:hover { background: #fdecec; }
