@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;800&family=Barlow:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #0E1420; --surface: #17202F; --line: #26324A;
  --paper: #F7F3E6; --paper-ink: #22201A; --paper-muted: #7A7466;
  --green: #2FBF71; --red: #E4574C; --amber: #E8A33D; --gold: #D9B44A;
  --text: #E8ECF3; --muted: #8B94A7;
  --board-top: #121A2A;
  --shadow: rgba(0,0,0,0.35);
  --logo-bg: rgba(255,255,255,0.06);
  --scrim: rgba(8,12,20,0.75);
}
* { box-sizing: border-box; margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: 'Barlow', sans-serif; padding-bottom: 130px; }
a { color: var(--gold); }

/* — Tableau de bord — */
.board { padding: calc(16px + env(safe-area-inset-top)) 16px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--board-top) 0%, var(--bg) 100%); }
.brandrow { display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: 'Barlow Condensed'; font-weight: 800; font-size: 26px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); text-decoration: none; }
.brand span { color: var(--gold); }
.who { font-size: 13px; color: var(--muted); }
.bank { text-align: center; margin-top: 12px; }
.bank-v { font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.bank-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; text-align: center; }
.kpi .v { font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 15px; }
.kpi .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 3px; }
.pos { color: var(--green); } .neg { color: var(--red); }

/* — Journal — */
.day { padding: 14px 16px 0; }
.dayhead { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; gap: 12px; }
.dayhead .dayname { flex: none; white-space: nowrap; }
.dayname { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 17px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.dayprofit { font-family: 'IBM Plex Mono'; font-size: 13px; font-weight: 600; }

/* — Ticket — */
.ticket { background: var(--paper); color: var(--paper-ink); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden; box-shadow: 0 2px 8px var(--shadow); position: relative; }
.ticket .top { padding: 12px 14px 10px; }
.ticket .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--paper-muted); padding-right: 56px; }
.ticket .event { font-weight: 600; font-size: 16px; margin-top: 5px; line-height: 1.25; }
.ticket .bettype { font-size: 13px; color: var(--paper-muted); margin-top: 2px; }
.perf { border-top: 2px dashed #CFC8B4; position: relative; }
.perf::before, .perf::after { content: ''; position: absolute; top: -8px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); }
.perf::before { left: -8px; } .perf::after { right: -8px; }
.ticket .bottom { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.nums { display: flex; gap: 18px; font-family: 'IBM Plex Mono'; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.nums .lbl { display: block; font-family: 'Barlow'; font-weight: 500; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-muted); }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 99px; color: #fff; white-space: nowrap; }
.actions { display: flex; gap: 6px; padding: 0 14px 12px; }
.actions form { flex: 1; display: flex; }
.abtn { flex: 1; padding: 8px 0; border-radius: 7px; border: none; cursor: pointer;
  font-family: 'Barlow Condensed'; font-weight: 600; font-size: 14px; text-transform: uppercase;
  letter-spacing: 0.05em; color: #fff; }
.icons { position: absolute; top: 8px; right: 10px; display: flex; gap: 2px; }
.icons button { background: none; border: none; color: #A89F87; font-size: 15px; cursor: pointer;
  line-height: 1; padding: 4px 5px; }
.icons button:hover { color: var(--paper-ink); }

/* — Boutons & navigation — */
.fab { position: fixed; bottom: calc(72px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #1A1508; border: none; border-radius: 99px;
  padding: 13px 26px; font-family: 'Barlow Condensed'; font-weight: 800; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
  box-shadow: 0 4px 16px rgba(217,180,74,0.4); z-index: 5; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--surface);
  border-top: 1px solid var(--line); z-index: 6; }
.nav a { flex: 1; text-align: center; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  color: var(--muted); text-decoration: none; font-family: 'Barlow Condensed';
  text-transform: uppercase; font-weight: 600; font-size: 15px; letter-spacing: 0.06em; }
.nav a.on { color: var(--gold); }

/* — Modal / formulaires — */
.overlay { position: fixed; inset: 0; background: var(--scrim); display: none;
  align-items: flex-end; justify-content: center; z-index: 10; }
.overlay.open { display: flex; }
.sheet { background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  width: 100%; max-width: 520px; border-top: 1px solid var(--line); max-height: 88vh; overflow-y: auto; }
.sheet h2 { font-family: 'Barlow Condensed'; font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.field { margin-bottom: 11px; }
.field label { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 11px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-family: 'Barlow'; font-size: 16px; }
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.submit { width: 100%; margin-top: 6px; padding: 13px; border-radius: 9px; border: none;
  background: var(--gold); color: #1A1508; font-family: 'Barlow Condensed'; font-weight: 800;
  font-size: 18px; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; }
.cancel { width: 100%; margin-top: 8px; padding: 10px; border-radius: 9px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: 'Barlow'; font-size: 14px; cursor: pointer; }

/* — Cartes & listes — */
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty .big { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 20px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin-bottom: 6px; }
/* Les cartes du site utilisent .papercard (fond beige, découpe ticket),
   défini plus bas. .statcard a été retiré : plus aucun appelant. */
.srow { display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; gap: 10px; }
.srow:last-child { border-bottom: none; }
.srow .mono { font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 13px; white-space: nowrap; }
.srow .sub { display: block; font-size: 12px; color: var(--muted); }
.chartbox { position: relative; width: 100%; height: 210px; }
.flash { margin: 12px 16px 0; padding: 11px 14px; border-radius: 9px; font-size: 14px; }
.flash.ok { background: rgba(47,191,113,0.12); border: 1px solid rgba(47,191,113,0.4); color: #7FE0AE; }
.flash.err { background: rgba(228,87,76,0.12); border: 1px solid rgba(228,87,76,0.4); color: #F0968E; }

/* — Caisse — */
.cashgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 16px 4px; }
.cashbtn { padding: 14px; border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Barlow Condensed'; font-weight: 800; font-size: 17px; text-transform: uppercase;
  letter-spacing: 0.05em; color: #fff; }

/* — Auth — */
.authwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.authcard { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 22px; }
.authcard .brand { display: block; text-align: center; font-size: 30px; margin-bottom: 4px; }
.authcard .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.authcard .alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* ============================================================
   Ajouts JadalStats — étendent le design existant sans le modifier
   (mêmes variables, mêmes polices, même esprit visuel)
   ============================================================ */

/* — Barre de recherche dans le board — */
.searchform { display: flex; gap: 8px; margin-top: 14px; }
.searchbox { flex: 1; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-family: 'Barlow'; font-size: 15px; }
.searchbox::placeholder { color: var(--muted); }
.searchbox:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.searchbtn { padding: 0 16px; border-radius: 8px; border: none; background: var(--gold);
  color: #1A1508; font-family: 'Barlow Condensed'; font-weight: 800; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }

/* — Onglets de jour — */
.daytabs { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 0; scrollbar-width: none; }
.daytabs::-webkit-scrollbar { display: none; }
.daytab { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); text-decoration: none;
  font-family: 'Barlow Condensed'; font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.daytab.on { background: var(--gold); border-color: var(--gold); color: #1A1508; }

/* — Barre de filtres — */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px 0; }
.filterbar select { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-family: 'Barlow'; font-size: 13px;
  max-width: 47%; }
.clearfilter { font-size: 12px; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: 'Barlow'; }

.resultcount { padding: 10px 16px 0; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; }

/* — En-tête de championnat dans la liste — */
.leaguehead { display: flex; align-items: baseline; gap: 7px; padding: 12px 16px 6px; }
.leaguehead .flag { font-size: 15px; }
.leaguehead .leaguename { font-family: 'Barlow Condensed'; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.leaguehead .leaguecountry { font-size: 11px; color: var(--muted); }

/* — Carte de match (réutilise .ticket) — */
a.matchcard { display: block; text-decoration: none; margin: 0 16px 10px; }
.matchcard .vs { color: var(--paper-muted); font-weight: 500; padding: 0 3px; }
.matchcard .nums { justify-content: space-between; width: 100%; gap: 10px; }

/* — Pagination — */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px;
  padding: 18px 16px 8px; }
.pagination a { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--gold); text-decoration: none;
  font-family: 'Barlow Condensed'; font-weight: 600; text-transform: uppercase; font-size: 13px; }
.pageinfo { font-size: 13px; color: var(--muted); font-family: 'IBM Plex Mono'; }

/* — En-tête de page match — */
.matchhead { padding: 16px 16px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--board-top) 0%, var(--bg) 100%); }
.backlink { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px;
  margin-bottom: 10px; font-family: 'Barlow'; }
.mh-league { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mh-league .flag { font-size: 16px; }
.mh-country { color: var(--muted); }
.mh-teams { font-family: 'Barlow Condensed'; font-weight: 800; font-size: 24px;
  margin-top: 4px; line-height: 1.2; }
.mh-teams .vs { color: var(--muted); padding: 0 6px; font-weight: 500; }
.mh-when { font-size: 13px; color: var(--muted); margin-top: 4px; font-family: 'IBM Plex Mono'; }
.mh-badge { display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; }

/* — Barre de forme — */
.formerow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.formelabel { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.formelabel .sub { display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); font-weight: 500; margin-top: 1px; }
.formebar { height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.formefill { height: 100%; border-radius: 99px; }
.formeval { font-size: 12px; margin-top: 5px; }

.disclaimer { margin: 4px 16px 20px; font-size: 12px; color: var(--muted); line-height: 1.5;
  text-align: center; padding: 0 8px; }

/* — Historique / archive (encadré vert) — */
.archivenotice { margin: 14px 16px 0; padding: 12px 14px; border-radius: 9px;
  background: rgba(47,191,113,0.10); border: 1px solid rgba(47,191,113,0.35);
  color: #9FE6BF; font-size: 12.5px; line-height: 1.5; }

/* .matchcard-past : contour vert retiré — les cartes passées gardent le style standard */

/* .matchhead-past : bordure verte retirée — l'en-tête garde le style standard */
.mh-archivenote { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* .stats-past .statcard : cadre vert retiré — les sections gardent le style standard */

/* — Score réel affiché sur les cartes historique — */
.scorebadge { display: inline-block; margin: 0 6px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--green); color: var(--green);
  font-size: 13px; font-weight: 700; }
/* Sur la fiche match, le score s'aligne sur la typographie de l'en-tête (noms d'équipes) */
.mh-teams .scorebadge { font-family: 'Barlow Condensed'; font-weight: 800;
  font-size: 22px; padding: 1px 10px; vertical-align: 1px; }

/* — Indicateurs de fiabilité (page dédiée) — */
.reliability-hero { padding: 18px 16px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.reliability-score { font-family: 'Barlow Condensed'; font-weight: 800; font-size: 44px; color: var(--green); line-height: 1; }
.reliability-sub { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.reliability-threshold { display: inline-block; margin-top: 9px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold); font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: 0.04em; }
.archivenotice .mn, .dayhead .mn { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.dayhead .mn { text-transform: none; letter-spacing: 0; }
.marketrow { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.marketrow .mlabel { flex: 1; font-size: 13px; }
.marketrow .mn { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono'; }
.marketbar { width: 70px; height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; flex: 0 0 auto; }
.marketbar > div { height: 100%; border-radius: 99px; }
.marketpct { width: 46px; text-align: right; font-family: 'IBM Plex Mono'; font-size: 13px; font-weight: 600; }
/* Numéro de rang dans les classements de fiabilité */
.mrank { display: inline-block; min-width: 16px; margin-right: 6px; font-family: 'IBM Plex Mono';
  font-size: 11px; font-weight: 700; color: var(--gold); }

/* — Comparatif prédiction/réel sur la fiche match — */
.cmprow { display: flex; align-items: center; gap: 8px; }
.cmpicon { width: 18px; text-align: center; font-size: 13px; flex: 0 0 auto; }

/* — Logos d'équipes (badges API) — */
.teamlogo { vertical-align: -4px; margin-right: 5px; border-radius: 3px;
  object-fit: contain; background: var(--logo-bg); }
.ticket .event .teamlogo { vertical-align: -3px; }
.mh-teams .teamlogo { vertical-align: -2px; margin-right: 7px; }

/* — Confrontations directes (H2H) — */
.h2hbilan { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0 2px; }
.h2hbilan .h2hteam { flex: 1; min-width: 0; font-family: 'Barlow Condensed'; font-weight: 700;
  font-size: 15px; text-align: right; line-height: 1.15; }
.h2hbilan .h2hteam-a { text-align: left; }
.h2hbilan .h2htally { font-family: 'IBM Plex Mono'; font-weight: 600; font-size: 18px;
  color: var(--gold); white-space: nowrap; }
.h2hlegend { text-align: center; font-size: 11px; margin: 2px 0 4px; }
.h2hlist { margin-top: 6px; }
.h2hline { font-family: 'Barlow'; font-size: 12px; color: var(--muted);
  padding: 5px 0; border-bottom: 1px solid var(--line); }
.h2hline:last-child { border-bottom: none; }

/* — Bilan de journée dans l'historique — */
.daysum { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap;
  overflow-x: auto; scrollbar-width: none; }
.daysum::-webkit-scrollbar { display: none; }
.daysum > span { flex: none; }
.daysum strong { color: inherit; font-weight: 700; }
.daysum .daysum-pct { margin-left: auto; font-weight: 700; font-size: 12px;
  font-variant-numeric: tabular-nums; }



/* — Carte papier (fond beige), même matière que les tickets de la liste — */
/* Les variables sont redéfinies DANS la carte : tout ce qu'elle contient — y
   compris le SVG du graphique — s'adapte au fond clair sans code spécifique.
   Les accents reprennent les teintes sombres du thème clair, les couleurs vives
   du thème sombre étant illisibles sur beige. */
.papercard {
  background: var(--paper); color: var(--paper-ink);
  border-radius: 10px; padding: 14px; margin: 0 16px 12px;
  box-shadow: 0 2px 8px var(--shadow);
  position: relative; overflow: visible;
  --text: var(--paper-ink);
  --muted: var(--paper-muted);
  --line: #CFC8B4;
  --surface: var(--paper);
  --gold: #7F620D; --green: #16743F; --red: #C33A2E; --amber: #8E6110;
}
/* Le titre porte la découpe du ticket : ligne perforée + encoches latérales.
   Les pseudo-éléments sont en position absolue, donc hors du flux flex du titre
   (un flex item viendrait sinon s'insérer entre le libellé et le compteur).
   Décalage de -22px = 14px de padding de carte + 8px de demi-encoche. */
.papercard h3 { font-family: 'Barlow Condensed'; font-weight: 600; font-size: 16px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper-muted);
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  position: relative; padding-bottom: 11px; margin-bottom: 12px;
  border-bottom: 2px dashed #CFC8B4; }
.papercard h3::before, .papercard h3::after { content: ''; position: absolute;
  bottom: -9px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); }
.papercard h3::before { left: -22px; }
.papercard h3::after  { right: -22px; }
.papercard h3 .mn { font-family: 'IBM Plex Mono'; font-size: 11px; letter-spacing: 0;
  text-transform: none; font-weight: 500; flex: none; }
.papercard .srow { border-bottom: 1px solid #E3DCC7; }
.papercard .srow:last-child { border-bottom: none; }
.papercard .marketrow:last-child { border-bottom: none; }
.papercard .archivenotice { background: transparent; border: none; padding: 8px 0 0;
  color: var(--paper-muted); }
