/* Polices servies par le site (SIL Open Font License 1.1, voir /fonts/OFL-*.txt) */
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(/fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%; src: url(/fonts/archivo-latin-wdth-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: italic; font-display: swap; font-weight: 200 800; src: url(/fonts/atkinson-hyperlegible-mono-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Du pion à la dame — direction SOMA23 « Les Harmoniques ».
   Mise en page : un manuel technique de poche. Fond presque noir teinté de vert, vert acide en signal,
   titres en capitales très espacées, texte en chasse fixe, filets fins, encadrés « à retenir »,
   et un échiquier traité comme un contrôleur à pads dont les cases s'allument. */

:root {
  color-scheme: dark;
  /* fonds */
  --bg: #0A0C09;
  --panel: #0D0F0A;
  --panel-2: #12150E;
  --panel-3: #0F1208;
  --pad-off: #1D2215;
  --rule: #1A1F14;
  --rule-2: #262D1C;
  /* encres */
  --ink: #D8E0C8;
  --ink-2: #A8B099;
  --ink-3: #6B745C;
  --olive: #3A4A18;
  --olive-2: #6C8A1F;
  /* signaux */
  --lime: #C8FF3A;
  --lime-2: #98C12F;
  --lime-3: #576F1D;
  --lime-wash: rgba(200, 255, 58, .07);
  --lime-glow: 0 0 14px rgba(200, 255, 58, .38);
  --cyan: #3AE0FF;
  --orange: #FF5A2A;
  --orange-wash: #1A0E08;
  --on-lime: #0A0C09;
  /* échiquier : pads */
  --board-gap: #050604;
  --pad-l: #3E4B29;
  --pad-d: #1C2315;
  --coord-l: #A9C75A;
  --coord-d: #6F8A3A;
  --move-dot: rgba(200, 255, 58, .62);
  --arrow: rgba(200, 255, 58, .85);
  --arrow-bad: rgba(255, 90, 42, .88);
  --arrow-soft: rgba(216, 224, 200, .36);
  --piece-w: #E9EFDC;
  --piece-w-line: #0A0C09;
  --piece-b: #0B0E08;
  --piece-b-line: #C8FF3A;
  --piece-b-detail: #C8FF3A;

  --font-head: 'Archivo', 'Archivo Variable', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono', 'DejaVu Sans Mono', ui-monospace, Menlo, Consolas, monospace;
  --fs-xs: .72rem;
  --fs-s: .84rem;
  --fs-m: .95rem;
  --fs-l: 1.08rem;
  --fs-xl: 1.32rem;
  --fs-xxl: clamp(1.55rem, 6.4vw, 2.35rem);
  --track: .14em;
  --track-wide: .2em;
  --radius: 8px;
  --radius-s: 5px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-m);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 700; }
p { margin: 0; }
strong { font-weight: 700; color: var(--lime); }
mark { background: none; color: var(--lime); }
a { color: var(--lime); }
::selection { background: var(--lime); color: var(--on-lime); }
.lime { color: var(--lime); }
.orange { color: var(--orange); }

/* ---------- Typographie ---------- */
.eyebrow { display: block; font-size: var(--fs-xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-3); line-height: 1.4; }
.display {
  font-family: var(--font-head); font-weight: 800; font-stretch: 112%;
  text-transform: uppercase; letter-spacing: var(--track); color: var(--lime);
  font-size: var(--fs-xxl); line-height: 1.12;
}
.display.small { font-size: var(--fs-l); }
.lede { color: var(--ink-3); font-size: var(--fs-s); max-width: 62ch; }
.label { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--lime); }
.label.sub { margin: 18px 0 6px; }
.sec-num { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; letter-spacing: var(--track); color: var(--olive); }
.hint { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }

/* ---------- Coquille ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--rule); }
.topbar-in {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { flex: none; display: grid; grid-template-columns: repeat(4, 7px); gap: 2px; }
.brand-mark i { width: 7px; height: 7px; border-radius: 1.6px; background: var(--pad-off); }
.brand-mark i.on { background: var(--lime); box-shadow: 0 0 5px rgba(200, 255, 58, .7); }
.brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; font-size: .86rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--lime); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .6rem; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.grade { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); background: var(--panel); border-radius: var(--radius-s); padding: 4px 10px 4px 4px; cursor: pointer; color: var(--ink); }
.grade:hover { border-color: var(--olive); }
.grade-icon { width: 30px; height: 30px; border-radius: 4px; background: var(--pad-off); display: grid; place-items: center; }
.grade-icon .pc { width: 24px; height: 24px; }
.grade-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.grade-label { font-size: .56rem; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-3); }
.grade-name { font-weight: 700; font-size: var(--fs-s); color: var(--lime); }
.grade-meter { display: grid; grid-template-columns: repeat(10, 4px); gap: 2px; align-self: center; }
.grade-meter i { height: 12px; border-radius: 1px; background: var(--pad-off); }
.grade-meter i.on { background: var(--lime); box-shadow: 0 0 4px rgba(200, 255, 58, .55); }

.acct-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2); border-radius: var(--radius-s); padding: 0 11px; min-height: 40px; cursor: pointer; font-size: .68rem; font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; }
.acct-btn:hover { color: var(--lime); border-color: var(--olive); }
.acct-btn svg { width: 17px; height: 17px; flex: none; }
.acct-name { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: .02em; font-size: var(--fs-s); color: var(--lime); }
.acct-elo { font-size: .66rem; color: var(--ink-3); letter-spacing: .04em; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(var(--tab-count, 3), 1fr);
  background: var(--panel); border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(6px, env(safe-area-inset-left, 0px));
  padding-right: max(6px, env(safe-area-inset-right, 0px));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-block: 9px 10px; border: 0; background: none; color: var(--ink-3);
  font-size: .62rem; font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; cursor: pointer; position: relative;
}
.tab:hover { color: var(--ink-2); }
.tab-ic { width: 24px; height: 24px; display: grid; place-items: center; position: relative; }
.tab-ic svg { width: 21px; height: 21px; }
.tab.is-on { color: var(--lime); }
.tab.is-on::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; background: var(--lime); box-shadow: var(--lime-glow); }
.dot-badge { position: absolute; top: -1px; right: -4px; width: 8px; height: 8px; border-radius: 2px; background: var(--orange); box-shadow: 0 0 8px rgba(255, 90, 42, .8); }

.main {
  flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
  padding-block: 24px calc(104px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.view { display: grid; gap: 26px; align-content: start; }
@media (min-width: 860px) {
  .topbar-in { padding-block: 13px; }
  .brand-mark { grid-template-columns: repeat(4, 8px); }
  .brand-mark i { width: 8px; height: 8px; }
  .brand-name { font-size: .95rem; }
  .tabs {
    position: static; max-width: 1080px; margin: 0 auto; display: flex; gap: 2px;
    background: none; border: 0; padding-block: 0;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .tab { flex-direction: row; gap: 8px; font-size: .7rem; padding: 8px 14px 11px; }
  .tab-ic { width: 18px; height: 18px; }
  .tab-ic svg { width: 17px; height: 17px; }
  .tab.is-on::before { top: auto; bottom: -1px; left: 10px; right: 10px; }
  .main { padding-block: 34px 56px; }
}
.acct-btn.is-in svg { color: var(--lime); }
@media (max-width: 600px) {
  .tag { padding: 5px 8px; font-size: .58rem; letter-spacing: .1em; }
}
@media (max-width: 720px) {
  .acct-label, .acct-elo, .acct-name { display: none; }
  .acct-btn { padding: 0 10px; }
  /* Avec le bouton de compte, le grade se résume à sa pièce : le nom de l'application reste lisible en entier. */
  #acctSlot:not(:empty) + .grade { padding-right: 4px; }
  #acctSlot:not(:empty) + .grade .grade-text { display: none; }
}
@media (max-width: 400px) {
  .brand-sub, .grade-meter, .grade-label { display: none; }
  .brand { gap: 8px; }
  .brand-mark { grid-template-columns: repeat(4, 5px); gap: 2px; }
  .brand-mark i { width: 5px; height: 5px; border-radius: 1px; }
  .brand-name { font-size: .74rem; letter-spacing: .1em; }
}

.foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 10px; font-size: .62rem; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--olive); }

/* ---------- Commandes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 16px; border-radius: 4px;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink);
  font-weight: 700; font-size: var(--fs-xs); letter-spacing: var(--track); text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--olive-2); color: var(--lime); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); box-shadow: var(--lime-glow); }
.btn-primary:hover { color: var(--on-lime); border-color: var(--lime); box-shadow: 0 0 22px rgba(200, 255, 58, .5); }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { border-color: transparent; }
.btn-danger { color: var(--orange); border-color: rgba(255, 90, 42, .4); }
.btn-danger:hover { color: var(--orange); border-color: var(--orange); }
.btn[disabled] { opacity: .35; cursor: default; box-shadow: none; transform: none; }
.btn-sm { min-height: 36px; padding: 6px 11px; font-size: .64rem; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 4px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--lime); border-color: var(--olive-2); }
.icon-btn svg { width: 19px; height: 19px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 0; background: var(--pad-off); color: var(--lime); border-radius: 3px; padding: 6px 10px; font-size: .62rem; font-weight: 700; letter-spacing: var(--track); text-transform: uppercase; cursor: pointer; }
.tag:hover { background: var(--rule-2); box-shadow: inset 0 0 0 1px var(--olive-2); }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 700; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button .pc { width: 22px; height: 22px; }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
.seg button[aria-pressed="true"] .pc-b { --pl: var(--on-lime); --pd: var(--on-lime); }

.switches { display: grid; gap: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: var(--radius-s); padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.switch span:first-child { min-width: 0; }
.switch b { font-size: var(--fs-s); }
.switch small { display: block; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.45; }
.knob { width: 42px; height: 24px; border-radius: 4px; background: var(--pad-off); border: 1px solid var(--rule-2); position: relative; flex: none; transition: background-color .15s; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 3px; background: var(--ink-3); transition: transform .15s, background-color .15s; }
.switch[aria-checked="true"] .knob { background: var(--lime-3); border-color: var(--lime-2); }
.switch[aria-checked="true"] .knob::after { transform: translateX(18px); background: var(--lime); box-shadow: var(--lime-glow); }

/* ---------- Encadrés (comme « À retenir », « Image de l'ingé », « Le piège ») ---------- */
.callout { background: var(--panel-2); border-left: 3px solid var(--lime); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 13px 16px 14px; display: grid; gap: 6px; min-width: 0; }
.callout-label { display: block; font-size: .62rem; font-weight: 700; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--lime); }
.callout p, .callout .fb-text, .callout .coach-text { font-size: var(--fs-s); line-height: 1.62; color: var(--ink); }
.callout.is-orange { border-left-color: var(--orange); background: var(--orange-wash); }
.callout.is-orange .callout-label, .callout.is-orange strong, .callout.is-orange mark { color: var(--orange); }
.callout.is-cyan { border-left-color: var(--cyan); }
.callout.is-cyan .callout-label, .callout.is-cyan strong, .callout.is-cyan mark { color: var(--cyan); }
.callout.is-dashed { border: 1px dashed var(--olive); border-radius: var(--radius-s); background: var(--panel-3); }
.callout.is-dashed .callout-label { color: var(--olive-2); }

/* ---------- Figures ---------- */
.fig { margin: 0; background: var(--panel); border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 18px; min-width: 0; }
.fig figcaption { text-align: center; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
.fig figcaption b { color: var(--lime); }
.fig figcaption i { font-style: italic; }

/* ---------- Apprendre ---------- */
.cover { display: grid; gap: 12px; }
.cover .tags { margin-top: 6px; }
.next-callout { gap: 10px; }
.next-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.next-ic { width: 46px; height: 46px; border-radius: 6px; background: var(--lime); box-shadow: var(--lime-glow); display: grid; place-items: center; flex: none; }
.next-ic .pc { width: 36px; height: 36px; --pf: var(--on-lime); --pl: var(--on-lime); --pd: var(--lime); }
.next-info { flex: 1 1 180px; min-width: 0; display: grid; }
.next-info b { font-size: var(--fs-l); color: var(--ink); }
.next-info span { font-size: var(--fs-s); color: var(--ink-3); }

.spectrum { display: grid; gap: 16px; }
.spectrum-plot { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; align-items: end; height: 124px; border-bottom: 1px solid var(--rule-2); padding: 0 4px; }
.sp-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; min-width: 0; }
.sp-val { font-size: .58rem; color: var(--olive-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-track { position: relative; width: 100%; max-width: 30px; height: 100%; background: rgba(29, 34, 21, .5); border-radius: 2px 2px 0 0; }
.sp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3%; background: var(--olive); border-radius: 2px 2px 0 0; transition: height .5s cubic-bezier(.3, .7, .4, 1); }
.sp-col.is-part .sp-bar { background: linear-gradient(var(--lime-2), var(--lime-3)); }
.sp-col.is-full .sp-bar { background: var(--lime); box-shadow: 0 0 12px rgba(200, 255, 58, .45); }
.sp-lbl { font-size: .62rem; color: var(--ink-3); transform: translateY(18px); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stats div { display: grid; gap: 2px; text-align: center; padding: 8px 4px; border-top: 1px solid var(--rule); }
.stats b { font-size: var(--fs-xl); color: var(--lime); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats b small { font-size: var(--fs-xs); color: var(--olive-2); font-weight: 400; }
.stats span { font-size: .6rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }

.toc { display: grid; }
.toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.toc-note { font-size: var(--fs-xs); color: var(--olive-2); font-variant-numeric: tabular-nums; }
@media (min-width: 860px) {
  .toc { grid-template-columns: 1fr 1fr; column-gap: 36px; align-items: start; }
  .toc-head { grid-column: 1 / -1; }
}
.toc-chapter { scroll-margin-top: 90px; min-width: 0; }
@media (min-width: 860px) { .toc-chapter { scroll-margin-top: 130px; } }
.toc-part { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 0 8px; border-bottom: 1px solid var(--rule); }
.part-label { font-size: .64rem; font-weight: 700; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--lime); white-space: nowrap; }
.part-desc { font-size: var(--fs-xs); color: var(--olive-2); text-align: right; }
.toc-row {
  width: 100%; display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 2px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer; color: var(--ink);
}
.toc-row:hover { background: var(--lime-wash); }
.toc-num { font-size: var(--fs-s); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc-main { min-width: 0; display: grid; }
.toc-title { font-size: var(--fs-s); line-height: 1.35; }
.toc-desc { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; }
.toc-row.is-done .toc-title { color: var(--ink-2); }
.toc-row.is-next { background: var(--lime-wash); }
.toc-row.is-next .toc-num, .toc-row.is-next .toc-title { color: var(--lime); }
.toc-row.is-next .toc-title::after { content: "à toi"; margin-left: 8px; font-size: .58rem; vertical-align: 2px; padding: 1px 6px; border-radius: 3px; background: var(--pad-off); color: var(--lime); letter-spacing: .14em; text-transform: uppercase; }

.pi { display: inline-block; width: 1.4em; height: 1.4em; vertical-align: -.32em; margin: 0 .05em; }
.pi .pc { width: 100%; height: 100%; }
.star-ic { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.18em; }
.stars-row { display: inline-flex; gap: 2px; }
.stars-row svg { width: 13px; height: 13px; }
.st-on { fill: var(--lime); stroke: var(--lime); stroke-width: 1; filter: drop-shadow(0 0 3px rgba(200, 255, 58, .6)); }
.st-off { fill: none; stroke: var(--olive); stroke-width: 1.4; }

/* ---------- Pièces ---------- */
.pc { display: block; overflow: visible; }
.pc .pb { fill: var(--pf); stroke: var(--pl); stroke-width: 3.4; stroke-linejoin: round; }
.pc .pd { fill: none; stroke: var(--pd); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.pc .pdot { fill: var(--pd); }
.pc-w { --pf: var(--piece-w); --pl: var(--piece-w-line); --pd: var(--piece-w-line); }
.pc-b { --pf: var(--piece-b); --pl: var(--piece-b-line); --pd: var(--piece-b-detail); }

/* ---------- Défis ---------- */
.sets { display: grid; gap: 16px; }
@media (min-width: 860px) { .sets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.set { display: flex; flex-direction: column; gap: 12px; }
.set-head { display: flex; align-items: baseline; gap: 10px; }
.set-head h2 { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .1em; color: var(--lime); font-size: var(--fs-l); }
.set-desc { color: var(--ink-3); font-size: var(--fs-xs); }
.pads { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pad { aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 5px; background: var(--pad-off); color: var(--ink-3); font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; display: grid; place-items: center; transition: box-shadow .15s, background-color .15s; }
.pad:hover { box-shadow: inset 0 0 0 1px var(--olive-2); color: var(--lime); }
.pad.is-on { background: var(--lime); color: var(--on-lime); box-shadow: 0 0 14px rgba(200, 255, 58, .45); }
.set-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.set-foot .count { font-size: var(--fs-xs); color: var(--ink-3); }

/* ---------- Jouer : réglages ---------- */
.setup { display: grid; gap: 26px; max-width: 720px; }
.setup section { display: grid; gap: 10px; }
.levels { display: grid; border-top: 1px solid var(--rule); }
.level {
  display: grid; grid-template-columns: 2.2em 34px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 9px 10px 9px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer; color: var(--ink); position: relative;
}
.level:hover { background: var(--lime-wash); }
.level .pc { width: 32px; height: 32px; }
.lv-num { font-size: var(--fs-s); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lv-name { display: grid; min-width: 0; }
.lv-name b { font-size: var(--fs-m); }
.lv-name small { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.lv-meter { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.lv-meter i { width: 5px; border-radius: 1px; background: var(--pad-off); }
.lv-meter i:nth-child(1) { height: 30%; } .lv-meter i:nth-child(2) { height: 45%; } .lv-meter i:nth-child(3) { height: 62%; } .lv-meter i:nth-child(4) { height: 80%; } .lv-meter i:nth-child(5) { height: 100%; }
.lv-meter i.on { background: var(--lime-2); }
.level[aria-pressed="true"] { background: var(--lime-wash); }
.level[aria-pressed="true"]::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; background: var(--lime); box-shadow: var(--lime-glow); }
.level[aria-pressed="true"] .lv-num, .level[aria-pressed="true"] b { color: var(--lime); }
.level[aria-pressed="true"] .lv-meter i.on { background: var(--lime); box-shadow: 0 0 6px rgba(200, 255, 58, .5); }
.level-desc { color: var(--ink-2); font-size: var(--fs-s); min-height: 2.6em; }
.setup-go { display: flex; }

/* ---------- Jouer : partie ---------- */
.game { display: grid; gap: 14px; align-items: start; }
@media (min-width: 860px) { .game { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; } }
.game-board-col { display: grid; gap: 8px; justify-items: center; min-width: 0; }
.player-bar { width: 100%; max-width: var(--board-max, 560px); display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; font-size: var(--fs-s); }
.who .pc { width: 26px; height: 26px; flex: none; }
.who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name small { color: var(--ink-3); font-weight: 400; }
.who-rating { font-weight: 400; color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.who.is-turn .who-name { color: var(--lime); }
.who-turn { font-size: .62rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--lime-2); }
.thinking { font-weight: 400; font-size: .62rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--lime-2); }
.captured { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; min-width: 0; font-size: var(--fs-xs); color: var(--ink-3); }
.captured .pc { width: 17px; height: 17px; margin-left: -5px; }
.captured b { margin-left: 4px; color: var(--lime); }
.clock { font-size: var(--fs-l); font-weight: 700; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-3); min-width: 78px; text-align: center; letter-spacing: .04em; }
.clock.is-running { color: var(--on-lime); background: var(--lime); border-color: var(--lime); box-shadow: var(--lime-glow); }
.clock.is-low { color: var(--orange); border-color: var(--orange); }
.clock.is-running.is-low { color: var(--bg); background: var(--orange); box-shadow: 0 0 16px rgba(255, 90, 42, .55); }
.game-side { display: grid; gap: 12px; min-width: 0; }
.coach-text { min-width: 0; }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.controls { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.controls .btn { min-height: 56px; flex-direction: column; gap: 5px; padding: 6px 4px; font-size: .58rem; letter-spacing: .1em; }
.moves { border: 1px solid var(--rule-2); background: var(--panel); border-radius: var(--radius); max-height: 230px; overflow-y: auto; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.moves-head { position: sticky; top: 0; display: grid; grid-template-columns: 44px 1fr 1fr; background: var(--panel); color: var(--lime); font-size: .62rem; font-weight: 700; letter-spacing: var(--track-wide); text-transform: uppercase; border-bottom: 1px solid var(--rule-2); }
.moves-head span, .mv-row span { padding: 5px 10px; }
.mv-row { display: grid; grid-template-columns: 44px 1fr 1fr; border-top: 1px solid var(--rule); }
.mv-row:first-of-type { border-top: 0; }
.mv-row .n { color: var(--olive-2); text-align: right; }
.mv-row .is-last { color: var(--lime); text-shadow: 0 0 8px rgba(200, 255, 58, .5); }
.moves-empty { padding: 12px; color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- Échiquier : contrôleur à pads ---------- */
.board-wrap { width: 100%; display: flex; justify-content: center; }
.board {
  position: relative; width: min(100%, var(--board-max, 560px)); aspect-ratio: 1; max-width: 100%;
  border-radius: 8px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--board-gap); box-shadow: 0 0 0 1px var(--rule-2), 0 0 36px rgba(200, 255, 58, .05);
}
.board:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.sq { position: absolute; width: 12.5%; height: 12.5%; }
.sq::before, .sq::after { content: ""; position: absolute; inset: 1.5px; border-radius: 4px; pointer-events: none; }
.sq::before { background: var(--pad-d); }
.sq.l::before { background: var(--pad-l); }
.sq .co { position: absolute; z-index: 1; font-family: var(--font-mono); font-size: clamp(.5rem, 1.9vw, .66rem); font-weight: 700; line-height: 1; pointer-events: none; }
.sq.l .co { color: var(--coord-l); }
.sq.d .co { color: var(--coord-d); }
.co-f { right: 7%; bottom: 7%; }
.co-r { left: 8%; top: 7%; }
.sq.hl-last::after { background: rgba(200, 255, 58, .2); box-shadow: inset 0 0 0 1px rgba(200, 255, 58, .38); }
.sq.mk-soft::after { background: rgba(200, 255, 58, .11); }
.sq.mk-target::after { box-shadow: inset 0 0 0 2.5px var(--lime), 0 0 12px rgba(200, 255, 58, .35); }
.sq.mk-ok::after { background: rgba(200, 255, 58, .42); box-shadow: 0 0 14px rgba(200, 255, 58, .5); }
.sq.mk-bad::after { background: rgba(255, 90, 42, .5); box-shadow: 0 0 14px rgba(255, 90, 42, .5); }
.sq.hl-sel::after { background: rgba(200, 255, 58, .44); box-shadow: inset 0 0 0 1px rgba(226, 255, 150, .85), 0 0 16px rgba(200, 255, 58, .55); }
.sq.hl-check::after { background: radial-gradient(circle, rgba(255, 90, 42, .95) 0%, rgba(255, 90, 42, .5) 42%, rgba(255, 90, 42, .08) 75%); box-shadow: 0 0 18px rgba(255, 90, 42, .6); }
.sq.cursor::after { box-shadow: inset 0 0 0 2.5px var(--cyan); }
.sq.mk-target, .sq.mk-ok, .sq.mk-bad, .sq.hl-sel, .sq.hl-check, .sq.cursor { z-index: 1; }
.flash-cell { position: absolute; inset: 1.5px; border-radius: 4px; background: rgba(255, 90, 42, .55); animation: flash .7s ease forwards; pointer-events: none; z-index: 2; }
.dot { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 2; }
.dot::before { content: ""; width: 26%; height: 26%; border-radius: 3px; background: var(--move-dot); box-shadow: 0 0 9px rgba(200, 255, 58, .5); }
.dot.cap::before { width: 82%; height: 82%; border-radius: 6px; background: none; box-shadow: inset 0 0 0 3.5px var(--move-dot), 0 0 10px rgba(200, 255, 58, .35); }
.dot.mk::before { background: var(--lime); opacity: .75; }
.star { position: absolute; inset: 17%; pointer-events: none; z-index: 2; animation: pop .35s ease; }
.star svg { width: 100%; height: 100%; }
.sq .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: clamp(1rem, 5vw, 1.5rem); color: var(--lime); text-shadow: 0 0 10px rgba(200, 255, 58, .55); z-index: 2; pointer-events: none; }
.pieces { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.piece { position: absolute; width: 12.5%; height: 12.5%; padding: 1.1%; will-change: transform; }
.piece .pc { width: 100%; height: 100%; }
.piece .pc-b { filter: drop-shadow(0 0 2px rgba(200, 255, 58, .38)); }
.piece .pc-w { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.piece.anim { transition: transform .2s cubic-bezier(.3, .7, .4, 1); }
.piece.drag { z-index: 10; transition: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); }
.piece.fade { animation: fadeout .25s ease forwards; }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.ar-def, .ar-ok { stroke: var(--arrow); fill: var(--arrow); }
.ar-bad { stroke: var(--arrow-bad); fill: var(--arrow-bad); }
.ar-soft { stroke: var(--arrow-soft); fill: var(--arrow-soft); }

@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeout { to { opacity: 0; transform: scale(.7); } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 58, .5); } 50% { box-shadow: 0 0 0 7px rgba(200, 255, 58, 0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Lecteur de leçon et de défi ---------- */
.runner { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; padding-top: env(safe-area-inset-top, 0px); }
.run-top { position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--rule); }
.run-top-in {
  max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding-block: 9px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.run-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.run-num { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; letter-spacing: var(--track); color: var(--olive); font-size: var(--fs-l); flex: none; }
.run-heads { min-width: 0; display: grid; }
.run-heads b { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); font-size: var(--fs-m); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-heads .eyebrow { font-size: .58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-progress { display: flex; align-items: center; gap: 10px; }
.progress { display: flex; gap: 3px; }
.progress i { width: 8px; height: 8px; border-radius: 2px; background: var(--pad-off); }
.progress i.on { background: var(--lime-3); }
.progress i.now { background: var(--lime); box-shadow: var(--lime-glow); }
.run-steps-count { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .progress { display: none; } }
.run-body {
  max-width: 1080px; margin: 0 auto; display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "say" "board" "extra" "fb";
  padding-block: 18px calc(112px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  --board-max: min(560px, max(280px, calc(100svh - 340px)));
}
.run-body.no-board { grid-template-areas: "say" "extra" "fb"; max-width: 720px; }
.run-say { grid-area: say; animation: rise .25s ease; }
.run-board { grid-area: board; min-width: 0; }
.run-extra { grid-area: extra; min-width: 0; }
.run-fb { grid-area: fb; min-width: 0; }
.run-extra:empty, .run-fb:empty { display: none; }
.say-text { font-size: var(--fs-m); line-height: 1.66; max-width: 62ch; }
.say-text p + p { margin-top: .6em; }
.say-text ol, .say-text ul { margin: .5em 0 0; padding-left: 1.5em; }
.say-text li { margin: .25em 0; }
.say-text li::marker { color: var(--lime); font-weight: 700; }
.say-text ul { list-style: none; padding-left: 1.2em; }
.say-text ul li::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--lime); margin: 0 .65em .14em -1.2em; box-shadow: 0 0 6px rgba(200, 255, 58, .6); }
.fig-board { padding: 12px; display: grid; gap: 10px; justify-items: center; }
.fig-board figcaption { max-width: var(--board-max, 560px); }
.fb { animation: rise .2s ease; }
.fb-text p + p { margin-top: .35em; }
.choices { display: grid; border-top: 1px solid var(--rule); }
.choice { text-align: left; border: 0; border-bottom: 1px solid var(--rule); background: none; padding: 12px 6px; font-size: var(--fs-s); font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.choice:hover { background: var(--lime-wash); }
.choice .key { width: 26px; height: 26px; border-radius: 4px; background: var(--pad-off); color: var(--lime); display: grid; place-items: center; font-size: var(--fs-xs); flex: none; }
.choice.is-ok { background: var(--lime-wash); color: var(--lime); }
.choice.is-ok .key { background: var(--lime); color: var(--on-lime); box-shadow: var(--lime-glow); }
.choice.is-bad { color: var(--orange); }
.choice.is-bad .key { background: var(--orange-wash); color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.counter { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.counter b { color: var(--lime); }
.run-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--panel); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom, 0px); }
.run-actions-in {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.run-actions-in .spacer { flex: 1; }
.run-actions .btn-primary { min-width: 150px; }
.run-actions .btn-primary.pulse { animation: pulse 1.4s ease infinite; }
@media (max-width: 520px) {
  .run-heads b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; letter-spacing: .08em; text-wrap: balance; }
  .run-actions .btn-quiet { min-width: 44px; padding: 6px 10px; }
  .run-actions .btn-quiet .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .run-actions .btn-primary { min-width: 0; flex: 1 1 auto; max-width: 240px; }
}
@media (min-width: 900px) {
  .run-body { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "board say" "board extra" "board fb" "board ."; grid-template-rows: auto auto auto 1fr; align-items: start; column-gap: 32px; row-gap: 14px; padding-top: 28px; --board-max: min(600px, calc(100svh - 200px)); }
  .run-body.no-board { grid-template-columns: minmax(0, 1fr); grid-template-areas: "say" "extra" "fb"; grid-template-rows: none; }
}

.done { grid-column: 1 / -1; max-width: 560px; width: 100%; margin: 6vh auto 0; text-align: center; display: grid; gap: 16px; justify-items: center; padding-block: 0 140px; }
.done p { color: var(--ink-2); max-width: 46ch; font-size: var(--fs-s); }
.big-stars { display: flex; gap: 12px; }
.big-stars svg { width: 54px; height: 54px; animation: pop .45s ease backwards; }
.big-stars svg:nth-child(2) { animation-delay: .12s; }
.big-stars svg:nth-child(3) { animation-delay: .24s; }
.done-pads { display: grid; grid-template-columns: repeat(4, 14px); gap: 4px; }
.done-pads i { width: 14px; height: 14px; border-radius: 3px; background: var(--pad-off); }
.done-pads i.on { background: var(--lime); box-shadow: 0 0 10px rgba(200, 255, 58, .6); animation: pop .4s ease backwards; }
.xp { font-weight: 700; background: var(--lime); color: var(--on-lime); padding: 4px 12px; border-radius: 3px; letter-spacing: .1em; font-size: var(--fs-s); box-shadow: var(--lime-glow); }
.done-promo { display: flex; align-items: center; gap: 12px; text-align: left; }
.done-promo .pc { width: 40px; height: 40px; flex: none; }
.done-promo b { color: var(--lime); font-size: var(--fs-l); }
.done-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Feuilles modales ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(5, 7, 4, .8); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box {
  width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--rule-2); border-bottom: 0;
  border-radius: 10px 10px 0 0; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: grid; gap: 14px; animation: rise .2s ease; max-height: 92vh; overflow-y: auto;
}
@media (min-width: 600px) { .sheet-back { align-items: center; } .sheet-box { border-radius: 10px; border-bottom: 1px solid var(--rule-2); } }
.sheet-box h2 { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: var(--track); color: var(--lime); font-size: var(--fs-l); margin-top: -6px; }
.sheet-box > p { color: var(--ink-2); font-size: var(--fs-s); }
.promo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.promo-grid button { border: 0; border-radius: 6px; background: var(--pad-l); padding: 8px 4px; cursor: pointer; display: grid; justify-items: center; gap: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.promo-grid button:hover { box-shadow: 0 0 0 2px var(--lime), var(--lime-glow); }
.promo-grid .pc { width: 50px; height: 50px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sheet-actions.start { justify-content: flex-start; }
.grades { display: grid; border-top: 1px solid var(--rule); }
.grade-row { display: grid; grid-template-columns: 2em 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 6px; border-bottom: 1px solid var(--rule); font-size: var(--fs-s); }
.grade-row .pc { width: 28px; height: 28px; }
.grade-num { color: var(--olive-2); font-size: var(--fs-xs); }
.grade-row.is-now { background: var(--lime-wash); box-shadow: inset 3px 0 0 var(--lime); }
.grade-row.is-now b { color: var(--lime); }
.grade-row.is-past { color: var(--ink-3); }
.grade-row span:last-child { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  background: var(--lime); color: var(--on-lime); padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: var(--fs-xs); letter-spacing: .04em;
  max-width: calc(100% - 32px); text-align: center; box-shadow: var(--lime-glow); animation: rise .2s ease;
}
@media (min-width: 860px) { .toast { bottom: 28px; } }

/* ---------- Compte ---------- */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: .62rem; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.field input { width: 100%; min-height: 44px; border-radius: 4px; border: 1px solid var(--rule-2); background: var(--bg); color: var(--ink); padding: 8px 12px; }
.field input:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.field small { color: var(--ink-3); font-size: .7rem; }
.form-err { color: var(--orange); font-size: var(--fs-xs); min-height: 1.2em; }
.tabs-mini { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; }
.tabs-mini button { border: 0; background: none; padding: 9px; cursor: pointer; font-weight: 700; font-size: var(--fs-xs); letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }
.tabs-mini button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kv div { border-top: 1px solid var(--rule-2); padding: 8px 4px 2px; text-align: center; display: grid; }
.kv b { color: var(--lime); font-size: var(--fs-l); font-variant-numeric: tabular-nums; }
.kv span { font-size: .58rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }
details.pw { border-top: 1px solid var(--rule); padding-top: 10px; }
details.pw summary { cursor: pointer; font-size: var(--fs-xs); letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-2); }
details.pw summary:hover { color: var(--lime); }
details.pw .form { margin-top: 12px; }

/* ---------- Salon ---------- */
.lobby { display: grid; gap: 16px; }
@media (min-width: 860px) { .lobby { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 22px; } }
.lobby-col { display: grid; gap: 16px; min-width: 0; }
.panel { display: grid; gap: 4px; padding: 14px 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.panel-head .count { font-size: var(--fs-xs); color: var(--olive-2); font-variant-numeric: tabular-nums; }
.panel-empty { color: var(--ink-3); font-size: var(--fs-xs); margin: 4px 0; }
.create { display: grid; gap: 12px; }
.create .btn { justify-self: start; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.lrow:last-child { border-bottom: 0; }
.lrow-main { flex: 1; min-width: 0; display: grid; }
.lrow-title { font-weight: 700; font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-title small { color: var(--ink-3); font-weight: 400; }
.lrow-meta { font-size: .7rem; color: var(--ink-3); }
.lrow-btns { display: flex; gap: 6px; flex: none; }
.lrow .btn { flex: none; }
.lrow.is-forme { background: var(--lime-wash); box-shadow: inset 3px 0 0 var(--lime); padding-left: 10px; }
.online-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--lime); box-shadow: 0 0 8px rgba(200, 255, 58, .85); flex: none; }
.online-dot.busy { background: var(--cyan); box-shadow: 0 0 8px rgba(58, 224, 255, .75); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chips button { border: 0; background: var(--pad-off); border-radius: 3px; padding: 7px 10px; cursor: pointer; font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.tc-chips button:hover { color: var(--lime); }
.tc-chips button[aria-pressed="true"] { background: var(--lime); color: var(--on-lime); box-shadow: var(--lime-glow); }
.mine { gap: 0; }
.table-wrap { overflow-x: auto; }
.ranks { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ranks th { text-align: left; font-size: .6rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--lime); padding: 6px 4px; border-bottom: 1px solid var(--rule-2); font-weight: 700; }
.ranks td { padding: 7px 4px; border-bottom: 1px solid var(--rule); }
.ranks td:first-child { color: var(--lime-2); }
.ranks tr.is-me td { color: var(--lime); }
.ranks td.num, .ranks th.num { text-align: right; }
.res-win { color: var(--lime); }
.res-loss { color: var(--orange); }
.res-draw { color: var(--cyan); }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.game-top .meta { font-size: .64rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--ink-3); }
.banner .big { font-family: var(--font-head); font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: var(--track); color: var(--lime); font-size: var(--fs-l); }
.banner.is-orange .big { color: var(--orange); }
.banner.is-cyan .big { color: var(--cyan); }
.banner.is-dashed .big { color: var(--olive-2); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.guest { display: grid; gap: 18px; max-width: 640px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-s); }
.ticks li { display: flex; gap: 10px; align-items: baseline; }
.ticks li::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--lime); box-shadow: 0 0 6px rgba(200, 255, 58, .6); transform: translateY(-2px); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

#acctSlot:empty { display: none; }
