:root {
  --btv-red: #ce0205;
  --dark: #373737;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #dedede;
  --paper: #ffffff;
  --surface: #f5f5f5;
  --soft-red: #fff1f1;
  --winner: #ce0205;
  --accent: #121212;
  --score-bg: #fff2cc;
  --font-title: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-body: "Inter", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 14px clamp(14px, 3vw, 34px) 12px;
  background:
    linear-gradient(115deg, rgba(206, 2, 5, 0.98), rgba(55, 55, 55, 0.98));
  border-bottom: 4px solid #fff;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("assets/haut/logo-filigrane-haut.png");
  background-repeat: no-repeat;
  background-position: right clamp(16px, 5vw, 72px) center;
  background-size: clamp(180px, 24vw, 360px) auto;
  opacity: 0.16;
  pointer-events: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.event-identity {
  min-width: 0;
}

.event-main-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  align-items: baseline;
}

.identity-brand,
.event-main-line h1,
.identity-place {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

.identity-brand {
  font-size: clamp(34px, 6vw, 74px);
}

.btv-black {
  color: #121212;
}

.event-main-line h1 {
  font-size: clamp(34px, 6vw, 74px);
}

.identity-place {
  margin-top: 4px;
  font-size: clamp(30px, 4.5vw, 58px);
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.page-nav a {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 10px;
  font: 700 13px var(--font-body);
  text-decoration: none;
}

.page-nav a:hover,
.page-nav a:focus-visible {
  background: #fff;
  border-color: #fff;
  color: var(--btv-red);
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}

.event-actions a {
  min-width: 132px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(18, 18, 18, 0.28);
  color: #fff;
  font: 800 12px var(--font-body);
  text-decoration: none;
  text-transform: uppercase;
}

.event-actions a:hover,
.event-actions a:focus-visible {
  background: #fff;
  color: var(--btv-red);
  border-color: #fff;
}

.hero {
  padding: 18px clamp(16px, 5vw, 72px);
  background:
    linear-gradient(115deg, rgba(206, 2, 5, 0.94), rgba(55, 55, 55, 0.96)),
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.22), transparent 32%);
  color: #fff;
  overflow: hidden;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.subtitle {
  margin: 10px 0 0;
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  font-family: var(--font-title);
  font-size: 22px;
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 1120px;
  margin: 0 auto;
}

.event-strip div {
  border-left: 5px solid currentColor;
  padding: 10px 0 10px 14px;
  background: rgba(255, 255, 255, 0.12);
}

.event-strip span,
.event-strip strong {
  display: block;
}

.event-strip span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-strip strong {
  margin-top: 2px;
  font-size: 16px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px clamp(16px, 5vw, 72px);
  background: var(--dark);
  color: #fff;
  font-size: 13px;
}

.status-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#data-time {
  font-weight: 800;
}

.section {
  padding: clamp(28px, 5vw, 58px) clamp(16px, 5vw, 72px);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h2 {
  color: var(--accent);
  font-size: clamp(38px, 6vw, 72px);
}

.section-title-block {
  min-width: 0;
}

.section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 800;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.team-card,
.pool-card,
.match-card,
.champion-banner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.team-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  min-height: 112px;
  overflow: hidden;
}

.team-number {
  display: grid;
  place-items: center;
  background: var(--btv-red);
  color: #fff;
  font-family: var(--font-title);
  font-size: 27px;
}

.team-body {
  min-width: 0;
  padding: 12px;
}

.name-strong,
.match-name,
.winner-name,
.qualified-name {
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1;
}

.name-strong {
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(25px, 3vw, 34px);
}

.team-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.waiting-panel {
  grid-column: 1 / -1;
  padding: clamp(22px, 4vw, 42px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 8px solid var(--btv-red);
  border-radius: 8px;
  text-align: center;
}

.waiting-panel span {
  display: block;
  color: var(--btv-red);
  font-family: var(--font-title);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.95;
}

.waiting-panel strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.25;
}

.waiting-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.pools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pool-card {
  overflow: hidden;
}

.pool-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  background: var(--soft-red);
}

.pool-title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-title);
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 400;
  line-height: 0.95;
}

.pool-visual {
  min-height: 92px;
  border: 1px dashed rgba(206, 2, 5, 0.42);
  background: rgba(255, 255, 255, 0.5);
}

.pool-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.visual-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 92px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.pool-matches {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.match-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 58px minmax(0, 1fr) 82px;
  gap: 6px;
  align-items: center;
}

.phase-label,
.status-pill,
.score-box {
  font-weight: 800;
  text-align: center;
}

.phase-label {
  color: var(--muted);
  font-size: 12px;
}

.match-name {
  min-width: 0;
  font-family: var(--font-title);
  font-size: clamp(22px, 2.8vw, 30px);
  text-align: center;
}

.score-box {
  padding: 6px 4px;
  background: var(--score-bg);
  color: var(--dark);
  font-size: 20px;
}

.status-pill {
  color: var(--muted);
  font-size: 12px;
}

.pool-qualified {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 14px;
}

.qualified-box {
  padding: 10px;
  background: var(--btv-red);
  color: #fff;
  text-align: center;
}

.qualified-box span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.qualified-name {
  margin-top: 2px;
  font-family: var(--font-title);
  font-size: clamp(24px, 3vw, 34px);
}

.champion-banner {
  display: none;
  margin-bottom: 14px;
  padding: 18px clamp(16px, 4vw, 34px);
  background: var(--btv-red);
  color: #fff;
  text-align: center;
}

.champion-banner.is-visible {
  display: block;
}

.champion-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
}

.champion-cup {
  width: clamp(48px, 8vw, 92px);
  height: auto;
  flex: 0 0 auto;
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.champion-copy {
  min-width: 0;
}

.champion-banner span {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
}

.champion-banner strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
}

.champion-players {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.champion-players li {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 800;
  font-size: clamp(13px, 1.6vw, 18px);
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.final-bracket {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 14px;
  align-items: start;
}

.round-column {
  display: grid;
  gap: 10px;
}

.round-title {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 400;
}

.match-card {
  overflow: hidden;
}

.match-card-head {
  padding: 8px 10px;
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.final-teams {
  display: grid;
}

.final-team-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  min-height: 70px;
  border-top: 1px solid var(--line);
}

.winner-line {
  background: rgba(206, 2, 5, 0.12);
}

.final-team-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 8px;
}

.final-team-line .match-name {
  display: grid;
  place-items: center;
  padding: 0;
}

.final-team-players {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.final-team-players li {
  min-width: 0;
  padding: 3px 4px;
  background: rgba(55, 55, 55, 0.08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.final-team-line .score-box {
  display: grid;
  place-items: center;
}

.match-winner {
  padding: 8px 10px;
  background: var(--btv-red);
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.winner-name {
  display: block;
  margin-top: 2px;
  font-family: var(--font-title);
  font-size: 28px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(16px, 5vw, 72px);
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 1120px) {
  .teams-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pools-grid,
  .final-bracket {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar::after {
    background-position: center -36px;
    background-size: 310px auto;
    opacity: 0.12;
  }

  .event-main-line {
    display: grid;
    gap: 4px;
  }

  .event-strip {
    grid-template-columns: 1fr;
  }

  .status-line {
    display: grid;
    gap: 4px;
  }

  .champion-inner {
    display: grid;
    justify-items: center;
    gap: 8px;
  }

  .champion-players {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

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

  .team-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .pool-head {
    grid-template-columns: 1fr;
  }

  .pool-visual {
    min-height: 140px;
  }

  .match-row {
    grid-template-columns: 1fr 48px 1fr;
    border: 1px solid var(--line);
    padding: 6px;
  }

  .phase-label,
  .status-pill {
    grid-column: 1 / -1;
  }

  .pool-qualified {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .page-nav a {
    width: 100%;
    text-align: center;
  }

  .name-strong,
  .match-name,
  .qualified-name,
  .winner-name {
    font-size: clamp(22px, 10vw, 32px);
  }
}
