/* Héros du Numérique — EVM */
:root {
  --bg: #0f1d3d;
  --bg2: #142857;
  --card: #1a3268;
  --card2: #213d7c;
  --line: #2f4c93;
  --txt: #f5f7ff;
  --muted: #b3bfe4;
  --yellow: #f6c700;
  --orange: #f39221;
  --red: #e84a5f;
  --green: #57b947;
  --blue: #2f8fe6;
  --purple: #9b6ef3;
  --ok: #5fd07a;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(3, 8, 25, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg2); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #22408a 0%, transparent 60%), linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--txt);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--yellow); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.noscript { padding: 24px; text-align: center; }

/* ---------- Démarrage ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.boot-logo { width: 160px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 20px; border: 0; border-radius: 14px;
  font-weight: 800; font-size: 1rem; cursor: pointer; text-decoration: none;
  background: var(--card2); color: var(--txt); transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .opt:focus-visible, .chip:focus-visible, .slot:focus-visible, .district:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #ffd43b, var(--yellow)); color: #241a00; box-shadow: 0 4px 0 #b38f00; }
.btn-green { background: linear-gradient(180deg, #6fd15e, var(--green)); color: #0c2306; box-shadow: 0 4px 0 #3a8a2e; }
.btn-ghost { background: transparent; border: 2px solid var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: .9rem; border-radius: 12px; }
.link-btn { background: none; border: 0; color: var(--yellow); font-weight: 700; cursor: pointer; padding: 8px 0; text-decoration: underline; }

/* ---------- Écran de connexion ---------- */
.auth { max-width: 520px; margin: 0 auto; padding: 24px 16px calc(32px + var(--safe-b)); }
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head img { width: 170px; }
.auth-head h1 { margin: 6px 0 4px; font-size: 1.9rem; letter-spacing: .3px; }
.tagline { color: var(--muted); margin: 0 auto; max-width: 420px; font-style: italic; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--card); padding: 6px; border-radius: 16px; margin-bottom: 16px; }
.tab { min-height: 46px; border: 0; border-radius: 12px; background: transparent; font-weight: 800; cursor: pointer; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--card2); color: var(--txt); }
.panel { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field small { color: var(--muted); font-weight: 400; }
.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: #0d1a3a; color: var(--txt); font-size: 1rem; font-family: inherit;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--yellow); }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 64px; }
.pass-toggle { position: absolute; right: 6px; top: 6px; height: 38px; border: 0; border-radius: 10px; background: var(--card2); padding: 0 10px; cursor: pointer; font-size: .85rem; font-weight: 700; }
.form-error { background: rgba(232, 74, 95, .15); border: 2px solid var(--red); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.avatar-opt { aspect-ratio: 1; border-radius: 14px; border: 3px solid transparent; background: var(--card2); font-size: 1.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; min-width: 0; }
.avatar-opt[aria-pressed="true"] { border-color: var(--yellow); background: #2b4b96; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-opt { text-align: left; border: 3px solid transparent; background: var(--card2); border-radius: 14px; padding: 12px; cursor: pointer; }
.level-opt b { display: block; font-size: 1.05rem; }
.level-opt span { color: var(--muted); font-size: .88rem; }
.level-opt[aria-pressed="true"] { border-color: var(--yellow); background: #2b4b96; }
.footer { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 22px; }

/* ---------- En-tête du jeu ---------- */
.shell { max-width: 760px; margin: 0 auto; padding: 0 12px calc(96px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; padding: 10px 0 8px; background: linear-gradient(180deg, var(--bg) 70%, rgba(15, 29, 61, 0)); }
.topbar-row { display: flex; align-items: center; gap: 10px; }
.topbar-row img { width: 54px; height: auto; }
.brand { flex: 1; min-width: 0; }
.brand b { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; }
.sync[data-s="pending"] i { background: var(--yellow); }
.sync[data-s="offline"] i { background: var(--orange); }
.sync[data-s="auth"] i { background: var(--red); }
.me { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--yellow); background: var(--card2); font-size: 1.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.gauge { font-size: .72rem; color: var(--muted); }
.gauge .bar { height: 8px; background: #0b1631; border-radius: 6px; overflow: hidden; margin-top: 3px; }
.gauge .bar span { display: block; height: 100%; border-radius: 6px; transition: width .6s ease; }
.gauge b { color: var(--txt); }

.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(13, 26, 58, .97); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b)); }
.navbar-in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nav-btn { min-height: 56px; border: 0; border-radius: 14px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.nav-btn span { font-size: 1.4rem; line-height: 1.1; }
.nav-btn[aria-current="page"] { background: var(--card2); color: var(--txt); }

.banner { display: flex; gap: 10px; align-items: center; background: rgba(232, 74, 95, .15); border: 2px solid var(--red); border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: .92rem; }
.banner p { margin: 0; flex: 1; }

h2.title { font-size: 1.4rem; margin: 14px 0 4px; }
.lead { color: var(--muted); margin: 0 0 14px; }

/* ---------- Carte ---------- */
.fog { background: linear-gradient(135deg, rgba(47, 143, 230, .25), rgba(155, 110, 243, .2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.fog .bit { font-size: 2.2rem; }
.fog p { margin: 0; }
.districts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .districts { grid-template-columns: repeat(4, 1fr); } }
.district {
  position: relative; text-align: left; border: 0; cursor: pointer; border-radius: var(--radius); padding: 14px 12px 12px;
  background: var(--card); box-shadow: var(--shadow); min-height: 150px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.district::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--axis, var(--blue)); }
.district .ico { font-size: 2.1rem; }
.district b { font-size: 1rem; line-height: 1.25; }
.district .axis { font-size: .75rem; font-weight: 800; color: var(--axis); text-transform: uppercase; letter-spacing: .5px; }
.district .st { margin-top: auto; font-size: .8rem; color: var(--muted); }
.district.locked { filter: grayscale(.8); opacity: .6; }
.district.soon .ico { opacity: .5; }
.district.done { background: linear-gradient(160deg, #1f4a3a, var(--card)); }
.district.current { outline: 3px solid var(--yellow); }
.axis-choisir { --axis: var(--yellow); }
.axis-comprendre { --axis: var(--blue); }
.axis-creer { --axis: var(--green); }
.axis-entreprendre { --axis: var(--orange); }

/* ---------- Chapitre ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; padding: 8px 0; font-size: .95rem; }
.chapter-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 14px; }
.chapter-head .ico { font-size: 3rem; }
.missions { display: grid; gap: 10px; }
.mission-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px 14px; }
.mission-row .num { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.mission-row.done .num { background: var(--green); color: #0c2306; }
.mission-row .mt { flex: 1; min-width: 0; }
.mission-row .mt small { display: block; color: var(--muted); }
.mission-row.locked { opacity: .55; }

/* ---------- Mission ---------- */
.mission-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.mission-bar b { flex: 1; font-size: .95rem; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.dots i { flex: 1; min-width: 10px; height: 6px; border-radius: 4px; background: #0b1631; }
.dots i.on { background: var(--yellow); }
.scene { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.bubble { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.bubble .who-ico { font-size: 2.3rem; line-height: 1; flex: none; }
.bubble .who { font-weight: 800; font-size: .85rem; color: var(--yellow); text-transform: uppercase; letter-spacing: .5px; }
.bubble p { margin: 4px 0 0; font-size: 1.05rem; }
.bubble.narr { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.bubble.narr .who { color: var(--muted); }
.bubble.reply { background: #1e3f5e; border-left: 6px solid var(--blue); }
.opts { display: grid; gap: 10px; margin-bottom: 14px; }
.opt { text-align: left; min-height: 56px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-size: 1rem; font-weight: 600; }
.opt:hover { border-color: var(--yellow); }
.opt.picked { border-color: var(--yellow); background: #2b4b96; }
.opt.wrong { border-color: var(--red); background: rgba(232, 74, 95, .12); animation: shake .35s; }
.opt.right { border-color: var(--ok); background: rgba(95, 208, 122, .15); }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hint { background: rgba(246, 199, 0, .12); border: 2px solid var(--yellow); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.explain { background: rgba(95, 208, 122, .12); border: 2px solid var(--ok); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 160px; }

/* Téléphone factice des Ruses */
.phone { max-width: 340px; margin: 0 auto 16px; background: #05070f; border-radius: 34px; padding: 14px 10px 20px; box-shadow: var(--shadow), inset 0 0 0 2px #2c3550; }
.phone-top { display: flex; justify-content: space-between; color: #9aa6c9; font-size: .75rem; padding: 0 12px 8px; }
.phone-app { background: #f3f5fb; color: #101828; border-radius: 22px; padding: 10px; min-height: 280px; display: flex; flex-direction: column; gap: 8px; }
.phone-app h4 { margin: 2px 6px 4px; font-size: .9rem; color: #475467; }
.mock { text-align: left; background: #fff; color: #101828; border: 2px solid #e4e7ec; border-radius: 14px; padding: 10px 12px; cursor: pointer; font-size: .92rem; line-height: 1.35; }
.mock:hover { border-color: #98a2b3; }
.mock.found, .mock.mock-countdown.found { border-color: var(--green); background: #e9f9ec; color: #0c2306; }
.mock.miss { border-color: var(--red); animation: shake .35s; }
.mock.clue { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(246, 199, 0, .55); } }
.mock-video { height: 86px; width: 100%; border-radius: 10px; background: linear-gradient(135deg, #344054, #101828); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 6px; }
.mock-countdown { background: #101828; color: #fff; border-color: #101828; }
.mock-loading { color: #667085; text-align: center; }
.mock-badge { background: #e11d48; color: #fff; border-radius: 10px; padding: 0 6px; font-size: .78rem; font-weight: 800; }
.mock-tag { color: #667085; font-size: .78rem; }
.ruse-card { display: flex; gap: 12px; background: linear-gradient(135deg, #2c2a6b, #1a3268); border: 2px solid var(--purple); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; animation: rise .4s ease; }
.ruse-card .ri { font-size: 2.4rem; }
.ruse-card h3 { margin: 0 0 6px; }
.ruse-card p { margin: 4px 0; font-size: .95rem; }
.tagline-sm { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--purple); font-weight: 800; }

/* Journée virtuelle */
.day-left { position: sticky; top: 124px; z-index: 5; background: var(--yellow); color: #241a00; font-weight: 800; border-radius: 12px; padding: 8px 14px; margin-bottom: 10px; text-align: center; }
.day-left.full { background: var(--ok); color: #0c2306; }
.acts { display: grid; gap: 8px; margin-bottom: 14px; }
.act { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 8px 10px; }
.act .ai { font-size: 1.6rem; width: 36px; text-align: center; }
.act .an { flex: 1; font-weight: 600; font-size: .95rem; }
.act .an small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--card2); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.stepper button[disabled] { opacity: .35; }
.stepper output { width: 26px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.result-bars { display: grid; gap: 8px; margin: 10px 0 14px; }
.rbar { display: grid; grid-template-columns: 110px 1fr 30px; gap: 8px; align-items: center; font-size: .9rem; }
.rbar .track { height: 14px; background: #0b1631; border-radius: 8px; overflow: hidden; }
.rbar .track span { display: block; height: 100%; border-radius: 8px; }
.notes { margin: 0 0 14px; padding-left: 20px; }
.notes li { margin-bottom: 6px; }

/* Cartes et créations */
.hero-card { max-width: 340px; margin: 0 auto 16px; border-radius: 22px; padding: 18px; background: linear-gradient(150deg, #2f8fe6, #9b6ef3 60%, #e84a5f); box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden; }
.hero-card .hc-top { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.hero-card .hc-top img { width: 46px; }
.hero-card .hc-av { font-size: 4rem; margin: 6px 0 0; }
.hero-card .hc-name { font-size: 1.4rem; font-weight: 900; }
.hero-card .hc-lvl { font-size: .85rem; opacity: .9; }
.hero-card .hc-dev { margin-top: 10px; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 10px; font-style: italic; font-weight: 600; }
.radio-list { display: grid; gap: 8px; margin-bottom: 12px; }
.radio-list .opt { font-weight: 600; }
.carnet-list { display: grid; gap: 8px; margin-bottom: 14px; }
.carnet-item { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 10px 12px; border: 2px solid transparent; cursor: pointer; text-align: left; }
.carnet-item[aria-pressed="true"] { border-color: var(--yellow); }
.carnet-item .ci { font-size: 1.6rem; }
.carnet-item p { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.counter { text-align: right; font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Bilan */
.bilan { text-align: center; }
.bilan .big { font-size: 3.4rem; }
.badge { display: inline-flex; gap: 10px; align-items: center; background: var(--card); border: 2px solid var(--yellow); border-radius: 16px; padding: 10px 14px; margin: 8px 0 14px; text-align: left; }
.badge .bi { font-size: 2rem; }
.deltas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 14px; }
.delta { background: var(--card); border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: .9rem; }
.pause-screen { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; }
.pause-screen img { width: 150px; }
.pause-screen .moon { font-size: 3.4rem; }

/* Carnet de Héros */
.axes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.axis-card { background: var(--card); border-radius: 16px; padding: 12px; border-top: 6px solid var(--axis); }
.axis-card b { display: block; }
.axis-card .lvl { font-size: 1.15rem; font-weight: 900; color: var(--axis); }
.axis-card .pips { display: flex; gap: 4px; margin-top: 6px; }
.axis-card .pips i { flex: 1; height: 6px; border-radius: 4px; background: #0b1631; }
.axis-card .pips i.on { background: var(--axis); }
.comp-list { display: grid; gap: 6px; margin-bottom: 18px; }
.comp { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 12px; font-size: .93rem; }
.comp.off { opacity: .5; }
.ruses-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 640px) { .ruses-grid { grid-template-columns: repeat(3, 1fr); } }
.ruse-tile { background: var(--card); border-radius: 16px; padding: 12px; text-align: center; border: 2px solid var(--purple); }
.ruse-tile.off { border-color: var(--line); color: var(--muted); }
.ruse-tile .ri { font-size: 2rem; }
.ruse-tile b { display: block; font-size: .92rem; }
.ruse-tile small { display: block; color: var(--muted); font-size: .78rem; margin-top: 4px; }
h3.sec { font-size: 1.05rem; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.g-item { border: 0; background: var(--card); border-radius: 16px; padding: 14px; text-align: left; cursor: pointer; min-height: 130px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.g-item .gi { font-size: 2.2rem; }
.g-item b { font-size: .95rem; line-height: 1.25; }
.g-item small { color: var(--muted); margin-top: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; background: var(--card); border-radius: var(--radius); }
.empty .ei { font-size: 3rem; }

/* ---------- Robot du port ---------- */
.robot-wrap { display: grid; gap: 14px; }
@media (min-width: 720px) { .robot-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.board-box { background: var(--card); border-radius: var(--radius); padding: 12px; }
.board { position: relative; width: 100%; aspect-ratio: 1; display: grid; gap: 3px; background: #0b3a6b; border-radius: 12px; padding: 3px; }
.cell { min-width: 0; min-height: 0; overflow: hidden; line-height: 1; background: #c9a36b; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: var(--cfs, 1.6rem); }
.cell.alt { background: #d6b27a; }
.cell.goal { background: #5aa9e6; }
.robot { position: absolute; display: flex; align-items: center; justify-content: center; transition: transform .38s ease; z-index: 2; pointer-events: none; }
.robot .rb { font-size: var(--rfs, 1.8rem); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .35)); }
.robot .dir { position: absolute; inset: 0; transition: transform .3s ease; }
.robot .dir::after { content: ""; position: absolute; left: 50%; top: -2px; transform: translateX(-50%); border: 8px solid transparent; border-bottom: 12px solid var(--yellow); border-top: 0; }
.robot.crash .rb { animation: shake .35s 2; }
.boom { position: absolute; z-index: 3; font-size: var(--rfs, 1.8rem); display: flex; align-items: center; justify-content: center; pointer-events: none; animation: rise .3s; }
.board-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.prog-box { background: var(--card); border-radius: var(--radius); padding: 12px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pal { min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 0; font-weight: 800; font-size: .92rem; cursor: pointer; color: #fff; }
.t-avancer { background: var(--blue); }
.t-gauche, .t-droite { background: var(--orange); }
.t-repeter { background: #2f9a52; }
.t-si { background: var(--purple); }
.program { background: #0d1a3a; border-radius: 12px; padding: 8px; min-height: 120px; max-height: 52vh; overflow-y: auto; }
.blist { display: flex; flex-direction: column; gap: 6px; }
.chip { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; border-radius: 10px; font-weight: 800; font-size: .9rem; cursor: pointer; color: #fff; border: 3px solid transparent; text-align: left; width: 100%; }
.chip.sel { border-color: var(--yellow); }
.chip.run { box-shadow: 0 0 0 3px #fff; }
.chip.bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red); }
.chip .num { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.chip .num span { cursor: pointer; width: 30px; height: 30px; border-radius: 8px; background: rgba(0, 0, 0, .25); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cont { border-radius: 12px; padding: 4px; }
.cont.t-repeter { background: rgba(47, 154, 82, .25); }
.cont.t-si { background: rgba(155, 110, 243, .22); }
.cont > .chip { width: 100%; }
.cont-body { margin: 6px 0 4px 16px; display: flex; flex-direction: column; gap: 6px; padding-left: 8px; border-left: 3px solid rgba(255, 255, 255, .25); }
.cont-label { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; margin: 2px 0 0 18px; }
.slot { min-height: 34px; border: 2px dashed rgba(255, 255, 255, .3); border-radius: 10px; background: transparent; color: var(--muted); font-size: .8rem; font-weight: 700; cursor: pointer; }
.slot.cursor { border-color: var(--yellow); color: var(--yellow); background: rgba(246, 199, 0, .08); }
.prog-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.prog-info { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-top: 6px; }
.code-js { background: #050b1c; color: #9fe3a9; border-radius: 12px; padding: 10px 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem; white-space: pre; overflow-x: auto; margin: 10px 0 0; min-height: 40px; }
.run-row { display: flex; gap: 8px; margin-top: 10px; }
.run-row .btn { flex: 1; }
.tip { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- Modales ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(4, 9, 24, .72); display: flex; align-items: flex-end; justify-content: center; padding: 12px; animation: fade .2s; }
@media (min-width: 640px) { .modal-back { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px calc(18px + var(--safe-b)); box-shadow: var(--shadow); animation: rise .25s ease; }
.modal .m-ico { font-size: 2.8rem; text-align: center; line-height: 1.1; }
.modal h2 { margin: 6px 0 8px; font-size: 1.3rem; text-align: center; }
.modal .m-body { margin-bottom: 16px; }
.modal .m-body p { margin: 6px 0; }
.modal .m-actions { display: grid; gap: 10px; }
.settings-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.settings-sec:first-child { border: 0; margin: 0; padding: 0; }

.contact { display: grid; gap: 8px; margin-top: 12px; }

/* ---------- Version 1.3 : lexique, accessibilité, questionnaire ---------- */
.term { display: inline; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.term:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
.chip-row { display: flex; gap: 6px; align-items: stretch; }
.chip-row .chip { flex: 1; }
.cnt { width: 44px; min-height: 42px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .3); color: #fff; font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.cnt:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.cnt[disabled] { opacity: .35; cursor: default; }
.run-row { flex-wrap: wrap; }
.run-row .btn { min-width: 0; padding: 12px 10px; }
.step-info { min-height: 1.2em; margin: 6px 0 0; font-size: .85rem; color: var(--yellow); font-weight: 700; }
.speeds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.speed-opt { text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: .92rem; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.quest-card { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, rgba(246, 199, 0, .18), rgba(87, 185, 71, .15)); border: 2px solid var(--yellow); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.quest-card > span { font-size: 2rem; }
.quest-card div { flex: 1; }
.quest-card p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.lexique { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
@media (min-width: 640px) { .lexique { grid-template-columns: repeat(3, 1fr); } }
.lex-item { display: flex; gap: 8px; align-items: center; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--card); font-weight: 700; font-size: .9rem; text-align: left; cursor: pointer; }
.lex-item span { font-size: 1.3rem; }
.progress-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; margin-bottom: 18px; }
.progress-row small { display: block; color: var(--muted); }
.progress-row b { font-size: 1.6rem; }
.carnet-item.picked { border-color: var(--yellow); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Version 1.4 : abonnement ---------- */
.status-card { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; border: 2px solid var(--yellow); background: linear-gradient(135deg, rgba(246, 199, 0, .14), rgba(47, 143, 230, .12)); }
.status-card.st-expire { border-color: var(--orange); background: linear-gradient(135deg, rgba(243, 146, 33, .18), rgba(232, 74, 95, .12)); }
.status-card.st-desactive { border-color: var(--red); background: rgba(232, 74, 95, .14); }
.status-card .sc-head { display: flex; gap: 10px; align-items: center; font-size: 1.1rem; margin-bottom: 4px; }
.status-card .sc-head span { font-size: 1.8rem; }
.status-card p { margin: 6px 0; }
.status-card .notes { margin: 6px 0; }
.status-card .actions { margin-top: 10px; }
.banner.sub-soon { border-color: var(--yellow); background: rgba(246, 199, 0, .12); }
