/* Страницы лиг и клубов (views/leagues/*, views/clubs/*, app/club/*): карточки, шапка с
   аватаром, вкладки, таблицы - в духе страниц турниров (public/css/tournaments.css). Цвета -
   токены common.css (--surface-1/2, --text-1/2, --border, --link), тёмная тема -
   html[data-theme='dark']. Тёмные строки bootstrap и постраничник - public/css/dark_lists.css. */

:root {
  --lc-accent: #2563eb;
  --lc-accent-soft: rgba(37, 99, 235, 0.1);
  --lc-live: #15803d;
  --lc-live-soft: rgba(22, 163, 74, 0.12);
  --lc-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  --lc-gold: #b7791f;
  --lc-gold-soft: rgba(234, 179, 8, 0.16);
  --lc-silver: #64748b;
  --lc-silver-soft: rgba(148, 163, 184, 0.2);
  --lc-bronze: #b45309;
  --lc-bronze-soft: rgba(217, 119, 6, 0.14);
  --lc-me: rgba(37, 99, 235, 0.08);
}
html[data-theme='dark'] {
  --lc-accent: #6ea2ff;
  --lc-accent-soft: rgba(79, 140, 255, 0.16);
  --lc-live: #4ade80;
  --lc-live-soft: rgba(74, 222, 128, 0.14);
  --lc-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  --lc-gold: #facc15;
  --lc-gold-soft: rgba(250, 204, 21, 0.14);
  --lc-silver: #cbd5e1;
  --lc-silver-soft: rgba(203, 213, 225, 0.12);
  --lc-bronze: #fb923c;
  --lc-bronze-soft: rgba(251, 146, 60, 0.14);
  --lc-me: rgba(79, 140, 255, 0.12);
}

.lc-page {
  padding-bottom: 24px;
  min-width: 0;
}

/* ---------- заголовок раздела ---------- */
.lc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 24px 0 18px;
}
.lc-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-1, #1f2328);
  word-break: break-word;
}
.lc-how {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.9rem;
}
.lc-muted {
  color: var(--text-2, #6b7280);
}
.lc-small {
  font-size: 0.85rem;
}

/* ---------- переключатель «Мои / Все» ---------- */
.lc-seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--surface-2, #f6f7f9);
  border: 1px solid var(--border, #e5e7eb);
}
.lc-seg-btn {
  display: inline-block;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2, #6b7280);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
}
.lc-seg-btn:hover,
.lc-seg-btn:focus {
  color: var(--text-1, #1f2328);
  text-decoration: none;
}
.lc-seg-btn.is-on {
  background: var(--surface-1, #ffffff);
  color: var(--lc-accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
html[data-theme='dark'] .lc-seg-btn.is-on {
  background: var(--lc-accent-soft);
  box-shadow: none;
}

/* ---------- карточки ---------- */
.lc-card {
  background: var(--surface-1, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  color: var(--text-1, #1f2328);
}
.lc-card + .lc-card {
  margin-top: 12px;
}
.lc-empty {
  text-align: center;
  color: var(--text-2, #6b7280);
  padding: 28px 16px;
}

/* сетка лиг и клубов: карточка - аватар, название, участники, флаг */
.lc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.lc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface-1, #ffffff);
  color: var(--text-1, #1f2328);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lc-item:hover,
.lc-item:focus {
  border-color: var(--lc-accent);
  box-shadow: var(--lc-shadow);
  color: var(--text-1, #1f2328);
  text-decoration: none;
  transform: translateY(-1px);
}
.lc-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.lc-item-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.lc-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 6px;
}
.lc-more {
  text-align: center;
  margin-top: 16px;
}

/* аватар: картинка поверх первой буквы на цветном фоне (картинки нет или не загрузилась) */
.lc-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: hsl(var(--lc-hue, 215), 52%, 47%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  user-select: none;
}
.lc-avatar img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-1, #ffffff);
}
.lc-avatar.is-lg {
  width: 112px;
  height: 112px;
  border-radius: 20px;
  font-size: 2.8rem;
}
.lc-avatar.is-md {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  font-size: 1.9rem;
}
.lc-avatar.is-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
}

/* ---------- значки ---------- */
.lc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface-2, #f6f7f9);
  color: var(--text-2, #6b7280);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.75;
  white-space: nowrap;
}
.lc-chip-accent {
  border-color: transparent;
  background: var(--lc-accent-soft);
  color: var(--lc-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lc-chip .flag {
  margin: 0;
}
.lc-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.lc-flag .flag {
  margin: 0;
  border-radius: 2px;
}
.lc-status {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
  vertical-align: middle;
}
.lc-status.is-live {
  background: var(--lc-live-soft);
  color: var(--lc-live);
}
.lc-status.is-over {
  background: var(--surface-2, #f6f7f9);
  color: var(--text-2, #6b7280);
  border: 1px solid var(--border, #e5e7eb);
}
.lc-status.is-soon {
  background: var(--lc-accent-soft);
  color: var(--lc-accent);
}

/* ---------- шапка лиги, сезона, клуба ---------- */
.lc-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}
.lc-hero-body {
  flex: 1 1 auto;
  min-width: 0;
}
.lc-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.lc-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.lc-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--text-2, #6b7280);
  font-size: 0.9rem;
}
.lc-desc {
  margin-top: 12px;
  color: var(--text-1, #1f2328);
  line-height: 1.55;
  word-break: break-word;
}
.lc-desc p:last-child {
  margin-bottom: 0;
}
.lc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.lc-actions .btn-block {
  width: auto;
  display: inline-block;
}
.lc-actions .btn-block + .btn-block {
  margin-top: 0;
}
.lc-actions .alert {
  margin: 0;
  padding: 6px 12px;
}
.lc-actions .btn {
  margin-bottom: 0;
}
.lc-actions .btn-lg {
  padding: 0.375rem 1.1rem;
  font-size: 1rem;
  border-radius: 0.3rem;
}
.lc-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-2, #6b7280);
}

/* ---------- вкладки ---------- */
.lc-tabs.nav {
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.lc-tabs .nav-link {
  margin-bottom: -1px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-2, #6b7280);
  font-weight: 700;
  cursor: pointer;
}
.lc-tabs .nav-link:hover,
.lc-tabs .nav-link:focus {
  color: var(--text-1, #1f2328);
  border-color: transparent;
  border-bottom-color: var(--border, #e5e7eb);
}
.lc-tabs .nav-link.active,
.lc-tabs .nav-link.active:hover,
.lc-tabs .nav-link.active:focus {
  color: var(--lc-accent);
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--lc-accent);
}
/* тёмная тема: common.css красит .nav-tabs с !important - перебиваем точнее */
html[data-theme='dark'] .lc-tabs.nav-tabs {
  border-bottom-color: var(--border, #22304a) !important;
}
html[data-theme='dark'] .lc-tabs.nav-tabs .nav-link {
  color: var(--text-2, #9aa4b2) !important;
  background-color: transparent !important;
  border-color: transparent !important;
}
html[data-theme='dark'] .lc-tabs.nav-tabs .nav-link:hover {
  color: var(--text-1, #e5e7eb) !important;
  border-color: transparent transparent var(--border, #22304a) !important;
}
html[data-theme='dark'] .lc-tabs.nav-tabs .nav-link.active,
html[data-theme='dark'] .lc-tabs.nav-tabs .nav-item.show .nav-link {
  color: var(--lc-accent) !important;
  background-color: transparent !important;
  border-color: transparent transparent var(--lc-accent) !important;
}
.lc-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.lc-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

/* ---------- строки (сезоны лиги) ---------- */
.lc-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-1, #ffffff);
}
.lc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-1, #1f2328);
  text-decoration: none;
}
.lc-row + .lc-row {
  border-top: 1px solid var(--border, #e5e7eb);
}
.lc-row:hover,
.lc-row:focus {
  background: var(--surface-2, #f6f7f9);
  color: var(--text-1, #1f2328);
  text-decoration: none;
}
.lc-row-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}
.lc-row-title {
  font-weight: 700;
  word-break: break-word;
}
.lc-row-go {
  color: var(--text-2, #6b7280);
  font-size: 0.8rem;
}

/* ---------- таблицы (зачёт сезона, турниры, участники клуба) ---------- */
.lc-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface-1, #ffffff);
}
.lc-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.93rem;
  color: var(--text-1, #1f2328);
}
.lc-table th,
.lc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  text-align: left;
  vertical-align: middle;
}
.lc-table tr:last-child td {
  border-bottom: 0;
}
.lc-table th {
  background: var(--surface-2, #f6f7f9);
  color: var(--text-2, #6b7280);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lc-table tbody tr:hover td {
  background: var(--surface-2, #f6f7f9);
}
.lc-table tr.is-me td {
  background: var(--lc-me);
}
.lc-num {
  text-align: right !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.lc-center {
  text-align: center !important;
}
.lc-points {
  font-weight: 800;
}
.lc-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.lc-player a {
  word-break: break-word;
}
.lc-place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-2, #6b7280);
}
.lc-table tr.is-top1 .lc-place {
  background: var(--lc-gold-soft);
  color: var(--lc-gold);
}
.lc-table tr.is-top2 .lc-place {
  background: var(--lc-silver-soft);
  color: var(--lc-silver);
}
.lc-table tr.is-top3 .lc-place {
  background: var(--lc-bronze-soft);
  color: var(--lc-bronze);
}
.lc-table tr.is-top1 td,
.lc-table tr.is-top2 td,
.lc-table tr.is-top3 td {
  font-weight: 700;
}
.lc-table .flag {
  margin-left: 2px;
}

/* ---------- формы создания ---------- */
.lc-form-card {
  max-width: 560px;
}
.lc-form-card label {
  font-weight: 600;
}

/* ---------- телефон ---------- */
@media (max-width: 575.98px) {
  .lc-head {
    margin: 16px 0 14px;
  }
  .lc-title {
    font-size: 1.45rem;
  }
  .lc-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .lc-item {
    padding: 12px;
    gap: 12px;
  }
  .lc-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    border-radius: 12px;
  }
  .lc-avatar.is-lg,
  .lc-avatar.is-md {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
    border-radius: 14px;
  }
  .lc-avatar.is-sm {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  /* шапка на телефоне: аватар слева от названия, описание и кнопки - на всю ширину под ним */
  .lc-hero {
    display: block;
    padding: 14px;
  }
  .lc-hero > .lc-avatar {
    float: left;
    margin: 0 12px 8px 0;
  }
  .lc-hero::after {
    content: '';
    display: block;
    clear: both;
  }
  .lc-desc,
  .lc-actions,
  .lc-hint {
    clear: both;
  }
  .lc-table th,
  .lc-table td {
    padding: 8px;
  }
  .lc-tabs.nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .lc-tabs .nav-link {
    padding: 8px 10px;
    white-space: nowrap;
  }
  .lc-seg {
    display: flex;
  }
  .lc-seg-btn {
    flex: 1 1 0;
    text-align: center;
  }
}
