/* LEGION Live — DA du club : noir profond, or du logo, angles biseautés, losanges.
   Mise en page : colonne unique mobile (720px max), cartes biseautées pour ce qui compte, listes sobres pour le reste. */
:root {
  color-scheme: dark;
  --bg: #090806;
  --surface: #110F0C;
  --surface-2: #18150F;
  --surface-3: #231F18;
  --line: rgba(183,143,88,.14);
  --line-2: rgba(183,143,88,.36);
  --gold: #B78F58;
  --gold-hi: #D6B37C;
  --gold-soft: rgba(183,143,88,.13);
  --text: #EFEBE4;
  --muted: #9C9486;
  --faint: #635C51;
  --loss: #D9483B;
  --loss-soft: rgba(217,72,59,.14);
  --draw: #D8D2C7;
  --draw-soft: rgba(216,210,199,.1);
  --live: #E8382D;
  --live-soft: rgba(232,56,45,.16);
  --cut: 16px;
  --display: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Saira", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overscroll-behavior-y: contain;
  background: radial-gradient(120% 60% at 50% -10%, #17130D 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 1.5px solid var(--gold-hi); outline-offset: 2px; }

/* ------------------------------------------------------------- motifs */
.frame {
  --c: var(--cut);
  position: relative; padding: 1px; background: var(--line-2);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.frame > .in {
  background: var(--surface);
  clip-path: polygon(calc(var(--c) - .5px) 0, 100% 0, 100% calc(100% - var(--c) + .5px), calc(100% - var(--c) + .5px) 100%, 0 100%, 0 calc(var(--c) - .5px));
}
.frame.live { background: linear-gradient(135deg, var(--live), rgba(232,56,45,.35) 55%, var(--line-2)); }
.frame.gold { background: linear-gradient(135deg, var(--gold-hi), var(--line-2) 50%, var(--gold)); }
.diamond { display: inline-block; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); flex-shrink: 0; }
.diamond.fill { background: var(--gold); }

/* ------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(9,8,6,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { height: 30px; width: auto; }
.brand-name { font: 500 15px/1 var(--body); letter-spacing: .48em; color: var(--gold); margin-right: -.48em; }
.brand-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 7px; margin-left: 4px;
  background: var(--live); color: #fff; font: 700 11.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.brand-live i, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.75);} }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.updated { font: 500 11.5px/1 var(--body); color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 4px; letter-spacing: .04em; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { color: var(--gold-hi); }
.icon-btn.on { color: var(--gold-hi); }
.bell-dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; background: var(--gold-hi); transform: rotate(45deg); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- layout */
.app { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(48px + var(--safe-bottom)); }
.view { animation: rise .3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

.sect { display: flex; align-items: center; gap: 12px; margin: 30px 2px 12px; }
.sect h2 { margin: 0; font: 600 12.5px/1.3 var(--body); letter-spacing: .34em; text-transform: uppercase; color: var(--gold); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sect::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.sect small { order: 3; font: 500 12px/1 var(--body); color: var(--faint); white-space: nowrap; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.sect::after { min-width: 12px; }
.sect.live h2 { color: var(--live); }
.sect:first-child { margin-top: 8px; }

.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px -4px; padding: 6px 6px; color: var(--muted); font: 500 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.back:active { color: var(--gold-hi); }
.overline { font: 600 11px/1.3 var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.overline b { color: var(--gold); font-weight: 600; }

/* ---------------------------------------------------------- team card */
.team-card { display: block; margin-bottom: 14px; transition: transform .15s ease; }
.team-card:active { transform: scale(.985); }
.team-card .in { padding-bottom: 2px; }
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 6px; }
.tc-name { font: 800 32px/.95 var(--display); text-transform: uppercase; letter-spacing: .02em; margin-top: 8px; }
.tc-rank { text-align: right; flex-shrink: 0; }
.rank-big { font: 800 34px/1 var(--display); color: var(--gold-hi); }
.rank-big sup { font-size: 14px; margin-left: 1px; color: var(--gold); }
.rank-sub { font: 500 12px/1.2 var(--body); color: var(--muted); margin-top: 4px; letter-spacing: .04em; white-space: nowrap; }
.form { display: flex; gap: 4px; justify-content: flex-end; margin-top: 7px; }
.form span { width: 19px; height: 19px; display: grid; place-items: center; font: 700 11px/1 var(--display); }
.f-W { background: var(--gold-soft); color: var(--gold-hi); }
.f-L { background: var(--loss-soft); color: var(--loss); }
.f-D { background: var(--draw-soft); color: var(--draw); }

.hero { margin: 12px 12px 12px; padding: 16px 14px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; font: 500 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; white-space: nowrap;
  font: 700 11.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
  background: var(--surface-3); color: var(--muted);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.pill.live { background: var(--live); color: #fff; }
.pill.lineup { background: var(--gold); color: #120F0A; }
.pill.W { background: var(--gold-soft); color: var(--gold-hi); }
.pill.L { background: var(--loss-soft); color: var(--loss); }
.pill.D { background: var(--draw-soft); color: var(--draw); }

.score-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 10px; }
.side { min-width: 0; }
.side.right { text-align: right; }
.side-name { font: 700 17px/1.08 var(--display); text-transform: uppercase; letter-spacing: .03em; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.side.them .side-name { color: var(--muted); }
.side-name.long, .sb-score .side-name.long { font-size: 14px; letter-spacing: .01em; }
.side-tag { font: 500 11px/1.2 var(--body); color: var(--faint); margin-top: 4px; letter-spacing: .06em; }
.score { display: flex; align-items: center; gap: 10px; font: 800 54px/.9 var(--display); font-variant-numeric: tabular-nums; }
.score .lose { color: var(--faint); }
.score .win { color: var(--gold-hi); }
.score .diamond { width: 8px; height: 8px; }
.score.wide { font-size: 46px; gap: 8px; }
.score.small, .score.small.wide { font-size: 34px; gap: 8px; }
.score.vs { font: 700 20px/1 var(--display); letter-spacing: .2em; color: var(--gold); }
.hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font: 500 12px/1.2 var(--body); color: var(--muted); letter-spacing: .04em; }
.progress { height: 3px; background: var(--surface-3); margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--live); transition: width .4s ease; }

.next { display: flex; align-items: center; gap: 10px; padding: 2px 18px 16px; font: 400 13px/1.35 var(--body); color: var(--muted); }
.next svg { flex-shrink: 0; color: var(--gold); }
.next b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ alerte home */
.nudge { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 12px 12px 14px; border: 1px solid var(--line-2); background: linear-gradient(90deg, var(--gold-soft), transparent); }
.nudge svg { color: var(--gold-hi); flex-shrink: 0; }
.nudge p { margin: 0; flex: 1; font-size: 13px; line-height: 1.35; color: var(--muted); }
.nudge p b { color: var(--text); font-weight: 600; display: block; }
.nudge .x { color: var(--faint); padding: 6px; }

/* -------------------------------------------------------------- joueurs */
.search {
  width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: 0;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23B78F58' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px 50%;
  color: var(--text); font: 15px var(--body); outline: none; margin-bottom: 10px; -webkit-appearance: none;
}
.search:focus { border-color: var(--line-2); }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.player-tile { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.player-tile:active { border-color: var(--line-2); }
.player-tile.is-live { border-color: rgba(232,56,45,.55); }
.pt-name { font: 700 14.5px/1.08 var(--display); text-transform: uppercase; letter-spacing: .03em; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-sub { font: 500 11.5px/1.25 var(--body); color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-sub b { color: var(--gold); font-weight: 600; }

.avatar {
  position: relative; flex-shrink: 0; width: 40px; height: 40px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(140deg, #2A241A, #14110C); color: var(--gold); font: 700 15px/1 var(--display); letter-spacing: .04em;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.cls { display: inline-block; padding: 3px 7px; border: 1px solid var(--line-2); color: var(--gold-hi); font: 700 11.5px/1.1 var(--display); letter-spacing: .1em; }

/* ------------------------------------------------------------ page équipe */
.page-title { font: 800 44px/.92 var(--display); text-transform: uppercase; margin: 8px 0 16px; letter-spacing: .02em; text-wrap: balance; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); background: var(--surface); }
.kpi { padding: 12px 10px 11px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-v { font: 800 25px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.kpi-v.gold { color: var(--gold-hi); }
.kpi-l { font: 600 10px/1 var(--body); color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .18em; }

.tabs {
  position: sticky; top: calc(59px + var(--safe-top)); z-index: 10; display: flex; margin: 20px 0 12px;
  background: rgba(9,8,6,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.tab { flex: 1; padding: 13px 4px 12px; font: 600 12.5px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--gold-hi); border-bottom-color: var(--gold); }

.match-list { display: flex; flex-direction: column; gap: 6px; }
.group-label { display: flex; align-items: center; gap: 10px; font: 600 11px/1 var(--body); letter-spacing: .26em; text-transform: uppercase; color: var(--faint); margin: 18px 2px 4px; }
.group-label small { letter-spacing: .04em; text-transform: none; font-weight: 500; }
.group-label.live { color: var(--live); }
.mrow { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); }
.mrow:active { border-color: var(--line-2); }
.mrow.is-live { border-color: var(--live); background: linear-gradient(90deg, var(--live-soft), var(--surface) 60%); }
.mrow.is-lineup { border-color: var(--gold); }
.mrow.todo .mdate { opacity: .55; }
.mdate { text-align: center; line-height: 1.05; }
.mdate .d { font: 800 22px/1 var(--display); }
.mdate .m { font: 600 10px/1.3 var(--body); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.mopp { min-width: 0; }
.mopp-name { font: 700 16px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mopp-sub { font: 500 12px/1.2 var(--body); color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mres { display: flex; align-items: center; gap: 8px; }
.mscore { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.badge { width: 24px; height: 24px; display: grid; place-items: center; font: 800 13px/1 var(--display); }
.todo-tag { font: 600 10.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.table th { font: 600 10px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); text-align: right; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 8px; text-align: right; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 12px; }
.table .tname { text-align: left; font: 700 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.mine td { background: var(--gold-soft); }
.table tr.mine .tname, .table tr.mine .pts { color: var(--gold-hi); }
.table .pts { font: 800 17px/1 var(--display); }

.pcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; }
a.pcard:active { border-color: var(--line-2); }
.pcard-main { flex: 1; min-width: 0; }
.pcard-name { font: 700 17px/1.08 var(--display); text-transform: uppercase; letter-spacing: .03em; word-break: break-word; }
.pcard-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 12.5px/1.2 var(--body); color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.pcard-stats b { color: var(--text); font-weight: 600; }
.pcard-rating { text-align: right; }
.pcard-rating .v { font: 800 28px/1 var(--display); color: var(--gold-hi); }
.pcard-rating .l { font: 600 9.5px/1 var(--body); color: var(--faint); letter-spacing: .2em; text-transform: uppercase; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { padding: 3px 7px; background: var(--surface-3); font: 600 11px/1.2 var(--body); color: var(--muted); letter-spacing: .06em; }
.chip b { color: var(--gold-hi); }

/* ------------------------------------------------------------ page match */
.scoreboard .in { padding: 18px 16px 16px; position: relative; overflow: hidden; }
.scoreboard .in::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; background: radial-gradient(70% 100% at 50% 0%, var(--gold-soft), transparent 75%); pointer-events: none; }
.scoreboard.live .in::before { background: radial-gradient(70% 100% at 50% 0%, var(--live-soft), transparent 75%); }
.sb-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 11.5px/1.3 var(--body); color: var(--muted); margin-bottom: 16px; letter-spacing: .1em; text-transform: uppercase; }
.sb-score { position: relative; }
.sb-score .score { font-size: 72px; }
.sb-score .score.wide { font-size: 58px; }
.sb-score .side-name { font-size: 20px; }
.sb-score .score.vs { font-size: 26px; }
.tracker { display: grid; gap: 3px; margin-top: 18px; position: relative; }
.tracker i { height: 22px; display: grid; place-items: center; font: 700 10px/1 var(--display); background: var(--surface-3); color: var(--faint); }
.tracker i.w { background: var(--gold); color: #17130C; }
.tracker i.l { background: var(--loss-soft); color: var(--loss); }
.tracker i.now { background: transparent; outline: 1.5px dashed var(--live); outline-offset: -1.5px; color: var(--live); }
.tracker-legend { display: flex; justify-content: space-between; font: 500 11.5px/1 var(--body); color: var(--muted); margin-top: 8px; position: relative; letter-spacing: .04em; }
.tracker-legend b { color: var(--gold-hi); }
.sb-actions { display: flex; gap: 8px; margin-top: 16px; position: relative; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; flex: 1;
  border: 1px solid var(--line-2); color: var(--text); font: 600 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase;
}
.btn:active { background: var(--gold-soft); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #120F0A; }
.btn.primary:active { background: var(--gold-hi); }
.btn.ghost { border-color: transparent; color: var(--muted); }

.set { background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; }
.set-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 500 11.5px/1.2 var(--body); color: var(--muted); letter-spacing: .06em; }
.set-n { font: 800 15px/1 var(--display); color: var(--gold); letter-spacing: .08em; }
.set-head .res { margin-left: auto; }
.set-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.set-side { padding: 8px 12px 10px; min-width: 0; }
.set-side + .set-side { border-left: 1px solid var(--line); text-align: right; }
.set-side.won { background: linear-gradient(180deg, var(--gold-soft), transparent); }
.sp { padding: 4px 0; }
.sp-name { font: 700 14.5px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-side:not(.won) .sp-name { color: var(--muted); }
.sp-stat { font: 500 12px/1.3 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-stat b { color: var(--text); font-weight: 600; }
.set-side.won .sp-stat b { color: var(--gold-hi); }
.set.hl { border-color: var(--line-2); }
.set.latest { border-color: var(--live); }

.compare { background: var(--surface); border: 1px solid var(--line); padding: 16px 14px; margin-bottom: 14px; }
.cmp-names { display: flex; justify-content: space-between; gap: 12px; font: 700 14px/1.1 var(--display); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.cmp-names span:last-child { color: var(--muted); text-align: right; }
.cmp-row + .cmp-row { margin-top: 14px; }
.cmp-top { display: flex; justify-content: space-between; align-items: baseline; font: 800 23px/1 var(--display); font-variant-numeric: tabular-nums; }
.cmp-top span:nth-child(2) { font: 600 10px/1 var(--body); color: var(--muted); letter-spacing: .24em; text-transform: uppercase; }
.cmp-top .low { color: var(--faint); }
.cmp-bar { display: flex; gap: 4px; height: 4px; margin-top: 8px; }
.cmp-bar i { background: var(--surface-3); }
.cmp-bar i.us { background: var(--gold); }

.details { background: var(--surface); border: 1px solid var(--line); margin-top: 10px; }
.details summary { padding: 14px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; font: 600 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.details summary::-webkit-details-marker { display: none; }
.details[open] summary { border-bottom: 1px solid var(--line); }
.details .pcard { border: 0; margin: 0; border-bottom: 1px solid var(--line); background: transparent; }

/* ------------------------------------------------------------ page joueur */
.phead { display: flex; align-items: center; gap: 16px; margin: 4px 2px 6px; }
.phead .page-title { margin: 8px 0 8px; font-size: 36px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border: 1px solid var(--line); background: var(--surface); }
.tile { padding: 13px 14px; border-bottom: 1px solid var(--line); }
.tile:nth-child(odd) { border-right: 1px solid var(--line); }
.tile:nth-last-child(-n+2) { border-bottom: 0; }
.tile-v { font: 800 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.tile-v small { font-size: 16px; color: var(--muted); }
.tile-l { font: 600 10px/1 var(--body); color: var(--muted); letter-spacing: .2em; text-transform: uppercase; margin-top: 7px; }
.tile.hl .tile-v { color: var(--gold-hi); }
.mini-match { display: block; margin-bottom: 10px; }
.mini-match .in { padding: 14px; }

/* ------------------------------------------------------------- états */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); border: 1px dashed var(--line-2); font-size: 14px; line-height: 1.5; }
.empty .btn { margin-top: 16px; flex: none; }
.error { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px solid var(--line-2); }
.error b { display: block; color: var(--gold-hi); font: 800 24px/1.1 var(--display); text-transform: uppercase; margin-bottom: 8px; letter-spacing: .04em; }
.error .btn { margin-top: 18px; flex: none; }
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 40px; color: var(--faint); font: 500 11.5px/1.5 var(--body); text-align: center; letter-spacing: .04em; }
.foot .tag { font: 700 15px/1 var(--display); letter-spacing: .1em; color: var(--muted); }
.foot .rule { display: flex; align-items: center; gap: 10px; width: 60%; }
.foot .rule::before, .foot .rule::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ------------------------------------------------------- pop-up in-app */
.popups { position: fixed; left: 0; right: 0; top: calc(66px + var(--safe-top)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.popup {
  pointer-events: auto; width: 100%; max-width: 520px; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: #15120D; border: 1px solid var(--line-2); box-shadow: 0 18px 40px -12px rgba(0,0,0,.8); animation: drop .35s cubic-bezier(.2,.9,.3,1.2);
}
.popup.start { border-color: var(--live); }
.popup.win { border-color: var(--gold-hi); }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.popup .pk { flex-shrink: 0; }
.popup-main { flex: 1; min-width: 0; }
.popup-title { font: 800 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.popup.win .popup-title { color: var(--gold-hi); }
.popup-body { font: 400 12.5px/1.3 var(--body); color: var(--muted); margin-top: 3px; }
.popup .go { font: 700 11px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hi); padding: 8px 6px; }
.popup .x { color: var(--faint); padding: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom)); transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); padding: 11px 16px; font: 500 13px/1.3 var(--body); z-index: 60; animation: rise .2s ease-out; max-width: calc(100% - 32px); }

/* ------------------------------------------------------- feuille alertes */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-card { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; animation: up .3s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-card .in { padding: 22px 20px calc(22px + var(--safe-bottom)); background: #12100C; }
.sheet h3 { margin: 4px 0 6px; font: 800 28px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sheet .note { font-size: 12.5px; color: var(--faint); margin: 14px 0 0; }
.opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 6px; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .box { width: 20px; height: 20px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex-shrink: 0; transform: rotate(45deg); transition: background .15s; }
.opt input:checked + .box { background: var(--gold); border-color: var(--gold); }
.opt input:checked + .box::after { content: ""; width: 6px; height: 6px; background: #120F0A; }
.opt input:focus-visible + .box { outline: 1.5px solid var(--gold-hi); outline-offset: 3px; }
.opt-main { flex: 1; min-width: 0; }
.opt-name { font: 700 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.opt-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sheet-actions .btn { flex: 1 1 140px; }
.steps { margin: 0 0 4px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text); }
.steps li::before { content: counter(s); font: 800 18px/1 var(--display); color: var(--gold); width: 18px; flex-shrink: 0; }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font: 600 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hi); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .tile { border-bottom: 0 !important; border-right: 1px solid var(--line); }
  .tile:last-child { border-right: 0; }
  .score { font-size: 62px; }
  .sb-score .score { font-size: 88px; }
  .sb-score .score.wide { font-size: 72px; }
  .tc-name { font-size: 36px; }
  .sheet { align-items: center; }
}
@media (max-width: 380px) {
  .score { font-size: 46px; }
  .score.wide { font-size: 40px; }
  .sb-score .score { font-size: 60px; }
  .sb-score .score.wide { font-size: 48px; }
  .kpi-v { font-size: 21px; }
  .side-name { font-size: 15px; }
  .updated { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
