/* ============================================================
   ШРИФТ
   ============================================================ */
@font-face {
  font-family: 'RPL';
  src: url('fonts/rpl-regular.woff2') format('woff2'),
       url('fonts/rpl-regular.woff') format('woff'),
       url('fonts/rpl-regular.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: swap;
}

/* ============================================================
   ПЕРЕМЕННЫЕ И БАЗА
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --neon: #00ffd5; --neon-2: #ff0080; --neon-3: #a855f7;
  --bg: #05060d; --text: #e6edf7;
  --text-dim: #64748b; --text-muted: #475569;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 255, 213, 0.3);
  --topbar-bg: rgba(13, 15, 26, 0.95);
  --match-bg: rgba(13, 15, 26, 0.85);
  --tour-bg: rgba(13, 15, 26, 0.85);
  --body-grad-1: rgba(0, 255, 213, 0.08);
  --body-grad-2: rgba(168, 85, 247, 0.1);
  --search-bg: rgba(0, 0, 0, 0.35);
}

body.light {
  --bg: #f0f4f8; --text: #0f172a;
  --text-dim: #64748b; --text-muted: #94a3b8;
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(0, 168, 150, 0.4);
  --topbar-bg: rgba(255, 255, 255, 0.98);
  --match-bg: #ffffff; --tour-bg: #ffffff;
  --body-grad-1: rgba(0, 200, 180, 0.12);
  --body-grad-2: rgba(140, 60, 220, 0.08);
  --neon: #00a896;
  --search-bg: rgba(15, 23, 42, 0.05);
}

body {
  font-family: 'RPL', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  letter-spacing: 0.3px;
  min-height: 100vh;
  padding: 20px 16px;
  line-height: 1.55;
  overflow-x: clip;
  background: var(--bg);
  transition: background 0.3s, color 0.3s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, var(--body-grad-1), transparent 40%),
    radial-gradient(circle at 100% 100%, var(--body-grad-2), transparent 40%),
    var(--bg);
}

/* ============================================================
   КНОПКА «НАВЕРХ»
   ============================================================ */
.scroll-top {
  position: fixed; bottom: 20px; right: 20px;
  width: 44px; height: 44px; padding: 0; border-radius: 10px;
  background: var(--topbar-bg);
  border: 1px solid var(--border);
  color: var(--neon);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease,
              background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.scroll-top svg { width: 22px; height: 22px; stroke: currentColor; display: block; }
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.scroll-top:active {
  transform: translateY(0) scale(0.95);
  background: var(--neon); border-color: var(--neon); color: #05060d;
  box-shadow: 0 0 24px rgba(0, 255, 213, 0.7);
}
.scroll-top:focus { outline: none; }
.scroll-top:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .scroll-top:hover {
    background: var(--neon); border-color: var(--neon); color: #05060d;
    box-shadow: 0 4px 20px rgba(0, 255, 213, 0.5);
  }
}
@media (hover: none) and (pointer: coarse) {
  .scroll-top:active { transition: background 0.05s, border-color 0.05s, color 0.05s, box-shadow 0.05s; }
}

/* ============================================================
   ФИЛЬТР КОМАНД В КАЛЕНДАРЕ
   ============================================================ */
.cal-teams-filter {
  display: flex; 
  align-items: center; 
  flex-wrap: nowrap; 
  justify-content: flex-start; 
  gap: 6px; 
  height: 32px;               
  padding: 0 8px;             
  background: var(--match-bg);
  border: 1px solid var(--border);
  border-radius: 5px; 
  width: max-content;         
  max-width: 100%;            
  box-sizing: border-box; 
  overflow-x: auto;           
  scrollbar-width: none;
  flex: 0 1 auto;             
  min-width: 0;               
}
.cal-teams-filter::-webkit-scrollbar {
  display: none;
}
.cal-team-filter {
  width: 24px; height: 24px; padding: 2px; border-radius: 5px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.cal-team-filter img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; transition: transform 0.15s; }
.cal-team-filter:hover { background: rgba(0, 255, 213, 0.08); border-color: var(--border-hover); }
.cal-team-filter:hover img { transform: scale(1.1); }
.cal-team-filter.active {
  background: linear-gradient(135deg, rgba(0, 255, 213, 0.2), rgba(168, 85, 247, 0.2));
  border-color: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 213, 0.3);
}
.cal-team-filter-reset {
  display: none;
  color: var(--text-dim); font-size: 14px; font-weight: 900;
  background: rgba(255, 0, 128, 0.1); border-color: rgba(255, 0, 128, 0.3);
}
.cal-team-filter-reset:hover { background: rgba(255, 0, 128, 0.2); color: #fff; border-color: var(--neon-2); }

.cal-teams-wrapper { 
  display: flex; 
  align-items: center; 
  gap: 4px; 
  margin-left: auto;  /* Прижимаем к правому краю, если есть место */
  width: max-content;
  max-width: 100%; 
}
.cal-teams-arrow {
  display: none;
  width: 26px; height: 26px; padding: 0; border-radius: 6px;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px; font-weight: 900;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cal-teams-arrow:hover { background: rgba(0, 255, 213, 0.15); border-color: var(--neon); color: var(--neon); }
.cal-teams-arrow:active { transform: scale(0.95); }

/* ============================================================
   ЗАГОЛОВОК ДНЯ
   ============================================================ */
.day-head {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 4px 2px;
  margin-top: 4px;
}
.day-head:first-child { margin-top: 0; }
.day-head-text {
  font-size: 12px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--neon);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.day-head-text > span:first-child {
  color: #fff;
}
.day-head-text > span.day-head-rest {
  color: var(--neon);
}
.day-head-text::before {
  content: none;
}
.day-head::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-hover), transparent);
}

@media (max-width: 600px) {
  .day-head-text { font-size: 10px; letter-spacing: 1.2px; }
  .day-head { padding: 4px 2px 0; }
}
/* ============================================================
   КОНТЕЙНЕР И ТОПБАР
   ============================================================ */
.container { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; animation: pageFadeIn 0.3s ease-out; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 44px; padding: 5px 10px;
  background: var(--topbar-bg);
  border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 12px;
  position: relative; z-index: 1000; isolation: isolate;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; padding: 2px;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-size: 14px; font-weight: 900; color: var(--text); line-height: 1.2; transition: color 0.2s; }
.brand-sub {
  font-size: 10px; color: var(--neon);
  text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; margin-top: 1px;
}
.brand:hover .brand-name { color: var(--neon); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0, 255, 213, 0.1);
  border: 1px solid rgba(0, 255, 213, 0.3);
  color: var(--neon); font-size: 16px;
  cursor: pointer; flex-shrink: 0;
}

.how-link { color: var(--neon); font-weight: 800; text-decoration: none; transition: color 0.2s; }
.how-link:hover { color: #ffffff; text-decoration: underline; }

.tour-badge {
  display: flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 16px;
  background: linear-gradient(135deg, rgba(0, 255, 213, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(0, 255, 213, 0.4);
  border-radius: 6px;
}
.tour-badge-value { font-size: 16px; font-weight: 900; color: var(--text); letter-spacing: -0.5px; line-height: 1; }

/* ============================================================
   НАВИГАЦИЯ
   ============================================================ */
.nav-tabs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 12px; border-radius: 6px;
  text-decoration: none; color: var(--text-dim);
  font-weight: 800; font-size: 12px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-tab:hover { background: rgba(0, 255, 213, 0.08); color: var(--neon); }
.nav-tab.active {
  background: linear-gradient(135deg, rgba(0, 255, 213, 0.15), rgba(168, 85, 247, 0.15));
  color: var(--neon);
  border: 1px solid rgba(0, 255, 213, 0.4);
}

/* ============================================================
   ПОИСК (топбар)
   ============================================================ */
.search-toggle {
  display: none;
  width: 32px; height: 32px; padding: 0; border-radius: 6px;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.search-toggle svg { width: 16px; height: 16px; stroke: currentColor; display: block; }
.search-toggle:hover { background: rgba(0, 255, 213, 0.15); color: var(--neon); }

.topbar-search {
  position: relative; width: 220px; margin: 0 !important;
  flex-shrink: 0;
  display: flex; align-items: center; align-self: center;
}
.topbar-search input {
  width: 100%; height: 32px; padding: 0 30px 0 32px;
  background-color: var(--search-bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.35-4.35'/></svg>");
  background-repeat: no-repeat; background-position: 10px center; background-size: 16px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px; font-weight: 700; font-family: inherit;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.topbar-search.has-logo input {
  background-image: none; padding-left: 32px;
  border-color: rgba(0, 255, 213, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 255, 213, 0.15);
}
.topbar-search input:focus {
  outline: none; border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(0, 255, 213, 0.15), 0 0 20px rgba(0, 255, 213, 0.15);
}
.topbar-search input::placeholder { color: var(--text-dim); font-weight: 700; }
.topbar-search .search-box-logo { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; object-fit: contain; z-index: 2; pointer-events: none; }
.topbar-search .search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; padding: 2px 6px; }
.topbar-search .search-clear:hover { color: var(--neon); }

.topbar-search .search-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  border-radius: 6px;
  background: rgba(20, 25, 40, 0.98);
  border: 1px solid rgba(0, 255, 213, 0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 255, 213, 0.15), 0 0 20px rgba(0, 255, 213, 0.1);
  z-index: 9999;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 213, 0.4) transparent;
  overflow: hidden; opacity: 0; transform: translateY(-8px);
  max-height: 0; padding: 0;
  pointer-events: none; display: none;
}
.topbar-search .search-suggestions::-webkit-scrollbar { width: 6px; }
.topbar-search .search-suggestions::-webkit-scrollbar-track { background: transparent; margin: 4px 0; }
.topbar-search .search-suggestions::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(0, 255, 213, 0.5), rgba(168, 85, 247, 0.5)); border-radius: 3px; }
.topbar-search .search-suggestions::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--neon), var(--neon-3)); }
.topbar-search .search-suggestions.active {
  display: block; overflow-y: auto;
  opacity: 1; transform: translateY(0); max-height: 280px; padding: 4px 0;
  border-color: rgba(0, 255, 213, 0.25);
  pointer-events: auto;
}
body.light .topbar-search .search-suggestions {
  background: #ffffff;
  border-color: rgba(0, 168, 150, 0.3);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 168, 150, 0.1);
  scrollbar-color: rgba(0, 168, 150, 0.5) transparent;
}
body.light .topbar-search .search-suggestions::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(0, 168, 150, 0.6), rgba(140, 60, 220, 0.6)); }

.topbar-search .search-suggestion {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  cursor: pointer; color: var(--text);
  font-size: 12px; font-weight: 700;
  text-decoration: none; position: relative;
  transition: background 0.15s, color 0.15s;
}
.topbar-search .search-suggestion:not(:last-child)::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 213, 0.25) 20%, rgba(168, 85, 247, 0.25) 80%, transparent 100%);
}
.topbar-search .search-suggestion:hover { background: rgba(0, 255, 213, 0.15); color: var(--neon); }
.topbar-search .search-suggestion-logo { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar-search .search-suggestion-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; transition: transform 0.15s; }
.topbar-search .search-suggestion:hover .search-suggestion-logo img { transform: scale(1.1); }
.topbar-search .search-suggestion-name { font-size: 12px; font-weight: 700; }

/* ============================================================
   ЗАГОЛОВОК СЕКЦИИ
   ============================================================ */
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-left: 4px; }
.section-head-title {
  font-size: 13px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 2.5px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.section-head-title span:not(#currentHeaderTeam):not(#pastHeaderTeam) { color: var(--neon); font-weight: 900; margin-left: 6px; font-size: 11px; letter-spacing: 1px; text-transform: none; }
.section-head-title::before { content: none; }

/* ============================================================
   ПОИСК (вне топбара — базовый)
   ============================================================ */
.search-box { position: relative; margin-bottom: 12px; }
.search-box input {
  width: 100%; padding: 14px 44px 14px 18px;
  background: var(--match-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: 15px; font-family: inherit;
  transition: border-color 0.2s, padding-left 0.2s;
}
.search-box.has-logo input { padding-left: 52px; }
.search-box-logo { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; object-fit: contain; z-index: 2; pointer-events: none; }
.search-box input:focus { outline: none; border-color: var(--neon); }
.search-box input::placeholder { color: var(--text-dim); }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 6px 10px; }
.search-clear:hover { color: var(--neon); }

.search-suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--topbar-bg);
  border: 1px solid var(--border);
  border-radius: 8px; margin-top: 4px;
  max-height: 280px; overflow-y: auto;
  z-index: 100; display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.search-suggestions.active { display: block; }
.search-suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  cursor: pointer; color: var(--text);
  font-size: 14px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover { background: rgba(0, 255, 213, 0.1); color: var(--neon); }
.search-suggestion-logo { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.search-suggestion-logo img { width: 100%; height: 100%; object-fit: contain; }
.search-suggestion-name { flex: 1; }

/* ============================================================
   МАТЧИ
   ============================================================ */
.matches { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  margin-bottom: 36px; 
}

.day-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Карточка, поднятая наверх (live), отделяется от блоков дней */
.matches > .match.is-live,
.matches > .day-group.is-lifted {
  margin-bottom: 4px;
}
.match {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--match-bg);
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  position: relative; overflow: visible;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.3s;
}
.match:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
body:has(.replay-select.open) .match:hover {
  transform: none;
  box-shadow: none;
}
.match.match-focused {
  border-color: var(--neon);
  box-shadow: none !important;
  outline: none !important;
}

.match-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase;
}
.match-when { display: flex; align-items: baseline; gap: 6px; color: var(--text-dim); }
.match-day  { color: var(--neon); font-size: 14px; letter-spacing: -0.5px; }
.match-time { color: var(--text); }
.match-dot  { color: var(--text-muted); opacity: 0.6; }
.match-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag { padding: 3px 8px; border-radius: 3px; font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.tag-tour {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--neon-3);
  text-decoration: none; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
a.tag-tour:hover { background: rgba(168, 85, 247, 0.25); border-color: var(--neon-3); color: #fff; }
.tag-4k { background: linear-gradient(135deg, var(--neon-3), var(--neon-2)); color: #fff; text-decoration: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
a.tag-4k:hover { transform: translateY(-1px); box-shadow: 0 0 15px rgba(255, 0, 128, 0.5); }

.match-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.match-team {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; text-decoration: none; color: var(--text);
  font-weight: 800; font-size: 16px;
  transition: color 0.15s;
}
.match-team.home { justify-content: flex-start; }
.match-team.away { justify-content: flex-end; }
.match-team:hover { color: var(--neon); }
.match-team.match-team-hl { color: var(--neon); }
.match-team.match-team-hl .team-logo {
  border-color: var(--neon);
  background: rgba(0, 255, 213, 0.08);
}
.match-team:hover .team-logo { border-color: var(--neon); background: rgba(0, 255, 213, 0.08); }

.team-name { min-width: 0; line-height: 1.15; word-break: break-word; }
.match-team.away .team-name { text-align: right; }

.team-logo {
  width: 30px; height: 30px; border-radius: 5px;
  background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: var(--text-dim);
  flex-shrink: 0; overflow: hidden; padding: 3px;
  transition: border-color 0.2s, background 0.2s;
}
.team-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.match-score {
  display: flex; align-items: center; justify-content: center;
  min-width: 76px; height: 40px; padding: 0 14px;
  border-radius: 6px;
  font-size: 22px; font-weight: 900; letter-spacing: 1px;
  text-align: center; font-variant-numeric: tabular-nums;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.match-score:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(0, 255, 213, 0.4); }
.match-score.match-score-final {
  background: linear-gradient(135deg, rgba(0, 255, 213, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(0, 255, 213, 0.5);
  color: var(--neon);
  text-shadow: 0 0 12px rgba(0, 255, 213, 0.5);
}
.match-score.match-score-upcoming {
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: var(--text-dim);
  font-size: 15px; font-weight: 800;
}

/* ===== Блок счёта ===== */
.match-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Центрируем по вертикали */
  position: relative;
  min-width: 76px;
}
.match-status {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 3px;
  padding: 2px 6px;
  line-height: 1.2;
  white-space: nowrap;
  justify-self: center; /* Центрируем в сетке формы */
  align-self: center;
}
/* ===== Плашка LIVE / ПЕРЕРЫВ (в стиле статуса «Завершён») ===== */
.match-live-badge.match-status {
  /* Наследуем ширину и поведение от .match-status, 
     переопределяем только цвета для LIVE */
  color: #ff3b3b;
  background: rgba(255, 59, 59, 0.1);
  border: 1px solid rgba(255, 59, 59, 0.3);
  display: flex; /* Flex, чтобы кружок и текст стояли в ряд */
  align-items: center;
  justify-content: center;
  gap: 6px; /* Отступ между кружком и текстом */
  margin-top: 4px;
}

/* Пульсирующий кружок */
.match-live-badge .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px #ff3b3b;
  animation: livePulse 1.4s infinite ease-in-out;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.match-live-badge.match-status-live {
  color: #ff3b3b;
  background: rgba(255, 59, 59, 0.12);
  border-color: rgba(255, 59, 59, 0.4);
}

/* Подсветка карточки live-матча */
.match.is-live {
  border-color: rgba(0, 255, 213, 0.5);
  box-shadow: 0 0 20px rgba(0, 255, 213, 0.15);
}

body.light .match-status {
  color: var(--text-dim);
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.2);
}

.match-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border);
}

.quality-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.quality-row > * { vertical-align: middle; }
.quality-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.25);
  color: var(--neon);
  padding: 3px 10px; border-radius: 4px;
  font-size: 10px; font-weight: 800;
  text-decoration: none; text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.quality-btn:focus { outline: none; }
.quality-btn:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .quality-btn:hover { background: var(--neon); color: #05060d; border-color: var(--neon); }
}
/* ============================================================
   ПОВТОР МАТЧА (архив туров) — выпадающий селект
   ============================================================ */
.replay-select {
  position: relative;
  display: inline-block;
  width: auto;
  max-width: 100%;
  line-height: 1;
}
.replay-select.open {
  z-index: 100;
}
/* Когда селект открыт — вся карточка .match поднимается над соседними */
.match:has(.replay-select.open) {
  z-index: 200;
  position: relative;
  overflow: visible;
}

.replay-toggle,
.review-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.25);
  color: var(--neon);
  border-radius: 6px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; font-family: inherit;
  line-height: 1;
  box-sizing: border-box;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.replay-toggle:focus,
.review-toggle:focus { outline: none; }
.replay-toggle:focus-visible,
.review-toggle:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.replay-toggle:focus { outline: none; }
.replay-toggle:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.replay-caret { font-size: 10px; margin-left: 0; transition: transform 0.2s; }
.replay-select.open .replay-caret { transform: rotate(180deg); }

.replay-list {
  position: absolute;
  top: calc(100% + 4px); left: 0;
  min-width: 100%;
  display: none;
  flex-direction: column;
  background: var(--topbar-bg);
  border: 1px solid rgba(0, 255, 213, 0.35);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
  overflow: hidden;
  opacity: 0;
}
.replay-select.open .replay-list { display: flex; opacity: 1; }

.replay-item {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  font-size: 11px; font-weight: 800;
  text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.replay-item:last-child { border-bottom: none; }
.replay-item:focus { outline: none; }
.replay-item:focus-visible { outline: 2px solid var(--neon); outline-offset: -2px; }

/* Кнопка «Обзор матча» — стиль общий с .replay-toggle (см. выше) */

/* Тур-подборки: сейвы / моменты / все голы — над карточками тура */
.tour-reviews-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 4px 12px;
}
.tour-review-btn {
  height: 30px;
  padding: 0 14px;
  font-size: 11px;
}

@media (hover: hover) and (pointer: fine) {
  .replay-toggle:hover {
    background: rgba(0, 255, 213, 0.18);
    color: var(--neon);
    border-color: var(--neon);
    box-shadow: 0 0 12px rgba(0, 255, 213, 0.25);
  }
  .review-toggle:hover {
    background: rgba(0, 255, 213, 0.18);
    color: var(--neon);
    border-color: var(--neon);
    box-shadow: 0 0 12px rgba(0, 255, 213, 0.25);
  }
  .replay-item:hover {
    background: rgba(0, 255, 213, 0.18);
    color: var(--neon);
  }
}

.quality-timer {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 3px 10px; border-radius: 4px;
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.25);
  color: var(--neon);
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.5px; text-transform: uppercase;
  cursor: default; user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.quality-timer .timer-icon { font-size: 10px; line-height: 1; }
.quality-timer .timer-count { font-variant-numeric: tabular-nums; color: #fff; font-weight: 900; letter-spacing: 0.5px; }
.quality-timer .timer-unit { font-size: 8px; font-weight: 800; letter-spacing: 0; margin-left: 1px; color: #fff; opacity: 0.85; }
.quality-timer .timer-part { display: inline-flex; align-items: baseline; }
.quality-timer .timer-num { font-variant-numeric: tabular-nums; color: #fff; font-weight: 900; letter-spacing: 0.5px; }
.quality-timer.expiring { background: rgba(0, 255, 213, 0.15); border-color: var(--neon); box-shadow: 0 0 12px rgba(0, 255, 213, 0.35); color: var(--neon); }

.match-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.3px; }
.meta-sep { color: var(--text-muted); opacity: 0.5; }

/* ============================================================
   ФОРМА КОМАНД (5 квадратиков)
   ============================================================ */
.match-form { 
  display: grid; 
  grid-template-columns: 1fr auto 1fr; /* 3 колонки: левые квадраты, плашка, правые квадраты */
  align-items: center;
  gap: 10px; 
  margin-top: -4px;
  position: relative;
}
/* Невидимая заглушка для будущих матчей, чтобы форма не съезжала */
.match-status-placeholder {
  width: 1px;
  height: 1px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.match-form-side { display: flex; align-items: center; min-width: 0; }
.match-form-home { justify-content: flex-start; }
.match-form-away { justify-content: flex-end; margin-left: auto; }

.form-row { display: inline-flex; align-items: center; gap: 3px; }
.form-sq {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 2px;
  font-size: 7px; font-weight: 900; line-height: 1;
  color: #fff; user-select: none; flex-shrink: 0;
  text-decoration: none; opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s;
}
.form-sq:hover { opacity: 1; transform: scale(1.15); }
.form-w { background: #16a34a; }
.form-d { background: #eab308; color: #1a1a1a; }
.form-l { background: #dc2626; }
body.light .form-w { background: #15803d; }
body.light .form-d { background: #ca8a04; }
body.light .form-l { background: #b91c1c; }

.past-match { opacity: 0.9; }

/* ============================================================
   ТУРЫ
   ============================================================ */
.tours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tour-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; height: 56px; padding: 0 18px;
  background: var(--tour-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none; color: var(--text);
  font-size: 14px; font-weight: 800;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s ease;
}
.tour-card:hover { background: rgba(0, 255, 213, 0.1); border-color: var(--neon); color: var(--neon); transform: translateY(-2px); }
.tour-card .arrow { color: var(--neon); font-size: 14px; }
.tour-card-large { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; }
.tour-card-info { display: flex; flex-direction: column; gap: 4px; }
.tour-name-big { font-size: 17px; font-weight: 900; }
.tour-dates { font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   КОМАНДЫ
   ============================================================ */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.team-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 18px 14px;
  background: var(--tour-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: all 0.25s ease;
}
.team-card:hover { border-color: var(--neon); background: rgba(0, 255, 213, 0.08); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.team-card-logo { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; padding: 4px; }
.team-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.team-card-name { font-size: 14px; font-weight: 800; text-align: center; }
.team-card-stadium { font-size: 10px; color: var(--text-dim); text-align: center; line-height: 1.3; font-weight: 600; }

/* ============================================================
   КАЛЕНДАРЬ
   ============================================================ */
.cal-month { margin-bottom: 24px; }
.cal-month-row { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  margin-bottom: 10px; 
  flex-wrap: wrap; /* <--- РАЗРЕШАЕМ ПЕРЕНОС НА НОВУЮ СТРОКУ */
}
.cal-month-row > *,
.cal-month-row .cal-teams-wrapper { height: 32px; display: inline-flex; align-items: center; }
.cal-month-row .cal-month-title,
.cal-month-row .cal-tour-title { margin-bottom: 0; }

.cal-tour-group { margin-bottom: 18px; }

.cal-tour-title {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; margin-bottom: 10px;
  font-size: 12px; font-weight: 900;
  color: var(--neon-3);
  text-transform: uppercase; letter-spacing: 1.5px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 5px;
  text-decoration: none; cursor: pointer;
  white-space: nowrap;       /* <--- ДОБАВИТЬ ЭТО */
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
a.cal-tour-title:hover { background: rgba(168, 85, 247, 0.2); border-color: var(--neon-3); color: #fff; transform: translateY(-1px); }
.cal-tour-title.cal-tour-future { background: rgba(0, 255, 213, 0.1); border-color: rgba(0, 255, 213, 0.4); color: var(--neon); }
.cal-tour-title.cal-tour-upcoming { background: rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.4); color: var(--neon-3); }
.cal-tour-title.cal-tour-past { background: rgba(100, 116, 139, 0.08); border-color: rgba(100, 116, 139, 0.3); color: var(--text-dim); }
.cal-tour-status { font-size: 9px; font-weight: 800; letter-spacing: 0.5px; padding: 2px 6px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; text-transform: none; line-height: 1; }

.cal-month-title {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 12px;
  font-size: 12px; font-weight: 900;
  color: var(--neon);
  background: rgba(0, 255, 213, 0.08);
  border: 1px solid rgba(0, 255, 213, 0.3);
  border-radius: 5px;
  text-transform: uppercase; letter-spacing: 1.5px;
  white-space: nowrap;       /* <--- ДОБАВИТЬ ЭТО */
}

.cal-match {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 6px;
  background: var(--match-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.cal-match:hover { border-color: var(--neon); transform: translateX(4px); }

.cal-date { display: flex; flex-direction: column; align-items: center; gap: 0; padding-right: 12px; border-right: 1px solid var(--border); }
.cal-day { font-size: 22px; font-weight: 900; color: var(--neon); text-align: center; letter-spacing: -1px; line-height: 1; }
.cal-month-short { font-size: 9px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.cal-time-inline { font-size: 11px; font-weight: 800; color: var(--text); margin-top: 3px; }

.cal-teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-weight: 700; }
.cal-team { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: inherit; transition: color 0.15s; }
a.cal-team:hover { color: var(--neon); }
.cal-team .team-logo { width: 24px; height: 24px; padding: 2px; flex-shrink: 0; }
.cal-team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 800; }
.cal-attendance { font-size: 10px; color: var(--text-muted); font-weight: 600; margin-top: 2px; letter-spacing: 0.3px; }

.cal-score {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; min-width: 44px; padding: 6px 10px; border-radius: 5px;
  font-size: 14px; font-weight: 900; letter-spacing: 0.5px;
  text-align: center; font-variant-numeric: tabular-nums;
}
.cal-score-num { line-height: 1.1; }
.cal-score.cal-score-final {
  background: linear-gradient(135deg, rgba(0, 255, 213, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(0, 255, 213, 0.5);
  color: var(--neon);
  text-shadow: 0 0 10px rgba(0, 255, 213, 0.6);
}
.cal-score.cal-score-upcoming { background: rgba(100, 116, 139, 0.08); border: 1px solid rgba(100, 116, 139, 0.3); color: var(--text-dim); font-size: 12px; font-weight: 800; padding: 4px 10px; }

/* ============================================================
   ФУТЕР И ДИСКЛЕЙМЕР
   ============================================================ */
.footer { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.footer .neon { color: var(--neon); font-weight: 800; }

.disclaimer {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  background: rgba(100, 116, 139, 0.06);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 8px;
  padding: 12px 20px;
  margin-top: 32px; margin-bottom: 0;
}
.disclaimer-icon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.disclaimer-text { font-size: 11px; color: var(--text-muted); line-height: 1.6; letter-spacing: 0.2px; }
.disclaimer-text b { color: var(--text-dim); font-weight: 700; }

/* ============================================================
   ПЛАВНОЕ ПЕРЕКЛЮЧЕНИЕ ТЕМЫ
   ============================================================ */
body, .topbar, .nav-tabs, .nav-tab, .match, .tour-card, .team-card,
.cal-match, .search-box, .topbar-search input, .theme-toggle,
.disclaimer, .footer { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }

/* ============================================================
   ДВУХКОЛОНОЧНЫЙ LAYOUT НА ГЛАВНОЙ
   ============================================================ */
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.main-layout-col { min-width: 0; }
.main-layout-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden; padding-right: 2px; }
.main-layout-side::-webkit-scrollbar { width: 4px; }
.main-layout-side::-webkit-scrollbar-track { background: transparent; }
.main-layout-side::-webkit-scrollbar-thumb { background: rgba(0, 255, 213, 0.2); border-radius: 2px; }

.main-layout .match { padding: 14px 16px; gap: 12px; }
.main-layout .match-team { font-size: 14px; gap: 8px; }
.main-layout .team-logo { width: 28px; height: 28px; padding: 3px; }
.main-layout .match-score { min-width: 62px; height: 36px; font-size: 18px; padding: 0 10px; }
.main-layout .match-score.match-score-upcoming { font-size: 13px; padding: 0 10px; }
.main-layout .match-meta { font-size: 10px; }
.main-layout .quality-btn { padding: 2px 8px; font-size: 9px; }

/* ============================================================
   ТУРНИРНАЯ ТАБЛИЦА
   ============================================================ */
.table-card { background: var(--match-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 0; }

.table-header {
  display: grid;
  grid-template-columns: 26px 1fr 24px 24px 24px 24px 30px;
  align-items: center; gap: 4px;
  padding: 10px 12px;
  font-size: 9px; font-weight: 900;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 255, 213, 0.03);
}
.table-header-club { padding-left: 4px; }
.table-header-pos { text-align: center; }
.table-header-pts { text-align: center; color: var(--text-dim); }
.table-header .table-stat-i { color: var(--text-dim); }
.table-header .table-stat-w { color: #4ade80; }
.table-header .table-stat-d { color: #facc15; }
.table-header .table-stat-l { color: #ff2d55; }

.table-body { display: flex; flex-direction: column; }

.table-row {
  display: grid;
  grid-template-columns: 26px 1fr 24px 24px 24px 24px 30px;
  align-items: center; gap: 4px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: background 0.15s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: rgba(0, 255, 213, 0.04); }
.table-row:hover .table-club-name { color: var(--neon); }

/* Подсветка строки выбранной команды (поиск) */
.table-row-active {
  background: linear-gradient(90deg, rgba(0, 255, 213, 0.14) 0%, rgba(168, 85, 247, 0.10) 100%) !important;
  border-left: 3px solid var(--neon);
  padding-left: 9px;
}
.table-row-active .table-club-name { color: var(--neon); font-weight: 900; }
.table-row-active .table-pos { box-shadow: 0 0 12px rgba(0, 255, 213, 0.35); }
body.light .table-row-active { background: linear-gradient(90deg, rgba(0, 168, 150, 0.12) 0%, rgba(140, 60, 220, 0.08) 100%) !important; }

/* Подсветка строк команд текущего матча */
.table-row-match {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.14) 0%, rgba(0, 255, 213, 0.08) 100%) !important;
  border-left: 3px solid var(--neon-3);
  padding-left: 9px;
}
.table-row-match .table-club-name { color: var(--neon-3); font-weight: 900; }
.table-row-match .table-pos { box-shadow: 0 0 12px rgba(168, 85, 247, 0.35); }
body.light .table-row-match { background: linear-gradient(90deg, rgba(140, 60, 220, 0.10) 0%, rgba(0, 168, 150, 0.06) 100%) !important; }

/* Приоритет: если строка и матч, и поиск — неоновая подсветка поиска */
.table-row-active.table-row-match {
  background: linear-gradient(90deg, rgba(0, 255, 213, 0.14) 0%, rgba(168, 85, 247, 0.10) 100%) !important;
  border-left-color: var(--neon);
}
.table-row-active.table-row-match .table-club-name { color: var(--neon); }
.table-row-active.table-row-match .table-pos { box-shadow: 0 0 12px rgba(0, 255, 213, 0.35); }

.table-pos {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px;
  font-size: 10px; font-weight: 900; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
}
.table-pos-gold { background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 180, 0, 0.15)); color: #ffd700; box-shadow: 0 0 8px rgba(255, 215, 0, 0.35); }
.table-pos-silver { background: linear-gradient(135deg, rgba(200, 210, 220, 0.25), rgba(160, 175, 190, 0.15)); color: #c8d2dc; box-shadow: 0 0 8px rgba(200, 210, 220, 0.3); }
.table-pos-bronze { background: linear-gradient(135deg, rgba(205, 127, 50, 0.25), rgba(180, 100, 40, 0.15)); color: #cd7f32; box-shadow: 0 0 8px rgba(205, 127, 50, 0.3); }
.table-pos-playoff { background: rgba(255, 120, 120, 0.15); color: #ff8a8a; }
.table-pos-relegation { background: rgba(255, 45, 85, 0.15); color: #ff2d55; }

.table-club { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 800; }
.table-club-logo { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; }
.table-club-logo img { width: 100%; height: 100%; object-fit: contain; }
.table-club-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }

.table-stat { text-align: center; color: var(--text-dim); font-weight: 700; font-size: 10px; font-variant-numeric: tabular-nums; }
.table-pts { text-align: center; font-weight: 900; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

.table-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 9px; color: var(--text-dim); font-weight: 600; }
.table-legend span { display: flex; align-items: center; gap: 5px; }
.table-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.table-legend-playoff { background: #ff8a8a; }
.table-legend-relegation { background: #ff2d55; }

/* ============================================================
   РАЗДЕЛИТЕЛЬ «БУДУЩИЕ / ПРОШЕДШИЕ»
   ============================================================ */
#sectionsDivider {
  display: block;
  width: 100%;
  height: 1px;
  margin: 24px 0 20px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 255, 213, 0.35) 20%,
    rgba(0, 255, 213, 0.6) 50%,
    rgba(0, 255, 213, 0.35) 80%,
    transparent 100%);
  border-radius: 1px;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .main-layout-side { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .main-layout + .section-head { margin-top: 24px; }
}

@media (max-width: 600px) {
  body { padding: 0 12px 14px; }
  .container {
    animation: none;
  }
     .table-pos-gold,
  .table-pos-silver,
  .table-pos-bronze,
  .table-pos-playoff,
  .table-pos-relegation,
  .table-row-active .table-pos,
  .table-row-match .table-pos {
    box-shadow: none !important;
  }

      .match.match-focused {
    box-shadow: none !important;
    outline: none !important;
    border-color: var(--neon) !important;
    border-width: 1px !important;
    background: var(--match-bg) !important;
  }

  .quality-timer.expiring {
    box-shadow: none !important;
  }
  .topbar {
    position: -webkit-sticky; position: sticky;
    top: 0;
    flex-wrap: wrap; align-items: center; align-content: center;
    padding: 8px 10px;
    z-index: 1000; isolation: isolate;
    background: var(--topbar-bg);
    border-radius: 0 0 10px 10px;
    margin-left: -12px; margin-right: -12px;
    padding-left: 22px; padding-right: 22px;
    margin-bottom: 12px; margin-top: 0;
    min-height: 44px; gap: 8px;
  }

  .brand-logo { width: 34px; height: 34px; border-radius: 6px; }
  .brand-name { font-size: 12px; }
  .brand-sub { font-size: 9px; letter-spacing: 1.2px; }
  .theme-toggle { width: 30px; height: 30px; font-size: 14px; border-radius: 6px; }
  .tour-badge { height: 30px; padding: 0 12px; border-radius: 6px; }
  .tour-badge-value { font-size: 14px; }

  .nav-tab { padding: 0 10px; font-size: 11px; height: 30px; }

  .search-toggle { display: flex; width: 30px; height: 30px; border-radius: 6px; }
  .search-toggle svg { width: 15px; height: 15px; }

  .topbar-search {
    display: none;
    order: 10; flex-basis: 100%; width: 100%; min-width: 0;
    position: relative; align-items: center;
    margin-top: 6px; margin-bottom: 0;
  }
  .topbar-search.expanded,
  .topbar-search.closing { display: flex; }
  .topbar-search.expanded { animation: searchSlideIn 0.3s ease-out forwards; }
  .topbar-search.closing  { animation: searchSlideOut 0.3s ease-in forwards; }
  @keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-8px); max-height: 0; }
    to   { opacity: 1; transform: translateY(0);   max-height: 60px; }
  }
  @keyframes searchSlideOut {
    from { opacity: 1; transform: translateY(0);    max-height: 60px; }
    to   { opacity: 0; transform: translateY(-8px); max-height: 0; }
  }
  .topbar-search.expanded { max-height: 60px; opacity: 1; margin-top: 6px; height: 40px; align-items: center; }
  .topbar-search.expanded input { height: 40px; display: block; }
  .topbar-search.expanded .search-box-logo { top: 50%; transform: translateY(-50%); bottom: auto; left: 12px; width: 20px; height: 20px; }
  .topbar-search.expanded .search-clear { top: 50%; transform: translateY(-50%); bottom: auto; right: 10px; font-size: 14px; padding: 4px 8px; }
  .topbar-search input { height: 40px; font-size: 14px; padding: 0 36px 0 38px; background-position: 12px center; background-size: 18px 18px; }
  .topbar-search .search-box-logo { left: 12px; width: 20px; height: 20px; }
  .topbar-search .search-clear { right: 10px; font-size: 14px; padding: 4px 8px; }
  .topbar-search .search-suggestions.active { max-height: 220px; }
  .topbar-search .search-suggestions::-webkit-scrollbar { width: 5px; }
  .topbar-search .search-suggestions::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(0, 255, 213, 0.5), rgba(168, 85, 247, 0.5)); border-radius: 3px; }
  .topbar-search .search-suggestion { padding: 10px 12px; font-size: 14px; }
  .topbar-search .search-suggestion-logo { width: 22px; height: 22px; }
  .topbar-search .search-suggestion-name { font-size: 14px; }

  .section-head { margin-bottom: 12px; }
  .section-head-title { font-size: 11px; letter-spacing: 1.5px; }
  .section-head-title span { font-size: 10px; letter-spacing: 0.5px; }

  .main-layout { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .main-layout-side { position: static; max-height: none; overflow: visible; padding-right: 0; margin-top: 0; }
  .main-layout + .section-head { margin-top: 24px; }
  .main-layout-col { margin-bottom: 0; }
  .main-layout .matches { margin-bottom: 20px; }
  .table-card { margin-bottom: 0; }
  #currentSection, #pastSection { margin-bottom: 24px; }
  #pastSection { margin-bottom: 0; }
  .main-layout .match { padding: 14px; gap: 12px; }
  .main-layout .match-team { font-size: 13px; gap: 6px; }
  .main-layout .team-logo { width: 26px; height: 26px; padding: 2px; }
  .main-layout .match-score { min-width: 62px; height: 36px; font-size: 18px; padding: 0 10px; }
  .main-layout .quality-btn { padding: 2px 8px; font-size: 9px; }
  .match { padding: 14px; gap: 12px; }
  .match-day { font-size: 13px; }
  .match-main { gap: 10px; }
  .match-team { font-size: 13px; gap: 6px; line-height: 1.15; }
  .team-logo { width: 26px; height: 26px; padding: 2px; }
  .match-score { min-width: 62px; height: 36px; font-size: 18px; padding: 0 10px; }
  .match-score.match-score-upcoming { font-size: 13px; padding: 0 10px; height: 36px; }
  .match-bottom { flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding-top: 10px; }
  .quality-row { gap: 5px; justify-content: center; }
  .match-meta { justify-content: center; flex-wrap: wrap; gap: 4px 6px; font-size: 10px; line-height: 1.4; text-align: center; }
  .meta-item { white-space: nowrap; }
  .quality-btn { padding: 2px 8px; font-size: 9px; }

  .match-form { gap: 6px; margin-top: -6px; }
  .form-sq { width: 11px; height: 11px; font-size: 6px; }

  .match:hover { transform: none; box-shadow: none; }

  .tours-grid { grid-template-columns: 1fr 1fr; }
  .tour-card-large { padding: 16px 18px; }
  .tour-name-big { font-size: 15px; }
  .tour-dates { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .teams-grid { grid-template-columns: 1fr 1fr; }
  .team-card { padding: 14px 10px; }
  .team-card-logo { width: 40px; height: 40px; }
  .team-card-name { font-size: 12px; }
  .team-card-stadium { font-size: 9px; }

  .cal-teams-wrapper { margin-left: 0; margin-top: 6px; flex-basis: 100%; width: 100%; }
  .cal-month-title,
  .cal-tour-title,
  .cal-teams-filter,
  .cal-month-row > *,
  .cal-month-row .cal-teams-wrapper { height: 34px; }
  .cal-month-title,
  .cal-tour-title { padding: 0 10px; font-size: 11px; }
  .cal-teams-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; -webkit-overflow-scrolling: touch; }
  .cal-teams-filter::-webkit-scrollbar { display: none; }
  .cal-team-filter { width: 22px; height: 22px; padding: 2px; flex-shrink: 0; }
  .cal-teams-arrow { display: flex; }
  .cal-match { grid-template-columns: 50px 1fr auto; gap: 10px; padding: 12px 14px; }
  .cal-date { padding-right: 10px; }
  .cal-day { font-size: 20px; }
  .cal-team-name { font-size: 13px; }
  .cal-score { font-size: 12px; padding: 4px 8px; min-width: 40px; gap: 1px; }
  .cal-score.cal-score-upcoming { font-size: 12px; padding: 4px 10px; }

  .scroll-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  .scroll-top svg { width: 20px; height: 20px; }

  .disclaimer { padding: 12px 14px; margin-top: 24px; gap: 10px; }
  .disclaimer-icon { font-size: 16px; }
  .disclaimer-text { font-size: 10px; line-height: 1.5; }
}
/* ============================================================
   ОТКЛЮЧЕНИЕ HOVER-ЭФФЕКТОВ НА ТАЧ-УСТРОЙСТВАХ
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .match,
  .tour-card,
  .team-card,
  .cal-match,
  .table-row,
  .quality-btn,
  .form-sq,
  .cal-team-filter,
  .search-suggestion {
    transition: none !important;
  }

    .match:hover,
  .tour-card:hover,
  .team-card:hover,
  .cal-match:hover,
  .table-row:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border) !important;
    background: var(--match-bg) !important;
  }
  .match:hover.match-focused {
    border-color: var(--neon) !important;
  }
  .team-card:hover { background: var(--tour-bg) !important; }

  .table-row:hover { background: transparent !important; }
  .table-row:hover .table-club-name { color: inherit !important; }

  .form-sq:hover { transform: none !important; opacity: 0.75 !important; }
  .quality-btn:hover { background: rgba(0, 255, 213, 0.08) !important; color: var(--neon) !important; border-color: rgba(0, 255, 213, 0.25) !important; }
}

/* ============================================================
   ПК-ВЕРСИЯ: УВЕЛИЧЕНИЕ ИНТЕРФЕЙСА НА 25%
   ============================================================ */
@media (min-width: 901px) {

  /* --- Контейнер шире на 25% --- */
  .container {
    max-width: 1000px;          
    animation: none;            
  }

  body { padding: 25px 20px; }
  .topbar { min-height: 55px; padding: 6px 12px; gap: 15px; margin-bottom: 15px; }
  .nav-tab { height: 40px; padding: 0 15px; font-size: 15px; }
  .topbar-search { width: 275px; }
  .topbar-search input { height: 40px; font-size: 15px; padding: 0 38px 0 40px; background-position: 12px center; background-size: 20px 20px; }
  .search-toggle { width: 40px; height: 40px; }
  .theme-toggle { width: 40px; height: 40px; font-size: 20px; }
  .section-head { margin-bottom: 15px; gap: 18px; }
  .section-head-title { font-size: 16px; letter-spacing: 3px; }
  .day-head { padding: 8px 5px 3px; gap: 15px; }
  .day-head-text { font-size: 15px; letter-spacing: 2.5px; }

  /* --- Карточка матча --- */
  .match { padding: 20px 25px; gap: 18px; border-radius: 13px; }
  .match-top { font-size: 14px; letter-spacing: 1.5px; }
  .match-day { font-size: 18px; }
  .match-tags { gap: 8px; }
  .tag { padding: 4px 10px; font-size: 11px; letter-spacing: 1.25px; }
  .match-main { gap: 18px; }
  .match-team { font-size: 20px; gap: 13px; }
  .team-logo { width: 38px; height: 38px; padding: 4px; border-radius: 6px; }
  .match-score { min-width: 95px; height: 50px; padding: 0 18px; font-size: 28px; border-radius: 8px; }
  .match-score.match-score-upcoming { font-size: 19px; }
  .match-score-block { min-width: 95px; }
  .match-status { font-size: 11px; padding: 3px 8px; border-radius: 4px; }
  .match-form { gap: 13px; }
  .form-sq { width: 16px; height: 16px; font-size: 9px; border-radius: 3px; }
  .form-row { gap: 4px; }
  .match-bottom { padding-top: 15px; gap: 13px; }
  .quality-row { gap: 8px; }
  .quality-btn { padding: 4px 13px; font-size: 13px; border-radius: 5px; }
  .replay-toggle, .review-toggle { height: 33px; padding: 0 13px; font-size: 14px; border-radius: 8px; gap: 5px; }
  .replay-item { padding: 10px 15px; font-size: 14px; }
  .replay-caret { font-size: 13px; }
  .quality-timer { padding: 4px 13px; font-size: 13px; gap: 8px; }
  .quality-timer .timer-icon { font-size: 13px; }
  .quality-timer .timer-unit { font-size: 10px; }
  .match-meta { font-size: 14px; gap: 8px; }

  /* --- Правая колонка и таблица --- */
  .main-layout { grid-template-columns: minmax(0, 1fr) 425px; gap: 25px; }
  .main-layout-side { top: 15px; max-height: calc(100vh - 30px); }
  .main-layout .match { padding: 18px 20px; gap: 15px; }
  .main-layout .match-team { font-size: 18px; gap: 10px; }
  .main-layout .team-logo { width: 35px; height: 35px; padding: 4px; }
  .main-layout .match-score { min-width: 78px; height: 45px; font-size: 22px; padding: 0 13px; }
  .main-layout .match-score.match-score-upcoming { font-size: 16px; }
  .main-layout .match-meta { font-size: 13px; }
  .main-layout .quality-btn { padding: 3px 10px; font-size: 11px; }
  .table-header, .table-row { grid-template-columns: 33px 1fr 30px 30px 30px 30px 38px; gap: 5px; padding: 9px 15px; }
  .table-header { padding: 13px 15px; font-size: 11px; letter-spacing: 1.25px; }
  .table-row { font-size: 15px; }
  .table-pos { width: 25px; height: 25px; font-size: 13px; border-radius: 5px; }
  .table-club { gap: 8px; }
  .table-club-logo { width: 23px; height: 23px; }
  .table-club-name { font-size: 15px; }
  .table-stat { font-size: 13px; }
  .table-pts { font-size: 16px; }
  .table-legend { gap: 15px; padding: 10px 15px; font-size: 11px; }
  .table-legend i { width: 10px; height: 10px; }

  /* --- Календарь --- */
  .cal-month-row { gap: 13px; margin-bottom: 13px; }
  .cal-month-row > *, .cal-month-row .cal-teams-wrapper { height: 40px; }
  .cal-tour-group { margin-bottom: 23px; }
  .cal-tour-title, .cal-month-title { height: 40px; padding: 0 15px; font-size: 15px; letter-spacing: 1.9px; }
  .cal-match { grid-template-columns: 70px 1fr auto; gap: 15px; padding: 15px 20px; margin-bottom: 8px; font-size: 18px; }
  .cal-day { font-size: 28px; }
  .cal-month-short { font-size: 11px; }
  .cal-time-inline { font-size: 14px; }
  .cal-team { gap: 10px; }
  .cal-team .team-logo { width: 30px; height: 30px; }
  .cal-team-name { font-size: 18px; }
  .cal-score { min-width: 55px; padding: 8px 13px; font-size: 18px; }
  .cal-score.cal-score-upcoming { font-size: 15px; }

       /* --- Фильтр команд --- */
  .cal-teams-wrapper {
    margin-left: auto;         /* Прижимаем к правому краю */
    width: max-content;
    max-width: 100%;
  }
  .cal-teams-filter {
    height: 40px !important;   
    padding: 0 10px;
    gap: 6px;
    border-radius: 5px;
    flex-wrap: nowrap;         /* Иконки не переносятся внутри блока */
    justify-content: flex-start;
    overflow-x: auto;          /* Если не влезают — скролл */
    width: max-content;          
    max-width: 100%;
    flex: 0 1 auto;              
    min-width: 0;
    background: var(--match-bg);
    border: 1px solid var(--border);
    box-sizing: border-box; 
    scrollbar-width: none;
  }
  .cal-team-filter {
    width: 32px;                 
    height: 32px;
    padding: 3px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .cal-team-filter-reset {
    width: 32px;
    height: 32px;
    font-size: 16px;
    flex-shrink: 0;
    display: none;               
  }
  /* --- Туры (архив) --- */
  .tours-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 13px; }
  .tour-card-large { padding: 20px 22px; gap: 15px; min-height: 88px; }
  .tour-name-big { font-size: 20px; }
  .tour-dates { font-size: 14px; white-space: normal; line-height: 1.3; }

  /* --- Команды --- */
  .teams-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; }
  .team-card { padding: 22px 18px; }
  .team-card-logo { width: 60px; height: 60px; }
  .team-card-name { font-size: 18px; }
  .team-card-stadium { font-size: 13px; }

  /* --- Кнопка «Наверх» --- */
  .scroll-top { width: 55px; height: 55px; right: 25px; bottom: 25px; border-radius: 13px; }
  .scroll-top svg { width: 28px; height: 28px; }

  /* --- Футер и дисклеймер --- */
  .footer { font-size: 15px; margin-top: 60px; padding-top: 30px; }
  .disclaimer { padding: 15px 25px; gap: 15px; margin-top: 40px; }
  .disclaimer-icon { font-size: 23px; }
  .disclaimer-text { font-size: 14px; }
     /* --- Футер и дисклеймер --- */
  .footer { font-size: 15px; margin-top: 60px; padding-top: 30px; }
  .disclaimer { padding: 15px 25px; gap: 15px; margin-top: 40px; }
  .disclaimer-icon { font-size: 23px; }
  .disclaimer-text { font-size: 14px; }
   /* Увеличение названия выбранной команды в фильтре календаря */
}
/* ============================================================
   ВОЗВРАТ КОМПАКТНЫХ КАРТОЧЕК НА МОБИЛЬНЫХ
   ============================================================ */
@media (max-width: 900px) {
  .tours-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .tour-card-large {
    padding: 16px 18px !important;
    min-height: auto !important;
  }
  .tour-name-big { font-size: 15px !important; }
  .tour-dates { font-size: 10px !important; white-space: nowrap !important; }
  
  .teams-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .team-card { padding: 14px 10px !important; }
  .team-card-logo { width: 40px !important; height: 40px !important; }
  .team-card-name { font-size: 12px !important; }
  .team-card-stadium { font-size: 9px !important; }
}
