/*
 * Revised World Cup 26 - Initial Capacity × FIFA World Cup 26
 * IC brand: Montserrat, dark blue #1e3244, medium #3f6d92, light #99c0e1,
 *           orange #f16102, square-bracket motif, alternating dark/light bands.
 * WC26 brand: bold geometric type, gold trophy accent, square + quarter-circle
 *             geometric units (the "26" mark is built from 48 of them).
 */
:root {
  --dark-blue: #1e3244;
  --darker-blue: #16242f;
  --medium-blue: #3f6d92;
  --light-blue: #99c0e1;
  --orange: #f16102;
  --gold: #d9a826;
  --white: #ffffff;
  --gray: #343c43;
  --red: #d92632;

  --card: #27405a;
  --line: rgba(153, 192, 225, 0.22);
  --muted: #9fb4ca;

  --font-family: "Montserrat", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--dark-blue);
  color: var(--white);
  line-height: 1.5;
}

/* --- Top nav (IC style: sparse, logo + two links) --- */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  cursor: pointer;
}
/* Force the hand cursor across the whole linked lockup (header + footer marks). */
.brand, .brand *, .brand-mark, .brand-mark * { cursor: pointer; }
.brand-brackets {
  font-weight: 800;
  font-size: 22px;
  color: var(--orange);
  letter-spacing: 0.02em;
}
.brand-ic { color: var(--white); }
.brand-mark { text-decoration: none; cursor: pointer; }
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-blue);
}
.brand-26 {
  font-weight: 900;
  font-size: 18px;
  color: var(--gold);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.nav-links a:hover { color: var(--light-blue); }

/* --- Hero (IC centered hgroup, huge 800-weight heading) --- */
.hero {
  text-align: center;
  padding: 72px 24px 64px;
  max-width: 1000px;
  margin: 0 auto;
}
.kicker {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 24px;
}
.hero h1 {
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--light-blue);
  margin: 0;
  text-wrap: balance;
}
.subtitle {
  font-weight: 300;
  font-size: clamp(18px, 3vw, 28px);
  color: var(--light-blue);
  margin: 22px 0 0;
}
.meta {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 26px 0 0;
}

/* --- Geometric strip (WC26: squares + quarter circles) --- */
.geo-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 34px auto 0;
}
.geo { width: 20px; height: 20px; display: inline-block; }
.geo-strip.small .geo { width: 12px; height: 12px; }
.geo.qc.tl { border-radius: 100% 0 0 0; }
.geo.qc.tr { border-radius: 0 100% 0 0; }
.geo.qc.bl { border-radius: 0 0 0 100%; }
.geo.qc.br { border-radius: 0 0 100% 0; }
.c-orange { background: var(--orange); }
.c-light { background: var(--light-blue); }
.c-gold { background: var(--gold); }
.c-medium { background: var(--medium-blue); }

/* --- Rules (IC light band) --- */
.light {
  background: var(--white);
  color: var(--dark-blue);
}
.rules { padding: 72px 24px; }
.rules hgroup {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 48px;
}
.rules h2 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800;
  color: var(--medium-blue);
  margin: 0 0 14px;
}
.rules hgroup span {
  font-weight: 300;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--medium-blue);
}
.rule-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 36px 44px;
}
.rule-list li { display: flex; gap: 18px; align-items: flex-start; }
.rule-num {
  font-weight: 900;
  font-size: 30px;
  color: var(--orange);
  line-height: 1;
  min-width: 48px;
  border-top: 4px solid var(--gold);
  padding-top: 8px;
}
.rule-list strong {
  display: block;
  font-weight: 800;
  font-size: 17px;
  color: var(--dark-blue);
  margin-bottom: 6px;
}
.rule-list p { margin: 0; font-size: 14.5px; color: var(--gray); }
.rule-list em { font-style: normal; font-weight: 700; color: var(--orange); }

/* --- Tabs (IC bordered buttons, orange primary when active) --- */
.tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 40px 24px 8px;
  position: sticky;
  top: 0;
  background: var(--dark-blue);
  z-index: 5;
}
.tab {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  background: var(--dark-blue);
  color: var(--white);
  border: 2px solid var(--white);
  padding: 11px 30px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { border-color: var(--light-blue); color: var(--light-blue); }
.tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

main { max-width: 1140px; margin: 0 auto; padding: 32px 24px 72px; }
.panel { display: none; }
.panel.active { display: block; }

/* --- Matches --- */
.match-day { margin-bottom: 40px; }
.day-title {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin: 0 0 18px;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.match-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.match-card.status-final { border-top: 3px solid var(--gold); }
.match-card.status-upcoming { border-top: 3px solid var(--medium-blue); }
.match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
.match-group {
  font-weight: 800;
  color: var(--white);
  background: var(--medium-blue);
  padding: 3px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-upcoming {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 600;
}
.match-upcoming .vs {
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-right: 4px;
  margin-bottom: 4px;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto 30px 34px;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
}
.score-row .team {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-row.winner { background: rgba(217, 168, 38, 0.14); box-shadow: inset 3px 0 0 var(--gold); }
.score-row.winner .team { color: var(--gold); font-weight: 800; }
.orig-goals { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.rev-score {
  text-align: center;
  font-weight: 900;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.reds { display: flex; gap: 2px; justify-content: flex-end; }
.red-card { font-size: 11px; }
.red-card.goalie { color: var(--gold); font-weight: 800; }

.match-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.match-foot strong { color: var(--white); font-weight: 800; }
.match-foot.upcoming { font-style: italic; text-align: center; }
.match-foot.awaiting { font-style: italic; text-align: center; color: var(--gold); }
.match-foot.live {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 7px;
  vertical-align: middle;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.match-card.state-live { border-top-color: var(--red); }

.demo-tag {
  position: absolute;
  top: 3px;
  right: 0;
  background: var(--orange);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
}

/* --- Standings --- */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}
.group-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--medium-blue);
  padding: 16px 18px;
}
.group-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--light-blue);
}
.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
}
.standings th.t, .standings td.t { text-align: left; }
.standings td {
  text-align: center;
  padding: 8px 4px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid rgba(153, 192, 225, 0.1);
}
.standings td.t { font-weight: 600; white-space: nowrap; }
.standings td.pts { font-weight: 900; color: var(--gold); }
.standings td.rc { font-weight: 700; color: var(--red); }
.standings tr.qualifying td { background: rgba(153, 192, 225, 0.08); }
.standings tr.qualifying td.t { box-shadow: inset 3px 0 0 var(--orange); }
.gk-flag { font-size: 12px; }
.standings-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin-top: 22px;
}

/* --- Footer --- */
footer {
  background: var(--darker-blue);
  border-top: 1px solid var(--line);
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer .geo-strip { margin: 0 auto 18px; }
footer .brand-brackets { font-size: 15px; }

@media screen and (max-width: 640px) {
  .top-nav { padding: 16px 20px; }
  .brand-name { display: none; }
  .hero { padding: 48px 20px 44px; }
  .rules { padding: 48px 20px; }
}
