/* Suivi Muscu — « plan de forge » : fond carbone et grille de plan technique, bulles de verre, chiffres façon tableau de score.
   Rôles des couleurs : bleu schéma = action et navigation · or = récompense · rouge = menace · couleurs des muscles = données seulement. */

@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(../fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(../fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-700.woff2) format('woff2'); }

:root {
  /* Couleurs */
  --bg: #090B10;              /* nuit carbone */
  --surface: rgba(17, 20, 28, .66);
  --surface-2: rgba(141, 184, 255, .07);
  --line: rgba(141, 184, 255, .12);   /* traits du plan */
  --text: #E8ECF4;            /* craie */
  --muted: #8A93A6;
  --faint: #5B6377;
  --accent: #2F6FEB;          /* bleu schéma (boutons) */
  --accent-hi: #6FA3FF;       /* bleu schéma (traits, texte) */
  --accent-soft: rgba(61, 139, 255, .16);
  --gold: #F5C04A;            /* récompense */
  --red: #FF5A5F;             /* menace */
  --green: #5EE0A0;           /* gain */
  --orange: #FF9A3D;
  --ink: #0A0D14;             /* texte sur fond clair */
  /* Type */
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --ui: 'Barlow', -apple-system, system-ui, sans-serif;
  /* Formes */
  --r-bubble: 24px; --r-inner: 14px;
  --shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 32px rgba(2, 6, 18, .55);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body { font: 500 15px/1.35 var(--ui); -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
input, select { font: inherit; font-size: 16px; color: var(--text); -webkit-user-select: text; user-select: text; }
#app { position: fixed; inset: 0; }

/* ---- Fond : carbone + grille de plan technique (fixe, ne coûte rien en batterie) ---- */
.bg { position: fixed; inset: 0; background:
  radial-gradient(90% 45% at 12% -8%, rgba(61,139,255,.20), transparent 70%),
  linear-gradient(rgba(141,184,255,.075) 1px, transparent 1px) -1px -1px / 120px 120px,
  linear-gradient(90deg, rgba(141,184,255,.075) 1px, transparent 1px) -1px -1px / 120px 120px,
  linear-gradient(rgba(141,184,255,.035) 1px, transparent 1px) -1px -1px / 24px 24px,
  linear-gradient(90deg, rgba(141,184,255,.035) 1px, transparent 1px) -1px -1px / 24px 24px,
  var(--bg); }
.bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(9,11,16,.85) 85%); }

/* ---- Écrans ---- */
.screen { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 108px); scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen > .stack { animation: screenIn .22s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .005em; }

/* Échelle : 12 · 13 · 15 · 17 · 22 · 28 · 40 · 56 */
.h-sub { font-size: 13px; font-weight: 500; color: var(--muted); }
.h-title { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: .95; letter-spacing: -.005em; }
.h-card { font-size: 17px; font-weight: 600; }
.big { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.heavy { font-weight: 600; }
.caps { font-size: 13px; font-weight: 500; color: var(--muted); }
.rise { display: contents; }

/* ---- Bulles de verre ---- */
.glass { position: relative; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-bubble);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: var(--shadow); }
.glass.tap { cursor: pointer; transition: transform .15s ease-out, border-color .15s; }
.glass.tap:active { transform: scale(.985); border-color: rgba(141,184,255,.3); }
.list { padding: 2px 0; }
.list > * + * { border-top: 1px solid var(--line); }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; text-align: left; }
.lrow .ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-hi); }
.lrow .ico svg { width: 18px; height: 18px; }
.lrow .val { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.chev { color: var(--faint); font-size: 18px; }

/* ---- Boutons ---- */
.pill { width: 100%; min-height: 54px; border-radius: 999px; font-family: var(--ui); font-size: 16px; font-weight: 600; color: var(--ink);
  transition: transform .15s ease-out, opacity .2s; padding: 0 20px; }
.pill:active:not(:disabled) { transform: scale(.97); }
.pill.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.pill:disabled { opacity: .5; }
.round { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1; }
.round:active:not(:disabled) { background: rgba(141,184,255,.18); }
.round:disabled { opacity: .4; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink); }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- Barre d'onglets ---- */
.tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 6px); display: flex; gap: 2px; padding: 6px;
  border-radius: 32px; z-index: 20; }
.tabbar button { flex: 1; min-height: 54px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--accent-hi); background: var(--accent-soft); }

/* ---- Semaine ---- */
.days { display: flex; gap: 3px; padding: 6px; }
.days button { position: relative; flex: 1; min-height: 58px; border-radius: 17px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; color: var(--muted); transition: background .2s, color .2s; }
.days button b { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--text); }
.days button span { width: 6px; height: 6px; border-radius: 50%; }
.days button.today b { color: var(--accent-hi); }
.days button.on { background: var(--accent); }
.days button.on b { color: #fff; }
.days .dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }

.levelring { position: relative; width: 52px; height: 52px; }
.levelring svg { width: 52px; height: 52px; }
.levelring div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.levelring small { font-size: 9px; color: var(--muted); }
.levelring b { font-family: var(--display); font-size: 20px; font-weight: 700; }
.rings { width: 96px; height: 96px; flex: 0 0 96px; }

/* Héros du jour */
.hero { padding: 20px; overflow: hidden; }
.hero .muscle { font-family: var(--display); font-size: 64px; font-weight: 700; line-height: .85; letter-spacing: -.01em; }
.hero .plan { position: absolute; right: -18px; top: -18px; width: 170px; height: 170px; color: var(--accent-hi); opacity: .5; pointer-events: none; }
.hero ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.hero li { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero li::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 1px; background: var(--accent-hi); margin: 0 7px 2px 0; vertical-align: middle; }

/* ---- Séance ---- */
.kgval { flex: 1; text-align: center; font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.skipped { opacity: .5; }
.skipped .exname { text-decoration: line-through; }
.progress { height: 6px; border-radius: 3px; background: rgba(141,184,255,.12); overflow: hidden; flex: 1; }
.progress i { display: block; height: 100%; border-radius: 3px; transition: width .5s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.exrow { padding: 10px 12px 10px 16px; }
.exrow.bossex { box-shadow: inset 3px 0 0 var(--red); }
.exinfo { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0; }
.exinfo .exname { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pr-dot { font-size: 11px; font-weight: 600; color: var(--ink); background: var(--gold); padding: 1px 6px; border-radius: 6px; vertical-align: 1px; animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
.pr-dot.boss { background: var(--red); }
.kgctl { display: flex; align-items: center; gap: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.kgctl button { width: 34px; height: 34px; border-radius: 50%; font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--muted); }
.kgctl button.plus { color: var(--accent-hi); }
.kgctl button:active:not(:disabled) { background: rgba(141,184,255,.18); }
.kgctl button:disabled { opacity: .35; }
.kgctl b { min-width: 62px; text-align: center; font-family: var(--display); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kgctl b small { font-family: var(--ui); font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.xs { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; color: var(--faint); display: grid; place-items: center; }
.xs svg { width: 16px; height: 16px; }
.xs.on { background: var(--red); color: var(--ink); }
.exrow.skipped .kgctl { display: none; }
.sticky-cta { position: sticky; bottom: calc(var(--safe-bottom) + 82px); z-index: 5; padding-top: 4px; }

.cond { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cond-dot { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 2px solid; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink); transition: background .3s; }

/* Niveau par muscle */
.musclechip { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); font-size: 14px; text-align: left; }
.musclechip b { white-space: nowrap; font-weight: 600; }
.rankdot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; transform: rotate(45deg); }
.minibar { flex: 1; height: 4px; border-radius: 2px; background: rgba(141,184,255,.12); overflow: hidden; display: block; }
.minibar i { display: block; height: 100%; border-radius: 2px; }
.rankbadge { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 22px; display: grid; place-items: center; font-family: var(--display);
  font-size: 34px; font-weight: 700; color: var(--ink); transform: rotate(-4deg); }

/* ---- Boss ---- */
.boss { flex: 0 0 auto; }
.boss svg { overflow: visible; }
.bossBr { transform-origin: 60px 114px; animation: bossBreathe 3.4s ease-in-out infinite; }
.bossSp { transform-origin: 60px 62px; animation: bossSpin 16s linear infinite; }
.bossGl { animation: bossGlow 2.6s ease-in-out infinite; }
.bossTw { transform-box: fill-box; transform-origin: center; animation: bossTwinkle 2.2s ease-in-out infinite; }
@keyframes bossBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes bossSpin { to { transform: rotate(360deg); } }
@keyframes bossGlow { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes bossTwinkle { 0%,100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

.gate { position: relative; width: 310px; height: 340px; margin: 0 auto; border-radius: 150px 150px 28px 28px;
  background: linear-gradient(#3A3F4B, #1A1D24); display: grid; place-items: center; box-shadow: 0 30px 60px rgba(0,0,0,.6); }
.gate-in { position: relative; width: 290px; height: 320px; border-radius: 145px 145px 22px 22px; overflow: hidden;
  display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, #2A0A0A, #000 65%); transition: background .6s; }
.gate-in.lit { background: radial-gradient(circle at 50% 60%, #6A1616, #000 65%); }
.bars { position: absolute; inset: 0; display: flex; justify-content: center; gap: 22px; transition: transform .95s cubic-bezier(.7,0,.3,1); }
.bars.up { transform: translateY(-340px); }
.bars i { width: 9px; border-radius: 5px; background: linear-gradient(90deg, #2B2F38, #8C95A6, #4A505D); }
.bars .hbar { position: absolute; left: 0; right: 0; height: 12px; background: linear-gradient(#8C95A6, #3A3F4B, #1E2128); }
.eyes { display: flex; gap: 26px; animation: blink 2.4s ease-in-out infinite; }
.eyes i { width: 18px; height: 8px; border-radius: 4px; background: #FF3B3B; box-shadow: 0 0 10px #FF3B3B; }
@keyframes blink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.shake { animation: shake .12s linear infinite; }
.shake-hard { animation: shakeHard .1s linear infinite; }
@keyframes shake { 0% { transform: translate(2px,1px); } 25% { transform: translate(-3px,-2px); } 50% { transform: translate(3px,-1px); } 75% { transform: translate(-2px,2px); } }
@keyframes shakeHard { 0% { transform: translate(7px,3px); } 25% { transform: translate(-8px,-5px); } 50% { transform: translate(6px,-4px); } 75% { transform: translate(-7px,5px); } }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 40; animation: flash .8s ease-out forwards; }
@keyframes flash { from { opacity: var(--o, .7); } to { opacity: 0; } }
.lightning { position: fixed; inset: 0; pointer-events: none; z-index: 41; width: 100%; height: 100%; }
.lightning path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bolt .35s ease-out forwards, fade 1s .5s forwards; }
@keyframes bolt { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 0; } }
.reveal-name { animation: zoomIn .6s cubic-bezier(.3,1.4,.5,1) both; }
.reveal-name b { font-family: var(--display); font-size: 56px; font-weight: 700; line-height: 1; display: block; margin-top: 6px; }
@keyframes zoomIn { from { transform: scale(2.5); opacity: 0; } }
.goldrain { position: fixed; inset: 0; pointer-events: none; z-index: 39; overflow: hidden; }
.goldrain i { position: absolute; top: -20px; border-radius: 2px; animation: fall linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

.bossname { font-family: var(--display); font-size: 48px; font-weight: 700; line-height: .95; }
.vaincu { position: absolute; font-family: var(--display); font-size: 40px; font-weight: 700; padding: 4px 16px; border: 3px solid; border-radius: 12px; transform: rotate(-12deg);
  animation: stamp .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes stamp { from { transform: rotate(-12deg) scale(4); opacity: 0; } }
.hit { filter: brightness(1.8); transform: translateX(14px) rotate(5deg); transition: all .2s; }
.cracks path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: crack .8s ease-out forwards; }
@keyframes crack { to { stroke-dashoffset: 0; } }
.burst { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 6px solid; animation: burst .8s ease-out forwards; }
@keyframes burst { to { transform: scale(3.4); opacity: 0; } }
.shard { position: absolute; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 18px solid; animation: shard .8s ease-out forwards; }
@keyframes shard { to { transform: translate(var(--dx), var(--dy)) rotate(280deg); opacity: 0; } }
.loot-box { animation: dropIn .7s cubic-bezier(.3,1.5,.5,1) both; font-size: 58px; }
@keyframes dropIn { from { transform: translateY(-160px); } }
.loot-gem { font-size: 54px; animation: gemUp .7s .3s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes gemUp { from { transform: translateY(60px) scale(.3); opacity: 0; } }
.rays { position: absolute; width: 130px; height: 130px; border-radius: 50%; animation: spin 9s linear infinite; }

.weekstrip { display: flex; gap: 3px; }
.weekstrip div { flex: 1; min-height: 52px; border-radius: 15px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.weekstrip b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.weekstrip span { font-size: 10px; font-weight: 600; }
.trophies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.trophies div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }

/* ---- Roues ---- */
.wheelwrap { position: relative; width: 260px; height: 272px; margin: 0 auto; }
.wheelwrap .wheel { position: absolute; top: 12px; left: 0; width: 260px; height: 260px; }
.wheelwrap .pointer { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--text); filter: drop-shadow(0 2px 2px #000); z-index: 2; }
.diff { flex: 1; min-height: 54px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; transition: transform .2s, background .2s; }
.diff b { font-size: 13px; font-weight: 600; }
.diff span { font-size: 11px; }
.diff.on { transform: scale(1.06); color: var(--ink); }

/* ---- Tripot ---- */
.games { display: flex; gap: 8px; }
.games button { flex: 1; min-height: 72px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.games button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.games button .ic { font-size: 22px; }
.betchips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.betchips button { min-height: 46px; border-radius: 14px; font-size: 14px; font-weight: 600; border: 2px solid transparent; }
.betchips button.on { border-color: var(--gold); }
.coin { width: 150px; height: 150px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 58px;
  background: radial-gradient(circle at 35% 30%, #FFF1B8, #F5C04A 45%, #8A5A10); border: 6px solid #8A5A10;
  box-shadow: 0 0 30px rgba(245,192,74,.45); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.reels { display: flex; gap: 10px; }
.reel { flex: 1; height: 110px; border-radius: 18px; display: grid; place-items: center; font-size: 46px;
  background: linear-gradient(#141821, #0B0D14); border: 2px solid rgba(245,192,74,.45); }
.reel.spin span { filter: blur(3px); transform: translateY(-6px); }
.reel.stop span { animation: pop .3s cubic-bezier(.3,1.6,.5,1); }
.balance { font-family: var(--display); font-size: 56px; font-weight: 700; line-height: .9; font-variant-numeric: tabular-nums; }

/* ---- Fenêtres ---- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 30px; background: rgba(4,6,12,.7); animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.overlay .glass { width: 100%; max-width: 380px; animation: popIn .45s cubic-bezier(.3,1.4,.5,1); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
.sheet-bg { position: fixed; inset: 0; z-index: 45; background: rgba(4,6,12,.55); display: flex; align-items: flex-end; animation: fadeIn .2s; }
.sheet { position: relative; width: 100%; max-height: 92%; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 22px 18px calc(var(--safe-bottom) + 24px);
  background: rgba(14,17,24,.94); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border-top: 1px solid var(--line);
  animation: up .35s cubic-bezier(.2,.8,.2,1); }
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(141,184,255,.25); margin: -10px auto 14px; }
@keyframes up { from { transform: translateY(100%); } }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); font-size: 14px; z-index: 2; color: var(--muted); }
.full { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg);
  padding: calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 30px); }

/* ---- Formulaires ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select, input.text { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r-inner); border: 1px solid var(--line);
  background: var(--surface-2); outline: none; }
.field input:focus, input.text:focus { border-color: var(--accent-hi); }
select { appearance: none; -webkit-appearance: none; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; padding: 6px 0; border-radius: 12px; background: var(--surface-2); }
.mini small { font-size: 11px; color: var(--muted); font-weight: 500; }
.mini div { display: flex; align-items: center; gap: 4px; }
.mini button { width: 30px; height: 30px; border-radius: 50%; font-family: var(--display); font-size: 20px; font-weight: 600; }
.mini b { min-width: 30px; text-align: center; font-family: var(--display); font-size: 18px; font-weight: 700; }

/* ---- Stats ---- */
.grade { width: 74px; height: 74px; flex: 0 0 74px; border-radius: 22px; display: grid; place-items: center; font-family: var(--display); font-size: 48px; font-weight: 700; color: var(--ink); transform: rotate(-4deg); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.kpis > div { padding: 14px 16px; }
.kpis > div + div { border-left: 1px solid var(--line); }
.bars-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; border-bottom: 1px solid var(--line); }
.bars-chart i { flex: 1; border-radius: 6px 6px 0 0; min-height: 3px; transition: height .6s ease-out; }
.heat { display: flex; gap: 4px; }
.heat div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.heat i { height: 14px; border-radius: 3px; }
.radarlabel { fill: var(--muted); font-family: var(--ui); font-size: 12px; font-weight: 600; }
.radarlabel tspan { fill: var(--text); font-family: var(--display); font-weight: 700; }
.linechart { position: relative; }
.linechart span { position: absolute; right: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lc-hi { top: 0; } .lc-lo { bottom: 0; }
.pr { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.pr b { font-family: var(--display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Récap animé (stories) */
.story { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: radial-gradient(90% 50% at 50% 0%, rgba(61,139,255,.25), transparent 70%), var(--bg);
  padding: calc(var(--safe-top) + 12px) 22px calc(var(--safe-bottom) + 30px); }
.story .bars-top { display: flex; gap: 4px; }
.story .bars-top i { flex: 1; height: 3px; border-radius: 2px; background: rgba(141,184,255,.25); overflow: hidden; }
.story .bars-top i b { display: block; height: 100%; background: var(--text); }
.story .bars-top i.run b { animation: storyfill 4.5s linear forwards; }
@keyframes storyfill { from { width: 0; } to { width: 100%; } }
.story .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; animation: screenIn .5s both; }
.story .huge { font-family: var(--display); font-size: 96px; font-weight: 700; line-height: .9; }

/* Contrôle segmenté */
.seg { display: flex; gap: 3px; padding: 3px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 40px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: background .2s, color .2s; white-space: nowrap; }
.seg button small { font-size: 11px; font-weight: 500; opacity: .8; }
.seg button.on { background: var(--text); color: var(--ink); }

/* Classement */
.player { padding: 12px 16px; }
.player.mine { background: rgba(61,139,255,.07); }
.pos { width: 30px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--muted); }
.pos.top { color: var(--gold); }
.lvl { font-family: var(--display); font-size: 17px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.musclegrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.musclegrid div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.musclegrid div span:last-child { margin-left: auto; }

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