:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #6b7280;
  --line: #e4ded1;
  --navy: #0b1f4d;
  --accent: #00a88f;
  --accent-ink: #ffffff;
  --logo-accent: #3ddbbf;
  --late: #e4572e;
  --early: #2f80ed;
  --warn-bg: #fff4d6;
  --warn-ink: #7a5300;
  --bar: #cdc5b4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 4px 16px rgba(20, 33, 61, 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1320;
    --card: #161e2e;
    --ink: #eef1f6;
    --muted: #9aa4b5;
    --line: #273248;
    --warn-bg: #3a2d0b;
    --warn-ink: #ffd772;
    --bar: #3d4a63;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1320;
  --card: #161e2e;
  --ink: #eef1f6;
  --muted: #9aa4b5;
  --line: #273248;
  --warn-bg: #3a2d0b;
  --warn-ink: #ffd772;
  --bar: #3d4a63;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand { min-width: 0; }
a.brand { color: inherit; text-decoration: none; border-radius: 10px; }
a.brand:hover .brand-back { transform: translateX(-2px); }
.brand-back { font-size: 1.9rem; font-weight: 300; line-height: 1; margin: -4px -4px 0 -6px; opacity: 0.85; transition: transform 0.15s ease; }
span.wallet-pill { display: inline-flex; align-items: center; gap: 4px; cursor: default; }
span.wallet-pill:hover { background: rgba(255, 255, 255, 0.1); }
a.brand:focus-visible { outline: 2px solid var(--logo-accent); outline-offset: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
/* Cagnotte de jetons, commune aux deux jeux. */
.wallet-pill {
  height: 30px; padding: 0 9px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-size: 0.85rem; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.wallet-pill:hover { background: rgba(255, 255, 255, 0.18); }
a.wallet-pill { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.wallet-pill:focus-visible { outline: 2px solid var(--logo-accent); outline-offset: 2px; }

/* Logo : panneau de métro rond et métronome ; l'aiguille bat quelques mesures au chargement. */
.brand-logo { flex: none; width: 34px; height: 34px; color: #fff; overflow: visible; }
.logo-needle { stroke: var(--logo-accent); fill: var(--logo-accent); transform-box: view-box; transform-origin: 16px 22.2px; transform: rotate(14deg); }
@media (prefers-reduced-motion: no-preference) {
  .logo-needle { animation: logo-tick 0.75s ease-in-out 0.3s 6 alternate both; }
}
@keyframes logo-tick { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }

/* Mot-symbole : « Métro » + « Nome », le jeu de mots se lit grâce à la couleur. */
.wordmark { margin: 0; font-size: 1.2rem; font-weight: 850; letter-spacing: -0.01em; line-height: 1.1; }
.wm-metro { color: #fff; }
.wm-nome { color: var(--logo-accent); }
.subtitle { margin: 0; font-size: 0.75rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div { min-width: 0; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35); background: transparent;
  color: #fff; font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---- Onglets Matin / Soir ---- */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 6px 16px 0;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font: inherit;
}
.tab-title { font-weight: 750; font-size: 0.88rem; }
.tab-status { font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.tab.active { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Résumé d'une journée (carte « hier ») ---- */
.day-line { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; }
.day-line span { min-width: 0; }
.day-total { margin: 10px 0 0; font-weight: 800; text-align: right; }

main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.card h2 { margin: 0 0 8px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- Trajet ---- */
#trip-card { cursor: pointer; }
.route { display: grid; grid-template-columns: 18px 1fr auto; column-gap: 10px; align-items: center; }
.route .dot { width: 14px; height: 14px; border-radius: 50%; border: 4px solid var(--ink); background: var(--card); justify-self: center; }
.route .bar { width: 4px; height: 14px; background: var(--ink); justify-self: center; border-radius: 2px; }
.route .station { font-size: 1.2rem; font-weight: 750; }
.route .time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.route .time.big { color: var(--ink); }

.trip-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; margin-top: 10px; flex-wrap: wrap; }
.normal-time { font-size: 0.9rem; color: var(--muted); }
.weather-line { margin: 6px 0 0; font-size: 0.88rem; }
.normal-time strong { color: var(--ink); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.fact { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.fact .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.fact .value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fact .value.late { color: var(--late); }

.lines { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.line-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  font-weight: 800; font-size: 0.8rem; background: #888; color: #fff;
}
.line-badge .mode { font-weight: 600; font-size: 0.65rem; margin-right: 3px; opacity: 0.85; }
.arrow { color: var(--muted); }

/* ---- Pari ---- */
.question { margin: 0; font-size: 0.95rem; text-align: center; }
.bet-display { text-align: center; margin: 10px 0 2px; }
.bet-value { font-size: 2.8rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1; }
button.bet-value {
  border: 0; background: none; color: inherit; font-family: inherit; cursor: text; padding: 0 4px;
  text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent);
  text-decoration-thickness: 3px; text-underline-offset: 8px;
}
button.bet-value:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.bet-input {
  width: 5ch; font: inherit; font-size: 2.8rem; font-weight: 850; line-height: 1; text-align: center;
  color: var(--ink); background: var(--bg); border: 2px solid var(--accent); border-radius: 10px; padding: 0 4px;
}
.bet-value.late { color: var(--late); }
.bet-value.early { color: var(--early); }
.bet-caption { color: var(--muted); margin-top: 6px; font-size: 0.9rem; }

.slider-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.step-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 13px;
  background: var(--accent); color: var(--accent-ink); font-size: 1.05rem; font-weight: 750; cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--navy); color: #fff; }

.countdown { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); margin: 8px 0 0; font-size: 0.85rem; }
.notice { text-align: center; padding: 4px 0; }
.notice p { margin: 8px 0 0; }
.notice .big-emoji { font-size: 2.4rem; }

/* ---- Résultat ---- */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.score-banner { text-align: center; padding: 8px 0 0; }
.score-banner .emoji { font-size: 2.4rem; }
.score-banner .points { font-size: 2.2rem; font-weight: 850; }
.score-banner .detail { color: var(--muted); }
.score-banner .better { margin-top: 4px; font-weight: 750; color: var(--accent); }
.score-banner .tokens { display: inline-block; margin-top: 6px; font-size: 0.85rem; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--bg); border-radius: 999px; padding: 3px 10px; }

/* ---- Graphique des paris ---- */
.tracking-line { margin: 8px 0 0; }
.chart { margin: 16px 0 0; }
.bets-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-bar { fill: var(--bar); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-real { stroke: var(--accent); stroke-width: 2; }
.chart-me { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; }
.chart-label { font: 700 11px system-ui, sans-serif; fill: var(--ink); }
.chart-tick { font: 500 10px system-ui, sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-caption { margin: 6px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); min-height: 1.2em; }

/* ---- Dialogues ---- */
dialog {
  border: 0; border-radius: var(--radius); padding: 22px; max-width: 440px; width: calc(100% - 32px);
  background: var(--card); color: var(--ink); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(5, 10, 25, 0.55); }
dialog h2 { margin-top: 0; }
/* À l'ouverture, le focus va au titre (haut de la fenêtre) plutôt qu'au bouton du bas. */
dialog h2[autofocus]:focus { outline: none; }
.scale { padding-left: 1.1em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-bottom: 16px; }
.stats-grid .value { font-size: 1.6rem; font-weight: 850; }
.stats-grid .label { font-size: 0.72rem; color: var(--muted); }
.history { list-style: none; padding: 0; margin: 0 0 16px; max-height: 240px; overflow: auto; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

/* ---- Historique (feuille plein écran sur téléphone) ---- */
dialog.sheet { padding: 0; width: min(520px, calc(100% - 16px)); max-height: calc(100dvh - 24px); display: none; flex-direction: column; }
dialog.sheet[open] { display: flex; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1rem; text-wrap: balance; }
.sheet-head form { margin: 0; }
.close-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 0.9rem; cursor: pointer; flex: none; }
.sheet-body { padding: 12px 16px 18px; overflow-y: auto; }
.sheet-body h2 { margin: 14px 0 8px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.history-day + .history-day { margin-top: 14px; }
.history-day h3 { margin: 0 0 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.history-row:disabled { cursor: default; opacity: 0.7; }
.history-row:focus-visible, .back-btn:focus-visible, .close-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.history-trip { display: flex; flex-direction: column; min-width: 0; }
.history-trip strong { font-size: 0.92rem; }
.pill { flex: none; font-weight: 800; font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--bg); font-variant-numeric: tabular-nums; }
.guess-pill { background: var(--accent); color: var(--accent-ink); }
.practice-pill { border: 1px dashed var(--muted); }
.muted-pill { color: var(--muted); font-weight: 600; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.legal h3 { margin: 16px 0 4px; font-size: 0.9rem; }
.legal h3:first-child { margin-top: 0; }
.legal p { margin: 0 0 8px; font-size: 0.9rem; max-width: 65ch; }
.legal a { color: var(--accent); }
.back-btn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; padding: 4px 0; margin-bottom: 6px; cursor: pointer; }
.trip-summary { margin-bottom: 12px; }
.trip-summary p { margin: 0 0 4px; }
.trip-summary-route { font-size: 1.1rem; font-weight: 800; }
.trip-summary .lines { margin-top: 6px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; z-index: 20; max-width: calc(100% - 32px); text-align: center;
}

.footer {
  width: 100%; max-width: 520px; margin: 0 auto;
  padding: 4px 16px max(12px, env(safe-area-inset-bottom));
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px;
  font-size: 0.72rem; color: var(--muted);
}
#mode-badge { color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 0 6px; font-weight: 600; }

/* ---- Animation d'intro ---- */
#intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 24px;
  background: radial-gradient(120% 80% at 50% 30%, #17306e 0%, var(--navy) 70%);
  color: #fff; text-align: center; cursor: pointer;
  transition: opacity 0.45s ease;
}
#intro.leaving { opacity: 0; }
#intro-map { width: min(100%, 420px); height: auto; overflow: visible; }
.intro-kicker {
  margin: 0; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0;
  animation: intro-in 0.5s ease 0.1s forwards;
}
.intro-route { margin: 0; font-size: 1.35rem; font-weight: 800; min-height: 1.4em; opacity: 0; animation: intro-in 0.5s ease 0.3s forwards; }
.intro-duration { margin: 0; font-size: 1rem; min-height: 1.4em; opacity: 0; }
.intro-duration.show { animation: intro-pop 0.45s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.intro-weather { margin: 0; font-size: 0.95rem; min-height: 1.4em; opacity: 0; }
.intro-weather.show { animation: intro-in 0.5s ease 0.35s forwards; }
.intro-duration strong { font-size: 1.6rem; }
.intro-skip { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); margin: 0; font-size: 0.75rem; opacity: 0.5; }
.intro-label { font: 700 13px system-ui, sans-serif; fill: #fff; }
.intro-sub { font: 600 11px system-ui, sans-serif; fill: rgba(255, 255, 255, 0.7); }
.intro-badge { opacity: 0; transition: opacity 0.3s ease; }
.intro-badge.show { opacity: 1; }

@keyframes intro-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes intro-pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* ---- Ticket gagnant ---- */
.rl-head { display: flex; justify-content: space-between; gap: 8px; }
.rl-countdown { text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.rl-question { font-size: 0.9rem; }
.rl-closing { display: inline-flex; align-items: center; gap: 2px; padding: 3px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); text-transform: none; letter-spacing: 0; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.rl-title { margin: 2px 0 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.rl-rule { margin: 2px 0 8px; font-size: 0.85rem; color: var(--muted); }
.rl-legend { display: flex; gap: 12px; margin: 0 0 2px; font-size: 0.72rem; color: var(--muted); }
.rl-legend span { display: inline-flex; align-items: center; gap: 4px; }
.rl-legend i { width: 8px; height: 8px; border-radius: 50%; }
.rl-legend .safe { background: #adb5bd; }
.rl-legend .mid { background: #3b82f6; }
.rl-legend .risky { background: #f59e0b; }
.rl-legend .risky::after { content: ""; }
.rl-groups { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; }
.rl-group-label { display: block; font-size: 0.66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 5px; }
.rl-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.rl-tile {
  --c: var(--accent);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 0 7px; border-radius: 14px; border: 1.5px solid transparent;
  background: color-mix(in srgb, var(--ink) 4%, var(--card));
  color: var(--ink); font: inherit; cursor: pointer; min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.rl-tile .rl-badge { --bs: 34px; }
button.rl-tile:disabled { cursor: default; }
button.rl-tile:not(:disabled):active { transform: scale(0.96); }
.rl-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rl-tile.picked {
  border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--card));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 32%, transparent); transform: translateY(-2px);
}
.rl-tile.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c), 0 4px 12px color-mix(in srgb, var(--c) 32%, transparent); }
.rl-tile.hit { border-color: var(--late); background: color-mix(in srgb, var(--late) 14%, var(--card)); }
.rl-tile.hit.picked { box-shadow: inset 0 0 0 2px var(--late); transform: none; }
.rl-odds { font-size: 0.72rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); line-height: 1.1; white-space: nowrap; }
.rl-odds.safe, .rl-odds.mid, .rl-odds.risky { padding: 2px 7px; border-radius: 999px; }
.rl-odds.safe { background: color-mix(in srgb, #868e96 16%, var(--card)); color: color-mix(in srgb, #495057 85%, var(--ink)); }
.rl-odds.mid { background: color-mix(in srgb, #3b82f6 16%, var(--card)); color: #2563eb; }
.rl-odds.risky { background: color-mix(in srgb, #f59e0b 22%, var(--card)); color: #b45309; }
.rl-hot { position: absolute; top: -6px; left: -4px; font-size: 0.75rem; line-height: 1; }
.rl-tile.hit .rl-odds { color: var(--late); }
.rl-chip {
  position: absolute; top: -7px; right: -5px; min-width: 22px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--ink); color: var(--card); border: 2px solid var(--card);
  font-size: 0.68rem; font-weight: 800; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rl-odds.safe { color: #ced4da; }
  :root:not([data-theme="light"]) .rl-odds.mid { color: #93c5fd; }
  :root:not([data-theme="light"]) .rl-odds.risky { color: #fcd34d; }
}

/* Le ticket : bords crantés, perforation, gain possible, tampon « composté ». */
.rl-ticket { position: relative; overflow: visible; }
.rl-ticket-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.rl-ticket-lines { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.rl-ticket-line { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1.5px solid transparent; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--ink); font: inherit; font-size: 0.82rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.rl-ticket-line .rl-badge { --bs: 24px; }
.rl-ticket-line.active { border-color: var(--c); }
.rl-perfo { position: relative; border-top: 2px dashed var(--line); margin: 16px calc(-1 * var(--pad, 16px)) 12px; }
.rl-perfo::before, .rl-perfo::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.rl-perfo::before { left: -11px; clip-path: inset(0 0 0 50%); }
.rl-perfo::after { right: -11px; clip-path: inset(0 50% 0 0); }
.rl-gain { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rl-gain-label { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.rl-gain strong { font-size: 1.6rem; font-weight: 850; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rl-ticket .btn { margin-top: 12px; }
.rl-ticket-head { align-items: center; min-height: 26px; }
.rl-stamp {
  flex: none; padding: 2px 8px; border: 2.5px solid var(--accent); border-radius: 7px;
  color: var(--accent); font-weight: 900; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  transform: rotate(-8deg); opacity: 0.85; pointer-events: none; animation: rl-stamp 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes rl-stamp { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 0.85; } }

/* Pastilles de ligne, comme les logos des lignes : police sans empattement proche de la Parisine (Fira Sans,
   et le « 1 » d'Open Sans, plus fidèle ; licence OFL, public/fonts/, réduites aux chiffres, majuscules et « bis »),
   chiffres qui remplissent le rond, « bis » en petit à mi-hauteur. Taille : --bs. */
@font-face { font-family: "MN Lignes"; src: url("/fonts/fira-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+30, U+32-39, U+41-5A, U+62, U+69, U+73; }
@font-face { font-family: "MN Lignes"; src: url("/fonts/open-sans-700-un.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+31; }
.rl-badge {
  --bs: 24px;
  display: inline-flex; align-items: baseline; justify-content: center; flex: none;
  width: var(--bs); height: var(--bs); line-height: var(--bs);
  font-family: "MN Lignes", system-ui, sans-serif; font-size: calc(var(--bs) * 0.7); font-weight: 600;
}
.rl-badge.two { font-size: calc(var(--bs) * 0.6); letter-spacing: -0.04em; }
.rl-badge.bis { font-size: calc(var(--bs) * 0.64); }
.rl-badge.bis small { font-size: 0.42em; margin-left: 0.03em; transform: translateY(-0.45em); }
.rl-badge.mode-metro { border-radius: 50%; }
.rl-badge.mode-rer { border-radius: 22%; font-size: calc(var(--bs) * 0.66); }
.rl-badge.mode-transilien { border-radius: 14%; font-size: calc(var(--bs) * 0.66); }

.rl-hint { margin: 8px 0 0; }
.rl-editor { margin: 8px 0 10px; padding: 6px 10px; border-radius: 12px; background: var(--bg); }
.rl-editor-line { display: flex; align-items: center; gap: 8px; }
.rl-editor-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.rl-editor-name .muted { font-size: 0.8rem; }
.rl-stepper { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rl-stepper .step-btn { width: 40px; height: 40px; background: var(--card); }
.rl-stepper .step-btn:disabled { opacity: 0.4; }
.rl-stake {
  width: 3.4ch; padding: 2px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 1.4rem; font-weight: 850; font-variant-numeric: tabular-nums; text-align: center; -moz-appearance: textfield;
}
.rl-stake::-webkit-outer-spin-button, .rl-stake::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rl-stake:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rl-potential { margin: 4px 0 0; text-align: center; font-size: 0.82rem; color: var(--muted); }
.rl-saved { margin: 8px 0 0; text-align: center; }

.rl-status { margin: 0; font-size: 0.9rem; }
.rl-status.failed { color: var(--warn-ink); background: var(--warn-bg); border-radius: 8px; padding: 6px 8px; }
.rl-mybets { list-style: none; padding: 0; margin: 10px 0 0; }
.rl-mybets li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rl-mybets li:last-child { border-bottom: 0; }
.rl-outcome { font-weight: 750; }
.rl-outcome.won { color: var(--accent); }
.rl-subtitle { margin: 14px 0 6px !important; }
.rl-incidents { list-style: none; padding: 0; margin: 0; max-height: 210px; overflow-y: auto; }
.rl-incidents li { display: grid; grid-template-columns: 42px 28px 1fr; align-items: start; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.rl-incidents li:last-child { border-bottom: 0; }
.rl-time { font-variant-numeric: tabular-nums; font-weight: 700; padding-top: 3px; }
.rl-incident-title { padding-top: 3px; min-width: 0; overflow-wrap: anywhere; }
.rl-popular { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.rl-popular span { display: inline-flex; align-items: center; gap: 4px; }
.score-banner + .rl-mybets { margin-top: 6px; }

/* Petits téléphones : l'en-tête (logo, cagnotte, boutons) tient sur une ligne même avec « 9999+ ». */
@media (max-width: 390px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 7px; }
  .brand-logo { width: 30px; height: 30px; }
  .wordmark { font-size: 1.08rem; }
  .topbar-actions { gap: 4px; }
  .wallet-pill { padding: 0 7px; font-size: 0.8rem; }
}

/* ---- Détour ---- */
.dt-route { margin: 0 0 8px; font-size: 1.05rem; }
.dt-normal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dt-normal .lines .rl-badge { --bs: 22px; }
.dt-cut {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--late) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--late) 45%, transparent);
  font-size: 0.92rem;
}
.dt-undo { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.dt-lines { margin-bottom: 4px; }
.rl-tile.cut { border-color: var(--late); }
.dt-note { text-align: center; margin: 8px 0 0; }
.dt-legs { list-style: none; padding: 0; margin: 0; }
.dt-legs li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.dt-legs li:last-child { border-bottom: 0; }
.dt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dt-timer { font-variant-numeric: tabular-nums; font-weight: 750; font-size: 0.9rem; }
.dt-chain { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.dt-chain .rl-badge { --bs: 30px; }
.dt-q { margin: 6px 0; }
.dt-others { list-style: none; padding: 0; margin: 0; }
.dt-others li { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.dt-others li:last-child { border-bottom: 0; }

/* ---- Bilan de fin de journée (Trajet et Ticket gagnant) ---- */
.recap {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
  padding: 20px; overflow-y: auto; background: radial-gradient(120% 80% at 50% 25%, #17306e 0%, var(--navy) 70%); color: #fff;
  animation: recap-fade 0.4s ease both;
}
.recap.leaving { animation: recap-fade 0.35s ease reverse both; }
.recap-inner { width: min(100%, 420px); text-align: center; margin: auto; }
.recap-kicker { margin: 0; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; }
.recap-title { margin: 4px 0 16px; font-size: 1.4rem; font-weight: 850; }
.recap-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.recap-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.08);
  opacity: 0; animation: recap-in 0.45s cubic-bezier(.2, 1.2, .4, 1) var(--d, 0s) both;
}
.recap-item .recap-sub { display: block; font-size: 0.8rem; opacity: 0.75; }
.recap-item .recap-pts { font-weight: 850; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.recap-emoji { font-size: 1.6rem; opacity: 0; animation: recap-pop 0.4s cubic-bezier(.2, 1.6, .4, 1) var(--d2, 0s) both; }
.recap-total { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; opacity: 0; animation: recap-pop 0.5s cubic-bezier(.2, 1.4, .4, 1) var(--d, 0s) both; }
.recap-total small { font-size: 1rem; font-weight: 650; opacity: 0.7; margin-left: 4px; }
.recap-total.up { color: #5ee6a8; }
.recap-total.down { color: #ff9b85; }
.recap-note { margin: 8px 0 0; opacity: 0; animation: recap-in 0.4s ease var(--d, 0s) both; }
.recap-tokens { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 750; opacity: 0; animation: recap-pop 0.4s ease var(--d, 0s) both; }
.recap-actions { display: flex; gap: 8px; margin-top: 20px; opacity: 0; animation: recap-in 0.4s ease var(--d, 0s) both; }
.recap-actions .btn { flex: 1; }
.recap-actions .btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; }
.recap-burst { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.recap-burst span { position: absolute; bottom: -40px; font-size: 1.6rem; animation: recap-rise var(--t, 2.4s) ease-out var(--d, 0s) both; }
/* Ticket gagnant : le ticket de la journée, composté avant le résultat */
.recap-ticket {
  position: relative; width: 250px; margin: 12px auto 14px; padding: 10px 14px 12px 22px; border-radius: 8px;
  background: #f3ead2; color: #0b1f4d; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  animation: recap-insert 0.7s cubic-bezier(.2, .8, .3, 1.2) both;
}
/* Bande magnétique et bord prédécoupé, comme un ticket de métro. */
.recap-ticket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; border-radius: 8px 0 0 8px; background: #6b4f2a; }
.recap-ticket::after { content: ""; position: absolute; right: -1px; top: 8px; bottom: 8px; border-right: 3px dotted #0b1f4d; opacity: 0.25; }
.rt-head { display: flex; justify-content: space-between; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.rt-lines { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.rt-count { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.rt-count strong { font-size: 2rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.rt-count small { font-size: 0.75rem; font-weight: 700; }
.rt-stamp {
  position: absolute; right: 12px; bottom: 16px; padding: 2px 8px; border: 2px solid #c0392b; border-radius: 4px;
  color: #c0392b; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase;
  transform: rotate(-12deg); opacity: 0; animation: recap-stamp 0.35s ease-in 1.6s both;
}
.recap-item.hit { animation-name: recap-in, recap-flash; animation-duration: 0.45s, 0.9s; animation-delay: var(--d, 0s), calc(var(--d, 0s) + 0.3s); animation-fill-mode: both, none; }
.recap-item.miss .recap-pts { opacity: 0.6; }
.recap-item.miss { animation-name: recap-in, recap-shake; animation-duration: 0.45s, 0.5s; animation-delay: var(--d, 0s), calc(var(--d, 0s) + 0.35s); animation-fill-mode: both, none; }

@keyframes recap-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes recap-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes recap-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes recap-insert { from { opacity: 0; transform: translateY(-40px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes recap-stamp { from { opacity: 0; transform: rotate(-12deg) scale(2.2); } to { opacity: 0.9; transform: rotate(-12deg) scale(1); } }
/* Sans opacité ni position de départ : l'apparition différée (recap-in) garde la main jusqu'à son tour. */
@keyframes recap-flash { 0%, 100% { background: rgba(255, 255, 255, 0.08); } 40% { background: rgba(94, 230, 168, 0.35); } }
@keyframes recap-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes recap-rise { from { opacity: 0; transform: translateY(0) rotate(0); } 15% { opacity: 1; } to { opacity: 0; transform: translateY(-110vh) rotate(var(--r, 30deg)); } }
@media (prefers-reduced-motion: reduce) {
  .recap, .recap *, .recap-burst span { animation-duration: 0.01s !important; animation-delay: 0s !important; }
}

/* ---- Accueil : une grande tuile par jeu ---- */
.home-date { margin: 8px 2px 2px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; min-height: 1.2em; }
.home-tiles { display: flex; flex-direction: column; gap: 12px; }
.home-tile {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 18px 14px 18px 16px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.home-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--tile); }
.home-tile:hover { border-color: var(--tile); transform: translateY(-2px); }
.home-tile:active { transform: scale(0.99); }
.home-tile:focus-visible { outline: 3px solid var(--tile); outline-offset: 2px; }
.home-icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; font-size: 2.1rem;
  background: color-mix(in srgb, var(--tile) 16%, transparent);
}
.home-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.home-title { font-size: 1.35rem; font-weight: 850; letter-spacing: -0.01em; line-height: 1.1; }
.home-pitch { font-size: 0.88rem; color: var(--muted); }
.home-status { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 1.4rem; }
.home-status:empty { display: none; }
.home-chip {
  font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums;
}
.home-chip.todo { background: var(--tile); border-color: var(--tile); color: #fff; }
.home-go { font-size: 2rem; line-height: 1; color: var(--tile); font-weight: 300; }
.home-note { margin: 4px 2px 0; text-align: center; }
@media (min-width: 560px) {
  .home-tile { padding: 22px 18px 22px 22px; }
  .home-icon { width: 76px; height: 76px; font-size: 2.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .home-tile { animation: home-in 0.4s ease both; }
  .home-tile:nth-child(2) { animation-delay: 0.07s; }
  .home-tile:nth-child(3) { animation-delay: 0.14s; }
}
@media (prefers-reduced-motion: reduce) {
  .home-tile { transition: none; }
}
@keyframes home-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- Collection : la carte de Paris qui s'illumine ---- */
.cl-progress { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cl-progress strong { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.cl-pct { font-weight: 800; color: #c98a00; font-variant-numeric: tabular-nums; }
.cl-bar { height: 6px; border-radius: 3px; background: var(--line); margin: 6px 0 10px; overflow: hidden; }
.cl-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ffb000, #ffe27a); }
.cl-map-wrap { margin: 0 -16px; background: #08122e; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cl-map { display: block; width: 100%; height: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cl-paris { fill: #0e1f4f; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.cl-lines path { fill: none; stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; opacity: 0.32; }
.cl-map.idf .cl-lines path { stroke-width: 0.8px; opacity: 0.4; }
.cl-glows circle { fill: url(#cl-glow); mix-blend-mode: screen; }
.cl-glows circle.ultra { fill: url(#cl-glow-ultra); }
.cl-glows .cl-new { transform-box: fill-box; transform-origin: center; animation: cl-light 1.4s ease-out both; }
.cl-dot { fill: rgba(255, 255, 255, 0.32); }
.cl-dot.on { fill: #fff6cf; stroke: #ffcf4d; stroke-width: 0.7px; vector-effect: non-scaling-stroke; }
.cl-dot.sel { stroke: #fff; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.cl-offer.rare { stroke: #c4a7ff; }
.cl-offer.ultra { stroke: #ff8ad8; stroke-width: 1.6px; }
.cl-offer { fill: none; stroke: #ffd34d; stroke-width: 1.1px; vector-effect: non-scaling-stroke; stroke-dasharray: 2 2; opacity: 0.9; }
@media (prefers-reduced-motion: no-preference) {
  .cl-offer { animation: cl-spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
}
@keyframes cl-spin { to { transform: rotate(360deg); } }
@keyframes cl-light { 0% { transform: scale(0); opacity: 0; } 40% { transform: scale(1.8); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.cl-caption { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-height: 1.6em; }
.cl-caption .rl-badge { --bs: 20px; }
.cl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cl-head h2 { margin-bottom: 4px; }
.cl-offer-list { list-style: none; margin: 0; padding: 0; }
.cl-offer-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cl-offer-list li:first-child { border-top: 0; }
.cl-where { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cl-badges { display: flex; flex-wrap: wrap; gap: 2px; width: 74px; flex: none; }
.cl-badges .rl-badge { --bs: 22px; }
.cl-name { display: flex; flex-direction: column; min-width: 0; }
.cl-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-buy { width: auto; flex: none; padding: 8px 12px; font-size: 0.9rem; white-space: nowrap; }
.cl-buy:disabled { opacity: 0.45; }
.cl-owned { flex: none; font-weight: 800; color: #c98a00; font-size: 0.9rem; }
li.bought .cl-name strong { color: #c98a00; }
.cl-arrs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cl-depts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.cl-head-2 { margin-top: 14px; }
.cl-views { display: flex; gap: 4px; margin: 0 0 8px; }
.cl-views button {
  flex: 1; padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.cl-views button[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.cl-arr {
  display: flex; flex-direction: column; align-items: center; padding: 5px 2px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(255, 191, 0, 0.32) var(--p), transparent var(--p)); font-variant-numeric: tabular-nums;
}
.cl-arr strong { font-size: 0.82rem; white-space: nowrap; }
.cl-arr small { font-size: 0.7rem; color: var(--muted); }
.cl-arr.done { background: linear-gradient(135deg, #ffd34d, #ffb000); border-color: #ffb000; color: #3d2a00; }
.cl-arr.done small { color: #5c4300; }

/* Rareté des stations */
.cl-tier { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; color: #fff; vertical-align: 1px; }
.cl-tier.rare { background: #7c3aed; }
.cl-tier.ultra { background: linear-gradient(90deg, #f59e0b, #ec4899, #8b5cf6); }
.cl-offer-list li.tier-ultra { margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(236, 72, 153, 0.1), rgba(139, 92, 246, 0.12)); }
.cl-offer-list li.tier-rare { margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: rgba(124, 58, 237, 0.07); }
.cl-caption .cl-tier { margin-left: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .cl-tier.ultra { background-size: 200% 100%; animation: cl-shine 3s linear infinite; }
}
@keyframes cl-shine { to { background-position: 200% 0; } }
/* Accueil : le sous-titre (accroche) peut passer sur deux lignes sur les petits écrans plutôt que d'être coupé. */
.nowrap { white-space: nowrap; }

/* Accueil : la Collection, à part des jeux (on y dépense ses jetons) — carte de nuit qui s'illumine. */
.home-spend { margin-top: 10px; }
.home-section { margin: 8px 2px 8px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.home-album {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px 14px 16px 16px; border-radius: 20px; text-decoration: none; color: #fff; overflow: hidden;
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 207, 77, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 64% 70%, rgba(255, 207, 77, 0.3) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 78%, rgba(255, 207, 77, 0.25) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 72% 50%, rgba(255, 190, 40, 0.18), transparent 45%),
    linear-gradient(135deg, #0b1f4d, #13306e);
  border: 1px dashed rgba(255, 207, 77, 0.55);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.home-album:hover { transform: translateY(-2px); border-color: #ffcf4d; }
.home-album:focus-visible { outline: 3px solid #ffcf4d; outline-offset: 2px; }
.home-album-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 1.8rem; background: rgba(255, 207, 77, 0.16); box-shadow: 0 0 18px rgba(255, 207, 77, 0.35); }
.home-album .home-title { font-size: 1.2rem; }
.home-album .home-pitch { color: rgba(255, 255, 255, 0.75); }
.home-album .home-go { color: #ffcf4d; }
.home-album-bar { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.home-album-bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #ffb000, #ffe27a); transition: width 0.6s ease; }
.home-album .home-chip { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.home-album .home-chip.todo { background: #ffcf4d; border-color: #ffcf4d; color: #3d2a00; }

/* Détour : jours précédents (entraînement) */
.dt-practice h2 { margin-bottom: 2px; }
.dt-practice p { margin: 0 0 4px; }
.dt-practice .link-btn { font-size: 0.85rem; margin-bottom: 8px; }
.dt-past { list-style: none; margin: 0; padding: 0; }
.dt-past li + li { border-top: 1px solid var(--line); }
.dt-past-day {
  display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px 2px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.dt-past-day:hover, .dt-past-day:focus-visible { background: var(--bg); }
.dt-past-day.current { box-shadow: inset 3px 0 0 var(--accent); }
.dt-past-when { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-past-when small { font-size: 0.72rem; }
.dt-past-trip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.dt-past-trip .rl-badge { --bs: 20px; vertical-align: middle; }
.dt-past-res { font-size: 0.85rem; font-weight: 700; white-space: nowrap; color: var(--accent); }


/* ---------- Animation de bienvenue (première visite) ---------- */
html.in-lock { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 90% at 50% 20%, #17306f 0%, #0b1f4d 55%, #071333 100%); color: #fff; text-align: center; transition: opacity 0.7s ease; cursor: pointer; }
.intro.out { opacity: 0; pointer-events: none; }
.in-stage { position: relative; width: min(100%, 420px); height: min(420px, 82vh); padding: 0 16px; }
@media (min-width: 560px) { .in-stage { width: min(100%, 600px); } }
.in-scene { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; opacity: 0; transform: translateY(14px) scale(0.98); transition: opacity 0.45s ease, transform 0.45s ease; pointer-events: none; }
.in-scene.on { opacity: 1; transform: none; }
.in-text { margin: 0; font-size: 1.85rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.in-text b { color: #3ddbbf; font-weight: 800; }
.in-art { position: relative; width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; }
.in-skip { position: absolute; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; font-size: 0.85rem; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.in-skip { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.in-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #3ddbbf; transform-origin: left; transform: scaleX(0); animation: in-bar var(--total, 10s) linear forwards; }
@keyframes in-bar { to { transform: scaleX(1); } }

/* 1 · le panneau d'information en station : attentes qui grimpent, messages qui s'enchaînent */
.in-board { gap: 0; padding: 0 14px; }
.in-board .in-art { height: auto; }
.pb { width: 100%; border-radius: 14px; overflow: hidden; background: #0a0f1a; text-align: left; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pb-head { display: flex; align-items: center; gap: 7px; padding: 9px 10px; background: #f4f6fb; color: #0b1f4d; }
.pb-logo svg { display: block; width: 28px; height: 28px; color: #0b1f4d; }
.pb-line { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ffcd00; color: #000; font-weight: 800; font-size: 1rem; }
.pb-alert { position: absolute; right: -6px; bottom: -4px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; background: #e4572e; color: #fff; font-style: normal; font-size: 0.7rem; font-weight: 900; transform: scale(0); transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pb.alert .pb-alert { transform: scale(1); }
.pb-dest { flex: 1; min-width: 0; font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.pb-clock { flex: none; padding: 3px 7px; border-radius: 5px; background: #0a0f1a; color: #ffcd00; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.pb-body { display: flex; flex-direction: column; }
.pb-waits { display: flex; align-items: stretch; justify-content: space-around; padding: 10px 8px 12px; }
.pb-wait { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40%; }
.pb-wait small { color: #fff; font-size: 0.8rem; font-weight: 600; }
.pb-n { color: #ffcd00; font-size: 3.6rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.pb-sep { width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.85); margin: 22px 0 6px; }
.pb-n[data-len="3"] { font-size: 3rem; }
.pb-n[data-len="4"] { font-size: 2.35rem; }
.pb.bump .pb-n { animation: pb-bump 0.35s ease; }
@keyframes pb-bump { 30% { color: #ff8a5b; transform: scale(1.12); } }
.in-scene.on .pb.bump { animation: pb-shake 0.3s ease; }
@keyframes pb-shake { 25% { transform: translateX(calc(-1 * var(--shake, 0px))) rotate(-0.4deg); } 75% { transform: translateX(var(--shake, 0px)) rotate(0.4deg); } }
.pb.cut .pb-n { color: #e4572e; animation: pb-blink 0.9s steps(2, start) infinite; }
@keyframes pb-blink { to { visibility: hidden; } }
.pb-info { margin: 0 8px 8px; padding: 8px 10px 10px; border-radius: 8px; background: #f4f6fb; color: #0b1f4d; min-height: 84px; overflow: hidden; }
.pb-info-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pb-mini { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #ffcd00; color: #000; font-weight: 800; font-size: 0.72rem; }
.pb-tag { font-size: 0.72rem; font-weight: 700; color: #5b6478; text-transform: uppercase; letter-spacing: 0.04em; }
.pb.alert .pb-tag { color: #c2410c; }
.pb.alert .pb-tag::before { content: "⚠ "; }
.pb-msg { margin: 0; font-size: 1rem; line-height: 1.3; }
.pb-msg b { font-weight: 800; }
.pb-msg.swap { animation: pb-swap 0.25s ease; }
@keyframes pb-swap { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pb-stripe { height: 7px; background: #ffcd00; transition: background 0.4s ease; }
.pb.cut .pb-stripe { background: #e4572e; }
.in-scene.on .pb { animation: in-pop 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
@keyframes in-pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
@media (min-width: 560px) {
  .pb-body { flex-direction: row; align-items: stretch; }
  .pb-waits { flex: 1; }
  .pb-info { flex: 1.1; margin: 8px 8px 8px 0; }
}

/* 2 · 3 · le message */
.in-sub { margin: -10px 0 0; max-width: 320px; font-size: 1rem; line-height: 1.35; opacity: 0.8; }
.in-scene:not(.in-board):not(.in-final) .in-text { font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.in-jackpot { display: inline-block; margin-top: 10px; font-size: 1.25em; white-space: nowrap; }
.in-scene.on .in-jackpot { animation: in-pop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) 0.55s both; }

/* 5 · le logo */
.in-final { gap: 0; }
.in-brand { display: flex; align-items: center; gap: 14px; }
.in-brand svg { width: 96px; height: 96px; color: #fff; }
.in-word { display: flex; flex-direction: column; text-align: left; font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.in-word span:last-child { color: #3ddbbf; }
.in-scene.on .in-brand { animation: in-pop 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.in-scene.on .in-needle { transform-origin: 16px 22.2px; animation: in-swing 1.2s ease-in-out 0.3s both; }
@keyframes in-swing { 0% { transform: rotate(-60deg); } 40% { transform: rotate(35deg); } 70% { transform: rotate(-12deg); } 100% { transform: rotate(0); } }

/* Sur le logo final : il pulse en douceur et un halo l'entoure. */
.intro.in-logo .in-brand { position: relative; }
.intro.in-logo .in-brand::before { content: ""; position: absolute; left: 0; top: 50%; width: 96px; height: 96px; margin-top: -48px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(61, 219, 191, 0.55); animation: in-halo 1.05s ease-out 0.4s infinite; }
@keyframes in-halo { to { box-shadow: 0 0 0 38px rgba(61, 219, 191, 0); } }

/* ---------- Duel : deux lignes face à face ---------- */
.dl-lead { margin: 2px 0 12px; }
.dl-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dl-duel { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; }
.dl-vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--card); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; z-index: 1; }
.dl-side { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 12px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; text-align: center; cursor: pointer; transition: transform 0.12s, border-color 0.12s, opacity 0.12s; }
.dl-side:active { transform: scale(0.97); }
.dl-side:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dl-side .rl-badge { --bs: 40px; }
.dl-name { font-weight: 700; font-size: 0.9rem; }
.dl-side.chosen { border-color: var(--accent, #00a88f); box-shadow: inset 0 0 0 1px var(--accent, #00a88f); background: color-mix(in srgb, var(--accent, #00a88f) 10%, var(--card)); }
.dl-side.other { opacity: 0.55; }
.dl-tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--accent, #00a88f); color: #fff; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.dl-gain { margin: 0 0 12px; }
.dl-foot { margin: 10px 0 0; text-align: center; }

.dl-side.result { cursor: default; gap: 4px; min-height: 128px; }
.dl-side.result:active { transform: none; }
.dl-top { display: flex; align-items: center; gap: 6px; }
.dl-crown { font-size: 1.1rem; line-height: 1; }
.dl-count { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dl-first, .dl-share { font-size: 0.7rem; color: var(--muted); }
.dl-side.result.lead { border-color: var(--ink); }
.dl-side.result.won { border-color: #2f9e44; background: color-mix(in srgb, #2f9e44 10%, var(--card)); }
.dl-duel.result.lost .dl-side.chosen { border-color: var(--late); background: color-mix(in srgb, var(--late) 9%, var(--card)); }
.dl-duel.result.void .dl-side { opacity: 0.8; }
.dl-outcome { position: absolute; right: -4px; top: -10px; font-size: 1.3rem; z-index: 2; }
.dl-total { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 6%, var(--card)); text-align: center; }
.dl-total strong { font-size: 1.15rem; }
.dl-total.up span { color: #2f9e44; font-weight: 800; }
.dl-total small { color: var(--muted); }

/* ---------- Classement ---------- */
.rk-mine { margin: 0 0 12px; font-size: 1rem; }
.rk-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rk-row { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 4%, var(--card)); }
.rk-row.podium { background: color-mix(in srgb, #f5b301 12%, var(--card)); }
.rk-row.me { box-shadow: inset 0 0 0 2px var(--accent, #00a88f); }
.rk-rank { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-you { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent, #00a88f); color: #fff; font-size: 0.66rem; font-weight: 800; vertical-align: 2px; }
.rk-tokens { font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-gap { text-align: center; color: var(--muted); }
.rk-form { display: flex; gap: 8px; }
.rk-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.rk-form .btn { width: auto; flex: none; }

/* Lien vers le classement, sur l'accueil */
.home-rank { display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; }
.home-rank:hover { border-color: #f5b301; }
.home-rank-icon { font-size: 1.6rem; }
.home-rank .home-title { font-size: 1rem; }
.home-rank .home-go { margin-left: auto; }

/* Collection : loyer des stations */
.cl-rent { margin: 6px 0 0; font-size: 0.9rem; }
.cl-deal { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.cl-yield { font-size: 0.7rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* Pseudo proposé après l'animation de bienvenue */
.pz .pz-error { min-height: 1.2em; margin: 6px 0 0; color: var(--late); font-size: 0.85rem; }
.pz .pz-later { display: block; margin: 8px auto 0; }

/* Détour : l'annonce en station */
.dt-annonce { margin: 8px 0 10px; padding: 10px 12px; border-radius: 12px; background: #0b1f4d; color: #fff; }
.dt-annonce p { margin: 2px 0; }
.dt-annonce-head { display: flex; align-items: center; gap: 6px; font-weight: 800; color: #ffd166; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }
.dt-annonce strong { color: #fff; }


/* Détour : construction de l'itinéraire */
.dt-steps { list-style: none; margin: 4px 0 10px; padding: 0 0 0 4px; }
.dt-step { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 0 4px 2px; }
.dt-step + .dt-step::before { content: ""; position: absolute; left: 15px; top: -8px; height: 12px; border-left: 3px dotted color-mix(in srgb, var(--ink) 30%, transparent); }
.dt-step .rl-badge { --bs: 30px; flex: none; }
.dt-dot { display: grid; place-items: center; width: 30px; height: 30px; flex: none; font-size: 1.1rem; }
.dt-step.goal { opacity: 0.55; }
.dt-step.goal.ready { opacity: 1; }
.dt-remove { margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); font: inherit; cursor: pointer; }
.dt-q { margin: 0 0 8px; font-weight: 650; }
.dt-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.dt-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.dt-opt:active { transform: scale(0.98); }
.dt-opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dt-opt .rl-badge { --bs: 34px; flex: none; }
.dt-opt-name { display: flex; flex-direction: column; font-weight: 700; line-height: 1.2; }
.dt-opt-name small { font-weight: 600; font-size: 0.7rem; color: var(--late); }
.dt-opt.cut { border-color: color-mix(in srgb, var(--late) 45%, var(--line)); }

/* ------------------------------------------------------------ application installable */
.home-install {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 14px 0 0; padding: 12px 16px;
  font: inherit; font-weight: 600; color: var(--ink);
  background: transparent; border: 1.5px dashed var(--muted); border-radius: 14px; cursor: pointer;
}
.home-install:hover { border-style: solid; }
.install-steps { padding-left: 1.3em; margin: 8px 0 16px; }
.install-steps li { margin: 6px 0; }
.offline-card { text-align: center; margin-top: max(15vh, env(safe-area-inset-top)); }
.offline-card img { border-radius: 18px; }
.offline-card .btn { display: block; text-decoration: none; }

/* Jeu à venir : grisé, pas cliquable. */
.home-tile.soon { filter: grayscale(1); cursor: default; box-shadow: none; background: transparent; }
.home-tile.soon > * { opacity: 0.5; }
.home-tile.soon:hover { border-color: var(--line); transform: none; }
.home-tile.soon:active { transform: none; }
.home-soon {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; vertical-align: 2px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line);
}
