/* Dōjō — mise en page. Couleurs et polices : theme.css. Rayons 3–4 px, ombres douces, beaucoup d'air. Aucun zoom : touch-action manipulation partout, champs ≥ 16 px. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* aucune barre de défilement visible (iOS et Mac), aucun débordement horizontal */
html, body { height: 100%; overflow: hidden; scrollbar-width: none; -ms-overflow-style: none; } html::-webkit-scrollbar, body::-webkit-scrollbar, .view::-webkit-scrollbar, .mlist::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* coque d'app : le corps ne défile jamais ; .view est la seule zone de défilement, et seulement si le contenu dépasse (un écran qui tient reste immobile) */
.view { position: fixed; top: 0; left: 0; right: 0; bottom: calc(46px + env(safe-area-inset-bottom)); margin: 0 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.tabs-hidden .view { bottom: 0; }
button, a, input, .tab, .sq, .mkey { touch-action: manipulation; }
html, body { margin: 0; color: var(--text); font: 15px/1.5 var(--font-body); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; touch-action: manipulation; }
body { height: 100%; background-color: var(--bg); background-image: var(--bg-image); }
.hidden { display: none !important; }
a { color: var(--accent-2); text-decoration: none; }
button { font-family: inherit; }

/* ---------- Surfaces ---------- */
.card, .qcard, .day, .mkey, .chip.on { background: var(--surface); color: var(--surface-text); }
.btn { background: var(--btn-bg); color: var(--btn-text); border: var(--border-w) solid var(--btn-border); box-shadow: var(--btn-shadow); }
.tabs { background: var(--tabs-bg); color: var(--tabs-text); }
.card { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; border: var(--border-w) solid var(--surface-border); box-shadow: var(--surface-shadow); background-image: var(--surface-image); overflow: hidden; }
.card .muted, .card.muted-in { color: var(--surface-muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; color: var(--text); }
.view { padding: calc(10px + env(safe-area-inset-top)) 20px 16px; max-width: 760px; }
.view section.fill { height: 100%; display: flex; flex-direction: column; min-height: 0; }
@media (min-width: 820px) { .view, .tabs { max-width: 900px; } }

/* ---------- Texte ---------- */
h1, h2, h3.title { font-family: var(--font-title); font-weight: var(--title-weight); letter-spacing: var(--title-tracking); }
h2 { font-size: 24px; margin: 12px 0 14px; line-height: 1.2; }
h3 { font-size: 13px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; letter-spacing: 0; }
.card h3 { color: var(--surface-muted); }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { font-size: 13px; color: var(--muted); margin-top: 8px; white-space: pre-wrap; }
.status.bad { color: var(--bad); } .status.ok { color: var(--ok); font-weight: 500; }
.card .status.bad { color: var(--bad-ink); } .card .status.ok { color: var(--ok-ink); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: var(--panel-2); padding: 2px 6px; border-radius: var(--radius-s); color: var(--text); }

/* ---------- Boutons, champs ---------- */
.btn { border-radius: var(--radius-s); padding: 11px 18px; font-size: 14.5px; font-weight: 700; cursor: pointer; letter-spacing: .01em; }
.btn:active { filter: brightness(.92); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.big { display: block; width: 100%; font-size: 17px; padding: 15px 20px; font-weight: 700; letter-spacing: .01em; }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.btn svg, .icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--panel-2); color: var(--text-2); padding: 9px 13px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { border-color: transparent; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 9px 6px; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: var(--radius-s); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--seg-on-bg); color: var(--seg-on-text); border-color: transparent; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.card input { background: rgba(255,255,255,.35); color: var(--surface-text); border-color: var(--surface-border); }
.pill { display: inline-block; white-space: nowrap; padding: 1px 7px; border-radius: var(--radius-s); border: 1px solid var(--surface-text-2); color: var(--surface-text-2); font-size: 11.5px; font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pill.bad { border-color: var(--bad-ink); color: var(--bad-ink); }
.pill.gold { border-color: var(--accent); color: var(--accent); }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; display: inline-flex; border-radius: var(--radius-s); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--panel-2); }

/* ---------- Connexion (dans l'app) ---------- */
.login { max-width: 360px; margin: 14vh auto 0; text-align: center; }
.login .mark { width: 84px; height: 84px; border-radius: 14px; margin-bottom: 10px; }
.login h1 { font-size: 34px; margin: 0 0 20px; }
.login input { width: 100%; font-size: 22px; text-align: center; letter-spacing: .2em; margin-bottom: 12px; }
.login .btn { width: 100%; }

/* ---------- Onglets ---------- */
/* Barre du bas : fine et compacte (≈ 46 px + zone sûre) ; masquée pendant une partie d'échecs (body.tabs-hidden), petit bouton pour la rappeler. */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; margin: 0 auto; padding: 2px 4px calc(2px + env(safe-area-inset-bottom)); z-index: 10; box-shadow: var(--tabs-shadow); border-top: 1px solid var(--tabs-border); }
.tab { flex: 1; border: 0; background: none; color: var(--tabs-text); font-size: 9.5px; line-height: 1.1; padding: 5px 0 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; letter-spacing: .02em; position: relative; }
.tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--tabs-active); font-weight: 700; }
.tab.active svg { stroke-width: 2.1; }
.tab.active::before { content: ''; position: absolute; top: -2px; left: 50%; width: 22px; height: 2px; margin-left: -11px; background: var(--tabs-mark); }
body.tabs-hidden .tabs { display: none; }
.tabs-toggle { display: none; position: fixed; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); z-index: 60; align-items: center; justify-content: center; cursor: pointer; opacity: .8; }
/* pendant une partie de calcul : bouton en haut au centre, et la barre repasse au-dessus du plein écran si on la rappelle */
body.calc-run .tabs-toggle { bottom: auto; right: auto; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); }
body.calc-run:not(.tabs-hidden) .tabs { z-index: 55; }
body.calc-run:not(.tabs-hidden) .mrun { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
body.tabs-hidden .tabs-toggle { display: inline-flex; }
.tabs-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Planning (contenu inchangé) ---------- */
.weeknav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.weeknav > button { border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--panel-2); color: var(--text); width: 40px; height: 40px; cursor: pointer; font-size: 20px; line-height: 1; }
.weeknav b { font-family: var(--font-title); font-weight: 500; font-size: 17px; }
.weeknav .linkbtn, .weeknav .small { display: inline-block; margin-top: 3px; }
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.day { border-radius: var(--radius); padding: 8px 5px; min-height: 0; border: var(--border-w) solid var(--surface-border); box-shadow: var(--surface-shadow); background-image: var(--surface-image); }
.day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day h4 { margin: 0 0 6px; font-size: 10.5px; text-align: center; color: var(--surface-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.day h4 b { display: block; font-size: 19px; color: var(--surface-text); letter-spacing: 0; font-family: var(--font-title); font-weight: 700; }
.day.today h4 b { color: var(--bad-ink); }
.day.off { opacity: .75; }
.week { --h: 44px; --g: 4px; flex: 1; min-height: 0; }
.period { height: calc(var(--h) * var(--span, 1) + var(--g) * (var(--span, 1) - 1)); margin-bottom: var(--g); }
.period.after-break { margin-top: 10px; }
.period.after-lunch { margin-top: 26px; position: relative; }
.period.after-lunch::before { content: ''; position: absolute; left: 8%; right: 8%; top: -14px; border-top: 1px dashed var(--surface-line); }
.slot { height: 100%; font-size: 11.5px; line-height: 1.15; padding: 4px 5px; border-radius: var(--radius-s); background: var(--surface-tint); color: var(--slot-text); overflow: hidden; }
.slot .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.slot small { display: block; color: var(--slot-text); opacity: .72; font-size: 10px; }
/* une couleur par matière ; tests, examens et semestriels en rose */
.slot.s-maths { background: var(--subj-maths); } .slot.s-mathsos { background: var(--subj-mathsos); } .slot.s-mathsr { background: var(--subj-mathsr); }
.slot.s-phys { background: var(--subj-phys); } .slot.s-physos { background: var(--subj-physos); } .slot.s-chimie { background: var(--subj-chimie); } .slot.s-bio { background: var(--subj-bio); }
.slot.s-fr { background: var(--subj-fr); } .slot.s-angl { background: var(--subj-angl); } .slot.s-ita { background: var(--subj-ita); } .slot.s-all { background: var(--subj-all); }
.slot.s-hist { background: var(--subj-hist); } .slot.s-geo { background: var(--subj-geo); } .slot.s-arts { background: var(--subj-arts); } .slot.s-soutien { background: var(--subj-soutien); } .slot.s-other { background: var(--subj-other); }
.slot.exam, .slot.test, .slot.semestriel { background: var(--pink); color: var(--pink-ink); font-weight: 700; }
.slot.exam small, .slot.test small, .slot.semestriel small { color: var(--pink-ink); }
.slot.off { height: auto; background: transparent; color: var(--surface-muted); font-style: italic; font-size: 10px; text-align: center; padding: 2px 0 6px; letter-spacing: -.02em; white-space: normal; }
@media (max-width: 480px) { .week { gap: 4px; --h: 40px; --g: 3px; } .period.after-break { margin-top: 8px; } .period.after-lunch { margin-top: 22px; } .period.after-lunch::before { top: -12px; } .slot { font-size: 10px; padding: 3px 3px; } .slot small { font-size: 9px; } .slot small .end { display: none; } .day { padding: 6px 3px; } }

/* ---------- Notes ---------- */
.avgs { text-align: center; padding: 10px 0 6px; }
.avgs .lab { font-size: 13px; color: var(--muted); font-weight: 500; }
.avg.big { font-family: var(--font-title); font-size: 64px; font-weight: 500; line-height: 1.1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.avg.bad { color: var(--bad); } .avg.good { color: var(--ok-deep); }
td.good, table.summary td.good b { color: var(--ok-ink); }
.gap { color: var(--bad); font-weight: 600; font-size: 13px; }
.card .gap { color: var(--bad-ink); }
.lastsync { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
table.summary { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
table.summary col.c { width: 64px; }
table.summary th { font-size: 10.5px; color: var(--surface-muted); font-weight: 700; text-align: left; padding: 8px 8px 6px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
table.summary td { padding: 10px 8px; border-top: 1px solid var(--surface-line); }
table.summary td:first-child { padding-left: 12px; }
table.summary .c { text-align: center; }
table.summary tr.subj { cursor: pointer; }
table.summary tr.subj.open td { background: var(--surface-tint); }
table.summary .chev { display: inline-block; width: 16px; color: var(--surface-muted); font-size: 11px; }
table.summary tr.detail td { padding: 4px 12px 12px 28px; background: var(--surface-tint); }
table.summary tr.under td.hl b { color: var(--bad-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
table.summary td .gap.small { font-weight: 500; font-size: 11.5px; }
td.bad, .grades b.bad { color: var(--bad-ink); }
table.grades { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.grades col.d { width: 50px; } table.grades col.c { width: 44px; } table.grades col.n { width: 56px; }
table.grades td:first-child, table.grades td:last-child { white-space: nowrap; }
table.grades td, table.grades th { padding: 6px 4px; border-top: 1px solid var(--surface-line); text-align: left; }
table.grades td { overflow-wrap: anywhere; }
table.grades th { font-size: 11px; color: var(--surface-muted); font-weight: 700; border-top: 0; text-transform: uppercase; letter-spacing: .08em; }
table.grades td.c, table.grades th.c { text-align: center; }
.sync { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 6px; } .sync .status { margin-top: 0; text-align: center; }
.sync-btn.busy svg { animation: spin 1s linear infinite; }
.sync-bar { width: 160px; height: 3px; border-radius: 2px; background: var(--panel-2); overflow: hidden; } .sync-bar i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 2px; animation: slide 1.1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } } @keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* ---------- Liste ---------- */
.quick { display: block; margin-bottom: 12px; } .quick .line { display: flex; gap: 8px; margin-top: 8px; } .quick input { flex: 1; font-size: 16px; }
.counter { font-size: 13px; color: var(--muted); margin: 2px 0 12px; }
.qcard { border-radius: var(--radius); padding: 12px 14px 8px; margin-bottom: 10px; border: var(--border-w) solid var(--surface-border); box-shadow: var(--surface-shadow); background-image: var(--surface-image); transition: opacity .3s ease, transform .3s ease, max-height .3s ease; overflow: hidden; }
.qcard .qtitle { font-size: 17px; font-weight: 600; line-height: 1.3; }
.qcard .kind { font-size: 11.5px; font-weight: 600; color: var(--surface-muted); margin-bottom: 2px; }
.qcard .qdate { font-size: 11.5px; color: var(--surface-muted); margin-top: 2px; }
.qfoot { display: flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer; user-select: none; }
.qfoot input { position: absolute; opacity: 0; width: 0; height: 0; }
.qfoot .box { width: 22px; height: 22px; border: 2px solid var(--surface-text); border-radius: var(--radius-s); display: inline-flex; align-items: center; justify-content: center; background: transparent; transition: background .2s, border-color .2s; }
.qfoot .box svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s ease .05s; }
.qfoot .small { color: var(--surface-muted); }
.qcard.checked .box { background: var(--surface-text); }
.qcard.checked .box svg { stroke-dashoffset: 0; }
.qcard.gone { opacity: 0; transform: translateX(30px); max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
.qcard.settled .qtitle { color: var(--surface-muted); font-weight: 500; text-decoration: line-through; }
.qcard .actions a { margin-right: 10px; color: var(--surface-text-2); text-decoration: underline; }

/* ---------- Calcul ---------- */
.modes { margin-top: 18px; }
body.noscroll { overflow: hidden; height: 100dvh; }
.mrun { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom)); touch-action: manipulation; user-select: none; -webkit-user-select: none; color: var(--text); }
.mtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mscore { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.mmid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.mtag { font-size: 12.5px; color: var(--muted); font-weight: 600; height: 16px; }
.mcalc { font-size: 46px; font-weight: 700; letter-spacing: -.01em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mans { min-width: 150px; min-height: 60px; padding: 8px 18px; border: 2px solid var(--line-2); border-radius: var(--radius); background: var(--panel); font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s; }
.mans .caret { display: inline-block; width: 2px; height: 34px; background: var(--accent); margin-left: 3px; animation: blink 1s infinite; }
.mans.ok { border-color: var(--ok); color: var(--ok); } .mans.bad { border-color: var(--bad); color: var(--bad); } .mans.ok .caret, .mans.bad .caret { display: none; }
.mfix { height: 34px; font-size: 26px; font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }
.mkeys { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8px; height: min(44vh, 340px); }
.mkey { border: 0; border-radius: var(--radius-s); font: inherit; font-size: 30px; font-weight: 600; cursor: pointer; }
.mkey:active { filter: brightness(.9); } .mkey.del { font-size: 24px; color: var(--surface-muted); } .mkey:disabled { opacity: .28; cursor: default; }
.mend { text-align: center; } .mend .big { font-family: var(--font-title); font-size: 60px; font-weight: 500; letter-spacing: -.02em; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Échecs ---------- */
.chess-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.connect { max-width: 420px; margin: 6px auto 0; }
.connect input { width: 100%; font-size: 18px; letter-spacing: .02em; }
.connect .btn { width: 100%; margin-top: 10px; font-size: 17px; padding: 14px; }
.connect .status { text-align: center; }
.sheet .grp { margin: 6px 0 10px; } .sheet .grp h3 { margin: 0 0 6px; }
.sheet .seg.small button { padding: 9px 2px; font-size: 12.5px; }
.seg button:disabled { opacity: .3; cursor: default; }
.board-wrap { margin: 0 -20px; }
.board, .board .sq { touch-action: none; }
.board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); width: 100%; aspect-ratio: 1; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; background: var(--sq-dark) center / 100% 100% no-repeat; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.sq { position: relative; aspect-ratio: 1; }   /* cases transparentes : le plateau est une image de Lichess (réglage Apparence), posée sur .board */
.sq::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.sq.last::before { background: rgba(201,162,74,.42); }
.sq.sel::before { box-shadow: inset 0 0 0 3px var(--accent); }
.sq.pre::before { background: rgba(92,139,176,.55); }                        /* pré-coup : cases bleutées */
.sq.mate::before { background: rgba(110,20,20,.55); }
.sq .matebadge { position: absolute; top: -9%; right: -9%; width: 46%; height: 46%; border-radius: 50%; background: #e0342b; display: flex; align-items: center; justify-content: center; z-index: 5; box-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }   /* échec et mat façon chess.com */
.sq .matebadge svg { width: 82%; height: 82%; fill: #fff; display: block; }
.sq.check::before { background: radial-gradient(circle, rgba(224,86,74,.98) 0%, rgba(224,86,74,.75) 40%, rgba(224,86,74,0) 72%); }
.sq.dot::after { content: ''; position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; border-radius: 50%; background: rgba(20,14,8,.28); pointer-events: none; }
.sq.cap::after { content: ''; position: absolute; inset: 5%; border-radius: 50%; border: 4px solid rgba(20,14,8,.30); pointer-events: none; }
/* analyse : icône de classement sur la case d'arrivée, flèche du meilleur coup */
.sq .mi { position: absolute; top: -5%; right: -5%; width: 38%; height: 38%; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; line-height: 1; color: #fff; z-index: 4; box-shadow: 0 1px 3px rgba(0,0,0,.45); pointer-events: none; letter-spacing: -.02em; }
.mi-brilliant { background: var(--cls-brilliant); } .mi-great { background: var(--cls-great); } .mi-best { background: var(--cls-best); } .mi-excellent { background: var(--cls-excellent); } .mi-good { background: var(--cls-good); color: #241a10; } .mi-book { background: var(--cls-book); } .mi-inaccuracy { background: var(--cls-inaccuracy); color: #241a10; } .mi-mistake { background: var(--cls-mistake); } .mi-blunder { background: var(--cls-blunder); } .mi-missed { background: var(--cls-missed); }
.board svg.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.board svg.arrows line { stroke: var(--arrow); stroke-width: .22; stroke-linecap: round; opacity: .9; } .board svg.arrows polygon { fill: var(--arrow); opacity: .9; }
.board svg.arrows g.played line { stroke: var(--arrow-bad); } .board svg.arrows g.played polygon { fill: var(--arrow-bad); }   /* rouge : mon coup fautif */
.mlist { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; } .mlist .num { color: var(--muted); font-size: 12px; align-self: center; margin-left: 2px; }
.mlist .mv { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); border-radius: var(--radius-s); padding: 3px 7px; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.mlist .mv.on { border-color: var(--accent); color: var(--text); } .mlist .mv .mi { position: static; width: 15px; height: 15px; font-size: 8.5px; box-shadow: none; }
.arrowtoggle { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 6px 0; } .arrowtoggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.lastline { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin: 0 0 6px; } .lastline b { color: var(--text); } .lastline .diff.up { color: var(--ok); } .lastline .diff.down { color: var(--bad); }
.board.tap { cursor: pointer; }
.pc { position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; background-size: 92%; pointer-events: none; z-index: 1; }
.pc.wK { background-image: url(/vendor/pieces/cburnett/wK.svg); } .pc.wQ { background-image: url(/vendor/pieces/cburnett/wQ.svg); } .pc.wR { background-image: url(/vendor/pieces/cburnett/wR.svg); } .pc.wB { background-image: url(/vendor/pieces/cburnett/wB.svg); } .pc.wN { background-image: url(/vendor/pieces/cburnett/wN.svg); } .pc.wP { background-image: url(/vendor/pieces/cburnett/wP.svg); }
.pc.bK { background-image: url(/vendor/pieces/cburnett/bK.svg); } .pc.bQ { background-image: url(/vendor/pieces/cburnett/bQ.svg); } .pc.bR { background-image: url(/vendor/pieces/cburnett/bR.svg); } .pc.bB { background-image: url(/vendor/pieces/cburnett/bB.svg); } .pc.bN { background-image: url(/vendor/pieces/cburnett/bN.svg); } .pc.bP { background-image: url(/vendor/pieces/cburnett/bP.svg); }
.sq.dragging .pc { opacity: .35; }
.drag-ghost { position: fixed; z-index: 60; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: 92%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.sq .cr, .sq .cf { position: absolute; font-size: 9px; font-weight: 700; color: rgba(20,14,8,.55); pointer-events: none; z-index: 2; } .sq .cr { top: 2px; left: 3px; } .sq .cf { bottom: 1px; right: 3px; }
.sq.dark .cr, .sq.dark .cf { color: rgba(242,234,219,.6); }
.plrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; min-height: 48px; }
.plrow .who { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .plrow .who .top { display: flex; align-items: baseline; gap: 8px; } .plrow .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .plrow .elo { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.caps { display: flex; align-items: center; gap: 0; height: 16px; } .caps .cp { width: 16px; height: 16px; margin-right: -3px; background-size: 88%; background-position: center; background-repeat: no-repeat; background-color: rgba(242,234,219,.22); border-radius: 50%; } .caps .adv { margin-left: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.endcard { margin: 10px 0 4px; padding: 12px 16px; border-radius: var(--radius); text-align: center; } .endcard .t { font-family: var(--font-title); font-size: 24px; font-weight: 500; } .endcard .r { font-size: 15px; margin-top: 2px; } .endcard .r b { font-size: 17px; } .endcard .btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.gfilter { margin: 0 0 8px; } .gfilter .seg button { padding: 7px 4px; font-size: 12.5px; }
.more { display: block; width: 100%; margin: 4px 0 10px; padding: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); border-radius: var(--radius-s); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 22px; padding: 4px 12px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); min-width: 92px; text-align: center; }
.clock.on { background: var(--seg-on-bg); color: var(--seg-on-text); border-color: transparent; }
.clock.low { color: var(--bad); } .clock.on.low { color: var(--bad-ink); }
.cbar { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; }
.cbar .nav { display: flex; gap: 6px; } .cbar .spacer { flex: 1; }
.ibtn { border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); border-radius: var(--radius-s); width: 48px; height: 44px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; padding: 0; }
.ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibtn.arrow { width: 44px; font-size: 20px; font-weight: 700; }
.ibtn:disabled { opacity: .3; cursor: default; }
.ibtn.warn { color: var(--bad); border-color: rgba(224,86,74,.5); }
.ibtn.hot { background: var(--seg-on-bg); color: var(--seg-on-text); border-color: transparent; }
.gstatus { text-align: center; font-size: 14px; color: var(--muted); min-height: 20px; margin: 6px 0 2px; }
.gstatus b { color: var(--text); }
.glist .g { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--surface-line); cursor: pointer; }
.glist .g:first-child { border-top: 0; }
.glist .g .res { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--surface-muted); text-align: right; } .glist .g .res.win { color: var(--ok-ink); } .glist .g .res.loss { color: var(--bad-ink); } .glist .g .res small { display: block; font-weight: 600; font-size: 10.5px; letter-spacing: .04em; color: var(--surface-muted); }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88vh; overflow-y: auto; background: var(--panel); border-top: 1px solid var(--line-2); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
.sheet h3 { margin: 12px 0 8px; }
.sheet .seg { margin-bottom: 4px; }
.sheet .levels button { padding: 10px 0; }
.evalchart { width: 100%; height: 74px; display: block; margin: 4px 0 8px; }
.evalchart .bg { fill: var(--chart-bg); } .evalchart .fill { fill: var(--text-2); } .evalchart .mid { stroke: rgba(163,154,139,.55); stroke-width: 1; } .evalchart .cur { stroke: var(--accent); stroke-width: 1.5; } .evalchart .blunder { fill: var(--cls-blunder); } .evalchart .mistake { fill: var(--cls-mistake); } .evalchart .missed { fill: var(--cls-missed); } .evalchart .brilliant { fill: var(--cls-brilliant); }
.mvlabel { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 30px; margin: 6px 0; font-size: 16px; }
.mvlabel .san { font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-s); font-size: 12px; font-weight: 700; letter-spacing: .03em; border: 1px solid transparent; }
.badge.brilliant { background: var(--cls-brilliant); color: #fff; } .badge.great { background: var(--cls-great); color: #fff; } .badge.best { background: var(--cls-best); color: #241a10; } .badge.excellent { background: var(--cls-excellent); color: #241a10; } .badge.good { background: var(--cls-good); color: #241a10; } .badge.book { background: var(--cls-book); color: #241a10; } .badge.inaccuracy { background: var(--cls-inaccuracy); color: #241a10; } .badge.mistake { background: var(--cls-mistake); color: #241a10; } .badge.blunder { background: var(--cls-blunder); color: #fff; } .badge.missed { background: var(--cls-missed); color: #fff; }
.mvbest { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.progressbar { width: 100%; height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin: 8px 0; } .progressbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }

/* réglage d'apparence des échecs : vignettes des plateaux (un quart du plateau), des pièces (cavalier blanc, dame noire), liste des jeux de sons */
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; } .thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: 0 0 auto; width: 66px; background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.thumb i { display: block; width: 62px; height: 62px; border-radius: var(--radius-s); background-size: 200% 200%; background-position: left bottom; box-shadow: 0 1px 3px rgba(0,0,0,.4); border: 2px solid transparent; }
.thumb i.pcs { display: flex; align-items: center; justify-content: center; background: var(--wood-100, #e6d2ae); } .thumb i.pcs b { width: 27px; height: 27px; background: no-repeat center / contain; }
.thumb.on { color: var(--text); } .thumb.on i { border-color: var(--accent); }
.sndlist .snd { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 2px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 5px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.sndlist .snd.on { border-color: var(--accent); color: var(--text); }
/* affichage « 007 » des notes : les notes elles-mêmes en vert (les moyennes suivent la règle normale, donc vertes aussi) */
.grades b.fine { color: var(--ok-ink); }
/* bandeau réseau */
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 70; padding: calc(5px + env(safe-area-inset-top)) 12px 6px; text-align: center; font-size: 12.5px; font-weight: 600; background: var(--panel-2); color: var(--text); border-bottom: 1px solid var(--line-2); }
.netbar[hidden] { display: none; }
body.offline .view { padding-top: calc(36px + env(safe-area-inset-top)); }

/* ---------- Accueil Échecs : tout tient sur l'écran ; « Voir plus » déplie la liste ---------- */
.chess-head h2 { margin: 4px 0; }
.chess-actions { margin: 10px 0 8px; } .chess-actions .btn.big { padding: 12px 20px; }
.gfilter { margin: 0 0 6px; } .gfilter .seg button { padding: 7px 4px; font-size: 12.5px; }
.glist.compact { padding: 2px 14px; margin-bottom: 6px; }
.glist.compact .g { padding: 8px 0; gap: 8px; } .glist .g > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42%; }
.glist .g .meta { flex: 1; min-width: 0; font-size: 11.5px; color: var(--surface-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.morebar { display: flex; gap: 8px; } .morebar .more { margin: 0 0 6px; padding: 8px; }
/* ---------- Réglages : aperçus de styles (chaque aperçu porte son data-theme, donc ses propres jetons) ---------- */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.theme { text-align: left; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px; color: var(--text); font: inherit; cursor: pointer; }
.theme.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme .prev { display: block; height: 98px; border-radius: 4px; overflow: hidden; position: relative; margin-bottom: 8px; background-color: var(--bg); background-image: var(--bg-image); }
.theme .prev .pcard { position: absolute; left: 10px; right: 10px; top: 10px; height: 48px; background-color: var(--surface); background-image: var(--surface-image); color: var(--surface-text); border: var(--border-w) solid var(--surface-border); border-radius: var(--radius); box-shadow: var(--surface-shadow); padding: 5px 8px; }
.theme .prev .pt { font-family: var(--font-title); font-weight: var(--title-weight); font-size: 15px; font-style: normal; line-height: 1.1; }
.theme .prev .pl { display: block; height: 4px; width: 70%; background: var(--surface-line); margin-top: 5px; border-radius: 2px; } .theme .prev .pl.short { width: 42%; }
.theme .prev .pbtn { position: absolute; left: 10px; bottom: 12px; width: 56px; height: 16px; background: var(--btn-bg); border: var(--border-w) solid var(--btn-border); border-radius: var(--radius-s); box-shadow: var(--btn-shadow); }
.theme .prev .ptabs { position: absolute; right: 10px; bottom: 12px; width: 48px; height: 16px; background: var(--tabs-bg); border: 1px solid var(--tabs-border); border-radius: 3px; }
.theme .prev .ptabs::after { content: ''; position: absolute; left: 6px; top: 4px; width: 10px; height: 2px; background: var(--tabs-mark); }
.theme .tname { display: block; font-weight: 700; font-size: 14px; } .theme .tdesc { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 1px; }
