:root {
  --bg: #f7fbf4;
  --surface: #ffffff;
  --surface-2: #eef7e9;
  --line: rgba(20, 60, 30, 0.1);
  --text: #12301d;
  --muted: #5d7364;
  --accent: #2f9e4f;
  --accent-2: #8fd16a;
  --forest: #1d5c35;
  --radius: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 480px at 100% -8%, rgba(143, 209, 106, 0.28), transparent 60%),
    radial-gradient(800px 500px at -10% 105%, rgba(47, 158, 79, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 150px;
  min-height: 100dvh;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 8vw, 2.6rem); font-weight: 800; line-height: 1.02; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 16px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 8px;
}

/* ---------- Transitions de page ---------- */
.view { animation: viewIn 0.55s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
}

/* ---------- Titres & en-têtes ---------- */
.hero { margin: 8px 0 28px; }
.hero h1 span,
.page-head h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { color: var(--muted); font-size: 1rem; line-height: 1.5; margin-top: 12px; }
.lead-sm { line-height: 1.6; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 6px 0 20px;
}

.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 30px 0 12px;
  font-weight: 700;
}

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
  transition: color 0.2s;
}
.back:hover { color: var(--text); }

.link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 14px;
}

/* ---------- Cartes ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(20, 60, 30, 0.12);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 60, 30, 0.22);
}
.card-link { display: block; margin-bottom: 14px; }
.card-link h3 { margin: 4px 0 4px; font-size: 1.25rem; }
.countdown-card h2 { font-size: 1.5rem; margin: 4px 0 6px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; margin: 4px 0 6px; }

.grid { display: grid; gap: 14px; }
.team-card { display: flex; flex-direction: column; gap: 12px; }
.team-card.is-mine { border-color: rgba(47, 158, 79, 0.5); }
.team-link { display: block; }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 12px;
  color: var(--muted);
  line-height: 1.45;
}
.meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); }

.profile-card { display: flex; flex-direction: column; align-items: flex-start; }
.profile-card h2 { margin-bottom: 4px; }

/* ---------- Boutons, champs, pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s var(--ease), box-shadow 0.3s, border-color 0.3s, background 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 10px 30px -10px rgba(47, 158, 79, 0.7);
}
.btn-primary:hover { box-shadow: 0 14px 36px -10px rgba(47, 158, 79, 0.9); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: rgba(20, 60, 30, 0.3); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

.input {
  width: 100%;
  background: rgba(20, 60, 30, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 158, 79, 0.15);
  background: rgba(20, 60, 30, 0.06);
}
.input-lg { font-size: 1.1rem; padding: 16px; text-align: center; letter-spacing: 0.2em; }
textarea.input { resize: vertical; }

.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.field > span { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.fset { border: 0; padding: 0; margin: 4px 0 0; }
.fset legend { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; padding: 0; }

.shake { animation: shake 0.45s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.pill, .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(47, 158, 79, 0.14);
  color: var(--accent);
  white-space: nowrap;
}
.tag {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.tags, .chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { position: relative; cursor: pointer; }
.chip input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  transition: all 0.25s var(--ease);
}
.chip input:checked + span {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.04);
}

.pick {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.pick:hover { border-color: var(--accent); transform: translateY(-2px); }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.seg label { position: relative; }
.seg span {
  display: block;
  text-align: center;
  padding: 11px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.seg input:checked + span { background: var(--accent); color: #fff; }

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Notes sur 5 ---------- */
.rate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rate-row > span { font-weight: 600; }
.rate { display: flex; gap: 6px; }
.rate button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.rate button.on {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: 0 8px 18px -8px var(--accent);
}

.rating-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.rating-label { width: 100px; font-weight: 600; font-size: 0.9rem; }
.rating-val { width: 36px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
.ratings { padding: 8px 18px; }
.bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  transform: scaleX(var(--v));
  animation: grow 1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Membres, avatars ---------- */
.members { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.members li { display: flex; gap: 12px; align-items: center; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; margin-bottom: 12px; }
.tag + .muted { margin-top: 2px; }
.sticky-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Compte à rebours & carte ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 4px; }
.unit {
  background: rgba(20, 60, 30, 0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 6px;
  text-align: center;
}
.num {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.num.tick { animation: tick 0.45s var(--ease); }
@keyframes tick {
  from { transform: translateY(-6px); opacity: 0.2; }
  to   { transform: none; opacity: 1; }
}

.map {
  height: 230px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 16px;
  z-index: 0;
}
.map-pick { height: 260px; margin-top: 8px; }
.leaflet-container { background: #e9f2e4; font-family: inherit; }
.ping-wrap { background: none; border: 0; }
.ping, .ping-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.ping {
  background: var(--accent);
  opacity: 0.5;
  animation: ping 1.8s var(--ease) infinite;
}
.ping-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px #fff, 0 0 18px var(--accent);
}
@keyframes ping {
  from { transform: scale(0.6); opacity: 0.7; }
  to   { transform: scale(3); opacity: 0; }
}

/* ---------- Classements ---------- */
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.rank-row:hover { transform: translateX(4px); border-color: rgba(20, 60, 30, 0.22); }
.rank-row .pos {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.rank-row.top .pos {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
}
.rank-row .pts { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-row .pts small { color: var(--muted); font-weight: 600; font-size: 0.7rem; }
.chips-mini { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.mini {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(47, 158, 79, 0.14);
  color: var(--accent);
}
.mini.off { background: transparent; color: var(--muted); }

.podium { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.podium li { display: flex; gap: 8px; align-items: center; }
.podium li > span { color: var(--accent); font-weight: 800; width: 24px; }
.podium em { margin-left: auto; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px 10px 16px;
}
.result-row .input { width: 130px; text-align: right; padding: 10px 12px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 200px); min-height: 360px; }
.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}
.msg {
  max-width: 82%;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  animation: rise 0.4s var(--ease) both;
}
.msg.mine { align-self: flex-end; background: var(--surface-2); border-radius: 16px 16px 4px 16px; }
.msg.orga {
  border-color: rgba(47, 158, 79, 0.45);
  background: linear-gradient(160deg, rgba(47, 158, 79, 0.16), var(--surface));
}
.msg-meta { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
.msg-meta strong { color: var(--text); font-weight: 700; }
.msg p { line-height: 1.45; word-wrap: break-word; }
.badge {
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.composer { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.composer .input { border-radius: 999px; }
.composer .btn { flex-shrink: 0; }

.empty {
  text-align: center;
  padding: 40px 10px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ---------- Barre de navigation ---------- */
#tabbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 20px 50px -14px rgba(20, 60, 30, 0.35);
  z-index: 10;
  animation: rise 0.6s var(--ease) both;
}
#tabbar[hidden] { display: none; }
#tabbar a {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 2px 8px;
  border-radius: 16px;
  transition: color 0.3s, background 0.3s;
}
#tabbar a.active { color: var(--text); background: rgba(20, 60, 30, 0.06); }
#tabbar .dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin: 0 auto 4px;
  background: transparent;
  transition: background 0.3s, transform 0.3s var(--ease);
}
#tabbar a.active .dot { background: var(--accent); transform: scale(1.3); }

/* ---------- Notification ---------- */
#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -160%);
  background: var(--forest);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 20px 40px -10px rgba(20, 60, 30, 0.45);
  transition: transform 0.5s var(--ease);
  z-index: 20;
  max-width: min(90vw, 420px);
  text-align: center;
}
#toast.show { transform: translate(-50%, 0); }

/* ---------- Barrière d'installation (mobile) ---------- */
html.gated #app,
html.gated #tabbar { display: none !important; }

#install-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(47, 158, 79, 0.18), transparent 60%),
    radial-gradient(700px 450px at 110% 110%, rgba(143, 209, 106, 0.12), transparent 60%),
    var(--bg);
}
.gate-box {
  width: min(100%, 440px);
  animation: viewIn 0.7s var(--ease) both;
}
.gate-box h1 { font-size: clamp(1.8rem, 7vw, 2.2rem); margin-bottom: 4px; }
.gate-box h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  margin-bottom: 18px;
  box-shadow: 0 16px 40px -12px rgba(47, 158, 79, 0.6);
}
.steps {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  line-height: 1.4;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms + 200ms);
}
.steps li:nth-child(2) { --i: 1; }
.steps li:nth-child(3) { --i: 2; }
.step-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
}
#gate-install { margin-top: 22px; }

/* ---------- Accueil : deux tuiles identiques ---------- */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0 8px;
}
.tile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(160deg, #ffffff 0%, #eef7e9 100%);
  border: 1px solid rgba(47, 158, 79, 0.22);
  box-shadow: 0 14px 30px -18px rgba(29, 92, 53, 0.5);
  color: var(--text);
  position: relative;
  overflow: hidden;
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.tile::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 209, 106, 0.45), transparent 70%);
  transition: transform 0.6s var(--ease);
}
.tile:hover { transform: translateY(-5px) rotate(-0.6deg); box-shadow: 0 22px 40px -18px rgba(29, 92, 53, 0.6); }
.tile:hover::after { transform: scale(1.4); }
.tile:active { transform: scale(0.97); }
.tile strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; position: relative; z-index: 1; }
.tile .small { position: relative; z-index: 1; }
.tile-ic {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(47, 158, 79, 0.8);
  transition: transform 0.5s var(--ease);
}
.tile:hover .tile-ic { transform: rotate(-8deg) scale(1.08); }
.tile-ic svg { width: 30px; height: 30px; }

/* ---------- Illustration sportive (accueil) ---------- */
.hero-sport { position: relative; padding-top: 6px; }
.sport-art {
  width: 100%;
  height: 150px;
  margin-bottom: 8px;
  animation: viewIn 0.9s var(--ease) both;
}
.sport-art .run { animation: bob 1.2s ease-in-out infinite; transform-origin: center; }
.sport-art .sun { animation: pulse 3.2s ease-in-out infinite; transform-origin: center; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes pulse { 50% { opacity: 0.55; transform: scale(1.06); } }
.stripe {
  height: 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, var(--accent-2) 14px 28px);
  margin: 18px 0 0;
  opacity: 0.9;
}

/* ---------- Transitions partout ---------- */
a, button, .card, .rank-row, .pick, .chip span, .seg span, .btn, .input {
  transition-property: transform, background, border-color, color, box-shadow, opacity;
  transition-duration: 0.3s;
  transition-timing-function: var(--ease);
}
.pick:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.rank-row:hover { background: var(--surface-2); }
.team-card:hover { border-color: rgba(47, 158, 79, 0.45); }
.card:hover { box-shadow: 0 18px 36px -18px rgba(29, 92, 53, 0.4); }
.members li, .rate-row, .result-row { transition: background 0.3s var(--ease); }
.members li:hover { background: var(--surface-2); border-radius: 14px; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.5s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-24px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(24px); } }

/* ---------- Photo de profil ---------- */
img.avatar { object-fit: cover; padding: 0; border: 2px solid #fff; box-shadow: 0 6px 14px -8px rgba(20, 60, 30, 0.5); }
.photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px dashed rgba(47, 158, 79, 0.45);
  color: var(--muted);
  font-size: 1.6rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; animation: viewIn 0.5s var(--ease) both; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
label.btn { position: relative; }
.photo-change { display: flex; gap: 8px; margin: 2px 0 14px; }

/* ---------- Participation ---------- */
.part { margin-top: 18px; }
.pct {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bar.big { height: 12px; }

/* ---------- Pictogrammes et paysage ---------- */
.activities {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 18px 0 4px;
}
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms + 200ms); }
.act-ic {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--forest);
  border: 1px solid rgba(47, 158, 79, 0.25);
  box-shadow: 0 8px 18px -12px rgba(29, 92, 53, 0.6);
  transition: transform 0.4s var(--ease), background 0.3s, color 0.3s;
}
.act-ic svg { width: 26px; height: 26px; }
.act:hover .act-ic { transform: translateY(-4px) rotate(-6deg); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.act small { font-size: 0.7rem; font-weight: 700; color: var(--muted); }

.scene { margin: 26px -20px -28px; line-height: 0; animation: viewIn 1s var(--ease) both; }
.scene-svg { width: 100%; height: auto; display: block; }

.tab-ic { display: block; width: 22px; height: 22px; margin: 0 auto 3px; transition: transform 0.4s var(--ease); }
.tab-ic svg { width: 22px; height: 22px; }
#tabbar a.active .tab-ic { transform: translateY(-2px) scale(1.12); color: var(--accent); }
#tabbar a { display: flex; flex-direction: column; align-items: center; }

.ep-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; color: var(--accent); }
.ep-ic svg { width: 18px; height: 18px; }

.empty-ic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  animation: rise 0.7s var(--ease) both;
}
.empty-ic svg { width: 34px; height: 34px; }
.chat-empty { padding: 60px 10px; }

.strength { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.strength strong { color: var(--forest); }

/* ---------- Réactions sur les messages ---------- */
.msg-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.msg-wrap.mine { align-items: flex-end; }
.msg { cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.msg:hover { box-shadow: 0 10px 22px -14px rgba(29, 92, 53, 0.5); transform: translateY(-1px); }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin: -6px 8px 0; }
.rx {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 10px -6px rgba(20, 60, 30, 0.4);
  animation: pop 0.4s var(--ease) both;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.rx small { font-size: 0.72rem; font-weight: 700; color: var(--muted); margin-left: 3px; }
.rx.on { border-color: var(--accent); background: var(--surface-2); }
.rx:active { transform: scale(0.9); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.picker {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 30px -12px rgba(20, 60, 30, 0.45);
  animation: viewIn 0.35s var(--ease) both;
}
.picker button {
  font-size: 1.3rem;
  background: none;
  border: 0;
  padding: 4px 5px;
  border-radius: 50%;
  cursor: pointer;
  animation: pop 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform 0.2s var(--ease);
}
.picker button:hover { transform: scale(1.3) translateY(-3px); }

/* ---------- Bandeau graphique, avatars, agenda, équipe ---------- */
.banner {
  border-radius: 24px;
  overflow: hidden;
  margin: 16px 0 4px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f2faec 0%, #ffffff 100%);
  line-height: 0;
  box-shadow: 0 16px 30px -22px rgba(29, 92, 53, 0.5);
}
.banner .scene-svg { width: 100%; height: auto; }
.avatar.sm { width: 34px; height: 34px; font-size: 0.9rem; }
.avatar.md { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.5rem; }
.my-team { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.my-team h2 { margin: 2px 0; }
.ep-link { color: inherit; }
.ep-link .arrow { display: inline-block; color: var(--accent); transition: transform 0.3s var(--ease); }
.ep-link:hover .arrow { transform: translateX(6px); }

.day-title { font-size: 1rem; color: var(--forest); margin: 26px 0 10px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl {
  display: grid;
  grid-template-columns: 52px 16px 1fr;
  gap: 8px;
  align-items: start;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.tl-time { font-weight: 800; font-size: 0.85rem; color: var(--muted); padding-top: 16px; font-variant-numeric: tabular-nums; }
.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--accent);
  margin-top: 18px;
  transition: transform 0.3s var(--ease);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.tl-card:hover { transform: translateX(4px); box-shadow: 0 12px 22px -16px rgba(29, 92, 53, 0.5); }
.tl.past .tl-card { opacity: 0.55; }
.tl.next .tl-dot { background: var(--accent); transform: scale(1.25); }
.tl.next .tl-card { border-color: var(--accent); box-shadow: 0 12px 24px -14px rgba(47, 158, 79, 0.6); }

/* ---------- Modifier et supprimer ses messages ---------- */
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; animation: viewIn 0.3s var(--ease) both; }
.msg-actions button {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}
.msg-actions button:hover { border-color: var(--accent); transform: translateY(-1px); }
.msg-actions button.danger:hover { border-color: #d64545; color: #d64545; }
.msg-edit { display: flex; flex-direction: column; gap: 8px; width: min(100%, 320px); align-self: flex-end; animation: viewIn 0.35s var(--ease) both; }
.msg-edit .input { border-radius: 14px; }
.msg-edit-btns { display: flex; gap: 8px; justify-content: flex-end; }
.edited { font-size: 0.68rem; color: var(--muted); font-style: italic; margin-left: 4px; }

/* ---------- Sélecteur Classement / Épreuves ---------- */
.seg2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  margin: 4px 0 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  animation: viewIn 0.5s var(--ease) both;
}
.seg2 a {
  text-align: center;
  padding: 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.2s var(--ease);
}
.seg2 a:active { transform: scale(0.97); }
.seg2 a.on {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 8px 18px -10px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

#tabbar .tab-sub { display: block; font-size: 0.58rem; font-weight: 600; opacity: 0.75; margin-top: 1px; line-height: 1; }
