:root {
  --blue: #004aad;
  --blue-deep: #06367b;
  --yellow: #ffe04c;
  --paper: #f7f4ed;
  --paper-soft: rgba(255, 255, 255, 0.88);
  --paper-strong: rgba(255, 255, 255, 0.94);
  --ink: #0f2145;
  --ink-soft: #45618f;
  --line: rgba(15, 33, 69, 0.12);
  --shadow: 0 28px 70px rgba(6, 54, 123, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 224, 76, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(13, 84, 183, 0.22), transparent 34%),
    linear-gradient(180deg, #eef4ff 0%, #f4f6fb 24%, #f7f4ed 100%);
  padding: 22px;
}

.championship-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hero-banner-wrap {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(6, 54, 123, 0.12), rgba(13, 84, 183, 0.08)),
    var(--paper);
}

.hero-banner {
  position: relative;
  min-height: 360px;
  background:
    url("../images/bandeau.JPG") center 36%/contain no-repeat,
    #004aad;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(247, 244, 237, 0.96));
}

.championship-content-card {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
  transform: translateY(-36px);
  border-radius: 30px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 50px rgba(15, 33, 69, 0.12);
  padding: 30px;
}

.brand-block { display: grid; gap: 8px; }

.brand-kicker,
.championship-kicker,
.logo-mark strong,
.site-menu-link,
.championship-panel h1,
.division-card h2,
.match-club strong,
.match-date {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.brand-kicker,
.championship-kicker {
  margin: 0;
  color: var(--blue);
  font-size: 1.45rem;
  letter-spacing: 0.08em;
}

.logo-mark strong {
  display: block;
  font-size: 1.9rem;
  line-height: 0.95;
  color: var(--blue-deep);
}

.logo-mark span,
.championship-intro,
.division-empty {
  color: var(--ink-soft);
  line-height: 1.7;
}

.logo-mark span { display: block; margin-top: 8px; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(13, 84, 183, 0.16), rgba(255, 224, 76, 0.8), rgba(13, 84, 183, 0.16));
  margin: 26px 0;
}

.menu-card,
.championship-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper-strong);
}

.menu-card { padding: 14px; }

.site-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--blue-deep);
  background: rgba(0, 74, 173, 0.06);
  border: 1px solid rgba(0, 74, 173, 0.08);
  font-size: 1.16rem;
}

.site-menu-link.is-active {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}

.site-menu-link[aria-disabled="true"] { opacity: 0.6; }

.championship-panel {
  margin-top: 18px;
  padding: 24px;
}

.championship-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.championship-panel h1 {
  margin: 6px 0 14px;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  line-height: 0.92;
}

.championship-intro { margin: 0; }

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.championship-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.championship-actions .button-secondary {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 74, 173, 0.12);
  background: rgba(0, 74, 173, 0.06);
  color: var(--blue-deep);
  font-weight: 700;
}

.championship-actions .button-secondary:hover {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
  border-color: transparent;
}

.score-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(0, 74, 173, 0.08);
  border: 1px solid rgba(0, 74, 173, 0.12);
  color: var(--blue-deep);
  font-weight: 700;
}

.button-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid var(--line);
}

.flash {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 600;
}

.flash-success {
  background: rgba(31, 122, 66, 0.12);
  color: #1f7a42;
}

.flash-error {
  background: rgba(162, 42, 53, 0.12);
  color: #a22a35;
}

.division-switcher {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.division-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(0, 74, 173, 0.12);
  background: rgba(0, 74, 173, 0.06);
  color: var(--blue-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.division-link-tab {
  text-decoration: none;
}

.division-link-tab,
.championship-actions .button-secondary {
  text-align: center;
}

.division-tab.is-active {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
  border-color: transparent;
}

.division-panels {
  margin-top: 20px;
}

.division-card {
  display: none;
}

.division-card.is-visible {
  display: block;
}

.division-header h2 {
  margin: 0 0 12px;
  font-size: 1.7rem;
  line-height: 0.95;
  color: var(--blue-deep);
}

.division-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ranking-export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.ranking-export-button {
  min-height: 46px;
  padding: 0 18px;
}

.division-empty { margin: 0; }

.history-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 74, 173, 0.12);
}

.history-panel-header h2,
.history-division-card h3 {
  margin: 6px 0 0;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--blue-deep);
}

.history-panel-header h2 {
  font-size: clamp(1.9rem, 4.6vw, 2.8rem);
}

.history-division-card h3 {
  font-size: 1.7rem;
}

.history-division-list {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.history-division-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 74, 173, 0.1);
}

.history-matchday-list {
  display: grid;
  gap: 12px;
}

.history-matchday {
  border-radius: 20px;
  background: rgba(0, 74, 173, 0.04);
  border: 1px solid rgba(0, 74, 173, 0.08);
  overflow: hidden;
}

.history-matchday-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  color: var(--blue-deep);
}

.history-matchday-summary::-webkit-details-marker {
  display: none;
}

.history-matchday-count {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.history-match-list {
  padding: 0 16px 16px;
}

.championship-rich-content {
  color: var(--ink);
  line-height: 1.8;
}

.championship-rich-content > *:first-child {
  margin-top: 0;
}

.championship-rich-content h2,
.championship-rich-content h3,
.championship-rich-content h4 {
  margin: 28px 0 12px;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--blue-deep);
}

.championship-rich-content h2 {
  font-size: 1.9rem;
}

.championship-rich-content h3 {
  font-size: 1.8rem;
}

.championship-rich-content h4 {
  font-size: 1.5rem;
}

.championship-rich-content p,
.championship-rich-content ul,
.championship-rich-content ol,
.championship-rich-content blockquote {
  margin: 0 0 16px;
}

.championship-rich-content ul,
.championship-rich-content ol {
  padding-left: 24px;
}

.championship-rich-content blockquote {
  padding: 16px 18px;
  border-left: 4px solid rgba(0, 74, 173, 0.25);
  border-radius: 0 16px 16px 0;
  background: rgba(0, 74, 173, 0.05);
  color: var(--ink-soft);
}

.championship-rich-content a {
  color: var(--blue);
  font-weight: 700;
}

.championship-rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px auto;
  border-radius: 18px;
  border: 1px solid rgba(0, 74, 173, 0.1);
}

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

.ranking-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
}

.ranking-table thead th {
  padding: 14px 12px;
  text-align: center;
  background: rgba(0, 74, 173, 0.08);
  color: var(--blue-deep);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0, 74, 173, 0.12);
}

.ranking-table thead th:nth-child(2) {
  text-align: left;
  padding-left: 64px;
}

.ranking-table tbody td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(15, 33, 69, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.ranking-table tbody td:first-child {
  font-weight: 700;
  color: var(--blue-deep);
}

.ranking-table tbody tr:nth-child(even) td {
  background: rgba(0, 74, 173, 0.03);
}

.ranking-table tbody tr:hover td {
  background: rgba(255, 224, 76, 0.14);
}

.ranking-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  text-align: left;
}

.mobile-label {
  display: none;
}

.ranking-team-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.ranking-team-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ranking-points {
  font-weight: 700;
  color: var(--blue-deep);
}

.ranking-legend {
  margin-top: 18px;
  text-align: center;
}

.ranking-legend p {
  margin: 0;
}

.ranking-legend-season {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: 0.04em;
  color: var(--blue-deep);
}

.ranking-legend-season span,
.ranking-legend-points span {
  color: #0d54b7;
}

.ranking-legend-season strong {
  color: #d7aa00;
  font-weight: 400;
}

.ranking-legend-points {
  margin-top: 6px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.ranking-legend-note {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.match-list {
  display: grid;
  gap: 14px;
}

.match-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(0, 74, 173, 0.05);
  border: 1px solid rgba(0, 74, 173, 0.08);
}

.match-date {
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 1.35rem;
}

.match-clubs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.match-club {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.match-logo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.match-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.match-club strong {
  color: var(--blue-deep);
  font-size: 1.18rem;
  line-height: 0.95;
}

.club-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: white;
  box-shadow: 0 10px 24px rgba(15, 33, 69, 0.14);
}

.score-win {
  background: linear-gradient(135deg, #2f9f52, #1f7a42);
}

.score-loss {
  background: linear-gradient(135deg, #d94a5b, #a22a35);
}

.score-draw {
  background: linear-gradient(135deg, #5b7fb5, #3f5f95);
}

.match-versus {
  font-weight: 700;
  color: var(--ink-soft);
}

.score-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.score-field {
  display: grid;
  gap: 6px;
}

.score-field span {
  font-weight: 700;
  color: var(--ink);
}

.score-field input {
  width: 100%;
  border: 1px solid rgba(0, 74, 173, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

@media (max-width: 920px) {
  .championship-content-card { transform: translateY(-24px); }
  .championship-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .championship-actions {
    justify-content: flex-start;
  }
  .score-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body { padding: 14px; }
  .championship-panel h1 {
    font-size: 2.1rem;
  }
  .division-header h2,
  .history-panel-header h2,
  .history-division-card h3,
  .championship-rich-content h2 {
    font-size: 1.55rem;
  }
  .championship-rich-content h3 {
    font-size: 1.35rem;
  }
  .hero-banner-wrap { border-radius: 24px; }
  .hero-banner { min-height: 300px; }
  .championship-content-card {
    width: calc(100% - 20px);
    padding: 20px;
    border-radius: 24px;
    transform: translateY(-18px);
  }
  .championship-panel {
    padding: 20px;
    border-radius: 22px;
  }
  .division-tab {
    width: 100%;
  }
  .division-header {
    align-items: flex-start;
  }
  .ranking-export-actions {
    width: 100%;
  }
  .ranking-export-button {
    flex: 1 1 0;
  }
  .site-menu-link {
    flex: 1 1 calc(50% - 4px);
    width: calc(50% - 4px);
    min-width: 0;
  }
  .match-clubs { grid-template-columns: 1fr; }
  .match-versus { justify-self: center; }
  .history-matchday-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .ranking-table-wrap {
    overflow-x: visible;
  }

  .ranking-page {
    padding: 8px;
  }

  .ranking-page .championship-content-card {
    width: calc(100% - 8px);
    padding: 12px;
  }

  .ranking-page .championship-panel {
    padding: 14px;
  }

  .ranking-page .division-card.is-visible {
    margin-inline: -4px;
  }

  .ranking-table {
    min-width: 0;
    table-layout: fixed;
  }

  .ranking-table th:nth-child(1),
  .ranking-table td:nth-child(1) {
    width: 8%;
  }

  .ranking-table th:nth-child(2),
  .ranking-table td:nth-child(2) {
    width: 36%;
  }

  .ranking-table th:nth-child(3),
  .ranking-table td:nth-child(3) {
    width: 8%;
  }

  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4),
  .ranking-table th:nth-child(5),
  .ranking-table td:nth-child(5),
  .ranking-table th:nth-child(6),
  .ranking-table td:nth-child(6),
  .ranking-table th:nth-child(7),
  .ranking-table td:nth-child(7) {
    width: 6%;
  }

  .ranking-table th:nth-child(8),
  .ranking-table td:nth-child(8),
  .ranking-table th:nth-child(9),
  .ranking-table td:nth-child(9),
  .ranking-table th:nth-child(10),
  .ranking-table td:nth-child(10) {
    width: 8%;
  }

  .ranking-table thead th,
  .ranking-table tbody td {
    padding: 8px 3px;
    font-size: 0.78rem;
  }

  .ranking-table thead th {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
  }

  .ranking-team {
    min-width: 0;
    gap: 0;
    justify-content: flex-start;
  }

  .ranking-team-logo {
    display: none;
  }

  .ranking-team span {
    font-size: 0.83rem;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: left;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .ranking-legend-points {
    font-size: 0.96rem;
  }

  .ranking-legend-note {
    font-size: 0.9rem;
  }
}

@media (max-width: 880px) and (orientation: landscape) {
  .ranking-table-wrap {
    overflow-x: visible;
  }

  .ranking-table {
    min-width: 0;
    table-layout: fixed;
  }

  .ranking-table thead th,
  .ranking-table tbody td {
    padding: 9px 5px;
  }

  .ranking-team {
    min-width: 0;
    gap: 8px;
  }

  .ranking-team-logo {
    display: none;
  }

  .ranking-team span {
    font-size: 0.86rem;
    line-height: 1.2;
    word-break: break-word;
  }
}
