[hidden] { display: none !important; }
:root { --bg: #f4f6fa; --card: #fff; --ink: #0B2D5B; --muted: #5b6878; --line: #dfe3ea; --blue: #0B6BE6; --teal: #06C1B7; --green: #10D08A; --red: #d64545; --gold: #f2b705; --soft: #eef3fb; --pos: #0a8f5f; }
@media (prefers-color-scheme: dark) { :root { --bg: #0d1420; --card: #162132; --ink: #e9eef6; --muted: #9aa8bb; --line: #26344a; --blue: #4f9bff; --soft: #1b2a40; --red: #ff7a7a; --pos: #3fd39a; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 100%/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.top { position: sticky; top: 0; z-index: 5; background: linear-gradient(120deg, #0B2D5B, #0F5FC4 70%, #06A9A0); color: #fff; }
.top-main { display: flex; align-items: center; gap: 8px; padding: 10px 14px; }
.retour[hidden] ~ .top-main { padding-top: calc(10px + env(safe-area-inset-top)); }
.top-main h1 { flex: 1; margin: 0; font-size: 1.1875rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { border: 0; background: rgba(255,255,255,.14); color: inherit; border-radius: 10px; min-width: 38px; height: 38px; font-size: 1.25rem; cursor: pointer; }
/* Barre de retour vers Quotizi : affichée seulement quand c'est pertinent (venue du site, ?de=quotizi, ou appli installée sans historique). Masquable d'un toucher, pour la session. */
.retour { box-sizing: content-box; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 28px; padding: 0 14px; padding-top: env(safe-area-inset-top); background: rgba(0,0,0,.18); font-size: .85rem; }
.retour a { color: #fff; text-decoration: none; font-weight: 700; }
.retour-x { border: 0; background: transparent; color: #fff; opacity: .75; cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.retour-x:active { opacity: 1; }
#lang { font-size: .8125rem; font-weight: 700; }
main { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(90px + env(safe-area-inset-bottom)); }
h2 { font-size: 1.0625rem; margin: 22px 0 8px; } h2:first-child { margin-top: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 650; background: var(--blue); color: #fff; cursor: pointer; }
.btn.line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
.btn.block { display: block; width: 100%; } .btn.sm { padding: 7px 11px; font-size: .875rem; border-radius: 10px; }
.btn:disabled { opacity: .45; }
.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 8px 24px rgba(11,45,91,.3); padding: 14px 26px; font-size: 1.0625rem; border-radius: 999px; z-index: 4; }
.games { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.game-tile { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px; cursor: pointer; }
.game-tile .e { font-size: 1.875rem; } .game-tile b { display: block; margin-top: 6px; } .game-tile span { font-size: .8125rem; color: var(--muted); }
.game-tile.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue) inset; }
.list-item { display: flex; gap: 12px; align-items: center; cursor: pointer; width: 100%; text-align: left; color: inherit; }
.list-item .e { font-size: 1.625rem; } .list-item .line { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 11px; font-size: .875rem; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .x { margin-left: 6px; opacity: .7; border: 0; background: transparent; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.chip .x:focus-visible { opacity: 1; outline-color: var(--gold); }
label.f { display: block; margin: 10px 0; } label.f > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.in { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; } .seg button { flex: 1 1 auto; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 10px; cursor: pointer; font-size: .9rem; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 650; }
.board { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tot { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.tot .n { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tot .v { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tot.lead { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.tot.out { opacity: .45; } .tot .sub { font-size: .75rem; color: var(--muted); }
.bar { height: 6px; background: var(--soft); border-radius: 4px; overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); }
table.rounds { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
table.rounds th, table.rounds td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--line); }
table.rounds th:first-child, table.rounds td:first-child { text-align: left; color: var(--muted); }
table.rounds td .c { display: block; font-size: .72rem; color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--red); }
.win { background: linear-gradient(120deg, #fff4d6, #e9fbf4); color: #0B2D5B; border: 0; text-align: center; }
.win .big { font-size: 1.375rem; font-weight: 800; margin: 4px 0; }
.win .btn.line { color: #0B2D5B; border-color: #0B2D5B; }
.sheet-bg { position: fixed; inset: 0; background: rgba(5,15,30,.5); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 6px; font-size: 1.1875rem; }
.preview { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-size: .9rem; }
.preview:empty { display: none; }
.err { color: var(--red); font-size: .875rem; min-height: 1em; }
.num { display: flex; align-items: center; gap: 6px; } .num .in { text-align: center; font-size: 1.25rem; font-weight: 700; padding: 8px; }
.num button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 1.25rem; cursor: pointer; flex: none; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #0B2D5B; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 40; font-size: .9rem; max-width: 90vw; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); } .empty .e { font-size: 2.5rem; }
.foot { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 26px; }
.foot a { color: inherit; }
.rule { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.quick { display: flex; gap: 8px; margin: 10px 0 0; } .quick .in { flex: 1; }

/* Mode table : plein écran, noir sur blanc inversé, gros chiffres, pas de menu. Même en plein soleil, même de loin. */
.table { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); }
.table .tm-head { font-size: 1.1rem; font-weight: 700; text-align: center; }
.table:not([hidden]) ~ .toast { bottom: auto; top: calc(12px + env(safe-area-inset-top)); background: #ffd600; color: #000; font-weight: 700; }
.table .tm-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.table .tm-side { border: 3px solid #fff; border-radius: 18px; padding: 10px; text-align: center; background: #000; }
.table .tm-side.lead { border-color: #ffd600; }
.table .tm-side.out { opacity: .4; }
.table .tm-name { font-size: 1.25rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .tm-total { font-size: clamp(3rem, 16vw, 6.5rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.table .tm-sub { font-size: 1rem; color: #bbb; margin-top: 6px; }
.table .tm-in { margin-top: 8px; font-size: 2rem; font-weight: 800; text-align: center; background: #111; color: #fff; border: 2px solid #999; border-radius: 12px; padding: 8px; -moz-appearance: textfield; }
.table .tm-in::-webkit-outer-spin-button, .table .tm-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.table .tm-in:focus { border-color: #ffd600; outline: none; box-shadow: 0 0 0 3px rgba(255,214,0,.4); }
.table .tm-label { display: block; font-size: 1rem; font-weight: 700; margin: 6px 0 -2px; }
.table .tm-hint { margin: 4px 0; font-size: .9rem; color: #bbb; }
.table .tm-extra { display: flex; flex-direction: column; gap: 8px; }
.table .seg button { background: #111; color: #fff; border: 2px solid #777; font-size: 1.05rem; padding: 12px 10px; } .table .seg button.on { background: #ffd600; color: #000; border-color: #ffd600; font-weight: 800; }
.table .preview { background: #1a1a1a; color: #fff; font-size: 1.05rem; margin: 0; } .table .preview .muted { color: #bbb; }
.table .err { color: #ff6b6b; font-size: 1.05rem; text-align: center; margin: 0; }
.table .tm-ok { font-size: 1.5rem; padding: 18px; background: #1dbb6a; color: #000; border: 0; border-radius: 16px; width: 100%; font-weight: 800; cursor: pointer; }
.table .tm-btn { font-size: 1.05rem; padding: 14px; background: #222; color: #fff; border: 2px solid #777; border-radius: 12px; flex: 1; cursor: pointer; }
.table .tm-btn:disabled { opacity: .4; }
.table .tm-win { background: #ffd600; color: #000; border-radius: 16px; padding: 14px; text-align: center; font-size: 1.5rem; font-weight: 800; }
.table :focus-visible { outline: 3px solid #ffd600; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .table .tm-total { transition: transform .15s; } }
