/* ==========================================================
   La salle d'entraînement : ce qui s'ajoute au style des activités
   de maths (../Mathematics/maths.css).
   ========================================================== */
:root { --bar: #3b5bdb; --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

.settings { align-items: center; }
.prof { height: 42px; padding: 0 10px; font-size: 16px; max-width: 11em; }
#newProfile { min-width: 42px; height: 42px; padding: 0; font-size: 20px; }

/* Les matières */
.subjects { margin-bottom: 18px; }
.subj { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: 17px; }
.subj small { font-size: 13px; font-weight: 600; opacity: .7; }

/* Le catalogue */
.topic-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.topic-head h2 { margin: 0; }
.letter {
  display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 4px;
  font-size: .85em; color: #fff; background: var(--bar); border: 2.5px solid var(--ink); border-radius: 10px;
}
.lesson-link { font-weight: 700; color: var(--blue); }
ul.skills { list-style: none; margin: 0; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 14px; }
ul.skills a {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
ul.skills a:hover, ul.skills a:focus-visible { background: var(--sky); outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.sk-code { flex: none; min-width: 2.6em; font: 700 15px var(--mono); color: var(--muted); }
.skill-head .sk-code { min-width: 0; margin-right: 4px; }
.name { flex: 1; min-width: 0; }
.badge { flex: none; min-width: 2.4em; padding: 0 8px; text-align: center; font-weight: 800; font-size: 15px; border-radius: 999px; }
.badge.none { border: 2px dashed var(--line); min-height: 1.5em; }
.badge.s0 { background: var(--rose); border: 2px solid var(--ink); }
.badge.s1 { background: var(--note); border: 2px solid var(--ink); }
.badge.s2 { background: var(--mint); border: 2px solid var(--ink); }
.badge.done { font-size: 20px; }
.pbar { flex: 0 0 90px; height: 10px; border-radius: 999px; background: var(--sky); border: 2px solid var(--ink); overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--green); }

/* S'exercer : la question à gauche, le score à droite */
.practice { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 0 22px; align-items: start; }
@media (max-width: 760px) {
  .practice { grid-template-columns: 1fr; }
  /* sur téléphone, le score tient sur une bande au-dessus de la question */
  .side { order: -1; position: static; display: grid; grid-template-columns: auto auto 1fr; gap: 0 14px; align-items: start; padding: 8px 14px; margin-bottom: 12px; }
  .side .stat { display: block; padding: 0; border: 0; }
  .side .stat span { display: block; font-size: 13px; }
  .side .stat b { font-size: 22px; }
  .side .stat.score b { font-size: 22px; }
  .side .meter { height: 12px; margin-top: 2px; }
  .side .zone { font-size: 13px; margin-top: 2px; }
  .side .lesson-link { display: none !important; }
}
.skill-head { margin: 0 0 10px !important; font-weight: 700; color: var(--muted); }
.prompt { font-size: 21px; font-weight: 600; line-height: 1.5; }
.prompt b { font-weight: 800; }
.prompt .hint { margin: 6px 0 0 !important; font-size: 16px; color: var(--muted); }
.eq { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .25em; font-size: clamp(30px, 6vw, 42px); font-weight: 800; font-variant-numeric: tabular-nums; }
.blank { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.2em; padding: 0 .15em; color: var(--red); border: 3px dashed var(--red); border-radius: 10px; font-size: .9em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; }
.frac > span { padding: 0 .15em; }
.frac > span:first-child { border-bottom: 3.5px solid var(--ink); }
.frac .blank { height: 1.1em; margin: 2px 0; }
.visual { margin: 14px 0 4px; text-align: center; overflow-x: auto; }
.visual .vis { max-width: 100%; height: auto; }
pre.code { display: inline-block; margin: 0; padding: 12px 18px; text-align: left; overflow-x: auto; max-width: 100%; background: #17233d; color: #e8edf5; border-radius: 14px; font: 17px/1.5 var(--mono); }
pre.code code { font: inherit; }

#ansForm { margin-top: 16px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice { text-align: left; font-size: 18px; padding: 8px 14px; }
.choice kbd { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: 6px; font: 700 13px var(--mono); border: 2px solid var(--line); border-radius: 6px; }
.choice.picked { background: var(--note); }
.unit { font-size: 24px; font-weight: 800; }
.pair-in label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.pair-in .num-input { font-size: 26px; width: 4em; }
.frac-in { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 auto 10px; width: max-content; }
.frac-in .fr-bar { width: 100%; min-width: 5em; border-top: 4px solid var(--ink); }
.frac-in .num-input { font-size: 26px; width: 3.6em; }

.flash { margin: 14px 0 0 !important; font-weight: 800; font-size: 22px; }
.flash.good { color: var(--green); }
.flash.info { color: var(--ink); font-size: 18px; }
.wrongbox { margin-top: 18px; padding-top: 14px; border-top: 2.5px dashed var(--line); }
.wrongbox .big-msg { margin: 0 0 4px !important; font-size: 22px; font-weight: 800; }
.wrongbox .muted { color: var(--muted); }
.wrongbox h3 { margin: 14px 0 4px; font-size: 18px; }
.explain { padding: 10px 14px; border-radius: 12px; background: var(--sky); }
.explain ol { margin: 4px 0; }
.explain p { margin: 6px 0; }
.wrongbox .row { margin-top: 14px; }
.mastered { margin-top: 10px; text-align: center; }
.mastered .big-msg { font-size: 30px; font-weight: 800; margin: 0 !important; }

.side { position: sticky; top: 10px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.stat span { font-weight: 600; color: var(--muted); }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat.score { flex-wrap: wrap; border-bottom: 0; }
.stat.score b { font-size: 44px; line-height: 1; }
.meter { position: relative; flex-basis: 100%; height: 16px; margin-top: 8px; border-radius: 999px; background: var(--sky); border: 2.5px solid var(--ink); overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .4s; }
.meter i { position: absolute; top: 0; bottom: 0; width: 2.5px; background: var(--ink); opacity: .5; }
.zone { display: block; flex-basis: 100%; margin-top: 6px; font-weight: 700; font-size: 15px; }
.zone.z_challenge { color: var(--red); }
.zone.z_master { color: var(--green); }
.side .lesson-link { display: inline-block; margin-top: 10px; }

/* Le suivi sur plusieurs appareils */
.sync-code { margin: 8px 0 !important; font: 800 clamp(26px, 6vw, 38px) var(--mono); letter-spacing: .08em; text-align: center; padding: 6px 10px; border: 3px dashed var(--ink); border-radius: 14px; background: var(--note); user-select: all; }
.sync-have { margin-top: 14px; padding-top: 12px; border-top: 2.5px dashed var(--line); }
.sync-have label { font-weight: 700; }
.code-input { width: 10em; font: 700 20px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); }
.sync-side { display: block; margin-top: 8px; font-weight: 600; color: var(--muted); }

/* Mes progrès */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { padding: 10px 14px; text-align: center; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--sky); }
.tile b { display: block; font-size: 32px; line-height: 1.1; }
.tile span { font-weight: 600; font-size: 15px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .meter span { transition: none; } }
