﻿:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --line: #dbe3ef;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --accent: #0ea5e9;
  --danger: #b91c1c;
  --focus: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #e0f2fe, transparent 40%), var(--bg);
  line-height: 1.55;
}

.container { width: min(1200px, 94%); margin: 0 auto; }

.skip-link {
  position: absolute;
  left: 0;
  top: -120px;
  background: #0f172a;
  color: #fff;
  padding: 0.55rem 0.75rem;
  z-index: 1000;
}

.skip-link:focus-visible { top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.8rem;
  color: var(--ink);
  font-weight: 600;
}

.nav-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.4rem;
}

.nav-menu.is-open {
  display: flex;
  position: absolute;
  top: 72px;
  right: 3%;
  flex-direction: column;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-menu a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav-menu a:hover { background: #eef6ff; color: var(--ink); }

.nav-menu a.is-active {
  background: #d1fae5;
  border-color: #99f6e4;
  color: #065f46;
}

main { padding-block: 1.2rem 2.4rem; }

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.breadcrumbs li + li::before { content: "/"; margin-right: 0.45rem; }

.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  background: linear-gradient(130deg, #f8fafc, #eff6ff 60%, #ecfeff);
}

.hero h1 { margin: 0.45rem 0 0.55rem; font-size: clamp(1.8rem, 4vw, 2.9rem); line-height: 1.15; }
.hero-kicker { text-transform: uppercase; letter-spacing: 0.08em; color: #155e75; font-weight: 700; margin: 0; font-size: 0.8rem; }
.hero-text { margin: 0 0 1rem; color: var(--ink-soft); max-width: 62ch; }

.button {
  display: inline-block;
  background: var(--brand);
  color: #f0fdfa;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.66rem 1.05rem;
  font-weight: 700;
}

.button:hover { background: var(--brand-dark); }

.section {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.section-title,
.section-head h2 { margin: 0; font-size: 1.25rem; }

.link { color: var(--brand); font-weight: 700; }

.news-hub,
.news-hub__top,
.news-grid,
.top-list,
.news-filters { display: grid; gap: 0.9rem; }

.news-grid--home,
.news-grid--portal { grid-template-columns: 1fr; }

.news-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.news-card__media-link { display: block; overflow: hidden; }

.news-card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.news-card:hover .news-card__image,
.news-card:focus-within .news-card__image { transform: scale(1.04); }

.news-card__body { padding: 0.9rem 0.95rem 1rem; }

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: #475569;
  margin-bottom: 0.45rem;
}

.news-pill {
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
}

.news-pill--urgent {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.news-card__title { margin: 0; line-height: 1.3; }
.news-card__title a { color: var(--ink); text-decoration: none; text-decoration-thickness: 2px; }

.news-card:hover .news-card__title a,
.news-card:focus-within .news-card__title a { text-decoration: underline; }

.news-card__excerpt { margin: 0.55rem 0 0.75rem; color: var(--ink-soft); }

.news-card__read-more {
  display: inline-block;
  font-weight: 700;
  color: #0b5f59;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.32rem 0.62rem;
  text-decoration: none;
}

.news-card__read-more:hover { background: #e6fffb; }
.news-card--featured .news-card__image { height: 300px; }
.news-card--compact .news-card__image { height: 170px; }
.news-card--urgent { border-color: #fdba74; }
.news-featured__media,
.news-mini-card__media {
  display: block;
  overflow: hidden;
}

.news-featured__image,
.news-mini-card__image {
  width: 100%;
  display: block;
  object-fit: cover;
}

.news-featured__image { height: 300px; }
.news-mini-card__image { height: 170px; }

.top-list { list-style: none; margin: 0; padding: 0; }

.section-top-day .top-list {
  gap: 0.22rem !important;
  row-gap: 0.22rem !important;
  align-content: start;
  grid-auto-rows: min-content;
}

.section-top-day .top-list__item {
  margin: 0 !important;
}

.section-top-day .top-list__link {
  padding-block: 0.32rem;
}

.section-home-news {
  margin-top: 2.2rem;
}

.news-hub .section-filters {
  margin-top: 1.35rem;
}

.top-list__item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafc;
}

.top-list__link { display: block; padding: 0.65rem 0.75rem; text-decoration: none; color: var(--ink); }
.top-list__meta { display: block; color: #475569; font-size: 0.82rem; margin-bottom: 0.2rem; }
.top-list__title { font-weight: 700; line-height: 1.25; }

.top-list__item:hover .top-list__title,
.top-list__item:focus-within .top-list__title { text-decoration: underline; }

.filter-group { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.filter-group--selects { align-items: center; gap: 0.5rem; }

.filter-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.36rem 0.8rem;
  font-weight: 700;
}

.filter-chip.is-active {
  background: #ccfbf1;
  border-color: #99f6e4;
  color: #115e59;
}

.filter-label { font-size: 0.9rem; color: #334155; font-weight: 600; }
.filter-select { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 0.35rem 0.5rem; min-width: 130px; }

.is-hidden-by-filter { display: none; }
.narrow { max-width: 760px; }
.muted { color: #64748b; }
.error-page h1 { color: var(--danger); font-size: 2.5rem; margin-bottom: 0.35rem; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding: 2rem 0 1.6rem;
  color: var(--ink-soft);
}

.footer-inner {
  display: grid;
  gap: 0.45rem;
}

.footer-inner p {
  margin: 0;
  max-width: 78ch;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.5rem 0.76rem;
  box-shadow: var(--shadow);
}

.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  display: grid;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
  z-index: 250;
}

.toast { border-radius: 10px; padding: 0.75rem 0.85rem; color: #fff; box-shadow: var(--shadow); }
.toast.info { background: #0f766e; }
.toast.success { background: #166534; }
.toast.error { background: #b91c1c; }

a:focus-visible,
button:focus-visible,
select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (min-width: 740px) {
  .news-grid--home,
  .news-grid--portal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-card--featured .news-card__image { height: 340px; }
}

@media (min-width: 980px) {
  .nav-toggle { display: none; }
  .nav-menu { display: flex; position: static; flex-direction: row; }
  .news-hub__top { grid-template-columns: 1.55fr 1fr; align-items: start; }
  .news-grid--home,
  .news-grid--portal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.nav-logout-form {
  margin: 0;
}

.nav-logout-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.nav-logout-button:hover {
  background: #eef6ff;
  color: var(--ink);
}

.messages {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.message {
  border-radius: 12px;
  padding: 0.72rem 0.86rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);
  font-weight: 600;
}

.message--success {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.message--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.message--warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.message--info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.auth-section h1 {
  margin-top: 0;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
}

.form-row label {
  font-weight: 600;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0.52rem 0.62rem;
  font: inherit;
}

.help-text {
  color: #64748b;
  font-size: 0.88rem;
}

.field-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.9rem;
}

.auth-note,
.auth-links {
  margin-top: 0.9rem;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button--secondary {
  background: #fff;
  color: #0b5f59;
  border-color: #99f6e4;
}

.profile-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.profile-grid dt {
  font-weight: 700;
  color: #334155;
}

.profile-grid dd {
  margin: 0.2rem 0 0;
}

@media (min-width: 740px) {
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.filter-input {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: #fff;
}

.button--small {
  padding: 0.42rem 0.8rem;
  font-size: 0.92rem;
}

.pagination {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.pagination-link {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  color: var(--ink);
  font-weight: 600;
}

.pagination-current {
  color: var(--ink-soft);
  font-weight: 600;
}

.news-detail h1 {
  margin-bottom: 0.55rem;
}

.news-detail__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.news-detail__cover {
  margin: 0.8rem 0;
}

.news-detail__cover .news-card__image {
  width: 100%;
  height: clamp(240px, 42vw, 460px);
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.news-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.news-detail__chips .news-pill {
  text-decoration: none;
}

.news-detail__content {
  color: var(--ink);
}

.news-detail__content p {
  margin: 0 0 0.8rem;
}

.filter-chip input {
  margin-right: 0.35rem;
}

.entity-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

.entity-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entity-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
}

.entity-card--plain {
  padding: 0.2rem;
}

.entity-card__media-link {
  display: block;
  overflow: hidden;
}

.entity-card__image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.entity-card:hover .entity-card__image,
.entity-card:focus-within .entity-card__image {
  transform: scale(1.04);
}

.entity-card__body {
  padding: 0.9rem 0.95rem 1rem;
}

.entity-card--finished {
  border-color: rgba(16, 185, 129, 0.36);
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.26), transparent 40%),
    radial-gradient(circle at bottom left, rgba(5, 150, 105, 0.14), transparent 46%),
    linear-gradient(145deg, #f3fff8 0%, #d9fbe9 52%, #c7f7e0 100%);
  box-shadow:
    0 18px 34px rgba(16, 185, 129, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.entity-card--finished .news-card__title a,
.entity-card--finished .news-card__meta,
.entity-card--finished .news-card__excerpt {
  color: #065f46;
}

.entity-card--finished .news-pill {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(6, 95, 70, 0.22);
  color: #065f46;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.08);
}

.team-detail__header {
  display: grid;
  gap: 1rem;
}

.team-detail__logo-wrap {
  width: min(220px, 100%);
}

.team-detail__logo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.team-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.team-roster__card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-muted);
}

.team-roster__photo-wrap {
  aspect-ratio: 4 / 3;
  background: linear-gradient(140deg, #304252 0%, #3e5568 100%);
}

.team-roster__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-roster__body {
  padding: 0.58rem 0.7rem 0.65rem;
}

.team-roster__name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.team-roster__role {
  margin: 0.28rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.simple-list {
  margin: 0;
  padding-left: 1rem;
}

.simple-list li {
  margin-bottom: 0.35rem;
}

.match-table-wrap {
  overflow-x: auto;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
}

.match-table th,
.match-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.55rem 0.45rem;
  vertical-align: top;
}

.match-table th {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.match-score-box {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.match-score {
  margin: 0;
  font-size: 1.05rem;
}

.team-upcoming-matches {
  display: grid;
  gap: 0.9rem;
}

.team-upcoming-match {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.88));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
}

.team-upcoming-match__date {
  display: inline-flex;
  align-self: start;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 88px;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #15314b 0%, #244d70 100%);
  color: #f8fbff;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.team-upcoming-match__day {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.team-upcoming-match__time {
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.88;
}

.team-upcoming-match__body {
  min-width: 0;
}

.team-upcoming-match__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.team-upcoming-match__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.team-upcoming-match__title a {
  color: var(--ink);
  text-decoration: none;
}

.team-upcoming-match__title a:hover,
.team-upcoming-match__title a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.team-upcoming-match__details {
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  color: var(--ink-soft);
}

.team-upcoming-match__details a {
  color: #0b5f59;
  text-decoration: none;
  font-weight: 600;
}

.team-upcoming-match__details a:hover,
.team-upcoming-match__details a:focus-visible {
  text-decoration: underline;
}

.team-upcoming-match__details span::before {
  content: "•";
  margin-right: 0.75rem;
  color: rgba(71, 85, 105, 0.55);
}

.team-upcoming-match__side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.team-upcoming-match__score {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #15314b;
}

@media (min-width: 740px) {
  .entity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-detail__header {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }

  .team-roster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-upcoming-match {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .team-upcoming-match__side {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
  }
}

@media (min-width: 980px) {
  .entity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-roster {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.dashboard-summary {
  display: grid;
  gap: 1rem;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--surface-muted);
}

.metric-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.metric-card p {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  font-size: 0.87rem;
  color: var(--ink-soft);
}

.dash-select-cell {
  width: 72px;
  text-align: center;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dash-search {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.dash-search--users {
  margin-top: 0.9rem;
}

.dash-search__field {
  flex: 0 1 520px;
  max-width: 520px;
  min-width: 320px;
  width: 100%;
}

.dash-search .search-autocomplete__panel {
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
}

.dash-search input[type="search"],
.dash-search .dash-input {
  width: 100% !important;
  min-height: 40px;
  padding: 0.52rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: block;
}

.dash-search input[type="search"]:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.dash-btn {
  min-height: 36px;
  padding: 0.42rem 0.78rem;
  border-radius: 10px;
  line-height: 1.2;
}

.dashboard-table .button.button--small {
  min-height: 34px;
  padding: 0.36rem 0.72rem;
}

.dash-row-actions {
  align-items: flex-start;
  gap: 0.34rem;
}

.dash-inline-form {
  align-items: center;
}

.dash-btn--row {
  min-height: 32px;
  padding: 0.3rem 0.64rem;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0;
}

.dash-btn--edit {
  box-shadow: none;
}

.dash-btn--toggle {
  border-color: color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
}

.dashboard-table .auth-input.dash-select-role {
  min-height: 32px;
  height: 32px;
  padding: 0.2rem 0.55rem;
  border-radius: 9px;
  font-size: 0.92rem;
  width: min(230px, 100%);
}

.dash-check {
  position: relative;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.dash-check__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.dash-check__box {
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, var(--accent) 28%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--surface) 18%);
  display: inline-grid;
  place-items: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.dash-check__box::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid transparent;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  margin-top: -2px;
  transition: transform 0.18s ease;
}

.dash-check__input:checked + .dash-check__box {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.dash-check__input:checked + .dash-check__box::after {
  transform: rotate(45deg) scale(1);
}

.dash-check__input:focus-visible + .dash-check__box {
  outline: 2px solid color-mix(in srgb, var(--accent) 52%, transparent);
  outline-offset: 2px;
}

.button--secondary-danger {
  background: transparent;
  color: #b91c1c;
  border-color: #b91c1c;
}

.button--secondary-danger:hover {
  background: color-mix(in srgb, #b91c1c 10%, transparent);
}

.button--danger {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}

.button--danger:hover {
  background: #991b1b;
}

.dashboard-table .dash-btn--delete {
  background: transparent;
  color: #b91c1c;
  border-color: #b91c1c;
}

.dashboard-table .dash-btn--delete:hover {
  background: color-mix(in srgb, #b91c1c 10%, transparent);
  color: #991b1b;
}

.dashboard-form .form-row.checklist-row > label {
  margin-bottom: 0.12rem;
}

.dashboard-form .checklist-row .dash-checklist {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 84%, var(--surface) 16%);
  padding: 0.45rem;
}

.dashboard-form .checklist-row .dash-checklist > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.dashboard-form .checklist-row .dash-checklist > div > div {
  min-width: 0;
}

.dashboard-form .checklist-row .dash-checklist label {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  padding: 0.42rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent) 18%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-muted) 12%);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-form .checklist-row .dash-checklist label:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.dashboard-form .checklist-row .dash-checklist input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--accent) 30%);
  border-radius: 6px;
  background: var(--surface);
  display: inline-grid;
  place-content: center;
  margin: 0;
}

.dashboard-form .checklist-row .dash-checklist input[type='checkbox']::before {
  content: "";
  width: 9px;
  height: 5px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 0.15s ease;
}

.dashboard-form .checklist-row .dash-checklist input[type='checkbox']:checked {
  background: #0ea5e9;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px color-mix(in srgb, #0ea5e9 25%, transparent);
}

.dashboard-form .checklist-row .dash-checklist input[type='checkbox']:checked::before {
  transform: rotate(45deg) scale(1);
}

.dashboard-form .checklist-row .dash-checklist input[type='checkbox']:focus-visible {
  outline: 2px solid color-mix(in srgb, #0ea5e9 45%, transparent);
  outline-offset: 1px;
}

html[data-theme='dark'] .dashboard-form .checklist-row .dash-checklist {
  background: color-mix(in srgb, var(--surface) 82%, #000 18%);
  border-color: color-mix(in srgb, var(--line) 86%, #000 14%);
}

html[data-theme='dark'] .dashboard-form .checklist-row .dash-checklist label {
  background: color-mix(in srgb, var(--surface) 78%, #000 22%);
  border-color: color-mix(in srgb, var(--line) 80%, #000 20%);
  color: var(--ink);
}

html[data-theme='dark'] .dashboard-form .checklist-row .dash-checklist input[type='checkbox'] {
  background: #131922;
  border-color: #3b4a5f;
}

html[data-theme='dark'] .dashboard-form .checklist-row .dash-checklist input[type='checkbox']:checked {
  background: #0ea5e9;
  border-color: #38bdf8;
}

.dashboard-form input[type='file'],
.dashboard-assets input[type='file'] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.34rem;
}

.dashboard-form input[type='file']::file-selector-button,
.dashboard-assets input[type='file']::file-selector-button {
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--accent) 25%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
  color: var(--ink);
  font-weight: 600;
  padding: 0.34rem 0.7rem;
  margin-right: 0.55rem;
  cursor: pointer;
}

.dashboard-form input[type='file']::file-selector-button:hover,
.dashboard-assets input[type='file']::file-selector-button:hover {
  background: color-mix(in srgb, var(--surface) 72%, var(--accent) 28%);
}

.dashboard-cover-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.46rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  margin-bottom: 0.5rem;
}

.dashboard-cover-preview img {
  width: 124px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.dashboard-cover-preview__title {
  margin: 0 0 0.16rem;
  font-weight: 700;
  color: var(--ink);
}

.asset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.asset-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem;
  background: var(--surface-muted);
}

.asset-card__image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

@media (min-width: 740px) {
  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-search__field {
    min-width: 420px;
  }
}

@media (max-width: 739px) {
  .dash-search {
    flex-wrap: wrap;
  }

  .dash-search__field {
    min-width: 0;
    flex-basis: 100%;
    max-width: 100%;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-muted: #1d222b;
  --ink: #e7e9ee;
  --ink-soft: #a2a9b3;
  --line: #2f3742;
  --brand: #c79a5a;
  --brand-dark: #a77b40;
  --focus: #f5c453;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.nav-theme-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.nav-theme-button:hover {
  background: #eef6ff;
  color: var(--ink);
}

.news-actions {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  display: grid;
  gap: 0.7rem;
}

.news-actions__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.rating-widget {
  display: grid;
  gap: 0.45rem;
}

.rating-widget__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.news-actions .button.is-active {
  border-color: #14b8a6;
  box-shadow: inset 0 0 0 1px #14b8a6;
}

.news-actions__count {
  margin-left: 0.25rem;
  font-weight: 700;
}

.comments-block {
  margin-top: 1rem;
}

.comments-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.comments-form__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.comments-list {
  display: grid;
  gap: 0.7rem;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: var(--surface-muted);
}

.comment-item__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.comment-item__header time {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.comment-item__text {
  margin: 0 0 0.55rem;
  white-space: pre-wrap;
}

.search-autocomplete {
  position: relative;
}

.search-autocomplete__panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 40;
  overflow: hidden;
}

.search-autocomplete__item {
  display: block;
  padding: 0.55rem 0.65rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.search-autocomplete__item:last-child {
  border-bottom: 0;
}

.search-autocomplete__item:hover,
.search-autocomplete__item:focus-visible {
  background: #eef6ff;
}

.share-modal[hidden] {
  display: none;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.share-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
}

.share-modal__dialog {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.share-modal__dialog h3 {
  margin-top: 0;
}

.share-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.modal-open {
  overflow: hidden;
}

.matches-page {
  padding: 1rem;
}

.matches-page__hero h1 {
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.matches-page__lead {
  margin: 0;
  color: var(--ink-soft);
  max-width: 64ch;
}

.matches-filters {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  overflow: hidden;
}

.matches-filters__summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.matches-filters__summary::-webkit-details-marker {
  display: none;
}

.matches-filters__summary::after {
  content: "▾";
  float: right;
  color: var(--ink-soft);
}

.matches-filters[open] .matches-filters__summary::after {
  content: "▴";
}

.matches-filters__form {
  display: grid;
  gap: 0.85rem;
  padding: 0.75rem;
}

.matches-filters__chips {
  align-items: center;
}

.matches-filters__controls {
  display: grid;
  gap: 0.55rem;
  align-items: center;
}

.matches-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.matches-groups {
  display: grid;
  gap: 1rem;
}

.matches-group {
  padding: 0.95rem;
}

.matches-group__title {
  margin: 0 0 0.7rem;
  font-size: 1.12rem;
}

.matches-list {
  display: grid;
  gap: 0.65rem;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.match-card:hover,
.match-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.match-meta__date,
.match-meta__time {
  font-weight: 700;
  color: var(--ink);
}

.match-meta__tournament {
  color: #0b5f59;
  text-decoration: none;
  font-weight: 600;
}

.match-meta__tournament:hover,
.match-meta__tournament:focus-visible {
  text-decoration: underline;
}

.match-teams__link {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.match-team:last-child {
  justify-content: flex-end;
  text-align: right;
}

.match-team__logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.match-team__logo--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 700;
}

.match-team__name {
  font-weight: 700;
  line-height: 1.2;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.match-teams__link:hover .match-team__name,
.match-teams__link:focus-visible .match-team__name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.match-teams__vs {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.badge--live {
  background: #e6fffb;
  border-color: #99f6e4;
  color: #0f766e;
}

.badge--scheduled {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.badge--finished {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.3s ease-in-out infinite;
}

@keyframes livePulse {
  0% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.35; transform: scale(0.85); }
}

.score {
  margin: 0;
  font-weight: 800;
  font-size: 1.18rem;
  line-height: 1;
  color: var(--ink);
}

.score--live {
  color: #0f766e;
}

.score__live-label {
  margin-left: 0.35rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f766e;
  vertical-align: middle;
}


@media (min-width: 740px) {
  .matches-filters__controls {
    grid-template-columns: auto minmax(160px, 1fr) auto minmax(160px, 1fr) auto;
  }

  .match-card {
    grid-template-columns: 1fr 2.3fr 1fr;
    align-items: center;
  }

  .match-side {
    justify-content: flex-end;
  }
}

@media (min-width: 980px) {
  .matches-filters__summary {
    display: none;
  }

  .matches-filters[open] .matches-filters__form,
  .matches-filters:not([open]) .matches-filters__form {
    display: grid;
  }

  .matches-filters {
    padding: 0.2rem;
  }
}

/* Theme tokens */
:root,
html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-muted: #1d222b;
  --text: #e7e9ee;
  --muted: #a2a9b3;
  --border: #2f3742;
  --accent: #c79a5a;
  --accent-2: #e0bc86;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  --ink: var(--text);
  --ink-soft: var(--muted);
  --line: var(--border);
  --brand: var(--accent);
  --brand-dark: #a77b40;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f7faff;
  --text: #14223a;
  --muted: #617793;
  --border: #d8e1ef;
  --accent: #0b88c2;
  --accent-2: #2faae0;
  --shadow: 0 12px 28px rgba(12, 24, 46, 0.12);
  --ink: var(--text);
  --ink-soft: var(--muted);
  --line: var(--border);
  --brand: var(--accent);
  --brand-dark: #096f9e;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 14%, transparent), transparent 40%), var(--bg);
  color: var(--text);
}

.site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent 8%);
}

.section,
.top-list__item,
.news-card,
.entity-card,
.comment-item,
.matches-filters,
.news-actions,
.share-modal__dialog,
.metric-card,
.asset-card {
  background: var(--surface);
  border-color: var(--border);
}

.hero {
  background: linear-gradient(130deg, color-mix(in srgb, var(--surface) 85%, var(--accent) 15%), var(--surface) 65%, color-mix(in srgb, var(--surface-muted) 75%, var(--accent-2) 25%));
}

.hero-kicker,
.muted,
.news-card__meta,
.news-card__excerpt,
.news-detail__meta,
.pagination-current,
.top-list__meta {
  color: var(--muted);
}

.button {
  background: var(--accent);
  color: #f5fbff;
}

.button:hover {
  background: color-mix(in srgb, var(--accent) 78%, #000 22%);
}

.button--secondary,
.nav-toggle,
.nav-logout-button,
.filter-select,
.filter-input,
.pagination-link {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button--secondary:hover,
.nav-logout-button:hover,
.pagination-link:hover {
  background: color-mix(in srgb, var(--surface) 80%, var(--accent) 20%);
}

.news-pill {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: color-mix(in srgb, var(--text) 80%, var(--accent) 20%);
}

.news-pill--urgent {
  border-color: color-mix(in srgb, #f97316 40%, var(--border));
  background: color-mix(in srgb, #f97316 12%, var(--surface));
}

.nav-theme-button {
  display: none;
}

.theme-toggle-item {
  display: flex;
  align-items: center;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.42rem;
  min-height: 40px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--surface) 70%, var(--accent) 30%);
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

.theme-toggle:active {
  transform: translateY(1px);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.theme-toggle__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.theme-toggle__track {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, #fff 10%);
  background: color-mix(in srgb, var(--surface-muted) 82%, var(--accent) 18%);
  position: relative;
}

.theme-toggle__thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 3px 8px rgba(2, 8, 20, 0.35);
  transition: transform 0.24s ease;
}

html[data-theme="dark"] .theme-toggle {
  color: #d6e4ff;
}

html[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(18px);
}

html[data-theme="light"] .theme-toggle .theme-toggle__icon--sun {
  color: #e89109;
}

html[data-theme="dark"] .theme-toggle .theme-toggle__icon--moon {
  color: #9fc4ff;
}

/* News grids: 3 / 2 / 1 and aligned cards */
.news-grid--home,
.news-grid--portal {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .news-grid--home,
  .news-grid--portal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .news-grid--home,
  .news-grid--portal {
    grid-template-columns: 1fr;
  }
}

.section-home-news .news-card,
.section-all-news #news-grid .news-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.section-home-news .news-card__media-link,
.section-all-news #news-grid .news-card__media-link {
  flex-shrink: 0;
}

.section-home-news .news-card__image,
.section-all-news #news-grid .news-card__image {
  height: 210px;
}

.section-home-news .news-card__body,
.section-all-news #news-grid .news-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-home-news .news-card__title,
.section-all-news #news-grid .news-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
}

.section-home-news .news-card__excerpt,
.section-all-news #news-grid .news-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 4.65em;
}

.section-home-news .news-card__read-more,
.section-all-news #news-grid .news-card__read-more {
  margin-top: auto;
  align-self: flex-start;
  border-color: var(--border);
  color: var(--accent);
}

/* Related news strip */
.news-strip-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.news-strip-control {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.news-strip-control:hover {
  background: color-mix(in srgb, var(--surface) 75%, var(--accent) 25%);
}

.news-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding: 0.2rem 0.1rem 0.6rem;
  justify-content: flex-start;
}

.news-strip .news-card {
  flex: 0 0 336px;
  scroll-snap-align: start;
  height: 100%;
}

.news-strip .news-card__body {
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.news-strip .news-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.news-strip .news-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.news-strip .news-card__read-more {
  margin-top: auto;
}

.news-strip::-webkit-scrollbar {
  height: 8px;
}

.news-strip::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--surface) 85%, var(--accent) 15%);
  border-radius: 999px;
}

.news-strip::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 65%, var(--border) 35%);
  border-radius: 999px;
}

@media (max-width: 740px) {
  .news-strip-controls {
    display: none;
  }

  .news-strip {
    gap: 6px;
    padding-inline: 0;
  }

  .news-strip .news-card {
    flex-basis: min(86vw, 310px);
  }
}

/* Stable news grid overrides (latest + all news) */
#home-latest-grid.news-grid--stable,
#news-grid.news-grid--stable {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  justify-content: stretch !important;
  grid-auto-flow: row !important;
  grid-auto-rows: 1fr;
  column-count: initial !important;
}

@media (max-width: 1024px) {
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: 1fr !important;
  }
}

#home-latest-grid.news-grid--stable > .news-card,
#news-grid.news-grid--stable > .news-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 0 !important;
  margin-right: 0 !important;
  transform: none !important;
  translate: none !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

#home-latest-grid.news-grid--stable .news-card__image,
#news-grid.news-grid--stable .news-card__image {
  height: 210px;
}

#home-latest-grid.news-grid--stable .news-card__body,
#news-grid.news-grid--stable .news-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#home-latest-grid.news-grid--stable .news-card__title,
#news-grid.news-grid--stable .news-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
}

#home-latest-grid.news-grid--stable .news-card__excerpt,
#news-grid.news-grid--stable .news-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 4.65em;
}

#home-latest-grid.news-grid--stable .news-card__read-more,
#news-grid.news-grid--stable .news-card__read-more {
  margin-top: auto;
  align-self: flex-start;
}

#home-latest-grid.news-grid--stable > .news-card:nth-child(n),
#news-grid.news-grid--stable > .news-card:nth-child(n) {
  margin-top: 0 !important;
}

.data-freshness {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
}

.entity-source,
.match-source {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
}

.entity-source a,
.match-source a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}

.entity-source a:hover,
.match-source a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Auth premium UI */
:root {
  --surface-2: color-mix(in srgb, var(--surface) 85%, var(--accent) 15%);
  --success: #16a34a;
}

.auth-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 1rem 0 2rem;
}

.auth-shell--profile {
  min-height: auto;
}

.auth-card {
  width: min(640px, 100%);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent) 20%);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent 12%);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2rem);
}

.auth-card__head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
}

.auth-card__head p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.auth-form--premium {
  display: grid;
  gap: 0.9rem;
}

.form-row.has-error label {
  color: var(--danger);
}

.auth-input,
.auth-form--premium input,
.auth-form--premium select,
.auth-form--premium textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 80%, var(--surface) 20%);
  color: var(--text);
  padding: 0.66rem 0.78rem;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input::placeholder,
.auth-form--premium input::placeholder,
.auth-form--premium textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 85%, transparent);
}

.auth-input:hover,
.auth-form--premium input:hover,
.auth-form--premium select:hover,
.auth-form--premium textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.auth-input:focus-visible,
.auth-form--premium input:focus-visible,
.auth-form--premium select:focus-visible,
.auth-form--premium textarea:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.auth-input[aria-invalid="true"],
.form-row.has-error .auth-input,
.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea {
  border-color: color-mix(in srgb, var(--danger) 70%, var(--border));
}

.password-field {
  position: relative;
}

.password-field .auth-input,
.password-field input {
  padding-right: 5.8rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.52rem;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 80%, var(--accent) 20%);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1;
  padding: 0.38rem 0.56rem;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
}

.password-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

.alert-block {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, var(--accent) 20%);
  padding: 0.66rem 0.75rem;
}

.alert-block--error {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.field-error {
  margin: 0.35rem 0 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.profile-card {
  width: min(760px, 100%);
}

.profile-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface) 30%);
}

.profile-grid dt {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-grid dd {
  color: var(--text);
  font-weight: 700;
}

.auth-info {
  color: var(--muted);
  display: grid;
  gap: 0.55rem;
}

/* === Responsive system overrides (mobile-first) === */
:root {
  --bp-mobile-max: 30rem;   /* 480px */
  --bp-tablet-min: 48.0625rem; /* 769px */
  --bp-tablet-max: 64rem;   /* 1024px */
  --bp-desktop-min: 64.0625rem; /* 1025px */
  --bp-desktop-wide: 80.0625rem; /* 1281px */
}

html,
body {
  max-width: 100%;
}

body {
  overflow-x: clip;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1240px, calc(100% - 1.5rem));
}

main.container {
  padding-inline: 0;
}

.section {
  padding: clamp(0.9rem, 2.8vw, 1.2rem);
}

.section-head {
  flex-wrap: wrap;
}

.hero {
  padding: clamp(1rem, 3vw, 1.6rem);
}

.hero h1 {
  font-size: clamp(1.35rem, 7vw, 2.6rem);
}

.hero-text {
  font-size: clamp(0.95rem, 3.1vw, 1.05rem);
}

.button,
.nav-toggle,
.nav-logout-button,
.pagination-link,
.theme-toggle {
  min-height: 44px;
}

/* Navbar / Header */
.header-inner {
  min-height: 64px;
}

.brand {
  font-size: clamp(1.05rem, 4.8vw, 1.3rem);
}

.nav-toggle {
  font-size: 0.9rem;
  padding-inline: 0.72rem;
}

.nav-menu.is-open {
  top: 64px;
  right: 0.75rem;
  width: min(92vw, 380px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  gap: 0.5rem;
  padding: 0.75rem;
}

.nav-menu a,
.nav-logout-button {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.nav-logout-button {
  width: 100%;
}

.theme-toggle-item {
  width: 100%;
}

.theme-toggle {
  width: 100%;
  justify-content: center;
}

/* Home split block */
.news-hub__top {
  grid-template-columns: 1fr;
  align-items: start;
}

/* News grids */
#home-latest-grid.news-grid--stable,
#news-grid.news-grid--stable {
  grid-template-columns: 1fr !important;
  gap: 0.85rem !important;
}

#home-latest-grid.news-grid--stable .news-card__image,
#news-grid.news-grid--stable .news-card__image {
  height: clamp(190px, 54vw, 240px);
}

#home-latest-grid.news-grid--stable .news-card__title,
#news-grid.news-grid--stable .news-card__title {
  -webkit-line-clamp: 2;
}

#home-latest-grid.news-grid--stable .news-card__excerpt,
#news-grid.news-grid--stable .news-card__excerpt {
  -webkit-line-clamp: 3;
}

.pagination {
  justify-content: flex-start;
}

.pagination-link,
.pagination-current {
  font-size: 0.92rem;
}

/* Related strip */
.news-strip {
  gap: 0.4rem;
  padding: 0.1rem 0 0.55rem;
}

.news-strip .news-card {
  flex-basis: min(88vw, 320px);
}

.news-strip-controls {
  margin-left: auto;
}

/* Filters */
.news-filters,
.matches-filters__form {
  gap: 0.75rem;
}

.filter-group,
.filter-group--selects,
.matches-filters__controls {
  width: 100%;
}

.filter-group--selects,
.matches-filters__controls {
  grid-template-columns: 1fr !important;
}

.filter-select,
.filter-input {
  width: 100%;
  min-height: 44px;
}

.filter-group--selects .button,
.matches-filters__actions .button {
  width: 100%;
  text-align: center;
}

.matches-filters__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

/* Teams / Tournaments / Match tables */
.match-table {
  min-width: 620px;
}

.match-table th,
.match-table td {
  white-space: nowrap;
}

.news-card__title a,
.news-card__excerpt,
.match-meta__tournament,
.match-team__name {
  overflow-wrap: anywhere;
}

/* Match cards -> stacked mobile */
.match-card {
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
}

.match-meta {
  gap: 0.35rem 0.45rem;
}

.match-meta__tournament {
  width: 100%;
}

.match-teams__link {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.match-team:last-child {
  justify-content: flex-start;
  text-align: left;
}

.match-teams__vs {
  justify-self: start;
}

.match-side {
  justify-content: space-between;
}

/* Auth responsive */
.auth-shell {
  min-height: auto;
  padding: 0.5rem 0 1.25rem;
}

.auth-card {
  width: 100%;
  padding: clamp(1rem, 3.4vw, 1.8rem);
}

.auth-form--premium .button,
.auth-form--premium .button--secondary {
  min-height: 44px;
}

.form-actions {
  justify-content: stretch;
}

.form-actions .button {
  flex: 1 1 220px;
  text-align: center;
}

/* Mobile performance tweaks */
@media (max-width: 48rem) {
  .site-header {
    backdrop-filter: blur(6px);
  }

  .auth-card {
    backdrop-filter: blur(4px);
  }

  .news-card,
  .entity-card,
  .match-card {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
  }
}

/* 481-768 */
@media (min-width: 30.0625rem) {
  .container {
    width: min(1240px, calc(100% - 2rem));
  }

  .news-strip .news-card {
    flex-basis: min(72vw, 336px);
  }
}

/* 769-1024 tablet */
@media (min-width: 48.0625rem) {
  .header-inner {
    min-height: 68px;
  }

  .news-hub__top {
    grid-template-columns: 1.3fr 1fr;
  }

  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }

  .matches-filters__controls {
    grid-template-columns: auto minmax(160px, 1fr) auto minmax(160px, 1fr);
  }

  .matches-filters__actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .auth-card {
    max-width: 620px;
  }
}

/* 1025-1280 desktop */
@media (min-width: 64.0625rem) {
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.1rem !important;
  }

  .matches-filters__controls {
    grid-template-columns: auto minmax(160px, 1fr) auto minmax(160px, 1fr) auto;
  }

  .matches-filters__actions {
    grid-column: auto;
    display: flex;
    width: auto;
  }
}

@media (min-width: 48.0625rem) {
  .news-hub__top {
    align-items: stretch !important;
  }

  .news-hub__top > .section {
    height: 100%;
  }
}

/* 1281+ */
@media (min-width: 80.0625rem) {
  .container {
    width: min(1280px, calc(100% - 3rem));
  }
}

/* Header alignment fix: keep nav level, closer to brand, theme toggle on right edge */
@media (min-width: 61.25rem) {
  .header-inner {
    min-height: 72px;
    align-items: center;
    gap: 0.9rem;
  }

  .header-inner > nav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
  }

  #nav-menu.nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin: 0 0 0 auto;
    padding: 0;
    gap: 0.35rem;
  }

  #nav-menu.nav-menu > li {
    display: flex;
    align-items: center;
  }

  #nav-menu.nav-menu a,
  #nav-menu.nav-menu .nav-logout-button {
    min-height: 40px;
    margin: 0;
  }

  #nav-menu.nav-menu .nav-logout-button {
    width: auto;
  }

  #nav-menu.nav-menu .theme-toggle-item {
    margin-left: 0.55rem;
    width: auto;
    flex: 0 0 auto;
  }

  #nav-menu.nav-menu .theme-toggle {
    width: auto;
    justify-content: center;
  }
}

/* Slimmer theme switch on desktop, keep proportions even */
@media (min-width: 61.25rem) {
  .theme-toggle {
    min-height: 36px;
    padding: 0.18rem 0.38rem;
    gap: 0.35rem;
  }

  .theme-toggle__icon {
    width: 16px;
    height: 16px;
  }

  .theme-toggle__icon svg {
    width: 16px;
    height: 16px;
  }

  .theme-toggle__track {
    width: 34px;
    height: 18px;
  }

  .theme-toggle__thumb {
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
  }

  html[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(16px);
  }
}

/* Final anti-masonry lock for news cards (home + all news) */
#home-latest-grid.news-grid--stable,
#news-grid.news-grid--stable {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
  align-content: start !important;
  justify-content: stretch !important;
}

@media (max-width: 1024px) {
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable {
    grid-template-columns: 1fr !important;
  }
}

#home-latest-grid.news-grid--stable > .news-card,
#news-grid.news-grid--stable > .news-card {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
  grid-column: auto !important;
  grid-row: auto !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Deterministic placement: no accidental centered first card */
@media (min-width: 1025px) {
  #home-latest-grid.news-grid--stable > .news-card:nth-child(3n + 1),
  #news-grid.news-grid--stable > .news-card:nth-child(3n + 1) {
    grid-column: 1 !important;
  }

  #home-latest-grid.news-grid--stable > .news-card:nth-child(3n + 2),
  #news-grid.news-grid--stable > .news-card:nth-child(3n + 2) {
    grid-column: 2 !important;
  }

  #home-latest-grid.news-grid--stable > .news-card:nth-child(3n),
  #news-grid.news-grid--stable > .news-card:nth-child(3n) {
    grid-column: 3 !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  #home-latest-grid.news-grid--stable > .news-card:nth-child(odd),
  #news-grid.news-grid--stable > .news-card:nth-child(odd) {
    grid-column: 1 !important;
  }

  #home-latest-grid.news-grid--stable > .news-card:nth-child(even),
  #news-grid.news-grid--stable > .news-card:nth-child(even) {
    grid-column: 2 !important;
  }
}

/* Premium filters UI */
.section.section-filters,
.matches-filters {
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%);
  background:
    radial-gradient(140% 90% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 52%),
    linear-gradient(170deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-muted) 86%, transparent));
  box-shadow: 0 14px 32px color-mix(in srgb, #000 20%, transparent);
}

.news-filters,
.matches-filters__form {
  gap: 0.95rem;
}

.filter-group {
  gap: 0.55rem;
}

.tournament-notice {
  margin-bottom: 1.35rem;
}

.tournament-filters {
  margin-top: 0.35rem;
}

.match-center-filters {
  margin-top: 0.35rem;
}

.match-center-filters__grid {
  align-items: end;
}

.filter-group--selects {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr !important;
}

.filter-field {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
}

.filter-label {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--muted) 88%, var(--text) 12%);
  font-weight: 700;
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 74%, var(--accent) 26%);
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-muted) 16%);
  color: var(--text);
  padding: 0.44rem 0.84rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.filter-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--muted) 65%, var(--border) 35%);
  background: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border) 42%);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  color: color-mix(in srgb, var(--text) 78%, var(--accent) 22%);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border) 28%);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

.filter-chip.is-active::before {
  border-color: color-mix(in srgb, var(--accent) 85%, #ffffff 15%);
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}

.filter-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.filter-input,
.filter-select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%);
  background: color-mix(in srgb, var(--surface) 85%, var(--surface-muted) 15%);
  color: var(--text);
  padding: 0.62rem 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.filter-input {
  width: 100%;
}

.filter-input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, var(--text) 12%);
}

.filter-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.1rem;
  background-image:
    linear-gradient(45deg, transparent 50%, color-mix(in srgb, var(--muted) 88%, var(--text) 12%) 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--muted) 88%, var(--text) 12%) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.filter-input:hover,
.filter-select:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border) 42%);
  background: color-mix(in srgb, var(--surface) 76%, var(--accent) 24%);
}

.filter-input:focus-visible,
.filter-select:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 75%, var(--border) 25%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.filter-actions,
.matches-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.filter-actions {
  grid-column: 1 / -1;
}

.filter-actions .button,
.matches-filters__actions .button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
}

.filter-actions .button--secondary,
.matches-filters__actions .button--secondary {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.section.section-filters .button:hover,
.matches-filters .button:hover {
  transform: translateY(-1px);
}

.search-autocomplete {
  min-width: 0;
}

.search-autocomplete__panel {
  width: 100%;
  border-radius: 12px;
  border-color: color-mix(in srgb, var(--border) 72%, var(--accent) 28%);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.search-autocomplete__item:hover,
.search-autocomplete__item:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

@media (min-width: 48.0625rem) {
  .filter-group--selects {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .filter-actions {
    justify-content: flex-end;
  }

  .filter-actions .button {
    width: auto !important;
    min-width: 170px;
  }

  .matches-filters__controls {
    grid-template-columns: auto minmax(180px, 1fr) auto minmax(180px, 1fr) auto !important;
    gap: 0.7rem 0.8rem;
  }

  .matches-filters__actions {
    width: auto;
    display: flex;
  }

  .matches-filters__actions .button {
    width: auto !important;
    min-width: 150px;
  }
}

@media (min-width: 75rem) {
  #news-filters-form .filter-group--selects {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  #news-filters-form .filter-actions {
    justify-content: flex-end;
  }
}

/* Final dark-mode lock: anthracite / graphite (override all previous blue-tinted rules) */
html[data-theme="dark"] {
  --bg: #121417 !important;
  --surface: #1a1d22 !important;
  --surface-muted: #22262d !important;
  --text: #eceff3 !important;
  --muted: #a8afb8 !important;
  --border: #313741 !important;
  --accent: #8f959d !important;
  --accent-2: #b5bbc3 !important;
  --brand: #8f959d !important;
  --brand-dark: #777e87 !important;
  --ink: var(--text) !important;
  --ink-soft: var(--muted) !important;
  --line: var(--border) !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] body {
  background: #121417 !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .section,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .top-list__item,
html[data-theme="dark"] .entity-card,
html[data-theme="dark"] .team-roster__card,
html[data-theme="dark"] .match-card,
html[data-theme="dark"] .news-actions,
html[data-theme="dark"] .matches-filters,
html[data-theme="dark"] .share-modal__dialog,
html[data-theme="dark"] .asset-card,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .profile-item {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .entity-card--finished {
  border-color: rgba(52, 211, 153, 0.38) !important;
  background:
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.16), transparent 42%),
    linear-gradient(155deg, #11241e 0%, #163328 100%) !important;
  box-shadow: 0 18px 32px rgba(5, 150, 105, 0.18);
}

html[data-theme="dark"] .entity-card--finished .news-card__title a,
html[data-theme="dark"] .entity-card--finished .news-card__meta,
html[data-theme="dark"] .entity-card--finished .news-card__excerpt {
  color: #d1fae5 !important;
}

html[data-theme="dark"] .entity-card--finished .news-pill {
  background: rgba(209, 250, 229, 0.08);
  border-color: rgba(110, 231, 183, 0.28);
  color: #d1fae5 !important;
}

html[data-theme="dark"] .team-roster__photo-wrap {
  background: linear-gradient(140deg, #2a323b 0%, #3b4651 100%);
}

html[data-theme="dark"] .news-card__meta,
html[data-theme="dark"] .top-list__meta,
html[data-theme="dark"] .hero-kicker,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .news-card__excerpt,
html[data-theme="dark"] .news-detail__meta {
  color: var(--muted) !important;
}

html[data-theme="dark"] .button,
html[data-theme="dark"] .theme-toggle__thumb {
  background: var(--brand) !important;
  color: #111317 !important;
}

html[data-theme="dark"] .button:hover {
  background: var(--brand-dark) !important;
}

html[data-theme="dark"] .button--secondary,
html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .nav-logout-button,
html[data-theme="dark"] .pagination-link,
html[data-theme="dark"] .filter-input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .auth-form select,
html[data-theme="dark"] .auth-form textarea {
  background: var(--surface-muted) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .nav-menu a:hover,
html[data-theme="dark"] .nav-menu a.is-active,
html[data-theme="dark"] .nav-logout-button:hover,
html[data-theme="dark"] .pagination-link:hover,
html[data-theme="dark"] .news-card__read-more:hover {
  background: #2a3038 !important;
  color: var(--text) !important;
  border-color: #3a424d !important;
}

html[data-theme="dark"] .news-pill,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .badge--scheduled,
html[data-theme="dark"] .badge--finished,
html[data-theme="dark"] .badge--live {
  background: #2a3038 !important;
  color: #d9dee5 !important;
  border-color: #3a424d !important;
}

/* Dark theme refinement: neutral graphite palette with warm amber accents */
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 15% -10%, rgba(199, 154, 90, 0.11), transparent 36%),
    radial-gradient(circle at 88% -18%, rgba(115, 96, 70, 0.1), transparent 33%),
    var(--bg);
}

html[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--surface) 94%, #000 6%);
  border-bottom-color: color-mix(in srgb, var(--line) 86%, #000 14%);
}

html[data-theme="dark"] .nav-menu a:hover,
html[data-theme="dark"] .nav-logout-button:hover {
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 26%);
  color: var(--ink);
}

html[data-theme="dark"] .nav-menu a.is-active {
  background: color-mix(in srgb, var(--surface) 62%, var(--accent) 38%);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line) 28%);
  color: var(--ink);
}

html[data-theme="dark"] .hero {
  background: linear-gradient(
    136deg,
    color-mix(in srgb, var(--surface) 90%, #000 10%),
    color-mix(in srgb, var(--surface-muted) 82%, var(--accent) 18%)
  );
}

html[data-theme="dark"] .hero-kicker {
  color: color-mix(in srgb, var(--accent-2) 80%, #e7e9ee 20%);
}

html[data-theme="dark"] .news-pill,
html[data-theme="dark"] .badge--scheduled {
  background: color-mix(in srgb, var(--surface) 72%, var(--accent) 28%);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line) 38%);
  color: #f3e4ce;
}

html[data-theme="dark"] .news-pill--urgent {
  background: color-mix(in srgb, #c58b2a 22%, var(--surface) 78%);
  border-color: color-mix(in srgb, #c58b2a 56%, var(--line) 44%);
  color: #f4debb;
}

html[data-theme="dark"] .top-list__item,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .auth-form select,
html[data-theme="dark"] .auth-form textarea,
html[data-theme="dark"] .comments-form__input,
html[data-theme="dark"] .filter-input,
html[data-theme="dark"] .filter-select {
  background: color-mix(in srgb, var(--surface) 88%, #000 12%);
}

html[data-theme="dark"] .comments-form__input {
  color: #eef2f7 !important;
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line) 44%);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 90%, #000 10%),
    color-mix(in srgb, var(--surface-muted) 82%, #000 18%)
  ) !important;
}

html[data-theme="dark"] .comments-form__input::placeholder {
  color: rgba(226, 232, 240, 0.62) !important;
}

html[data-theme="dark"] .comments-form__input:focus,
html[data-theme="dark"] .comments-form__input:focus-visible {
  color: #f8fafc !important;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line) 30%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent);
}

html[data-theme="dark"] .team-upcoming-match {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line) 76%);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--surface) 92%, #000 8%),
    color-mix(in srgb, var(--surface-muted) 86%, #000 14%)
  );
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .team-upcoming-match__date {
  background: linear-gradient(180deg, #1a3b59 0%, #234d72 100%);
  color: #f8fbff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 20px rgba(7, 16, 28, 0.24);
}

html[data-theme="dark"] .team-upcoming-match__title a,
html[data-theme="dark"] .team-upcoming-match__score {
  color: #eef2f7;
}

html[data-theme="dark"] .team-upcoming-match__details {
  color: rgba(226, 232, 240, 0.7);
}

html[data-theme="dark"] .team-upcoming-match__details a {
  color: #9ed7c1;
}

html[data-theme="dark"] .team-upcoming-match__details span::before {
  color: rgba(148, 163, 184, 0.42);
}

html[data-theme="dark"] .team-upcoming-match .button--secondary {
  background: color-mix(in srgb, var(--surface) 88%, #000 12%);
  color: #eef2f7;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line) 70%);
}

html[data-theme="dark"] .team-upcoming-match .button--secondary:hover,
html[data-theme="dark"] .team-upcoming-match .button--secondary:focus-visible {
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 26%);
  color: #ffffff;
}

html[data-theme="dark"] .button--secondary {
  background: color-mix(in srgb, var(--surface) 86%, #000 14%);
  color: color-mix(in srgb, var(--accent-2) 78%, var(--ink) 22%);
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line) 44%);
}

html[data-theme="dark"] .news-card__read-more {
  color: color-mix(in srgb, var(--accent-2) 78%, var(--ink) 22%);
}

html[data-theme="dark"] .news-card__read-more:hover {
  background: color-mix(in srgb, var(--surface) 72%, var(--accent) 28%);
}

html[data-theme="dark"] .button {
  color: #1a1610;
}

html[data-theme="dark"] .message--info {
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 26%);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line) 38%);
  color: #f3e4ce;
}

html[data-theme="dark"] .match-team__logo--placeholder {
  background: color-mix(in srgb, var(--surface) 68%, var(--accent) 32%);
  color: #f8e7cc;
}

html[data-theme="dark"] .badge {
  background: color-mix(in srgb, var(--surface) 88%, #000 12%);
}

html[data-theme="dark"] .badge--live {
  background: color-mix(in srgb, var(--surface) 64%, #3f8f6c 36%);
  border-color: color-mix(in srgb, #3f8f6c 58%, var(--line) 42%);
  color: #dbf4e8;
}

html[data-theme="dark"] .badge--finished {
  background: color-mix(in srgb, var(--surface) 80%, #4a4f58 20%);
  border-color: color-mix(in srgb, #4a4f58 50%, var(--line) 50%);
  color: #c4cad3;
}

html[data-theme="dark"] .theme-toggle {
  color: #d7c5a7;
}

html[data-theme="dark"] .theme-toggle .theme-toggle__icon--moon {
  color: #d7c5a7;
}

/* Production responsive layer */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body.has-open-nav {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

.container {
  width: min(1200px, calc(100% - 32px));
  padding-inline: 0;
}

main.container {
  min-width: 0;
}

.site-nav {
  margin-left: auto;
}

.nav-overlay {
  position: fixed;
  inset: 72px 0 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

body.has-open-nav .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

.nav-toggle {
  min-height: 44px;
  min-width: 44px;
  gap: 0.65rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.nav-toggle__icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.nav-toggle__icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.button,
.nav-logout-button,
.news-card__read-more,
.auth-submit,
.dashboard-actions .button,
.button--secondary {
  min-height: 44px;
  touch-action: manipulation;
}

.news-card__body,
.top-list__link,
.metric-card,
.auth-card,
.profile-item,
.dashboard-table td,
.dashboard-table th {
  min-width: 0;
}

.news-card__title,
.news-card__excerpt,
.top-list__title,
.hero h1,
.hero-text,
.section-title,
.match-team__name,
.team-upcoming-match__title {
  overflow-wrap: anywhere;
}

.news-card__read-more,
.button,
.button--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-table-wrap,
.match-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-table,
.match-table {
  min-width: 720px;
}

.auth-card form,
.dashboard-form,
.dashboard-toolbar,
.dashboard-actions,
.section-head,
.profile-card__head {
  min-width: 0;
}

@media (min-width: 1025px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
  }

  .nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-overlay {
    display: none;
  }
}

@media (max-width: 1024px) {
  .container {
    width: min(100%, calc(100% - 32px));
  }

  .header-inner {
    min-height: 68px;
    gap: 0.75rem;
  }

  .site-nav {
    position: static;
  }

  .nav-menu {
    position: fixed;
    top: 84px;
    right: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s ease;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    z-index: 350;
  }

  .nav-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .nav-menu a,
  .nav-logout-button,
  .theme-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-logout-form {
    width: 100%;
  }

  .theme-toggle-item {
    width: 100%;
  }

  .news-hub__top {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: start;
  }

  .news-card__image {
    height: clamp(220px, 26vw, 280px);
  }

  .news-card--featured .news-card__image {
    height: clamp(260px, 32vw, 360px);
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    width: min(100%, 720px);
  }

  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-head,
  .profile-card__head {
    align-items: flex-start;
  }

  .team-upcoming-match {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
  }

  .team-upcoming-match__score {
    justify-self: flex-start;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  main {
    padding-block: 0.9rem 2rem;
  }

  .container {
    width: calc(100% - 32px);
  }

  .hero {
    padding: 1.2rem;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .hero-text {
    font-size: 1rem;
    margin-bottom: 0.9rem;
  }

  .section {
    padding: 1rem;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head .link,
  .section-head .button,
  .profile-card__head .button {
    width: 100%;
  }

  .news-hub__top,
  #home-latest-grid.news-grid--stable,
  #news-grid.news-grid--stable,
  .news-grid--portal,
  .news-grid--home,
  .dashboard-metrics,
  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .top-list {
    gap: 0.7rem;
  }

  .news-card__image,
  .news-card--featured .news-card__image {
    height: 220px;
  }

  .news-card__body {
    padding: 0.9rem;
  }

  .news-card__read-more,
  .button,
  .button--secondary {
    width: 100%;
  }

  .dashboard-summary p:has(> .button),
  .dashboard-actions,
  .dashboard-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .dashboard-summary p > .button,
  .dashboard-actions .button,
  .dashboard-actions .button--secondary,
  .dashboard-toolbar .button {
    width: 100%;
  }

  .auth-card {
    width: 100%;
    padding: 1.1rem;
  }

  .auth-card input,
  .auth-card select,
  .auth-card textarea,
  .auth-submit {
    width: 100%;
  }

  .dashboard-table,
  .match-table {
    min-width: 640px;
  }

  .team-upcoming-match {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container {
    width: calc(100% - 24px);
  }

  .header-inner {
    min-height: 64px;
  }

  .brand {
    font-size: 1.15rem;
  }

  .nav-toggle__label {
    display: none;
  }

  .nav-menu {
    top: 76px;
    left: 12px;
    right: 12px;
    padding: 0.8rem;
    border-radius: 18px;
  }

  .hero {
    padding: 1rem;
    border-radius: 20px;
  }

  .hero-kicker {
    font-size: 0.74rem;
  }

  .hero h1 {
    font-size: clamp(1.55rem, 9.5vw, 2rem);
    margin-top: 0.3rem;
    margin-bottom: 0.5rem;
  }

  .hero-text {
    font-size: 0.96rem;
  }

  .section {
    margin-top: 0.85rem;
    padding: 0.9rem;
  }

  .section-title,
  .section-head h2 {
    font-size: 1.1rem;
  }

  .news-card__image,
  .news-card--featured .news-card__image {
    height: 190px;
  }

  .news-card__meta,
  .top-list__meta,
  .breadcrumbs ol {
    font-size: 0.8rem;
  }

  .news-card__excerpt {
    margin-bottom: 0.7rem;
  }

  .button,
  .button--secondary,
  .nav-toggle,
  .nav-logout-button,
  .auth-submit,
  .news-card__read-more {
    min-height: 46px;
    padding-inline: 0.9rem;
  }

  .dashboard-table,
  .match-table {
    min-width: 560px;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
  }
}

html[data-theme="dark"] .nav-menu {
  background: rgba(16, 23, 37, 0.96);
  border-color: rgba(94, 116, 147, 0.34);
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .nav-overlay {
  background: rgba(2, 6, 23, 0.62);
}

html[data-theme="dark"] .nav-toggle:hover,
html[data-theme="dark"] .nav-toggle:focus-visible {
  background: color-mix(in srgb, var(--surface) 76%, var(--accent) 24%);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line) 60%);
}

@media (min-width: 1025px) {
  body.page-core-home .container,
  body.page-articles-news_list .container,
  body.page-core-about .container {
    width: min(1320px, calc(100% - 3rem));
  }

  body.page-core-home .hero-home,
  body.page-core-home .news-hub,
  body.page-core-home .section-home-news,
  body.page-articles-news_list .news-hub,
  body.page-articles-news_list .section,
  body.page-core-about .section {
    width: 100%;
  }

  body.page-core-home .news-hub__top,
  body.page-articles-news_list .news-hub__top {
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
  }

  body.page-core-about .section.narrow {
    max-width: 980px;
  }
}

@media (min-width: 1281px) {
  body.page-core-home .container,
  body.page-articles-news_list .container,
  body.page-core-about .container {
    width: min(1380px, calc(100% - 4rem));
  }

  body.page-core-home .news-hub__top,
  body.page-articles-news_list .news-hub__top {
    grid-template-columns: minmax(0, 1.78fr) minmax(340px, 0.92fr);
    gap: 1.15rem;
  }

  body.page-core-about .section.narrow {
    max-width: 1040px;
  }
}
