/* ===== WORLD CUP — LAYOUT ===== */

#worldcup {
  padding-bottom: 0;
}

.worldcup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
  gap: 16px;
  flex-wrap: wrap;
}

.worldcup-header h2 {
  margin-bottom: 6px;
}

.worldcup-header .section-subtitle {
  margin-bottom: 0;
}

/* Two-column layout: teams + sidebar */
.worldcup-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.worldcup-layout.sidebar-hidden {
  grid-template-columns: 1fr;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

/* ---------- BASE CARD (dark/holographic — identity preserved) ---------- */
.team-card {
  position: relative;
  aspect-ratio: 3 / 4.9;
  border-radius: 18px;
  padding: 16px 14px 14px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, .18), transparent 55%),
    linear-gradient(160deg, #1a2333 0%, #0a1220 100%);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, .45),
    inset 0 0 0 1.5px rgba(255, 255, 255, .12);
}

.team-card::before {
  /* Borde holográfico/dorado */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1.5px;
  background: linear-gradient(140deg, #c9a14a 0%, #f4d97a 25%, #e6b94a 50%, #8a6a25 80%, #c9a14a 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.team-card::after {
  /* Brillo diagonal sutil */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, transparent 40%, rgba(255, 255, 255, .10) 50%, transparent 60%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  transition: transform .6s ease;
  transform: translateX(-30%);
}

.team-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 40px rgba(201, 161, 74, .35), 0 8px 20px rgba(0, 0, 0, .5);
}

.team-card:hover::after {
  transform: translateX(30%);
}

/* ---------- RARIDADES ---------- */
/* ICONO (Top 8): dorado intenso + fondo más rico */
.team-card.tier-icon {
  background:
    radial-gradient(110% 80% at 50% -10%, rgba(255, 225, 150, .35), transparent 55%),
    linear-gradient(160deg, #3a2a0e 0%, #1a1206 60%, #0a0703 100%);
}

.team-card.tier-icon::before {
  background: linear-gradient(140deg, #fff1b8 0%, #f4c84a 25%, #ffd76a 50%, #a0772a 80%, #fff1b8 100%);
}

/* ORO (9-24) */
.team-card.tier-gold {
  background:
    radial-gradient(110% 80% at 50% -10%, rgba(255, 215, 120, .22), transparent 55%),
    linear-gradient(160deg, #2a2010 0%, #14100a 100%);
}

/* PLATA (25+) */
.team-card.tier-silver {
  background:
    radial-gradient(110% 80% at 50% -10%, rgba(220, 228, 240, .22), transparent 55%),
    linear-gradient(160deg, #2a2f3a 0%, #14181f 100%);
}

.team-card.tier-silver::before {
  background: linear-gradient(140deg, #d8dde6 0%, #f3f5f8 25%, #b8bfcc 50%, #6a7180 80%, #d8dde6 100%);
}

/* ---------- ESTRUCTURA INTERNA ---------- */
.tc-top {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.tc-ovr {
  font-family: 'Bebas Neue', 'Oswald', 'Inter', sans-serif;
  font-size: 46px;
  line-height: .9;
  font-weight: 800;
  letter-spacing: .5px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}

.tier-icon .tc-ovr {
  color: #fff4c8;
}

.tier-silver .tc-ovr {
  color: #eef1f6;
}

.tc-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .85;
}

.tc-meta .tc-pos {
  font-weight: 700;
  color: #f4d97a;
}

.tier-silver .tc-meta .tc-pos {
  color: #dfe5ef;
}

.tc-meta .tc-group {
  opacity: .7;
  font-size: 10px;
}

.tc-flag {
  position: relative;
  z-index: 3;
  font-size: 64px;
  line-height: 1;
  text-align: center;
  margin: 2px 0 6px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
}

.tc-name {
  position: relative;
  z-index: 3;
  font-family: 'Oswald', 'Inter', sans-serif;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  padding-bottom: 6px;
}

.tc-stats {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tc-stats .lbl {
  opacity: .6;
}

.tc-stats .val {
  text-align: right;
  font-weight: 700;
  color: #f4d97a;
}

.tier-silver .tc-stats .val {
  color: #eef1f6;
}

.tc-style {
  position: relative;
  z-index: 3;
  font-size: 10.5px;
  line-height: 1.3;
  text-align: center;
  opacity: .85;
  margin: 6px 0;
  font-style: italic;
}

.tc-player {
  position: relative;
  z-index: 3;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding-top: 6px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
}

.tc-player small {
  display: block;
  font-size: 9px;
  font-weight: 500;
  opacity: .55;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.tc-cta {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  margin-top: 8px;
  padding: 6px 10px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #fff;
  opacity: .9;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}

.team-card.has-article .tc-cta {
  color: #1a1206;
  opacity: 1;
  background: linear-gradient(135deg, #f4d97a 0%, #e6b94a 100%);
  border-color: rgba(244, 217, 122, .6);
  box-shadow: 0 2px 8px rgba(244, 217, 122, .25);
}

.team-card:hover .tc-cta {
  opacity: 1;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .32);
}

.team-card.has-article:hover .tc-cta {
  background: linear-gradient(135deg, #fff1b8 0%, #f4c84a 100%);
  box-shadow: 0 4px 14px rgba(244, 217, 122, .45);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .team-card {
    aspect-ratio: 3 / 5.2;
    padding: 12px 10px 12px;
  }

  .tc-ovr {
    font-size: 32px;
  }

  .tc-meta {
    font-size: 9px;
    letter-spacing: 1px;
  }

  .tc-meta .tc-group {
    font-size: 8.5px;
  }

  .tc-flag {
    font-size: 44px;
    margin: 2px 0 4px;
  }

  .tc-name {
    font-size: 13px;
    margin-bottom: 6px;
    padding-bottom: 5px;
    letter-spacing: .3px;
  }

  .tc-stats {
    font-size: 9px;
    gap: 2px 8px;
    margin-bottom: 6px;
  }

  .tc-style {
    font-size: 9.5px;
    margin: 4px 0;
  }

  .tc-player {
    font-size: 10px;
    letter-spacing: .8px;
    padding-top: 5px;
  }

  .tc-player small {
    font-size: 8px;
    margin-bottom: 1px;
  }

  .tc-cta {
    font-size: 9px;
    letter-spacing: .8px;
    padding: 5px 6px;
    margin-top: 6px;
  }
}

/* ===== FIXTURE SIDEBAR — light theme ===== */
.fixture-sidebar {
  position: sticky;
  top: calc(var(--navbar-height) + 16px);
  max-height: calc(100vh - var(--navbar-height) - 32px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.fixture-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
}

.fixture-sidebar-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  font-family: var(--sans);
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
  line-height: 1;
}

.sidebar-close-btn:hover {
  color: var(--fg);
  background: var(--border);
}

/* Fixture filters — light */
.fixture-filters {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg);
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  border-radius: 6px;
  padding: 3px;
}

.filter-tab {
  flex: 1;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(26, 18, 8, 0.08);
}

.filter-tab:hover:not(.active) {
  color: var(--fg);
}

.fixture-filter-row {
  display: flex;
  gap: 8px;
}

.fixture-filter-row input,
.fixture-filter-row select,
.fixture-filters input,
.fixture-filters select {
  flex: 1;
  padding: 7px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.8rem;
  transition: var(--transition);
  min-width: 0;
}

.fixture-filters input::placeholder {
  color: var(--muted);
}

.fixture-filters input:focus,
.fixture-filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-download-filtered {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.btn-download-filtered:hover {
  background: var(--card);
  border-color: var(--accent);
}

/* Fixture list scroll area */
.fixture-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg);
}

.fixture-scroll::-webkit-scrollbar {
  width: 4px;
}

.fixture-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Match cards inside sidebar (compact) */
.fixture-scroll .match-card {
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 14px 18px;
  background: transparent;
}

.fixture-scroll .match-card:last-child {
  border-bottom: none;
}

.fixture-scroll .match-card:hover {
  background: var(--card);
  transform: none;
}

.fixture-scroll .match-teams {
  font-size: 0.88rem;
  color: var(--fg);
}

.fixture-scroll .match-info {
  font-size: 0.75rem;
  margin-bottom: 10px;
  color: var(--muted);
}

.fixture-scroll .match-date {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Stage/day dividers in sidebar */
.fixture-divider {
  padding: 8px 18px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.fixture-empty {
  padding: 32px 18px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: var(--sans);
}

/* ===== ARTICLE PANEL — light theme ===== */
.article-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 8, 0.45);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.article-panel-overlay.open {
  opacity: 1;
  visibility: visible;
}

.article-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100%);
  background: var(--bg);
  z-index: 3001;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.article-panel::-webkit-scrollbar {
  width: 4px;
}

.article-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.article-panel.open {
  transform: translateX(0);
}

.article-panel-header {
  position: sticky;
  top: 0;
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(8px);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.article-panel-header .back-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--sans);
}

.article-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 5px;
  transition: var(--transition);
  line-height: 1;
}

.article-close-btn:hover {
  color: var(--fg);
  background: var(--card);
}

.article-panel-content {
  padding: 40px 36px 60px;
}

/* Article typography — light */
.article-panel-content .article-flag {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 16px;
}

.article-panel-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--fg);
  font-family: var(--serif);
}

.article-panel-content .article-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--sans);
}

.article-panel-content .article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-panel-content .article-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 28px;
  border-left: 2px solid var(--border);
  padding-left: 18px;
  font-style: italic;
  font-family: var(--serif);
}

.article-panel-content h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--fg);
  letter-spacing: -0.01em;
  font-family: var(--sans);
}

.article-panel-content p {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 14px;
  font-family: var(--sans);
}

.article-panel-content .article-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.article-panel-content .stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}

.article-panel-content .stat-box .stat-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--primary);
  font-family: var(--serif);
}

.article-panel-content .stat-box .stat-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--sans);
}

.article-panel-content .player-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.article-panel-content .player-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg);
  font-family: var(--sans);
}

.article-panel-content .player-list li:last-child {
  border-bottom: none;
}

.article-panel-content .player-list .player-role {
  font-size: 0.75rem;
  color: var(--muted);
}

.article-panel-content .article-verdict {
  background: var(--card);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: 18px 20px;
  margin: 24px 0;
}

.article-panel-content .article-verdict strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: var(--sans);
}

.article-panel-content .article-verdict p {
  margin-bottom: 0;
  color: var(--fg);
  font-size: 0.92rem;
}

/* Coming soon article */
.article-coming-soon {
  text-align: center;
  padding: 60px 0;
}

.article-coming-soon .coming-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}

.article-coming-soon p {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--sans);
}

/* ===== RESPONSIVE WORLDCUP ===== */
@media (max-width: 900px) {
  .worldcup-layout {
    grid-template-columns: 1fr;
  }

  .fixture-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(400px, 100%);
    max-height: 100%;
    border-radius: 0;
    border-right: none;
    transform: translateX(110%);
    z-index: 2500;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .fixture-sidebar.mobile-open {
    transform: translateX(0);
  }

  .fixture-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 18, 8, 0.45);
    z-index: 2400;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .fixture-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .teams-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-panel-content {
    padding: 28px 20px 48px;
  }

  .article-panel-content .article-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== MONETIZACIÓN — CAMISETAS ===== */
/* Jersey buttons sit inside dark cards — keep their dark styling */
.jersey-buy-btn {
  display: block;
  margin-top: 12px;
  padding: 8px 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  letter-spacing: 0.02em;
}

.jersey-buy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Etiqueta discreta de afiliado */
.jerseys-affiliate-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: -8px;
  font-family: var(--sans);
}

/* ===== MONETIZACIÓN — KO-FI / FOOTER — light theme ===== */
.kofi-strip {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 10%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.kofi-strip p {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.5;
  font-family: var(--sans);
}

.kofi-strip p strong {
  color: var(--fg);
}

.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: #ff5e5b;
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-kofi:hover {
  background: #e04d4a;
  transform: translateY(-1px);
}

.btn-kofi svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 600px) {
  .kofi-strip {
    padding: 20px 6%;
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-kofi {
    width: 100%;
    justify-content: center;
  }
}