/* GABL Stats — матч-центр и сезон. Светлая по умолчанию (как страницы FIBA), есть тёмная. */
:root {
  --bg: #ececef; --paper: #ffffff; --paper2: #f5f5f7; --fg: #141416; --mut: #6c6c74; --line: #dcdce1;
  --top: #121212; --top-fg: #f2f2f2; --accent: #f07c00; --gold: #c9a24b; --win: #1d9a55; --loss: #c8382e;
  --bar: #d9d9de; --shadow: rgba(0,0,0,.08);
  --font: -apple-system, "SF Pro Text", "Roboto", "Noto Sans Georgian", ".SF Georgian", sans-serif;
  --cond: "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "sans-serif-condensed", "Noto Sans Georgian", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --paper: #19191c; --paper2: #212125; --fg: #f0f0f2; --mut: #9c9ca4; --line: #303036;
  --top: #050505; --bar: #34343a; --shadow: rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--top); color: var(--top-fg); border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--cond); font-size: 22px; font-weight: 700; letter-spacing: 1px; padding-top: 3px; white-space: nowrap; }
.brand img { height: 28px; }
.brand b { color: var(--gold); }
.top nav { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top nav a { font-family: var(--cond); font-size: 18px; text-transform: uppercase; text-decoration: none; padding-top: 3px; white-space: nowrap; }
.top select { background: #222; border: 1px solid #333; color: #eee; border-radius: 4px; padding: 3px 6px; }
.tb { background: #222; border: 0; color: #eee; border-radius: 4px; padding: 3px 9px; cursor: pointer; }
/* язык — значок глобуса, список невидимо поверх */
.langwrap { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; background: #222; color: #eee; border-radius: 4px; cursor: pointer; }
.langwrap svg { width: 18px; height: 18px; }
.top .langwrap select { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; cursor: pointer; padding: 0; border: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.loading, .empty { color: var(--mut); text-align: center; padding: 40px 0; }
.foot { text-align: center; color: var(--mut); font-size: 12px; padding: 0 16px 24px; }

.card { background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px var(--shadow); min-width: 0; }
.card > h3, .sect-h { margin: 0; padding: 12px 16px 10px; font-family: var(--cond); font-size: 20px; letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card > h3 small, .sect-h small { font-family: var(--font); font-size: 12px; color: var(--mut); text-transform: none; letter-spacing: 0; font-weight: 400; }
.pad { padding: 14px 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- лента матчей тура ---------- */
.round { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.rg { flex: none; min-width: 190px; background: var(--paper); border-radius: 6px; padding: 8px 10px; text-decoration: none; box-shadow: 0 1px 3px var(--shadow); border: 2px solid transparent; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.rg.cur { border-color: var(--accent); }
.rg .w { color: var(--mut); font-size: 11px; display: flex; justify-content: space-between; }
.rg .w .lv { color: var(--loss); font-weight: 700; }
.rg .t { display: flex; align-items: center; gap: 6px; }
.rg .t img { width: 18px; height: 18px; object-fit: contain; }
.rg .t span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg .t b { font-variant-numeric: tabular-nums; }

/* ---------- шапка матча ---------- */
.mhead { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto auto minmax(0, 1fr) 10px; align-items: stretch; background: var(--paper); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px var(--shadow); min-height: 120px; }
.mhead .stripe { width: 10px; }
.mteam { display: flex; align-items: center; gap: 16px; padding: 12px 18px; text-decoration: none; min-width: 0; }
.mteam.r { flex-direction: row-reverse; text-align: right; }
.mteam img { width: 76px; height: 76px; object-fit: contain; flex: none; }
.mteam .nm { font-family: var(--cond); font-size: 30px; font-weight: 700; text-transform: uppercase; line-height: 1.05; padding-top: 4px; min-width: 0; overflow-wrap: anywhere; }
.mscore { font-family: var(--cond); font-size: 76px; font-weight: 700; display: flex; align-items: center; padding: 8px 18px 0; font-variant-numeric: tabular-nums; }
.mscore.lose { color: var(--mut); }
.mmid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 14px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 160px; }
.mmid .st { font-family: var(--cond); font-size: 16px; color: var(--mut); text-transform: uppercase; letter-spacing: 1px; }
.mmid .st.live { color: var(--loss); }
/* двоеточие в часах — две точки по середине высоты цифр (у DIN Condensed своё двоеточие сидит низко) */
.colon { display: inline-block; position: relative; width: .26em; height: .72em; vertical-align: baseline; font-style: normal; }
.colon::before, .colon::after { content: ""; position: absolute; left: 50%; width: .11em; height: .11em; margin-left: -.055em;
  background: currentColor; border-radius: 18%; }
.colon::before { top: .15em; } .colon::after { bottom: .15em; }
.mmid .clk { font-family: var(--cond); font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.qt { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.qt td, .qt th { padding: 1px 5px; text-align: center; }
.qt th { color: var(--mut); font-weight: 600; }
.qt td.t { font-weight: 700; }
.minfo { text-align: center; color: var(--mut); font-size: 13px; }
@media (max-width: 760px) {
  .mhead { grid-template-columns: 6px minmax(0, 1fr) auto minmax(0, 1fr) 6px; grid-template-rows: auto auto; }
  .mhead .stripe { width: 6px; grid-row: span 2; }
  .mteam { flex-direction: column; text-align: center; padding: 10px 6px; gap: 6px; }
  .mteam.r { flex-direction: column; text-align: center; }
  .mteam img { width: 48px; height: 48px; }
  .mteam .nm { font-size: 18px; }
  .mscore { font-size: 46px; padding: 6px 6px 0; justify-content: center; }
  .mhead .mscore.h { grid-column: 2; grid-row: 2; } .mhead .mscore.a { grid-column: 4; grid-row: 2; }
  .mmid { grid-column: 3; grid-row: 1 / span 2; min-width: 0; padding: 6px; }
}

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 2px; background: var(--paper2); border-radius: 6px; overflow-x: auto; box-shadow: 0 1px 3px var(--shadow); }
.tabs a { flex: none; padding: 12px 18px 9px; font-family: var(--cond); font-size: 18px; text-decoration: none; text-transform: uppercase; color: var(--mut); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--accent); background: var(--paper); }

/* ---------- таблицы ---------- */
.tw { overflow-x: auto; }
table.st { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.st th { font-family: var(--cond); font-weight: 700; font-size: 14px; color: var(--mut); text-transform: uppercase; padding: 8px 6px 5px; text-align: center; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.st td { padding: 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.st .l { text-align: left; }
table.st tr.sep td { background: var(--paper2); color: var(--mut); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; text-align: left; padding: 3px 8px; }
table.st tr.tot td { font-weight: 700; border-top: 2px solid var(--fg); }
table.st tr.dnp td { color: var(--mut); }
table.st tr.pick td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
table.st td.num { width: 34px; font-family: var(--cond); font-size: 17px; font-weight: 700; color: #fff; }
table.st td.nm a { text-decoration: none; font-weight: 600; }
table.st td.nm a:hover { text-decoration: underline; }
table.st td.pts { font-weight: 700; }
table.st small { color: var(--mut); font-size: 11px; margin-left: 3px; }
.shbtn { border: 1px solid var(--line); background: var(--paper2); border-radius: 4px; padding: 1px 6px; font-size: 12px; cursor: pointer; }
.shbtn.on { background: var(--accent); color: #111; border-color: var(--accent); }
.rank { width: 26px; color: var(--mut); }
.res-w { color: var(--win); font-weight: 700; } .res-l { color: var(--loss); font-weight: 700; }

/* ---------- лидеры ---------- */
.ldr { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lc { background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px var(--shadow); overflow: hidden; min-width: 0; }
.lc h4 { margin: 0; padding: 10px 14px 7px; font-family: var(--cond); font-size: 18px; text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--line); }
.lc .first { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lc .first img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.lc .first .n { flex: 1; min-width: 0; font-weight: 700; }
.lc .first .n small { display: block; font-weight: 400; color: var(--mut); font-size: 12px; }
.lc .first .v { font-family: var(--cond); font-size: 40px; font-weight: 700; padding-top: 4px; }
.lc .row { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.lc .row:last-child { border-bottom: 0; }
.lc .row:nth-child(even) { background: var(--paper2); }
.lc .row img { width: 18px; height: 18px; object-fit: contain; }
.lc .row a, .lc .first a { text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc .row a { flex: 1; }
.lc .row b { font-variant-numeric: tabular-nums; }

/* ---------- сравнение ---------- */
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); align-items: center; row-gap: 10px; column-gap: 12px; padding: 14px 16px; }
.cmp .v { font-variant-numeric: tabular-nums; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cmp .v.h { justify-content: flex-end; }
.cmp .v small { color: var(--mut); font-weight: 400; }
.cmp .k { text-align: center; font-family: var(--cond); font-size: 15px; text-transform: uppercase; color: var(--mut); line-height: 1.1; }
.cmp .bar { height: 8px; background: var(--bar); border-radius: 4px; position: relative; flex: 1; max-width: 220px; overflow: hidden; }
.cmp .bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.cmp .v.h .bar i { right: 0; } .cmp .v.a .bar i { left: 0; }

/* ---------- ход игры ---------- */
.pbp { display: flex; flex-direction: column; }
.pbp .per { text-align: center; font-family: var(--cond); font-size: 16px; text-transform: uppercase; background: var(--top); color: var(--top-fg); padding: 6px 0 3px; margin: 10px 0 4px; border-radius: 4px; }
.pe { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.pe .ev { padding: 6px 10px; border-radius: 4px; background: var(--paper2); min-width: 0; }
.pe .ev.h { grid-column: 1; text-align: right; border-right: 4px solid var(--c); }
.pe .ev.a { grid-column: 3; border-left: 4px solid var(--c); }
.pe .ev.score { font-weight: 700; background: color-mix(in srgb, var(--c) 14%, var(--paper)); }
.pe .tm { grid-column: 2; grid-row: 1; text-align: center; font-variant-numeric: tabular-nums; color: var(--mut); font-size: 12px; line-height: 1.2; }
.pe .tm b { display: block; color: var(--fg); font-size: 14px; }
.pe .ev a { text-decoration: none; font-weight: 600; }
.pbpf { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; }

/* ---------- площадка / броски ---------- */
.court { width: 100%; height: auto; display: block; }
.shotwrap { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 14px; padding: 14px 16px; align-items: start; }
@media (max-width: 900px) { .shotwrap { grid-template-columns: minmax(0, 1fr); } }
.plist { display: flex; flex-direction: column; gap: 3px; }
.plist button { display: flex; justify-content: space-between; gap: 8px; text-align: left; background: var(--paper2); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; cursor: pointer; font-size: 13px; }
.plist button.on { background: var(--c); color: #fff; border-color: var(--c); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 12px 16px 0; }
.chipb { border: 1px solid var(--line); background: var(--paper2); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.chipb.on { background: var(--fg); color: var(--paper); border-color: var(--fg); }
.donuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; padding: 8px 16px 16px; }
.donut { width: 110px; text-align: center; font-family: var(--cond); }
.donut svg { width: 110px; height: 110px; }

/* ---------- плитки цифр ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tile { background: var(--paper); border-radius: 6px; padding: 12px 14px; box-shadow: 0 1px 3px var(--shadow); }
.tile .v { font-family: var(--cond); font-size: 34px; font-weight: 700; line-height: 1; padding-top: 4px; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.tile .r { font-size: 11px; color: var(--accent); margin-top: 2px; }

/* ---------- страница команды / игрока ---------- */
.phead { display: flex; align-items: center; gap: 20px; background: var(--paper); border-radius: 6px; padding: 16px 20px; box-shadow: 0 1px 3px var(--shadow); border-left: 10px solid var(--c); flex-wrap: wrap; }
.phead img { width: 84px; height: 84px; object-fit: contain; }
.phead img.photo { width: 120px; height: 150px; object-fit: cover; object-position: 50% 18%; border-radius: 4px; margin: -6px 0; }
.phead .nm { font-family: var(--cond); font-size: 36px; font-weight: 700; text-transform: uppercase; line-height: 1; padding-top: 4px; }
.phead .sub { color: var(--mut); margin-top: 6px; }
.phead .sub a { color: var(--fg); font-weight: 600; }
.phead .big { margin-left: auto; font-family: var(--cond); font-size: 56px; font-weight: 700; color: var(--mut); }
.divtabs { display: flex; gap: 8px; }
.divtabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 8px 18px; font-family: var(--cond); font-size: 18px; cursor: pointer; text-transform: uppercase; }
.divtabs button.on { background: var(--top); color: var(--top-fg); border-color: var(--top); }
.toggle { cursor: pointer; }
details.adm summary { cursor: pointer; padding: 12px 16px; color: var(--mut); }
.gl { display: flex; flex-direction: column; }
.gl .gr { display: grid; grid-template-columns: 90px minmax(0, 1fr) 80px minmax(0, 1fr) 70px; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.gl .gr:hover { background: var(--paper2); }
.gl .gr .d { color: var(--mut); font-size: 12px; }
.gl .gr .tn { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gl .gr .tn.r { justify-content: flex-end; text-align: right; }
.gl .gr .tn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl .gr .tn img { width: 22px; height: 22px; object-fit: contain; }
.gl .gr .sc { text-align: center; font-family: var(--cond); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gl .gr .st { text-align: right; font-size: 12px; color: var(--mut); }
.gl .gr .st.live { color: var(--loss); font-weight: 700; }
@media (max-width: 600px) { .gl .gr { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); } .gl .gr .d, .gl .gr .st { display: none; } }
.adm label { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.adm label span { flex: 1; }
.chart { width: 100%; height: auto; display: block; }
/* телефон: верхняя полоса помещается в ширину экрана */
@media (max-width: 560px) {
  .brand span { display: none; }
  .top nav { gap: 8px; }
  .top nav a { font-size: 16px; }
  .top select { max-width: 96px; }
}
.top nav a.backpro { background: var(--accent, #f07c00); color: #111; padding: 6px 12px 3px; border-radius: 6px; font-weight: 700; }
/* лидеры: длинное имя у первого места переносится по словам (раньше «#22» оставался один на строке,
   а имя уезжало вниз), крупное число не сжимается; на узком экране — меньше */
.lc .first .n { line-height: 1.2; overflow-wrap: anywhere; }
.lc .first .n a { white-space: normal; overflow: visible; }
.lc .first .v { flex: none; line-height: 1; padding-top: 6px; }
@media (max-width: 720px) {
  .ldr { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
  .lc .first { gap: 10px; padding: 10px 12px; }
  .lc .first img { width: 36px; height: 36px; }
  .lc .first .v { font-size: 32px; }
  .lc .row { padding: 6px 12px; }
}
