/* ═════════════════════════════════════════════════════════════════
   Dubai Padel League · Dubai — dark scoreboard theme
   Mobile-first (390px primary) · desktop ≥ 900px
   ═════════════════════════════════════════════════════════════════ */

:root {
  --bg: #090b10;
  --bg-2: #0d1118;
  --navy: #0f1524;
  --surface: #121826;
  --surface-2: #1a2235;
  --surface-3: #222c44;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --text: #f3f5f9;
  --text-2: #c6cdda;
  --muted: #8a93a6;

  --orange: #ff6a1a;
  --orange-2: #ff8a3d;
  --orange-soft: rgba(255, 106, 26, 0.14);
  --orange-glow: rgba(255, 106, 26, 0.45);

  --gold: #f6c343;   --gold-soft: rgba(246, 195, 67, 0.14);
  --silver: #d3dae6; --silver-soft: rgba(211, 218, 230, 0.12);
  --bronze: #d58a52; --bronze-soft: rgba(213, 138, 82, 0.14);
  --green: #3ad38a;  --green-soft: rgba(58, 211, 138, 0.14);
  --red: #ff5f5f;    --red-soft: rgba(255, 95, 95, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --pad: 14px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --topbar-h: 56px;
}

/* ─── Reset / base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 56px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: 0.01em; }
p { margin: 0; }
a { color: var(--orange-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ol, ul { margin: 0; padding: 0; list-style: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.show-mobile { display: inline; }
.hide-mobile { display: none; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--pad); }

/* ambient glow */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(255, 106, 26, 0.16), transparent 60%),
    radial-gradient(700px 400px at 100% 10%, rgba(53, 94, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 60%);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary { background: var(--orange); color: #0b0d12; box-shadow: 0 6px 18px rgba(255, 106, 26, 0.3); }
.btn--primary:hover { background: var(--orange-2); text-decoration: none; }
.btn--ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { background: var(--surface-3); text-decoration: none; }
.btn--danger { color: var(--red); }
.btn--danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn--sm { padding: 8px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn--sm { width: 30px; height: 30px; font-size: 14px; }

/* ─── Chips / badges ────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.chip--count { color: var(--muted); }

.cat {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; letter-spacing: 0.06em;
  font-size: 13px; line-height: 1; padding: 5px 9px; border-radius: 7px;
  border: 1px solid transparent; vertical-align: middle; white-space: nowrap;
}
.cat--xs { font-size: 11px; padding: 3px 6px; border-radius: 5px; }
.cat--lg { font-size: 20px; padding: 8px 14px; border-radius: 9px; }
.cat--P100  { background: var(--bronze-soft); color: var(--bronze); border-color: rgba(213, 138, 82, 0.45); }
.cat--P500  { background: var(--silver-soft); color: var(--silver); border-color: rgba(211, 218, 230, 0.4); }
.cat--P1000 { background: var(--gold-soft);   color: var(--gold);   border-color: rgba(246, 195, 67, 0.5); }

.status { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.status--completed { background: var(--green-soft); color: var(--green); }
.status--upcoming  { background: var(--orange-soft); color: var(--orange-2); }
.status--pending   { background: var(--surface-3); color: var(--muted); }

/* ─── Top bar ───────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(9, 11, 16, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-family: var(--font-display); font-size: 18px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; color: var(--orange); flex: 0 0 auto; }
.brand__word { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.02em; }
.brand__word strong { font-weight: 900; }
.topbar__links { display: none; margin-left: auto; gap: 4px; }
.topbar__links a { padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.topbar__links a:hover, .topbar__links a.is-active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar .btn { margin-left: auto; }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero { padding: 26px 0 18px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -40px; width: 260px; height: 260px;
  border-radius: 50%; border: 2px solid rgba(255, 106, 26, 0.12); pointer-events: none;
  box-shadow: inset 0 0 0 40px rgba(255, 106, 26, 0.03);
}
.hero__inner { display: grid; gap: 18px; position: relative; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--orange-soft); } 50% { box-shadow: 0 0 0 7px rgba(255, 106, 26, 0.05); } }
.hero__title { font-size: clamp(40px, 11vw, 76px); font-weight: 900; line-height: 0.95; text-transform: uppercase; margin-top: 8px; letter-spacing: 0.005em; }
.hero__brand { color: var(--orange); display: block; }
.hero__subtitle { margin-top: 10px; color: var(--text-2); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat__label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.stat__value--accent { color: var(--orange-2); }
.stat__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }

/* ─── Quick nav (mobile chips) ──────────────────────────────── */
.quicknav {
  position: sticky; top: var(--topbar-h); z-index: 30;
  background: rgba(9, 11, 16, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.quicknav__inner { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.quicknav__inner::-webkit-scrollbar { display: none; }
.quicknav a {
  flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.quicknav a.is-active { color: #0b0d12; background: var(--orange); border-color: var(--orange); }
.quicknav a:hover { text-decoration: none; }

/* ─── Layout / cards ────────────────────────────────────────── */
.layout { display: grid; gap: 14px; padding-top: 14px; padding-bottom: 24px; }
.grid-2 { display: grid; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px var(--pad); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset; min-width: 0;
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__title { font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1; }
.card__meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 0 4px; }

/* ─── Podium ────────────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; align-items: end; }
.podium__card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 12px 6px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); color: var(--text); min-width: 0;
  position: relative; transition: transform 0.15s ease, border-color 0.15s ease;
}
.podium__card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.podium__card--1 { order: 2; padding-top: 16px; padding-bottom: 14px; border-color: rgba(246, 195, 67, 0.5); background: linear-gradient(180deg, rgba(246, 195, 67, 0.16), var(--surface) 70%); box-shadow: 0 0 0 1px rgba(246, 195, 67, 0.15), 0 14px 30px rgba(246, 195, 67, 0.08); }
.podium__card--2 { order: 1; border-color: rgba(211, 218, 230, 0.35); background: linear-gradient(180deg, rgba(211, 218, 230, 0.1), var(--surface) 70%); }
.podium__card--3 { order: 3; border-color: rgba(213, 138, 82, 0.4); background: linear-gradient(180deg, rgba(213, 138, 82, 0.12), var(--surface) 70%); }
.podium__rank {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
  font-family: var(--font-display); font-weight: 900; font-size: 14px; display: grid; place-items: center; color: #0b0d12;
}
.podium__card--1 .podium__rank { background: var(--gold); }
.podium__card--2 .podium__rank { background: var(--silver); }
.podium__card--3 .podium__rank { background: var(--bronze); }
.podium__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.1; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.podium__card--1 .podium__name { font-size: 17px; }
.podium__country { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__pts { font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1; color: var(--orange-2); margin-top: 4px; }
.podium__pts small { font-size: 11px; font-weight: 600; margin-left: 3px; color: var(--muted); }
.podium__meta { font-size: 11px; color: var(--muted); }

/* avatars */
.avatar {
  position: relative; width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 14px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
}
.avatar--lg { width: 48px; height: 48px; font-size: 18px; }
.avatar--xl { width: 64px; height: 64px; font-size: 24px; }
.avatar__flag { position: absolute; right: -4px; bottom: -4px; font-size: 14px; line-height: 1; background: var(--surface); border-radius: 50%; padding: 1px; }
.avatar--lg .avatar__flag, .avatar--xl .avatar__flag { font-size: 18px; }

/* ─── Search / toolbar ──────────────────────────────────────── */
.toolbar { margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 0 10px; }
.search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.search__icon { color: var(--muted); display: inline-flex; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 11px 0; outline: none; font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px; }
.search__clear:hover { color: var(--text); }

/* ─── Ranking table ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); -webkit-overflow-scrolling: touch; }
.table-wrap--inner { margin: 10px 0 8px; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.ranking { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.ranking thead th { padding: 0; text-align: left; border-bottom: 1px solid var(--line-2); }
.th-btn {
  width: 100%; display: inline-flex; align-items: center; gap: 2px; padding: 8px 3px;
  background: transparent; border: 0; color: var(--muted); font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; text-align: left; border-radius: 6px;
}
.th-btn:hover { color: var(--text); }
.th-btn.is-active { color: var(--orange-2); }
.sort-ind { font-size: 9px; }
.col-num .th-btn, .col-pts .th-btn, .col-trend .th-btn { justify-content: center; text-align: center; }
.col-rank { width: 34px; }
.col-num { width: 32px; text-align: center; }
.col-pts { width: 52px; text-align: center; }
.col-trend { width: 50px; text-align: center; }
.ranking tbody td { padding: 8px 3px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ranking tbody tr:last-child td { border-bottom: 0; }
.ranking tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.row--podium td { background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 60%); }
.row--1 td { background: linear-gradient(90deg, var(--gold-soft), transparent 70%); }
.row--2 td { background: linear-gradient(90deg, var(--silver-soft), transparent 70%); }
.row--3 td { background: linear-gradient(90deg, var(--bronze-soft), transparent 70%); }
.row--flash td { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: var(--orange-soft); } 100% { background: transparent; } }

.rank {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text-2); background: var(--surface-2);
}
.rank--1 { background: var(--gold); color: #0b0d12; box-shadow: 0 0 14px rgba(246, 195, 67, 0.45); }
.rank--2 { background: var(--silver); color: #0b0d12; }
.rank--3 { background: var(--bronze); color: #0b0d12; }
.rank--big { width: auto; height: auto; padding: 6px 10px; font-size: 22px; }

.pcell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.flag { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.pcell__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.plink {
  background: transparent; border: 0; padding: 0; text-align: left; color: var(--text);
  font-weight: 600; font-size: 14px; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere;
}
.plink:hover { color: var(--orange-2); }
.pcell__sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row--1 .plink { color: var(--gold); }
.col-num { color: var(--text-2); font-size: 14px; }
.titles { font-weight: 700; color: var(--gold); }
.pts { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--orange-2); }
.row--1 .pts { color: var(--gold); }

.trend { display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 700; min-width: 28px; padding: 2px 4px; border-radius: 6px; white-space: nowrap; }
.trend--up { color: var(--green); background: var(--green-soft); }
.trend--down { color: var(--red); background: var(--red-soft); }
.trend--flat { color: var(--muted); }
.trend--new { color: var(--orange-2); background: var(--orange-soft); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); align-items: center; }
.legend b { font-weight: 700; }
.legend__note { flex-basis: 100%; }

/* ─── Segmented filters ─────────────────────────────────────── */
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 12px; max-width: 100%; }
.seg { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg.is-active { background: var(--surface-3); color: var(--text); }
.seg__count { font-size: 11px; background: var(--surface); padding: 1px 6px; border-radius: 999px; color: var(--text-2); }

/* ─── Tournaments ───────────────────────────────────────────── */
.tgroups { display: grid; gap: 14px; }
.tgroup__label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-family: var(--font); }
.tlist { display: grid; gap: 10px; }
.tcard {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; padding: 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-left-width: 3px; min-width: 0;
}
.tcard--P100 { border-left-color: var(--bronze); }
.tcard--P500 { border-left-color: var(--silver); }
.tcard--P1000 { border-left-color: var(--gold); }
.tcard__cat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tcard__tag { font-size: 10px; color: var(--muted); text-align: center; letter-spacing: 0.04em; text-transform: uppercase; max-width: 64px; line-height: 1.2; }
.tcard__body { min-width: 0; display: grid; gap: 4px; }
.tcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard__name { font-size: 20px; font-weight: 700; line-height: 1.05; min-width: 0; overflow-wrap: anywhere; }
.tcard__meta { font-size: 12px; color: var(--muted); }
.tcard__line { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.tcard__line--win { color: var(--text); font-weight: 600; }
.tcard__line .muted { font-weight: 400; }
.tcard__actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form { display: grid; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field__label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row--4 { grid-template-columns: 1fr 1fr; }
input[type="text"], input[type="search"], input[type="date"], select {
  width: 100%; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font-size: 15px; -webkit-appearance: none; appearance: none;
}
input[type="date"] { min-height: 44px; color-scheme: dark; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
input::placeholder { color: #5f6878; }
.form-error { color: var(--red); background: var(--red-soft); border: 1px solid rgba(255, 95, 95, 0.35); padding: 9px 12px; border-radius: 10px; font-size: 13px; }

.catradios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.catradio { position: relative; cursor: pointer; min-width: 0; }
.catradio input { position: absolute; opacity: 0; inset: 0; }
.catradio__box {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); min-width: 0;
}
.catradio__box b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: 0.05em; }
.catradio__box small { font-size: 10px; color: var(--muted); line-height: 1.2; }
.catradio--P100 .catradio__box b { color: var(--bronze); }
.catradio--P500 .catradio__box b { color: var(--silver); }
.catradio--P1000 .catradio__box b { color: var(--gold); }
.catradio input:checked + .catradio__box { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 0 2px var(--orange-soft); }
.catradio input:focus-visible + .catradio__box { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ─── Players grid ──────────────────────────────────────────── */
.player-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pcard {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); min-width: 0;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.pcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pcard--flash { animation: flashBorder 2.4s ease-out; }
@keyframes flashBorder { 0% { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); } 100% { border-color: var(--line); box-shadow: none; } }
.pcard__text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.pcard__name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__stats { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; flex: 0 0 auto; }
.pcard__stats b { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--orange-2); }
.pcard__stats small { font-size: 11px; color: var(--muted); }

/* ─── How it works ──────────────────────────────────────────── */
.steps { display: grid; gap: 10px; margin-bottom: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step__n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #0b0d12; font-family: var(--font-display); font-weight: 900; font-size: 16px; }
.step b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1.1; margin-bottom: 2px; }
.step p { color: var(--text-2); font-size: 14px; }

.catcards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.catcard { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); border-top-width: 3px; min-width: 0; }
.catcard--P100 { border-top-color: var(--bronze); }
.catcard--P500 { border-top-color: var(--silver); }
.catcard--P1000 { border-top-color: var(--gold); }
.catcard__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.catcard__tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.catcard__list { display: grid; gap: 6px; }
.catcard__list li { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--text-2); padding: 6px 0; border-bottom: 1px dashed var(--line); }
.catcard__list li:last-child { border-bottom: 0; }
.catcard__list b { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text); }
.catcard--P100 .catcard__list b { color: var(--bronze); }
.catcard--P500 .catcard__list b { color: var(--silver); }
.catcard--P1000 .catcard__list b { color: var(--gold); }

.points-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.points-table th, .points-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); font-size: 14px; }
.points-table thead th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
.points-table tbody th { text-align: left; font-weight: 600; }
.points-table tbody th small { display: block; font-size: 11px; font-weight: 400; }
.points-table tbody td { font-family: var(--font-display); font-size: 18px; font-weight: 800; }
.points-table tbody tr:last-child th, .points-table tbody tr:last-child td { border-bottom: 0; }

/* ─── Data tools / footer ───────────────────────────────────── */
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data-actions .btn { flex: 1 1 auto; }
.footer { border-top: 1px solid var(--line); padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--text-2); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ─── Dialogs ───────────────────────────────────────────────── */
.modal {
  border: 1px solid var(--line-2); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text);
  width: min(100% - 20px, 520px); max-height: min(92vh, 92dvh); box-shadow: var(--shadow); overflow: hidden;
}
.modal--wide { width: min(100% - 20px, 680px); }
.modal::backdrop { background: rgba(5, 7, 12, 0.72); backdrop-filter: blur(4px); }
.modal__form { display: grid; gap: 14px; padding: 18px 16px; max-height: min(92vh, 92dvh); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modal__head--bare { justify-content: flex-end; margin-bottom: -40px; position: relative; z-index: 1; }
.modal__title { font-size: 26px; font-weight: 800; text-transform: uppercase; line-height: 1; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal__actions--split { justify-content: space-between; align-items: center; }
.modal__actions .btn { flex: 1 1 auto; }
.modal__actions--split > .btn { flex: 0 0 auto; }
.modal__actions--split > .modal__actions { flex: 1 1 auto; }

/* profile */
.profile { display: grid; gap: 14px; }
.profile__head { display: flex; align-items: center; gap: 12px; padding-right: 44px; }
.profile__id { min-width: 0; flex: 1; }
.profile__name { font-size: 26px; font-weight: 800; line-height: 1; overflow-wrap: anywhere; }
.profile__sub { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.profile__stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; display: grid; gap: 2px; min-width: 0; }
.profile__stats b { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--orange-2); line-height: 1; }
.profile__stats span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.profile__trend { display: flex; align-items: center; gap: 8px; }
.profile__h { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-family: var(--font); font-weight: 700; }
.plist { display: grid; gap: 6px; }
.plist li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.plist__name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; line-height: 1.15; }
.plist__name small { font-size: 11px; color: var(--muted); font-weight: 400; }
.plist__tier { color: var(--text-2); white-space: nowrap; }
.plist__pts { font-family: var(--font-display); font-size: 18px; color: var(--orange-2); }

/* results form */
.results-body { display: grid; gap: 12px; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; background: var(--bg-2); min-width: 0; }
.tier legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.tier legend small { font-family: var(--font); font-size: 12px; font-weight: 400; color: var(--muted); }
.tier__icon { font-size: 16px; }
.pts-chip { font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--orange-2); background: var(--orange-soft); padding: 2px 7px; border-radius: 999px; }
.tier--winner { border-color: rgba(246, 195, 67, 0.4); }
.tier--finalist { border-color: rgba(211, 218, 230, 0.3); }
.tier--semi { border-color: rgba(213, 138, 82, 0.35); }
.tier .field-row { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; inset: 0; }
.chip-check span { display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; white-space: nowrap; }
.chip-check input:checked + span { background: var(--orange); color: #0b0d12; border-color: var(--orange); }
.chip-check input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.chip-check.is-taken { opacity: 0.4; cursor: not-allowed; }
.chip-check.is-taken span { text-decoration: line-through; }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 11px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60; max-width: calc(100% - 24px); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--ok { border-color: rgba(58, 211, 138, 0.5); }
.toast--err { border-color: rgba(255, 95, 95, 0.6); }

/* ═════════════════════════════════════════════════════════════════
   ≥ 640px — large phones / tablets
   ═════════════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  :root { --pad: 20px; }
  .show-mobile { display: none; }
  .hide-mobile { display: inline; }
  .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .col-rank { width: 48px; }
  .col-num { width: 70px; }
  .col-pts { width: 90px; }
  .col-trend { width: 80px; }
  .ranking tbody td { padding: 10px 8px; }
  .th-btn { padding: 10px 8px; font-size: 11px; letter-spacing: 0.08em; }
  .pcell { gap: 8px; }
  .plink { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rank { width: 32px; height: 32px; }
  .plink { font-size: 15px; }
  .pcell__sub { font-size: 12px; }
  .pts { font-size: 20px; }
  .podium { gap: 12px; }
  .podium__card { padding: 16px 10px 14px; }
  .podium__name { font-size: 17px; }
  .podium__card--1 .podium__name { font-size: 20px; }
  .podium__pts { font-size: 28px; }
  .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr 1fr; gap: 14px; }
  .field-row--4 { grid-template-columns: repeat(4, 1fr); }
  .data-actions .btn { flex: 0 1 auto; }
  .modal__form { padding: 22px; }
  .tcard { grid-template-columns: auto 1fr auto; }
  .tcard__actions { grid-column: auto; flex-direction: column; align-items: flex-end; justify-content: flex-start; }
}

/* ═════════════════════════════════════════════════════════════════
   ≥ 900px — desktop
   ═════════════════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  :root { --pad: 24px; }
  body { font-size: 16px; }
  .topbar__links { display: flex; }
  .topbar .btn { margin-left: 0; }
  .quicknav { display: none; }
  html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
  .hero { padding: 48px 0 28px; }
  .hero__inner { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 32px; }
  .hero__title { font-size: clamp(64px, 7vw, 92px); }
  .hero__subtitle { font-size: 17px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat__value { font-size: 28px; }
  .layout { gap: 20px; padding-top: 20px; padding-bottom: 40px; }
  .grid-2 { grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
  .card { padding: 22px 24px; }
  .card__title { font-size: 30px; }
  .podium { gap: 16px; margin-bottom: 20px; }
  .podium__card { padding: 20px 14px 16px; }
  .podium__card--1 { padding-top: 26px; padding-bottom: 20px; }
  .podium__name { font-size: 20px; }
  .podium__card--1 .podium__name { font-size: 24px; }
  .podium__pts { font-size: 34px; }
  .podium__rank { width: 28px; height: 28px; font-size: 16px; top: 10px; left: 10px; }
  .avatar--lg { width: 56px; height: 56px; font-size: 20px; }
  .ranking tbody td { padding: 12px 10px; }
  .col-rank { width: 60px; }
  .col-num { width: 110px; }
  .col-pts { width: 120px; }
  .col-trend { width: 110px; }
  .pts { font-size: 22px; }
  .player-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .footer { padding-top: 22px; font-size: 13px; }
}
@media (min-width: 1100px) {
  .player-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ═════════════════════════════════════════════════════════════════
   v2 — dual ranking · profiles · pairs · matches · share · polish
   ═════════════════════════════════════════════════════════════════ */
:root {
  --platinum: #cfe6ff; --platinum-soft: rgba(207, 230, 255, 0.14);
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 24px; --fs-2xl: 30px;
}
.card__title { font-size: var(--fs-2xl); letter-spacing: 0.03em; }
.card__meta { font-size: var(--fs-sm); }
.card__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ─── Spotlights ────────────────────────────────────────────── */
.spotlights__grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
.spot {
  display: grid; gap: 6px; text-align: left; padding: 12px 14px; border-radius: 14px; color: var(--text);
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; min-width: 0;
}
.spot:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(255, 106, 26, 0.45); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.spot--empty { opacity: 0.6; cursor: default; }
.spot__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-2); }
.spot__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.spot__name { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot__main { font-family: var(--font-display); font-size: 26px; font-weight: 900; color: var(--text); line-height: 1; }
.spot__sub { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Tabs ──────────────────────────────────────────────────── */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); min-width: 0; transition: background 0.15s ease, color 0.15s ease; }
.tab b { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.tab small { font-size: 10px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--orange); color: #0b0d12; box-shadow: 0 6px 16px rgba(255, 106, 26, 0.3); }
.tab.is-active small { color: rgba(11, 13, 18, 0.75); }

/* ─── Switch ────────────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background 0.15s ease; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform 0.15s ease, background 0.15s ease; }
.switch input:checked + .switch__track { background: var(--orange); border-color: var(--orange); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: #0b0d12; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--orange); outline-offset: 2px; }
.switch--block { margin-top: 12px; align-items: flex-start; }
.switch--block .switch__track { margin-top: 2px; }
.toolbar { display: flex; flex-direction: column; gap: 8px; }

/* ─── Pills, badges, scores ─────────────────────────────────── */
.formpills { display: inline-flex; gap: 3px; }
.pill { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 9px; font-weight: 800; font-style: normal; line-height: 1; letter-spacing: 0; }
.pill--w { background: var(--green); color: #052b1a; }
.pill--l { background: rgba(255, 95, 95, 0.22); color: var(--red); border: 1px solid rgba(255, 95, 95, 0.4); }
.legend .pill { margin-right: 2px; vertical-align: middle; }
.lvl { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; vertical-align: middle; }
.lvl--xs { font-size: 9px; padding: 1px 5px; }
.lvl--bronze { background: var(--bronze-soft); color: var(--bronze); border-color: rgba(213, 138, 82, 0.45); }
.lvl--silver { background: var(--silver-soft); color: var(--silver); border-color: rgba(211, 218, 230, 0.4); }
.lvl--gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(246, 195, 67, 0.5); }
.lvl--platinum { background: linear-gradient(135deg, rgba(207, 230, 255, 0.22), rgba(207, 230, 255, 0.08)); color: var(--platinum); border-color: rgba(207, 230, 255, 0.55); box-shadow: 0 0 10px rgba(207, 230, 255, 0.15); }
.score { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
.score--sets { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.score--sets i { font-style: normal; background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 13px; color: var(--text); }
.pend { color: var(--orange-2); font-weight: 600; }
.btn--xs { padding: 5px 9px; font-size: 12px; }
.avatar { overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--sm .avatar__flag { font-size: 11px; }

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 14px; border: 1px dashed var(--line-2); border-radius: 14px; color: var(--text-2); }
.empty-state__icon { font-size: 30px; line-height: 1; }
.empty-state b { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.empty-state p { font-size: var(--fs-sm); color: var(--muted); max-width: 36ch; }
.empty-state .btn { margin-top: 6px; }

/* ─── Ranking table v2 ──────────────────────────────────────── */
.th-static { display: block; padding: 8px 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; }
.col-form { width: 86px; text-align: center; }
.col-finals, .col-trend { display: none; }
.ranking tbody tr { transition: background 0.15s ease; }
.ranking tbody tr:hover td { background: rgba(255, 255, 255, 0.035); }
.ranking tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.ranking tbody tr:hover .pcell { transform: translateX(3px); }
.pcell { transition: transform 0.15s ease; }
.pcell__sub .trend { font-size: 10px; padding: 0 4px; min-width: 0; margin-left: 2px; }
.flag--pair { font-size: 15px; letter-spacing: -2px; }
.pair-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; }
.pair-names .plink { font-size: 13px; }
.amp { color: var(--orange-2); font-weight: 700; font-size: 12px; }
.podium__crown { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 20px; filter: drop-shadow(0 2px 6px rgba(246, 195, 67, 0.5)); }
.podium__card--1 { overflow: visible; }
.podium__avatars { display: inline-flex; }
.podium__avatars .avatar + .avatar { margin-left: -10px; }
.podium__card:not(button) { cursor: default; }

/* ─── Profile ───────────────────────────────────────────────── */
.modal--profile { width: min(100% - 16px, 720px); }
.profile__photo { position: relative; flex: 0 0 auto; }
.photo-btn { position: absolute; right: -6px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-3); font-size: 13px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.photo-btn--rm { right: auto; left: -6px; color: var(--red); font-size: 11px; }
.profile__ranks { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rankchip { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.rankchip b { font-family: var(--font-display); font-size: 18px; color: var(--orange-2); }
.rankchip small { text-transform: uppercase; letter-spacing: 0.06em; font-size: 9px; }
.profile__stats { grid-template-columns: repeat(5, 1fr); }
.profile__stats b small { font-size: 14px; color: var(--muted); font-weight: 700; }
.profile__stats span { font-size: 9px; }
.pblock { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.pblock__h { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); font-family: var(--font); font-weight: 700; }
.pblock__h .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pblock__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pgrid { display: grid; gap: 10px; }
.field--inline select { padding: 7px 30px 7px 10px; font-size: 13px; }
.spark { width: 100%; height: 88px; display: block; }
.spark__line { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__dot { fill: var(--surface); stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark__dot--last { fill: var(--orange); }
.spark__axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.partner { display: flex; align-items: center; gap: 10px; text-align: left; background: transparent; border: 0; padding: 0; color: var(--text); }
.partner span { display: flex; flex-direction: column; line-height: 1.2; }
.partner b { font-size: 15px; }
.partner small { font-size: 12px; color: var(--muted); }
.partner:hover b { color: var(--orange-2); }
.biglist { display: grid; gap: 6px; }
.biglist li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.biglist li > span:last-child { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.biglist small { color: var(--muted); font-size: 11px; }
.biglist .score { flex: 0 0 auto; color: var(--green); font-size: 14px; white-space: nowrap; }
.h2h { display: flex; align-items: center; gap: 12px; }
.h2h__score { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--font-display); font-size: 34px; font-weight: 900; line-height: 1; }
.h2h__score span { color: var(--muted); font-size: 22px; }
.h2h__score .is-up { color: var(--green); }
.h2h__score .is-down { color: var(--red); }
.h2h__text { font-size: 13px; color: var(--text-2); }
.mlist { display: grid; gap: 6px; }
.mline { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.mline .pill { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }
.mline__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.mline__who { font-size: 13px; }
.mline__meta { font-size: 11px; color: var(--muted); }
.mline .score--sets { grid-column: 2; }
.mline--w { border-left: 3px solid var(--green); }
.mline--l { border-left: 3px solid rgba(255, 95, 95, 0.6); }

/* ─── Matches editor ────────────────────────────────────────── */
.tier--list legend .pend { font-size: 12px; font-family: var(--font); }
.medit { display: grid; gap: 6px; margin-top: 6px; }
.medit__row { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.medit__row.is-pending { border-style: dashed; border-color: rgba(255, 106, 26, 0.45); }
.medit__round { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--orange-2); background: var(--orange-soft); padding: 3px 7px; border-radius: 6px; margin-top: 2px; }
.medit__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; min-width: 0; }
.medit__pair { color: var(--text-2); }
.medit__pair.is-winner { color: var(--text); font-weight: 700; }
.medit__pair.is-winner::before { content: "🏆 "; font-size: 11px; }
.medit__vs { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.medit__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.field-row--add { grid-template-columns: 1fr 1fr; }
.pairs-row { display: grid; gap: 8px; margin: 10px 0; align-items: center; }
.pairbox { display: grid; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); }
.pairbox--a { border-color: rgba(58, 211, 138, 0.35); }
.pairbox--b { border-color: rgba(255, 106, 26, 0.35); }
.pairbox__tag { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pairs-vs { text-align: center; font-family: var(--font-display); font-weight: 900; color: var(--muted); font-size: 16px; text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; padding-top: 24px; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tier--add { border-color: rgba(255, 106, 26, 0.35); }
.tier--add .btn--block { margin-top: 10px; }

/* ─── Share ─────────────────────────────────────────────────── */
.modal--share { width: min(100% - 20px, 560px); }
.share-preview { width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); display: block; }

/* ─── Players grid v2 ───────────────────────────────────────── */
.pcard__stats .formpills { margin-top: 3px; }
.pcard__stats .pill { width: 13px; height: 13px; font-size: 8px; }

/* ─── Breakpoints ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .spotlights__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { flex-direction: row; align-items: center; }
  .toolbar .search { flex: 1; }
  .col-finals, .col-trend { display: table-cell; }
  .col-form { width: 110px; }
  .col-num { width: 60px; }
  .pcell__sub .show-mobile { display: none; }
  .tab small { font-size: 11px; }
  .tab b { font-size: 19px; }
  .pgrid { grid-template-columns: 1fr 1fr; }
  .mline { grid-template-columns: auto 1fr auto; }
  .mline .score--sets { grid-column: auto; }
  .medit__row { grid-template-columns: auto 1fr auto; }
  .medit__actions { grid-column: auto; }
  .pairs-row { grid-template-columns: 1fr auto 1fr; }
  .pair-names .plink { font-size: 15px; }
  .podium__card--1 { transform: translateY(-8px); }
}
@media (min-width: 900px) {
  .col-num { width: 84px; }
  .col-form { width: 130px; }
  .col-trend { width: 96px; }
  .spot { padding: 16px 18px; }
  .spot__main { font-size: 30px; }
  .podium__card--1 { transform: translateY(-12px); }
  .modal--profile .modal__form { padding: 24px 28px; }
}

/* ═════════════════════════════════════════════════════════════════
   v3 — Ecosystem: organizers · clubs & venues · academies
   ═════════════════════════════════════════════════════════════════ */
.eco-grid { display: grid; gap: 12px; }
.ecoblock { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; align-content: start; }
.ecoblock__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ecoblock__head > div { min-width: 0; }
.ecoblock__icon { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.ecoblock__title { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1; }
.ecoblock__meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.ecoblock__head .chip { margin-left: auto; flex: 0 0 auto; }
.ecolist { display: grid; gap: 8px; }
.eco {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 12px; border-radius: 12px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--line); transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.eco:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }
.eco--top { background: linear-gradient(135deg, rgba(246, 195, 67, 0.16), var(--surface-2) 65%); border-color: rgba(246, 195, 67, 0.5); box-shadow: 0 0 0 1px rgba(246, 195, 67, 0.12), 0 10px 26px rgba(246, 195, 67, 0.08); }
.eco__rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-family: var(--font-display); font-weight: 800; font-size: 15px; background: var(--surface-3); color: var(--text-2); }
.eco--top .eco__rank { background: var(--gold); color: #0b0d12; box-shadow: 0 0 14px rgba(246, 195, 67, 0.45); }
.eco__body { display: grid; gap: 4px; min-width: 0; }
.eco__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.eco__name { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.05; overflow-wrap: anywhere; }
.eco--top .eco__name { color: var(--gold); }
.featured { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: var(--gold); color: #0b0d12; white-space: nowrap; box-shadow: 0 4px 12px rgba(246, 195, 67, 0.3); }
.eco__where { font-size: var(--fs-xs); color: var(--muted); }
.eco__bio { font-size: var(--fs-sm); color: var(--text-2); }
.eco__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.stat-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stat-chip b { font-family: var(--font-display); font-size: 15px; color: var(--orange-2); }
.eco--top .stat-chip b { color: var(--gold); }
.eco__members { display: inline-flex; align-items: center; }
.eco__members .avatar + .avatar { margin-left: -8px; }
.eco__del { align-self: start; opacity: 0.55; }
.eco__del:hover { opacity: 1; color: var(--red); }
.chip--aca { background: var(--orange-soft); color: var(--orange-2); }
.empty-state--sm { padding: 16px 10px; }
.catradio--eco .catradio__box b { font-size: 22px; }
.catradio--eco .catradio__box small { font-size: 11px; color: var(--text-2); }
.check--flat { padding-top: 0; }
textarea { width: 100%; min-height: 76px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
textarea::placeholder { color: #5f6878; }

@media (min-width: 640px) {
  .eco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eco-grid .ecoblock:last-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .eco-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .eco-grid .ecoblock:last-child { grid-column: auto; }
  .steps { grid-template-columns: repeat(5, 1fr); }
  .step b { font-size: 17px; }
  .step p { font-size: 13px; }
}

/* ═════════════════════════════════════════════════════════════════
   v4 — Group stage (poules) · live tournaments · tournament view
   ═════════════════════════════════════════════════════════════════ */
.status--live { background: var(--orange-soft); color: var(--orange-2); position: relative; padding-left: 16px; }
.status--live::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--orange); animation: pulse 2.2s ease-in-out infinite; }
.tcard__groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gchip { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.gchip b { color: var(--text); font-weight: 600; }

.tview { display: grid; gap: 12px; }
.tview__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--text-2); }
.tview__podium { display: grid; gap: 4px; }
.gtables { display: grid; gap: 10px; }
.gtable-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.gtable__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface-2); font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.gtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.gtable th, .gtable td { padding: 7px 4px; text-align: center; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.gtable thead th { border-top: 0; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 6px 4px; }
.gtable th:nth-child(1), .gtable td:nth-child(1) { width: 24px; }
.gtable th:nth-child(2), .gtable td:nth-child(2) { text-align: left; }
.gtable th:nth-child(3), .gtable td:nth-child(3), .gtable th:nth-child(4), .gtable td:nth-child(4), .gtable th:nth-child(5), .gtable td:nth-child(5) { width: 28px; }
.gtable th:nth-child(6), .gtable td:nth-child(6) { width: 34px; }
.gtable th:nth-child(7), .gtable td:nth-child(7) { width: 42px; }
.gtable__pair { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gtable__names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.gtable__names .plink { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.gtable__names .amp { display: none; }
.gtable__rank { color: var(--muted); font-weight: 700; }
.gtable__w { color: var(--green); font-weight: 700; }
.gtable__pts { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--orange-2); }
.gtable tr.is-q td { background: rgba(58, 211, 138, 0.06); }
.gtable tr.is-out td { opacity: 0.55; }
.gtable tr.is-out .gtable__pts { color: var(--muted); }
.qtag { display: inline-grid; place-items: center; min-width: 26px; padding: 3px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; line-height: 1; }
.qtag--q { background: var(--green); color: #052b1a; box-shadow: 0 0 10px rgba(58, 211, 138, 0.35); }
.qtag--out { background: rgba(255, 95, 95, 0.16); color: var(--red); border: 1px solid rgba(255, 95, 95, 0.4); }

/* editor */
.tier--groups { border-color: rgba(58, 211, 138, 0.35); }
.gedit { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 8px; }
.gedit__head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.gedit__head .icon-btn { margin-left: auto; }
.gedit__add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
.gedit__add .btn { grid-column: 1 / -1; }
.gtable--edit { min-width: 420px; }
.gtable--edit th:nth-child(1), .gtable--edit td:nth-child(1) { width: auto; text-align: left; }
.gtable--edit th:nth-child(2), .gtable--edit td:nth-child(2) { width: 28px; text-align: center; }
.gtable--edit th:nth-child(3), .gtable--edit td:nth-child(3), .gtable--edit th:nth-child(4), .gtable--edit td:nth-child(4) { width: 58px; }
.gtable--edit th:nth-child(5), .gtable--edit td:nth-child(5) { width: 36px; }
.gtable--edit th:nth-child(6), .gtable--edit td:nth-child(6) { width: 70px; }
.gtable--edit th:nth-child(7), .gtable--edit td:nth-child(7) { width: 38px; }
.gtable__pairtxt { font-size: 13px; line-height: 1.2; }
.gtable--edit input[type="number"] { width: 100%; min-width: 0; padding: 6px 4px; text-align: center; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.gtable--edit input[type="number"]:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.gtable--edit select { padding: 6px 20px 6px 6px; font-size: 12px; background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%; }
.tier--groups > .btn { margin-top: 8px; }

@media (min-width: 640px) {
  .gtables { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .gtable__names { flex-direction: row; flex-wrap: wrap; gap: 0 4px; }
  .gtable__names .amp { display: inline; }
  .gtable th:nth-child(3), .gtable td:nth-child(3), .gtable th:nth-child(4), .gtable td:nth-child(4), .gtable th:nth-child(5), .gtable td:nth-child(5) { width: 34px; }
  .gedit__add { grid-template-columns: 1fr 1fr auto; }
  .gedit__add .btn { grid-column: auto; }
}
@media (min-width: 900px) {
  .gtables { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
}

/* Tournament card: long status badges go under the title on phones */
.tcard__top { flex-direction: column; align-items: flex-start; gap: 6px; }
.tcard__name { overflow-wrap: normal; word-break: normal; }
@media (min-width: 640px) {
  .tcard__top { flex-direction: row; align-items: flex-start; }
}

/* ═════════════════════════════════════════════════════════════════
   v5 — formats · platform links · certification · coaches
   ═════════════════════════════════════════════════════════════════ */
.fmt { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; line-height: 1.2; }
.fmt--xs { font-size: 10px; padding: 2px 7px; }
.cert { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; background: var(--green-soft); color: var(--green); border: 1px solid rgba(58, 211, 138, 0.4); white-space: nowrap; line-height: 1.2; }
.cert--sm { font-size: 10px; padding: 2px 7px; }
.cert--xs { padding: 0; font-size: 11px; background: none; border: 0; margin-left: 4px; vertical-align: middle; }
.pcell__name { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.pcell__name .plink { min-width: 0; }
.tcard__badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tview__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile__links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.linkbadge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); text-decoration: none; line-height: 1.2; }
.linkbadge small { font-weight: 500; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.linkbadge:hover { border-color: var(--orange); color: var(--orange-2); text-decoration: none; }
.linkbadge--playtomic { border-color: rgba(58, 211, 138, 0.4); }
.linkbadge--wecourts { border-color: rgba(255, 106, 26, 0.4); }
.field-row--cert { align-items: end; }
.field-row--cert .check { padding-bottom: 12px; }
.catradios--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.catradios--4 .catradio__box small { font-size: 10px; }
.tsettings { border-color: rgba(255, 255, 255, 0.14); }
.tsettings .check { margin-top: 8px; }
.ecoblock--coach .eco__name { font-size: 18px; }

@media (min-width: 640px) {
  .eco-grid .ecoblock:last-child { grid-column: auto; }
}
@media (min-width: 900px) {
  .eco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ═════════════════════════════════════════════════════════════════
   v6 — Women / Men / Mixed categories
   ═════════════════════════════════════════════════════════════════ */
.gen { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; border: 1px solid transparent; white-space: nowrap; line-height: 1.2; }
.gen--xs { font-size: 10px; padding: 2px 7px; }
.gen--women { background: rgba(255, 122, 184, 0.14); color: #ff8ec4; border-color: rgba(255, 122, 184, 0.42); }
.gen--men   { background: rgba(111, 183, 255, 0.14); color: #8cc5ff; border-color: rgba(111, 183, 255, 0.42); }
.gen--mixed { background: rgba(200, 155, 255, 0.14); color: #d2adff; border-color: rgba(200, 155, 255, 0.42); }
.toolbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.segmented--gender { margin-bottom: 0; }
.segmented--gender .seg { padding: 6px 10px; }
.catradio--gen .catradio__box b { font-size: 20px; }
.catradio--gen .catradio__box small { font-size: 11px; color: var(--text-2); }
@media (min-width: 640px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { flex: 1 1 260px; }
  .toolbar__row { flex: 0 1 auto; }
}
