/* ==========================================================================
   Broadcast Standings & Points Table Styles — Expat World Cup
   Brand Palette:
   Emerald Green: #00A86B | Royal Blue: #0057D9
   Golden Yellow: #FFC72C | Championship Gold: #D4AF37
   Dark Text: #111827     | Light Background: #F8FAFC
   ========================================================================== */

/* Standings Hero Banner with Cinematic Background */
.page-hero-standings {
  position: relative;
  min-height: 480px;
  background: linear-gradient(135deg, #030a1c 0%, var(--color-navy) 50%, #002b66 100%);
  border-bottom: 3px solid var(--color-emerald);
  padding: calc(var(--header-h) + 4.5rem) 0 3.8rem;
  overflow: hidden;
}

.page-hero-standings .frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.page-hero-standings .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.28;
  transform: scale(1.04);
  transition: transform 0.6s ease;
}

.page-hero-standings .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 23, 57, 0.75) 0%, rgba(7, 23, 57, 0.95) 100%);
  z-index: 1;
}

.page-hero-standings .container {
  position: relative;
  z-index: 2;
}

.page-hero-standings .crumbs {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.78);
}

.page-hero-standings .crumbs a {
  color: var(--color-yellow) !important;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.page-hero-standings .crumbs a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

.page-hero-standings .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-emerald);
  color: #ffffff !important;
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 168, 107, 0.4);
}

.page-hero-standings .hero-badge svg {
  width: 15px;
  height: 15px;
  fill: var(--color-yellow);
}

.page-hero-standings h1 {
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: #ffffff !important;
  margin: 0 0 14px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.page-hero-standings h1::after {
  content: "";
  display: block;
  width: 3.8rem;
  height: 3px;
  background: var(--color-yellow);
  margin-top: 0.85rem;
  border-radius: 2px;
}

.page-hero-standings .lede {
  color: rgba(255, 255, 255, 0.92) !important;
  max-width: 680px;
  font-size: 1.12rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Standings Metrics Bar */
.standings-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.standings-metric-pill {
  background: rgba(7, 23, 57, 0.82);
  border: 1px solid rgba(0, 168, 107, 0.35);
  padding: 14px 18px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.standings-metric-pill:hover {
  transform: translateY(-2px);
  border-color: var(--color-yellow);
}

.standings-metric-icon {
  width: 38px;
  height: 38px;
  background: rgba(0, 168, 107, 0.2);
  border: 1px solid rgba(0, 168, 107, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.standings-metric-icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-yellow) !important;
  stroke: var(--color-yellow);
}

.standings-metric-pill strong {
  display: block;
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-yellow) !important;
  line-height: 1;
  margin-bottom: 4px;
}

.standings-metric-pill span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Standings Group Tabs */
.standings-tab-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.standings-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: #ffffff;
  border: 1.5px solid rgba(0, 87, 217, 0.18);
  border-radius: 6px;
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-royal) !important;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px rgba(7, 23, 57, 0.04);
}

.standings-group-btn svg {
  width: 16px;
  height: 16px;
  color: var(--color-royal) !important;
  transition: color 0.22s ease;
}

.standings-group-btn:hover {
  border-color: var(--color-emerald);
  color: var(--color-emerald) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 168, 107, 0.15);
}

.standings-group-btn:hover svg {
  color: var(--color-emerald) !important;
}

.standings-group-btn.is-active {
  background: var(--color-emerald) !important;
  color: #ffffff !important;
  border-color: var(--color-emerald) !important;
  box-shadow: 0 6px 20px rgba(0, 168, 107, 0.35) !important;
}

.standings-group-btn.is-active svg {
  color: var(--color-yellow) !important;
}

/* Group Standings Table Card */
.standings-table-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(7, 23, 57, 0.07);
  border: 1px solid rgba(0, 87, 217, 0.12);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

/* STANDINGS CARD HEADER — FULL HIGH-CONTRAST FIX */
.standings-card-header {
  background: linear-gradient(135deg, #071739 0%, #0a2558 55%, #0057D9 100%) !important;
  color: #ffffff !important;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--color-emerald);
  box-shadow: 0 4px 16px rgba(7, 23, 57, 0.15);
}

.standings-card-header h2 {
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 1.48rem;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 0.05em;
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.standings-card-header h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background: var(--color-yellow);
  border-radius: 2px;
}

.standings-card-header .zone-tag {
  color: var(--color-yellow) !important;
  background: rgba(255, 199, 44, 0.14) !important;
  border: 1px solid rgba(255, 199, 44, 0.4) !important;
  font-family: var(--font-body), sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 4px;
}

/* Broadcast League Table */
.league-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.broadcast-league-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.broadcast-league-table th {
  background: #f8fafc;
  font-family: var(--font-display), "Barlow Condensed", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-royal) !important;
  padding: 14px 18px;
  border-bottom: 2px solid var(--color-emerald);
  text-align: left;
}

.broadcast-league-table th.num,
.broadcast-league-table td.num {
  text-align: center;
}

.broadcast-league-table td {
  padding: 15px 18px;
  border-bottom: 1px solid #eef2f6;
  font-size: 0.95rem;
  color: #111827 !important;
  vertical-align: middle;
}

.broadcast-league-table tr:hover td {
  background: rgba(0, 87, 217, 0.04);
}

/* Rank column */
.broadcast-league-table td.rank-cell {
  width: 50px;
  text-align: center;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display), "Oswald", sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
  background: #f1f5f9;
  color: #475569;
}

.rank-cell.qualifies .rank-pill {
  background: var(--color-emerald) !important;
  color: #ffffff !important;
  border: 1px solid var(--color-emerald);
  box-shadow: 0 2px 8px rgba(0, 168, 107, 0.35);
}

/* Team cell */
.team-table-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-table-crest {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--crest-bg, #00A86B);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.team-table-title a {
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--color-royal) !important;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.team-table-title a:hover {
  color: var(--color-emerald) !important;
}

.team-table-title span {
  display: block;
  font-size: 0.82rem;
  color: #475569 !important;
  font-weight: 600;
  margin-top: 2px;
}

/* NRR Pill */
.nrr-tag {
  font-family: var(--font-display), "Oswald", sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.nrr-positive {
  color: #047857 !important;
  background: rgba(0, 168, 107, 0.12);
}

.nrr-negative {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.1);
}

/* Points Badge */
.pts-badge {
  font-family: var(--font-display), "Oswald", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-royal);
}

.rank-cell.qualifies ~ td .pts-badge {
  color: var(--color-emerald) !important;
}

/* Form Guide Pills */
.form-guide-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.form-dot {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display), "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff !important;
}

.form-win {
  background: var(--color-emerald) !important;
}

.form-loss {
  background: #ef4444 !important;
}

/* Qualification Legend Footer */
.table-legend-footer {
  background: #f8fafc;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  color: #1e293b !important;
  font-weight: 600;
}

.legend-items {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legend-color.advance {
  background: var(--color-emerald);
  border: 1px solid var(--color-emerald);
}

.legend-color.eliminated {
  background: #cbd5e1;
}

.legend-sort-note {
  color: var(--color-royal);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .standings-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .standings-metrics-grid {
    grid-template-columns: 1fr;
  }
  .standings-card-header {
    padding: 14px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .standings-tab-bar {
    gap: 8px;
  }
  .standings-group-btn {
    padding: 8px 14px;
    font-size: 0.88rem;
  }
}
