/* TSF Genève — charte : marine #10263E, bordeaux #971438, blanc, fond #F5F6F9 */
:root {
  --navy: #10263E; --navy-2: #1B3A5C; --bordeaux: #971438; --bordeaux-2: #B51E48;
  --bg: #F5F6F9; --card: #FFFFFF; --line: #E2E6EE; --muted: #5B6B80; --text: #10263E;
  --ok: #1F7A4D; --ok-bg: #E5F4EC; --warn: #8A5A00; --warn-bg: #FFF4D6; --err: #B42318; --err-bg: #FDECEA;
  --info-bg: #E8EEF6; --radius: 14px; --shadow: 0 1px 2px rgba(16,38,62,.06), 0 4px 14px rgba(16,38,62,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", var(--font);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--bordeaux); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bordeaux-2); outline-offset: 2px; border-radius: 6px; }
.num, .tab { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: .75rem; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: .55rem 1rem; display: flex; align-items: center; gap: .75rem; padding-top: max(.55rem, env(safe-area-inset-top)); }
.topbar .logo { height: 38px; width: auto; display: block; }
.topbar .ed { font-size: .78rem; color: var(--muted); line-height: 1.2; }
.pill { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .2rem .6rem; font-size: .78rem; font-weight: 600; background: var(--info-bg); color: var(--navy); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.pill.bx { background: var(--bordeaux); color: #fff; }
.pill.navy { background: var(--navy); color: #fff; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Mise en page publique ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(88px + var(--safe-b)); }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; margin: 0; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.25rem 0 .6rem; }
.section-title h2 { text-transform: uppercase; font-size: 1rem; letter-spacing: .06em; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card + .card { margin-top: .75rem; }
.hero { background: var(--navy); color: #fff; border-radius: 18px; padding: 1.25rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 18px solid rgba(151,20,56,.55); }
.hero .kicker { display: inline-block; background: var(--bordeaux); padding: .2rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero h1 { font-size: 1.9rem; line-height: 1.05; margin: .6rem 0 .3rem; text-transform: uppercase; position: relative; z-index: 1; }
.hero p { margin: 0; color: #D5DEEA; position: relative; z-index: 1; }
.dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; position: relative; z-index: 1; }
.dates div { background: rgba(255,255,255,.08); border-radius: 10px; padding: .5rem; }
.dates b { display: block; font-size: .95rem; }
.dates span { font-size: .72rem; color: #BFCADA; text-transform: uppercase; letter-spacing: .04em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: .7rem; text-align: center; }
.stat b { display: block; font-size: 1.4rem; font-family: var(--display); }
.stat span { font-size: .75rem; color: var(--muted); }
.ann { border-left: 4px solid var(--navy); }
.ann.important { border-left-color: var(--bordeaux); }
.ann.postponement { border-left-color: var(--warn); background: var(--warn-bg); }
.ann h3 { margin-bottom: .25rem; }
.ann p { margin: 0; white-space: pre-line; }

/* ---------- Filtres ---------- */
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .6rem 0; }
.field { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, input.input, select.input, textarea.input { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; background: #fff; font-size: 1rem; color: var(--text); font-weight: 400; width: 100%; }
.search { grid-column: 1 / -1; }

/* ---------- Liste des matchs ---------- */
.day { font-weight: 700; text-transform: capitalize; margin: 1rem 0 .5rem; color: var(--muted); font-size: .85rem; letter-spacing: .03em; }
.match { display: grid; grid-template-columns: 58px 1fr auto; gap: .75rem; align-items: center; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: .7rem .8rem; border: 0; width: 100%; text-align: left; }
.match + .match { margin-top: .5rem; }
.match .time { font-weight: 700; font-size: 1rem; }
.match .meta { font-size: .72rem; color: var(--muted); }
.match .teams { display: grid; gap: .15rem; min-width: 0; }
.match .team { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.match .team span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .team.win span:first-child { color: var(--navy); }
.match .team.lose { color: var(--muted); font-weight: 500; }
.match .score { font-weight: 800; min-width: 1.2rem; text-align: right; }
.match .fav { color: var(--bordeaux); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 5px; background: var(--info-bg); color: var(--navy); }
.tag.bx { background: #F6E3E9; color: var(--bordeaux); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--err-bg); color: var(--err); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty b { display: block; color: var(--text); margin-bottom: .25rem; }

/* ---------- Classement ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.std { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
table.std th { background: var(--navy); color: #fff; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; padding: .55rem .4rem; text-align: center; position: sticky; top: 0; }
table.std th.l, table.std td.l { text-align: left; }
table.std td { padding: .6rem .4rem; text-align: center; border-bottom: 1px solid var(--line); }
table.std tr:last-child td { border-bottom: 0; }
table.std td.rank { font-weight: 800; width: 2.2rem; }
table.std td.team { font-weight: 600; min-width: 9rem; }
table.std td.pts { font-weight: 800; color: var(--bordeaux); }
table.std tr.is-fav td.team::before { content: "★ "; color: var(--bordeaux); }
.legend { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.banner { border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; margin: .6rem 0; display: block; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--navy); }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Navigation basse ---------- */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 60px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.bottomnav a[aria-current="page"] { color: var(--bordeaux); }
.bottomnav svg { width: 24px; height: 24px; }

/* ---------- Feuille de détail ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(16,38,62,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 1.1rem 1.1rem calc(1.2rem + var(--safe-b)); max-height: 90vh; overflow: auto; }
.sheet .close { float: right; border: 0; background: var(--bg); border-radius: 999px; width: 40px; height: 40px; font-size: 1.2rem; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; text-align: center; margin: 1rem 0; }
.scoreboard .t { font-weight: 700; font-size: 1.05rem; }
.scoreboard .s { font-size: 2.4rem; font-weight: 800; font-family: var(--display); font-variant-numeric: tabular-nums; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; text-decoration: none; color: var(--navy); }
.btn.primary { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--err); border-color: #F3C4BF; }
.btn.sm { min-height: 40px; padding: .4rem .8rem; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.star { border: 0; background: none; font-size: 1.5rem; color: var(--bordeaux); min-width: 44px; min-height: 44px; }

/* ---------- Écran projection ---------- */
.screen { background: var(--navy); color: #fff; min-height: 100vh; padding: 2vw 3vw; }
.screen header { display: flex; align-items: center; gap: 2vw; margin-bottom: 3vw; }
.screen header .logo-box { background: #fff; border-radius: 12px; padding: .6vw 1vw; }
.screen header img { height: 5vw; min-height: 40px; display: block; }
.screen h1 { font-size: 3.2vw; text-transform: uppercase; }
.screen .clock { margin-left: auto; font-size: 3vw; font-weight: 800; font-variant-numeric: tabular-nums; }
.screen table.std { font-size: 2vw; margin-top: 0; background: #fff; color: var(--navy); border-radius: 14px; overflow: hidden; }
.screen table.std th { font-size: 1.3vw; background: var(--bordeaux); }
.screen .foot { margin-top: 1.5vw; font-size: 1.2vw; color: #BFCADA; }

/* ---------- Accessibilité / mouvement ---------- */
@media (prefers-reduced-motion: no-preference) {
  .flash { animation: flash 1.2s ease-out; }
  @keyframes flash { from { background: #FFF1C2; } to { background: #fff; } }
}
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(4, 1fr); }
  .search { grid-column: span 4; }
}
.mt { margin-top: .75rem; } .mt-s { margin-top: .6rem; } .mt-l { margin-top: 1.25rem; } .jsb { justify-content: space-between; }
.sub { margin: .7rem 0 .4rem; }

/* ---------- Finales ---------- */
.seg { display: inline-grid; grid-auto-flow: column; background: #E6EAF1; border-radius: 12px; padding: 3px; gap: 3px; }
.seg a { padding: .5rem 1.1rem; border-radius: 9px; text-decoration: none; color: var(--navy); font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.seg a[aria-selected="true"] { background: #fff; box-shadow: var(--shadow); color: var(--bordeaux); }
.finals-cta { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--navy); border-left: 5px solid var(--bordeaux); }
.kicker-bx { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bordeaux); }
.bracket { display: flex; gap: .8rem; overflow-x: auto; padding: .25rem .1rem 1rem; scroll-snap-type: x proximity; }
.bcol { flex: 0 0 236px; display: flex; flex-direction: column; scroll-snap-align: start; }
.bcol h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
.bstack { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: .6rem; }
.bcard { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; box-shadow: var(--shadow); position: relative; }
.r-final .bcard { border: 2px solid var(--bordeaux); }
.bcard .bm { font-size: .68rem; color: var(--muted); margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl { display: flex; justify-content: space-between; gap: .4rem; padding: .15rem 0; font-size: .88rem; }
.bl .bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bl .bn.tbd { color: var(--muted); font-style: italic; font-weight: 500; }
.bl .bs { font-weight: 800; }
.bl.win .bn { color: var(--navy); font-weight: 800; }
.bl.win .bn::after { content: " ✓"; color: var(--ok); }
.bl.lose { color: var(--muted); }
.bl.lose .bn { font-weight: 500; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: .5rem; align-items: end; }
.podium > div { background: var(--navy); color: #fff; border-radius: 14px 14px 6px 6px; padding: .8rem .5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.podium .p1 { background: var(--bordeaux); padding-top: 1.3rem; padding-bottom: 1.3rem; }
.podium b { font-size: .92rem; line-height: 1.2; }
.podium small { font-size: .68rem; opacity: .85; }
.podium .medal { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--navy); font-weight: 800; display: grid; place-items: center; }
.podium .p1 .medal { color: var(--bordeaux); }
.page.wide { max-width: 1180px; }
@media (min-width: 1000px) { .bcol { flex: 1 1 220px; min-width: 200px; } }
main:focus { outline: none; }

/* ---------- Fair-play ---------- */
.fp-award { background: #fff; border-radius: 16px; box-shadow: var(--shadow); border-left: 6px solid var(--bordeaux); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.fp-award b { font-size: 1.35rem; font-family: var(--display); }
.fp-award small { color: var(--muted); }
table.std tr.fp-win td { background: #FBEFF3; }

/* Écran géant : réglages */
.scr-f { border: 0; padding: 0; margin: 0; }
.scr-f legend { font-weight: 700; font-size: .9rem; margin-bottom: .4rem; }
.chip-check { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; }
.chip-check input { width: 20px; height: 20px; }
#scr code { word-break: break-all; font-size: .8rem; }
.screen .scr-exit { color: #BFCADA; text-decoration: underline; }
