/* ==========================================================================
   TrainTrack — design system (thème sombre, accent bleu)
   ========================================================================== */
:root {
  --bg: #070A10;
  --bg-2: #0B1019;
  --card: #111823;
  --card-2: #172030;
  --line: #1E2838;
  --text: #F2F5FA;
  --muted: #94A0B4;
  --faint: #667286;
  --blue: #1C7BFF;
  --blue-d: #1560D4;
  --blue-soft: rgba(28, 123, 255, .14);
  --green: #22C55E;
  --green-soft: rgba(34, 197, 94, .14);
  --purple: #8B5CF6;
  --purple-soft: rgba(139, 92, 246, .16);
  --orange: #F59E0B;
  --orange-soft: rgba(245, 158, 11, .14);
  --red: #EF4444;
  --r: 14px;
  --r-lg: 18px;
  --tab-h: 66px;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: #03050A; color: var(--text); font-size: 15px; line-height: 1.4;
  display: grid; place-items: center; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
ul, ol { list-style: none; margin: 0; padding: 0; }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cadre de l'application ---------- */
#app {
  position: relative; width: 100%; max-width: 430px; height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 50% -10%, #0E1A2E 0%, var(--bg) 55%); overflow: hidden;
}
@media (min-width: 560px) and (min-height: 760px) and (hover: hover) and (pointer: fine) {
  #app { height: min(100dvh - 32px, 900px); border-radius: 34px; border: 1px solid #1B2433; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
}
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; outline: none; }
.screen::-webkit-scrollbar { display: none; }
.view { min-height: 100%; display: flex; flex-direction: column; animation: fade .18s ease; }
.view > * { flex: 1 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page { padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.page > * { flex-shrink: 0; }
.screen.no-pad .page { padding: 0; }

/* ---------- Utilitaires ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 8px; } .mb { margin-bottom: 14px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.center { text-align: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.up { color: var(--green); } .down { color: var(--red); } .blue { color: var(--blue); } .green { color: var(--green); }
.warn { color: var(--orange); } .bad { color: var(--red); } .ok { color: var(--green); }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.sec { font-size: 17px; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.sub { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.ic { flex-shrink: 0; }
.prose { display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.prose b { color: var(--text); }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv span { color: var(--muted); } .kv b { color: var(--text); text-align: right; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 6px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; font-weight: 600; font-size: 15px; transition: transform .08s, filter .15s, background .15s; border: 1px solid transparent;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; border-radius: 14px; font-size: 16px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 6px 20px rgba(28, 123, 255, .28); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.secondary { background: var(--card-2); border-color: var(--line); color: var(--text); }
.btn.secondary:hover { background: #1C2638; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-ghost { color: #FF6B6B; background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .22); }
.btn.pill { border-radius: 999px; min-height: 38px; font-size: 14px; }
.center-btn { align-self: center; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: 14px; padding: 6px 2px; }
.link-btn.muted { color: var(--muted); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text); flex-shrink: 0; }
.icon-btn:hover { background: var(--card); }
.icon-btn.round { background: var(--card); border: 1px solid var(--line); border-radius: 50%; }
.pill-btn { background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.pill-btn.blue { color: var(--blue); background: transparent; border: 0; }

/* ---------- En-têtes ---------- */
.hd { display: flex; align-items: center; gap: 6px; min-height: 44px; margin: 0 -4px; }
.hd-title { flex: 1; min-width: 0; }
.hd-title h1 { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-title p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.hd-right { display: flex; align-items: center; }
.hd-spacer { width: 40px; height: 40px; display: inline-block; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; background: var(--card-2);
  border: 1px solid var(--line); border-radius: 12px; color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input input, .input select, .input textarea { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); padding: 12px 0; width: 100%; }
.input textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.input select { appearance: none; cursor: pointer; }
.input select option { background: #151D2B; }
.input input::placeholder, .input textarea::placeholder { color: var(--faint); }
.input input[type=date] { color-scheme: dark; }
.input em { font-style: normal; color: var(--faint); font-size: 13px; }
.eye { color: var(--muted); display: grid; place-items: center; width: 32px; height: 32px; }
.form-error { color: #FF7A7A; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .25); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; color: var(--muted); }
.search input { flex: 1; background: transparent; border: 0; outline: 0; padding: 13px 0; color: var(--text); min-width: 0; }
.search:focus-within { border-color: var(--blue); }

/* ---------- Puces, onglets, segments ---------- */
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: .15s; }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip-sm { font-size: 12px; color: var(--muted); background: var(--card-2); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.tabs { display: flex; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tab { flex: 1; padding: 9px 4px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; white-space: nowrap; }
.tab.active { background: var(--blue); color: #fff; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--blue); color: #fff; }

/* ---------- Cartes & listes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card, .row-link, .inj-row, .ev {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; color: var(--text);
}
.row-card > div, .row-link > div, .inj-row > div, .ev > div { flex: 1; min-width: 0; }
.row-card b, .row-link b, .inj-row b, .ev b { display: block; font-size: 15px; font-weight: 600; }
.row-card span, .row-link span:not(.goal-ic):not(.pref-ic), .inj-row span:not(.inj-ic), .ev span:not(.ev-dot) { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row-link > .ic:last-child, .inj-row > .ic:last-child, .ev > .ic:last-child { color: var(--faint); }
.row-link:hover, .session-card:hover, .ev:hover { border-color: #2A3850; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 17px; }
.empty.small { padding: 18px; }
.empty-ic { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--blue-soft); color: var(--blue); }
.empty-ic.purple { background: var(--purple-soft); color: var(--purple); }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); border: 1px solid rgba(28, 123, 255, .35); font-size: 14px; }
.banner span { flex: 1; } .banner em { font-style: normal; color: var(--blue); font-weight: 700; }
.banner.warn { background: var(--orange-soft); border-color: rgba(245, 158, 11, .35); }
.progress { height: 8px; border-radius: 99px; background: #1B2535; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #3B8CFF, var(--blue)); border-radius: 99px; transition: width .4s; }
.progress.purple i { background: linear-gradient(90deg, #A78BFA, var(--purple)); }
.disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--faint); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }

/* ---------- Vignettes d'exercices (placeholder + photo) ---------- */
.thumb {
  position: relative; display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, #1A2740, #0F1726); color: rgba(255, 255, 255, .35); border: 1px solid var(--line);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.sm { width: 48px; height: 48px; border-radius: 10px; } .thumb.xs { width: 34px; height: 34px; border-radius: 9px; } .thumb.xs .ic { width: 16px; height: 16px; }
.thumb.hero { width: 100%; height: 190px; border-radius: 16px; } .thumb.hero .ic { width: 54px; height: 54px; }
.m-chest { background: linear-gradient(145deg, #1D3560, #0F1B33); color: #6FA6FF; }
.m-back { background: linear-gradient(145deg, #1B4A4E, #0E2527); color: #5FD0C9; }
.m-legs { background: linear-gradient(145deg, #4A2C61, #1F1229); color: #C39BFF; }
.m-shoulders { background: linear-gradient(145deg, #5A3B1B, #2A1B0B); color: #FFB65C; }
.m-arms { background: linear-gradient(145deg, #5A2433, #2A101A); color: #FF8DA3; }
.m-abs { background: linear-gradient(145deg, #2F4F25, #14240F); color: #9BE27A; }
.avatar { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(145deg, #2B6BDB, #1C3F8F); font-weight: 700; font-size: 16px; overflow: hidden; flex-shrink: 0; border: 2px solid #1E2A40; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; } .avatar.xl { width: 92px; height: 92px; font-size: 30px; }

/* ---------- Accueil invité / auth ---------- */
.welcome { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 8vh 24px 28px; overflow: hidden; }
.welcome-bg { position: absolute; inset: 0; z-index: 0; background:
  linear-gradient(180deg, rgba(7, 10, 16, .50) 0%, rgba(7, 10, 16, .22) 28%, rgba(7, 10, 16, .78) 62%, #070A10 88%),
  radial-gradient(70% 30% at 50% 18%, rgba(28, 123, 255, .22), transparent 70%),
  url('../assets/bg/welcome.webp') center 12% / cover no-repeat, #070A10; }
.welcome > * { position: relative; z-index: 1; }
.welcome-top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-top: 6vh; }
.logo-mark { width: 124px; filter: drop-shadow(0 8px 30px rgba(28, 123, 255, .5)); }
.brand { font-size: 38px; font-weight: 800; letter-spacing: .02em; margin-top: 8px; }
.brand span { color: var(--blue); }
.tagline { font-size: 12.5px; letter-spacing: .28em; font-weight: 600; color: #B7C4DA; line-height: 1.8; margin-top: 6px; }
.welcome-points { text-align: center; color: #D6DEEB; display: flex; flex-direction: column; gap: 6px; font-size: 15px; margin: 24px 0; }
.welcome-cta { display: flex; flex-direction: column; gap: 12px; }
.auth { padding: 14px 20px 32px; display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.auth-title { font-size: 28px; font-weight: 800; margin-top: 10px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; }
.auth-switch a, .legal a, .forgot { color: var(--blue); font-weight: 600; }
.forgot { align-self: flex-end; font-size: 13.5px; }
.legal { font-size: 12px; color: var(--faint); line-height: 1.5; margin-top: 6px; }
.demo-box { background: var(--blue-soft); border: 1px dashed rgba(28, 123, 255, .5); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 8px; }
.demo-box div { display: flex; align-items: center; gap: 8px; color: #8DBBFF; }
.demo-box p { font-size: 13px; color: var(--muted); }

/* ---------- Accueil ---------- */
.home-hd { display: flex; align-items: center; justify-content: space-between; }
.who { display: flex; align-items: center; gap: 12px; }
.who small { display: block; color: var(--muted); font-size: 13px; } .who b { font-size: 20px; font-weight: 700; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 7px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.day span { font-size: 11px; color: var(--muted); } .day b { font-size: 16px; font-weight: 700; }
.day.active { background: var(--blue); border-color: var(--blue); box-shadow: 0 6px 18px rgba(28, 123, 255, .35); } .day.active span { color: #D6E6FF; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot.none { background: transparent; } .dot.done { background: var(--blue); } .dot.plan { border: 1.5px solid var(--blue); width: 6px; height: 6px; background: transparent; }
.day.active .dot.done { background: #fff; } .day.active .dot.plan { border-color: #fff; }
.dot.inj { background: var(--purple); } .dot.inj-plan { border: 1.5px solid var(--purple); background: transparent; } .dot.wt { background: var(--orange); }
.today-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); background: linear-gradient(135deg, #12213B, #0E1727); border: 1px solid rgba(28, 123, 255, .35); }
.today-card > div { flex: 1; min-width: 0; } .today-card small { color: #7DB0FF; font-size: 13px; font-weight: 500; display: block; }
.today-card b { display: block; font-size: 18px; font-weight: 700; margin: 1px 0; } .today-card span:not(.today-ic) { color: var(--muted); font-size: 13px; }
.today-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--blue); display: grid; place-items: center; flex-shrink: 0; }
.today-ic.ok { background: var(--green); } .today-ic.dim { background: var(--card-2); color: var(--muted); }
.today-card.idle, .today-card.done { background: var(--card); border-color: var(--line); } .today-card.done small { color: var(--green); } .today-card.idle small { color: var(--muted); }
.goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.goal { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; padding: 14px 6px; border-radius: 16px; min-height: 112px; border: 1px solid var(--line); }
.goal small { font-size: 12px; color: var(--muted); } .goal b { font-size: 15px; font-weight: 700; }
.goal.green { background: linear-gradient(160deg, #123022, #0E1A17); border-color: rgba(34, 197, 94, .25); }
.goal.blue { background: linear-gradient(160deg, #11284A, #0E1A2E); border-color: rgba(28, 123, 255, .3); }
.goal.purple { background: linear-gradient(160deg, #2A1B52, #17112D); border-color: rgba(139, 92, 246, .3); }
.goal-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.goal.green .goal-ic, .goal-ic.green { color: var(--green); background: var(--green-soft); } .goal.blue .goal-ic, .goal-ic.blue { color: var(--blue); background: var(--blue-soft); }
.goal.purple .goal-ic, .goal-ic.purple { color: #B79CFF; background: var(--purple-soft); } .goal-ic.orange { color: var(--orange); background: var(--orange-soft); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.quick a span { color: var(--blue); } .quick a.accent { background: var(--purple-soft); border-color: rgba(139, 92, 246, .35); } .quick a.accent span { color: #B79CFF; }

/* ---------- Barre d'onglets ---------- */
.tabbar { display: flex; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(9, 13, 21, .96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); flex-shrink: 0; }
.tabbar[hidden] { display: none; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 11px; font-weight: 600; transition: color .15s; }
.tab-item.active { color: var(--blue); }

/* ---------- Séances ---------- */
.session-card { display: flex; flex-direction: column; gap: 10px; }
.session-card.today { border-color: rgba(28, 123, 255, .5); background: linear-gradient(135deg, #12213B, var(--card)); }
.sc-top { display: flex; align-items: center; justify-content: space-between; } .sc-top b { display: block; font-size: 17px; } .sc-top span { color: var(--muted); font-size: 13px; }
.sc-bot { display: flex; align-items: center; justify-content: space-between; }
.stack-thumbs { display: flex; } .stack-thumbs .thumb { margin-left: -8px; border: 2px solid var(--card); } .stack-thumbs .thumb:first-child { margin-left: 0; }
.ex-list { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--text); }
.ex-row > div { flex: 1; min-width: 0; } .ex-row b { display: block; font-size: 15px; font-weight: 600; } .ex-row span:not(.num):not(.thumb) { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ex-row > .ic:last-child { color: var(--faint); }
.ex-row.current { border-color: var(--blue); background: linear-gradient(135deg, #12213B, var(--card)); }
.ex-row.done { opacity: .75; } .ex-row.done .num { background: var(--green); color: #fff; }
.num { width: 22px; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; flex-shrink: 0; display: grid; place-items: center; }
.ex-row.done .num { width: 22px; height: 22px; border-radius: 50%; }

/* ---------- Suivi d'exercice ---------- */
.track .hero-img { margin: 0 -2px; }
.targets { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.plan { display: grid; gap: 6px; } .plan div { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; } .plan span { color: var(--muted); }
.set-table { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.st-head, .st-sub, .st-row { display: grid; grid-template-columns: 34px 1fr 1fr 1.15fr 1.15fr 40px; gap: 6px; align-items: center; text-align: center; }
.st-head .grp { grid-column: span 2; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.st-head .grp:nth-child(3) { color: #7DB0FF; border-color: rgba(28, 123, 255, .5); }
.st-sub { font-size: 11px; color: var(--muted); }
.st-row { padding: 2px 0; border-radius: 10px; transition: background .2s; } .st-row.done { background: var(--green-soft); }
.sn { font-weight: 700; color: var(--muted); font-size: 14px; }
.pl { background: #0E1522; border-radius: 9px; padding: 11px 0; font-weight: 600; font-size: 15px; color: var(--muted); }
.in-w, .in-r { width: 100%; min-width: 0; text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 0; font-weight: 700; font-size: 15px; outline: 0; }
.in-w:focus, .in-r:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.in-w::placeholder, .in-r::placeholder { color: #4A5568; font-weight: 600; }
.in-w:disabled, .in-r:disabled { opacity: .4; }
.chk { width: 36px; height: 36px; justify-self: center; border-radius: 10px; border: 1.5px solid #2D3A50; display: grid; place-items: center; color: transparent; transition: .15s; }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; } .chk:disabled { opacity: .35; }
.row-actions { display: flex; justify-content: space-between; align-items: center; }
.last-time { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-tiles div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; } .mini-tiles small { color: var(--muted); font-size: 12px; display: block; } .mini-tiles b { font-size: 20px; display: block; margin: 2px 0; } .mini-tiles span { font-size: 12px; color: var(--faint); }
.hist { display: flex; flex-direction: column; gap: 8px; }
.hist li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; } .hist li b { font-size: 13.5px; } .hist li span { font-size: 13px; color: var(--muted); }
.w-hist li { padding: 0; } .w-hist li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; }
.w-hist li button b { flex: 1; font-weight: 600; } .w-hist li button span { font-weight: 700; color: var(--text); font-size: 15px; } .w-hist li button em { font-style: normal; font-size: 13px; width: 52px; text-align: right; } .w-hist li button .ic { color: var(--faint); }

/* ---------- Minuteur de repos ---------- */
.rest-wrap { position: absolute; inset: 0; z-index: 60; background: var(--bg); opacity: 0; transition: opacity .2s; } .rest-wrap.open { opacity: 1; }
.rest { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 20px 24px; overflow-y: auto; background: radial-gradient(90% 50% at 50% 30%, #0F2038, var(--bg)); }
.rest-top { width: 100%; display: flex; justify-content: space-between; } .rest h2 { font-size: 24px; font-weight: 700; margin-top: 4px; }
.ring { position: relative; width: 250px; height: 250px; margin: 6px 0; } .ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: #16202F; stroke-width: 10; } .ring-fg { fill: none; stroke: var(--blue); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 8px rgba(28, 123, 255, .6)); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.ring-in b { font-size: 54px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; }
.rest-adj { display: flex; gap: 10px; }
.rest-next { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; } .rest-next small { font-weight: 700; font-size: 14px; }
.next-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; } .next-card b { display: block; } .next-card span { font-size: 13px; color: var(--muted); }
.rest > .btn { margin-top: auto; }

/* ---------- Récapitulatif ---------- */
.recap-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 6px; }
.recap-hero h1 { font-size: 26px; font-weight: 800; } .recap-hero p { color: var(--muted); }
.recap-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--green); display: grid; place-items: center; box-shadow: 0 0 0 10px var(--green-soft), 0 10px 30px rgba(34, 197, 94, .35); margin-bottom: 10px; }
.tiles4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tiles4 div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; } .tiles4 small { display: block; color: var(--muted); font-size: 11.5px; } .tiles4 b { font-size: 15px; display: block; margin-top: 3px; } .tiles4 em { font-style: normal; color: var(--faint); font-size: 12px; }
.detail-card { display: flex; flex-direction: column; gap: 8px; } .sets { display: flex; flex-wrap: wrap; gap: 6px; } .sets span { background: var(--card-2); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; color: var(--muted); } .sets .skipped { opacity: .45; text-decoration: line-through; } .sets small { color: var(--faint); }

/* ---------- Éditeur de séance ---------- */
.days-pick { display: flex; gap: 8px; } .day-btn { flex: 1; height: 42px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); font-weight: 700; color: var(--muted); } .day-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ed-ex { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.ed-ex-head { display: flex; align-items: center; gap: 10px; } .ed-ex-head > div:nth-child(2) { flex: 1; min-width: 0; } .ed-ex-head b { display: block; font-size: 15px; } .ed-ex-head small { color: var(--muted); }
.ed-actions { display: flex; } .ed-actions button { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; } .ed-actions button:disabled { opacity: .25; } .ed-actions .danger { color: #FF7A7A; }
.ed-sets { display: flex; flex-direction: column; gap: 6px; }
.ed-set { display: grid; grid-template-columns: 38px 1fr 1fr 32px; gap: 8px; align-items: center; text-align: center; } .ed-set.head { font-size: 11px; color: var(--faint); } .ed-set > span { color: var(--muted); font-weight: 700; }
.mini { display: flex; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; } .mini input { width: 100%; min-width: 0; background: transparent; border: 0; outline: 0; padding: 10px 0; text-align: center; font-weight: 700; } .mini em { font-style: normal; font-size: 11px; color: var(--faint); } .mini:focus-within { border-color: var(--blue); }
.ed-set > button { color: var(--faint); display: grid; place-items: center; height: 32px; } .ed-set > button:disabled { opacity: .2; }
.ed-ex-foot { display: flex; justify-content: space-between; align-items: center; }
.rest-sel { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); } .rest-sel select { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.photo-pick { display: flex; gap: 14px; align-items: center; } .photo-pick > div:first-child { flex: 1; min-width: 0; } .photo-pick.center { flex-direction: column; } .photo-pick.center > div:first-child { flex: none; }

/* ---------- Graphiques & stats ---------- */
.chart-card { display: flex; flex-direction: column; gap: 10px; }
.chart { position: relative; width: 100%; user-select: none; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #1A2333; stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { fill: var(--faint); font-size: 10px; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--blue); } .chart .guide { stroke: #3A4A66; stroke-dasharray: 3 3; } .chart .sel { fill: var(--bg); stroke: var(--blue); stroke-width: 2.5; }
.chart .goal { stroke: var(--orange); stroke-dasharray: 5 4; stroke-width: 1.4; } .chart .goal-t { fill: var(--orange); font-size: 10px; font-weight: 600; }
.chart .bar { opacity: .45; transition: opacity .15s; } .chart .bar.last { opacity: 1; }
.chart .bar-g { cursor: pointer; }
.chart .tip { position: absolute; transform: translate(-50%, -130%); background: #1B2740; border: 1px solid #2D3E5E; border-radius: 10px; padding: 6px 10px; white-space: nowrap; pointer-events: none; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.chart .tip b { display: block; font-size: 14px; } .chart .tip span { font-size: 11px; color: var(--muted); }
.chart-empty { text-align: center; padding: 50px 0; color: var(--faint); }
.delta { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; }
.tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile-stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.tile-stat small { color: var(--muted); font-size: 12.5px; } .tile-stat b { font-size: 26px; font-weight: 700; letter-spacing: -.01em; } .tile-stat span, .tile-stat a { font-size: 12.5px; font-weight: 600; }
.best { display: flex; align-items: center; justify-content: space-between; } .best small { color: var(--muted); font-size: 12.5px; display: block; } .best b { font-size: 20px; display: block; margin: 2px 0; } .best span.up { font-size: 13px; font-weight: 600; }
.medal { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle, #5A4410, #2B210A); color: #FFC94D; display: grid; place-items: center; border: 2px solid #8A6A1A; }
.m-card { display: flex; flex-direction: column; } .m-row { display: grid; grid-template-columns: 1fr auto 70px; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); } .m-row:last-child { border: 0; } .m-row span { color: var(--muted); } .m-row em { font-style: normal; text-align: right; font-size: 13px; font-weight: 600; }
.goal-prog { display: flex; flex-direction: column; gap: 10px; }
.st-badge { font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; } .st-badge.ok { background: var(--green-soft); color: var(--green); } .st-badge.due { background: var(--orange-soft); color: var(--orange); } .st-badge.late { background: rgba(239, 68, 68, .14); color: #FF6B6B; }

/* ---------- Traitement ---------- */
.drug { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #261A4A, #151029); border-color: rgba(139, 92, 246, .35); }
.drug > div { flex: 1; min-width: 0; } .drug b { font-size: 19px; display: block; } .drug span:not(.drug-ic) { color: #B8A6E6; font-size: 13px; }
.drug-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--purple); display: grid; place-items: center; flex-shrink: 0; }
.week-card { display: flex; flex-direction: column; gap: 12px; } .week-card b { font-size: 16px; display: block; } .week-card .between span:not(.st-badge) { font-size: 13px; color: var(--muted); }
.next-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); } .next-line b { display: inline; font-size: inherit; color: var(--text); }
.inj-list { gap: 8px; } .inj-row { padding: 12px 14px; } .inj-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.inj-row > b { color: var(--text); flex: none; }

/* ---------- Calendrier ---------- */
.cal-nav { display: flex; align-items: center; gap: 4px; } .cal-nav > b { flex: 1; text-align: center; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { text-align: center; font-size: 11px; color: var(--faint); padding: 4px 0; }
.cell { aspect-ratio: 1 / 1.08; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 12px; color: var(--text); }
.cell b { font-size: 14px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cell.dim { opacity: .3; } .cell.today b { background: var(--blue); color: #fff; font-weight: 700; } .cell.sel { background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--blue); }
.dots { display: flex; gap: 3px; min-height: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); justify-content: center; } .legend span { display: inline-flex; align-items: center; gap: 5px; }
.week-list { display: flex; flex-direction: column; gap: 6px; }
.wl-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; } .wl-row.sel { border-color: var(--blue); } .wl-row.today .wl-d b { background: var(--blue); }
.wl-d { display: flex; flex-direction: column; align-items: center; width: 34px; } .wl-d small { font-size: 11px; color: var(--muted); } .wl-d b { font-size: 15px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.wl-items { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; } .wl-items em { color: var(--faint); font-style: normal; }
.pillx { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: #7DB0FF; } .pillx.purple { background: var(--purple-soft); color: #B79CFF; } .pillx.orange { background: var(--orange-soft); color: var(--orange); } .pillx.ghost { background: transparent; border: 1px dashed #34507E; } .pillx.ghost.purple { border-color: #5B4A8F; }
.ev { padding: 12px 14px; } .ev-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex-shrink: 0; } .ev-dot.purple { background: var(--purple); } .ev-dot.orange { background: var(--orange); } .ev-dot.hollow { background: transparent; border: 2px solid var(--blue); } .ev-dot.purple.hollow { border-color: var(--purple); }
.fab { position: sticky; bottom: 4px; align-self: flex-end; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; box-shadow: 0 10px 26px rgba(28, 123, 255, .5); margin-top: auto; z-index: 5; }

/* ---------- Profil ---------- */
.me { display: flex; align-items: center; gap: 14px; } .me b { font-size: 20px; display: block; } .me span { color: var(--muted); font-size: 13.5px; }
.pref-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.prefs .row-link { padding: 11px 14px; }

/* ---------- Feuilles modales ---------- */
#overlay { position: absolute; inset: 0; pointer-events: none; z-index: 50; }
#overlay > * { pointer-events: auto; }
.sheet-wrap { position: absolute; inset: 0; z-index: 55; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; display: flex; flex-direction: column; background: #101722; border-top: 1px solid #243046; border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
.sheet.full { height: 92%; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; } .sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: #2B3750; margin: 8px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 4px 20px; flex-shrink: 0; } .sheet-head h3 { font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: none; } .sheet-body::-webkit-scrollbar { display: none; }
.sheet-body .list { gap: 8px; }

/* ---------- Toasts ---------- */
#toasts { position: absolute; left: 0; right: 0; top: 14px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 10px; background: #1B2740; border: 1px solid #2D3E5E; border-radius: 14px; padding: 11px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(-10px); transition: .25s; max-width: 100%; }
.toast.show { opacity: 1; transform: none; } .toast.success { border-color: rgba(34, 197, 94, .5); } .toast.success .ic { color: var(--green); } .toast.error { border-color: rgba(239, 68, 68, .5); } .toast.error .ic { color: #FF6B6B; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Ajustements */
.track .thumb.hero { height: 118px; }
.hd.no-back { padding-left: 4px; }
#tabbody { display: flex; flex-direction: column; gap: 14px; }
.delta { display: block; }
.chart-card .between small.up { display: block; font-weight: 600; margin-top: 2px; }

/* Écran tactile (téléphone / tablette, même en « version ordinateur ») : plein écran, sans cadre */
@media (pointer: coarse) {
  #app { max-width: none; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
}
.welcome > .welcome-bg { position: absolute; inset: 0; z-index: 0; }
.welcome-top, .welcome-points { text-shadow: 0 2px 14px rgba(0, 0, 0, .75); }

.logo-full { width: min(86%, 360px); height: auto; filter: drop-shadow(0 8px 30px rgba(28, 123, 255, .35)); }
.welcome { padding-top: calc(env(safe-area-inset-top) + 3vh); }
.welcome-top { margin-top: 0; }
.welcome > .welcome-bg { background:
  linear-gradient(180deg, rgba(7, 10, 16, .78) 0%, rgba(7, 10, 16, .55) 22%, rgba(7, 10, 16, .28) 36%, rgba(7, 10, 16, .78) 64%, #070A10 90%),
  url('../assets/bg/welcome.webp') center 12% / cover no-repeat, #070A10; }

/* Fiches d'exercice (images complètes) */
.hero-img { position: relative; display: block; width: 100%; padding: 0; text-align: left; }
button.hero-img { cursor: zoom-in; }
.thumb img { object-position: center 30%; }
.thumb.hero img { object-position: center 32%; }
.thumb.has-img { background: #fff; }
.zoom-chip { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 5px 9px; border-radius: 999px; background: rgba(7, 10, 16, .72); color: #fff; backdrop-filter: blur(4px); pointer-events: none; }
.fiche { position: relative; display: block; width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; cursor: zoom-in; padding: 0; }
.fiche img { display: block; width: 100%; height: auto; }
.zoom-wrap { overflow: auto; border-radius: 12px; background: #fff; max-height: 70vh; cursor: zoom-in; -webkit-overflow-scrolling: touch; }
.zoom-wrap img { display: block; width: 100%; max-width: none; height: auto; transition: width .2s; }
.zoom-wrap.big { cursor: zoom-out; } .zoom-wrap.big img { width: 270%; }
.m-cardio { background: linear-gradient(145deg, #124B5E, #0A2230); color: #6EE0F2; }

/* ---------- Cardio ---------- */
.cd-list { display: flex; flex-direction: column; gap: 10px; }
.cd-row { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; transition: background .2s; }
.cd-row.done { background: var(--green-soft); border-color: rgba(34, 197, 94, .35); }
.cd-head { display: flex; align-items: center; gap: 10px; }
.cd-head .sn { width: 26px; text-align: center; }
.cd-plan { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.cd-plan small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7DB0FF; }
.cd-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr 1.1fr; gap: 6px; }
.cd-inputs label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cd-inputs small { font-size: 10.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-inputs input { width: 100%; min-width: 0; text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 0; font-weight: 700; font-size: 15px; outline: 0; }
.cd-inputs input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cd-inputs input::placeholder { color: #4A5568; font-weight: 600; }
.cd-inputs input:disabled { opacity: .4; }
.ed-sets.cardio .ed-set { grid-template-columns: 34px 1fr 1fr 1fr 28px; gap: 6px; }
.ed-sets.cardio .mini { padding: 0 6px; } .ed-sets.cardio .mini em { font-size: 10px; }

/* ---------- Assistant d'accueil ---------- */
.onb { display: flex; flex-direction: column; gap: 14px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; }
.onb-dots { display: flex; gap: 6px; } .onb-dots i { width: 28px; height: 5px; border-radius: 4px; background: #222D40; transition: background .2s; } .onb-dots i.on { background: var(--blue); }
.onb section { display: flex; flex-direction: column; gap: 14px; } .onb section[hidden] { display: none; }
.onb-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.onb-hero h2 { font-size: 22px; font-weight: 800; } .onb-hero p { color: var(--muted); font-size: 14px; max-width: 320px; }
.onb-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 4px; }
.onb-actions { display: flex; gap: 10px; margin-top: 6px; } .onb-actions .btn.primary { flex: 1; }
[hidden] { display: none !important; }

/* ---------- Jeu : XP, niveaux, trophées ---------- */
.skeleton { background: linear-gradient(90deg, #111823, #172030, #111823); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles3 .tile-stat b { font-size: 22px; }
.streak-n { display: inline-flex; align-items: center; gap: 4px; color: #FF9A3C; font-weight: 700; } .streak-n .ic { color: #FF9A3C; }
.shield-line { display: flex; gap: 8px; align-items: flex-start; } .shield-line .ic { margin-top: 2px; flex-shrink: 0; } .shield-line b { color: var(--text); }
.progress.sm { height: 5px; margin-top: 6px; }

.lvl-ring { --p: 0; position: relative; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; align-content: center;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #1B2535 0); }
.lvl-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.lvl-ring > * { position: relative; } .lvl-ring b { font-size: 26px; line-height: 1; } .lvl-ring small { font-size: 8.5px; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.lvl-ring.sm { width: 52px; height: 52px; } .lvl-ring.sm::before { inset: 5px; background: #0F1A2E; } .lvl-ring.sm b { font-size: 19px; }
.lvl-card { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .35); }
.lvl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; } .lvl-title { font-size: 20px; }
.xp-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: linear-gradient(135deg, #12213B, #0E1727); border: 1px solid rgba(28, 123, 255, .3); }
.xp-card > .ic:last-child { color: var(--faint); } .xp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; } .xp-body b { font-size: 15px; } .xp-body small { color: var(--muted); font-size: 12px; }
.lvl-link .goal-ic { width: 44px; height: 44px; }

.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.trophy { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.trophy b { font-size: 13.5px; margin-top: 4px; } .trophy small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.trophy .progress { width: 100%; } .trophy.todo { opacity: .85; } .trophy.got { border-color: color-mix(in srgb, var(--tier, #888) 40%, var(--line)); }
.emblem { --tier: #888; display: inline-grid; place-items: center; border-radius: 50%; color: #1A1204;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--tier) 55%, #fff), var(--tier) 60%, color-mix(in srgb, var(--tier) 70%, #000));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tier) 35%, transparent), inset 0 0 0 2px rgba(255, 255, 255, .25); }
.emblem.locked { background: #19212F; color: #546074; box-shadow: inset 0 0 0 2px #232E41; }
.rules .kv:first-child { border-top: 0; padding-top: 0; }

.xp-gain { display: flex; flex-direction: column; gap: 12px; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .4); }
.xp-gain.none { gap: 4px; background: var(--card); border-color: var(--line); } .xp-gain.none span { color: var(--muted); font-size: 13.5px; }
.xp-total { display: flex; align-items: baseline; justify-content: center; gap: 6px; } .xp-total b { font-size: 46px; font-weight: 800; color: #6FB0FF; letter-spacing: -.02em; } .xp-total span { font-weight: 700; color: var(--muted); }
.xp-rows { display: flex; flex-direction: column; gap: 6px; } .xp-rows div { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); } .xp-rows b { color: var(--green); }
.xp-level { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; } .xp-level .progress i { transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.level-up { color: var(--orange); font-weight: 700; font-size: 14px; }

.celebrate { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 6px; overflow: hidden; }
.celebrate h2 { font-size: 24px; font-weight: 800; }
.cel-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; } .cel-item { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 150px; } .cel-item b { font-size: 15px; margin-top: 6px; } .cel-item small { color: var(--muted); font-size: 12px; }
.confetti { position: absolute; inset: 0; pointer-events: none; } .confetti i { position: absolute; top: -10px; left: calc(var(--i) * 7.2%); width: 8px; height: 14px; border-radius: 2px; background: hsl(calc(var(--i) * 27), 85%, 60%); animation: fall 2.4s ease-in calc(var(--i) * 0.07s) both; }
@keyframes fall { to { transform: translateY(420px) rotate(540deg); opacity: 0; } }

/* ---------- Classement ---------- */
.hero-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .35); }
.hero-card h2 { font-size: 22px; font-weight: 800; } .hero-card p { color: var(--muted); font-size: 14px; }
.bullets { display: flex; flex-direction: column; gap: 10px; } .bullets li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14px; } .bullets .ic { color: var(--green); margin-top: 2px; } .bullets b { color: var(--text); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); line-height: 1.4; } .check-line input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue); flex-shrink: 0; } .check-line a { color: var(--blue); font-weight: 600; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.rank-row > span { flex: 1; } .rank-row b { color: #6FB0FF; font-size: 17px; } .rank-row .ic:first-child { color: var(--orange); } .rank-row > .ic:last-child { color: var(--faint); }
.rank-row.cta { border-style: dashed; border-color: rgba(28, 123, 255, .5); background: var(--blue-soft); } .rank-row em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
#xpslot { display: flex; flex-direction: column; gap: 8px; } #xpslot:empty { display: none; }

.pawn { --h: 210; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 65% 48%), hsl(var(--h) 65% 30%)); border: 2px solid rgba(255, 255, 255, .12); } .pawn.lg { width: 46px; height: 46px; font-size: 19px; }
.me-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .35); }
.me-rank { text-align: center; min-width: 64px; } .me-rank small { display: block; color: var(--muted); font-size: 11px; } .me-rank b { font-size: 32px; font-weight: 800; color: #6FB0FF; letter-spacing: -.02em; }
.me-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; } .me-info b { display: block; } .me-info small { color: var(--muted); font-size: 12.5px; } .me-card .reset { width: 100%; }
.lb-list { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.lb-row > div { flex: 1; min-width: 0; } .lb-row > div b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lb-row > div small { color: var(--muted); font-size: 12px; } .lb-row em { font-style: normal; font-size: 10.5px; background: var(--blue); color: #fff; border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.lb-row .xp { text-align: right; font-size: 17px; } .lb-row .xp small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }
.lb-row.me { border-color: var(--blue); background: linear-gradient(135deg, #12213B, var(--card)); }
.rk { width: 26px; text-align: center; font-weight: 800; color: var(--muted); font-size: 15px; } .rk.r1 { color: #F5B82E; font-size: 18px; } .rk.r2 { color: #C9D3E3; font-size: 17px; } .rk.r3 { color: #CD8B4F; font-size: 16px; }
.rp { width: 28px; height: 28px; display: grid; place-items: center; color: var(--faint); border-radius: 8px; flex-shrink: 0; } button.rp:hover { background: var(--card-2); color: var(--text); }
.lb-gap { text-align: center; color: var(--faint); letter-spacing: .3em; line-height: .6; padding: 2px 0; }

/* ---------- Avatars (emblèmes), ligues, amis ---------- */
.emb { --c1: #1C7BFF; --c2: #0B3C91; --s: 40px; position: relative; display: inline-grid; place-items: center; width: var(--s); height: var(--s); flex-shrink: 0;
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--c1) 38%, transparent)); }
.emb-shape { position: absolute; inset: 0; background: linear-gradient(145deg, var(--c1), var(--c2)); }
.emb-shape::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .45), transparent 55%); }
.sh-circle { border-radius: 50%; }
.sh-hex { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.sh-shield { clip-path: polygon(50% 0, 96% 14%, 96% 58%, 50% 100%, 4% 58%, 4% 14%); }
.sh-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sh-octagon { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.emb-glyph { position: relative; color: #fff; display: grid; place-items: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.emb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.emb.locked { filter: grayscale(1) brightness(.55); } .emb.locked .emb-glyph { color: #aeb8c8; }
.av-slot { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }

.av-hero { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .35); }
.av-hero b { display: block; font-size: 20px; margin: 1px 0 3px; } .av-hero span.muted { font-size: 13px; }
.av-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.av-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-align: center; color: var(--text); }
.av-cell b { font-size: 12.5px; line-height: 1.2; margin-top: 4px; } .av-cell small { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.av-cell.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); } .av-cell.todo small { color: var(--faint); }

.lg-card { --lc: #CD8B4F; display: flex; align-items: center; gap: 14px; border-color: color-mix(in srgb, var(--lc) 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--lc) 16%, #0E1522), var(--card)); }
.lg-card > div:nth-child(2) { flex: 1; min-width: 0; } .lg-card b { display: block; font-size: 22px; font-weight: 800; color: var(--lc); } .lg-card span.muted { font-size: 13px; }
.lg-badge { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #1A1204; flex-shrink: 0;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--lc) 50%, #fff), var(--lc) 60%, color-mix(in srgb, var(--lc) 65%, #000)); box-shadow: 0 6px 18px color-mix(in srgb, var(--lc) 35%, transparent); }
.lg-time { text-align: right; } .lg-time small { display: block; color: var(--muted); font-size: 11px; } .lg-time b { font-size: 15px; color: var(--text); }
.lb-row.z-up { border-left: 3px solid var(--green); } .lb-row.z-down { border-left: 3px solid var(--red); }
.zt { font-style: normal; font-weight: 700; } .zt.up { color: var(--green); } .zt.down { color: #FF6B6B; }

.code-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: linear-gradient(135deg, #12213B, var(--card)); border-color: rgba(28, 123, 255, .35); }
.code-card .code { font-size: 34px; font-weight: 800; letter-spacing: .18em; color: #6FB0FF; } .code-card .row-actions { gap: 10px; margin-top: 4px; }
.add-friend { display: flex; gap: 8px; } .add-friend input { flex: 1; min-width: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 46px; outline: 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.add-friend input:focus { border-color: var(--blue); } .add-friend input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }
.code-input { width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text); }
.check-line.card { padding: 12px 14px; }

/* ---------- Modération ---------- */
.goal-ic.red { color: #FF7A7A; background: rgba(239, 68, 68, .14); }
.mod-tiles .tile-stat b { font-size: 24px; } .mod-tiles .tile-stat.alert { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .08); } .mod-tiles .tile-stat.alert b { color: #FF7A7A; }
.mod-card { display: flex; flex-direction: column; gap: 10px; }
.mod-head { display: flex; align-items: center; gap: 12px; } .mod-head b { font-size: 16px; } .mod-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mbadge { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); } .mbadge.bad { background: rgba(239, 68, 68, .15); color: #FF8A8A; } .mbadge.warn { background: var(--orange-soft); color: var(--orange); margin-left: 4px; }
.small { font-size: 12px; align-self: center; }
.term { display: inline-flex; align-items: center; gap: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 13px; }
.term button { width: 20px; height: 20px; display: grid; place-items: center; color: var(--faint); border-radius: 50%; } .term button:hover { background: rgba(239, 68, 68, .2); color: #FF8A8A; }
.plain-input { width: 100%; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 46px; outline: 0; color: var(--text); } .plain-input:focus { border-color: var(--blue); }
select.plain-input { appearance: none; padding-right: 10px; } select.plain-input option { background: #151D2B; }

/* Illustration personnalisée : elle remplace entièrement l'emblème (forme + pictogramme) */
.emb.has-img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.emb.has-img .emb-shape { display: none; }
.emb.has-img .emb-glyph { display: none; }
.emb.has-img .emb-img { border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .14); background: #101826; }
.emb.has-img.locked { filter: grayscale(1) brightness(.5); }
.emb.has-img.locked .emb-glyph { display: grid; position: absolute; inset: 0; place-items: center; color: #fff; background: rgba(8, 12, 20, .45); border-radius: 50%; }
.emb.has-img.locked { filter: none; }
.emb.has-img.locked .emb-img { filter: grayscale(1) brightness(.4); }
.emb.has-img.locked .emb-glyph { color: #fff; background: transparent; }

/* ---------- Premium : essai, comparatif, offres ---------- */
.prem-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-top: 8px; }
.prem-row > .ic:first-child { color: #A78BFA; } .prem-row > .ic:last-child { color: var(--faint); }
.prem-row > div { flex: 1; min-width: 0; } .prem-row b { display: block; font-size: 14px; font-weight: 600; } .prem-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.prem-row .progress.sm { margin-top: 7px; }
.prem-row.soon { border-color: rgba(245, 158, 11, .5); background: var(--orange-soft); } .prem-row.soon > .ic:first-child { color: var(--orange); }
.prem-row.free { border-style: dashed; border-color: rgba(139, 92, 246, .5); background: var(--purple-soft); }
.prem-hero { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #1A1535, #0F1424); border-color: rgba(139, 92, 246, .35); }
.prem-hero > div { flex: 1; min-width: 0; } .prem-hero small { display: block; color: var(--muted); font-size: 12px; } .prem-hero b { display: block; font-size: 19px; margin: 2px 0; }
.prem-hero span:not(.prem-ic) { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.prem-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--purple-soft); color: #A78BFA; flex-shrink: 0; }
.prem-hero.warn { border-color: rgba(245, 158, 11, .5); } .prem-hero.warn .prem-ic { background: var(--orange-soft); color: var(--orange); }
.prem-hero.ok { border-color: rgba(34, 197, 94, .45); } .prem-hero.ok .prem-ic { background: var(--green-soft); color: var(--green); }
.prem-hero.free { background: var(--card); border-color: var(--line); } .prem-hero.free .prem-ic { background: var(--card-2); color: var(--muted); }
.cmp { padding: 6px 14px; }
.cmp-h, .cmp-r { display: grid; grid-template-columns: 1fr 76px 88px; gap: 8px; align-items: center; padding: 11px 0; }
.cmp-r { border-top: 1px solid var(--line); font-size: 13.5px; }
.cmp-h b { font-size: 12px; color: var(--muted); text-align: center; letter-spacing: .04em; text-transform: uppercase; } .cmp-h b.pr { color: #A78BFA; }
.cmp-r > span:first-child { color: var(--text); line-height: 1.35; } .cmp-r > span:first-child u { text-decoration: none; font-size: 10.5px; color: var(--orange); background: var(--orange-soft); padding: 1px 6px; border-radius: 99px; margin-left: 4px; white-space: nowrap; }
.cmp-r i, .cmp-r em, .cmp-r .pr { text-align: center; display: grid; place-items: center; font-style: normal; } .cmp-r em { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.cmp-r .y { color: var(--green); } .cmp-r .n { color: var(--faint); } .cmp-r .pr em { color: var(--text); font-weight: 600; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); text-align: center; }
.plan b { font-size: 14px; color: var(--muted); } .plan strong { font-size: 24px; } .plan span { font-size: 12.5px; color: var(--muted); } .plan small { font-size: 11.5px; color: var(--green); margin-top: 4px; }
.plan.best { border-color: rgba(139, 92, 246, .6); background: linear-gradient(180deg, #1A1535, var(--card)); }
.plan .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--purple); color: #fff; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.tick-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--muted); }
.tick-list li { display: flex; align-items: center; gap: 8px; } .tick-list .ic { color: var(--green); flex-shrink: 0; }
.tick-list .pr .ic { color: #A78BFA; }

/* ---------- Limites de la version gratuite ---------- */
.lock-note, .fiche-lock { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 14px; background: var(--purple-soft); border: 1px dashed rgba(139, 92, 246, .5); color: var(--text); text-align: left; font-size: 13px; line-height: 1.35; }
.lock-note > .ic:first-child, .fiche-lock > .ic:first-child { color: #A78BFA; flex-shrink: 0; } .lock-note > .ic:last-child, .fiche-lock > .ic:last-child { color: var(--faint); flex-shrink: 0; }
.lock-note > span, .fiche-lock > span { flex: 1; min-width: 0; }
.fiche-lock b { display: block; font-size: 14px; } .fiche-lock small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.fiche-lock { padding: 16px 14px; }
.lock-note { margin: 4px 0 10px; }
