/* LCT Scolaire — © LeCodeTech */
:root {
  --bic: #1F3BD1; --bic-d: #1730B0; --bic-soft: #E8ECFD; --ink: #141A3A; --ink2: #454C73; --line: #CDD5F0; --line2: #E6EAF7;
  --paper: #F6F7FB; --card: #FFFFFF; --red: #C42E41; --red-soft: #FBE3E6; --yellow: #FFE34F; --yellow-soft: #FFF6C9;
  --green: #1E7B45; --green-soft: #DDF2E6; --violet: #6D3FD6; --orange: #D06A12; --teal: #00739E; --r: 14px; --r-s: 10px;
  --f: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mf: "Cambria Math", "STIX Two Math", "Latin Modern Math", Cambria, "Times New Roman", serif;
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.45 var(--f); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bic); }
.ic { width: 22px; height: 22px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); }
.small { font-size: .88rem; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--bic); outline-offset: 2px; }

/* Écrans d'accueil */
.boot, .gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }
.gate__in { width: 100%; max-width: 440px; display: grid; gap: 18px; }
.gate__logo { width: 220px; height: auto; }
.gate h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.gate p { margin: 0; }
.gate .card { padding: 20px; }
.devcode { font-size: .85rem; color: var(--ink2); }
.devcode b { letter-spacing: .06em; color: var(--ink); }
.roles { display: grid; gap: 10px; }
.role { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; }
.role[aria-pressed="true"] { border-color: var(--bic); box-shadow: inset 0 0 0 1.5px var(--bic); background: var(--bic-soft); }
.role .em { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--bic); color: #fff; flex: none; }
.role b { display: block; } .role small { color: var(--ink2); }

/* Barre du haut */
.top { position: sticky; top: 0; z-index: 20; background: var(--bic); color: #fff; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.top__in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 40px; }
.top__sym { width: 46px; height: 28px; flex: none; color: #fff; }
.top__home { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: #fff; text-decoration: none; }
.top__txt { min-width: 0; flex: 1; }
.top__txt b { display: block; font-size: 1.06rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__txt small { display: block; opacity: .82; font-size: .78rem; }
.top__btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; cursor: pointer; flex: none; }
.top__btn--back { background: transparent; margin-left: -8px; }
.top h1 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-bar { background: var(--yellow); color: var(--ink); font-size: .9rem; padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; }
.demo-bar a { color: var(--ink); font-weight: 700; }

/* Contenu */
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 40px + var(--safe-b)); display: grid; gap: 14px; }
main.no-nav { padding-bottom: calc(40px + var(--safe-b)); }
h2 { margin: 0 0 10px; font-size: 1.05rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card--big { background: var(--bic); color: #fff; border-color: var(--bic); }
.card--tight { padding: 12px; }
.hello { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hello h1 { margin: 0; font-size: 1.4rem; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.rows li, .row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.rows li:last-child { border-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--paper); border-radius: var(--r-s); padding: 12px; min-width: 0; }
.kpi span { display: block; font-size: .82rem; color: var(--ink2); }
.kpi b { display: block; font-size: 1.2rem; margin-top: 2px; overflow-wrap: anywhere; }
.alert { display: flex; gap: 10px; align-items: center; padding: 13px 14px; border-radius: var(--r-s); background: var(--bic-soft); color: var(--ink); text-decoration: none; font-weight: 600; border: 0; width: 100%; text-align: left; cursor: pointer; }
.alert--warn { background: var(--yellow-soft); } .alert--bad { background: var(--red-soft); color: #7A1726; } .alert--ok { background: var(--green-soft); color: #14532D; }
.alert span { flex: 1; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn--main { background: var(--bic); border-color: var(--bic); color: #fff; }
.btn--main:active { background: var(--bic-d); }
.btn--light { background: #fff; color: var(--bic); border-color: #fff; }
.btn--yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn--wa { background: #1E8E4E; border-color: #1E8E4E; color: #fff; }
.btn--danger { color: var(--red); border-color: #F0B8C0; }
.btn--dangerfill { background: var(--red); border-color: var(--red); color: #fff; }
.btn--green { background: var(--green); border-color: var(--green); color: #fff; }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 7px 14px; font-size: .92rem; }
.btn--xl { min-height: 64px; font-size: 1.15rem; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btns .btn { flex: 1 1 auto; }
.link { background: none; border: 0; padding: 0; color: var(--bic); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Formulaires */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lab { font-weight: 700; font-size: .95rem; }
.field small { color: var(--ink2); font-size: .85rem; }
.in, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.05rem;
}
.field textarea { min-height: 84px; }
textarea.big { min-height: 220px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .in:focus { border-color: var(--bic); outline: none; box-shadow: 0 0 0 3px var(--bic-soft); }
.field--row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; display: grid; }
.field--row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; display: grid; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.err { color: var(--red); font-weight: 600; margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
a.chip { text-decoration: none; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--blue[aria-pressed="true"] { background: var(--bic); border-color: var(--bic); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days .chip { justify-content: center; padding: 6px 0; border-radius: 10px; }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 14px; color: var(--ink2); pointer-events: none; }
.search input { padding-left: 44px !important; }
.seg { display: flex; background: var(--line2); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; cursor: pointer; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,26,58,.15); }
.toggle { position: relative; width: 52px; height: 32px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(20px); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; min-width: 0; }
.li__main { flex: 1; min-width: 0; }
.li__main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__main small { display: block; color: var(--ink2); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li__side { text-align: right; flex: none; }
.li__side b { display: block; }
.li--off { opacity: .55; }
.li .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.li .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; flex: none; cursor: pointer; color: transparent; padding: 0; }
.li .tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.li .tick .ic { width: 18px; height: 18px; }
.li--done b { text-decoration: line-through; color: var(--ink2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--green-soft); color: #14532D; white-space: nowrap; }
.badge--warn { background: var(--yellow-soft); color: #6B4E00; } .badge--bad { background: var(--red-soft); color: #7A1726; } .badge--muted { background: var(--line2); color: var(--ink2); } .badge--blue { background: var(--bic-soft); color: var(--bic); }
.group-title { margin: 8px 2px 0; font-size: .85rem; color: var(--ink2); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.empty { text-align: center; padding: 28px 16px; display: grid; gap: 12px; justify-items: center; }
.empty p { margin: 0; color: var(--ink2); }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--ink2); } .dl dd { margin: 0; text-align: right; font-weight: 700; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-weight: 600; color: var(--ink2); padding: 9px 10px 9px 0; vertical-align: top; width: 42%; font-size: .92rem; border-bottom: 1px solid var(--line2); }
.ptable td { padding: 9px 0; border-bottom: 1px solid var(--line2); font-weight: 600; overflow-wrap: anywhere; }
.ptable tr:last-child th, .ptable tr:last-child td { border-bottom: 0; }

/* Accueil */
.hero { background: linear-gradient(135deg, #1F3BD1 0%, #2A3160 100%); color: #fff; border: 0; display: grid; gap: 12px; }
.hero h1 { margin: 0; font-size: 1.45rem; line-height: 1.2; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .meta span { background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.xp { display: grid; gap: 6px; }
.xp .lbl { display: flex; justify-content: space-between; font-size: .85rem; opacity: .92; }
.xp .track { height: 10px; border-radius: 6px; background: rgba(255,255,255,.2); overflow: hidden; }
.xp .fill { height: 100%; background: var(--yellow); border-radius: 6px; }
.track { height: 10px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.track .fill { height: 100%; background: var(--bic); border-radius: 6px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tilem { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; min-height: 112px; }
.tilem .em { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tilem b { display: block; line-height: 1.2; }
.tilem small { color: var(--ink2); font-size: .82rem; line-height: 1.3; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { display: grid; grid-template-columns: 58px 4px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.tl li:last-child { border-bottom: 0; }
.tl .t { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; }
.tl .bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--bic); }
.tl b { display: block; } .tl small { color: var(--ink2); }
.tl li.now { background: var(--yellow-soft); border-radius: 10px; padding-left: 6px; padding-right: 6px; }
.defi { background: var(--yellow-soft); border-color: #F3DE7A; }

/* Mathématiques */
.m { font-family: var(--mf); font-size: 1.12em; line-height: 1.6; }
.m i, .res i, .tv i, .vals i { font-family: var(--mf); }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .12em; font-size: .92em; line-height: 1.15; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .2em .06em; }
.fr > span:last-child { padding: .06em .2em 0; }
.sq { white-space: nowrap; }
.sq > span { border-top: 1.5px solid currentColor; padding: 0 .1em; margin-left: .04em; }
.sq .ri { font-size: .6em; margin-right: -.4em; vertical-align: .9em; }
sup { font-size: .7em; line-height: 0; }
.approx { color: var(--ink2); font-size: .9em; white-space: nowrap; }
.words { font-size: 1.1rem; font-weight: 700; line-height: 1.4; }

/* Calculatrice */
.calc { display: grid; gap: 10px; }
.screen { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; }
.screen:focus-within { border-color: var(--bic); box-shadow: 0 0 0 3px var(--bic-soft); }
.screen textarea { width: 100%; border: 0; outline: 0; resize: none; font: 500 1.35rem/1.35 var(--mf); min-height: 46px; padding: 2px 0; background: transparent; }
.screen .prev { min-height: 28px; color: var(--ink2); font-size: 1.05rem; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.screen .prev .live { font-weight: 700; color: var(--bic); font-family: var(--mf); font-size: 1.2rem; }
.screen .bar { display: flex; gap: 6px; align-items: center; }
.screen .bar .chip { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.qa { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.qa::-webkit-scrollbar { display: none; }
.qa .chip { background: var(--bic-soft); border-color: var(--bic-soft); color: var(--bic); font-weight: 700; }
.kp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.kp button { min-height: 52px; border-radius: 12px; border: 0; background: #fff; box-shadow: 0 1px 0 var(--line), inset 0 0 0 1px var(--line); font: 600 1.18rem var(--f); cursor: pointer; color: var(--ink); padding: 0 2px; user-select: none; -webkit-user-select: none; }
.kp button:active { transform: translateY(1px); background: var(--bic-soft); }
.kp .k-fn { background: var(--line2); font-size: .98rem; font-family: var(--mf); }
.kp .k-op { background: var(--bic-soft); color: var(--bic); font-weight: 800; }
.kp .k-eq { background: var(--bic); color: #fff; box-shadow: none; font-weight: 800; }
.kp .k-del { background: var(--red-soft); color: var(--red); }
.kp .k-shift { background: var(--yellow-soft); font-size: .88rem; }
.kp .k-shift[aria-pressed="true"] { background: var(--yellow); }
.kp .k-var { font-family: var(--mf); font-style: italic; }
.res { display: grid; gap: 10px; }
.res .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.res .head b { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bic); }
.res .interp { color: var(--ink2); overflow-x: auto; }
.res .blk { display: grid; gap: 2px; }
.res .blk .lbl { font-size: .82rem; color: var(--ink2); font-weight: 600; }
.res .blk.big .val { font-size: 1.45rem; font-weight: 600; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.res .blk .val { overflow-x: auto; }
.res .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.res .acts .chip { min-height: 36px; font-size: .86rem; }
.steps { margin: 0; padding: 12px 14px 12px 32px; background: var(--paper); border-radius: 12px; display: grid; gap: 6px; font-size: .95rem; }
.steps li { padding-left: 2px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--bic); padding: 4px 0; }
.notes { margin: 0; font-size: .86rem; color: var(--ink2); }
.err-card { border-color: #F0B8C0; background: #FFF8F9; }
.sys { display: inline-block; border-left: 2px solid currentColor; padding-left: 8px; }
.tv-wrap { overflow-x: auto; }
.tv, .vals { border-collapse: collapse; font-size: .95rem; min-width: 100%; }
.tv th, .vals th { text-align: left; padding: 6px 10px 6px 0; font-weight: 600; color: var(--ink2); white-space: nowrap; border-right: 1px solid var(--line); }
.tv td, .vals td { text-align: center; padding: 6px 8px; white-space: nowrap; font-family: var(--mf); }
.tv tr + tr td, .tv tr + tr th, .vals tr + tr td, .vals tr + tr th { border-top: 1px solid var(--line); }
.tv .arrow { font-size: 1.4rem; color: var(--bic); }
.tv .v-hi { vertical-align: top; } .tv .v-lo { vertical-align: bottom; }
.tv tr:last-child td { height: 64px; }
.tv .gap { border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); padding: 0 1px; }
.plot-wrap { display: grid; gap: 8px; }
.plot { width: 100%; height: 300px; border-radius: 12px; background: #fff; border: 1px solid var(--line); touch-action: none; display: block; }
.plot-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.plot-tools .coords { font-family: var(--mf); color: var(--ink2); font-size: .95rem; }
.mat { display: inline-grid; gap: 4px 14px; padding: 4px 10px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 6px; font-family: var(--mf); font-size: 1.05rem; text-align: center; vertical-align: middle; }
.mgrid { display: inline-grid; gap: 6px; }
.mgrid input { width: 64px; min-height: 42px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; font-size: 1rem; }
.formula { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.formula:last-child { border-bottom: 0; }
.formula b { font-size: .9rem; color: var(--ink2); font-weight: 600; }

/* Chrono */
.bigclock { text-align: center; font: 700 3.6rem/1 var(--f); font-variant-numeric: tabular-nums; letter-spacing: -1px; padding: 18px 0 8px; }
.bigclock small { font-size: .5em; color: var(--ink2); }
.ringbox { position: relative; width: min(280px, 78vw); aspect-ratio: 1; margin: 6px auto; }
.ringbox svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ringbox .bg { stroke: var(--line2); } .ringbox .fg { stroke: var(--bic); transition: stroke-dashoffset .25s linear; }
.ringbox .inner { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; }
.ringbox .inner b { font: 700 2.8rem/1 var(--f); font-variant-numeric: tabular-nums; }
.ringbox .inner small { color: var(--ink2); font-weight: 600; }
.ringbox.brk .fg { stroke: var(--green); }
.laps { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.laps td, .laps th { padding: 8px 6px; border-bottom: 1px solid var(--line2); text-align: right; }
.laps td:first-child, .laps th:first-child { text-align: left; }
.laps .best { color: var(--green); font-weight: 800; } .laps .worst { color: var(--red); font-weight: 800; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.presets .chip { justify-content: center; border-radius: 12px; }
.runner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; width: 100%; text-align: left; cursor: pointer; font-weight: 700; }
.runner.done { border-color: var(--green); background: var(--green-soft); }
.runner .t { margin-left: auto; font-variant-numeric: tabular-nums; }
.runner .rk { width: 28px; height: 28px; border-radius: 50%; background: var(--line2); display: grid; place-items: center; font-size: .85rem; flex: none; }
.runner.done .rk { background: var(--green); color: #fff; }
.examfull { position: fixed; inset: 0; z-index: 70; background: #0E1330; color: #fff; display: grid; place-items: center; align-content: center; gap: 18px; text-align: center; padding: 24px; }
.examfull .title { font-size: 1.4rem; font-weight: 700; opacity: .9; }
.examfull .digits { font: 800 min(22vw, 11rem)/1 var(--f); font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.examfull .digits.warn { color: var(--yellow); } .examfull .digits.end { color: #FF7A8A; }
.examfull .sub { font-size: 1.2rem; opacity: .85; }
.examfull .bar { width: min(800px, 90vw); height: 14px; border-radius: 8px; background: rgba(255,255,255,.15); overflow: hidden; }
.examfull .bar div { height: 100%; background: var(--yellow); }
.examfull .btns { justify-content: center; }
.examfull .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }

/* Alarme qui sonne, mode nuit */
.ringover { position: fixed; inset: 0; z-index: 90; background: linear-gradient(160deg, #1F3BD1, #0E1330); color: #fff; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px; text-align: center; }
.ringover .t { font: 800 5rem/1 var(--f); font-variant-numeric: tabular-nums; }
.ringover .lab { font-size: 1.3rem; font-weight: 700; }
.ringover .bell { width: 72px; height: 72px; animation: shake .5s infinite; }
.ringover .chal { background: rgba(255,255,255,.12); border-radius: 16px; padding: 16px; display: grid; gap: 10px; width: min(360px, 100%); }
.ringover .chal b { font-size: 1.8rem; }
.ringover input { min-height: 54px; border-radius: 12px; border: 0; text-align: center; font-size: 1.4rem; font-weight: 800; width: 100%; }
.ringover .btns { width: min(360px, 100%); }
.ringover .btn { min-height: 58px; font-size: 1.1rem; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.night { position: fixed; inset: 0; z-index: 80; background: #000; color: #8A93C9; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; padding: 24px; }
.night .t { font: 300 min(26vw, 9rem)/1 var(--f); font-variant-numeric: tabular-nums; color: #B9C2F2; }
.night .d { font-size: 1.1rem; }
.night .n { font-size: 1rem; opacity: .8; }
.night .btn { background: transparent; color: #8A93C9; border-color: #2A3160; margin-top: 24px; }

/* Jeux */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gcard { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; color: #fff; text-decoration: none; min-height: 132px; position: relative; overflow: hidden; }
.gcard b { font-size: 1.02rem; line-height: 1.2; }
.gcard small { opacity: .9; font-size: .82rem; line-height: 1.3; }
.gcard .best { position: absolute; right: 10px; top: 10px; background: rgba(255,255,255,.22); border-radius: 999px; padding: 2px 8px; font-size: .75rem; font-weight: 800; }
.gcard .em { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.qhead .timer { font-variant-numeric: tabular-nums; background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 12px; }
.qcard { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 26px 18px; text-align: center; font-size: 1.7rem; font-weight: 700; line-height: 1.35; min-height: 150px; display: block; align-content: center; }
.qcard small { display: block; font-size: 1rem; font-weight: 600; color: var(--ink2); margin-top: 6px; }
.qcard .blank { display: inline-block; min-width: 64px; border-bottom: 3px solid var(--bic); color: var(--bic); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choices button { min-height: 62px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 1.08rem; cursor: pointer; padding: 8px; line-height: 1.2; }
.choices button.ok { background: var(--green); border-color: var(--green); color: #fff; }
.choices button.ko { background: var(--red); border-color: var(--red); color: #fff; }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer { display: flex; gap: 8px; }
.answer input { flex: 1; min-height: 58px; border-radius: 14px; border: 1.5px solid var(--line); font-size: 1.5rem; font-weight: 800; text-align: center; min-width: 0; }
.answer input.ok { border-color: var(--green); background: var(--green-soft); } .answer input.ko { border-color: var(--red); background: var(--red-soft); }
.npad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.npad button { min-height: 54px; border-radius: 12px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 1.35rem; font-weight: 700; cursor: pointer; }
.npad .go { background: var(--bic); color: #fff; box-shadow: none; }
.npad .del { background: var(--red-soft); color: var(--red); }
.fb { padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.fb.ok { background: var(--green-soft); color: #14532D; } .fb.ko { background: var(--red-soft); color: #7A1726; }
.progress { height: 8px; background: var(--line2); border-radius: 6px; overflow: hidden; }
.progress div { height: 100%; background: var(--bic); transition: width .2s; }
.score { text-align: center; display: grid; gap: 8px; justify-items: center; }
.score .stars { font-size: 2.6rem; letter-spacing: 6px; color: #F5B800; }
.score .pts { font-size: 3rem; font-weight: 800; color: var(--bic); line-height: 1; }
.mem { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mem button { aspect-ratio: 3 / 4; border-radius: 12px; border: 0; background: var(--bic); color: #fff; font-weight: 800; font-size: .95rem; cursor: pointer; padding: 4px; line-height: 1.15; overflow-wrap: anywhere; }
.mem button.up { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--bic); }
.mem button.found { background: var(--green-soft); color: #14532D; box-shadow: none; }
.plaques { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.plaques button { min-height: 52px; border-radius: 10px; border: 0; background: var(--ink); color: var(--yellow); font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.plaques button.used { opacity: .3; }
.target { text-align: center; font: 800 3rem/1 var(--f); color: var(--bic); }

/* Résumés et cartes */
.kw { display: flex; flex-wrap: wrap; gap: 6px; }
.kw span { background: var(--bic-soft); color: var(--bic); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .88rem; }
.summary p { margin: 0 0 10px; line-height: 1.6; }
.summary ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.defs dt { font-weight: 800; } .defs dd { margin: 0 0 10px; color: var(--ink2); }
.flash { perspective: 1000px; }
.flash .inner { position: relative; min-height: 230px; transition: transform .45s; transform-style: preserve-3d; cursor: pointer; }
.flash.flipped .inner { transform: rotateY(180deg); }
.flash .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; padding: 20px; display: grid; place-items: center; text-align: center; font-size: 1.15rem; font-weight: 600; line-height: 1.45; border: 1.5px solid var(--line); background: #fff; overflow: auto; }
.flash .back { transform: rotateY(180deg); background: var(--bic-soft); border-color: var(--bic); }
.flash .face small { position: absolute; top: 10px; left: 14px; font-size: .75rem; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; }
.boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; }
.boxes div { background: var(--paper); border-radius: 10px; padding: 8px 4px; font-size: .78rem; color: var(--ink2); }
.boxes b { display: block; font-size: 1.2rem; color: var(--ink); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: #9AABF0; } .chart .bar--now { fill: var(--bic); }
.chart text { font: 600 9px var(--f); fill: var(--ink2); }
.chart .goal { stroke: var(--red); stroke-dasharray: 4 3; }

/* Notes */
.avg { display: grid; justify-items: center; gap: 2px; padding: 8px 0; }
.avg b { font: 800 3rem/1 var(--f); }
.avg small { color: var(--ink2); font-weight: 600; }
.marks input { width: 76px; min-height: 42px; text-align: center; border: 1.5px solid var(--line); border-radius: 10px; font-size: 1.05rem; font-weight: 700; }
.marks .li { padding: 8px 12px; }
.pick { text-align: center; padding: 30px 10px; font-size: 2rem; font-weight: 800; color: var(--bic); }

/* Barre du bas */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav__in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--nav-h); }
.nav a { display: grid; place-items: center; align-content: center; gap: 2px; color: var(--ink2); text-decoration: none; font-size: .74rem; font-weight: 600; position: relative; }
.nav a[aria-current="page"] { color: var(--bic); }
.nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--bic); }
.nav .run { position: absolute; top: 8px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

/* Dialogues */
.dlg-back { position: fixed; inset: 0; z-index: 60; background: rgba(20, 26, 58, .5); display: grid; align-items: end; padding: 16px; padding-bottom: calc(16px + var(--safe-b)); }
.dlg { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 440px; margin: 0 auto; display: grid; gap: 14px; box-shadow: 0 18px 40px rgba(20, 26, 58, .3); max-height: 90vh; overflow: auto; }
.dlg h2 { margin: 0; font-size: 1.15rem; }
@media (min-width: 560px) { .dlg-back { align-items: center; } }

/* Signature */
.sign { display: grid; justify-items: center; gap: 6px; padding: 18px 0 6px; text-align: center; font-size: .82rem; color: var(--ink2); }
.sign img { width: 150px; height: auto; }

.toast { position: fixed; left: 50%; top: calc(72px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 95; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(20,26,58,.3); animation: tin .2s ease-out; }
.toast--bad { background: var(--red); }
.toast--xp { background: var(--yellow); color: var(--ink); }
@keyframes tin { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast, .flash .inner, .ringover .bell { animation: none; transition: none; } }

@media (min-width: 560px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kp button { min-height: 56px; }
}
@media (min-width: 900px) { .calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; } }

#print { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; font: 12pt/1.5 Georgia, serif; color: #000; }
  #print h1 { font-size: 18pt; margin: 0 0 6pt; } #print h2 { font-size: 13pt; margin: 14pt 0 4pt; }
  #print .sigp { margin-top: 18pt; font: 9pt var(--f); color: #444; border-top: 1px solid #999; padding-top: 6pt; }
}
.screen textarea::placeholder { font-family: var(--f); font-size: 1.05rem; font-weight: 400; color: var(--ink2); opacity: .75; }
