/* ===================== Échecs Express — design ===================== */
:root {
  --bg:        #14130f;
  --bg-soft:   #1c1a14;
  --panel:     #221f18;
  --panel-2:   #2a2620;
  --line:      #38332a;
  --ink:       #f3efe6;
  --ink-soft:  #c8c0b1;
  --muted:     #8c8474;
  --gold:      #e7b24c;
  /* Couleur secondaire (accent d'action) : bleu azur — pour se démarquer du vert « chess.com ».
     On garde les noms de variables --green/--green-d pour ne pas réécrire toute la feuille. */
  --green:     #5aa6ea;
  --green-d:   #3a7fc8;
  --red:       #e0664f;
  --blue:      #6fb1d6;
  --sq-light:  #ebe6d4;
  --sq-dark:   #779457;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 18px 50px -20px rgba(0,0,0,.7);
  --font-disp: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(90, 166, 234,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(231,178,76,.07), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; flex-wrap: nowrap;
  gap: clamp(8px, 2vw, 20px); padding: 11px clamp(14px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28,26,20,.92), rgba(20,19,15,.86));
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; flex-shrink: 0; }
.brand-logo {
  font-size: 20px; line-height: 1; width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 11px;
  color: #1a1710; background: linear-gradient(135deg, var(--gold), #f2cd7a);
  box-shadow: 0 3px 10px -2px rgba(231,178,76,.5);
}
.brand-name { font-family: var(--font-disp); font-weight: 600; font-size: 19px; letter-spacing: .2px; white-space: nowrap; }
.brand-accent { color: var(--gold); }
.nav {
  display: flex; gap: 2px; flex: 1 1 auto; justify-content: center;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  margin: 0 4px; -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  color: var(--ink-soft); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: 7px 11px; cursor: pointer; transition: .18s; flex-shrink: 0;
}
.nav-btn:hover { color: var(--ink); background: var(--panel); }
.nav-btn.active { color: #1a1710; background: var(--gold); border-color: var(--gold); box-shadow: 0 2px 10px -3px rgba(231,178,76,.6); }
@media (max-width: 880px) { .nav { justify-content: flex-start; } .brand-name { display: none; } }
@media (max-width: 620px) { .account-name { display: none; } .account-chip { padding: 4px; } }

/* ---------- Layout ---------- */
.view { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(18px, 4vw, 40px); }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 22px; border-top: 1px solid var(--line); }
.section-title { font-family: var(--font-disp); font-weight: 600; font-size: clamp(22px, 3.4vw, 30px); margin: 4px 0 6px; }
.lead, .hero-sub { color: var(--ink-soft); line-height: 1.6; }

/* ---------- Accueil ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow);
}
.hero::after {
  content: "♞"; position: absolute; right: -20px; bottom: -50px;
  font-size: 230px; color: rgba(255,255,255,.025); pointer-events: none;
}
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid rgba(231,178,76,.4); border-radius: 999px; padding: 5px 12px; margin-bottom: 14px;
}
.hero h1 { font-family: var(--font-disp); font-weight: 700; font-size: clamp(30px, 5.4vw, 50px); line-height: 1.05; margin: 0 0 12px; }
.grad { background: linear-gradient(100deg, var(--green), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 620px; font-size: clamp(15px, 2vw, 17px); }
.xpbar { margin-top: 22px; height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; max-width: 460px; }
.xpbar-fill { height: 100%; background: linear-gradient(90deg, var(--green-d), var(--green)); border-radius: 999px; transition: width .6s; }
.xp-meta { margin-top: 8px; color: var(--muted); font-size: 13px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
@media (max-width: 620px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; text-align: center; }
.stat-num { font-family: var(--font-disp); font-size: clamp(24px, 4vw, 34px); font-weight: 600; color: var(--gold); }
.stat-lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

.path { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.path-card {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; transition: .18s; color: inherit; font: inherit;
}
.path-card:hover { transform: translateY(-2px); border-color: var(--green-d); box-shadow: var(--shadow); }
.path-num { font-family: var(--font-disp); font-size: 20px; color: var(--muted); width: 24px; text-align: center; }
.path-icon { font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--panel-2); border-radius: 12px; }
.path-body { flex: 1; }
.path-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--green); }
.path-body h3 { margin: 2px 0 3px; font-size: 17px; font-family: var(--font-disp); font-weight: 600; }
.path-body p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.path-go { font-size: 22px; color: var(--muted); transition: .18s; }
.path-card:hover .path-go { color: var(--green); transform: translateX(4px); }

.tip { margin-top: 22px; background: linear-gradient(135deg, rgba(231,178,76,.1), rgba(90, 166, 234,.06)); border: 1px solid rgba(231,178,76,.28); border-radius: var(--radius-sm); padding: 16px 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

/* ---------- Évolution Elo (accueil) ---------- */
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.elo-spark { text-align: center; flex-shrink: 0; }
.spark { display: block; }
.spark-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.tierbar { margin-top: 20px; max-width: 560px; }
.tierbar-track { height: 12px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.tierbar-track.sm { height: 8px; }
.tierbar-fill { height: 100%; background: linear-gradient(90deg, var(--green-d), var(--gold)); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.tierbar-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-soft); margin-top: 7px; }
.hero-cta { width: auto; margin-top: 22px; padding: 13px 26px; font-size: 15px; }

/* ---------- Onglets ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tab { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink-soft); background: transparent; border: none; border-radius: 999px; padding: 8px 18px; cursor: pointer; transition: .15s; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--gold); color: #1a1710; }

/* ---------- Filtres thème ---------- */
.theme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--green-d); color: #06223c; border-color: var(--green-d); }

/* ---------- Blitz ---------- */
.blitz-hud { display: flex; gap: 10px; margin: 10px 0; }
.blitz-stat { flex: 1; text-align: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; }
.bnum { font-family: var(--font-disp); font-size: 22px; font-weight: 700; color: var(--gold); }
.blbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.blitz-final { text-align: center; padding: 10px 0 14px; }

/* ---------- En-tête Elo (entraînement) ---------- */
.elo-head { display: flex; align-items: center; gap: 16px; margin: 8px 0 12px; }
.elo-big { font-family: var(--font-disp); font-size: 40px; font-weight: 700; color: var(--gold); line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.elo-unit { font-size: 13px; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.elo-mini { flex: 1; }
.elo-mini-top { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }

.result-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.res-tag { font-weight: 700; font-size: 16px; }
.result-row.win .res-tag { color: var(--green); }
.result-row.lose .res-tag { color: var(--red); }
.elo-delta { font-family: var(--font-disp); font-weight: 700; font-size: 20px; padding: 3px 12px; border-radius: 999px; }
.elo-delta.up { color: var(--green); background: rgba(90, 166, 234,.14); }
.elo-delta.down { color: var(--red); background: rgba(224,102,79,.14); }
.rating-line { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }

/* ---------- Ouvertures ---------- */
.opening-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.opening-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: .18s; color: inherit; font: inherit; border-left: 3px solid var(--line); }
.opening-card.white { border-left-color: #d9d2bd; }
.opening-card.black { border-left-color: #4a4540; }
.opening-card:hover { transform: translateY(-3px); border-color: var(--green-d); box-shadow: var(--shadow); }
.op-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.op-color { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.op-eco { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); padding: 2px 7px; border-radius: 5px; }
.opening-card h3 { font-family: var(--font-disp); font-weight: 600; font-size: 17px; margin: 0 0 5px; }
.opening-card p { margin: 0 0 10px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.op-line { font-family: var(--font-disp); font-size: 13px; color: var(--gold); letter-spacing: .3px; }
.op-movelist { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; font-size: 14px; }
.op-mv { color: var(--ink-soft); }
.op-mv.me { color: var(--gold); font-weight: 600; }

/* ---------- Bouton son (topbar) ---------- */
.sound-btn { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 15px; transition: .15s; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sound-btn:hover { border-color: var(--muted); color: var(--ink); }
/* icônes SVG */
.ico { display: block; }
.btn-ico { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-ico .ico { width: 16px; height: 16px; }
.push-on-lbl { display: inline-flex; align-items: center; gap: 6px; }
.sp-mute, .sheet-mute { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Play layout (board + side) ---------- */
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.board-col { display: flex; justify-content: center; }
.board-host { width: min(560px, 92vw); }
.small-board { width: min(420px, 88vw); }
.side-col { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 860px) {
  .play-layout { grid-template-columns: 1fr; }
  .side-col { order: 2; }
  .nav-btn { padding: 7px 11px; font-size: 13px; }
}

/* ---------- Échiquier ---------- */
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1 / 1; width: 100%;
  border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.4);
  container-type: inline-size;
  position: relative; touch-action: none; user-select: none;
}
.sq { position: relative; display: grid; place-items: center; }
.sq.light { background: var(--sq-light); }
.sq.dark  { background: var(--sq-dark); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(231,178,76,.42); }
.sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(224,102,79,.85), rgba(224,102,79,0) 72%); }
.sq.sel::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px rgba(90, 166, 234,.9); }
.sq.target::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px rgba(90, 166, 234,.95); border-radius: 4px; }
.sq.hintsq::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 4px var(--gold); }

.lbl { position: absolute; font-size: 2.6cqw; font-weight: 700; opacity: .55; pointer-events: none; }
.lbl.rank { top: 2px; left: 3px; }
.lbl.file { bottom: 1px; right: 4px; }
.sq.light .lbl { color: #6c7b52; }
.sq.dark .lbl { color: #e9ecd6; }

.piece {
  cursor: grab; z-index: 2;
  display: grid; place-items: center; width: 100%; height: 100%;
  padding: 5%; box-sizing: border-box;
  transition: opacity .1s, transform .08s;
  filter: drop-shadow(0 2px 2.5px rgba(0,0,0,.32));
}
.piece svg { width: 100%; height: 100%; display: block; pointer-events: none; }
/* repli sur glyphes Unicode si les SVG ne sont pas chargés */
.piece .glyph { font-size: 9.6cqw; line-height: 1; }
.piece .glyph.w { color: #f8f6ee; -webkit-text-stroke: 1.4px #2c2925; }
.piece .glyph.b { color: #2a2622; -webkit-text-stroke: 1.2px #0c0b0a; }
.piece.ghost {
  position: fixed; transform: translate(-50%, -55%) scale(1.06); pointer-events: none; z-index: 999;
  display: grid; place-items: center; cursor: grabbing;
  filter: drop-shadow(0 7px 9px rgba(0,0,0,.45));
}
.dot {
  position: absolute; width: 30%; height: 30%; border-radius: 50%;
  background: rgba(40,40,30,.32); pointer-events: none; z-index: 1;
}
.sq.light .dot { background: rgba(90,90,60,.34); }
.dot.cap {
  width: 86%; height: 86%; background: transparent;
  border: 5px solid rgba(40,40,30,.3); box-sizing: border-box;
}
.knight-home::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--gold); }
.sq.picked::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: rgba(111,177,214,.55); }
.sq.good-cell::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #1c3a12; font-size: 5cqw; font-weight: 800; background: rgba(90, 166, 234,.55); }
.sq.miss-cell::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 4px var(--red); }
.sq.ok::after { content: ""; position: absolute; inset: 0; background: rgba(90, 166, 234,.5); }
.sq.no::after { content: ""; position: absolute; inset: 0; background: rgba(224,102,79,.5); }

@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.sq.shake { animation: shake .28s; z-index: 4; }

/* promotion */
.promo-overlay { position: absolute; inset: 0; background: rgba(10,9,7,.75); display: grid; place-items: center; z-index: 20; }
.promo-box { display: flex; gap: 6px; background: var(--panel); padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.promo-choice { font-size: 38px; width: 56px; height: 56px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; cursor: pointer; }
.promo-choice:hover { border-color: var(--gold); }

/* ---------- Panels & boutons ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--green); }
.panel-title { font-family: var(--font-disp); font-weight: 600; font-size: 22px; margin: 4px 0 10px; }
.diff { color: var(--gold); letter-spacing: 2px; font-size: 14px; }
.turn-to-move { margin-top: 8px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.check-mark { color: var(--green); }

.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  background: var(--green); color: #06223c; border: none; border-radius: 10px;
  padding: 11px 16px; cursor: pointer; transition: .16s; width: 100%;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: var(--panel-2); color: var(--ink-soft); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn.small { width: auto; padding: 8px 13px; font-size: 13px; }
.btn.big { padding: 14px; font-size: 15px; margin-top: 6px; }
.btn.back { margin-bottom: 14px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.feedback { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14.5px; line-height: 1.5; }
.feedback.good { border-color: rgba(90, 166, 234,.5); background: rgba(90, 166, 234,.08); }
.feedback.bad { border-color: rgba(224,102,79,.5); background: rgba(224,102,79,.08); }
.feedback.solved .btn { margin-top: 12px; }
.explain { margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.muted { color: var(--muted); }
.good { color: var(--green); }
.bad { color: var(--red); }
.movechip { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-weight: 700; font-family: var(--font-disp); }

.puzzle-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.pnav { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: .15s; }
.pnav:hover { border-color: var(--muted); }
.pnav.cur { border-color: var(--gold); color: var(--gold); }
.pnav.done { background: var(--green-d); color: #06223c; border-color: var(--green-d); }

/* ---------- Play module ---------- */
.field { margin-top: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 7px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn { flex: 1; min-width: 64px; padding: 9px 6px; font-size: 13px; font-weight: 600; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft); cursor: pointer; transition: .15s; }
.seg-btn:hover { border-color: var(--muted); }
.seg-btn.on { background: var(--gold); color: #1a1710; border-color: var(--gold); }
.toggle { width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.toggle .dot { position: static; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); transition: .15s; flex-shrink: 0; }
.toggle.on { border-color: rgba(90, 166, 234,.5); color: var(--ink); }
.toggle.on .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.hint-text { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; }

.status { margin-top: 10px; font-size: 14.5px; color: var(--ink-soft); min-height: 22px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.red { background: rgba(224,102,79,.18); color: var(--red); border: 1px solid rgba(224,102,79,.4); }
.coach { margin-top: 12px; }
.coach.warn, .coach.gift { border-radius: var(--radius-sm); padding: 13px 15px; font-size: 13.5px; line-height: 1.5; }
.coach.warn { background: rgba(224,102,79,.1); border: 1px solid rgba(224,102,79,.45); }
.coach.gift { background: rgba(231,178,76,.1); border: 1px solid rgba(231,178,76,.45); }
.coach-h { font-weight: 700; margin-bottom: 5px; }
.coach p { margin: 0 0 10px; color: var(--ink-soft); }
.coach-actions { display: flex; gap: 8px; }
.coach-actions .btn { width: auto; flex: 1; }
.result { font-weight: 700; padding: 12px; border-radius: 10px; text-align: center; margin: 6px 0 12px; font-size: 15px; }
.result.win { background: rgba(90, 166, 234,.14); color: var(--green); }
.result.lose { background: rgba(224,102,79,.14); color: var(--red); }
.result.draw { background: var(--panel-2); color: var(--ink-soft); }

.moves-panel { max-height: 220px; display: flex; flex-direction: column; }
.movelist { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; overflow-y: auto; font-size: 14px; }
.mv-row { white-space: nowrap; }
.mv-no { color: var(--muted); font-weight: 600; }
.mv { font-weight: 600; }
.hud2 { margin-top: 10px; color: var(--muted); font-size: 13px; }

/* ---------- Drills (vision / mats) ---------- */
.drill-menu .lead, .principles .lead { max-width: 640px; margin-bottom: 18px; }
.drill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.drill-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: .18s; color: inherit; font: inherit; }
.drill-card:hover { transform: translateY(-3px); border-color: var(--green-d); box-shadow: var(--shadow); }
.drill-icon { font-size: 34px; margin-bottom: 8px; }
.drill-card h3 { font-family: var(--font-disp); font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.drill-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.drill-run { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hud { font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.hud .target-coord { font-family: var(--font-disp); font-size: 22px; color: var(--gold); font-weight: 700; }
.big-square { width: min(280px, 80vw); aspect-ratio: 1; background: var(--sq-dark); border-radius: var(--radius); display: grid; place-items: center; box-shadow: var(--shadow); transition: .1s; }
.big-square.ok { background: var(--green); }
.big-square.no { background: var(--red); }
.sq-name { font-family: var(--font-disp); font-size: 64px; font-weight: 700; color: #fff; }
.lr-btns { display: flex; gap: 12px; }
.btn.lr { width: 140px; padding: 16px; font-size: 15px; }
.btn.lr.light { background: var(--sq-light); color: #3a3320; }
.btn.lr.dark { background: var(--sq-dark); color: #fff; }
.drill-res { min-height: 24px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.drill-final { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big-score { font-family: var(--font-disp); font-size: 56px; font-weight: 700; color: var(--gold); }
.drill-final .btn { width: auto; }

.tip-box { background: rgba(231,178,76,.08); border: 1px solid rgba(231,178,76,.28); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 4px 0 12px; }

/* ---------- Principes ---------- */
.principle-text { color: var(--ink-soft); line-height: 1.6; font-size: 14.5px; }
.dots { display: flex; gap: 8px; justify-content: center; }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); }
.pdot.cur { background: var(--gold); border-color: var(--gold); }
.pdot.done { background: var(--green-d); border-color: var(--green-d); }

/* ---------- Analyse de partie ---------- */
.end-actions { display: flex; flex-direction: column; gap: 8px; }
.accuracy-row { display: flex; gap: 12px; margin: 12px 0; }
.acc-box { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.acc-box.you { border-color: rgba(90, 166, 234,.45); }
.acc-pct { font-family: var(--font-disp); font-size: 26px; font-weight: 700; color: var(--gold); }
.acc-lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.mistake-tally { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.move-detail { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; min-height: 40px; }
.md-head { margin-bottom: 4px; }
.md-label { font-weight: 700; }
.md-better { color: var(--ink-soft); }
.md-good { color: var(--green); }
.q-best { color: #7fd1e0; }
.q-good { color: var(--green); }
.q-inacc { color: #e8c84b; }
.q-mistake { color: #e89a4b; }
.q-blunder { color: var(--red); }
.review-nav { display: flex; gap: 6px; }
.review-nav .btn { flex: 1; padding: 8px 4px; }
.review-moves { display: flex; flex-wrap: wrap; gap: 3px; max-height: 230px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.rmv { display: inline-flex; align-items: baseline; gap: 3px; background: var(--panel-2); border: 1px solid transparent; border-radius: 6px; padding: 3px 7px; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.rmv:hover { border-color: var(--muted); }
.rmv.cur { border-color: var(--gold); background: rgba(231,178,76,.12); }
.rmv .mv-no { color: var(--muted); font-size: 11px; }
.rmv-san { font-weight: 600; color: var(--ink); }
.rmv-ic { font-size: 11px; font-weight: 700; }
.rmv.q-blunder .rmv-ic { color: var(--red); }
.rmv.q-mistake .rmv-ic { color: #e89a4b; }
.rmv.q-inacc .rmv-ic { color: #e8c84b; }
.review-tag { background: rgba(111,177,214,.16); color: var(--blue); border: 1px solid rgba(111,177,214,.4); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }

/* ---------- Défi du jour ---------- */
.daily-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: linear-gradient(135deg, rgba(231,178,76,.12), rgba(90, 166, 234,.06)); border: 1px solid rgba(231,178,76,.3); border-radius: var(--radius); padding: 16px 20px; cursor: pointer; transition: .18s; color: inherit; font: inherit; margin-bottom: 22px; }
.daily-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.daily-card.done { background: var(--panel); border-color: var(--line); }
.daily-ic { font-size: 30px; }
.daily-body { flex: 1; }
.daily-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gold); }
.daily-body h3 { margin: 2px 0 3px; font-size: 17px; font-family: var(--font-disp); font-weight: 600; }
.daily-body p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.daily-streak { color: var(--ink-soft); font-size: 14px; margin: 8px 0; }

/* ---------- Objectifs du jour ---------- */
.quests-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; }
.quests-card.done { border-color: rgba(90, 166, 234,.45); }
.quests-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.quests-reward { color: var(--green); font-weight: 700; font-size: 13px; }
.quests-list { display: flex; flex-direction: column; gap: 10px; }
.quest-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px 10px; }
.quest-ic { font-size: 18px; }
.quest-lbl { font-size: 14px; color: var(--ink-soft); }
.quest-row.ok .quest-lbl { color: var(--ink); }
.quest-prog { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.quest-bar { grid-column: 2 / 4; height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.quest-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--green-d), var(--green)); border-radius: 999px; transition: width .5s; }
.quest-row.ok .quest-bar-fill { background: var(--green); }

/* ---------- Succès ---------- */
.ach-strip-wrap { margin-bottom: 24px; }
.ach-strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ach-strip-head .btn { width: auto; }
.ach-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-mini { width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); filter: grayscale(1) opacity(.4); }
.ach-mini.on { filter: none; background: rgba(231,178,76,.1); border-color: rgba(231,178,76,.4); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.ach-card { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; position: relative; opacity: .55; }
.ach-card.on { opacity: 1; border-color: rgba(231,178,76,.35); }
.ach-icon { font-size: 30px; filter: grayscale(1); }
.ach-card.on .ach-icon { filter: none; }
.ach-body { flex: 1; }
.ach-body h3 { margin: 0 0 2px; font-size: 15px; font-family: var(--font-disp); font-weight: 600; }
.ach-body p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.ach-check { color: var(--green); font-weight: 800; }
.ach-lock { opacity: .5; }

/* ---------- Multijoueur en ligne ---------- */
.online-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.multielo { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 6px; }
.me-elo { font-family: var(--font-disp); font-weight: 700; font-size: 20px; color: var(--gold); line-height: 1.1; }
.me-elo span { font-family: var(--font-body); font-size: 11px; color: var(--muted); font-weight: 600; }
.me-name { font-size: 12px; color: var(--ink-soft); }
.join-row, .add-friend { display: flex; gap: 8px; margin-top: 12px; }
.join-row input, .add-friend input { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; color: var(--ink); font-size: 14px; font-family: var(--font-body); }
.join-row input:focus, .add-friend input:focus { outline: none; border-color: var(--green-d); }
.join-row .btn, .add-friend .btn { width: auto; }
.open-code { margin-top: 12px; background: rgba(90, 166, 234,.08); border: 1px solid rgba(90, 166, 234,.35); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.open-code strong { font-family: var(--font-disp); color: var(--gold); letter-spacing: 1px; }
.open-code input { width: 100%; margin-top: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink-soft); font-size: 12.5px; }

.friends-list { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.friends-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 8px 0 2px; }
.friend-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.fr-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.fr-elo { font-size: 12px; color: var(--gold); font-weight: 700; }
.fr-actions { display: flex; gap: 6px; align-items: center; }
.fr-actions .btn { width: auto; }
.presence { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.presence.on { background: var(--green); box-shadow: 0 0 7px var(--green); }
.small { font-size: 12px; }

.pl-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; }
.pl-card.top { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pl-card.bot { border-top: 1px solid var(--line); margin-top: 8px; }
.pl-id { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.you-tag { font-size: 10px; background: var(--gold); color: #1a1710; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.clock { font-family: var(--font-disp); font-weight: 700; font-size: 22px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 12px; min-width: 64px; text-align: center; }

.challenge-banner { position: fixed; right: 20px; bottom: 20px; width: 320px; max-width: 92vw; background: var(--panel); border: 1px solid var(--gold); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); z-index: 250; opacity: 0; transform: translateY(16px); transition: .3s; }
.challenge-banner.show { opacity: 1; transform: translateY(0); }
.cb-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cb-actions { display: flex; gap: 8px; }
.cb-actions .btn { flex: 1; width: auto; }

/* ---------- Matchmaking / classement / spectateur / chat ---------- */
.queue-status { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--ink-soft); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.live-games { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.live-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; color: inherit; font: inherit; transition: .15s; }
.live-row:hover { border-color: var(--green-d); }
.lg-players { font-weight: 600; font-size: 14px; }

.leaderboard { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; }
.lb-row:nth-child(odd) { background: var(--panel-2); }
.lb-row.me { background: rgba(231,178,76,.12); border: 1px solid rgba(231,178,76,.4); }
.lb-rank { width: 24px; text-align: center; font-family: var(--font-disp); font-weight: 700; color: var(--muted); }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); font-size: 17px; }
.lb-name { flex: 1; font-weight: 600; font-size: 14px; }
.lb-games { font-size: 12px; }
.lb-elo { font-family: var(--font-disp); font-weight: 700; color: var(--gold); }

.chat-panel { margin-top: 14px; }
.chat-log { max-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13.5px; }
.chat-msg { color: var(--ink-soft); line-height: 1.4; }
.chat-msg strong { color: var(--gold); }
.chat-input { display: flex; gap: 6px; }
.chat-input input { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; color: var(--ink); font-size: 13.5px; }
.chat-input input:focus { outline: none; border-color: var(--green-d); }
.chat-input .btn { width: auto; }
.btn.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(90, 166, 234,.5); } 50% { box-shadow: 0 0 0 8px rgba(90, 166, 234,0); } }

/* ---------- Comptes : barre du haut ---------- */
.account-slot { display: flex; align-items: center; flex-shrink: 0; }
.account-chip { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; transition: .15s; }
.account-chip:hover { border-color: var(--muted); }
.account-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; }
.avatar-fallback { background: linear-gradient(135deg, var(--green-d), var(--gold)); color: #14130f; display: grid; place-items: center; font-weight: 800; font-family: var(--font-disp); }

/* ---------- Cloche de notifications ---------- */
.bell { position: relative; background: transparent; border: 1px solid var(--line); color: var(--ink-soft); width: 36px; height: 36px; border-radius: 999px; cursor: pointer; font-size: 15px; flex-shrink: 0; transition: .15s; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.bell:hover { border-color: var(--muted); color: var(--ink); }
.bell.has { border-color: rgba(231,178,76,.5); }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.bell-panel { position: fixed; z-index: 260; width: 300px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; }
.bell-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 4px 6px 8px; }
.bell-empty { padding: 14px 6px; text-align: center; font-size: 14px; }
.bell-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px; border-top: 1px solid var(--line); }
.bell-txt { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.bell-acts { display: flex; gap: 5px; flex-shrink: 0; }
.bell-acts .btn { width: auto; padding: 5px 10px; }

/* ---------- Toasts ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; background: var(--panel); border: 1px solid var(--line); color: var(--ink); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 200; transition: .3s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(90, 166, 234,.5); }
.toast.bad { border-color: rgba(224,102,79,.5); }

/* ---------- Connexion / inscription ---------- */
.auth-wrap { max-width: 440px; margin: 10px auto; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.auth-head { text-align: center; margin-bottom: 16px; }
.auth-head .brand-logo { font-size: 34px; }
.auth-head h2 { font-family: var(--font-disp); font-weight: 600; font-size: 24px; margin: 6px 0 4px; }
.auth-head p { color: var(--ink-soft); font-size: 14px; margin: 0; }
.auth-tabs { display: flex; width: 100%; margin: 0 0 18px; }
.auth-tabs .tab { flex: 1; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.auth-form input { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); font-size: 15px; font-family: var(--font-body); }
.auth-form input:focus { outline: none; border-color: var(--green-d); }
.auth-msg { font-size: 13.5px; min-height: 4px; color: var(--ink-soft); }
.auth-msg.good { color: var(--green); }
.auth-msg.bad { color: var(--red); }
.preview-link { margin-top: 8px; font-size: 13px; }
.preview-link a { color: var(--gold); }

/* ---------- Profil ---------- */
.account-wrap { max-width: 720px; margin: 0 auto; }
.profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.profile-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-btn { position: relative; background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar { border: 2px solid var(--line); }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #14130f; display: grid; place-items: center; font-size: 14px; border: 2px solid var(--panel); }
.profile-id h2 { font-family: var(--font-disp); font-weight: 600; font-size: 24px; margin: 0 0 4px; }
.profile-email { color: var(--ink-soft); font-size: 14px; }
.verified-badge { color: var(--green); font-weight: 700; font-size: 12px; }
.profile-elo { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.profile-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.profile-actions .btn { width: auto; }

/* ===================== Mobile : barre du bas + feuille ===================== */
.bottom-nav { display: none; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; opacity: 0; transition: .25s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; background: var(--panel); border-top-left-radius: 22px; border-top-right-radius: 22px; border-top: 1px solid var(--line); padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .28s cubic-bezier(.2,.85,.25,1); box-shadow: 0 -10px 40px -10px rgba(0,0,0,.6); }
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 6px auto 14px; }
.sheet-title { font-family: var(--font-disp); font-size: 18px; margin: 0 0 14px; text-align: center; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-item { display: flex; flex-direction: column; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; }
.sheet-item:active { transform: scale(.96); }
.sheet-item.wide { flex-direction: row; justify-content: center; gap: 10px; margin-top: 10px; width: 100%; }
.sheet-ic { font-size: 24px; }

@media (max-width: 820px) {
  .topbar .nav { display: none; }
  .topbar { padding: 9px 14px; }
  .account-slot { margin-left: auto; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: rgba(26,24,19,.97); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .bnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--muted); padding: 5px 2px; cursor: pointer; border-radius: 10px; transition: .15s; min-width: 0; }
  .bnav-btn:active { background: var(--panel-2); }
  .bnav-ic { font-size: 21px; line-height: 1; }
  .bnav-lbl { font-size: 10px; font-weight: 600; }
  .bnav-btn.active { color: var(--gold); }
  body { padding-bottom: 66px; overflow-x: hidden; }
  .footer { display: none; }
  .view { padding: 16px 13px 22px; }
  input, select, textarea { font-size: 16px !important; }  /* évite le zoom iOS au focus */
  .challenge-banner { left: 10px; right: 10px; width: auto; bottom: calc(74px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .section-title { font-size: 24px; }
  .hero h1 { font-size: 34px; }
  .controls { grid-template-columns: 1fr 1fr; }
  .online-head { flex-direction: column; }
  .multielo { align-self: stretch; }
  .stat-row { gap: 10px; }
  .opening-grid, .drill-grid, .ach-grid { grid-template-columns: 1fr 1fr; }
  .promo-box { gap: 4px; }
  .promo-choice { width: 52px; height: 52px; }
}
@media (max-width: 420px) {
  .opening-grid, .drill-grid, .ach-grid, .sheet-grid { grid-template-columns: 1fr 1fr; }
  .seg { gap: 5px; }
  .seg-btn { min-width: 0; padding: 9px 4px; font-size: 12.5px; }
}

/* ---------- Volume (popover + feuille) ---------- */
.sound-pop { position: fixed; z-index: 260; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; }
.sp-mute { background: none; border: none; font-size: 18px; cursor: pointer; }
.sound-pop input[type=range], .sheet-vol input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; background: var(--panel-2); outline: none; }
.sound-pop input[type=range] { width: 120px; }
.sound-pop input[type=range]::-webkit-slider-thumb, .sheet-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; }
.sp-val { font-size: 12px; color: var(--muted); width: 24px; text-align: right; }
.sheet-vol { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.sheet-mute { background: none; border: none; font-size: 22px; cursor: pointer; }
.sheet-vol input[type=range] { flex: 1; }

/* ---------- Pièces capturées / avantage matériel ---------- */
.cap-pc { display: inline-block; width: 17px; height: 17px; vertical-align: middle; margin-right: -3px; opacity: .92; }
.cap-pc svg { width: 100%; height: 100%; display: block; }
.cap-adv { font-size: 12px; font-weight: 700; color: var(--green); margin-left: 6px; vertical-align: middle; }
.pl-cap { display: inline-flex; align-items: center; flex-wrap: wrap; min-height: 18px; flex: 1; margin: 0 8px; }
.mat-line { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 2px; font-size: 13px; }
.mat-side { display: inline-flex; align-items: center; gap: 5px; }
.mat-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }

/* ---------- Onboarding ---------- */
.onboard-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(10,9,7,.86); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; opacity: 0; transition: opacity .25s; overflow-y: auto; }
.onboard-overlay.show { opacity: 1; }
.onboard-card { width: 100%; max-width: 460px; background: linear-gradient(135deg, var(--panel), var(--bg-soft)); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; text-align: center; box-shadow: var(--shadow); }
.onboard-logo { width: 60px; height: 60px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 30px; border-radius: 16px; color: #1a1710; background: linear-gradient(135deg, var(--gold), #f2cd7a); box-shadow: 0 6px 18px -4px rgba(231,178,76,.5); }
.onboard-card h2 { font-family: var(--font-disp); font-weight: 700; font-size: 26px; margin: 0 0 6px; }
.onboard-card > p { color: var(--ink-soft); margin: 0 0 18px; }
.onboard-levels { display: grid; gap: 10px; margin-bottom: 16px; }
.onboard-levels button { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 4px 12px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; color: var(--ink); transition: .15s; }
.onboard-levels button:hover { border-color: var(--green-d); transform: translateY(-2px); }
.onboard-levels button span { font-size: 24px; grid-row: span 2; }
.onboard-levels button strong { font-size: 15px; }
.onboard-levels button small { color: var(--muted); font-size: 12.5px; }

/* ---------- Thèmes d'échiquier ---------- */
:root[data-board="wood"]  { --sq-light: #f0d9b5; --sq-dark: #b58863; }
:root[data-board="blue"]  { --sq-light: #dde6ef; --sq-dark: #6f8faf; }
:root[data-board="gray"]  { --sq-light: #e6e6e6; --sq-dark: #8a8d92; }
:root[data-board="pink"]  { --sq-light: #f3dfe8; --sq-dark: #c585a5; }
:root[data-board="night"] { --sq-light: #9fa8b2; --sq-dark: #46505c; }

/* ---------- Page Réglages ---------- */
.settings-wrap { max-width: 620px; }
.settings-card { margin-bottom: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: none; }
.set-row > span { font-size: 14px; }
.set-label { font-size: 13px; color: var(--ink-soft); margin: 4px 0 10px; }
.set-vol { display: flex; align-items: center; gap: 10px; }
.set-vol input[type=range] { -webkit-appearance: none; appearance: none; width: 130px; height: 5px; border-radius: 999px; background: var(--panel-2); }
.set-vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.theme-swatch { background: var(--panel-2); border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .15s; }
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.on { border-color: var(--green); }
.tsw { width: 46px; height: 46px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border-radius: 6px; overflow: hidden; }
.tsw span { display: block; }
.theme-swatch small { font-size: 12px; color: var(--ink-soft); }
.btn.danger { color: var(--red); border-color: rgba(224,102,79,.4); }
.btn.danger:hover { background: rgba(224,102,79,.12); }

/* liens texte (mot de passe oublié, légal…) */
.linklike { background: none; border: none; color: var(--gold); cursor: pointer; font: inherit; font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: var(--green); }
.auth-card .linklike { display: block; margin: 14px auto 0; }
.footer-links { margin-top: 4px; }

/* accessibilité : respecter la préférence « animations réduites » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* focus clavier visible et cohérent */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* fiche profil publique (modal) */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 200; padding: 20px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 360px; width: 100%; position: relative; box-shadow: var(--shadow); animation: pmpop .2s ease; }
@keyframes pmpop { from { transform: scale(.94); opacity: 0; } }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.pm-head { display: flex; align-items: center; gap: 14px; }
.pm-head h3 { margin: 0 0 2px; font-size: 19px; }
.pm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 4px; text-align: center; }
.pm-stats div { background: var(--panel-2); border-radius: 10px; padding: 10px 4px; }
.pm-stats strong { display: block; font-size: 20px; font-family: var(--font-disp); }
.pm-stats span { font-size: 11px; color: var(--muted); }
.pm-actions { display: flex; gap: 8px; margin-top: 16px; }
.pm-actions .btn { flex: 1; }
.fr-click { cursor: pointer; }
.fr-click:hover { color: var(--gold); }
.pl-name[data-player], .chat-from[data-player] { cursor: pointer; }
.pl-name[data-player]:hover, .chat-from[data-player]:hover { color: var(--gold); }
button.lb-row { width: 100%; border: none; font: inherit; color: var(--ink); cursor: pointer; transition: .12s; }
.lb-row:hover { background: rgba(255,255,255,.06); }

/* courbe d'Elo + historique de parties (profil) */
.elo-chart { width: 100%; height: auto; display: block; margin-top: 4px; }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hist-row:first-child { border-top: none; }
.hist-mode { font-size: 15px; }
.hist-res { font-weight: 700; min-width: 64px; }
.hist-res.win { color: var(--green); }
.hist-res.lose { color: var(--red); }
.hist-res.draw { color: var(--muted); }
.hist-opp { color: var(--ink-soft); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-date { color: var(--muted); font-size: 12px; }
.hist-an { padding: 2px 8px; }

/* page légale */
.legal-wrap { max-width: 680px; }
.legal-card h3 { font-family: var(--font-disp); font-size: 17px; margin: 20px 0 6px; }
.legal-card h3:first-child { margin-top: 0; }
.legal-card p, .legal-card li { color: var(--ink-soft); line-height: 1.6; font-size: 14px; }
.legal-card ul { margin: 6px 0; padding-left: 20px; }
.legal-card li { margin: 4px 0; }
.legal-card a { color: var(--gold); }

/* ---------- Notifications push (pied du panneau cloche) ---------- */
.bell-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.bell-foot .btn { width: auto; }

/* ---------- Révision espacée (ouvertures) ---------- */
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--gold); color: #1a1710; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: middle; }
.sr-cta { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--panel), var(--bg-soft)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0 20px; flex-wrap: wrap; }
.sr-cta-num { font-family: var(--font-disp); font-size: 40px; font-weight: 700; color: var(--gold); min-width: 48px; text-align: center; }
.sr-cta-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.sr-cta .btn { width: auto; }
.sr-grid { display: flex; flex-direction: column; gap: 8px; }
.sr-row { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; cursor: pointer; color: var(--ink); transition: .15s; }
.sr-row:hover { border-color: var(--green-d); transform: translateX(2px); }
.sr-color { font-size: 18px; width: 22px; text-align: center; }
.sr-color.w { color: #f2ead9; } .sr-color.b { color: #b9b09c; }
.sr-name { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.sr-name small { font-weight: 400; color: var(--muted); font-size: 12px; }
.sr-status { font-size: 13px; }
.sr-new { color: var(--gold); font-weight: 700; }
.sr-due { color: var(--green); font-weight: 700; }
.sr-ok { color: var(--muted); }
.sr-progress { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 10px 0 4px; }
.sr-progress-fill { height: 100%; background: linear-gradient(90deg, var(--green-d), var(--green)); border-radius: 999px; transition: width .35s; }
.sr-summary .sr-sum-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.sr-sum-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-due-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: linear-gradient(135deg, rgba(90, 166, 234,.10), var(--panel)); border: 1px solid rgba(90, 166, 234,.35); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; cursor: pointer; color: var(--ink); transition: .15s; }
.review-due-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* scrollbars discrètes */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
