/* ==========================================================================
   Vimba : feuille de style du site (V2-20), tirée de la maquette validée
   (docs/maquettes/vimba.css, V2-00). Un écart voulu se signale dans le compte
   rendu du ticket qui le fait.

   - CSP default-src 'self' : aucune ressource externe, aucune URL data:,
     aucun style inline. Logo et icônes en SVG dans le HTML.
   - Polices du système. Cinq tailles de texte par seuil (--fs-1 à --fs-5).
   - Deux seuils de largeur : 640px (navigation dans l'en-tête) et 1024px
     (mise en page d'ordinateur, échelle de texte agrandie).
   - Cibles tactiles d'au moins 44px. Fonds unis, pas de dégradé.
   - Toutes les couleurs passent par les variables : sans elles (Opera Mini
     en mode extrême), la page retombe en noir sur blanc, lisible.
   ========================================================================== */

/* Police d'affichage du titre de l'accueil : Outfit 800, SIL OFL (fonts/OFL-Outfit.txt),
   servie par Vimba (CSP). Le reste du site garde la police du système. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/outfit-5.3.0-800.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #0b0e13;
  --surface: #12161d;
  --surface-2: #181d26;
  --surface-3: #222833;
  --line: #1f2530;
  --line-strong: #343c4a;

  --text: #eef1f5;
  --text-2: #a3adbd;
  --text-3: #8a94a6;

  --accent: #4cc2ff;
  --accent-hover: #7fd4ff;
  --on-accent: #04131e;
  --accent-text: #7fd4ff;
  --accent-tint: #0d2230;

  --ok: #3ddc97;
  --warn: #f5b942;
  --warn-tint: #2a2110;
  --danger: #ff8a8a;
  --danger-tint: #2c1517;

  --cat-safe: #2dd4bf;
  --cat-boost: #b39dfa;
  --cat-bomba: #fb9a52;
  --cat-s2021: #f5cf4c;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", "Droid Sans Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-1: 0.75rem;   /* 12px : mentions */
  --fs-2: 0.875rem;  /* 14px : texte secondaire, petits boutons */
  --fs-3: 1rem;      /* 16px : texte courant, champs, boutons */
  --fs-4: 1.25rem;   /* 20px : titres de section, cotes */
  --fs-5: 1.75rem;   /* 28px : titre de page, codes coupons */

  --r-1: 10px;
  --r-2: 12px;
  --r-3: 16px;

  --tabbar-h: 60px;
}

/* Thème clair : celui du téléphone, sauf choix contraire dans l'en-tête (cookie
   vimba_theme, attribut data-theme posé par le serveur). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e6e9ee;
    --line: #e3e6eb;
    --line-strong: #c9d0da;

    --text: #0e131b;
    --text-2: #4a5464;
    --text-3: #5f6a7c;

    --accent: #0a6fb0;
    --accent-hover: #085d93;
    --on-accent: #ffffff;
    --accent-text: #075f97;
    --accent-tint: #e8f3fb;

    --ok: #0b7046;
    --warn: #8a5300;
    --warn-tint: #fdf3dc;
    --danger: #b3202e;
    --danger-tint: #fde9eb;

    --cat-safe: #0f766e;
    --cat-boost: #6d28d9;
    --cat-bomba: #b93f0b;
    --cat-s2021: #8a6400;
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e6e9ee;
  --line: #e3e6eb;
  --line-strong: #c9d0da;

  --text: #0e131b;
  --text-2: #4a5464;
  --text-3: #5f6a7c;

  --accent: #0a6fb0;
  --accent-hover: #085d93;
  --on-accent: #ffffff;
  --accent-text: #075f97;
  --accent-tint: #e8f3fb;

  --ok: #0b7046;
  --warn: #8a5300;
  --warn-tint: #fdf3dc;
  --danger: #b3202e;
  --danger-tint: #fde9eb;

  --cat-safe: #0f766e;
  --cat-boost: #6d28d9;
  --cat-bomba: #b93f0b;
  --cat-s2021: #8a6400;
}

/* --- Base ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-3)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

body.no-tabbar {
  padding-bottom: 0;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg {
  flex: none;
}

.ico {
  width: 20px;
  height: 20px;
}

.ico-sm {
  width: 16px;
  height: 16px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--text-2);
}

.only-desktop {
  display: none;
}

/* --- Logo (logotype dessiné, V en coche) ----------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
}

.logo svg {
  width: auto;
  height: 28px;
}

.lg-ink {
  fill: currentColor;
}

.lg-acc {
  fill: var(--accent);
}

.lg-st {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.4;
}

/* --- Conteneur, en-tête, barre du bas, pied de page ------------------------ */

.shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* En-tête fixe, translucide sur le contenu qui défile (demande du propriétaire). */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header .shell {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 56px;
}

.nav {
  display: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 600;
}

.nav a:hover {
  color: var(--text);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.header-end {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* Sous 640 px, la connexion passe dans la barre du bas (onglet Compte) : l'en-tête
   garde « Créer un compte », qui ne tient pas à côté sur 360 px (V2-67). Plus
   précise que .btn, qui la suit. */
.header-end .header-login {
  display: none;
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--text);
  font-size: var(--fs-2);
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.dot-warn {
  background: var(--warn);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tabbar-h);
  color: var(--text-3);
  font-size: var(--fs-1);
  font-weight: 600;
}

.tabbar svg {
  width: 22px;
  height: 22px;
}

.tabbar a[aria-current="page"] {
  color: var(--text);
}

.tabbar a[aria-current="page"] svg {
  color: var(--accent);
}

.main {
  flex: 1 0 auto;
  padding: 16px 0 40px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 16px 0 24px;
  color: var(--text-3);
  font-size: var(--fs-1);
}

.footer .shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

.footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.footer nav a:hover {
  color: var(--text);
}

/* --- Titres et sections ---------------------------------------------------- */

.title {
  font-size: var(--fs-5);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  margin-top: 8px;
  color: var(--text-2);
}

.meta {
  margin-top: 4px;
  color: var(--text-3);
  font-size: var(--fs-2);
}

.page-head {
  margin-bottom: 20px;
}

.section {
  margin-top: 32px;
}

.section-sm {
  margin-top: 16px;
}

.h2 {
  margin-bottom: 8px;
  font-size: var(--fs-3);
  font-weight: 700;
}

.narrow {
  max-width: 440px;
  margin: 0 auto;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: var(--fs-2);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
}

.crumbs li + li::before {
  content: "/";
  margin: 0 8px;
}

.crumbs li {
  display: flex;
  align-items: center;
}

/* --- Boutons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-3);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  background: var(--line-strong);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  padding: 0 8px;
  background: transparent;
  color: var(--accent-text);
}

.btn-ghost:hover {
  background: transparent;
  text-decoration: underline;
}

.btn-block {
  display: flex;
  width: 100%;
  min-height: 52px;
}

.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-1);
  font-size: var(--fs-2);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Carte d'échange ------------------------------------------------------- */

.swap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 4px 8px 8px;
}

.swap fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tabs {
  display: flex;
  gap: 24px;
  margin: 0 -8px 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: var(--fs-2);
  font-weight: 600;
}

.tabs a:hover {
  color: var(--text);
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.box {
  padding: 8px 16px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: var(--surface-2);
}

.box:focus-within {
  border-color: var(--line-strong);
}

.box.is-done {
  background: var(--accent-tint);
}

.box.is-error {
  border-color: var(--danger);
}

.box + .box {
  margin-top: 4px;
}

.box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.box-label {
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 500;
}

.box-label b {
  color: var(--text);
  font-weight: 600;
}

.code-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 600 var(--fs-5)/1.25 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-input::placeholder {
  color: var(--text-3);
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
}

.code-input:focus {
  outline: none;
}

.code-input:disabled {
  color: var(--text-2);
  opacity: 1;
}

.code-empty {
  margin-top: 4px;
  padding: 6px 0;
  color: var(--text-3);
  font: 600 var(--fs-5)/1.25 var(--mono);
}

.code-out {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.code {
  color: var(--text);
  font: 700 var(--fs-5)/1.2 var(--mono);
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

.code-sm {
  font: 600 var(--fs-3)/1.4 var(--mono);
  letter-spacing: 0.06em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-2);
  font-weight: 600;
  white-space: nowrap;
}

.status-ok {
  color: var(--ok);
}

.status-warn {
  color: var(--warn);
}

.status-lock {
  color: var(--text-3);
}

.msg {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: var(--fs-2);
}

.msg svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.msg-warn {
  color: var(--warn);
}

.msg-error {
  color: var(--danger);
}

/* Sélecteur de bookmaker : un vrai <select>, chevron dessiné en CSS. */
.bk {
  position: relative;
  display: inline-flex;
  flex: none;
  max-width: 62%;
}

.bk select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 0 36px 0 14px;
  border: 0;
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-3);
  font-weight: 600;
  text-overflow: ellipsis;
  cursor: pointer;
}

.bk::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg);
  pointer-events: none;
}

.bk select:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Bouton d'inversion, à cheval sur les deux blocs. */
.flip {
  position: relative;
  z-index: 1;
  height: 4px;
  display: flex;
  justify-content: center;
}

.flip-btn {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 4px solid var(--surface);
  border-radius: var(--r-2);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
}

.flip-btn.is-static {
  cursor: default;
  color: var(--text-2);
}

.flip + .box {
  margin-top: 4px;
}

.swap > .btn-block,
.swap fieldset > .btn-block {
  margin-top: 8px;
}

.under {
  margin-top: 12px;
  color: var(--text-3);
  font-size: var(--fs-2);
  text-align: center;
}

/* Détail repliable : sélections, cotes. */
.more {
  margin-top: 4px;
}

.more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 0 8px;
  color: var(--text-2);
  font-size: var(--fs-2);
  list-style: none;
  cursor: pointer;
}

.more > summary::-webkit-details-marker {
  display: none;
}

.more > summary b {
  color: var(--text);
  font-weight: 600;
}

.more > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg) translate(-2px, -2px);
}

.more[open] > summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.more-body {
  padding: 0 8px 4px;
}

/* --- Lignes de sélection ----------------------------------------------------- */

.lines li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.lines li:first-child {
  border-top: 0;
}

.ln-match {
  font-size: var(--fs-2);
  font-weight: 600;
}

.ln-odds {
  font-size: var(--fs-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ln-market {
  color: var(--text-2);
  font-size: var(--fs-2);
}

.ln-when {
  color: var(--text-3);
  font-size: var(--fs-1);
  text-align: right;
  white-space: nowrap;
}

.ln-reason {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: var(--fs-1);
}

.lines li.is-missing .ln-match,
.lines li.is-missing .ln-odds {
  color: var(--text-3);
}

.group-title {
  margin: 12px 0 2px;
  color: var(--text-3);
  font-size: var(--fs-1);
  font-weight: 700;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: var(--fs-2);
}

.kv dt {
  color: var(--text-2);
}

.kv dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* --- Résultat : carte à gauche, détail à droite sur ordinateur -------------- */

.result {
  display: grid;
  gap: 24px;
}

.panel > * + * {
  margin-top: 24px;
}

.panel-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* --- Offre partenaire (affiliation) ---------------------------------------
   Sur un écran où la destination est choisie, l'offre de ce bookmaker ;
   ailleurs, un bookmaker partenaire choisi par le serveur (rotation). */

.offer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "logo title btn"
    "logo text text"
    "legal legal legal";
  gap: 4px 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}

.offer-logo {
  grid-area: logo;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-1);
  background: var(--surface-3);
  font-size: var(--fs-2);
  font-weight: 800;
}

.offer-title {
  grid-area: title;
  align-self: center;
  font-weight: 700;
  line-height: 1.3;
}

.offer-text {
  grid-area: text;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.offer-text code {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
}

.offer .btn {
  grid-area: btn;
}

.offer-legal {
  grid-area: legal;
  margin-top: 8px;
  color: var(--text-3);
  font-size: var(--fs-1);
}

/* --- Listes de liens et raccourcis ---------------------------------------- */

.rows a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.rows a:hover {
  color: var(--accent-text);
}

.rows .row-sub {
  display: block;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.chev {
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg);
}

.shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.shortcuts a {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 500;
}

.shortcuts a:hover {
  color: var(--text);
}

.arrow {
  margin: 0 6px;
  color: var(--text-3);
}

/* --- Accueil ---------------------------------------------------------------- */

.home {
  display: grid;
  gap: 16px;
}

.home-intro .lead {
  display: none;
}

/* Accueil : titre en gras ; les bookmakers d'une paire, en couleur, défilent dans le
   titre (app.js). Sans JavaScript, la première paire reste. */
.home-intro .title {
  font-family: var(--display);
  font-size: 2.375rem;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

/* --- Accueil vivant (V2-63) : compteur, combinés du jour, bookmakers ------- */

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(61, 220, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
  }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-head .h2 {
  margin-bottom: 0;
}

.acca-link,
.state-row {
  transition: transform 0.15s ease-out, border-color 0.15s ease-out;
}

.acca-link {
  display: block;
  color: inherit;
}

.acca-link:hover,
.state-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.acca-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--accent-text);
  font-size: var(--fs-2);
  font-weight: 600;
}

.state-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
}

.state-row svg {
  flex: none;
  color: var(--accent-text);
}

.state-row b {
  color: var(--text);
}

.offer-grid {
  display: grid;
  gap: 12px;
}

.offer-grid .offer {
  margin-top: 0;
}

.rise {
  animation: rise 0.5s ease-out both;
}

.rise + .rise {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rot {
  color: var(--accent-text);
}

.rot b {
  font-weight: inherit;
}

.rot b + b,
.rot.is-rotating b {
  display: none;
}

.rot.is-rotating b.is-on {
  display: inline-block;
  animation: bk-in 0.35s ease-out;
}

@keyframes bk-in {
  from {
    opacity: 0;
    transform: translateY(0.25em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Messages ------------------------------------------------------------- */

.notice {
  padding: 12px 16px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  font-size: var(--fs-2);
}

.notice b {
  display: block;
  margin-bottom: 2px;
}

.notice-warn {
  background: var(--warn-tint);
}

.notice-warn b {
  color: var(--warn);
}

.notice-error {
  background: var(--danger-tint);
}

.notice-error b {
  color: var(--danger);
}

.notice .actions {
  margin-top: 8px;
}

.swap > .notice {
  margin-bottom: 8px;
}

/* --- Combinés du jour ------------------------------------------------------- */

.acca-grid {
  display: grid;
  gap: 12px;
}

.acca {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}

.acca-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat {
  font-size: var(--fs-1);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cat-safe {
  color: var(--cat-safe);
}

.cat-boost {
  color: var(--cat-boost);
}

.cat-bomba {
  color: var(--cat-bomba);
}

.cat-s2021 {
  color: var(--cat-s2021);
}

.tag {
  color: var(--text-3);
  font-size: var(--fs-1);
  font-weight: 600;
}

.acca-odds {
  margin-top: 12px;
  font-size: var(--fs-4);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.acca-meta {
  color: var(--text-2);
  font-size: var(--fs-2);
}

.codes {
  margin-top: 12px;
}

.codes li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-top: 1px solid var(--line);
}

.codes .bk-name {
  flex: 1;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.codes .odds {
  color: var(--text-3);
  font-size: var(--fs-2);
  font-variant-numeric: tabular-nums;
}

.codes code {
  font: 700 var(--fs-3) var(--mono);
  letter-spacing: 0.06em;
  -webkit-user-select: all;
  user-select: all;
}

.codes li.is-off code {
  color: var(--text-3);
  text-decoration: line-through;
}

.acca .more {
  border-top: 1px solid var(--line);
}

.acca .more > summary,
.acca .more-body {
  padding-left: 0;
  padding-right: 0;
}

.locked {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.locked p {
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.footnote {
  margin-top: 16px;
  color: var(--text-3);
  font-size: var(--fs-2);
}

/* --- Formulaires ------------------------------------------------------------ */

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}

.field {
  display: block;
  margin-top: 16px;
}

fieldset.field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.field:first-child {
  margin-top: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: var(--fs-2);
  font-weight: 600;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-3);
  font-size: var(--fs-1);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-3);
}

.input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.input-pin {
  font-family: var(--mono);
  letter-spacing: 0.3em;
}

.input-pin::placeholder {
  font-family: var(--font);
  letter-spacing: normal;
}

.input-group {
  display: flex;
}

.input-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--r-1) 0 0 var(--r-1);
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 600;
}

.input-group .input {
  border-radius: 0 var(--r-1) var(--r-1) 0;
}

.field.is-error .input {
  border-color: var(--danger);
}

.choices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  cursor: pointer;
}

.choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.choice-main {
  flex: 1;
  min-width: 0;
}

.choice-name {
  display: block;
  font-weight: 600;
}

.choice-sub {
  display: block;
  color: var(--text-2);
  font-size: var(--fs-2);
}

.choice-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.segctl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-2);
  background: var(--surface-2);
}

.segctl label {
  position: relative;
  flex: 1 1 0;
  min-width: 44px;
}

.segctl input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segctl span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--r-1);
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 600;
  text-align: center;
}

.segctl input:checked + span {
  background: var(--surface);
  color: var(--text);
}

.segctl input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.segctl-2 label {
  flex: 1 1 calc(50% - 4px);
}

.box .segctl {
  margin-top: 4px;
  background: var(--surface);
}

.steps {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--text-3);
  font-size: var(--fs-2);
  font-weight: 600;
}

.steps .is-current {
  color: var(--text);
}

.steps .is-done {
  color: var(--ok);
}

.checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.checks svg {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

/* --- Pages d'état (attente, réussite, erreurs) ------------------------------ */

.state {
  padding: 24px 0;
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
}

.state-icon svg {
  width: 26px;
  height: 26px;
}

.state-icon.is-ok {
  color: var(--ok);
}

.state-icon.is-danger {
  color: var(--danger);
}

.state-icon.is-accent {
  color: var(--accent-text);
}

.state h1,
.state h2 {
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.3;
}

.state p {
  margin-top: 8px;
  color: var(--text-2);
}

.state .btn {
  margin-top: 20px;
}

.state .btn + .btn {
  margin-top: 8px;
}

.state .kv {
  margin-top: 20px;
  text-align: left;
}

.state ol {
  margin-top: 20px;
  text-align: left;
}

.state ol li {
  padding: 6px 0;
  color: var(--text-2);
  counter-increment: step;
}

.state ol li::before {
  content: counter(step) ". ";
  color: var(--text);
  font-weight: 700;
}

/* --- Pages de contenu (SEO et GEO) ----------------------------------------- */

.updated {
  margin-top: 8px;
  color: var(--text-3);
  font-size: var(--fs-1);
}

.prose {
  max-width: 680px;
  line-height: 1.65;
}

.prose h2 {
  margin: 32px 0 8px;
  font-size: var(--fs-4);
  font-weight: 700;
  line-height: 1.3;
}

.prose h3 {
  margin: 20px 0 4px;
  font-size: var(--fs-3);
  font-weight: 700;
}

.prose p,
.prose ul,
.prose ol {
  margin-top: 8px;
}

.prose ul {
  padding-left: 1.2em;
  list-style: disc;
}

.prose ol {
  padding-left: 1.4em;
  list-style: decimal;
}

.prose li + li {
  margin-top: 4px;
}

.prose a {
  color: var(--accent-text);
  text-decoration: underline;
}

.ph {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--warn-tint);
  color: var(--warn);
  font-weight: 600;
}

.table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: var(--fs-2);
}

.table th,
.table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--text-3);
  font-weight: 600;
}

.faq li {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg) translate(-2px, -2px);
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.faq-a {
  padding-bottom: 16px;
  color: var(--text-2);
}

/* Page d'une paire : sur téléphone, l'outil juste après le titre. */
.pair {
  display: grid;
  gap: 24px;
}

/* --- Tablette : navigation dans l'en-tête ---------------------------------- */

@media (min-width: 640px) {
  body {
    padding-bottom: 0;
  }

  .tabbar {
    display: none;
  }

  .header-end .header-login {
    display: inline-flex;
  }

  .nav {
    display: flex;
    gap: 36px;
  }

  .shell {
    padding: 0 24px;
  }

  /* Logo à gauche, menu au centre, compte à droite (demande du propriétaire). */
  .header .shell {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    min-height: 64px;
  }

  .nav {
    justify-self: center;
  }

  .nav a {
    font-size: var(--fs-3);
  }

  .header-end {
    justify-self: end;
    margin-left: 0;
  }

  .offer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer {
    grid-template-areas:
      "logo title btn"
      "logo text btn"
      "legal legal legal";
    align-items: center;
  }

  .offer-title {
    align-self: end;
  }

  .offer-text {
    align-self: start;
  }
}

/* --- Ordinateur : deux colonnes, texte agrandi ----------------------------- */

@media (min-width: 1024px) {
  :root {
    --fs-1: 0.8125rem; /* 13px */
    --fs-2: 0.9375rem; /* 15px */
    --fs-3: 1.0625rem; /* 17px */
    --fs-4: 1.5rem;    /* 24px */
    --fs-5: 2.5rem;    /* 40px */
  }

  .shell {
    padding: 0 32px;
  }

  .header .shell {
    min-height: 72px;
  }

  .logo svg {
    height: 34px;
  }

  .home-intro .title {
    font-size: 4rem;
  }


  .main {
    padding: 40px 0 64px;
  }

  .only-desktop {
    display: block;
  }

  .only-mobile {
    display: none;
  }

  .home {
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 32px 80px;
    align-items: center;
    padding: 32px 0 16px;
  }

  .home.has-offer > .tool {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .home.has-offer > .home-intro {
    align-self: end;
  }

  .home.has-offer > .offer {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    max-width: 520px;
  }

  .home-intro .lead {
    display: block;
  }

  .home-intro .lead {
    max-width: 520px;
    margin-top: 16px;
  }

  .result {
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  .result > :first-child {
    position: sticky;
    top: 24px;
  }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 80px;
    align-items: start;
  }

  .pair {
    grid-template-columns: minmax(0, 1fr) 460px;
    gap: 16px 80px;
    align-items: start;
  }

  .pair-tool {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 24px;
  }

  .pair .shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .acca-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
  }

  .shortcuts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 32px;
  }

  .footer .shell {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .live-dot,
  .rise,
  .rot.is-rotating b.is-on {
    animation: none;
  }

  .acca-link,
  .state-row {
    transition: none;
  }
}

/* --- Bouton du thème clair ou sombre (demande du propriétaire) -------------- */

.theme-form {
  display: inline-flex;
}

.theme-btn .ico-moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .ico-sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .theme-btn .ico-moon {
    display: inline;
  }
}

:root[data-theme="light"] .theme-btn .ico-sun {
  display: none;
}

:root[data-theme="light"] .theme-btn .ico-moon {
  display: inline;
}
