/* Parquet : une colonne de lecture, des chiffres hauts comme un tableau d'affichage de salle,
   des gris froids d'arène, et une seule teinte à soi, l'érable du parquet. Le reste de la couleur vient des équipes. */
:root {
  --bg: #F4F5F6;
  --surface: #FFFFFF;
  --sunk: #E9EBEE;
  --raised: #FFFFFF;
  --ink: #12161C;
  --ink-2: #545E6A;
  --ink-3: #7F8894;
  --line: #E0E3E7;
  --maple: #96590F;
  --live: #CF2A2A;
  --good: #17795A;
  --bad: #BF3535;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --nav-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1216; --surface: #181C22; --sunk: #1E232A; --raised: #333B45; --ink: #EDEFF2; --ink-2: #A5AEB9; --ink-3: #78818D; --line: #272D35;
    --maple: #E0A862; --live: #FF5F56; --good: #4ECB9D; --bad: #F2756E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1216; --surface: #181C22; --sunk: #1E232A; --raised: #333B45; --ink: #EDEFF2; --ink-2: #A5AEB9; --ink-3: #78818D; --line: #272D35;
  --maple: #E0A862; --live: #FF5F56; --good: #4ECB9D; --bad: #F2756E;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.4 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; }
small { font-size: inherit; }
:focus-visible { outline: 2px solid var(--maple); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#view {
  max-width: 560px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 28px);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

#banner {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) var(--gutter) 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  text-align: center;
}

/* ------------------------------------------------------------ navigation du bas */
#tabs {
  position: fixed;
  z-index: 10;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
#tabs a {
  flex: 0 1 186px;
  height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
}
#tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#tabs a[aria-current] { color: var(--ink); }
#tabs a[aria-current] svg { stroke: var(--maple); stroke-width: 1.9; }

/* ------------------------------------------------------------ titres */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding-top: 10px; }
.brand { font: 700 15px/1 var(--display); letter-spacing: .24em; text-transform: uppercase; color: var(--maple); }
.title { font: 600 38px/1.05 var(--display); letter-spacing: .005em; text-wrap: balance; }
.sub { color: var(--ink-2); font-size: 14px; min-height: 20px; }
.label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.label--live { color: var(--live); }
.label--fav { color: var(--maple); }
.section { margin-top: 28px; }
.note { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; margin-top: 10px; }
.hint { margin-top: 24px; color: var(--ink-2); font-size: 14px; }
.hint a { color: var(--maple); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; flex: none; color: var(--ink-2); }
.icon-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.bar { display: flex; align-items: center; gap: 4px; min-height: 52px; margin-left: -10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); }
.bar__title { font-weight: 500; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ bande des jours */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 2px; }
.pick { position: relative; overflow: hidden; }
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; }
.pick input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.days {
  display: flex;
  gap: 2px;
  margin: 14px calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: auto;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 46px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 10px;
  color: var(--ink-2);
}
.day span { font-size: 11.5px; text-transform: capitalize; }
.day b { font: 600 21px/1 var(--display); }
.day[aria-current="date"] { background: var(--ink); color: var(--bg); }

/* ------------------------------------------------------------ liste des matchs */
.games { display: flex; flex-direction: column; }
.game { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.game:last-child { border-bottom: 1px solid var(--line); }
.game__status {
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.game__status b { font-weight: 500; color: var(--ink-2); }
.game__status.is-live, .game__status.is-live b { color: var(--live); }
.game__status.is-live b::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.game__teams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.game__note { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.line { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.line__name { font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line__rec { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line__score { margin-left: auto; font: 600 27px/1 var(--display); font-variant-numeric: tabular-nums; }
.line--lost .line__name, .line--lost .line__score { color: var(--ink-3); }
.line--lost .line__score { font-weight: 500; }
.fav-mark { width: 13px; height: 13px; fill: var(--maple); flex: none; margin-left: -4px; }
.logo { flex: none; object-fit: contain; }
.bump { animation: bump 1.2s ease-out; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes bump { 0% { color: var(--maple); transform: scale(1.14); } 100% { transform: none; } }

.empty { padding: 56px 0; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty__title { font: 600 28px/1.1 var(--display); color: var(--ink); }
.btn { padding: 11px 20px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 500; }

.skeleton { margin-top: 28px; display: flex; flex-direction: column; gap: 22px; }
.skeleton div { height: 44px; border-radius: 8px; background: var(--sunk); }

/* ------------------------------------------------------------ fiche d'un match */
.hero {
  position: relative;
  margin-top: 4px;
  padding: 22px 12px 14px;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--away) 50%, var(--home) 50%);
}
.hero__teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 6px; }
.hero__team { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.hero__name { font-weight: 600; font-size: 15px; margin-top: 4px; }
.hero__rec { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hero__score { font: 700 58px/1 var(--display); margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero__score.is-lost { color: var(--ink-3); font-weight: 500; }
.hero__mid { padding-top: 20px; text-align: center; color: var(--ink-2); font-size: 13px; max-width: 76px; }
.hero__mid b { font-weight: 500; }
.hero__time { font: 600 26px/1 var(--display) !important; color: var(--ink); }
.hero__mid.is-live b { color: var(--live); font-weight: 600; }
.hero__at { display: none; }
.hero__date { margin-top: 14px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 6px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); font-weight: 400; }
.tbl thead th { border-top: 0; padding-top: 2px; padding-bottom: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .03em; }
.tbl th:first-child { text-align: left; padding-left: 0; }
.tbl .strong { font-weight: 600; }
.cell-team { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.tbl--quarters td:last-child { font: 600 20px/1 var(--display); }
.scroll-x { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.tbl--box th:first-child { position: sticky; left: 0; background: var(--bg); padding-left: var(--gutter); padding-right: 12px; font-weight: 500; }
.tbl--box td:last-child, .tbl--box th:last-child { padding-right: var(--gutter); }
.tbl--box td { min-width: 38px; }
.tbl--box tfoot th, .tbl--box tfoot td { color: var(--ink-2); font-weight: 500; }
.tbl__group th { font-size: 11.5px; font-weight: 600 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 14px; }
.tbl--log small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.log-opp { font-weight: 500; }
.res-w { color: var(--good); font-style: normal; font-weight: 600; }
.res-l { color: var(--bad); font-style: normal; font-weight: 600; }

.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1; }
.chart .cross { stroke: var(--ink); stroke-width: 1; }
.chart .avg { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tick { fill: var(--ink-3); font: 500 10.5px var(--text); }
.chart .val { fill: var(--ink); font: 600 13px var(--display); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart__read { margin-top: 8px; min-height: 18px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }

.leaders { display: flex; flex-direction: column; }
.leaders__row { display: grid; grid-template-columns: 1fr 58px 1fr; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.leaders__cat { text-align: center; color: var(--ink-3); font-size: 12px; }
.leader { display: flex; align-items: center; gap: 8px; min-width: 0; }
.leader--end { flex-direction: row-reverse; text-align: right; }
.leader__txt { display: flex; flex-direction: column; min-width: 0; }
.leader__txt b { font: 600 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.leader__txt span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.face { position: relative; display: inline-block; flex: none; overflow: hidden; border-radius: 50%; background: var(--sunk); }
.face::before { content: attr(data-initials); position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.face img { position: absolute; left: 50%; bottom: 0; height: 100%; max-width: none; transform: translateX(-50%); }

.compare { display: flex; flex-direction: column; gap: 13px; }
.compare__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.compare__head b { color: var(--ink); font-weight: 600; font-size: 14px; }
.compare__bar { display: flex; gap: 2px; height: 5px; margin-top: 5px; }
.compare__bar i { display: block; border-radius: 3px; }
.compare__bar i:last-child { flex: 1; }

.seg { display: flex; gap: 2px; padding: 3px; margin-bottom: 12px; border-radius: 10px; background: var(--sunk); }
.seg button { flex: 1; min-width: 0; height: 34px; padding: 0 2px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-selected="true"] { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); min-height: 56px; }
.rows li:last-child .row { border-bottom: 1px solid var(--line); }
.row__main { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__main small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.row__side { color: var(--ink-2); font-size: 12.5px; text-align: right; }
.row__side--alert { color: var(--bad); }
.row__value { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.row__num { width: 26px; text-align: right; font: 600 20px/1 var(--display); color: var(--ink-3); }
.rows--rank { counter-reset: rank; }
.rows--rank li { counter-increment: rank; }
.rows--rank .row::before { content: counter(rank); width: 16px; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.is-live { color: var(--live); }

.facts { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------ fiche joueur et équipe */
.phero {
  position: relative;
  margin-top: 4px;
  min-height: 186px;
  padding: 18px 16px 16px;
  overflow: hidden;
  border-radius: 14px;
  background: color-mix(in srgb, var(--team) 16%, var(--surface));
}
.phero__num { position: absolute; right: 8px; top: -18px; font: 700 150px/1 var(--display); color: var(--team); opacity: .16; }
.phero__img { position: absolute; right: -14px; bottom: 0; width: 196px; height: auto; }
.phero__txt { position: relative; display: flex; flex-direction: column; gap: 2px; max-width: 62%; }
.phero__first { font-size: 15px; color: var(--ink-2); }
.phero__last { font: 700 40px/1 var(--display); overflow-wrap: anywhere; }
.phero__team { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 500; }
.phero__meta { margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.alert { margin-top: 10px; color: var(--bad); font-size: 13.5px; font-weight: 500; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.tile { display: flex; flex-direction: column; padding-left: 14px; border-left: 1px solid var(--line); }
.tile:first-child { padding-left: 0; border-left: 0; }
.tile b { font: 700 46px/1 var(--display); font-variant-numeric: tabular-nums; }
.tile span { color: var(--ink-2); font-size: 13px; }
.tile em { color: var(--maple); font-size: 12px; font-style: normal; font-weight: 500; }

.thero { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; padding: 18px 16px; border-radius: 14px; background: color-mix(in srgb, var(--team) 14%, var(--surface)); }
.thero__txt { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.thero__name { font: 700 30px/1.02 var(--display); text-wrap: balance; }
.thero__rec { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.thero__coach { font-size: 12.5px; color: var(--ink-2); }

.star { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.star[aria-pressed="true"] { color: var(--maple); }
.star[aria-pressed="true"] svg { fill: currentColor; }
.thero .star { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.thero .star[aria-pressed="true"] { color: var(--maple); }

/* ------------------------------------------------------------ classement */
.tbl--standings th, .tbl--standings td { padding-left: 4px; padding-right: 4px; }
.tbl--standings .rank { width: 22px; text-align: right; color: var(--ink-3); font-size: 13px; padding-left: 0; }
.tbl--standings tbody th { text-align: left; width: 100%; max-width: 0; overflow: hidden; }
.tbl--standings thead th:nth-child(2) { width: 100%; }
.tbl--standings thead th:first-child, .tbl--standings tbody td:first-child { text-align: right; }
.tbl--standings .cell-team { display: flex; min-width: 0; }
.tbl--standings .cell-team span { overflow: hidden; text-overflow: ellipsis; }
.tbl--standings .is-fav .cell-team { color: var(--maple); }
.cell-star { width: 30px; }
.cell-star .star { vertical-align: middle; padding: 4px; margin: -4px; }
.tbl__cut td { padding: 12px 0 5px !important; text-align: left !important; border-top: 1px solid var(--line); }
.tbl__cut span { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* ------------------------------------------------------------ recherche */
.search { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 0 14px; height: 46px; border-radius: 10px; background: var(--sunk); color: var(--ink-3); }
.search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: 400 16px var(--text); }
.search input::placeholder { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
@media (min-width: 620px) {
  #tabs a { flex-basis: 150px; }
}
