/* ====================================================================
   Mundial FIFA 2026 · estilos de la microsite (mundial/index.php)
   Autocontenido: define la paleta --mds-* (light) y los acentos --mun-*.
   El modo oscuro lo dispara [data-theme="dark"] (lib/theme.php).
   ==================================================================== */

:root {
  /* Paleta base del ecosistema (light) */
  --mds-primary:        #1a1a1a;
  --mds-surface:        #ffffff;
  --mds-surface-alt:    #f6f4ef;
  --mds-bg:             #faf8f3;
  --mds-text:           #0f1115;
  --mds-muted:          #6b6354;
  --mds-border:         #e7e1d4;
  --mds-border-strong:  #d6cfbf;
  --mds-shadow-sm:      0 1px 2px rgba(40,30,15,.06);
  --mds-shadow-md:      0 6px 22px rgba(40,30,15,.10);
  --mds-shadow-lg:      0 16px 48px rgba(40,30,15,.16);

  /* Acentos del Mundial */
  --mun-green:          #047857;   /* verde profundo */
  --mun-green-strong:   #065f46;
  --mun-green-soft:     #d1fae5;
  --mun-teal:           #0ea5a4;
  --mun-gold:           #e8a317;   /* dorado trofeo */
  --mun-gold-soft:      #fdf0d2;
  --mun-red:            #c2410c;   /* terracota / anfitrión MX */
  --mun-line:           #cdd5d0;   /* líneas del bracket */
  --mun-radius:         14px;
  --mun-radius-sm:      10px;
}

[data-theme="dark"] {
  --mds-primary:        #5eead4;
  --mds-surface:        #121821;
  --mds-surface-alt:    #0f141c;
  --mds-bg:             #0a0e14;
  --mds-text:           #e8edf2;
  --mds-muted:          #98a2b3;
  --mds-border:         #1f2937;
  --mds-border-strong:  #374151;
  --mds-shadow-sm:      0 1px 2px rgba(0,0,0,.40);
  --mds-shadow-md:      0 6px 22px rgba(0,0,0,.45);
  --mds-shadow-lg:      0 16px 48px rgba(0,0,0,.55);

  --mun-green:          #34d399;
  --mun-green-strong:   #6ee7b7;
  --mun-green-soft:     #0c2a22;
  --mun-teal:           #2dd4bf;
  --mun-gold:           #fbbf24;
  --mun-gold-soft:      #2a2210;
  --mun-red:            #fb7185;
  --mun-line:           #2b3645;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--mds-bg);
  color: var(--mds-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
.mun-wrap { max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.mun-flag { font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; line-height: 1; }

/* ---------- nav ---------- */
.mun-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--mds-bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mds-border);
}
.mun-nav .mun-wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.mun-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--mds-text); }
.mun-brand .ball {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mun-green), var(--mun-teal));
  color: #fff; font-size: 1.1rem; box-shadow: var(--mds-shadow-sm);
}
.mun-brand small { display:block; font-weight:600; font-size:.7rem; color: var(--mds-muted); letter-spacing:.01em; }
.mun-nav .spacer { flex: 1; }
.mun-nav .back {
  display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600;
  color: var(--mds-muted); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--mds-border);
}
.mun-nav .back:hover { color: var(--mun-green); border-color: var(--mun-green); }

/* ---------- hero ---------- */
.mun-hero { position: relative; overflow: hidden; padding: 54px 0 40px; }
.mun-hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(1100px 380px at 12% -10%, color-mix(in srgb, var(--mun-green) 22%, transparent), transparent 60%),
    radial-gradient(900px 360px at 100% 0%, color-mix(in srgb, var(--mun-teal) 20%, transparent), transparent 55%);
}
.mun-hero .mun-wrap { position: relative; z-index: 1; }
.mun-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mun-green-strong);
  background: var(--mun-green-soft); padding: 6px 12px; border-radius: 999px;
}
.mun-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em;
  margin: 16px 0 8px; line-height: 1.05;
}
.mun-hero h1 .grad {
  background: linear-gradient(100deg, var(--mun-green), var(--mun-teal) 60%, var(--mun-gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.mun-hero .lead { color: var(--mds-muted); font-size: 1.05rem; max-width: 640px; margin: 0 0 18px; }
.mun-hosts { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.mun-host { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .95rem; }
.mun-host .mun-flag { font-size: 1.4rem; }

/* stat chips */
.mun-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.mun-stat {
  background: var(--mds-surface); border: 1px solid var(--mds-border); border-radius: var(--mun-radius);
  padding: 12px 16px; min-width: 96px; box-shadow: var(--mds-shadow-sm);
}
.mun-stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.mun-stat span { font-size: .78rem; color: var(--mds-muted); font-weight: 600; }
.mun-stat b .mun-flag { font-size: 1.2rem; }

/* ---------- secciones ---------- */
.mun-section { padding: 34px 0; }
.mun-section.alt { background: var(--mds-surface-alt); }
.mun-shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.mun-shead h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 10px; }
.mun-shead h2 i { color: var(--mun-green); }
.mun-shead p { margin: 4px 0 0; color: var(--mds-muted); font-size: .92rem; }
.mun-nav-arrows { display: flex; gap: 8px; }
.mun-arrow {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  background: var(--mds-surface); border: 1px solid var(--mds-border-strong); color: var(--mds-text);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.mun-arrow:hover { border-color: var(--mun-green); color: var(--mun-green); transform: translateY(-1px); }
.mun-arrow:active { transform: scale(.95); }

/* ---------- scroller horizontal (carrusel) ---------- */
.mun-scroller {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 2px 16px; scrollbar-width: thin; scroll-padding-left: 2px;
}
.mun-scroller::-webkit-scrollbar { height: 8px; }
.mun-scroller::-webkit-scrollbar-thumb { background: var(--mds-border-strong); border-radius: 999px; }
.mun-scroller::-webkit-scrollbar-track { background: transparent; }
.mun-scroller > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ---------- tarjeta de partido ---------- */
.mun-match {
  width: 230px; background: var(--mds-surface); border: 1px solid var(--mds-border);
  border-radius: var(--mun-radius); box-shadow: var(--mds-shadow-sm); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.mun-match:hover { transform: translateY(-3px); box-shadow: var(--mds-shadow-md); border-color: var(--mun-green); }
.mun-match.is-host { border-color: color-mix(in srgb, var(--mun-green) 55%, var(--mds-border)); }
.mun-match-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: .72rem; font-weight: 700; color: var(--mds-muted);
  border-bottom: 1px dashed var(--mds-border); background: var(--mds-surface-alt);
}
.mun-gchip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px;
  padding: 0 6px; border-radius: 6px; background: var(--mun-green); color: #fff; font-size: .72rem; font-weight: 800;
}
.mun-match-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.mun-team { display: flex; align-items: center; gap: 9px; }
.mun-team .mun-flag { font-size: 1.5rem; }
.mun-team .nm { font-weight: 700; font-size: .92rem; }
.mun-team .cc { margin-left: auto; font-size: .72rem; color: var(--mds-muted); font-weight: 700; }
.mun-vs { text-align: center; font-size: .68rem; font-weight: 800; color: var(--mds-muted); letter-spacing: .12em; }
.mun-match-foot {
  padding: 9px 12px; border-top: 1px solid var(--mds-border); font-size: .74rem; color: var(--mds-muted);
  display: flex; align-items: center; gap: 6px;
}
.mun-match-foot i { color: var(--mun-green); }
.mun-host-tag { color: var(--mun-green-strong); font-weight: 700; }

/* filtros de grupo */
.mun-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.mun-fbtn {
  border: 1px solid var(--mds-border-strong); background: var(--mds-surface); color: var(--mds-text);
  font-weight: 700; font-size: .8rem; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: all .12s ease;
}
.mun-fbtn:hover { border-color: var(--mun-green); }
.mun-fbtn.active { background: var(--mun-green); border-color: var(--mun-green); color: #fff; }

/* ---------- tarjeta de grupo · tabla de clasificación ---------- */
.mun-group {
  width: 372px; background: var(--mds-surface); border: 1px solid var(--mds-border);
  border-radius: var(--mun-radius); box-shadow: var(--mds-shadow-sm); overflow: hidden;
}
.mun-group-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: linear-gradient(120deg, var(--mun-green), var(--mun-teal)); color: #fff;
}
.mun-group-head .lg { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.mun-group-head small { margin-left: auto; opacity: .9; font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }

.mun-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.mun-table thead th {
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  color: var(--mds-muted); padding: 8px 3px; background: var(--mds-surface-alt);
  border-bottom: 1px solid var(--mds-border);
}
.mun-table th.c, .mun-table td.c { text-align: center; width: 26px; }
.mun-table th.teamc { text-align: left; padding-left: 10px; }
.mun-table th.pts, .mun-table td.pts { width: 30px; }
.mun-table td.pts { font-weight: 800; color: var(--mds-text); }
.mun-table tbody td { padding: 8px 3px; border-bottom: 1px solid var(--mds-border); vertical-align: middle; }
.mun-table tbody tr:last-child td { border-bottom: none; }
.mun-table td.pos { color: var(--mds-muted); font-weight: 800; }
.mun-table td.teamc { padding-left: 10px; white-space: nowrap; }
.mun-table td.teamc .mun-flag { font-size: 1.2rem; vertical-align: middle; margin-right: 7px; }
.mun-table td.teamc .nm {
  font-weight: 700; vertical-align: middle; display: inline-block;
  max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mun-table td.teamc .rk {
  font-size: .6rem; font-weight: 800; color: var(--mun-gold); background: var(--mun-gold-soft);
  padding: 1px 5px; border-radius: 5px; margin-left: 6px; vertical-align: middle;
}
/* zonas de clasificación */
.mun-table tr.q1 td { background: color-mix(in srgb, var(--mun-green) 7%, transparent); }
.mun-table tr.q1 td.pos { box-shadow: inset 3px 0 0 var(--mun-green); color: var(--mun-green); }
.mun-table tr.q3 td { background: color-mix(in srgb, var(--mun-gold) 9%, transparent); }
.mun-table tr.q3 td.pos { box-shadow: inset 3px 0 0 var(--mun-gold); color: var(--mun-gold); }

.mun-group-foot {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px 12px;
  font-size: .68rem; color: var(--mds-muted); font-weight: 600;
}
.mun-group-foot .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mun-group-foot .dot.q1 { background: var(--mun-green); }
.mun-group-foot .dot.q3 { background: var(--mun-gold); margin-left: 8px; }

/* ---------- bracket ---------- */
.mun-bracket-wrap { overflow-x: auto; padding: 8px 2px 18px; }
.mun-bracket { display: inline-flex; gap: 0; min-width: 100%; align-items: stretch; }
.mun-bk-round { display: flex; flex-direction: column; justify-content: space-around; min-width: 196px; padding: 0 16px; }
.mun-bk-round-title {
  text-align: center; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mun-green-strong); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--mun-green-soft);
}
.mun-bk-match {
  position: relative; background: var(--mds-surface); border: 1px solid var(--mds-border);
  border-radius: var(--mun-radius-sm); box-shadow: var(--mds-shadow-sm); margin: 7px 0; padding: 8px 10px;
}
.mun-bk-slot { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; padding: 3px 0; }
.mun-bk-slot .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--mun-line); flex: 0 0 auto; }
.mun-bk-slot.third { color: var(--mds-muted); font-style: italic; font-size: .74rem; }
.mun-bk-vs { height: 1px; background: var(--mds-border); margin: 4px 0; }
.mun-bk-meta { font-size: .66rem; color: var(--mds-muted); font-weight: 700; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.mun-bk-meta i { color: var(--mun-green); }
/* conectores */
.mun-bk-round:not(:last-child) .mun-bk-match::after {
  content: ''; position: absolute; right: -16px; top: 50%; width: 16px; height: 2px; background: var(--mun-line);
}
.mun-bk-round:not(:first-child):not(.is-final) .mun-bk-match::before {
  content: ''; position: absolute; left: -16px; top: 50%; width: 16px; height: 2px; background: var(--mun-line);
}

/* final / campeón */
.mun-bk-round.is-final { justify-content: center; }
.mun-bk-final {
  background: linear-gradient(135deg, var(--mun-gold), #f6c453); color: #3a2a05;
  border: none; box-shadow: var(--mds-shadow-md); padding: 14px;
}
.mun-bk-final .mun-bk-round-title { color: #3a2a05; border-color: rgba(58,42,5,.25); }
.mun-bk-final .mun-bk-slot { color: #2a1f04; font-weight: 800; }
.mun-bk-final .mun-bk-slot .dot { background: #3a2a05; }
.mun-bk-final .mun-bk-meta { color: #5a4410; }
.mun-bk-final .mun-bk-meta i { color: #5a4410; }
.mun-trophy { text-align: center; font-size: 1.8rem; margin-bottom: 4px; }

/* tercer lugar */
.mun-third {
  margin-top: 16px; background: var(--mds-surface); border: 1px dashed var(--mds-border-strong);
  border-radius: var(--mun-radius); padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.mun-third .tag { font-weight: 800; font-size: .8rem; color: var(--mun-gold); text-transform: uppercase; letter-spacing: .04em; }
.mun-third .pair { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; }
.mun-third .pair span.dim { color: var(--mds-muted); font-weight: 600; }
.mun-third .meta { margin-left: auto; font-size: .74rem; color: var(--mds-muted); font-weight: 700; }

/* ---------- footer ---------- */
.mun-footer { background: var(--mds-surface-alt); border-top: 1px solid var(--mds-border); padding: 28px 0; margin-top: 12px; }
.mun-footer .mun-wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.mun-footer p { margin: 0; font-size: .82rem; color: var(--mds-muted); }
.mun-footer a { color: var(--mun-green); font-weight: 700; }
.mun-note {
  font-size: .76rem; color: var(--mds-muted); background: var(--mds-surface); border: 1px solid var(--mds-border);
  border-radius: 10px; padding: 10px 14px; margin-top: 14px; display: flex; gap: 9px; align-items: flex-start;
}
.mun-note i { color: var(--mun-gold); margin-top: 1px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .mun-hero { padding: 38px 0 30px; }
  .mun-match { width: 210px; }
  .mun-group { width: 340px; }
  .mun-table td.teamc .nm { max-width: 92px; }
  .mun-nav .back span { display: none; }
}
