/* =====================================================================
   RunTrack — design system
   ===================================================================== */
:root {
  --bg: #07070a;
  --bg-2: #0d0d13;
  --surface: #14141c;
  --surface-2: #1c1c27;
  --surface-3: #262634;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f6f6f8;
  --muted: #8d8d9e;
  --volt: #d4ff3a;
  --volt-ink: #0b0f00;
  --volt-soft: rgba(212, 255, 58, .14);
  --pink: #ff3d7f;
  --cyan: #3de0ff;
  --violet: #8b5cff;
  --danger: #ff4d5e;
  --danger-soft: rgba(255, 77, 94, .14);
  --ok: #3ddc84;
  --gold: #ffd257;
  --silver: #cfd6e0;
  --bronze: #e09a63;
  --display: "Bricolage Grotesque", ui-rounded, -apple-system, system-ui, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --tabbar-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60% 40% at 0% 0%, rgba(139, 92, 255, .16), transparent 70%),
    radial-gradient(50% 35% at 100% 0%, rgba(212, 255, 58, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 26px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Marque ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 25px; letter-spacing: -0.045em; line-height: 1; }
.brand .wordmark i { font-style: normal; color: var(--volt); }
.brand .logo-mark { width: 1.45em; height: 1.3em; flex-shrink: 0; overflow: visible; }
.brand.big { font-size: 52px; }
.brand.stacked { flex-direction: column; gap: 14px; }
.brand.stacked .logo-mark { width: 2.6em; height: 2.3em; animation: pin-drop .9s var(--ease) both; }
.brand.stacked .wordmark { animation: rise .5s .35s var(--ease) both; }
.hero-bib { width: 132px; height: 117px; margin-bottom: 18px; transform-origin: 50% 0; animation: pin-drop .9s var(--ease) both, sway 5s 1s ease-in-out infinite; }
.hero-bib .logo-mark { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgba(212, 255, 58, .25)); }

/* Carte « dossard » du profil : numéro unique par coureur */
.bib-card {
  position: relative; width: 230px; margin: 6px auto 18px; padding: 22px 18px 0; border-radius: 22px 22px 18px 18px;
  background: var(--volt); color: var(--volt-ink); text-align: center; overflow: hidden;
  transform: rotate(-4deg); transform-origin: 50% 0; box-shadow: 0 24px 50px -18px rgba(212, 255, 58, .45);
  animation: pin-drop .9s var(--ease) both, sway 6s 1s ease-in-out infinite;
}
.bib-card::before, .bib-card::after { content: ''; position: absolute; top: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); }
.bib-card::before { left: 14px; }
.bib-card::after { right: 14px; }
.bib-card .bib-num { font-family: var(--display); font-weight: 800; font-size: 76px; letter-spacing: -0.05em; line-height: .9; }
.bib-card .bib-name { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-card .bib-band { margin: 0 -18px; padding: 9px 0 10px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.bib-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--volt); color: var(--volt-ink); font-family: var(--display); font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 6px; transform: rotate(-3deg); vertical-align: middle; }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 9999; transition: opacity .4s; }
.splash .brand:not(.stacked) { animation: pop .6s var(--ease) both; }
.splash.out { opacity: 0; pointer-events: none; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 700; font-size: 15px;
  background: var(--surface-2); color: var(--text);
  transition: transform .15s var(--ease), opacity .2s, background .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.primary { background: var(--volt); color: var(--volt-ink); box-shadow: 0 8px 24px -8px rgba(212, 255, 58, .55); }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 8px 24px -8px rgba(255, 61, 127, .6); }
.btn.danger { background: var(--danger-soft); color: #ff8a95; }
.btn.glass { background: rgba(255, 255, 255, .12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.small { padding: 9px 14px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.xl { padding: 17px 22px; font-size: 17px; }
.icon-btn {
  border: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-size: 18px; flex-shrink: 0; transition: transform .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.glass { background: rgba(0, 0, 0, .35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }

.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 10px; border-radius: 999px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.on { background: var(--text); color: var(--bg); }
.seg.small button { font-size: 13px; padding: 7px 8px; }
.seg.scroll-x { overflow-x: auto; scrollbar-width: none; }
.seg.scroll-x::-webkit-scrollbar { display: none; }
.seg button { position: relative; }
.seg button.unread::after { content: ''; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 8px 13px; font-size: 14px; font-weight: 600; transition: all .15s;
}
.chip.on { background: var(--volt); color: var(--volt-ink); border-color: var(--volt); }
.chip.ghost { border-style: dashed; color: var(--muted); }
.chip .x { margin-left: 6px; opacity: .6; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); white-space: nowrap; }
.pill.live { background: rgba(61, 220, 132, .16); color: var(--ok); }
.pill.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.pill.soon { background: rgba(255, 210, 87, .16); color: var(--gold); }
.pill.done { background: rgba(255, 255, 255, .1); color: var(--muted); }
.pill.warn { background: var(--danger-soft); color: #ff8a95; }

/* ---------- Champs ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], textarea, select {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--surface); outline: none; font-size: 16px; color: var(--text); transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--volt); }
input[type=date] { min-height: 50px; -webkit-appearance: none; appearance: none; }
textarea { resize: none; font-family: inherit; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 8px; }
.field .field-label { margin-bottom: 0; }
.field-error { color: #ff8a95; font-size: 14px; min-height: 20px; margin: 0; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: block; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; min-width: 0; }
.inline.spread { justify-content: space-between; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 12px; }
.page-head { margin: 6px 0 18px; }
.page-head p { margin: 8px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 34px 18px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); font-size: 15px; line-height: 1.5; }
.empty .big-emoji { font-size: 44px; display: block; margin-bottom: 10px; }
.note { font-size: 13px; color: var(--muted); background: var(--surface); padding: 12px 14px; border-radius: var(--r-md); margin: 10px 0; line-height: 1.45; }

/* Avatars : dégradé calculé à partir de l'identifiant (--h) */
.avatar {
  --h: 80; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 17px; color: #0b0b0f;
  background: linear-gradient(135deg, hsl(var(--h) 95% 70%), hsl(calc(var(--h) + 50) 90% 58%));
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 28px; }
.avatar.xl { width: 96px; height: 96px; font-size: 42px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--volt); }
.stack-avatars { display: flex; }
.stack-avatars .avatar { width: 32px; height: 32px; font-size: 13px; margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.stack-avatars .avatar:first-child { margin-left: 0; }
.stack-avatars .more { background: var(--surface-3); color: var(--text); }

/* Squelettes de chargement */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-lg); }

/* ---------- Connexion ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(30px + var(--safe-t)) 18px calc(28px + var(--safe-b)); max-width: 460px; margin: 0 auto; }
.auth-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 280px; }
.tagline { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.1; margin: 14px 0 0; letter-spacing: -0.02em; }
.tagline em { font-style: normal; color: var(--volt); font-weight: 800; }
.floaters { position: absolute; inset: 0; pointer-events: none; }
.floaters span { position: absolute; font-size: 34px; animation: float 6s ease-in-out infinite; opacity: .85; }
.floaters span:nth-child(1) { top: 6%; right: 8%; }
.floaters span:nth-child(2) { top: 26%; right: 30%; animation-delay: -1s; font-size: 26px; }
.floaters span:nth-child(3) { top: 2%; left: 40%; animation-delay: -2s; font-size: 24px; }
.floaters span:nth-child(4) { bottom: 8%; right: 4%; animation-delay: -3s; }
.floaters span:nth-child(5) { top: 16%; left: 4%; animation-delay: -4s; font-size: 22px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 16px; }
#auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auth-msg { min-height: 20px; margin: 4px 0 0; font-size: 14px; color: var(--gold); text-align: center; }

/* ---------- Structure ---------- */
#main { height: 100%; }
.tab { display: none; height: 100%; }
.tab.active { display: block; animation: fadein .25s var(--ease); }
.tab.scroll {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(14px + var(--safe-t)) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
}
@media (min-width: 640px) { .tab.scroll > * { max-width: 560px; margin-left: auto; margin-right: auto; } }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.streak-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-weight: 800; font-family: var(--display); font-size: 16px; }
.streak-chip.hot { background: linear-gradient(135deg, #ff7a18, var(--pink)); border-color: transparent; color: #fff; }
.setup { min-height: 100%; max-width: 460px; margin: 0 auto; padding: calc(40px + var(--safe-t)) 20px calc(30px + var(--safe-b)); }
.setup .tagline { margin-bottom: 14px; }
.setup-steps { padding-left: 22px; margin: 18px 0; display: flex; flex-direction: column; gap: 12px; line-height: 1.5; }
.setup-steps li::marker { color: var(--volt); font-weight: 800; }
.setup code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- Barre d'onglets flottante ---------- */
#tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 1000;
  height: 64px; display: flex; align-items: center; justify-content: space-around;
  background: rgba(20, 20, 28, .82); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 26px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7);
  max-width: 520px; margin: 0 auto;
}
#tabbar button { position: relative; border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; width: 58px; padding: 6px 0; transition: color .2s; }
#tabbar button svg { width: 24px; height: 24px; fill: currentColor; transition: transform .2s var(--ease); }
#tabbar button.on { color: var(--text); }
#tabbar button.on svg { transform: translateY(-1px) scale(1.08); }
#tabbar button.on::after { content: ''; position: absolute; bottom: -4px; width: 5px; height: 5px; border-radius: 50%; background: var(--volt); }
#tabbar .fab {
  width: 58px; height: 58px; border-radius: 20px; background: var(--volt); color: var(--volt-ink);
  margin-top: -26px; box-shadow: 0 10px 30px -6px rgba(212, 255, 58, .7), 0 0 0 5px var(--bg);
  display: grid; place-items: center;
}
#tabbar .fab svg { width: 30px; height: 30px; }
#tabbar .fab:active { transform: scale(.92); }
.nav-dot { position: absolute; top: 4px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }

/* ---------- Accueil ---------- */
.week-card {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px;
  background: linear-gradient(140deg, #1d1f12 0%, #14141c 60%); border: 1px solid rgba(212, 255, 58, .18);
  display: flex; gap: 18px; align-items: center;
}
.ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .bar { stroke: var(--volt); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); filter: drop-shadow(0 0 8px rgba(212, 255, 58, .5)); }
.ring .inside { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .inside b { font-family: var(--display); font-size: 26px; font-weight: 800; display: block; }
.ring .inside small { font-size: 11px; color: var(--muted); }
.week-card .info h3 { font-size: 20px; margin-bottom: 6px; }
.week-card .info p { margin: 0; color: var(--muted); font-size: 14px; }
.week-card .info .rank-line { color: var(--text); font-weight: 600; margin-top: 8px; }

.cta-card {
  margin-top: 12px; border-radius: var(--r-xl); padding: 18px; display: flex; align-items: center; gap: 14px;
  background: var(--volt); color: var(--volt-ink); border: 0; width: 100%; text-align: left;
  box-shadow: 0 16px 40px -18px rgba(212, 255, 58, .8); transition: transform .15s var(--ease);
}
.cta-card:active { transform: scale(.98); }
.cta-card .cta-emoji { font-size: 34px; animation: wiggle 2.4s ease-in-out infinite; }
.cta-card b { font-family: var(--display); font-size: 19px; display: block; }
.cta-card span { font-size: 13px; opacity: .75; font-weight: 600; }
.cta-card.done { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.cta-card.done span { color: var(--muted); opacity: 1; }

.alert-card {
  margin-top: 12px; border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(255, 61, 127, .22), rgba(139, 92, 255, .18)); border: 1px solid rgba(255, 61, 127, .35);
  width: 100%; text-align: left; color: var(--text);
}
.alert-card .a-emoji { font-size: 30px; animation: spin-slow 6s linear infinite; }
.alert-card b { display: block; font-size: 15px; }
.alert-card span { font-size: 13px; color: #f3c4d3; }

/* ---------- Publication façon BeReal ---------- */
.feed { display: flex; flex-direction: column; gap: 22px; }
.post-card { animation: rise .4s var(--ease) both; }
.post-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.post-top .who b { display: block; font-size: 15px; }
.post-top .who span { font-size: 12.5px; color: var(--muted); }
.shot {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-2);
  user-select: none; -webkit-user-select: none; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .9);
}
.shot .main { width: 100%; height: 100%; object-fit: cover; }
.shot .inset {
  position: absolute; top: 12px; left: 12px; width: 31%; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  border: 2px solid #000; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); padding: 0; background: var(--surface-3);
  transition: transform .2s var(--ease);
}
.shot .inset:active { transform: scale(.94); }
.shot .inset img { width: 100%; height: 100%; object-fit: cover; }
.shot .stats {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
  display: flex; gap: 18px; align-items: flex-end;
}
.shot .stats div { line-height: 1; }
.shot .stats b { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; }
.shot .stats b.hero { font-size: 44px; color: var(--volt); }
.shot .stats small { display: block; font-size: 11px; color: rgba(255, 255, 255, .7); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.shot .badge-tl { position: absolute; top: 12px; right: 12px; }
.shot .contested { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; pointer-events: none; }
.shot .contested span { background: var(--danger); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; transform: rotate(-6deg); }
.shot .noimg { width: 100%; height: 100%; display: grid; place-items: center; font-size: 60px; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); }
.burst { position: absolute; left: 50%; top: 45%; font-size: 90px; transform: translate(-50%, -50%) scale(0); pointer-events: none; }
.burst.go { animation: burst .8s var(--ease) forwards; }
.post-caption { margin: 10px 4px 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.post-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.react {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 10px; font-size: 15px;
  display: inline-flex; gap: 5px; align-items: center; font-weight: 700; transition: transform .15s var(--ease);
}
.react small { font-size: 13px; color: var(--muted); }
.react.mine { background: var(--volt-soft); border-color: rgba(212, 255, 58, .5); }
.react.mine small { color: var(--volt); }
.react:active { transform: scale(.9); }
.react.add { color: var(--muted); font-size: 14px; }
.post-actions .spacer { flex: 1; }
.emoji-bar {
  display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; padding: 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-2); animation: rise .2s var(--ease);
}
.emoji-bar button { border: 0; background: none; font-size: 26px; width: 42px; height: 42px; border-radius: 50%; transition: transform .15s var(--ease); }
.emoji-bar button:active { transform: scale(1.3); }
.emoji-bar button.on { background: var(--volt-soft); }
.load-more { margin: 4px auto 0; }

/* ---------- Classements ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin: 22px 0 16px; }
.pod { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; animation: rise .5s var(--ease) both; }
.pod .name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .val { font-family: var(--display); font-weight: 800; font-size: 16px; }
.pod .block { width: 100%; border-radius: 16px 16px 8px 8px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 28px; color: rgba(0, 0, 0, .55); }
.pod.p1 .block { height: 110px; background: linear-gradient(180deg, var(--gold), #c99a1e); }
.pod.p2 .block { height: 80px; background: linear-gradient(180deg, var(--silver), #8f99a8); animation-delay: .1s; }
.pod.p3 .block { height: 62px; background: linear-gradient(180deg, var(--bronze), #a2602f); }
.pod.p1 { animation-delay: .15s; }
.pod.p1 .avatar { box-shadow: 0 0 0 3px var(--gold); }
.pod .crown { font-size: 22px; margin-bottom: -4px; animation: float 3s ease-in-out infinite; }
.pod.me .name { color: var(--volt); }
.board { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); padding: 11px 14px; border-radius: var(--r-md); animation: rise .35s var(--ease) both; }
.row.me { border-color: rgba(212, 255, 58, .55); background: linear-gradient(90deg, rgba(212, 255, 58, .1), var(--surface)); }
.row.loser { border-color: rgba(255, 61, 127, .5); background: linear-gradient(90deg, rgba(255, 61, 127, .14), var(--surface)); }
.row .pos { width: 26px; text-align: center; font-family: var(--display); font-weight: 800; color: var(--muted); }
.row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12.5px; color: var(--muted); }
.row .val { font-family: var(--display); font-weight: 800; font-size: 18px; text-align: right; white-space: nowrap; }
.row .tag { font-size: 11px; font-weight: 800; color: var(--pink); }

/* ---------- Groupes ---------- */
.group-card {
  --h: 80; position: relative; overflow: hidden; border: 0; width: 100%; text-align: left; color: #fff;
  border-radius: var(--r-xl); padding: 18px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, hsl(var(--h) 70% 32%), hsl(calc(var(--h) + 60) 70% 20%) 70%, #101016);
  transition: transform .15s var(--ease); animation: rise .4s var(--ease) both;
}
.group-card:active { transform: scale(.98); }
.group-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.group-card .gc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.group-card h3 { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.group-card .gc-goal { font-size: 13px; opacity: .8; margin-top: 4px; }
.group-card .gc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; position: relative; z-index: 1; }
.group-card .stack-avatars .avatar { box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.group-card .gc-alert { font-size: 12px; font-weight: 800; background: var(--pink); padding: 5px 10px; border-radius: 999px; animation: pulse-scale 1.8s infinite; }
.join { margin-top: 8px; }
#join-code { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
#join-code::placeholder { letter-spacing: .14em; }

.g-hero {
  --h: 80; position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 16px 18px 18px; margin: 0 0 14px; color: #fff;
  background: linear-gradient(150deg, hsl(var(--h) 70% 34%), hsl(calc(var(--h) + 60) 70% 20%) 75%, #101016);
}
.g-hero::after { content: ''; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .06); pointer-events: none; }
.g-hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.g-hero h1 { font-size: 30px; overflow-wrap: anywhere; }
.g-dates { margin: 6px 0 0; font-size: 13px; opacity: .8; }
.g-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.45; opacity: .92; white-space: pre-wrap; overflow-wrap: anywhere; }
.g-desc:empty { display: none; }
.g-hero-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 10px; position: relative; z-index: 1; }
.g-hero-actions { display: flex; gap: 8px; }
.g-hero .stack-avatars .avatar { box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
#g-pane { min-height: 160px; }
.g-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.week-hint { font-size: 13px; color: var(--muted); margin: 0 2px 12px; line-height: 1.45; }

.wheel-banner {
  border: 0; width: 100%; text-align: left; color: #fff; margin-bottom: 14px;
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--pink), var(--violet)); box-shadow: 0 16px 36px -16px rgba(255, 61, 127, .7);
}
.wheel-banner .wb-emoji { font-size: 40px; animation: spin-slow 5s linear infinite; }
.wheel-banner b { display: block; font-family: var(--display); font-size: 18px; }
.wheel-banner span { font-size: 13px; opacity: .9; }
.wheel-banner.calm { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.wheel-banner.calm .wb-emoji { animation: none; }
.wheel-banner.calm span { color: var(--muted); opacity: 1; }

.gage-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.gage-chip button { border: 0; background: none; color: var(--muted); padding: 0 0 0 4px; font-size: 14px; }
.gages-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.gages-box .inline { margin: 10px 0; }
.gage-list { margin-bottom: 14px; }
.spin-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.spin-row:first-child { border-top: 0; }
.spin-row .gage { font-weight: 700; }
.spin-row.done .gage { text-decoration: line-through; opacity: .6; }

/* Chat / commentaires */
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.cmt { display: flex; gap: 10px; align-items: flex-start; animation: rise .25s var(--ease) both; }
.cmt .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 9px 13px; max-width: 100%; }
.cmt.mine { flex-direction: row-reverse; }
.cmt.mine .bubble { background: var(--volt-soft); border-color: rgba(212, 255, 58, .3); border-radius: 18px 4px 18px 18px; }
.cmt.mine .cmt-head { text-align: right; }
.cmt-head { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cmt-head b { color: var(--text); margin-right: 6px; }
.cmt-body { line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt.system .bubble { background: linear-gradient(135deg, rgba(255, 61, 127, .2), rgba(139, 92, 255, .2)); border-color: rgba(255, 61, 127, .4); }
.cmt-del { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px; align-self: center; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; min-width: 0; border-radius: 999px; }
.chat-form { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 6px); background: var(--bg); padding: 10px 0; margin-top: 6px; z-index: 5; }

/* Personnes */
.people { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.person { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.person .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .hint { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 6px 2px 2px; font-weight: 700; }
.invite-box { margin-top: 8px; }
.code-pill { font-family: ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: .16em; font-size: 20px; color: var(--volt); }

/* ---------- Fenêtres (bottom sheets) ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-end; animation: fadein .2s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet {
  width: 100%; max-width: 600px; margin: 0 auto; max-height: 94%; overflow-y: auto; background: var(--bg-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 8px 16px calc(24px + var(--safe-b)); border-top: 1px solid var(--line-2);
  animation: sheet-up .35s var(--ease);
}
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }

/* Détail d'une sortie */
.rs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rs-head .who b { display: block; }
.rs-head .who span { font-size: 13px; color: var(--muted); }
.rs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.rs-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; text-align: center; }
.rs-stats b { font-family: var(--display); font-size: 22px; font-weight: 800; display: block; }
.rs-stats small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.proof-full { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); margin: 8px 0 16px; background: var(--surface); }
.proof-full img { width: 100%; max-height: 70vh; object-fit: contain; }
.who-reacted { font-size: 13px; color: var(--muted); margin: 8px 2px 16px; line-height: 1.6; }
.flag-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin: 16px 0; font-size: 13px; }
.flag-box.bad { border-color: rgba(255, 77, 94, .5); background: var(--danger-soft); }
.rs-section { margin: 20px 0 12px; }

/* ---------- Poster une course (plein écran) ---------- */
.fullsheet { position: fixed; inset: 0; z-index: 2500; background: var(--bg); display: flex; flex-direction: column; animation: sheet-up .35s var(--ease); }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px; }
.steps { display: flex; gap: 6px; flex: 1; max-width: 200px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); transition: background .3s; }
.steps i.on { background: var(--volt); }
.post-body { flex: 1; overflow-y: auto; padding: 10px 18px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.post-body h2 { font-size: 32px; margin: 4px 0 8px; }
.post-body > .step > p { margin: 0 0 18px; line-height: 1.5; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--volt); }
.post-foot { padding: 12px 18px calc(14px + var(--safe-b)); max-width: 560px; width: 100%; margin: 0 auto; }
.step { animation: slide-in .3s var(--ease); }
.drop {
  width: 100%; min-height: 260px; border-radius: var(--r-xl); border: 2px dashed var(--line-2); background: var(--surface);
  display: grid; place-items: center; overflow: hidden; padding: 0; margin-bottom: 14px; position: relative;
}
.drop img { width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.drop.filled { border-style: solid; border-color: rgba(212, 255, 58, .5); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; }
.drop-empty small { color: var(--muted); font-weight: 500; font-size: 13px; }
.drop-icon { font-size: 54px; margin-bottom: 4px; }
.ocr { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; font-size: 14px; }
.ocr.found { border-color: rgba(212, 255, 58, .45); background: var(--volt-soft); }
.ocr .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--volt); animation: spin 1s linear infinite; flex-shrink: 0; }
.ocr-hint { font-size: 13px; padding: 10px 14px; border-radius: var(--r-md); background: var(--volt-soft); border: 1px solid rgba(212, 255, 58, .35); margin-bottom: 18px; }
.selfie-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden; margin-bottom: 14px;
  background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface)); border: 2px dashed var(--line-2);
}
.selfie-frame.filled { border: 2px solid var(--volt); }
.selfie-frame img { width: 100%; height: 100%; object-fit: cover; }
.selfie-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-weight: 600; }
.selfie-empty span { font-size: 80px; animation: run-bob .6s ease-in-out infinite alternate; }
.big-input { display: flex; align-items: baseline; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 10px 18px; transition: border-color .2s; }
.big-input:focus-within { border-color: var(--volt); }
.big-input input { border: 0; background: none; outline: none; padding: 0; width: 100%; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -0.03em; }
.big-input em { font-style: normal; color: var(--muted); font-weight: 700; font-size: 18px; white-space: nowrap; }
.big-input.pace input { width: 2.2ch; text-align: center; flex: none; }
.calc { font-size: 14px; color: var(--muted); margin: -6px 2px 20px; }
.calc b { color: var(--text); }

/* ---------- Roue des gages ---------- */
.wheel-overlay {
  position: fixed; inset: 0; z-index: 3000; overflow-y: auto; padding: calc(60px + var(--safe-t)) 18px calc(30px + var(--safe-b));
  background: radial-gradient(circle at 50% 30%, #2a1340, #07070a 70%); animation: fadein .25s;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.wheel-close { position: absolute; top: calc(12px + var(--safe-t)); right: 14px; }
.wheel-overlay h2 { font-size: 30px; }
.wheel-overlay .w-sub { color: #cdbfe0; margin: 8px 0 22px; max-width: 360px; line-height: 1.45; }
.wheel-wrap { position: relative; width: min(84vw, 360px); aspect-ratio: 1; margin: 0 auto 26px; }
.wheel-svg { width: 100%; height: 100%; transition: transform 5.2s cubic-bezier(.12, .7, .08, 1); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .6)); }
.wheel-svg text { font-family: var(--body); font-weight: 700; fill: #0b0b0f; }
.wheel-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #fff; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); border: 4px solid #fff; display: grid; place-items: center; font-size: 28px; z-index: 2; }
.wheel-result { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--r-xl); padding: 20px; max-width: 380px; width: 100%; animation: pop .5s var(--ease) both; }
.wheel-result .wr-who { font-size: 15px; color: #e6daf5; }
.wheel-result .wr-gage { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 10px 0 16px; line-height: 1.15; color: var(--volt); }
#wheel-spin { min-width: 240px; }

/* ---------- Moi ---------- */
.me-hero { text-align: center; padding: 10px 0 6px; }
.me-hero .avatar { margin: 0 auto 14px; }
.me-hero h1 { font-size: 30px; }
.me-hero p { margin: 6px 0 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.tile b { font-family: var(--display); font-weight: 800; font-size: 28px; display: block; letter-spacing: -0.03em; }
.tile span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile.accent { background: var(--volt); color: var(--volt-ink); border: 0; }
.tile.accent span { color: rgba(0, 0, 0, .6); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.chart .bar { width: 100%; max-width: 30px; border-radius: 8px; background: var(--surface-3); min-height: 4px; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.chart .col.cur .bar { background: var(--volt); box-shadow: 0 0 16px rgba(212, 255, 58, .4); }
.chart .v { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .l { font-size: 10px; color: var(--muted); }
.rec { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; padding-top: 0; }
.rec b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.memories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r-lg); overflow: hidden; }
.memory { position: relative; aspect-ratio: 4 / 5; border: 0; padding: 0; background: var(--surface-2); overflow: hidden; }
.memory img { width: 100%; height: 100%; object-fit: cover; }
.memory span { position: absolute; left: 6px; bottom: 6px; font-family: var(--display); font-weight: 800; font-size: 14px; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.settings .set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.settings .set-row:first-child { border-top: 0; padding-top: 0; }
.goal-stepper { display: flex; align-items: center; gap: 10px; }
.goal-stepper b { min-width: 60px; text-align: center; font-family: var(--display); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 5000; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } }
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pulse-scale { 50% { transform: scale(1.06); } }
@keyframes float { 50% { transform: translateY(-10px) rotate(4deg); } }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 40% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1); opacity: 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes run-bob { to { transform: translateY(-8px); } }
@keyframes pin-drop { 0% { opacity: 0; transform: translateY(-60px) rotate(-18deg); } 60% { opacity: 1; transform: translateY(6px) rotate(3deg); } 80% { transform: translateY(-2px) rotate(-5deg); } 100% { transform: translateY(0) rotate(-4deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(-1deg); } }

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

/* =================== Sommeil =================== */
:root { --night: #6c7bff; --night-soft: rgba(108, 123, 255, .16); }
.plus-title { margin: 0 0 16px; }
.plus-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 8px; }
.plus-card {
  border: 0; border-radius: var(--r-xl); padding: 22px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--volt-ink); transition: transform .15s var(--ease); animation: pop .3s var(--ease) both;
}
.plus-card:active { transform: scale(.95); }
.plus-card span { font-size: 46px; }
.plus-card b { font-family: var(--display); font-size: 20px; }
.plus-card small { font-size: 12px; font-weight: 600; opacity: .7; }
.plus-card.run { background: var(--volt); }
.plus-card.sleep { background: linear-gradient(150deg, #8f9bff, #4b3fd8); color: #fff; animation-delay: .06s; }

.sleep-times { margin-bottom: 12px; }
.time-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 12px 14px; }
.time-card span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.time-card input { border: 0; background: none; padding: 0; min-height: 0; font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--text); outline: none; width: 100%; }
.time-card:focus-within { border-color: var(--night); }
.sleep-total { text-align: center; font-family: var(--display); font-weight: 800; font-size: 22px; margin: 4px 0 20px; color: #b9c0ff; }
.sl-help { margin: -2px 0 10px; line-height: 1.45; }
.drop.small { min-height: 150px; }
.drop.small img { max-height: 300px; }

.sleep-card {
  margin-top: 12px; border-radius: var(--r-xl); padding: 16px 18px; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 1px solid rgba(108, 123, 255, .35); background: linear-gradient(140deg, rgba(108, 123, 255, .22), rgba(20, 20, 28, .9) 70%); color: var(--text);
}
.sleep-card .moon { font-size: 34px; }
.sleep-card b { font-family: var(--display); font-size: 19px; display: block; }
.sleep-card span { font-size: 13px; color: #c3c8ff; }
.sleep-card.todo { border-style: dashed; }
.seg.kind button.on { background: var(--volt); color: var(--volt-ink); }
.seg.kind.night button.on { background: var(--night); color: #fff; }
.row.unranked { opacity: .55; }
.night-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px; width: 100%; text-align: left; color: var(--text); }
.night-row .when { font-size: 12.5px; color: var(--muted); }
.night-row .dur { font-family: var(--display); font-weight: 800; font-size: 18px; color: #b9c0ff; white-space: nowrap; }
.night-row.bad { border-color: rgba(255, 77, 94, .45); }
.tile.night { background: linear-gradient(150deg, #8f9bff, #4b3fd8); border: 0; color: #fff; }
.tile.night span { color: rgba(255, 255, 255, .75); }

/* =================== Profils : photo, bio, galerie =================== */
.avatar.photo { overflow: hidden; padding: 0; background: var(--surface-3); }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-profile] { cursor: pointer; }
.who [data-profile]:hover, .row .name[data-profile]:hover { text-decoration: underline; }

/* Édition */
.pe-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 4px 0 18px; }
.pe-avatar-btn { position: relative; border: 0; background: none; padding: 0; }
.pe-avatar-btn .avatar { width: 116px; height: 116px; font-size: 48px; box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 6px var(--volt); }
.pe-avatar-edit { position: absolute; right: 0; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--volt); font-size: 17px; box-shadow: 0 0 0 3px var(--bg-2); }
.pe-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pe-tile { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 0; padding: 0; }
.pe-tile img { width: 100%; height: 100%; object-fit: cover; }
.pe-tile .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; }
.pe-tile.add { border: 2px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 30px; }
#pe-bio-count { float: right; text-transform: none; letter-spacing: 0; }

/* Profil d'un coureur */
.ps-hero { text-align: center; padding: 4px 0 8px; }
.ps-hero .avatar { width: 112px; height: 112px; font-size: 46px; margin: 0 auto 12px; box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 6px var(--volt); }
.ps-hero h2 { font-size: 28px; }
.ps-hero .bib-chip { margin-left: 6px; }
.ps-bio { margin: 12px auto 0; max-width: 420px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ps-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: var(--r-lg); overflow: hidden; }
.ps-gallery button { aspect-ratio: 3 / 4; border: 0; padding: 0; background: var(--surface-2); overflow: hidden; }
.ps-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.ps-gallery button:active img { transform: scale(1.05); }
.ps-gallery.one { grid-template-columns: 1fr; }
.ps-gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Moi : photo sur le dossard */
.bib-card .bib-photo { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px rgba(0, 0, 0, .85); background: rgba(0, 0, 0, .12); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 38px; }
.bib-card .bib-photo img { width: 100%; height: 100%; object-fit: cover; }
.bib-card.with-photo .bib-num { font-size: 52px; }
.me-bio { margin: 0 auto 6px; max-width: 420px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.me-actions { display: flex; gap: 8px; justify-content: center; margin: 12px 0 4px; }

/* Photo en grand */
.lightbox { position: fixed; inset: 0; z-index: 4000; background: rgba(0, 0, 0, .94); display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 12px calc(16px + var(--safe-b)); animation: fadein .2s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 16px; object-fit: contain; }
#person-sheet { z-index: 2100; }
#profile-sheet { z-index: 2200; }
