/* ============================================================
   WORLD CUP 2026 — Editorial / Matchday Programme Theme
   Bebas Neue (display) + IBM Plex Sans (body)
   Light background variant
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #f5f2ed;
  --bg-alt:     #ede9e2;
  --bg-card:    #fff;
  --border:     #d8d3cb;
  --border-strong: #bbb6ad;
  --red:        #c8102e;
  --red-dark:   #8b0b1f;
  --red-tint:   #f9e8eb;
  --red-fill:   #f2d0d5;
  --ink:        #1a1a1a;
  --ink-mid:    #444;
  --ink-muted:  #777;
  --ink-faint:  #aaa;
  --font-display: 'Bebas Neue', 'Arial Narrow', Arial, sans-serif;
  --font-body:    'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */

header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--red);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1350px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 1rem;
}

.site-title a {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}

.site-title a:hover {
  color: var(--red);
}

nav {
  display: flex;
  gap: 1.75rem;
}

nav a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a:hover {
  color: var(--ink);
}

nav a.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* ---- Main / Page wrap ---- */

main {
  min-height: calc(100vh - 54px - 48px);
}

.page-wrap {
  max-width: 1350px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ---- Typography ---- */

h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-transform: uppercase;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.75rem;
  color: var(--ink-mid);
}

p.hint {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

small {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

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

a:hover {
  text-decoration: underline;
}

ul, ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

li {
  margin-bottom: 0.35rem;
}

strong {
  font-weight: 600;
}

/* ---- Banner ---- */

.banner {
  border-left: 3px solid var(--red);
  background: var(--red-tint);
  padding: 0.75rem 1rem;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
  color: var(--ink-mid);
}

.banner a {
  margin-left: 0.5rem;
}

/* ---- Badges ---- */

.level-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--red-fill);
  color: var(--red-dark);
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  vertical-align: middle;
}

.level-badge.tier-1 { background: #d4edda; color: #1a6630; }
.level-badge.tier-2 { background: #fff3cd; color: #7d5a00; }
.level-badge.tier-3 { background: #ffe0c2; color: #8a3a00; }
.level-badge.tier-4 { background: #fcd5d5; color: #8b0000; }

.group-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--bg-alt);
  color: var(--ink-muted);
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid var(--border);
}

/* ---- Tables — shared base ---- */

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.875rem;
}

thead th {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--red);
  padding: 0.55rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--bg-alt);
}

tbody tr:nth-child(odd) {
  background: var(--bg-card);
}

tbody tr:hover {
  background: #ede5d8;
}

tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

/* ---- Leaderboard ---- */

table.leaderboard {
  max-width: 620px;
  margin-bottom: 2rem;
}

table.leaderboard td.points {
  text-align: right;
  width: 5rem;
}

td.lbl-status {
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-style: italic;
  white-space: nowrap;
  padding-left: 0.75rem;
  width: 9rem;
}

table.leaderboard th:nth-child(3) {
  width: 9rem;
}

table.leaderboard th:last-child {
  text-align: right;
  width: 5rem;
}

table.leaderboard td.rank {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--red);
  width: 2.5rem;
  letter-spacing: 0.04em;
}

table.leaderboard td.points {
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

table.leaderboard tr.leader td {
  font-weight: 600;
}

table.leaderboard tr.leader td:first-child {
  border-left: 3px solid var(--red);
  padding-left: calc(0.75rem - 3px);
}

table.leaderboard tr.leader td.points {
  color: var(--red);
}

/* ---- Selections grid ---- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.selections {
  min-width: 700px;
}

table.selections td {
  font-size: 0.8125rem;
  line-height: 1.3;
  padding: 0.45rem 0.6rem;
  min-width: 100px;
}

table.selections td.player-name {
  font-weight: 600;
  white-space: nowrap;
  min-width: 90px;
}

table.selections td.points {
  font-weight: 600;
  text-align: right;
  min-width: 60px;
}

table.selections td.joker {
  background: #fde8ec;
  color: var(--ink);
}

table.selections td.joker .level-badge {
  background: var(--red-fill);
  color: var(--red-dark);
}

.joker-star {
  color: var(--red);
  font-size: 0.75rem;
  margin-left: 2px;
}

table.selections td.knocked {
  color: var(--ink-faint);
}

/* Hidden picks — tier teaser until reveal */
table.selections td.pick-locked {
  text-align: center;
  vertical-align: middle;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.6;
  opacity: 0.5;
}

.tier-badge.tier-1 { background: #d4edda; color: #1a6630; }
.tier-badge.tier-2 { background: #fff3cd; color: #7d5a00; }
.tier-badge.tier-3 { background: #ffe0c2; color: #8a3a00; }
.tier-badge.tier-4 { background: #fcd5d5; color: #8b0000; }

.joker-star {
  font-size: 0.7rem;
  line-height: 1;
}

.joker-star.dim {
  visibility: hidden;
}

table.selections td.knocked s {
  text-decoration: line-through;
  color: var(--ink-faint);
}

.tbd {
  color: var(--ink-faint);
  font-style: italic;
}

/* ---- Teams table ---- */

table.teams-table {
  margin-bottom: 2rem;
}

table.teams-table td:first-child {
  font-weight: 500;
  min-width: 180px;
}

table.teams-table .knocked td {
  color: var(--ink-faint);
}

table.teams-table .knocked td s {
  text-decoration: line-through;
  color: var(--ink-faint);
}

.elim-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 0.3rem;
  white-space: nowrap;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.mult-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.5rem;
}

/* ---- Rules page ---- */

table.rules-table {
  max-width: 400px;
  margin-bottom: 1.25rem;
}

.team-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.3rem 1.5rem;
  margin-bottom: 1rem;
}

.team-list li {
  font-size: 0.875rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
}

/* ---- Footer ---- */

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-strong);
}

.footer-inner {
  max-width: 1350px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ---- Two-column layout (leaderboard + matches panel) ---- */

.page-wrap.twocol {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.column-main {
  min-width: 0;
}

.column-matches {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-top: 4rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.column-matches::-webkit-scrollbar {
  display: none;
}

/* ---- Match cards ---- */

.matches-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1;
}

.matches-view {
  /* wrapper for toggled match sections */
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
}

.match-card.played {
  border-left: 3px solid var(--border-strong);
}

.match-card.upcoming {
  border-left: 3px solid var(--red);
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.match-team {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-team:first-child {
  text-align: left;
}

.match-team:last-child {
  text-align: right;
}

.match-score {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.match-vs {
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: center;
  flex-shrink: 0;
  padding: 0 0.3rem;
}

.match-team-placeholder {
  flex: 1;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-faint);
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0;
}

.stage-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.match-info {
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin-top: 0.15rem;
}

.match-info .venue {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-info .local-time {
  font-style: italic;
}

.match-times {
  font-size: 0.65rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.match-date-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.match-extra {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  font-weight: 500;
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.match-pickers-row {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.match-pickers-row.both {
  background: var(--red-tint);
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  margin-bottom: -0.65rem;
  padding: 0.35rem 0.75rem 0.65rem;
  border-top: 1px solid var(--red-fill);
}

.match-pickers-col {
  flex: 1;
  font-size: 0.65rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.match-pickers-col.right {
  text-align: right;
}

.picker-label {
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-right: 0.3rem;
}

.picker-names {
  display: inline;
}

.match-placeholder {
  border: 1px dashed var(--border);
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

/* ---- View toggle (teams page) ---- */

.view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
}

.view-toggle-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border: none;
  background: var(--bg-card);
  color: var(--ink-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}

.view-toggle-btn:last-child {
  border-right: none;
}

.view-toggle-btn:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.view-toggle-btn.active {
  background: var(--red);
  color: #fff;
}

.view-toggle-btn.disabled {
  opacity: 0.4;
  cursor: default;
  background: var(--bg-card);
  color: var(--ink-faint);
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.3rem; }
  .header-inner { padding: 0.5rem 1rem; }
  .site-title a { font-size: 1.4rem; }
  .page-wrap { padding: 1.5rem 1rem; }
  nav { gap: 1rem; }

  .page-wrap.twocol {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .column-matches {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-top: 0;
  }
}
