:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-muted: #f9fafc;
  --text: #111827;
  --text-muted: #5b6472;
  --line: #e4e8ef;
  --brand: #c62828;
  --brand-dark: #991b1b;
  --accent: #0f4c81;
  --home: #0f4c81;
  --away: #c62828;
  --shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(198, 40, 40, 0.16), transparent 40%),
    radial-gradient(circle at 95% 0%, rgba(15, 76, 129, 0.14), transparent 45%),
    var(--bg);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  background: rgba(248, 250, 253, 0.92);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-title {
  font-family: "Barlow Condensed", "Source Sans 3", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #1f2937;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-nav a {
  color: #273244;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.main-nav a:hover {
  border-color: rgba(15, 76, 129, 0.2);
  background: rgba(15, 76, 129, 0.08);
  color: var(--accent);
}

.nav-home {
  white-space: nowrap;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.15rem 0.2rem 0.15rem 0.55rem;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.15rem 0.4rem 0.15rem 0.6rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-section-groups {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-group-title {
  display: inline-flex;
  align-items: center;
  color: #273244;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.2rem 0.15rem;
  cursor: default;
  white-space: nowrap;
}

.nav-group-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-group-link,
.nav-link-disabled {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-group-link:hover {
  border-color: rgba(15, 76, 129, 0.25);
  background: rgba(15, 76, 129, 0.08);
}

.nav-link-disabled {
  color: #9aa4b2;
  opacity: 0.8;
}

.main-content {
  padding: 1.25rem 1.25rem 2.5rem;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(125deg, #111827 0%, #1f2937 45%, #243b53 100%);
  color: #f8fbff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-title {
  font-family: "Barlow Condensed", "Source Sans 3", sans-serif;
  font-size: clamp(1.55rem, 2.8vw, 2.35rem);
  line-height: 1;
  margin: 0;
}

.hero-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.96rem;
  color: rgba(246, 249, 252, 0.88);
}

.hero-score {
  font-family: "Barlow Condensed", "Source Sans 3", sans-serif;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.chip-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(248, 252, 255, 0.24);
  border-radius: 999px;
  font-size: 0.82rem;
  color: rgba(243, 247, 252, 0.9);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.85rem;
}

.kpi-label {
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
}

.kpi-value {
  margin: 0.15rem 0 0;
  font-family: "Barlow Condensed", "Source Sans 3", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
}

.panel-wide {
  grid-column: 1 / -1;
}

.timeline-chart-wrap {
  position: relative;
  width: 100%;
  height: 360px;
}

.penalty-strip-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  margin-top: 0.65rem;
}

.timeline-note {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.panel-title {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: #1f2a3d;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.team-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.side-team {
  display: flex;
  flex-direction: column;
}

.side-team.home {
  text-align: left;
}

.side-team.away {
  text-align: right;
}

.side-name {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
}

.side-meta {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.score-stack {
  text-align: center;
}

.period-line {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.stats-split-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.stats-split-table th,
.stats-split-table td,
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.45rem;
  font-size: 0.94rem;
}

.stats-split-table tr:last-child td,
.stats-split-table tr:last-child th,
.data-table tr:last-child td,
.data-table tr:last-child th {
  border-bottom: none;
}

.stats-split-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.stats-split-table .value-home {
  color: var(--home);
  font-weight: 700;
  text-align: left;
  width: 20%;
}

.stats-split-table .value-away {
  color: var(--away);
  font-weight: 700;
  text-align: right;
  width: 20%;
}

.stats-split-table .value-label {
  text-align: center;
  color: #273244;
  font-weight: 600;
}

.data-table thead th {
  background: var(--surface-muted);
  color: #334155;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td,
.data-table th {
  text-align: left;
}

.table-wrapper {
  overflow-x: auto;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow);
}

.tile p {
  margin: 0;
}

.tile-title {
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tile-value {
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
  margin-top: 0.8rem;
}

.chart-card-title {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
}

.season-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.9rem;
}

.season-group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.season-group-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.season-phase-links {
  display: grid;
  gap: 0.45rem;
}

.season-phase-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: #1f2a3d;
  font-weight: 600;
  font-size: 0.9rem;
}

.season-phase-link:hover {
  border-color: rgba(15, 76, 129, 0.25);
  background: rgba(15, 76, 129, 0.08);
}

.season-phase-link.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.season-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  color: #1f2a3d;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.season-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.12);
}

.season-card h3 {
  margin: 0;
  font-size: 1.07rem;
}

.season-card p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.image-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.image-card.image-card--ranking img {
  width: min(100%, 720px);
  display: block;
  margin: 0 auto;
}

.site-footer {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  color: #6b7280;
  padding: 1rem 1.25rem 1.4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  font-size: 0.88rem;
}

@media (max-width: 800px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding-top: 0.2rem;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a,
  .nav-group-title {
    width: 100%;
    border-radius: 8px;
  }

  .nav-group {
    width: 100%;
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .nav-group-links {
    display: flex;
    width: 100%;
    padding-left: 0.2rem;
  }

  .nav-section {
    width: 100%;
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .nav-section-groups {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-group-link,
  .nav-link-disabled {
    border-radius: 8px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .main-content {
    padding: 1rem 0.8rem 2rem;
  }

  .hero {
    padding: 1rem;
  }

  .team-sides {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .side-team.away,
  .side-team.home {
    text-align: left;
  }

  .score-stack {
    text-align: left;
  }

  .stats-split-table .value-home,
  .stats-split-table .value-away,
  .stats-split-table .value-label {
    font-size: 0.88rem;
  }
}
