:root {
  --wc-blue: #1a6091;
  --wc-blue-light: #3a9bd5;
  --wc-green: #00843d;
  --wc-gold: #d4a017;
  --conf-uefa: #0066cc;
  --conf-conmebol: #00a651;
  --conf-concacaf: #ce1126;
  --conf-caf: #fcd116;
  --conf-afc: #ff6600;
}

/* Hero Section */
.wc-hero {
  background: linear-gradient(135deg, var(--wc-blue) 0%, var(--wc-blue-light) 100%);
  padding: 3rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  color: white;
}

.wc-hero-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.wc-hero-fav {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.wc-hero-fav-small {
  font-size: 1rem;
  opacity: 0.95;
  margin-top: 0.25rem;
}

/* Group Tabs */
.wc-group-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.wc-group-tabs::-webkit-scrollbar {
  height: 4px;
}

.wc-group-tabs::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: var(--radius);
}

.wc-group-tabs::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: var(--radius);
}

.wc-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.wc-tab:hover {
  background: var(--bg-2);
  border-color: var(--wc-blue);
}

.wc-tab.active {
  background: var(--wc-blue);
  border-color: var(--wc-blue);
  color: white;
}

.wc-tab-panel {
  display: none;
}

.wc-tab-panel.active {
  display: block;
}

/* Group Board */
.wc-group-board {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.wc-group-board tbody {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}

.wc-team-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto 80px;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.2s ease;
}

.wc-team-row:last-child {
  border-bottom: none;
}

.wc-team-row:hover {
  background: var(--bg-2);
}

.wc-team-color {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-team-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wc-team-name {
  font-weight: 600;
  color: var(--text);
}

.wc-team-flag {
  font-size: 0.9rem;
  color: var(--muted);
}

.wc-team-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.wc-prob-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.wc-prob-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* Probability Bar */
.prob-bar {
  display: inline-flex;
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}

.prob-bar-fill {
  height: 100%;
  background: var(--wc-blue);
  width: var(--pct, 0%);
  transition: width 0.3s ease;
}

/* Knockout Bracket */
.wc-bracket {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wc-bracket-container {
  display: flex;
  gap: 2rem;
  min-width: 100%;
}

.wc-round {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-shrink: 0;
}

.wc-round-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.wc-match {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 200px;
}

.wc-team-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
  cursor: default;
}

.wc-team-slot:last-child {
  border-bottom: none;
}

.wc-team-slot:hover {
  background: var(--bg-2);
}

.wc-team-slot-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.wc-team-slot-prob {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 40px;
  text-align: right;
}

.wc-team-slot.eliminated .wc-team-slot-name {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Confederation Badges */
.conf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}

.conf-badge.uefa {
  background: var(--conf-uefa);
}

.conf-badge.conmebol {
  background: var(--conf-conmebol);
}

.conf-badge.concacaf {
  background: var(--conf-concacaf);
}

.conf-badge.caf {
  background: var(--conf-caf);
  color: #333;
}

.conf-badge.afc {
  background: var(--conf-afc);
}

/* Market Embeds Section */
.wc-market-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.wc-market-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.wc-embed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.wc-embed-hero {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wc-embed-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius);
}

.wc-embed-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.wc-embed-item {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wc-embed-item .wc-embed-frame {
  width: 100%;
  height: 100%;
}

/* Responsive Design */
@media (min-width: 768px) {
  .wc-hero {
    padding: 4rem 2rem;
  }

  .wc-hero-fav {
    font-size: 4rem;
  }

  .wc-team-row {
    grid-template-columns: 2rem 1.5fr auto 100px;
    padding: 1.25rem;
  }

  .wc-bracket-container {
    gap: 3rem;
  }

  .wc-match {
    min-width: 220px;
  }

  .wc-embed-grid {
    grid-template-columns: 1fr;
  }

  .wc-embed-hero {
    grid-column: 1 / -1;
  }

  .wc-embed-shelf {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .wc-embed-grid {
    grid-template-columns: 2fr 1fr;
  }

  .wc-embed-hero {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .wc-embed-shelf {
    grid-column: 2;
    grid-row: 1 / 3;
    grid-template-columns: 1fr;
  }

  .wc-embed-item {
    aspect-ratio: 16 / 10;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .wc-hero {
    background: linear-gradient(135deg, var(--wc-blue) 0%, var(--wc-blue-light) 100%);
  }

  .conf-badge.caf {
    color: #333;
  }
}

/* Utility Classes */
.wc-hidden {
  display: none;
}

.wc-text-center {
  text-align: center;
}

.wc-accent {
  color: var(--wc-blue);
}

.wc-accent-gold {
  color: var(--wc-gold);
}

.wc-accent-green {
  color: var(--wc-green);
}

/* ─── Utility classes used by wc-scope.js ────────────────────────────── */

.conf-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
}

.wc-host-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--wc-gold);
  color: #000;
  margin-left: 5px;
  vertical-align: middle;
}

.wc-group-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(58, 155, 213, 0.15);
  color: var(--wc-blue-light);
}

.wc-bracket-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--muted);
  font-size: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.wc-embed-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.wc-embed-card--hero {
  border-top: 3px solid var(--wc-blue-light);
}

.wc-embed-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.wc-embed-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wc-blue-light);
  text-decoration: none;
  margin-top: 4px;
}

.wc-embed-link:hover {
  text-decoration: underline;
}

.wc-embed-hero {
  margin-bottom: 20px;
}

.wc-embed-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.wc-leader-pct {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--wc-blue-light);
}

.wc-bracket-rounds {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.wc-round {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
}

.wc-round-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.wc-match-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
}

.wc-team-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-team-prob {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.wc-team-row--tbd {
  opacity: 0.5;
}

.wc-tbd-cell {
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
}

.wc-board-table td,
.wc-board-table th {
  white-space: nowrap;
}

.wc-group-table {
  width: 100%;
}

.prob-bar {
  display: inline-flex;
  width: 60px;
  height: 4px;
  background: var(--surface-soft);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 6px;
}

.prob-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
