/* Layout: o singura coloana de raport, ca o fisa de meci; graficul de scor si rotatiile impart aceeasi axa de timp */
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --ink: #15191e;
  --ink-2: #4d5560;
  --ink-3: #7c848f;
  --line: #e2e5e9;
  --grid: #eceef1;
  --us: #2a78d6;
  --them: #e34948;
  --us-soft: rgba(42,120,214,.16);
  --them-soft: rgba(227,73,72,.14);
  --run: rgba(227,73,72,.07);
  --bar: #9fb4cc;
  --bar-hi: #2a78d6;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121519; --surface: #1a1e23; --ink: #eef1f4; --ink-2: #b4bcc6; --ink-3: #87909b;
    --line: #2b3138; --grid: #242a30; --us: #3987e5; --them: #e66767;
    --us-soft: rgba(57,135,229,.22); --them-soft: rgba(230,103,103,.2); --run: rgba(230,103,103,.09);
    --bar: #4a5d74; --bar-hi: #3987e5; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121519; --surface: #1a1e23; --ink: #eef1f4; --ink-2: #b4bcc6; --ink-3: #87909b;
  --line: #2b3138; --grid: #242a30; --us: #3987e5; --them: #e66767;
  --us-soft: rgba(57,135,229,.22); --them-soft: rgba(230,103,103,.2); --run: rgba(230,103,103,.09);
  --bar: #4a5d74; --bar-hi: #3987e5; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; padding-inline: 16px; padding-block: 28px 56px; }
.wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 36px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: .01em; }
h2 { font-size: 1.6rem; font-weight: 600; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
section { display: grid; gap: 14px; min-width: 0; }
.lede { color: var(--ink-2); max-width: 68ch; margin: 0; }

/* antet / tabela de scor */
header { display: grid; gap: 18px; }
.board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.team { display: grid; gap: 2px; }
.team.right { text-align: right; }
.team .name { font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
.team .tag { font-size: .8rem; color: var(--ink-3); }
.score { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 9vw, 4.6rem); line-height: 1; display: flex; gap: .3em; align-items: baseline; font-variant-numeric: tabular-nums; }
.score .dash { color: var(--ink-3); font-weight: 500; }
.score .us { color: var(--us); }
.quarters { grid-column: 1 / -1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.q { font-size: .82rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.q b { font-weight: 600; color: var(--ink); }
.q .d { margin-left: 6px; font-weight: 600; }
.pos { color: var(--us); } .neg { color: var(--them); }

/* concluzii */
.takeaways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tk { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.tk .big { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tk p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.tk h3 { font-size: 1.1rem; font-weight: 600; }

/* grafice */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 18px 12px; min-width: 0; }
.scroll { overflow-x: auto; }
[hidden] { display: none !important; }
svg text { font-family: var(--body); fill: var(--ink-3); font-size: 12px; }
svg .lbl { fill: var(--ink-2); font-size: 13px; font-weight: 500; }
svg .runlbl { fill: var(--them); font-family: var(--display); font-weight: 600; font-size: 14px; }
svg .runlbl.us { fill: var(--us); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin: 0 0 8px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .82rem; box-shadow: 0 6px 20px rgba(0,0,0,.14); max-width: 280px; z-index: 10; line-height: 1.4; }
.tip b { font-variant-numeric: tabular-nums; }
.tip .mut { color: var(--ink-3); }

/* tabele */
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .9rem; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable:focus-visible { color: var(--ink); }
th.sortable:focus-visible { outline: 2px solid var(--us); outline-offset: -2px; }
th[aria-sort] { color: var(--ink); }
th[aria-sort]::after { content: ' ▾'; color: var(--us); }
th[aria-sort="ascending"]::after { content: ' ▴'; }
td.name { font-weight: 600; }
td.name .nr { color: var(--ink-3); font-weight: 500; margin-right: 6px; display: inline-block; min-width: 1.6em; }
tbody tr:hover { background: var(--grid); }
.pmcell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pmbar { height: 8px; border-radius: 0 4px 4px 0; display: inline-block; }
.muted { color: var(--ink-3); }
.note { font-size: .82rem; color: var(--ink-3); margin: 8px 0 0; max-width: 80ch; }
.flag { font-size: .7rem; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }

.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .cmp { grid-template-columns: 1fr; } .board { padding: 16px; } .team .name { font-size: 1.1rem; } }

.method { font-size: .88rem; color: var(--ink-2); display: grid; gap: 8px; max-width: 95ch; }
.method p { margin: 0; }
:focus-visible { outline: 2px solid var(--us); outline-offset: 2px; }

/* tabel statistici in format federatie */
table.box { font-size: .84rem; }
/* borduri separate (nu collapse): altfel Chrome deseneaza textul coloanelor glisate peste coloana fixa */
table.box { border-collapse: separate; border-spacing: 0; }
table.box th, table.box td { padding: 6px 8px; text-align: center; border: 0 solid var(--line); border-width: 0 1px 1px 0; }
table.box thead tr:first-child th, table.box > tbody:first-child tr:first-child td { border-top-width: 1px; }
table.box td:first-child, table.box thead tr:first-child th:first-child { border-left-width: 1px; }
table.box th { font-size: .7rem; letter-spacing: .04em; vertical-align: middle; }
table.box th.grp { border-bottom-color: var(--line); }
table.box td.lead, table.box th:first-child { text-align: left; }
table.box td.lead + td.lead { text-align: center; }
table.box tbody tr.tot td { font-weight: 600; background: var(--grid); }
table.box td.name .nr { color: var(--ink-3); font-weight: 500; margin-right: 6px; display: inline-block; min-width: 1.6em; }
.box-key { font-size: .8rem; color: var(--ink-3); margin: 8px 0 0; }
.box-key b { color: var(--ink-2); font-weight: 600; }
th[title]:not([title=""]) { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; }
th[title]:not([title=""]):not(.sortable) { cursor: help; }
.method h3 { font-size: 1.05rem; margin: 10px 0 0; color: var(--ink); }
.glosar { margin: 0; display: grid; grid-template-columns: 190px 1fr; gap: 10px 18px; }
.glosar dt { font-weight: 600; color: var(--ink); }
.glosar dd { margin: 0; }
@media (max-width: 560px) { .glosar { grid-template-columns: 1fr; gap: 2px; } .glosar dd { margin-bottom: 8px; } }
.toplink { font-size: .85rem; color: var(--us); text-decoration: none; }
.toplink:hover { text-decoration: underline; }

/* pase potentiale: bara = puncte posibile, partea plina = puncte rezultate */
.pbar { display: inline-block; height: 8px; border-radius: 4px; background: var(--grid); position: relative; overflow: hidden; vertical-align: middle; }
.pbar > i { position: absolute; inset: 0 auto 0 0; background: var(--us); border-radius: 4px; }
td.spre { text-align: left; color: var(--ink-2); white-space: normal; min-width: 180px; }

/* navigare comuna */
.topnav { max-width: 1180px; margin: -12px auto 24px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .9rem; }
.topnav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.topnav a:hover { background: var(--grid); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.topnav .brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); padding-left: 0; margin-right: 12px; display: inline-flex; align-items: center; gap: 8px; }
.topnav .brand:hover { background: none; }
.topnav .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--us); }
.topnav .sp { flex: 1; }
.topnav .cta { background: var(--us); color: #fff; font-weight: 600; }
.topnav .cta:hover { background: var(--us); color: #fff; filter: brightness(1.08); }
@media (max-width: 560px) { .topnav .brand { width: 100%; } .topnav .sp { display: none; } }

/* ---- telefon ---- */
/* prima coloana (numele) ramane pe loc cand tabelul lat e glisat orizontal */
.scroll table { border-collapse: separate; border-spacing: 0; }
.scroll table td:first-child, .scroll table thead tr:first-child th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.scroll table tr.tot td:first-child { background: var(--grid); }
.scroll.scrolled table td:first-child, .scroll.scrolled table thead tr:first-child th:first-child { box-shadow: 6px 0 6px -6px rgba(0,0,0,.25); }
.swipe-hint { display: none; font-size: .78rem; color: var(--ink-3); margin: 0 0 6px; }
.tiles { display: none; }
@media (max-width: 720px) {
  body { padding-inline: 12px; padding-block: 18px 40px; }
  .wrap { gap: 28px; }
  .panel { padding: 12px 12px 10px; border-radius: 8px; }
  h2 { font-size: 1.45rem; }
  .swipe-hint { display: block; }
  /* coloanele de text lung trec pe mai multe randuri */
  #ltable td:first-child, #ttable td:first-child, td.spre { white-space: normal; min-width: 130px; }
  #ttable td:first-child { min-width: 0; }
  #ltable td:first-child { font-size: .84rem; }
  table.box th, table.box td { padding: 5px 6px; }
  /* fisa jucatoarei: carduri in locul tabelului de medii */
  .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tiles div { background: var(--bg); border-radius: 6px; padding: 6px 4px; text-align: center; display: grid; }
  .tiles b { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
  .tiles span { font-size: .66rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
  .player .medii { display: none; }
}
