/* ══════════════════════════════════════
   CALISTHÉNIE — Shared styles v2
══════════════════════════════════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  /* Background */
  --bg:        #0a0a0a;
  --bg2:       #121212;
  --bg3:       #1a1a1a;
  --bg4:       #222222;

  /* Borders */
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --border3:   rgba(255,255,255,0.18);

  /* Text */
  --text:      #f2efe9;
  --muted:     #8a8680;
  --faint:     #4a4845;

  /* Mode colors */
  --salle:     #a8d8a8;   /* vert doux — salle */
  --salle-bg:  rgba(168,216,168,0.08);
  --maison:    #f5c875;   /* or — maison */
  --maison-bg: rgba(245,200,117,0.08);
  --street:    #f0997b;   /* orange — street */
  --street-bg: rgba(240,153,123,0.08);
  --skills:    #85b7eb;   /* bleu — skills */
  --skills-bg: rgba(133,183,235,0.08);
  --etire:     #c4a8d8;   /* lavande — étirements */
  --etire-bg:  rgba(196,168,216,0.08);
  --force:     #d8b4fe;   /* violet — force */
  --force-bg:  rgba(216,180,254,0.08);

  /* Accent principal */
  --accent:    #c8f56a;
  --accent-dim:rgba(200,245,106,0.10);

  /* UI */
  --radius:    12px;
  --radius-sm: 8px;
  --nav-h:     58px;
  --bot-h:     64px;

  /* Fonts */
  --font-d: 'Space Grotesk', sans-serif;
  --font-b: 'Inter', sans-serif;
  --font-m: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1,h2,h3,h4 { font-family: var(--font-d); font-weight: 600; line-height: 1.2; }
.mono { font-family: var(--font-m); }

/* ── Top navigation bar ── */
.topbar {
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.back-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 8px; border-radius: var(--radius-sm);
  font-size: 18px; line-height: 1; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; transition: color 0.15s;
}
.back-btn:hover { color: var(--text); background: var(--bg3); }
.topbar-title { font-family: var(--font-d); font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }
.topbar-badge {
  font-family: var(--font-m); font-size: 10px;
  padding: 3px 9px; border-radius: 20px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
}

/* ── Bottom navigation (mobile) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bot-h); background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bnav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--faint); padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s; text-decoration: none;
}
.bnav-btn:hover { color: var(--muted); }
.bnav-emoji { font-size: 20px; }
.bnav-label { font-family: var(--font-m); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Pill sub-nav ── */
.sub-nav {
  display: flex; gap: 8px; padding: 10px 16px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); background: var(--bg2);
  position: sticky; top: var(--nav-h); z-index: 100;
}
.sub-nav::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: none;
  color: var(--muted); font-family: var(--font-d);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.pill:hover { color: var(--text); border-color: var(--border2); }

/* ── Content wrapper ── */
.content {
  padding: 16px 16px 8px;
  max-width: 800px;
  margin: 0 auto;
}
body.has-bottom-nav { padding-bottom: calc(var(--bot-h) + 8px); }

/* ── Page header ── */
.page-hd { padding: 4px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.page-ey { font-family: var(--font-m); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 5px; }
.page-ti { font-family: var(--font-d); font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.2; margin-bottom: 4px; }
.page-su { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Section label ── */
.section-label {
  font-family: var(--font-d); font-size: 11px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 10px; margin-top: 4px;
}

/* ── Alert boxes ── */
.alert {
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 14px; display: flex; gap: 10px;
  align-items: flex-start; font-size: 13px; line-height: 1.6;
}
.alert .ai { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert.ok   { background: rgba(125,211,168,0.07); border: 1px solid rgba(125,211,168,0.2); color: #7dd3a8; }
.alert.warn { background: rgba(245,200,117,0.07); border: 1px solid rgba(245,200,117,0.2); color: #f5c875; }
.alert.info { background: rgba(133,183,235,0.07); border: 1px solid rgba(133,183,235,0.2); color: #85b7eb; }
.alert.accent { background: var(--accent-dim); border: 1px solid rgba(200,245,106,0.2); color: var(--accent); }
.alert strong { color: var(--text); font-weight: 500; }

/* ── Generic card ── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.card h4 {
  font-family: var(--font-d); font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 5px;
  display: flex; align-items: center; gap: 7px;
}
.card p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.card p strong { color: var(--text); font-weight: 500; }

/* ── Exercise table ── */
.tbl { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.tbl thead th {
  background: var(--bg3); font-family: var(--font-m); font-size: 10px;
  color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em;
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 400;
}
.tbl thead th:not(:first-child) { text-align: center; }
.tbl tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg3); }
.tbl td { padding: 11px 12px; vertical-align: top; font-size: 13px; color: var(--text); }
.tbl td:not(:first-child) { text-align: center; font-family: var(--font-m); font-size: 12px; color: var(--muted); }
.tbl .tn { font-family: var(--font-d); font-weight: 500; }
.tbl .tno { font-size: 11px; color: var(--faint); margin-top: 2px; font-style: italic; }

/* ── Skill progression card ── */
.skill-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 10px;
}
.skill-card-head {
  padding: 13px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: background 0.15s; -webkit-tap-highlight-color: transparent;
}
.skill-card-head:hover { background: var(--bg3); }
.skill-emoji { font-size: 22px; flex-shrink: 0; }
.skill-info { flex: 1; min-width: 0; }
.skill-name { font-family: var(--font-d); font-size: 14px; font-weight: 600; color: var(--text); }
.skill-cat { font-size: 11px; color: var(--muted); margin-top: 1px; }
.skill-badge {
  font-family: var(--font-m); font-size: 10px;
  padding: 3px 9px; border-radius: 20px; flex-shrink: 0; font-weight: 500;
}
.skill-chevron { font-size: 11px; color: var(--faint); transition: transform 0.2s; flex-shrink: 0; }
.skill-chevron.open { transform: rotate(180deg); }
.skill-body { display: none; border-top: 1px solid var(--border); }
.skill-body.open { display: block; }

/* ── Skill level rows ── */
.slevel {
  display: grid; grid-template-columns: 22px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.slevel:last-child { border-bottom: none; }
.slevel.done { background: rgba(200,245,106,0.04); }
.sl-num { font-family: var(--font-m); font-size: 11px; color: var(--faint); text-align: center; }
.sl-content { min-width: 0; }
.sl-name { font-family: var(--font-d); font-size: 13px; font-weight: 500; color: var(--text); }
.sl-detail { font-size: 11px; color: var(--muted); margin-top: 1px; }
.sl-tip { font-size: 11px; color: var(--faint); margin-top: 2px; font-style: italic; }
.sl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sl-diff { font-family: var(--font-m); font-size: 10px; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.b1{background:rgba(168,216,168,0.15);color:var(--salle)}
.b2{background:rgba(133,183,235,0.15);color:var(--skills)}
.b3{background:rgba(245,200,117,0.15);color:var(--maison)}
.b4{background:rgba(240,153,123,0.15);color:var(--street)}
.b5{background:rgba(200,245,106,0.15);color:var(--accent)}
.b6{background:rgba(216,180,254,0.15);color:var(--force)}

/* ── Checkbox ── */
.chk {
  width: 20px; height: 20px; border-radius: 5px;
  border: 1.5px solid var(--border2); background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.chk.done { background: var(--accent); border-color: var(--accent); }
.chk.done::after { content: '✓'; font-size: 12px; color: #0a0a0a; font-weight: 700; }

/* ── Skill tutorial section ── */
.tuto-section { padding: 14px; border-bottom: 1px solid var(--border); }
.tuto-section:last-child { border-bottom: none; }
.tuto-label { font-family: var(--font-m); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.tuto-text { font-size: 13px; color: var(--muted); line-height: 1.7; }
.tuto-text strong { color: var(--text); font-weight: 500; }
.tuto-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tuto-step { display: flex; gap: 10px; align-items: flex-start; }
.tuto-step-num { font-family: var(--font-m); font-size: 11px; color: var(--accent); flex-shrink: 0; min-width: 20px; margin-top: 1px; }
.tuto-step-text { font-size: 13px; color: var(--muted); line-height: 1.6; }
.tuto-step-text strong { color: var(--text); font-weight: 500; }
.yt-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,0,0,0.1); border: 1px solid rgba(255,0,0,0.2);
  color: #ff6b6b; font-family: var(--font-d); font-size: 12px;
  font-weight: 500; padding: 6px 12px; border-radius: var(--radius-sm);
  text-decoration: none; margin-top: 8px; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.yt-link:hover { background: rgba(255,0,0,0.15); }

/* ── Étirements ── */
.etire-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.etire-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer; gap: 10px; -webkit-tap-highlight-color: transparent; transition: background 0.15s; }
.etire-head:hover { background: var(--bg3); }
.etire-name { font-family: var(--font-d); font-size: 13px; font-weight: 600; color: var(--text); }
.etire-target { font-size: 11px; color: var(--muted); margin-top: 1px; }
.etire-dur { font-family: var(--font-m); font-size: 11px; color: var(--etire); background: var(--etire-bg); padding: 3px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; }
.etire-chev { font-size: 11px; color: var(--faint); transition: transform 0.2s; flex-shrink: 0; }
.etire-chev.open { transform: rotate(180deg); }
.etire-body { display: none; padding: 0 14px 13px; border-top: 1px solid var(--border); }
.etire-body.open { display: block; padding-top: 11px; }
.etire-how { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.etire-tips { display: flex; flex-direction: column; gap: 5px; }
.etire-tip { display: flex; gap: 7px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.etire-tip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--etire); flex-shrink: 0; margin-top: 6px; }
.etire-tip strong { color: var(--text); font-weight: 500; }
.mtags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.mtag { font-family: var(--font-m); font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--bg3); color: var(--muted); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(var(--bot-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: #0a0a0a;
  font-family: var(--font-d); font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 20px;
  opacity: 0; transition: all 0.3s; z-index: 300;
  white-space: nowrap; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Page footer ── */
.pfooter {
  font-family: var(--font-m); font-size: 10px; color: var(--faint);
  text-align: center; margin-top: 20px; padding: 8px 12px;
  background: var(--bg2); border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── Fade animation ── */
.fade-in { animation: fi 0.18s ease; }
@keyframes fi { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* ── Mobile ── */
@media (max-width: 768px) {
  .content { padding: 14px 14px 6px; }
  .page-ti { font-size: 20px; }
}

/* ── Desktop ── */
@media (min-width: 769px) {
  body.has-bottom-nav { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .content { padding: 24px 32px 32px; }
  .topbar { padding: 0 24px; }
  .sub-nav { padding: 10px 24px; top: var(--nav-h); }
}
