/* DÉJOUE ! — laboratoire d’enquête linguistique : clair, net, énergique. Polices système uniquement. */
:root { --bg: #f5f7fc; --card: #fff; --ink: #1b2340; --muted: #566082; --line: #dfe4f2; --indigo: #314dce; --indigo-d: #2539a3; --indigo-l: #e8ecfd; --turq: #0f9e97; --turq-l: #ddf5f3; --coral: #e5534b; --coral-l: #fde6e4; --lime: #5d9e1f; --lime-l: #eaf6dc; --amber: #b7791f; --amber-l: #fdf1dc;
  --r: 18px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color-scheme: light; }
:root.contrast { --ink: #000; --muted: #2a3150; --line: #9aa3c4; --indigo: #2236a8; --turq: #08706b; --coral: #b3261e; --lime: #3d6e0b; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; } /* pas de zoom au double-tap (zoom à deux doigts conservé) */
:root.big { font-size: 19px; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg) radial-gradient(1200px 400px at 50% -200px, #e3e8fb, transparent) no-repeat; color: var(--ink); font: 1rem/1.5 var(--font); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 9; background: #fff; padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
main:focus { outline: none; }
.app-shell { max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.loading { text-align: center; padding-top: 30vh; color: var(--muted); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; transition: transform .15s, background .15s; }
.btn:hover { border-color: var(--indigo); } .btn:active { transform: scale(.98); }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; } .btn.primary:hover { background: var(--indigo-d); }
.btn.danger { color: var(--coral); border-color: #f2b8b4; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--indigo); }
.btn.big { min-height: 56px; font-size: 1.08rem; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.icon-btn { width: 46px; height: 46px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--indigo-l); } .icon-sp { width: 46px; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--indigo); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: 0 6px 22px #1b234010; }
.card h2 { margin: 0 0 6px; font-size: 1.15rem; } .card h3 { margin: 14px 0 6px; font-size: .95rem; color: var(--muted); }
.note { color: var(--muted); font-size: .92rem; margin: 4px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .stack { display: grid; gap: 8px; }
.top { display: flex; align-items: center; gap: 8px; min-height: 52px; } .top h1 { flex: 1; margin: 0; text-align: center; font-size: 1.15rem; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 10px 30px #0003; }
/* Accueil */
.home-top { justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.45rem; letter-spacing: .02em; color: var(--indigo); }
.logo b { color: var(--coral); }
.promise { margin: 8px 0 4px; font-weight: 700; color: var(--muted); }
.moment { background: linear-gradient(135deg, #fff, #eef1fe); border-color: #cfd7f8; }
.kicker { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--turq); }
.moment h2 { font-size: 1.4rem; margin: 4px 0; } .moment .btn { width: 100%; margin-top: 10px; }
.calib-btns { display: grid; gap: 10px; margin-top: 10px; }
.calib-btns .btn { flex-direction: column; align-items: flex-start; text-align: left; } .calib-btns small { font-weight: 500; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; text-align: center; }
.tile .ic { color: var(--indigo); width: 26px; height: 26px; } .tile:hover { border-color: var(--indigo); }
.stats { text-align: center; color: var(--muted); font-weight: 600; margin: 14px 0 0; }
.daily { display: flex; margin: 4px auto 0; }
.install { background: var(--amber-l); border-color: #f0d9a8; }
.privacy { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 18px; }
.oops { text-align: center; margin-top: 20vh; } .oops h2 { color: var(--coral); }
/* Parcours, règles, pièges */
.parc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .parc-head h2 { margin: 0; }
.room { width: 92px; flex: none; } .room .wall { fill: #eef1fb; stroke: #c8d0ef; } .room .roof { fill: none; stroke: var(--indigo); stroke-width: 2; stroke-linejoin: round; }
.room .win { fill: #d5dbef; } .room .win.half { fill: #ffd98a; } .room .win.on { fill: #ffc531; filter: drop-shadow(0 0 2px #ffc531); }
.rules { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.rule-row { width: 100%; display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.rule-row:hover { background: var(--indigo-l); }
.rid { font-weight: 800; color: var(--indigo); font-size: .85rem; } .rt { font-size: .95rem; }
.gauge { display: inline-flex; gap: 2px; } .gauge i { width: 8px; height: 14px; border-radius: 3px; background: #dfe4f2; } .gauge i.on { background: var(--turq); }
.st { font-size: .74rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.st-new { background: #eef0f6; color: var(--muted); } .st-learn { background: var(--indigo-l); color: var(--indigo); } .st-cons { background: var(--amber-l); color: var(--amber); } .st-ok { background: var(--lime-l); color: var(--lime); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.bars i { flex: 1; position: relative; height: calc(var(--h) * 100%); min-height: 2px; background: #d9def3; border-radius: 3px 3px 0 0; }
.bars i b { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 100%); background: var(--turq); border-radius: 3px 3px 0 0; }
.badges { list-style: none; padding: 0; display: grid; gap: 8px; } .badges li { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: #f1f3f9; opacity: .7; }
.badges li.won { background: var(--lime-l); opacity: 1; } .badges small { color: var(--muted); }
.switch { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; font-weight: 600; } .switch span { display: flex; flex-direction: column; } .switch small { font-weight: 500; color: var(--muted); font-size: .85rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; flex: none; margin: 0; border-radius: 99px; background: #c5cbe0; position: relative; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px #0003; }
.switch input:checked { background: var(--indigo); } .switch input:checked::after { transform: translateX(20px); }
/* Mission */
body.in-mission .app-shell { display: flex; flex-direction: column; }
.mission { display: flex; flex-direction: column; flex: 1; min-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); }
.mbar { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.dots { flex: 1; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #d7dcef; } .dots i.cur { background: var(--indigo); transform: scale(1.25); }
.dots i.ok { background: var(--turq); } .dots i.ko { background: #fff; box-shadow: inset 0 0 0 2.5px var(--coral); }
.mmode { font-size: .8rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.qcard { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 8px 28px #1b234014; margin: 6px 0 12px; }
.consigne { margin: 0 0 10px; color: var(--muted); font-weight: 700; font-size: .95rem; } .consigne.good { color: var(--lime); }
.phrase { font-size: 1.32rem; line-height: 1.75; margin: 6px 0 16px; font-weight: 600; overflow-wrap: break-word; hyphens: manual; }
:root.big .phrase { font-size: 1.5rem; }
.blank { display: inline-block; white-space: nowrap; padding: 0 4px; border-radius: 8px; background: var(--indigo-l); color: var(--indigo); font-weight: 800; }
.gap { letter-spacing: 1px; }
.tok { position: relative; display: inline; border-radius: 6px; }
.tappable button.tok { font: inherit; font-weight: 600; padding: 2px 4px; margin: 0 -1px; border: 0; border-bottom: 2px dashed #b8c2e8; background: transparent; cursor: pointer; min-height: 44px; }
.tappable button.tok:hover { background: var(--indigo-l); }
.tok.ans { color: var(--indigo); font-weight: 800; text-decoration: underline 2px; text-underline-offset: 4px; }
.tok.wrong-word { color: inherit; }
.tok.trg { background: var(--turq-l); box-shadow: inset 0 -3px 0 var(--turq); padding: 0 3px; }
.tok.ant { background: #fff4d6; box-shadow: inset 0 -3px 0 var(--amber); padding: 0 3px; }
.tok .tag { position: absolute; left: 50%; top: -1.15em; transform: translateX(-50%); font-size: .58rem; line-height: 1; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--turq); white-space: nowrap; }
.tok.ant .tag { color: var(--amber); }
.tok.trg::before { content: "["; color: var(--turq); } .tok.trg::after { content: "]"; color: var(--turq); }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.opts.just { grid-template-columns: 1fr; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fbfcff; cursor: pointer; text-align: left; font-size: 1.1rem; }
.opts.just .opt { font-size: .98rem; }
.opt:hover { border-color: var(--indigo); } .opt.on { border-color: var(--indigo); background: var(--indigo-l); box-shadow: inset 0 0 0 1px var(--indigo); }
.opt .key { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: #eef0f8; font-size: .75rem; font-weight: 800; color: var(--muted); }
.opt .stem { color: var(--muted); font-weight: 500; }
.tapmsg { min-height: 1.5em; color: var(--amber); font-weight: 700; margin: 0; }
.typein { font: inherit; font-weight: 800; color: var(--indigo); width: 9em; max-width: 60%; min-height: 44px; padding: 2px 8px; border: 0; border-bottom: 3px solid var(--indigo); background: var(--indigo-l); border-radius: 8px 8px 0 0; font-size: 16px; }
.hintbox { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--amber-l); border: 1px solid #f0d9a8; } .hintbox .phrase { font-size: 1.05rem; margin: 10px 0 4px; } .hintbox p { margin: 0; }
.verdict { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; margin-bottom: 8px; animation: pop .2s ease; }
.verdict.yes { background: var(--lime-l); color: var(--lime); } .verdict.no { background: var(--coral-l); color: #b0362f; } .verdict.mid { background: var(--amber-l); color: var(--amber); }
.vic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: currentColor; flex: none; font-weight: 900; } .vic { color: #fff; } .verdict.yes .vic { background: var(--lime); } .verdict.no .vic { background: var(--coral); } .verdict.mid .vic { background: var(--amber); }
.verdict b { color: inherit; font-size: 1.05rem; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } }
.chain { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0; margin: 4px 0 10px; }
.chain li { padding: 4px 10px; border-radius: 99px; background: var(--indigo-l); color: var(--indigo); font-weight: 700; font-size: .85rem; }
.chain li:not(:last-child)::after { content: "→"; margin-left: 8px; color: var(--muted); }
.chain li.end { background: var(--indigo); color: #fff; }
.expl { margin: 6px 0; }
.mastered { padding: 10px 14px; border-radius: 14px; background: var(--lime-l); color: var(--lime); font-weight: 700; }
.mfoot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 max(4px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.mfoot .btn.big { min-width: 50%; }
.bilan-t { margin: 0 0 10px; color: var(--indigo); }
.bilan-box { border-radius: 14px; padding: 8px 14px; margin: 10px 0; } .bilan-box h3 { margin: 4px 0; font-size: .95rem; } .bilan-box ul { margin: 4px 0; padding-left: 20px; }
.bilan-box.ok { background: var(--lime-l); } .bilan-box.todo { background: var(--amber-l); } .bilan-box.badge { background: var(--indigo-l); }
/* Modales */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); background: var(--card); color: var(--ink); box-shadow: 0 24px 60px #1b234040; overflow: hidden; display: flex; flex-direction: column; }
dialog.modal:not([open]) { display: none; }
dialog::backdrop { background: #1b234070; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 0 20px; } .modal-head h2 { flex: 1; margin: 0; font-size: 1.15rem; }
.modal-body { padding: 8px 20px; overflow: auto; overscroll-behavior: contain; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); }
.fiche-rule { font-weight: 700; font-size: 1.05rem; } .fiche-ex { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: #f5f7fc; } .fiche-ex .phrase { font-size: 1.1rem; margin: 14px 0 6px; }
.steps { padding-left: 20px; } .steps li { margin-bottom: 8px; }
/* Grands écrans et paysage */
@media (min-width: 720px) { .opts { grid-template-columns: repeat(4, 1fr); } .opts.just { grid-template-columns: 1fr; } .calib-btns { grid-template-columns: repeat(3, 1fr); } }
@media (orientation: landscape) and (max-height: 500px) { .qcard { padding: 12px 16px; } .phrase { font-size: 1.15rem; margin: 4px 0 10px; } .opts { grid-template-columns: repeat(4, 1fr); } .opt { min-height: 48px; } .mbar { min-height: 44px; } }
@media (max-width: 360px) { .tiles { grid-template-columns: 1fr; } .tile { flex-direction: row; min-height: 56px; } .phrase { font-size: 1.15rem; } }
:root.still *, :root.still *::before, :root.still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.aide { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--amber-l); border: 1px solid #f0d9a8; font-weight: 600; font-size: .95rem; }
.card.lacune { border: 2px solid var(--coral); background: linear-gradient(160deg, var(--card) 0%, var(--coral-l) 100%); }
.card.lacune .kicker { color: var(--coral); }
.bilan-box.lacune { background: var(--coral-l); }
ul.lacunes { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
ul.lacunes li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--coral-l); }
ul.lacunes li small { display: block; color: var(--muted); font-size: .85rem; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .9rem; flex-shrink: 0; }
/* Profils « Qui joue ? » et tableau de bord du professeur */
.avatar { --c: var(--indigo); display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; width: 40px; height: 40px; font-size: 1.1rem; }
.avatar.s { width: 26px; height: 26px; font-size: .85rem; } .avatar.l { width: 52px; height: 52px; font-size: 1.4rem; }
.who-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; min-height: 40px; padding: 4px 12px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.who-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chooser { max-width: 560px; margin: 0 auto; padding-top: 24px; } .chooser .logo.big { justify-content: center; font-size: 1.8rem; }
.who-t { text-align: center; margin: 18px 0 14px; font-size: 1.6rem; } .center { text-align: center; }
ul.who { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.who-btn { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 16px; min-height: 72px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 2px 8px #1b234010; }
.who-btn:hover, .who-btn:focus-visible { border-color: var(--indigo); } .who-btn b { display: block; font-size: 1.1rem; } .who-btn small { color: var(--muted); }
.who-actions .plus { font-size: 1.3rem; font-weight: 800; margin-right: 4px; } .prof-btn { justify-content: center; }
ul.pupils { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
a.pupil { display: block; color: inherit; text-decoration: none; } a.pupil:hover, a.pupil:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.pupil-head { display: flex; align-items: center; gap: 12px; } .pupil-head b { display: block; font-size: 1.1rem; } .pupil-head small { color: var(--muted); }
.kpis { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 4px; color: var(--muted); } .kpis b { color: var(--ink); }
.lac-line { margin: 4px 0 0; color: var(--coral); }
.tiles-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.kpi { background: var(--indigo-l); border-radius: 12px; padding: 8px 10px; text-align: center; } .kpi b { display: block; font-size: 1.25rem; } .kpi small { color: var(--muted); font-size: .8rem; }
.tbl-wrap { overflow-x: auto; margin-top: 8px; } .tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; } .tbl th { color: var(--muted); font-weight: 700; font-size: .8rem; }
.tbl td.num { text-align: right; white-space: nowrap; } .tbl td.rid { color: var(--muted); font-weight: 700; }
ul.plain { padding-left: 18px; margin: 6px 0; } details summary { cursor: pointer; margin-top: 10px; color: var(--muted); font-weight: 700; }
.name-in { width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); margin: 8px 0 4px; box-sizing: border-box; }
.name-in:focus { border-color: var(--indigo); outline: none; }
@media (max-width: 380px) { .tiles-kpi { grid-template-columns: repeat(2, 1fr); } }
@media print {
  body { background: #fff; } .noprint, .top .icon-btn, #toast { display: none !important; }
  .pupil-sheet .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; } .tbl-wrap { overflow: visible; break-inside: avoid; }
  .bars i { print-color-adjust: exact; -webkit-print-color-adjust: exact; } .kpi, .avatar, .st { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.tbl td:nth-child(2) { min-width: 9em; }
@media (max-width: 600px) {
  .tbl { font-size: .82rem; } .tbl th, .tbl td { padding: 6px 4px; }
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; } /* « Rép. » : détail visible sur ordinateur et à l'impression */
}
@media print { .tbl th:nth-child(4), .tbl td:nth-child(4) { display: table-cell !important; } }
/* Code du professeur */
.pin-in { display: block; width: 8.5em; margin: 10px auto 4px; text-align: center; letter-spacing: .6em; padding: 12px 0 12px .6em; font: inherit; font-size: 1.8rem; font-weight: 800; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.pin-in:focus { border-color: var(--indigo); outline: none; } .modal.pin .tapmsg { text-align: center; } .pin-extra { justify-content: center; margin-top: 6px; }
.card.warn { border: 2px solid var(--amber); background: var(--amber-l); } .card.warn p { margin-top: 0; }
