/* caroule — app usagers. Style « sticker de nuit » : fond encre, couleurs acides, contours noirs, ombres décalées. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dmsans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --ink: #0C0A18;
  --night: #15122A;
  --sheet: #1B1733;
  --raised: #241F40;
  --line: #4A4470;
  --text: #FFFFFF;
  --soft: #A9A3C9;
  --paper: #FFFFFF;
  --paper-soft: #4A4560;
  --lime: #C6FF3D;
  --pink: #FF4FA3;
  --orange: #FFB020;
  --violet: #9B6BFF;
  --cyan: #3DE0F5;
  --coral: #FF7A45;
  --red: #FF3B5C;
  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --tabbar: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--lime); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--lime); color: var(--ink); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 8px; }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- carte ---------- */
#map { position: fixed; inset: 0; background: var(--night); }
.maplibregl-ctrl-attrib { background: rgba(12, 10, 24, .7) !important; color: var(--soft); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--soft); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(var(--tabbar) + var(--safe-b)); }

/* ---------- haut d'écran ---------- */
.top {
  position: fixed; z-index: 10; left: 16px; right: 16px; top: calc(16px + var(--safe-t));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--lime); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 16px;
  padding: 7px 14px 7px 10px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg);
  font: 800 22px/1 var(--display); letter-spacing: -.5px;
}
.logo svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pts {
  min-height: 40px; display: flex; align-items: center; padding: 0 14px;
  background: var(--raised); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: 3px 3px 0 var(--ink);
  font: 700 14px var(--body); color: var(--lime);
}
.pts { gap: 8px; padding: 0 4px 0 14px; text-decoration: none; }
.pts .mini { width: 32px; height: 32px; border-radius: 11px; background: var(--paper); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.pts .mini svg { width: 26px; height: 26px; }

.locate {
  position: fixed; z-index: 10; right: 16px; top: calc(134px + var(--safe-t)); width: 44px; height: 44px; border-radius: 14px;
  background: var(--raised); color: var(--text); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.locate svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.locate.on { background: var(--lime); color: var(--ink); }

/* mon avatar sur la carte */
.me { display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.me .bubble {
  width: 54px; height: 54px; border-radius: 19px; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg);
  animation: pop .45s cubic-bezier(.3, 1.6, .5, 1);
}
.me .bubble svg { width: 44px; height: 44px; }
.me .pulse { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--lime); border: 2.5px solid var(--ink); box-shadow: 0 0 0 0 rgba(198, 255, 61, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(198, 255, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(198, 255, 61, 0); } }

.avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.av {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 18px;
  background: var(--raised); border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); color: var(--text); font: 700 12px var(--body);
}
.av svg { width: 52px; height: 52px; }
.av[aria-pressed="true"] { background: var(--paper); color: var(--ink); transform: rotate(-3deg); outline: 3px solid var(--lime); outline-offset: 2px; }

.chips {
  position: fixed; z-index: 10; left: 0; right: 0; top: calc(78px + var(--safe-t));
  display: flex; gap: 8px; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 5px;
  border-radius: 20px; border: 2.5px solid var(--ink); background: var(--raised); color: var(--text);
  font: 700 13px var(--body); text-decoration: none; box-shadow: 2px 2px 0 var(--ink);
}
.chip.hot { background: var(--paper); color: var(--ink); }
.chip.dim { opacity: .75; }

.letter {
  flex: none; width: 28px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--lc); color: var(--ink); font: 800 15px/1 var(--display);
}

/* ---------- marqueurs ---------- */
.tram {
  display: flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; cursor: pointer;
  background: var(--lc); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink); font: 800 11px/1 var(--body); white-space: nowrap;
}
.tram b { width: 18px; height: 18px; border-radius: 6px; background: var(--ink); color: var(--lc); display: flex; align-items: center; justify-content: center; font: 800 11px/1 var(--display); }
.tram.on-time { padding-right: 2px; }
.tram.late { transform: rotate(-4deg); }
/* Vue d'ensemble : les rames à l'heure deviennent des points, celles en retard gardent leur étiquette. */
.compact .tram.on-time { padding: 0; border-radius: 50%; width: 14px; height: 14px; box-shadow: 1px 1px 0 var(--ink); }
.compact .tram.on-time > * { display: none; }

.pin { position: relative; display: flex; cursor: pointer; background: none; border: 0; padding: 0; }
.pin .pin-art {
  width: 52px; height: 52px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 3px solid var(--kc, var(--ink)); box-shadow: 3px 3px 0 var(--ink); transform: rotate(var(--r, -5deg));
}
.pin .pin-art svg { width: 40px; height: 40px; overflow: visible; }
/* Pastille façon notification : nombre de personnes qui signalent la même chose. */
.pin .count {
  position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--red); color: #FFFFFF; border: 2.5px solid var(--ink); font: 800 12px/19px var(--body); text-align: center;
}
.pin.pending .pin-art { border-style: dashed; border-color: var(--ink); opacity: .9; }
.pin.pending::after {
  content: "?"; position: absolute; left: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 10px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); font: 800 12px/16px var(--body); text-align: center;
}
.pin.mine .pin-art { outline: 3px solid var(--lime); outline-offset: 2px; }
.pin.pop .pin-art { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }

.ico { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- bouton signaler ---------- */
.fab {
  position: fixed; z-index: 11; right: 16px; bottom: calc(var(--tabbar) + var(--safe-b) + 150px);
  width: 72px; height: 72px; border-radius: 24px; display: flex; align-items: center; justify-content: center;
  background: var(--lime); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); transform: rotate(4deg);
  transition: transform .15s;
}
.fab:active { transform: rotate(4deg) translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.fab svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }

/* ---------- carte résumé ---------- */
.card {
  position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(var(--tabbar) + var(--safe-b) + 14px);
  background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 24px;
  box-shadow: 4px 4px 0 var(--ink); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.card:empty { display: none; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card h1 { margin: 0; font: 800 19px/1.1 var(--display); letter-spacing: -.3px; }
.card p { margin: 2px 0 0; font-size: 13px; color: var(--paper-soft); }
.square {
  flex: none; width: 38px; height: 38px; border-radius: 12px; border: 2.5px solid var(--ink);
  background: var(--lc, var(--lime)); display: flex; align-items: center; justify-content: center; font: 800 20px/1 var(--display); color: var(--ink);
}
.square svg { width: 22px; height: 22px; }
.go {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 14px; background: var(--ink); color: var(--lime);
  font: 700 14px var(--body); display: flex; align-items: center; text-decoration: none; border: 0;
}
.source { font-size: 11px !important; }
.crowd { display: flex; align-items: center; gap: 8px; }
.crowd > span:first-child { display: flex; }
.crowd i { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--paper); }
.crowd i + i { margin-left: -8px; }

/* ---------- barre d'onglets ---------- */
.tabs {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--safe-b));
  padding: 8px 12px var(--safe-b); background: var(--ink);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center;
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center;
  color: var(--soft); font: 700 12px var(--body); text-decoration: none;
}
.tabs a[aria-current="page"] { color: var(--lime); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- panneau (signaler, ligne, lignes, infos) ---------- */
.panel {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; top: calc(64px + var(--safe-t));
  background: var(--sheet); border-top: 2.5px solid var(--ink); border-radius: 30px 30px 0 0;
  padding: 10px 16px calc(var(--tabbar) + var(--safe-b) + 24px); overflow-y: auto; overscroll-behavior: contain;
  animation: up .28s cubic-bezier(.2, .9, .3, 1);
  outline: none;
}
.panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
body.has-panel .card, body.has-panel .fab, body.has-panel .chips, body.has-panel .locate { display: none; }
.close {
  position: absolute; right: 14px; top: 14px; width: 44px; height: 44px; border-radius: 22px;
  background: var(--raised); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; color: var(--text);
}
.close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.panel h1 { margin: 4px 56px 14px 0; font: 800 30px/1 var(--display); letter-spacing: -.8px; }
.panel h2 { margin: 24px 0 10px; font: 800 20px/1.1 var(--display); }
.panel p { margin: 0 0 10px; }
.muted { color: var(--soft); font-size: 14px; }

.context {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: var(--raised); border: 2px dashed var(--line); border-radius: 16px; padding: 8px 12px 8px 8px;
  font-size: 13px; color: #D9D4F2;
}
.context b { color: var(--text); }
.context .square { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
.linepick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.linepick button {
  width: 48px; height: 48px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--raised); color: var(--text);
  font: 800 20px/1 var(--display); box-shadow: 2px 2px 0 var(--ink);
}
.linepick button[aria-pressed="true"] { background: var(--lc); color: var(--ink); transform: rotate(-4deg); }

.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kind {
  min-height: 104px; border-radius: 22px; background: var(--kc); color: var(--ink);
  border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 12px 14px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 8px;
  transform: rotate(var(--r, 0deg)); transition: transform .12s, box-shadow .12s;
}
.kind:active { transform: translate(3px, 3px) rotate(var(--r, 0deg)); box-shadow: 1px 1px 0 var(--ink); }
.kind:disabled { opacity: .45; cursor: not-allowed; }
.kind svg { width: 30px; height: 30px; }
.kind strong { display: block; font: 800 18px/1.1 var(--display); }
.kind small { font: 500 12px var(--body); }
.danger {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; min-height: 76px; border-radius: 22px;
  background: #2A0E16; color: var(--text); border: 2.5px solid var(--red); padding: 12px 14px; text-align: left;
}
.danger > span:first-child { flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--red); display: flex; align-items: center; justify-content: center; }
.danger svg { width: 28px; height: 28px; }
.danger strong { display: block; font: 800 18px/1.1 var(--display); }
.danger small { color: #FFC2CC; font-size: 12px; }
.sos { grid-column: 1 / -1; background: #2A0E16; border: 2.5px solid var(--red); border-radius: 22px; padding: 14px; }
.sos p { color: #FFC2CC; font-size: 14px; }
.sos .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.btn {
  min-height: 48px; border-radius: 14px; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 15px var(--body); text-decoration: none; padding: 0 14px; box-shadow: 3px 3px 0 var(--ink);
}
.btn.red { background: var(--red); color: var(--ink); }
.btn.white { background: var(--paper); color: var(--ink); }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.full { width: 100%; }
.reward { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--soft); text-align: center; }
.sticker { white-space: nowrap; background: var(--lime); color: var(--ink); font: 800 12px var(--body); padding: 3px 8px; border-radius: 8px; transform: rotate(-3deg); display: inline-block; }

/* fiche ligne */
.hero {
  margin: -10px -16px 16px; padding: 18px 16px; background: var(--lc); color: var(--ink);
  border-bottom: 2.5px solid var(--ink); display: flex; flex-direction: column; gap: 14px;
}
.panel .hero { border-radius: 28px 28px 0 0; margin-top: -27px; padding-top: 22px; }
.hero-id { display: flex; align-items: center; gap: 14px; }
.hero .big {
  flex: none; width: 72px; height: 72px; border-radius: 22px; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); display: flex; align-items: center; justify-content: center; font: 800 44px/1 var(--display); transform: rotate(-4deg);
}
.hero h1 { margin: 0; font: 800 30px/1 var(--display); letter-spacing: -.8px; }
.hero p { margin: 4px 0 0; font-size: 13px; font-weight: 500; }
.meter { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.meter i { height: 12px; border-radius: 4px; background: rgba(255, 255, 255, .5); }
.meter i.on { background: var(--ink); }
.meter-foot { display: flex; justify-content: space-between; gap: 8px; font: 700 12px var(--body); margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--raised); border: 2.5px solid var(--ink); border-radius: 18px; padding: 10px 12px; }
.stat b { display: block; font: 800 26px/1.1 var(--display); }
.stat span { font-size: 12px; color: var(--soft); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.post {
  background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 4px 4px 0 var(--ink);
  padding: 12px; display: flex; align-items: center; gap: 10px;
}
.post:nth-child(even) { transform: rotate(-.6deg); }
.post .square { width: 40px; height: 40px; border-radius: 14px; background: var(--kc); }
.post div { flex: 1; min-width: 0; }
.post strong { display: block; font: 800 16px/1.15 var(--display); }
.post small { font-size: 12px; color: var(--paper-soft); }
.plus { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--lime); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.plus svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.official { background: var(--raised); border: 2.5px solid var(--ink); border-radius: 18px; padding: 12px; }
.official + .official { margin-top: 10px; }
.official .tag { display: inline-block; background: var(--ink); color: var(--lime); font: 800 11px var(--body); padding: 3px 7px; border-radius: 8px; margin-bottom: 6px; }
.official strong { display: block; font-weight: 700; }
.official p { margin: 4px 0 0; font-size: 14px; color: #D9D4F2; }
.empty { color: var(--soft); font-size: 14px; background: var(--raised); border: 2px dashed var(--line); border-radius: 16px; padding: 12px; }

/* liste des lignes */
.lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lines a {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; text-decoration: none;
  background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.lines .square { width: 48px; height: 48px; border-radius: 16px; font-size: 26px; }
.lines div { flex: 1; min-width: 0; }
.lines strong { display: block; font: 800 18px/1.1 var(--display); }
.lines small { display: block; font-size: 13px; color: var(--paper-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mood { flex: none; font: 800 13px var(--body); padding: 5px 10px; border-radius: 10px; border: 2px solid var(--ink); }
.mood.ok { background: var(--lime); }
.mood.degraded { background: var(--orange); }
.mood.down { background: var(--red); }
.mood.off, .mood.nodata { background: #DDD8F0; }

.prose p, .prose li { color: #D9D4F2; font-size: 15px; }
.prose ul { padding-left: 20px; }
.prose b { color: var(--text); }

/* toasts */
.toast {
  position: fixed; z-index: 40; left: 50%; top: calc(20px + var(--safe-t)); transform: translateX(-50%) rotate(-2deg);
  background: var(--lime); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 16px; font: 800 15px var(--body); max-width: calc(100% - 32px); text-align: center; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1);
}
.toast.bad { background: var(--paper); }

@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- grand écran : la maquette téléphone telle quelle, dans une colonne à gauche, la carte prend le reste ---------- */
@media (min-width: 700px) {
  :root { --col: 440px; }
  .top { right: auto; width: calc(var(--col) - 32px); }
  .chips { right: auto; width: var(--col); }
  .card { right: auto; width: calc(var(--col) - 32px); }
  .fab { right: auto; left: calc(var(--col) - 88px); }
  .locate { right: auto; left: calc(var(--col) - 60px); }
  .tabs { right: auto; width: var(--col); border-right: 2.5px solid var(--ink); }
  .panel { right: auto; width: var(--col); border-right: 2.5px solid var(--ink); }
  .toast { left: calc(var(--col) / 2); }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

/* ---------- profil et autres caroulers ---------- */
.avatars { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.field {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 2.5px solid var(--ink);
  background: var(--paper); color: var(--ink); font: 700 17px var(--body); box-shadow: 3px 3px 0 var(--ink);
}
.field::placeholder { color: #8A84A8; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 52px; height: 32px; border-radius: 16px; background: var(--raised); border: 2.5px solid var(--ink); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--soft); border: 2px solid var(--ink); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--lime); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--paper); }
.switch input:focus-visible + .track { outline: 3px solid var(--lime); outline-offset: 3px; }
.switch b { display: block; }
.switch small { display: block; color: var(--soft); font-size: 13px; margin-top: 2px; }

.crew { display: flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.crew .mini {
  width: 34px; height: 34px; border-radius: 12px; background: var(--paper); border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); display: flex; align-items: center; justify-content: center;
}
.crew .mini + .mini { margin-left: -12px; }
.crew .mini:nth-child(2) { transform: rotate(6deg); }
.crew .mini:nth-child(3) { transform: rotate(-6deg); }
.crew .mini svg { width: 28px; height: 28px; }
.crew .more { margin-left: 4px; background: var(--ink); color: var(--lime); font: 800 11px var(--body); padding: 3px 6px; border-radius: 8px; }
.crew-pop .maplibregl-popup-content {
  background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 12px; font: 500 13px var(--body); display: flex; flex-direction: column; gap: 2px;
}
.crew-pop .maplibregl-popup-tip { display: none; }

/* ---------- écran de démarrage ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--night); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; transition: opacity .45s, visibility .45s;
}
.splash.gone { opacity: 0; visibility: hidden; }
.splash-logo {
  display: flex; align-items: center; gap: 12px; background: var(--lime); color: var(--ink); border: 3px solid var(--ink);
  border-radius: 26px; padding: 14px 24px 14px 18px; box-shadow: 6px 6px 0 var(--ink); font: 800 44px/1 var(--display); letter-spacing: -1px;
  animation: hop 1.1s cubic-bezier(.3, 1.5, .5, 1) infinite alternate;
}
.splash-logo svg { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.splash p { margin: 0; color: var(--soft); font: 700 15px var(--body); }
.dots i { font-style: normal; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes hop { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(3deg) translateY(-14px); } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- célébration des points ---------- */
.boom { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(12, 10, 24, .35); transition: opacity .35s; }
.boom.out { opacity: 0; }
.boom-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 220px; padding: 22px 26px 18px;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 28px; box-shadow: 6px 6px 0 var(--ink);
  animation: boom .6s cubic-bezier(.25, 1.7, .45, 1) both; text-align: center;
}
.boom-pts { font: 800 72px/1 var(--display); color: var(--ink); -webkit-text-stroke: 0; background: var(--lime); border: 3px solid var(--ink); border-radius: 22px; padding: 4px 18px 8px; transform: rotate(-5deg); box-shadow: 4px 4px 0 var(--ink); }
.boom-card strong { margin-top: 10px; font: 800 22px var(--display); }
.boom-card small { color: var(--paper-soft); font-size: 13px; }
.boom-av { width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; animation: wiggle .5s .3s ease-in-out 3; }
.boom-av svg { width: 96px; height: 96px; }
.boom-level { font: 800 26px var(--display); background: var(--lime); border: 3px solid var(--ink); border-radius: 14px; padding: 2px 12px; transform: rotate(-3deg); }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 4px; background: var(--c); border: 2px solid var(--ink); transform: rotate(var(--a)) translateY(0) scale(.2); animation: shoot .8s .1s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes boom { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 100% { transform: scale(1) rotate(-2deg); opacity: 1; } }
@keyframes shoot { to { transform: rotate(var(--a)) translateY(-150px) scale(1) rotate(160deg); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- page perso ---------- */
.me-card { display: flex; align-items: center; gap: 16px; padding: 14px; margin-bottom: 18px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: 4px 4px 0 var(--ink); }
.me-big { flex: none; width: 88px; height: 88px; border-radius: 26px; background: var(--lime); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); }
.me-big svg { width: 70px; height: 70px; }
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.me-info strong { font: 800 22px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lvl { font: 700 13px var(--body); color: var(--paper-soft); }
.xp { height: 12px; border-radius: 6px; background: #E6E1F5; border: 2px solid var(--ink); overflow: hidden; }
.xp i { display: block; height: 100%; background: var(--lime); border-right: 2px solid var(--ink); }
.me-info small { font-size: 12px; color: var(--paper-soft); }
.label { display: block; font: 800 16px var(--display); margin: 6px 0 8px; }
.hint { font-size: 13px; margin: 6px 0 14px; }
.switch { padding: 12px; margin-bottom: 10px; background: var(--raised); border: 2.5px solid var(--ink); border-radius: 18px; }
.levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.levels li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 16px; background: var(--raised); border: 2px solid var(--ink); opacity: .6; }
.levels li.got { opacity: 1; }
.levels .mini { flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--paper); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.levels .mini svg { width: 32px; height: 32px; }
.levels span:nth-child(2) { flex: 1; min-width: 0; }
.levels b { display: block; font: 800 15px var(--display); }
.levels small { color: var(--soft); font-size: 12px; }
.levels i { width: 28px; height: 28px; border-radius: 9px; background: var(--lime); display: flex; align-items: center; justify-content: center; }
.levels i svg { width: 18px; height: 18px; }

/* ---------- départs ---------- */
.deps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.deps li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.deps .dest { font: 700 14px/1.2 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deps .times { display: flex; gap: 6px; }
.deps b, .legend-rt b { min-width: 42px; text-align: center; padding: 3px 6px; border-radius: 9px; font: 800 15px var(--display); background: #EEEAF8; border: 2px solid transparent; }
.deps b small, .legend-rt b small { font: 700 10px var(--body); margin-left: 1px; }
.deps b.rt, .legend-rt b.rt { background: var(--lime); border-color: var(--ink); }
.deps b.th, .legend-rt b.th { font-style: italic; color: var(--paper-soft); }
.deps b.late, .legend-rt b.late { background: var(--orange); }
.deps b:not(:first-child) { opacity: .7; font-size: 13px; min-width: 36px; }
.deps.mini { margin-top: 4px; }
.deps.mini li { padding: 6px 8px; background: #F4F1FC; border-width: 0; }
.station { margin-bottom: 18px; }
.station header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.station h2 { margin: 0; }
.station .muted { display: flex; align-items: center; gap: 4px; margin: 2px 0 0; }
.station .muted svg { width: 16px; height: 16px; stroke: var(--soft); }
.station-lines { display: flex; gap: 6px; margin: -6px 0 14px; }
.legend-rt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; color: var(--soft); font-size: 12px; }
.legend-rt b { color: var(--ink); }
.card .square svg { width: 22px; height: 22px; }
@media (max-width: 420px) { .deps b:nth-child(3) { display: none; } }

/* pictos illustrés des signalements */
.kind-art { width: 54px; height: 54px; border-radius: 18px; background: var(--paper); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.kind-art svg { width: 44px; height: 44px; overflow: visible; }
.danger > span:first-child { background: var(--paper); border: 2.5px solid var(--ink); }
.danger > span:first-child svg { width: 38px; height: 38px; }
.square.art { background: var(--paper) !important; border: 2.5px solid var(--kc); }
.square.art svg { width: 32px; height: 32px; overflow: visible; }
.post .tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font: 800 10px var(--body); vertical-align: 2px; background: #EEEAF8; color: var(--paper-soft); }
.post .tag.me { background: var(--lime); color: var(--ink); }

/* ---------- installation ---------- */
.install {
  position: fixed; z-index: 30; left: 12px; right: 12px; top: calc(132px + var(--safe-t)); display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 12px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 22px;
  box-shadow: 4px 4px 0 var(--ink); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1);
}
.install img { flex: none; border-radius: 12px; border: 2px solid var(--ink); }
.install div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install strong { font: 800 16px var(--display); }
.install small { font-size: 12px; color: var(--paper-soft); }
.install-x { flex: none; width: 36px; height: 36px; border-radius: 18px; border: 0; background: #EEEAF8; display: flex; align-items: center; justify-content: center; }
.install-x svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
body.has-panel .install { display: none; }
.install-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.install-hero img { border-radius: 18px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-4deg); }
.install-hero p { margin: 0; color: #D9D4F2; font-size: 14px; }
.steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: 3px 3px 0 var(--ink); font-size: 15px; }
.step-n { flex: none; width: 32px; height: 32px; border-radius: 11px; background: var(--lime); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 800 17px var(--display); }
.key { display: inline-flex; vertical-align: -5px; width: 26px; height: 26px; border-radius: 8px; background: #EEEAF8; align-items: center; justify-content: center; }
.key svg { width: 18px; height: 18px; stroke: #2F6BFF; }
@media (min-width: 700px) { .install { right: auto; width: calc(var(--col) - 24px); } }

/* pastille de signalements sur les puces de ligne */
.chip { position: relative; }
.chip-badge {
  position: absolute; top: -7px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #FFFFFF; border: 2px solid var(--ink); font: 800 11px/16px var(--body); text-align: center;
}
.chips { padding-top: 9px; }
/* bouton afficher / masquer les autres carouleurs, sous le bouton de position */
.crew-toggle { top: calc(186px + var(--safe-t)); }
.crew-toggle.on { background: var(--violet); color: var(--ink); }
.context.warn { border-color: var(--orange); background: #2E2410; color: #FFE7B8; }

.noscript { position: fixed; inset: 0; z-index: 200; background: var(--night); color: var(--text); padding: 40px 20px; }
.noscript h1 { font: 800 28px var(--display); }

/* lien vers le site vitrine, en tête de l'écran Infos */
.discover {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 14px; text-decoration: none;
  background: var(--lime); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-.6deg);
}
.discover-art { flex: none; width: 56px; height: 56px; border-radius: 18px; background: var(--paper); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.discover-art svg { width: 44px; height: 44px; overflow: visible; }
.discover strong { display: block; font: 800 19px var(--display); }
.discover small { display: block; font-size: 13px; color: #3B4A10; }
.discover-go { margin-left: auto; font: 800 26px var(--display); }

/* plan B : vélos et trottinettes */
.planb ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.planb li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; }
.pb-art { flex: none; width: 42px; height: 42px; border-radius: 13px; background: #F4F1FC; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.pb-art svg { width: 32px; height: 32px; overflow: visible; }
.planb strong { display: block; font: 800 15px var(--display); }
.planb small { font-size: 12px; color: var(--paper-soft); }

/* carte du bas : croix de fermeture (la carte est déjà en position fixe, qui sert de repère à la croix) */
.card-x {
  position: absolute; top: -12px; right: -10px; width: 34px; height: 34px; border-radius: 17px; padding: 0;
  background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); display: flex; align-items: center; justify-content: center;
}
.card-x svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.card-actions { display: flex; gap: 8px; flex: none; }
.go.ghost { background: #F4F1FC; padding: 0 8px; border: 2px solid var(--ink); }
.go.ghost svg { width: 30px; height: 30px; overflow: visible; }
/* bouton Plan B sur la carte, sous « autres carouleurs » */
.planb-btn { top: calc(238px + var(--safe-t)); background: var(--cyan); color: var(--ink); }
body.has-panel .planb-btn { display: none; }
@media (min-width: 700px) { .planb-btn { right: auto; left: calc(var(--col) - 60px); } .crew-toggle { right: auto; left: calc(var(--col) - 60px); } }
/* résumé Plan B */
.pb-teaser {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 14px; padding: 10px 12px; text-decoration: none;
  background: var(--cyan); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: 3px 3px 0 var(--ink);
}
.card .pb-teaser { margin: 8px 0 0; box-shadow: none; border-width: 2px; padding: 6px 10px; }
.pb-label { font: 800 15px var(--display); }
.pb-bit { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.pb-bit svg { width: 24px; height: 24px; overflow: visible; }
.pb-go { margin-left: auto; font: 800 20px var(--display); }
/* bannière d'installation : deux choix */
.install-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.install-actions .go { min-height: 36px; }
.install-done { border: 0; background: none; color: var(--paper-soft); font: 700 12px var(--body); text-decoration: underline; padding: 0; }

/* ---------- Plan B en mode carte ---------- */
body.planb-mode .chips, body.planb-mode .fab, body.planb-mode .install, body.planb-mode .locate:not(#locate) { display: none; }
.pb-banner {
  position: fixed; z-index: 12; left: 16px; right: 16px; top: calc(78px + var(--safe-t)); display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 10px; background: var(--cyan); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: 3px 3px 0 var(--ink);
}
.pb-banner div { flex: 1; display: flex; flex-direction: column; }
.pb-banner strong { font: 800 18px var(--display); }
.pb-banner small { font-size: 12px; }
.pb-banner .install-x { background: var(--paper); border: 2px solid var(--ink); }
body.planb-mode #locate { top: calc(150px + var(--safe-t)); }
.pbm { position: relative; display: flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.pbm > span { display: flex; align-items: center; justify-content: center; background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.pbm.station > span { width: 44px; height: 44px; border-radius: 15px; background: var(--lime); }
.pbm.station svg { width: 34px; height: 34px; overflow: visible; }
.pbm.station b { position: absolute; top: -9px; right: -10px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink); color: var(--lime); border: 2px solid var(--ink); font: 800 12px/18px var(--body); text-align: center; }
.pbm.free > span { width: 32px; height: 32px; border-radius: 11px; }
.pbm.free svg { width: 26px; height: 26px; overflow: visible; }
.pbm.sel > span { outline: 3px solid var(--pink); outline-offset: 2px; transform: scale(1.15); }
.pb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pb-list li { display: flex; align-items: center; gap: 10px; }
.pb-list li.sel { background: #F4F1FC; border-radius: 14px; padding: 4px; margin: -4px; }
.pb-list div { flex: 1; min-width: 0; }
.pb-list strong { display: block; font: 800 15px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-list small { font-size: 12px; color: var(--paper-soft); }
.pb-list .go { min-height: 40px; padding: 0 12px; }
@media (min-width: 700px) { .pb-banner { right: auto; width: calc(var(--col) - 32px); } }

/* carte du bas : le titre garde toute la largeur, le Plan B passe dessous */
.card h1 { font-size: 18px; }
.card .pb-teaser { justify-content: flex-start; }
