*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ClickTV surfaces — official dark palette */
  --bg:        #141414;
  --bg-card:   #1e1e1e;
  --bg-card2:  #272829;
  --bg-hover:  #2d2d2d;

  /* ClickTV Electric Blue — primary brand color */
  --accent:    #0077FF;
  --accent-dim: rgba(0,119,255,0.14);
  --accent-glow: 0 0 30px rgba(0,119,255,0.3), 0 0 60px rgba(0,119,255,0.1);

  /* ClickTV Premium Gold — also WC 2026 championship */
  --gold:      #E0A500;
  --gold-dim:  rgba(224,165,0,0.14);
  --gold-glow: 0 0 24px rgba(224,165,0,0.4);

  /* ClickTV alert colors */
  --red:       #FF4400;
  --green:     #00CC62;


  /* ClickTV text — official grey scale for dark */
  --text:      #FFFFFF;
  --text2:     #B8C4BE;   /* secondary — readable labels, stats, meta */
  --text3:     #7A8388;   /* muted — decorative separators, placeholders */

  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.13);
  --radius:    14px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg);
  background-image: url('/static/bg-desktop.png');
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 14, 0.72);
  z-index: 0;
  pointer-events: none;
}
.top-bar, .sticky-wrap, .main {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  body {
    background-image: url('/static/bg-mobile.png');
  }
}

/* ── TOP BAR ─────────────────────────────────────────────── */
.top-bar {
  height: 3px;
  background: var(--accent);
}

/* ── STICKY WRAP ─────────────────────────────────────────── */
.sticky-wrap {
  position: sticky;
  top: 2px;
  z-index: 100;
  background: rgba(14,14,14,0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── HEADER ─────────────────────────────────────────────── */
.header {
  background: transparent;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.logo { justify-self: start; display: flex; align-items: center; text-decoration: none; transition: opacity .2s; }
.logo:hover { opacity: .7; }
.logo-img { height: 34px; width: auto; display: block; }

.header-title {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
.header-title-text { text-align: center; }
.header-h1 {
  font-size: clamp(13px, 2vw, 20px);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}
.header-h1 span { color: var(--accent); }
.header-sub {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 500;
  margin-top: 3px;
}
.trophy-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  animation: trophy-float 4s ease-in-out infinite;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(224,165,0,0.6));
}
.trophy-icon:last-child { animation-delay: 2s; }
@keyframes trophy-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}
.header-right { justify-self: end; }

/* ── LANG SWITCHER ───────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  transition: color .2s, background .2s;
  text-transform: uppercase;
}
.lang-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.lang-btn.active { color: var(--accent); background: var(--accent-dim); }

/* ── TABS ────────────────────────────────────────────────── */
.tabs-nav {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.tabs-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.tabs-left {
  display: flex;
  position: relative;
}
/* Mobile lang switcher hidden on desktop */
#langSwitcherMobile { display: none; }
.tab {
  background: none;
  border: none;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 16px 22px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .2s;
  white-space: nowrap;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); }
.tab-slider {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: left .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
}

/* ── MAIN ────────────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px; }

/* ── LOADER / EMPTY ──────────────────────────────────────── */
.loader { text-align: center; padding: 100px 20px; color: var(--text2); }
.spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 100px 20px; color: var(--text2); font-size: 15px; line-height: 1.7; }
.btn-sync {
  margin-top: 20px; padding: 12px 28px;
  background: var(--accent); color: #000;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-weight: 800; font-size: 13px;
  cursor: pointer; transition: opacity .2s; letter-spacing: .5px;
}
.btn-sync:hover { opacity: .85; }

.hidden { display: none !important; }
.view { min-height: 200px; }
.no-data { text-align:center; color:var(--text2); padding:80px 20px; font-size:15px; }

/* ── GROUPS GRID ─────────────────────────────────────────── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.group-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,119,255,0.2);
}
.group-title {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.group-expand-hint { color: var(--text3); font-size: 11px; opacity: 0; transition: opacity .2s; }
.group-card:hover .group-expand-hint { opacity: 1; }

.standings-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.standings-table th {
  padding: 5px 4px; text-align: center;
  font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text2); border-bottom: 1px solid var(--border); width: 24px;
}
.standings-table th.th-team { text-align: left; padding-left: 12px; width: auto; }
.standings-table th.th-pts { color: var(--accent); width: 26px; }
.st-row td {
  padding: 8px 4px; text-align: center;
  border-bottom: 1px solid var(--border); color: var(--text);
  overflow: hidden; transition: background .15s;
}
.st-row:last-child td { border-bottom: none; }
.st-row:hover td { background: var(--bg-hover); }
.st-row.advance td:first-child { border-left: 2px solid var(--accent); }
.td-team { text-align: left !important; padding-left: 10px !important; }
.td-team-inner { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.st-logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-card2); }
.st-logo-txt {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-card2);
  border: 1px solid var(--border2); display: inline-flex; align-items: center;
  justify-content: center; font-size: 7px; font-weight: 700; color: var(--text3); flex-shrink: 0;
}
.st-name { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.td-pts { font-weight: 900; }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }

/* ── SCHEDULE ────────────────────────────────────────────── */
.date-group { margin-bottom: 40px; }
.date-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.date-header-line { flex: 1; height: 1px; background: var(--border); }
.date-header-text {
  font-size: 10px; font-weight: 800; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--text2); white-space: nowrap;
}
.date-header-text.today { color: var(--accent); }
.match-list { display: grid; gap: 6px; }

/* ── MATCH CARD ──────────────────────────────────────────── */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.match-card:hover {
  border-color: rgba(0,119,255,0.35);
  background: var(--bg-card2);
  transform: translateX(3px);
}
.match-card.live { border-color: rgba(0,119,255,0.4); }

.match-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.badge {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 6px; text-transform: uppercase;
}
.badge-stage { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,119,255,0.25); }
.badge-live  { background: var(--green); color: #000; animation: pulse-live 2s ease-in-out infinite; }
.badge-ft    { background: var(--bg-card2); color: var(--text2); border: 1px solid var(--border2); }
.badge-ns    { background: var(--bg-card2); color: var(--text2); border: 1px solid var(--border2); }
.badge-ht    { background: var(--gold); color: #000; }
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}
.match-meta-venue { font-size: 11px; color: var(--text2); margin-left: auto; }

.match-score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.team { display: flex; align-items: center; gap: 10px; }
.team.away { flex-direction: row-reverse; text-align: right; }
.team-logo {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: var(--bg-card2); flex-shrink: 0;
}
.team-logo-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card2); border: 1px solid var(--border2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text2);
}
.team-name { font-size: 15px; font-weight: 700; }

.score-box { text-align: center; min-width: 80px; }
.score-nums {
  font-size: 28px; font-weight: 900; letter-spacing: -1px; line-height: 1;
  color: var(--text);
}
.score-nums.live-score { color: var(--green); }
.score-sep { color: var(--text3); margin: 0 2px; }
.score-vs { font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: 3px; }
.score-time { font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 4px; letter-spacing: 1px; }

/* ── BRACKET TREE ────────────────────────────────────────── */
.bk-page { padding: 0; }

/* Prediction toolbar */
.bk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 12px 4px;
}
.bk-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg-card);
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.bk-toolbar-btn:hover { background: var(--bg-hover); color: var(--text); }
.bk-toolbar-btn--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}
.bk-toolbar-btn--reset {
  background: transparent;
  border-color: var(--border);
  color: var(--text3);
  font-weight: 500;
}
.bk-toolbar-btn--reset:hover { border-color: rgba(255,68,0,0.4); color: var(--red); }
.bk-pred-hint {
  font-size: 11px;
  color: var(--text3);
  padding: 0 4px 12px 4px;
  margin: 0;
}

/* Prediction cards */
.bk-card--pred { cursor: default; }
.bk-card--pred:hover { border-color: var(--border); background: var(--bg-card); }
.bk-card--pred .bk-row--pickable {
  cursor: pointer;
  border-radius: 6px;
  transition: background .12s;
}
.bk-card--pred .bk-row--pickable:hover { background: var(--bg-hover); }
.bk-card--pred .bk-row--picked {
  background: var(--gold-dim);
  border-radius: 6px;
}
.bk-card--pred .bk-row--picked .bk-nm {
  color: var(--gold);
  font-weight: 700;
}
.bk-card--pred .bk-row--picked .bk-logo-x {
  color: var(--gold);
  background: rgba(224,165,0,0.12);
  border-color: rgba(224,165,0,0.3);
}
.bk-card--pred .bk-row--picked img.bk-logo {
  filter: drop-shadow(0 0 4px rgba(224,165,0,0.5));
}

/* Desktop: JS applies zoom to fit — no scroll needed */
.bk-scroll { overflow: visible; }

/* Round header row (lives above the tree body) */
.bk-hdr-row {
  display: inline-flex;
  align-items: flex-end;
  padding: 12px 16px 6px;
  min-width: max-content;
}
.bk-col-hd {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bk-rnd-lbl {
  font-size: 10px; font-weight: 900; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text2);
}
.bk-rnd-dt {
  font-size: 10px; font-weight: 400;
  color: var(--text2); letter-spacing: 0.3px;
}
.bk-conn-hd { width: 32px; flex-shrink: 0; }

/* Tree body — matches + connectors in a fixed-height flex row */
.bk-tree {
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  min-width: max-content;
  padding: 2px 16px 12px;
}

/* Match column */
.bk-col {
  width: 190px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.bk-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Slot — equal-height flex item, centers its match card */
.bk-slot {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 5px 0;
}

/* Compact match card */
.bk-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.bk-card:hover          { border-color: rgba(0,119,255,0.35); background: var(--bg-card2); }
.bk-card--tbd           { cursor: default; }
.bk-card--tbd:hover     { border-color: var(--border); background: var(--bg-card); }
.bk-card--live          { border-color: rgba(0,220,100,0.3); }

/* Team row inside card */
.bk-row {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 0;
  font-size: 12px; font-weight: 600;
  color: var(--text2); min-width: 0;
}
.bk-row--win { color: var(--text); }

.bk-logo {
  width: 17px; height: 17px; border-radius: 50%;
  object-fit: cover; background: var(--bg-card2); flex-shrink: 0;
}
.bk-logo-x {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--bg-card2); border: 1px solid var(--border2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 7px; font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.bk-nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bk-nm--tbd { color: var(--text2); font-style: italic; }
.bk-sc { font-weight: 900; font-size: 13px; color: var(--text2); flex-shrink: 0; }
.bk-sc.win { color: var(--text); }
.bk-hr { height: 1px; background: var(--border); margin: 1px 0; }

/* Connector column between rounds */
.bk-conn {
  width: 32px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* One connector segment merges 2 adjacent slots → 1 next-round slot.
   The connector is 2× the height of one slot, so:
     25% of segment = center of slot 1  (top half)
     75% of segment = center of slot 2  (bottom half) */
.bk-conn-seg {
  flex: 1;
  position: relative;
}
/* ⌐ bracket: top stub + right vertical + bottom stub */
.bk-conn-seg::before {
  content: '';
  position: absolute;
  left: 0;
  width: 10px;
  top: 25%;
  height: 50%;
  border-top: 1px solid var(--border2);
  border-right: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
  box-sizing: border-box;
}
/* Horizontal line from bracket corner to next column */
.bk-conn-seg::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1px;
  background: var(--border2);
}

/* 3rd-place match shown below tree */
.bk-third {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 8px;
  border-top: 1px solid var(--border);
}
.bk-third-lbl {
  font-size: 8px; font-weight: 900;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text2); white-space: nowrap; flex-shrink: 0;
}
.bk-card--third { width: 190px; flex-shrink: 0; }
/* winner panel */
.bk-winner-conn { width: 32px; flex-shrink: 0; display: flex; align-items: center; }
.bk-winner-conn-line { width: 100%; height: 1px; background: var(--gold); opacity: 0.5; }
.bk-winner-col { width: 190px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bk-winner-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 12px 8px; }
.bk-trophy-img {
  width: 130px; height: auto; object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(224,165,0,0.55)) drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}
.bk-trophy-emoji { font-size: 52px; line-height: 1; display: block; }
.bk-champion-lbl { font-size: 10px; font-weight: 900; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold); }
.bk-winner-team { display: flex; align-items: center; gap: 6px; }
.bk-winner-logo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.bk-winner-logo-x { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: var(--text2); }
.bk-winner-nm { font-size: 13px; font-weight: 700; color: var(--text); }

/* ── GROUP POPUP ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px; overflow-y: auto;
  backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 100%; max-width: 580px; margin: auto;
  position: relative; padding: 32px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
}
.group-modal-box { max-width: 680px !important; padding: 0 !important; overflow: hidden; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-card2); border: 1px solid var(--border2);
  color: var(--text2); width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--accent); color: #000; border-color: var(--accent); }

/* match modal header */
.modal-header { text-align: center; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.modal-stage { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.modal-teams { display: flex; align-items: center; justify-content: center; gap: 16px; }
.modal-team { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 90px; flex: 1; }
.modal-team-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); }
.modal-team-placeholder {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg-card2);
  border: 1px solid var(--border2); display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: 800; color: var(--text2);
}
.modal-team-name { font-size: 14px; font-weight: 700; text-align: center; line-height: 1.3; }
.modal-score-center { text-align: center; flex-shrink: 0; }
.modal-score { font-size: 48px; font-weight: 900; letter-spacing: -2px; line-height: 1; color: var(--text); }
.modal-score-sep { color: var(--text3); }
.modal-score-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-top: 8px; color: var(--text2); }
.modal-kickoff { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: .5px; padding: 4px 0; }

/* modal sections */
.modal-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.modal-section-title { font-size: 9px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--text2); margin-bottom: 14px; }

/* events */
.event-list { display: flex; flex-direction: column; gap: 5px; }
.event-row {
  display: flex; align-items: center; gap: 12px; font-size: 13px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card2); border: 1px solid var(--border);
  transition: background .15s;
}
.event-row:hover { background: var(--bg-hover); }
.event-row.away { flex-direction: row-reverse; text-align: right; }
.event-min { font-size: 11px; font-weight: 800; color: var(--accent); min-width: 30px; text-align: center; }
.event-icon { font-size: 15px; flex-shrink: 0; }
.event-player { font-weight: 600; flex: 1; }
.event-result { font-size: 11px; color: var(--text2); font-weight: 600; }

/* statistics */
.stat-list { display: flex; flex-direction: column; gap: 14px; }
.stat-labels { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; align-items: center; }
.stat-val-home { font-weight: 900; color: var(--accent); min-width: 32px; }
.stat-name { color: var(--text2); font-weight: 500; text-align: center; flex: 1; font-size: 12px; }
.stat-val-away { font-weight: 700; color: var(--gold); min-width: 32px; text-align: right; }
.stat-bar-wrap { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; align-items: center; }
.stat-bar-home { height: 4px; background: var(--accent); border-radius: 2px 0 0 2px; transition: width .4s, height .3s; min-width: 2px; }
.stat-bar-away { height: 4px; background: var(--gold); border-radius: 0 2px 2px 0; transition: width .4s, height .3s; min-width: 2px; }
.stat-bar-home.stat-bar--lead { height: 8px; border-radius: 4px 0 0 4px; }
.stat-bar-away.stat-bar--lead { height: 8px; border-radius: 0 4px 4px 0; }
.modal-venue { text-align: center; font-size: 12px; color: var(--text2); margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

.modal-watch-row { display: flex; justify-content: center; padding: 24px 0; }
.watch-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 32px;
  background: var(--accent);
  color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 20px rgba(0,119,255,0.35);
}
.watch-btn:hover {
  background: #0066ee;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,119,255,0.5);
}
.watch-btn--live {
  background: var(--green);
  box-shadow: 0 4px 20px rgba(0,204,98,0.35);
  animation: watch-pulse 2s ease-in-out infinite;
}
.watch-btn--live:hover {
  background: #00b355;
  box-shadow: 0 6px 28px rgba(0,204,98,0.5);
}
@keyframes watch-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0,204,98,0.35); }
  50%       { box-shadow: 0 4px 28px rgba(0,204,98,0.65), 0 0 0 6px rgba(0,204,98,0.1); }
}

/* ── GROUP MODAL CONTENT ─────────────────────────────────── */
.gm-header {
  padding: 28px 28px 4px;
  font-size: 24px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent);
}
.gm-subtitle { padding: 0 28px 10px; font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text2); }
.gm-table-wrap { padding: 0 28px; }
.gm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gm-table th {
  padding: 7px 8px; text-align: center;
  font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text2); border-bottom: 1px solid var(--border);
}
.gm-table th.gm-th-team { text-align: left; }
.gm-table th.gm-th-pts { color: var(--accent); }
.gm-row td { padding: 12px 8px; text-align: center; border-bottom: 1px solid var(--border); font-size: 14px; }
.gm-row:last-child td { border-bottom: none; }
.gm-row:hover td { background: var(--bg-card2); }
.gm-row.advance .gm-team { border-left: 2px solid var(--accent); padding-left: 8px; }
.gm-pos { color: var(--text2); font-size: 11px; font-weight: 700; width: 28px; }
.gm-team { text-align: left !important; overflow: hidden; }
.gm-team-inner { display: flex; align-items: center; gap: 10px; }
.gm-team-inner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gm-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-card2); }
.gm-logo-txt { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-card2); border: 1px solid var(--border2); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
.gm-pts { font-weight: 900; color: var(--text); }

/* group fixtures inside popup */
.group-fixtures { background: var(--bg); border-top: 1px solid var(--border); padding-bottom: 8px; }
.gf-row {
  display: grid; grid-template-columns: 52px 1fr auto 1fr;
  align-items: center; gap: 10px;
  padding: 12px 28px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.gf-row:last-child { border-bottom: none; }
.gf-row:hover { background: var(--bg-card); }
.gf-date { font-size: 11px; color: var(--text2); white-space: nowrap; }
.gf-team { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; overflow: hidden; }
.gf-team.away { justify-content: flex-end; text-align: right; }
.gf-team.away span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gf-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-card2); }
.gf-logo-txt { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-card2); display: inline-flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
.gf-score { font-size: 15px; font-weight: 900; color: var(--text); text-align: center; white-space: nowrap; letter-spacing: 1px; }
.gf-score.live { color: var(--green); }
.gf-time { font-size: 14px; font-weight: 800; color: var(--accent); text-align: center; white-space: nowrap; }

/* ── TEAM DETAIL (inside group modal) ───────────────────── */
.gm-row--clickable { cursor: pointer; }

.td-header {
  padding: 16px 24px 0;
}
.td-back {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.td-back:hover { color: var(--text); }

.td-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.td-logo {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: var(--bg-card2); flex-shrink: 0;
}
.td-logo-txt {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-card2); border: 1px solid var(--border2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.td-hero-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.td-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.td-group-badge {
  font-size: 12px; font-weight: 600; color: var(--text3);
  background: var(--bg-card2); border: 1px solid var(--border2);
  padding: 2px 8px; border-radius: 20px;
}
.td-advancing-tag {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(0,119,255,0.25);
  padding: 2px 8px; border-radius: 20px;
}

.td-stats-row {
  display: flex;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.td-stat {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.td-stat-val { font-size: 20px; font-weight: 900; color: var(--text); }
.td-stat-val.pos { color: var(--green); }
.td-stat-val.neg { color: var(--red); }
.td-stat-pts { color: var(--gold); }
.td-stat-lbl { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

.td-matches { padding-bottom: 8px; }
.td-match-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.td-match-row:last-child { border-bottom: none; }
.td-match-row:hover { background: var(--bg-card2); }
.td-match-date { font-size: 11px; color: var(--text3); width: 50px; flex-shrink: 0; }
.td-match-teams { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.td-opp-logo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.td-opp-logo-x {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-card2); border: 1px solid var(--border2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: var(--text2); flex-shrink: 0;
}
.td-match-opp { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-match-result { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.td-match-score { font-size: 14px; font-weight: 900; color: var(--text); letter-spacing: 0.5px; }
.td-match-score.live { color: var(--green); }
.td-match-time { font-size: 13px; font-weight: 700; color: var(--accent); }
.td-result {
  width: 22px; height: 22px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; flex-shrink: 0;
}
.td-result--W { background: rgba(0,204,98,0.15); color: var(--green); }
.td-result--L { background: rgba(255,68,0,0.15); color: var(--red); }
.td-result--D { background: var(--bg-card2); color: var(--text3); }
.td-result--live { background: rgba(0,204,98,0.15); color: var(--green); }

/* ── SAVE BUTTON ─────────────────────────────────────────── */
.bk-toolbar-btn--save {
  background: linear-gradient(135deg, #1a8a2e, #22b83c) !important;
  border-color: #22b83c !important;
  color: #fff !important;
  font-weight: 700;
}
.bk-toolbar-btn--save:hover { opacity: .88; }

/* ── LOCKED ROUND CARDS ──────────────────────────────────── */
.bk-card--locked { opacity: .55; pointer-events: none; }

/* ── SHARED VIEW TOOLBAR ─────────────────────────────────── */
.bk-toolbar--shared { background: var(--bg-card2); border: 1px solid var(--border); }
.bk-shared-badge {
  font-size: 14px; color: var(--text2);
  display: flex; align-items: center; gap: 6px;
}
.bk-shared-badge strong { color: var(--text); }

/* ── LEADERBOARD ─────────────────────────────────────────── */
.bk-lb-wrap { margin: 32px 0 16px; }
.bk-lb-empty {
  text-align: center; color: var(--text3);
  font-size: 13px; padding: 24px 0;
}
.bk-lb {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}
.bk-lb-title {
  padding: 16px 20px 12px;
  font-size: 15px; font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.bk-lb-table {
  width: 100%; border-collapse: collapse;
}
.bk-lb-table thead tr {
  border-bottom: 1px solid var(--border);
}
.bk-lb-table th {
  padding: 8px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text3); letter-spacing: .5px;
  text-align: left;
}
.bk-lb-table th:first-child { text-align: center; }
.bk-lb-row { transition: background .12s; }
.bk-lb-row:hover { background: var(--bg-card2); }
.bk-lb-row--mine { background: rgba(0,119,255,.07); }
.bk-lb-row--mine:hover { background: rgba(0,119,255,.12); }
.bk-lb-row td { padding: 10px 12px; }
.bk-lb-rank {
  text-align: center; font-size: 13px;
  font-weight: 700; color: var(--text3); width: 40px;
}
.bk-lb-row:nth-child(1) .bk-lb-rank { color: #f5c518; font-size: 15px; }
.bk-lb-row:nth-child(2) .bk-lb-rank { color: #b0b8c4; }
.bk-lb-row:nth-child(3) .bk-lb-rank { color: #cd7f32; }
.bk-lb-nick {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.bk-lb-score {
  font-size: 15px; font-weight: 900;
  color: var(--gold); text-align: right; width: 60px;
}
.bk-lb-view {
  background: none; border: 1px solid var(--border2);
  color: var(--text2); font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
}
.bk-lb-view:hover {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
}

/* ── PREDICTION SAVE MODAL ───────────────────────────────── */
.pred-save-box {
  max-width: 420px !important;
  padding: 32px 28px !important;
}
.pred-save-title {
  font-size: 18px; font-weight: 800; color: var(--text);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.pred-save-hint {
  font-size: 13px; color: var(--text3); margin-bottom: 20px;
}
.pred-nickname-input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-card2); border: 1px solid var(--border2);
  border-radius: 10px; color: var(--text); font-size: 15px;
  outline: none; box-sizing: border-box;
  transition: border-color .15s;
}
.pred-nickname-input:focus { border-color: var(--accent); }
.pred-submit-btn {
  margin-top: 14px; width: 100%;
  padding: 13px; border-radius: 10px;
  background: var(--accent); border: none;
  color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.pred-submit-btn:hover { opacity: .88; }
.pred-submit-btn:disabled { opacity: .5; cursor: default; }
.pred-save-error {
  margin-top: 10px; color: var(--red);
  font-size: 13px; font-weight: 600;
}
/* save result */
.pred-saved-icon { font-size: 36px; text-align: center; margin-bottom: 8px; }
.pred-saved-title {
  font-size: 17px; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 4px;
}
.pred-saved-nickname {
  font-size: 14px; color: var(--text2);
  text-align: center; margin-bottom: 20px;
}
.pred-saved-link-wrap { display: flex; gap: 8px; }
.pred-share-input {
  flex: 1; padding: 10px 12px;
  background: var(--bg-card2); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-size: 12px;
  outline: none; min-width: 0;
}
.pred-copy-btn {
  padding: 10px 14px; border-radius: 8px;
  background: var(--accent); border: none;
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: opacity .15s;
}
.pred-copy-btn:hover { opacity: .85; }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── TABLET (≤ 1024px) ──────────────────────────────────── */
@media (max-width: 1024px) {
  .main { padding: 24px 20px 60px; }
  .groups-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── MOBILE (≤ 640px) ───────────────────────────────────── */
@media (max-width: 640px) {
  /* Header */
  .header-inner {
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: static;
    gap: 8px;
  }
  .logo { flex-shrink: 0; }
  .logo-img { height: 22px; }
  .header-title {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    white-space: nowrap;
    pointer-events: none;
  }
  .header-title-text { text-align: right; }
  .header-h1 { font-size: 11px; letter-spacing: 0.5px; }
  .header-sub { font-size: 8px; letter-spacing: 1px; margin-top: 1px; }
  .trophy-icon { display: none; }
  .header-right { display: none; }

  /* Tabs */
  .tabs-inner { padding: 0 4px; }
  .tab { padding: 13px 16px; font-size: 11px; letter-spacing: 0; }


  /* Main */
  .main { padding: 14px 10px 60px; }
  .groups-grid { grid-template-columns: 1fr; gap: 8px; }

  /* Match cards */
  .match-card { padding: 10px 12px; }
  .match-meta-venue { display: none; }
  .team { gap: 6px; min-width: 0; overflow: hidden; }
  .team-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .team-logo,
  .team-logo-placeholder { width: 26px; height: 26px; flex-shrink: 0; }
  .score-box { min-width: 50px; flex-shrink: 0; }
  .score-nums { font-size: 20px; }
  .score-vs { font-size: 15px; letter-spacing: 0; }
  .team-logo,
  .team-logo-placeholder { width: 24px; height: 24px; }
  .team { gap: 5px; }

  /* Standings table — hide low-priority columns (В, Н, П = columns 3,4,5) */
  .th-hide { display: none !important; }
  .standings-table th:nth-child(3),
  .standings-table th:nth-child(4),
  .standings-table th:nth-child(5),
  .standings-table td:nth-child(3),
  .standings-table td:nth-child(4),
  .standings-table td:nth-child(5) { display: none !important; }

  /* Match modal */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100% !important;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 24px 16px 32px;
    margin: 0;
    max-height: 90dvh;
    overflow-y: auto;
  }
  .modal-score { font-size: 36px; }
  .modal-team-logo,
  .modal-team-placeholder { width: 48px; height: 48px; }
  .modal-team-name { font-size: 12px; }
  .modal-kickoff { font-size: 17px; }

  /* Group popup */
  .group-modal-box {
    border-radius: 16px 16px 0 0 !important;
    max-height: 90dvh;
    overflow-y: auto;
  }
  /* hide ГЗ/ГП columns in group popup table (7th and 8th col) */
  .gm-table th:nth-child(7), .gm-table th:nth-child(8),
  .gm-table td:nth-child(7), .gm-table td:nth-child(8) { display: none !important; }
  .gm-header { padding: 20px 16px 4px; font-size: 18px; letter-spacing: 2px; }
  .gm-subtitle { padding: 0 16px 8px; }
  .gm-table-wrap { padding: 0 16px; }
  .gm-table { font-size: 12px; }
  .gm-row td { padding: 10px 6px; font-size: 12px; }
  .gf-row {
    padding: 10px 16px;
    grid-template-columns: 38px 1fr auto 1fr;
    gap: 5px;
  }
  .gf-team { font-size: 11px; gap: 4px; }
  .gf-logo { width: 16px; height: 16px; }
  .gf-score { font-size: 13px; }
  .gf-time { font-size: 12px; }

  /* Tabs: left-aligned + mobile lang switcher on right */
  .tabs-inner { justify-content: space-between; padding: 0 14px; }
  .tabs-left { flex: 1 1 auto; }
  #langSwitcherMobile { display: flex; flex-shrink: 0; }
  .tab { padding: 14px 10px; font-size: 11px; }

  /* Bracket: horizontal scroll on mobile (no JS zoom) */
  .bk-scroll { overflow-x: auto; overflow-y: visible; }
}
