/* Padel · Битва городов
   Палитра: светлая «спортивная афиша» как в референсе.
   Шрифты: Fira Sans Extra Condensed (дисплей, счёт, время) + Onest (текст). */

@font-face { font-family: "FSX"; font-weight: 600; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSX"; font-weight: 600; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "FSX"; font-weight: 700; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSX"; font-weight: 700; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "FSX"; font-weight: 800; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSX"; font-weight: 800; font-display: swap; src: url(vendor/fonts/fira-sans-extra-condensed-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(vendor/fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(vendor/fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(vendor/fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(vendor/fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(vendor/fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(vendor/fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(vendor/fonts/onest-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(vendor/fonts/onest-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f2f3ef;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --ink: #121412;
  --ink-2: #3c413d;
  --muted: #646b66;
  --line: #e2e4de;
  --line-2: #d3d6cf;

  --bar: #b8743c;          /* Бар — терракота/песок */
  --bar-ink: #95561f;
  --bar-tint: #f6ece2;
  --budva: #3d8ad6;        /* Будва — море */
  --budva-ink: #1f68b3;
  --budva-tint: #e6f0fa;

  --cat-d: #3a9a62; --cat-d-tint: #e8f4ec; --cat-d-ink: #23704a;
  --cat-c: #3a7fd0; --cat-c-tint: #e7effa; --cat-c-ink: #2161ad;
  --cat-b: #dc4f74; --cat-b-tint: #fbe8ee; --cat-b-ink: #b02f55;

  --ball: #d8f03c;         /* мяч — цвет «идёт» */
  --ball-ink: #1b2100;
  --danger: #c43a2f;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 20, 18, .04), 0 8px 24px -12px rgba(18, 20, 18, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "FSX", "Arial Narrow", sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar-h: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1110; --surface: #171a18; --surface-2: #1d201e; --ink: #f1f3ef; --ink-2: #cfd3cd; --muted: #9aa19b;
    --line: #2a2e2b; --line-2: #363b37;
    --bar: #d68f55; --bar-ink: #e6a36b; --bar-tint: #2a2119;
    --budva: #5aa2ea; --budva-ink: #7cb6f0; --budva-tint: #172331;
    --cat-d: #4cb478; --cat-d-tint: #16261c; --cat-d-ink: #7fd3a1;
    --cat-c: #5a98e2; --cat-c-tint: #162232; --cat-c-ink: #93bdf0;
    --cat-b: #ec6a8d; --cat-b-tint: #2c1820; --cat-b-ink: #f39ab3;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1110; --surface: #171a18; --surface-2: #1d201e; --ink: #f1f3ef; --ink-2: #cfd3cd; --muted: #9aa19b;
  --line: #2a2e2b; --line-2: #363b37;
  --bar: #d68f55; --bar-ink: #e6a36b; --bar-tint: #2a2119;
  --budva: #5aa2ea; --budva-ink: #7cb6f0; --budva-tint: #172331;
  --cat-d: #4cb478; --cat-d-tint: #16261c; --cat-d-ink: #7fd3a1;
  --cat-c: #5a98e2; --cat-c-tint: #162232; --cat-c-ink: #93bdf0;
  --cat-b: #ec6a8d; --cat-b-tint: #2c1820; --cat-b-ink: #f39ab3;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--budva); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.bar-c { color: var(--bar-ink); }
.budva-c { color: var(--budva-ink); }
.ph { line-height: 1; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { font: 800 19px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font: 600 11px/1.2 var(--text); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 2px; }

.nav { display: flex; gap: 2px; background: var(--surface); padding: 4px; border-radius: 999px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.nav a { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .25s var(--ease), color .25s var(--ease); }
.nav a .ph { font-size: 17px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn .ph { font-size: 18px; }
.btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn-ball { background: var(--ball); color: var(--ball-ink); border-color: color-mix(in srgb, var(--ball) 70%, #000); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* ---------- нижняя навигация (мобайл) ---------- */
.tabbar { display: none; }

/* ---------- hero ---------- */
.hero { padding: 36px 0 28px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 28px; align-items: stretch; }
.hero-main { position: relative; padding: 8px 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--text); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.hero h1 { font: 800 clamp(48px, 8.2vw, 92px)/.88 var(--display); text-transform: uppercase; margin: 14px 0 6px; letter-spacing: -.01em; text-wrap: balance; }
.versus { display: flex; align-items: baseline; gap: 14px; font: 800 clamp(40px, 6.8vw, 76px)/.95 var(--display); text-transform: uppercase; }
.versus .vs { font-size: .42em; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; }
.meta { display: flex; align-items: center; gap: 10px; }
.meta .ph { font-size: 26px; color: var(--ink-2); }
.meta b { display: block; font-weight: 600; font-size: 14px; }
.meta span { display: block; font-size: 12.5px; color: var(--muted); }
.meta-sep { width: 1px; background: var(--line-2); align-self: stretch; }
.tnote { margin-top: 16px; font-size: 13px; color: var(--muted); max-width: 60ch; }

/* табло — главный элемент */
.board { background: var(--ink); color: #f4f5f1; border-radius: 26px; padding: 22px 22px 18px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.board::before { /* линии корта */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(transparent 30%, #fff 30%, #fff calc(30% + 2px), transparent calc(30% + 2px), transparent 70%, #fff 70%, #fff calc(70% + 2px), transparent calc(70% + 2px));
}
.board > * { position: relative; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 600 12px/1 var(--text); text-transform: uppercase; letter-spacing: .14em; color: #a9ada6; }
.board-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; margin: 18px 0 14px; }
.board-city { font: 800 26px/1 var(--display); text-transform: uppercase; }
.board-city.r { text-align: right; }
.board-city .n { display: block; font-size: clamp(64px, 9vw, 96px); line-height: .85; margin-top: 6px; font-variant-numeric: tabular-nums; }

.board-city.lead .n { color: #fff; }
.board-colon { font: 800 54px/1 var(--display); color: #5f645e; padding-bottom: 8px; }
.tug { position: relative; height: 10px; border-radius: 99px; overflow: hidden; display: flex; background: #2b2f2c; }
.tug i { display: block; height: 100%; transition: flex-grow .8s var(--ease); }
.tug i { background: var(--q, #8a8f88); }
.board .tug i { background: var(--qd, #8a8f88); }
.tug::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--bg); opacity: .9; }
.board-sub { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: #a9ada6; }
.board-cats { margin-top: 18px; display: grid; gap: 8px; border-top: 1px solid #2c302d; padding-top: 14px; }
.bc-row { display: grid; grid-template-columns: 28px 112px 30px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; color: #cfd2cc; }
.bc-row .tug { height: 6px; }
.bc-row .n { font: 700 18px/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; }

.bc-row .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cfd2cc; }
.progress { flex: 1; height: 4px; background: #2b2f2c; border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ball); border-radius: 9px; transition: width .8s var(--ease); }
.winner-banner { display: flex; align-items: center; gap: 10px; background: var(--ball); color: var(--ball-ink); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; margin-top: 4px; }
.winner-banner .ph { font-size: 20px; }

/* ---------- бейджи ---------- */
.cat { --c: var(--muted); --t: var(--surface-2); --k: var(--ink); width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--c); color: #fff; font: 800 17px/1 var(--display); }
.cat-sm { width: 24px; height: 24px; font-size: 14px; }
.cat-D { --c: var(--cat-d); --t: var(--cat-d-tint); --k: var(--cat-d-ink); }
.cat-C { --c: var(--cat-c); --t: var(--cat-c-tint); --k: var(--cat-c-ink); }
.cat-B { --c: var(--cat-b); --t: var(--cat-b-tint); --k: var(--cat-b-ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font: 600 12px/1 var(--text); white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill-live { background: var(--ball); color: var(--ball-ink); }
.pill-done { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #e0321c; box-shadow: 0 0 0 0 rgba(224, 50, 28, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 50, 28, .55); } 70% { box-shadow: 0 0 0 7px rgba(224, 50, 28, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 50, 28, 0); } }

/* ---------- фильтры ---------- */
.filters { position: sticky; top: 64px; z-index: 20; padding: 12px 0; background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.filters .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  --c: var(--ink); --t: var(--surface); --k: var(--ink);
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px 0 6px; flex: none;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.chip:active { transform: scale(.97); }
.chip.no-badge { padding-left: 16px; }
.chip .cat { width: 30px; height: 30px; font-size: 16px; }
.chip[aria-pressed="true"] { background: var(--t); border-color: var(--c); color: var(--k); }
.chip.all[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-size: 12px; color: var(--muted); font-weight: 500; }
.chip.chip-q { --c: var(--q); --t: var(--qt); --k: var(--qi); gap: 8px; }
.filter-spacer { flex: 1; }
.search { position: relative; }
.search input { height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 16px 0 40px; width: 230px; font-size: 14px; }
.search input:focus { border-color: var(--ink-2); outline: none; }
.search .ph { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg .ph { font-size: 17px; }

/* ---------- секции ---------- */
.section { padding: 18px 0 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 18px 0 14px; flex-wrap: wrap; }
.h2 { font: 800 34px/1 var(--display); text-transform: uppercase; margin: 0; letter-spacing: .005em; }
.h3 { font: 800 22px/1.05 var(--display); text-transform: uppercase; margin: 0; }
.lead { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

/* ---------- сейчас на кортах ---------- */
.now { background: var(--surface); border-radius: var(--radius); border: 1.5px solid color-mix(in srgb, var(--ball) 70%, var(--line)); padding: 14px; margin-bottom: 18px; }
.now-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

/* ---------- сетка расписания ---------- */
.sched { display: grid; gap: 10px; }
.sched-head, .slot { display: grid; grid-template-columns: 96px repeat(var(--courts, 2), minmax(0, 1fr)); gap: 10px; }
.sched-head > div { background: var(--surface); border-radius: var(--radius-sm); min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; font: 800 19px/1 var(--display); text-transform: uppercase; border: 1px solid var(--line); }
.sched-head > div:first-child { font: 600 12px/1 var(--text); letter-spacing: .14em; color: var(--muted); }
.court-ico { width: 30px; height: 22px; color: var(--ink); }
.slot-time { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; }
.slot-time b { font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.slot-time span { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.slot-time.now-slot { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--ball); }
.slot-time .rw { display: block; font: 600 11px/1 var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.slot-time .round-tag { font: 600 11px/1 var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.court-label { display: none; }
.empty-cell { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--muted); font-size: 13px; min-height: 90px; }

/* ---------- карточка матча ---------- */
.match {
  --c: var(--muted); --t: var(--surface); --k: var(--ink);
  position: relative; background: var(--t); border-radius: var(--radius-sm);
  padding: 12px 14px 12px 16px; border: 1px solid color-mix(in srgb, var(--c) 18%, transparent);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.match::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.match.is-live { background: var(--surface); border: 2px solid var(--ball); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ball) 28%, transparent), var(--shadow); }
.match.hl { box-shadow: 0 0 0 2px var(--ink); }
.match-top { display: flex; align-items: center; gap: 10px; }
.match-top .tag { font: 600 12px/1 var(--text); color: var(--k); letter-spacing: .02em; }
.match-top .pill { margin-left: auto; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.side { min-width: 0; }
.side.r { text-align: right; }
.side .city { font: 800 19px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }

.side .who { margin-top: 4px; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.side .who a { text-decoration: none; }
.side .who a:hover { text-decoration: underline; }
.side.lost { opacity: .55; }
.side.won .city::after { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 0 3px 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.side.r.won .city::after { display: none; }
.side.r.won .city::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 6px 3px 0; border-radius: 50%; background: currentColor; vertical-align: middle; }
.score { display: flex; align-items: center; gap: 6px; font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.score .s.lost { color: var(--muted); }
.score .sep { color: var(--muted); font-size: 22px; }
.score.vs { font: 600 13px/1 var(--text); color: var(--muted); }
.match.is-live .score { background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 10px; }
.match.is-live .score .sep, .match.is-live .score .s.lost { color: color-mix(in srgb, var(--bg) 60%, var(--ink)); }
.match-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* админ-панель в карточке */
.ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px dashed color-mix(in srgb, var(--c) 30%, var(--line)); padding-top: 10px; }
.ctl .grow { flex: 1; }
.stepper { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 20px; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-2); }
.stepper b { min-width: 30px; text-align: center; font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.stepper .lbl { font: 700 12px/1 var(--text); text-transform: uppercase; padding-left: 12px; letter-spacing: .04em; }
.stepper .lbl { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- список (вид «по категориям») ---------- */
.list-group { margin-bottom: 26px; }
.list-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.when { font: 700 13px/1 var(--text); color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- результаты ---------- */
.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); padding: 18px; min-width: 0; }
.card-tint { --c: var(--muted); --t: var(--surface); --k: var(--ink); background: var(--t); border-color: color-mix(in srgb, var(--c) 22%, transparent); }
.cat-card-head { display: flex; align-items: center; gap: 12px; }
.cat-card-head .h3 { color: var(--k); }
.cat-result { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 6px; font: 800 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.cat-result small { font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.cat-verdict { font-weight: 600; font-size: 14px; }
.cat-verdict .ph { vertical-align: -3px; }
.podium { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.podium li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; background: color-mix(in srgb, var(--surface) 75%, transparent); border-radius: 12px; padding: 8px 12px 8px 8px; }
.medal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 16px/1 var(--display); background: var(--surface-2); }
.medal.m1 { background: #f2c94c; color: #3b2c00; }
.medal.m2 { background: #cfd4da; color: #283038; }
.medal.m3 { background: #d9a273; color: #3a1f07; }
.podium .nm { font-weight: 600; font-size: 14px; line-height: 1.2; min-width: 0; }
.podium .nm small { display: block; font-weight: 500; font-size: 12px; }
.podium .val { font: 800 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.podium .val small { font: 500 11px/1 var(--text); color: var(--muted); margin-left: 3px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: right; font: 600 11.5px/1 var(--text); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td { text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t th.l, .t td.l { text-align: left; }
.t td.pl { width: 46px; }
.t td.main { font-weight: 700; }
.t tbody tr { transition: background .15s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--surface-2); }
.t .pname { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.t .pname small { font-weight: 500; }
.city-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.place { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 800 15px/1 var(--display); }
.place.p1 { background: #f2c94c; color: #3b2c00; } .place.p2 { background: #cfd4da; color: #283038; } .place.p3 { background: #d9a273; color: #3a1f07; }
.pos { color: #23804b; } .neg { color: var(--danger); }
.form { display: inline-flex; gap: 3px; }
.form i { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font: 700 10px/1 var(--text); font-style: normal; color: #fff; }
.form i.w { background: #2f9a5a; } .form i.l { background: #c9cdc6; color: #4a4f4a; } .form i.d { background: #9aa19b; }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi b { display: block; font: 800 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.kpi span { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.cmp { display: grid; gap: 14px; }
.cmp-row { display: grid; grid-template-columns: 150px 52px 1fr 52px; gap: 12px; align-items: center; }
.cmp-row .lbl { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cmp-row .n { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.cmp-row .n.r { text-align: right; }
.cmp-row .tug { height: 12px; background: var(--surface-2); }
.cmp-row .tug::after { background: var(--surface); }

.hl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hl-card .k { font: 600 12px/1 var(--text); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hl-card .v { font: 800 30px/1 var(--display); margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.hl-card .d { font-size: 13.5px; color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- турниры ---------- */
.t-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.t-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.t-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.t-card .h3 { font-size: 26px; }
.t-card .sc { display: flex; align-items: baseline; gap: 10px; font: 800 30px/1 var(--display); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.t-card .sc .vs { font-size: 16px; color: var(--muted); }
.t-card.current { border-color: var(--ink); }

/* ---------- формы / управление ---------- */
.manage-nav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 12px; width: 100%; font-size: 15px; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.roster-col { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.roster-col h4 { margin: 0 0 10px; font: 800 18px/1 var(--display); text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.pchip button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row .input { height: 38px; font-size: 14px; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }
.notice .ph { font-size: 20px; flex: none; }
.notice.warn { background: color-mix(in srgb, var(--ball) 30%, var(--surface)); color: var(--ink); }
.mtable td .input { height: 36px; font-size: 13px; padding: 0 8px; min-width: 90px; }

/* ---------- модалка, тосты ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 10, .45); display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease); }
.modal { background: var(--surface); border-radius: 22px; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); animation: rise .3s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-wide { width: min(760px, 100%); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.final-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 10px 0 18px; }
.final-score .side-in { display: grid; gap: 8px; justify-items: center; text-align: center; }
.final-score .side-in .city { font: 800 22px/1 var(--display); text-transform: uppercase; }
.final-score .side-in .who { font-size: 12.5px; color: var(--muted); min-height: 32px; }
.big-step { display: flex; align-items: center; gap: 6px; }
.big-step button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 22px; display: grid; place-items: center; }
.big-step input { width: 70px; height: 64px; text-align: center; font: 800 44px/1 var(--display); border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.big-step input::-webkit-outer-spin-button, .big-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.big-step input { -moz-appearance: textfield; appearance: textfield; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.toasts { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow); animation: rise .3s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--danger); color: #fff; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .ph { font-size: 40px; display: block; margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .big-av { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font: 800 26px/1 var(--display); color: #fff; }

.hist { display: grid; gap: 8px; margin-top: 14px; }
.hist-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.hist-row .sc { font: 800 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.res-w { color: #23804b; font-weight: 700; } .res-l { color: var(--danger); font-weight: 700; }

.footer { padding: 30px 0 40px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.admin-strip { background: var(--ball); color: var(--ball-ink); font-size: 13px; font-weight: 600; }
.admin-strip .wrap { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.admin-strip .ph { font-size: 17px; }
.admin-strip button { margin-left: auto; background: none; border: 0; font-weight: 700; text-decoration: underline; color: inherit; }

.reveal { animation: rise .5s var(--ease) both; }

/* ---------- адаптив ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .res-grid, .hl-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --tabbar-h: 64px; }
  html { scroll-padding-top: 120px; }
  .wrap { padding: 0 16px; }
  .topbar .wrap { height: 56px; }
  .nav { display: none; }
  .brand-text { font-size: 17px; }
  .filters { top: 56px; padding: 10px 0; }
  .filters .wrap { flex-wrap: wrap; gap: 8px; }
  .filters .chips { flex: 1 1 100%; min-width: 0; }
  .chip.no-badge { padding: 0 14px; }
  .desk-only { display: none; }
  .chip { height: 40px; padding: 0 12px 0 5px; font-size: 13.5px; }
  .chip .lbl-long { display: none; }
  .chip .cat { width: 28px; height: 28px; font-size: 15px; }
  .hero { padding: 18px 0 14px; }
  .hero h1 { margin-top: 10px; }
  .meta-row { gap: 12px 16px; margin-top: 18px; }
  .meta-sep { display: none; }
  .meta .ph { font-size: 22px; }
  .board { border-radius: 22px; padding: 18px 16px 14px; }
  .board-colon { font-size: 40px; }
  .bc-row .name { display: none; }
  .bc-row { grid-template-columns: 26px 26px 1fr 26px; gap: 8px; }
  .h2 { font-size: 28px; }

  .sched-head { display: none; }
  .slot { grid-template-columns: 1fr; gap: 8px; }
  .slot-time { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; background: none; border: 0; padding: 10px 2px 0; }
  .slot-time .rw { display: inline; font: inherit; letter-spacing: 0; text-transform: none; color: inherit; margin: 0; }
  .slot-time.now-slot { box-shadow: none; }
  .slot-time b { font-size: 24px; }
  .slot-time .round-tag { margin: 0 0 0 auto; }
  .court-label { display: inline; font: 700 12px/1 var(--text); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
  .empty-cell { display: none; }
  .now-grid, .list-grid { grid-template-columns: 1fr; }
  .score { font-size: 28px; }
  .ctl .stepper { flex: 1 1 0; justify-content: space-between; min-width: 0; }
  .ctl .stepper button { width: 38px; }
  .ctl .stepper .lbl { padding-left: 10px; }
  .ctl .btn-dark, .ctl .btn-ball { flex: 1 1 100%; min-height: 42px; }
  .ctl .grow { display: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--muted); }
  .tabbar a .ph { font-size: 23px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] .ph { background: var(--ball); color: var(--ball-ink); border-radius: 99px; padding: 3px 14px; }

  .cmp-row { grid-template-columns: 1fr 40px 40px; grid-template-areas: "l a b" "t t t"; row-gap: 6px; }
  .cmp-row .lbl { grid-area: l; } .cmp-row .n:not(.r) { grid-area: a; text-align: right; } .cmp-row .n.r { grid-area: b; } .cmp-row .tug { grid-area: t; }
  .roster { grid-template-columns: 1fr; }
  .t th, .t td { padding: 10px 8px; }
  .t .hide-m { display: none; }
  .t .pname { white-space: normal; line-height: 1.25; }
  .t td.l { white-space: normal; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; width: 100%; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .big-step button { width: 42px; height: 42px; }
  .big-step input { width: 58px; height: 56px; font-size: 38px; }
  .final-score { gap: 6px; }
  .footer { padding-bottom: 24px; }
}


/* ---------- v2: компактный счёт, форматы, американо ---------- */
.board-score { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin: 16px 0 14px; }
.bs-city { font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; opacity: .75; }
.bs-city.lead { opacity: 1; }

.bs-n { font: 800 clamp(64px, 8vw, 92px)/.85 var(--display); font-variant-numeric: tabular-nums; color: #a9ada6; }
.bs-n.lead { color: #fff; }
.board-score .board-colon { padding: 0; font-size: 48px; align-self: center; }
.cat-result { display: flex; align-items: baseline; justify-content: flex-start; gap: 10px; margin: 16px 0 6px; font: 800 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.cat-result small { font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.cat-result .colon { color: var(--muted); font-size: 30px; }
.versus-sub { font-size: clamp(26px, 4vw, 40px); color: var(--ink-2); flex-wrap: wrap; gap: 10px; }
.versus-sub .vs { font-size: .6em; }
.board-leaders { display: grid; gap: 8px; margin-top: 16px; }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; background: #1f2320; border-radius: 12px; padding: 8px 12px 8px 8px; color: #f4f5f1; }
.lb li[data-act] { cursor: pointer; }
.lb .nm { font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .val { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.lb .val small { font: 500 11px/1 var(--text); color: #a9ada6; margin-left: 4px; }
.lb .muted-li { display: block; color: #a9ada6; font-size: 13.5px; background: none; padding: 4px 0; }
.lb-cat { display: flex; align-items: center; gap: 8px; font: 600 12px/1 var(--text); color: #a9ada6; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.rest-line { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 0 4px 4px; margin-top: -2px; }
.rest-line .ph { font-size: 16px; }
.side.solo .who { font-weight: 600; font-size: 14px; color: var(--ink); margin-top: 0; }
.side .city.neutral, .neutral-c { color: var(--ink); }
.stepper .lbl.neutral { color: var(--ink-2); }
.score-sets { gap: 8px; font-size: 22px; }
.score-sets .set { display: inline-flex; align-items: baseline; }
.score-sets .set b { font-weight: 800; }
.score-sets .set b + b::before { content: ":"; color: var(--muted); margin: 0 1px; font-size: .8em; }
.score-sets .set b.lost { color: var(--muted); }
.match.is-live .score-sets b.lost { color: color-mix(in srgb, var(--bg) 60%, var(--ink)); }
.swap-banner { display: flex; align-items: center; gap: 10px; background: var(--ball); color: var(--ball-ink); border-radius: 14px; padding: 10px 12px 10px 16px; margin-bottom: 14px; font-weight: 600; font-size: 14px; position: sticky; top: 74px; z-index: 15; }
.swap-banner .ph { font-size: 20px; }
.swap-banner .btn { margin-left: auto; }
.match.swap-src { outline: 2px dashed var(--ink); outline-offset: 2px; }
.match.swap-target { cursor: pointer; }
.match.swap-target:hover { box-shadow: 0 0 0 2px var(--ball); }
.t tr.row-swap td { background: color-mix(in srgb, var(--ball) 30%, transparent); }
.sched-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.check:has(input:checked) { border-color: var(--ink-2); background: var(--surface-2); }
.check input { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; }
.checks-players { max-height: 240px; overflow: auto; padding: 2px; }
.format-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fmt-card { position: relative; display: grid; gap: 6px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; background: var(--surface); transition: border-color .2s var(--ease), background .2s var(--ease); }
.fmt-card input { position: absolute; opacity: 0; pointer-events: none; }
.fmt-card b { font: 800 20px/1 var(--display); text-transform: uppercase; }
.fmt-card span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.fmt-card:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--ball) 22%, var(--surface)); }
.fmt-card:has(input:focus-visible) { outline: 2px solid var(--budva); outline-offset: 2px; }
.sets-grid { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 8px 12px; align-items: center; margin: 6px 0 4px; }
.sg-h { text-align: center; display: grid; gap: 4px; justify-items: center; }
.sg-h .city { font: 800 20px/1 var(--display); text-transform: uppercase; }
.sg-h .who { font-size: 12.5px; color: var(--muted); }
.sg-l { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.sg-in { text-align: center; font: 800 26px/1 var(--display) !important; height: 52px !important; }
.team-list { display: grid; gap: 8px; margin-top: 12px; }
.team-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 14px; }
.tr-name { display: grid; flex: 1; min-width: 0; }
.tr-name small { font-size: 12.5px; }
.team-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.team-form .input { height: 40px; font-size: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.roster-1 { grid-template-columns: 1fr; }
.mob-cards { display: none; }
.sc-lead { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.sc-lead .ph { color: #c9a227; font-size: 18px; }
.t th.th-main { color: var(--ink); }
.big-av.neutral { background: var(--ink); color: var(--bg); }
.nowrap { white-space: nowrap; }
@media (max-width: 980px) {
  .three-col { grid-template-columns: 1fr; }
  .team-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .rest-line { grid-column: 1 / -1; padding: 0 2px; }
  .bs-city { font-size: 18px; }
  .board-score { gap: 10px; }
  .board-score .board-colon { font-size: 36px; }
  .format-pick { grid-template-columns: 1fr; }
  .desk-table { display: none; }
  .mob-cards { display: grid; gap: 10px; }
  .swap-banner { top: 64px; }
  .sets-grid { grid-template-columns: 48px 1fr 1fr; gap: 8px; }
  .team-form { grid-template-columns: 1fr; }
  .score-sets { font-size: 18px; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.board:has(.board-leaders) { align-self: start; }

/* ---------- вход, аккаунт, ссылка на турнир ---------- */
.ico { width: 18px; height: 18px; flex: none; }
.acc-btn { padding: 0 10px 0 5px; gap: 8px; }
.acc-btn .avatar { background: var(--ink); color: var(--bg); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 20px; }
.organizer { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.organizer b { color: var(--ink); font-weight: 600; }
.organizer .ph { font-size: 17px; }
.share-note { align-items: center; margin-bottom: 14px; }
.share-note .ico { width: 20px; height: 20px; }
.share-note span { min-width: 0; overflow-wrap: anywhere; }
.share-note a { font-weight: 600; }
.share-note .btn { margin-left: auto; flex: none; }
a.btn { text-decoration: none; }

.btn-tg { width: 100%; min-height: 50px; font-size: 16px; }
.btn-tg .ph { font-size: 22px; }
.login-steps { margin: 16px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.login-wait { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.acc-h { font: 600 12px/1 var(--text); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 18px 0 10px; }
.acc-list { display: grid; gap: 6px; }
.acc-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; font-size: 14px; }
.acc-list a:hover { background: color-mix(in srgb, var(--ink) 7%, var(--surface)); }
.acc-list a span { font-size: 12.5px; white-space: nowrap; }

/* ---------- турниры: главные крупно, остальные компактно ---------- */
.t-group { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.t-group .count { font: 700 16px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.t-group-rest { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.t-group-rest .h3 { font-size: 19px; color: var(--ink-2); }
.t-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.t-meta { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.t-list-main { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.t-main { padding: 24px; gap: 16px; }
.t-main .h3 { font-size: 40px; line-height: .95; text-wrap: balance; }
.t-main .sc { font-size: 40px; }
.t-main .sc-lead { font-size: 16px; }
.t-list-mini { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.t-mini { padding: 14px; gap: 8px; border-radius: 14px; }
.t-mini .pill { height: 22px; font-size: 11.5px; padding: 0 8px; }
.t-mini-title { font-weight: 600; font-size: 15.5px; line-height: 1.25; overflow-wrap: anywhere; }
.t-mini .t-meta { margin-top: 0; font-size: 13px; }
.t-mini-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.t-mini-foot .who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.t-mini-foot .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-mini-foot .tnum { white-space: nowrap; }
.pill-own { background: var(--ink); color: var(--bg); }
.t-none { padding: 28px 16px; }
.t-none .btn { margin-top: 14px; }

@media (max-width: 760px) {
  .t-main { padding: 18px; }
  .t-main .h3 { font-size: 32px; }
  .t-main .sc { font-size: 32px; }
  .hero-actions { margin-top: 16px; }
  .share-note { flex-wrap: wrap; }
  .share-note .btn { margin-left: 0; }
}

/* ---------- главная без вкладок, живое обновление ---------- */
.nav:empty, .tabbar:empty { display: none; }
body.no-tabs { --tabbar-h: 0px; }
.no-anim .reveal { animation: none; }

/* ---------- полоса турнира: путь назад и меню разделов (шапка сайта над ней не меняется) ---------- */
body.in-t .topbar { position: static; }
/* липнет сама обёртка #tbar: она стоит прямо в body, как и шапка */
#tbar { position: sticky; top: 0; z-index: 30; }
.tbar {
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 60px; }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.crumbs a { display: inline-flex; align-items: center; gap: 2px; flex: none; min-height: 36px; padding: 0 12px 0 6px; margin-left: -6px; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.crumbs a:hover { background: var(--surface); color: var(--ink); }
.crumbs .sep { color: var(--muted); }
.crumbs b { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbar .nav { flex: none; box-shadow: none; }
body.in-t .filters { top: 62px; }
body.in-t .swap-banner { top: 70px; }

/* ---------- автообновление ---------- */
.autoref { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ring { width: 18px; height: 18px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--line-2); stroke-width: 2.5; }
.ring .run { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 50.3; stroke-dashoffset: 50.3; animation: ring-fill 30s linear forwards; }
@keyframes ring-fill { to { stroke-dashoffset: 0; } }
.autoref .btn.busy .ring { animation: spin .8s linear infinite; }

/* ---------- подсказки имён ---------- */
.suggest-wrap { position: relative; display: block; min-width: 0; }
.add-row.suggest-wrap { display: flex; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25;
  display: grid; gap: 2px; padding: 6px; max-height: 300px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 6px 8px -4px rgba(18, 20, 18, .2);
}
.suggest-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14.5px; }
.suggest-item:hover, .suggest-item.active { background: var(--surface-2); }
.suggest-item b { font-weight: 700; }
.suggest-item small { flex: none; color: var(--muted); font-size: 12.5px; }
.suggest-new { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.suggest-new .ph { font-size: 16px; }
.locked-row { align-items: center; min-height: 38px; font-size: 13px; }
.locked-row .pname-ro { font-weight: 600; font-size: 14px; }
.locked-row .muted { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .tbar .wrap { min-height: 48px; }
  body.in-t .filters { top: 49px; }
  body.in-t .swap-banner { top: 57px; }
  .team-form .suggest-wrap { grid-column: 1 / -1; }
}

/* ---------- команды командного турнира ----------
   Восемь цветов. У каждого: сам цвет (--qN), тёмный для текста на светлом (--qN-ink), бледный фон (--qN-tint)
   и светлый для тёмного табло (--qN-dark). Первые два — прежние «Бар» и «Будва».
   Класс q1…q8 на элементе выбирает цвет; q-c красит текст, q-dot рисует кружок. */
:root {
  --q1: #b8743c; --q1-ink: #95561f; --q1-tint: #f6ece2; --q1-dark: #e2a571;
  --q2: #3d8ad6; --q2-ink: #1f68b3; --q2-tint: #e6f0fa; --q2-dark: #8cc0f2;
  --q3: #2f9d6a; --q3-ink: #1f7550; --q3-tint: #e3f3eb; --q3-dark: #7fd3a8;
  --q4: #8363d6; --q4-ink: #6344b8; --q4-tint: #ede8fa; --q4-dark: #b7a3f0;
  --q5: #d2544b; --q5-ink: #b0362e; --q5-tint: #fae7e5; --q5-dark: #f09a93;
  --q6: #1f9aa3; --q6-ink: #14707a; --q6-tint: #dff2f3; --q6-dark: #7fd0d6;
  --q7: #b99720; --q7-ink: #836a0c; --q7-tint: #f6f0d6; --q7-dark: #e0c766;
  --q8: #c9539b; --q8-ink: #a3357a; --q8-tint: #f8e6f1; --q8-dark: #eba0cf;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --q1: #d68f55; --q1-ink: #e6a36b; --q1-tint: #2a2119;
    --q2: #5aa2ea; --q2-ink: #7cb6f0; --q2-tint: #172331;
    --q3: #4fb886; --q3-ink: #7fd3a8; --q3-tint: #15261e;
    --q4: #9a80e6; --q4-ink: #b7a3f0; --q4-tint: #1f1a30;
    --q5: #e2726a; --q5-ink: #f09a93; --q5-tint: #2c1917;
    --q6: #3db3bc; --q6-ink: #7fd0d6; --q6-tint: #12272a;
    --q7: #cfae3a; --q7-ink: #e0c766; --q7-tint: #2a2410;
    --q8: #d870ae; --q8-ink: #eba0cf; --q8-tint: #2b1724;
  }
}
:root[data-theme="dark"] {
  --q1: #d68f55; --q1-ink: #e6a36b; --q1-tint: #2a2119;
  --q2: #5aa2ea; --q2-ink: #7cb6f0; --q2-tint: #172331;
  --q3: #4fb886; --q3-ink: #7fd3a8; --q3-tint: #15261e;
  --q4: #9a80e6; --q4-ink: #b7a3f0; --q4-tint: #1f1a30;
  --q5: #e2726a; --q5-ink: #f09a93; --q5-tint: #2c1917;
  --q6: #3db3bc; --q6-ink: #7fd0d6; --q6-tint: #12272a;
  --q7: #cfae3a; --q7-ink: #e0c766; --q7-tint: #2a2410;
  --q8: #d870ae; --q8-ink: #eba0cf; --q8-tint: #2b1724;
}
.q1 { --q: var(--q1); --qi: var(--q1-ink); --qt: var(--q1-tint); --qd: var(--q1-dark); }
.q2 { --q: var(--q2); --qi: var(--q2-ink); --qt: var(--q2-tint); --qd: var(--q2-dark); }
.q3 { --q: var(--q3); --qi: var(--q3-ink); --qt: var(--q3-tint); --qd: var(--q3-dark); }
.q4 { --q: var(--q4); --qi: var(--q4-ink); --qt: var(--q4-tint); --qd: var(--q4-dark); }
.q5 { --q: var(--q5); --qi: var(--q5-ink); --qt: var(--q5-tint); --qd: var(--q5-dark); }
.q6 { --q: var(--q6); --qi: var(--q6-ink); --qt: var(--q6-tint); --qd: var(--q6-dark); }
.q7 { --q: var(--q7); --qi: var(--q7-ink); --qt: var(--q7-tint); --qd: var(--q7-dark); }
.q8 { --q: var(--q8); --qi: var(--q8-ink); --qt: var(--q8-tint); --qd: var(--q8-dark); }
.q-c { color: var(--qi); }
.board .q-c { color: var(--qd); }
.q-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--q); }
.q-dot-lg { width: 14px; height: 14px; }
.pname .q-dot { margin-right: 2px; }

/* название турнира → кто играет: три и больше команд идут списком */
.versus { flex-wrap: wrap; overflow-wrap: anywhere; }
.versus-many { gap: 6px 12px; }
.versus-many .vs { color: var(--line-2); }

/* табло двух команд с длинными названиями: названия над цифрами */
.board-score.long { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "ca . cb" "na colon nb"; align-items: end; gap: 6px 14px; }
.board-score.long .bs-city { font-size: 17px; line-height: 1.05; overflow-wrap: anywhere; }
.board-score.long > :nth-child(1) { grid-area: ca; text-align: right; }
.board-score.long > :nth-child(2) { grid-area: na; text-align: right; }
.board-score.long > :nth-child(3) { grid-area: colon; }
.board-score.long > :nth-child(4) { grid-area: nb; }
.board-score.long > :nth-child(5) { grid-area: cb; }

/* табло трёх и более команд: таблица мест */
.lb-squads { margin-top: 16px; }
.lb-squads li { grid-template-columns: 30px 1fr auto auto; }
.lb-squads .nm { font: 800 19px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; white-space: normal; overflow-wrap: anywhere; }
.lb-squads .games { font-size: 12.5px; color: #a9ada6; }
.lb-squads .val { min-width: 2.2em; text-align: right; }
.lb .medal.m0 { background: #2b2f2c; color: #a9ada6; }
.lb-squads .medal:not(.m1):not(.m2):not(.m3) { background: #2b2f2c; color: #cfd2cc; }
.board:has(.lb-squads) { align-self: start; }
/* по категориям: сетка «категория × команда» — числа ровно под названиями команд */
.bc-grid { grid-template-columns: 28px minmax(0, 1fr) repeat(var(--n), minmax(30px, max-content)); gap: 8px 14px; align-items: center; font-size: 13px; color: #cfd2cc; }
.bc-grid .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-grid .bc-h { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font: 700 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.bc-grid b { text-align: center; font: 700 18px/1 var(--display); font-variant-numeric: tabular-nums; }

/* результаты: места команд в карточке категории */
.res-gap { margin-top: 18px; }
.sq-mini { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; gap: 6px; }
.sq-mini li { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 10px; font-size: 14px; }
.sq-mini .nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.sq-mini .games { font-size: 12.5px; color: var(--muted); }
.sq-mini b { min-width: 1.6em; text-align: right; font: 800 22px/1 var(--display); }
.sq-mini .place { width: 26px; height: 26px; font-size: 14px; background: color-mix(in srgb, var(--surface) 75%, transparent); }
.t .pname b { font: 800 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; }

/* статистика: таблица «показатель × команда» */
.qmx th { vertical-align: bottom; }
.qmx thead th { font: 800 15px/1.1 var(--display); letter-spacing: .01em; white-space: normal; min-width: 84px; }
.qmx tbody th { font: 600 14px/1.3 var(--text); text-transform: none; letter-spacing: 0; color: var(--ink); white-space: nowrap; border-bottom: 1px solid var(--line); }
.qmx tbody th .cat { vertical-align: middle; margin-right: 4px; }
.qmx td { color: var(--ink-2); }
.qmx td b { display: block; font: 700 20px/1 var(--display); }
.qmx td.best b { color: var(--ink); font-weight: 800; }
.qmx td.best { background: var(--surface-2); }
.qmx tr:last-child th, .qmx tr:last-child td { border-bottom: 0; }
.qbar { display: block; height: 5px; margin: 7px 0 0 auto; width: 100%; max-width: 110px; border-radius: 9px; background: var(--line); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 9px; background: var(--q); }
.cmp-row .tug i { background: var(--q); }

/* список турниров: счёт или лидер командного турнира */
.t-card .sc { flex-wrap: wrap; }
.t-card .sc.sc-long { font-size: 26px; }
.sc-lead .q-c { font-weight: 700; }
.sc-lead .muted { margin-left: 2px; }
.t-squads { display: flex; flex-wrap: wrap; gap: 2px 8px; font-weight: 600; }
.t-squads i { font-style: normal; color: var(--line-2); }

/* управление: команды, составы, игроки */
.squads-card { margin-top: 14px; }
.squads-note { font-size: 13.5px; margin: 6px 0 12px; max-width: 70ch; }
.squad-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 14px; }
.squad-row, .squad-in { display: flex; align-items: center; gap: 8px; margin: 0; }
.squad-add { max-width: 460px; margin-top: 14px; }
.roster-squads { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.roster-col h4 { gap: 10px; overflow-wrap: anywhere; }
.players-add { max-width: 460px; margin: 12px 0 14px; }
.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 6px 14px; }
.players-grid .add-row { margin: 0; }
.squads-field { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.squad-ins { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px 12px; }
.squad-in .input { height: 40px; }
.squads-tools { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.squads-rank { min-width: 220px; }
.squads-rank .input { height: 40px; }
.btn[hidden], .squads-field[hidden] { display: none; }
