/* =========================================================
   QUINIELA MUNDIAL 2026 — LOGAN ECUADOR
   Sistema de estilos · Mobile-first · v4.0 TEMA CLARO
   Identidad oficial Logan (brandbook 2026)
   ========================================================= */

/* Tipografía oficial Logan: Archivo (variable, Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,700&family=JetBrains+Mono:wght@400;700&display=swap');

/* =========================================================
   1. TOKENS DE DISEÑO — PALETA OFICIAL LOGAN (tema claro)
   ========================================================= */
:root {
  /* === Colores base (brandbook §1.2) === */
  --bg:        #F6F6F3;   /* Off-white Logan oficial */
  --bg-2:      #efefea;
  --surface:   #ffffff;   /* Cards blancas puras */
  --surface-2: #f0f0eb;
  --surface-3: #e6e6e0;
  --border:    #e0e0d8;
  --border-2:  #c5c5bd;
  --border-strong: #000000;
  --text:      #000000;   /* Negro Logan oficial */
  --text-dim:  #5b5b58;
  --text-muted:#8b8b86;

  /* === Paleta de marca Logan oficial === */
  --logan-pink:   #FF859E;
  --logan-cyan:   #00CEFA;
  --logan-orange: #FF681E;
  --logan-blue:   #0062FF;
  --logan-white:  #F6F6F3;
  --logan-yellow: #FFBF0D;
  --logan-green:  #4EBB7A;
  --logan-red:    #E93842;
  --logan-black:  #000000;

  /* === Acentos funcionales === */
  --accent:    #4EBB7A;   /* Verde Logan / éxito */
  --accent-dk: #2f9c5b;
  --accent-2:  #E93842;   /* Rojo Logan / error/bloqueo */
  --accent-3:  #FFBF0D;   /* Amarillo Logan / destacado/campeón */
  --accent-4:  #0062FF;   /* Azul Logan / info */
  --accent-5:  #00CEFA;   /* Cyan Logan / secundario */

  /* Ecuador tricolor (uso sutil) */
  --ec-yellow: #ffce00;
  --ec-blue:   #003893;
  --ec-red:    #ed1c24;

  /* Spacing scale — más generoso (editorial) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  16px;
  --s-4:  24px;
  --s-5:  32px;
  --s-6:  48px;
  --s-7:  72px;
  --s-8:  96px;
  --s-9:  128px;

  /* Radius */
  --radius-sm: 8px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Shadow (suaves para tema claro) */
  --shadow-sm: 0 2px 6px rgba(0,0,0,.05);
  --shadow:    0 6px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --shadow-block: 6px 6px 0 var(--logan-black);   /* Sombra dura estilo Logan */

  /* Tipografía oficial Logan: Archivo */
  --display: 'Archivo', 'Archivo Black', system-ui, sans-serif;
  --body:    'Archivo', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --shell-max: 1280px;
  --topbar-h:  72px;
  --bottomnav-h: 64px;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .22s;
}

/* =========================================================
   2. RESET + BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
  /* Geometría sutil de fondo (formas orgánicas Logan) */
  background-image:
    radial-gradient(ellipse 600px 320px at 90% -5%, rgba(255,191,13,.18), transparent 60%),
    radial-gradient(ellipse 500px 280px at -10% 110%, rgba(78,187,122,.13), transparent 60%);
  background-attachment: fixed;
  background-color: var(--bg);
}

@media (max-width: 768px) {
  body.has-bottom-nav { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
}

a { color: var(--logan-black); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-dk); }

button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1; }

/* =========================================================
   3. LAYOUT BASE
   ========================================================= */
.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--s-3);
}
@media (min-width: 768px)  { .shell { padding: 0 var(--s-4); } }
@media (min-width: 1024px) { .shell { padding: 0 var(--s-5); } }

/* =========================================================
   4. TOPBAR (light)
   ========================================================= */
.topbar {
  position: sticky;
  top: 0; z-index: 50;
  background: rgba(246,246,243,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--logan-black);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h);
  gap: var(--s-3);
}

.brand {
  display: flex; align-items: center; gap: var(--s-3);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 36px; width: auto;
  display: block;
}
.brand-mark {
  width: 44px; height: 44px;
  background: var(--logan-black);
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  color: var(--logan-white);
  letter-spacing: 0;
}
.brand-text {
  font-family: var(--display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--logan-black);
  text-transform: uppercase;
}
.brand-text span {
  background: var(--logan-yellow);
  color: var(--logan-black);
  padding: 2px 8px 0;
  border-radius: 4px;
  display: inline-block;
}
@media (min-width: 768px) {
  .brand-text { font-size: 22px; }
  .brand-logo { height: 40px; }
}

.nav-desktop { display: none; gap: 4px; }
.nav-desktop a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--logan-black);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
}
.nav-desktop a:hover { background: var(--bg-2); text-decoration: none; }
.nav-desktop a.active { background: var(--logan-black); color: var(--logan-white); }
@media (min-width: 900px) { .nav-desktop { display: flex; } }

/* Chip usuario */
.user-chip {
  display: none;
  align-items: center; gap: var(--s-2);
  padding: 8px 14px;
  background: var(--logan-black); color: var(--logan-white);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--logan-yellow);
  display: grid; place-items: center;
  font-weight: 900; font-size: 12px; color: var(--logan-black);
}
@media (min-width: 900px) { .user-chip { display: inline-flex; } }

/* Hamburguesa */
.hamburger {
  background: var(--logan-black);
  border: none;
  border-radius: 10px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.hamburger:hover { background: var(--text-dim); }
.hamburger svg { width: 20px; height: 20px; stroke: var(--logan-white); }
@media (min-width: 900px) { .hamburger { display: none; } }

/* Drawer móvil */
.drawer {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.5);
  display: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.drawer.open { display: block; opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(82vw, 320px);
  background: var(--logan-white);
  border-left: 2px solid var(--logan-black);
  padding: var(--s-4) var(--s-3);
  padding-top: calc(var(--s-4) + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: var(--s-2);
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close {
  align-self: flex-end;
  background: var(--logan-black);
  border: none;
  color: var(--logan-white);
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: var(--s-3);
}
.drawer a {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 14px 18px;
  border-radius: 10px;
  color: var(--logan-black);
  font-size: 16px; font-weight: 600;
  text-decoration: none;
}
.drawer a:hover, .drawer a.active {
  background: var(--logan-yellow);
  text-decoration: none;
}

/* =========================================================
   5. BOTTOM NAV (mobile)
   ========================================================= */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 40;
    background: var(--logan-white);
    border-top: 2px solid var(--logan-black);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
  }
  .bottom-nav a svg { width: 22px; height: 22px; stroke: currentColor; }
  .bottom-nav a.active {
    color: var(--logan-black);
    background: var(--logan-yellow);
  }
}

/* =========================================================
   6. HERO con bloque Logan
   ========================================================= */
.hero {
  padding: var(--s-7) 0 var(--s-6);
  border-bottom: 2px solid var(--logan-black);
  position: relative;
  overflow: hidden;
}

/* Formas orgánicas Logan (decágonos irregulares — bandera/rombos dibujados a mano) */
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -80px;
  width: 360px; height: 360px;
  background: var(--logan-yellow);
  clip-path: polygon(50% 2%, 72% 6%, 92% 19%, 98% 50%, 93% 79%, 72% 94%, 50% 100%, 28% 95%, 7% 80%, 0% 51%, 6% 22%, 27% 5%);
  z-index: 0;
  opacity: .92;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -60px;
  width: 220px; height: 220px;
  background: var(--logan-green);
  clip-path: polygon(50% 0%, 74% 8%, 90% 24%, 97% 50%, 93% 76%, 76% 92%, 50% 100%, 24% 92%, 10% 76%, 3% 50%, 7% 24%, 26% 8%);
  z-index: 0;
  opacity: .85;
}

.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 900px) {
  .hero { padding: var(--s-8) 0 var(--s-7); }
  .hero-grid { grid-template-columns: 1.5fr 1fr; align-items: end; }
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--logan-black);
  background: var(--logan-white);
  padding: 6px 14px;
  border: 2px solid var(--logan-black);
  border-radius: 999px;
  margin-bottom: var(--s-4);
}
.hero-eyebrow::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--logan-green);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(48px, 10vw, 104px);
  letter-spacing: -0.03em;
  line-height: .88;
  margin-bottom: var(--s-4);
  text-transform: uppercase;
  color: var(--logan-black);
}
.hero-title em {
  font-style: normal;
  background: var(--logan-black);
  color: var(--logan-yellow);
  padding: 0 12px 4px;
  display: inline-block;
}
.hero-title .gold { color: var(--accent-3); }

.hero-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 560px;
  font-weight: 500;
}
@media (min-width: 768px) { .hero-sub { font-size: 17px; } }

/* Stats compactas */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--logan-white);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-block);
}
.hero-stats > div {
  padding: var(--s-4) var(--s-3);
  border-right: 2px solid var(--logan-black);
}
.hero-stats > div:last-child { border-right: none; }
.hero-stat-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}
.hero-stat-value {
  font-family: var(--display);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  margin-top: 6px;
  letter-spacing: -0.03em;
  color: var(--logan-black);
}
.hero-stat-value.accent { color: var(--accent-dk); }
.hero-stat-value.gold   { color: var(--accent-3); }
@media (min-width: 768px) { .hero-stat-value { font-size: 44px; } }

/* Countdown XL — bloque Logan dramático */
.countdown-xl {
  background: var(--logan-black);
  color: var(--logan-white);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  margin-top: var(--s-4);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-block);
}
.countdown-xl-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--logan-yellow);
  font-weight: 800;
  margin-bottom: var(--s-2);
  display: flex; align-items: center; gap: 6px;
}
.countdown-xl-value {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
  color: var(--logan-white);
  display: flex; gap: var(--s-3); align-items: baseline; flex-wrap: wrap;
}
.countdown-xl-value .unit {
  font-size: 11px; font-family: var(--body); font-weight: 700;
  color: var(--logan-yellow); text-transform: uppercase; letter-spacing: 1px;
  margin-left: -8px;
}

/* =========================================================
   7. SECCIONES Y TÍTULOS
   ========================================================= */
.section-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 32px;
  letter-spacing: -0.03em;
  margin: var(--s-7) 0 var(--s-4);
  display: flex; align-items: center; gap: var(--s-3);
  text-transform: uppercase;
  color: var(--logan-black);
  flex-wrap: wrap;
}
.section-title small {
  font-size: 14px; font-family: var(--body); font-weight: 600;
  color: var(--text-dim); letter-spacing: 0;
  text-transform: none;
}
@media (min-width: 768px) { .section-title { font-size: 40px; } }

.section-sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: var(--s-5);
  max-width: 720px;
  font-weight: 500;
}

/* =========================================================
   8. CHIPS / BADGES
   ========================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .9px;
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.chip-success { background: var(--logan-green);  color: var(--logan-white); }
.chip-danger  { background: var(--logan-red);    color: var(--logan-white); }
.chip-warn    { background: var(--logan-yellow); color: var(--logan-black); }
.chip-info    { background: var(--logan-blue);   color: var(--logan-white); }
.chip-mute    { background: var(--surface-2);    color: var(--text-dim); border-color: var(--border); }
.chip-ec {
  background: linear-gradient(90deg, var(--ec-yellow) 0%, var(--ec-yellow) 33%, var(--ec-blue) 33%, var(--ec-blue) 66%, var(--ec-red) 66%);
  color: var(--logan-white);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* =========================================================
   9. TABS
   ========================================================= */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--logan-black);
  margin: var(--s-5) 0 var(--s-4);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 14px 18px;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 3px solid transparent;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  margin-bottom: -2px;
}
.tab:hover { color: var(--logan-black); }
.tab.active {
  color: var(--logan-black);
  border-bottom-color: var(--logan-black);
}
@media (min-width: 768px) { .tab { padding: 14px 24px; font-size: 14px; } }

/* =========================================================
   9.B FILTROS (Fase / Día / Grupo) — pills estilo Logan
   ========================================================= */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 800;
  min-width: 50px;
  flex-shrink: 0;
}
.filter-row .tabs {
  margin: 0;
  border-bottom: none;
  flex: 1;
  min-width: 0;
  gap: 6px;
}
.filter-row .tab {
  padding: 8px 16px;
  font-size: 12px;
  border-bottom: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--logan-black);
  border: 1.5px solid var(--border);
  margin-bottom: 0;
}
.filter-row .tab:hover { background: var(--bg-2); border-color: var(--logan-black); }
.filter-row .tab.active {
  background: var(--logan-black);
  color: var(--logan-white);
  border-color: var(--logan-black);
}
@media (max-width: 640px) {
  .filter-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .filter-label { padding-left: 4px; }
}

/* Eliminatoria pendiente de grupos */
.match-card.match-elim {
  background: var(--logan-white);
}
.match-card.match-waiting-groups {
  border-color: var(--logan-yellow);
  background: linear-gradient(135deg, #fff 0%, #fffef5 100%);
}
.match-card.match-waiting-groups .team-flag { opacity: .35; filter: grayscale(1); }
.team-placeholder .team-flag { opacity: .35; filter: grayscale(1); }
.team-placeholder .team-name {
  color: var(--text-dim);
  font-size: 12px !important;
}

/* =========================================================
  10. MATCH CARDS — bloques Logan
   ========================================================= */
.match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
@media (min-width: 640px) { .match-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-4); } }
@media (min-width: 1024px) { .match-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .match-grid { grid-template-columns: repeat(4, 1fr); } }

.match-card {
  background: var(--surface);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  padding: var(--s-4);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.match-card:hover:not(.match-locked) {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-block);
}
.match-card.match-locked {
  opacity: .65;
  background: var(--surface-2);
}
.match-card.match-saved {
  background: #f0fbf4;
  box-shadow: var(--shadow-block);
}
.match-card.match-ec {
  border-color: var(--ec-yellow);
  border-width: 3px;
}
.match-card.match-ec::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    var(--ec-yellow) 0%, var(--ec-yellow) 50%,
    var(--ec-blue) 50%, var(--ec-blue) 75%,
    var(--ec-red) 75%, var(--ec-red) 100%);
}

.match-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px dashed var(--border-2);
  flex-wrap: wrap;
  gap: 6px;
}
.match-meta { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.match-id { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.match-group { font-family: var(--display); font-weight: 900; font-size: 13px; color: var(--logan-black); letter-spacing: 0; text-transform: uppercase; }
.match-date { font-size: 12px; color: var(--logan-black); font-family: var(--mono); font-weight: 600; }
.match-venue { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.match-info { margin-bottom: var(--s-3); }

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-3);
  align-items: center;
}
.team { text-align: center; }
.team-flag {
  font-size: 36px; line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.team-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
  color: var(--logan-black);
}
@media (min-width: 768px) { .team-name { font-size: 15px; } }

.team input[type="number"] {
  width: 68px; height: 60px;
  margin-top: var(--s-2);
  background: var(--bg-2);
  color: var(--logan-black);
  border: 2px solid var(--logan-black);
  border-radius: 12px;
  text-align: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 32px;
  -moz-appearance: textfield;
  transition: all var(--dur) var(--ease);
}
.team input[type="number"]::-webkit-outer-spin-button,
.team input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.team input[type="number"]:focus {
  outline: none;
  background: var(--logan-yellow);
  box-shadow: 4px 4px 0 var(--logan-black);
}
.team input[type="number"]:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--surface-2);
  border-style: dashed;
}
.match-vs {
  font-family: var(--display);
  font-weight: 900;
  color: var(--text-dim);
  font-size: 18px;
  padding-top: 36px;
  letter-spacing: -0.02em;
}

.match-foot {
  margin-top: var(--s-4);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding-top: var(--s-2);
  border-top: 1px dashed var(--border-2);
}
.match-foot-status { color: var(--text-dim); font-weight: 600; }
.match-foot-points { color: var(--accent-dk); font-weight: 800; }

.btn-save-match {
  background: var(--logan-black);
  border: 2px solid var(--logan-black);
  color: var(--logan-white);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.btn-save-match:hover {
  background: var(--logan-yellow);
  color: var(--logan-black);
}
.btn-save-match:disabled { opacity: .4; cursor: not-allowed; }

/* =========================================================
  11. SECCIÓN ESPECIAL (semis + campeón) — bloque Logan amarillo
   ========================================================= */
.special-card {
  background: var(--logan-yellow);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-block);
}
.special-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: var(--logan-black);
}
@media (min-width: 768px) { .special-title { font-size: 36px; } }
.special-sub { color: var(--logan-black); font-size: 14px; margin-bottom: var(--s-4); font-weight: 600; }
.special-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (min-width: 768px) { .special-grid { grid-template-columns: repeat(4, 1fr); } }
.special-grid > .full { grid-column: 1 / -1; margin-top: var(--s-2); }
.special-grid label {
  display: block;
  font-size: 11px;
  color: var(--logan-black);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 800;
}
.special-grid select {
  width: 100%;
  padding: 12px 14px;
  background: var(--logan-white);
  color: var(--logan-black);
  border: 2px solid var(--logan-black);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.special-grid select:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--logan-black);
  transform: translate(-1px, -1px);
}
.special-grid select:disabled { opacity: .6; cursor: not-allowed; }

/* =========================================================
  12. CARTAS DE GRUPOS
   ========================================================= */
.groups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (min-width: 640px) { .groups-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .groups-grid { grid-template-columns: repeat(4, 1fr); gap: var(--s-3); } }
@media (min-width: 1200px) { .groups-grid { grid-template-columns: repeat(6, 1fr); } }

.group-card {
  background: var(--surface);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  padding: var(--s-3);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.group-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-block);
}
.group-letter {
  font-family: var(--display);
  font-weight: 900;
  font-size: 26px;
  color: var(--logan-black);
  letter-spacing: -0.03em;
  margin-bottom: var(--s-2);
  text-transform: uppercase;
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--logan-black);
}
.group-team {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  color: var(--logan-black);
  font-weight: 600;
}
.group-team .flag { font-size: 16px; }
.group-team.ec {
  color: var(--logan-black);
  font-weight: 800;
  background: var(--ec-yellow);
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px -4px;
}

/* =========================================================
  13. BOTONES — estilo Logan
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid var(--logan-black);
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-primary { background: var(--logan-black); color: var(--logan-white); }
.btn-primary:hover:not(:disabled) {
  background: var(--logan-yellow);
  color: var(--logan-black);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--logan-black);
}

.btn-secondary { background: var(--logan-white); color: var(--logan-black); }
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-2);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--logan-black);
}

.btn-ghost { background: transparent; color: var(--logan-black); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); }

.btn-danger { background: var(--logan-red); color: var(--logan-white); }
.btn-danger:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--logan-black);
}

.btn-gold { background: var(--logan-yellow); color: var(--logan-black); }
.btn-gold:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--logan-black);
}

.btn-block { width: 100%; }
.btn-lg { padding: 18px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-width: 1.5px; }

/* =========================================================
  14. FORMULARIOS
   ========================================================= */
.form-group { margin-bottom: var(--s-4); }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--logan-black);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 800;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--logan-white);
  color: var(--logan-black);
  border: 2px solid var(--logan-black);
  border-radius: 12px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--logan-black);
  transform: translate(-2px, -2px);
}
.form-group small { display: block; font-size: 12px; color: var(--text-dim); margin-top: 6px; font-weight: 500; }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-row .full { grid-column: 1 / -1; }

/* =========================================================
  15. TABLA LEADERBOARD
   ========================================================= */
.table-wrap {
  background: var(--surface);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
table.lb {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
@media (min-width: 768px) { table.lb { min-width: 0; } }
table.lb th, table.lb td {
  padding: 14px 18px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
table.lb th {
  background: var(--logan-black);
  color: var(--logan-white);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 800;
}
table.lb tr:last-child td { border-bottom: none; }
table.lb tr:hover { background: var(--bg-2); }

.rank {
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  width: 40px; text-align: center;
  color: var(--text-dim);
  letter-spacing: -0.03em;
}
.rank.r1 { color: var(--logan-yellow); background: var(--logan-black); border-radius: 6px; padding: 0 6px; }
.rank.r2 { color: var(--logan-black); background: #c8c8c0; border-radius: 6px; padding: 0 6px; }
.rank.r3 { color: var(--logan-white); background: #cd7f32; border-radius: 6px; padding: 0 6px; }

.points-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--logan-black);
  color: var(--logan-white);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
}
.points-pill.gold { background: var(--logan-yellow); color: var(--logan-black); }

/* Podio */
.podio {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
@media (min-width: 640px) {
  .podio { grid-template-columns: repeat(3, 1fr); align-items: end; }
}
.podio-card {
  background: var(--surface);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-4);
  text-align: center;
}
.podio-card .pos {
  font-family: var(--display);
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.podio-card .nom {
  font-size: 17px; font-weight: 800;
  margin: var(--s-2) 0 var(--s-3);
  color: var(--logan-black);
  text-transform: uppercase;
}
.podio-1 {
  background: var(--logan-yellow);
  box-shadow: var(--shadow-block);
  order: -1;
}
@media (min-width: 640px) {
  .podio-1 { order: 2; transform: translateY(-16px); }
  .podio-2 { order: 1; }
  .podio-3 { order: 3; }
}
.podio-1 .pos { font-size: 72px; color: var(--logan-black); }
.podio-2 .pos { color: var(--text-dim); }
.podio-3 .pos { color: #cd7f32; }

/* =========================================================
  15.B GRUPOS FIFA (tablas de posiciones)
   ========================================================= */
#grupos-fifa-host {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 900px)  { #grupos-fifa-host { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { #grupos-fifa-host { grid-template-columns: 1fr 1fr 1fr; } }

.grupo-fifa { border-radius: var(--radius); overflow: hidden; }
.grupo-fifa-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--logan-black);
  color: var(--logan-white);
  border-radius: var(--radius) var(--radius) 0 0;
}
.grupo-fifa-letra {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  color: var(--logan-yellow);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.grupo-fifa-table { min-width: 0 !important; }
.grupo-fifa-table th { background: var(--bg-2); color: var(--logan-black); }
.grupo-fifa-table th, .grupo-fifa-table td {
  padding: 10px 12px;
  font-size: 13px;
}
.grupo-fifa-table .pos-mark {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text-dim);
}
.pos-clasifica .pos-mark { background: var(--logan-green); color: var(--logan-white); }
.pos-bestthird .pos-mark { background: var(--logan-yellow); color: var(--logan-black); }
.pos-fuera     { opacity: .6; }

/* Resultados con marcador prominente */
.result-score {
  font-family: var(--display);
  font-weight: 900;
  font-size: 48px;
  line-height: 1;
  margin-top: 6px;
  color: var(--logan-black);
  letter-spacing: -0.05em;
}
.team-winner .team-name { color: var(--accent-dk); }
.team-winner .result-score { color: var(--accent-dk); }

/* =========================================================
  16. ALERTAS — bloques Logan
   ========================================================= */
.alert {
  padding: var(--s-3) var(--s-4);
  border-radius: 12px;
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-bottom: var(--s-4);
  border: 2px solid var(--logan-black);
  font-size: 14px;
  font-weight: 500;
  color: var(--logan-black);
}
.alert-info   { background: #e0eaff; }
.alert-warn   { background: var(--logan-yellow); }
.alert-ok     { background: #d3f3df; }
.alert-danger { background: #fde0e3; }
.alert b { color: var(--logan-black); font-weight: 800; }
.alert-icon { font-size: 22px; line-height: 1.1; flex-shrink: 0; }

/* =========================================================
  17. AUTH CARD (login)
   ========================================================= */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--s-5) var(--s-3);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 360px; height: 360px;
  background: var(--logan-yellow);
  clip-path: polygon(50% 2%, 72% 6%, 92% 19%, 98% 50%, 93% 79%, 72% 94%, 50% 100%, 28% 95%, 7% 80%, 0% 51%, 6% 22%, 27% 5%);
  z-index: 0;
  opacity: .92;
}
.auth-page::after {
  content: '';
  position: absolute;
  bottom: -140px; left: -80px;
  width: 260px; height: 260px;
  background: var(--logan-green);
  clip-path: polygon(50% 0%, 74% 8%, 90% 24%, 97% 50%, 93% 76%, 76% 92%, 50% 100%, 24% 92%, 10% 76%, 3% 50%, 7% 24%, 26% 8%);
  z-index: 0;
  opacity: .85;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--logan-white);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius-lg);
  padding: var(--s-6) var(--s-5);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  position: relative;
  z-index: 1;
}
.auth-brand {
  display: flex; align-items: center; gap: var(--s-3);
  justify-content: center;
  margin-bottom: var(--s-5);
  flex-direction: column;
}
.auth-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: var(--s-2);
  text-transform: uppercase;
}
.auth-sub {
  color: var(--text-dim);
  text-align: center;
  font-size: 14px;
  margin-bottom: var(--s-5);
  font-weight: 500;
}
.auth-links {
  margin-top: var(--s-4);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* =========================================================
  17.B PERFIL
   ========================================================= */
.profile-head {
  display: flex; align-items: center; gap: var(--s-4);
  margin: var(--s-5) 0 var(--s-5);
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--logan-yellow);
  border: 2px solid var(--logan-black);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 34px;
  color: var(--logan-black);
  letter-spacing: -0.03em;
  flex-shrink: 0;
  box-shadow: var(--shadow-block);
}
.profile-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
  text-transform: uppercase;
  color: var(--logan-black);
}

/* =========================================================
  18. UTILIDADES
   ========================================================= */
.muted { color: var(--text-dim); }
.subtle { color: var(--text-muted); }
.accent { color: var(--accent-dk); }
.gold   { color: var(--accent-3); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.flex-row { display: flex; gap: var(--s-3); align-items: center; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); } .mb-6 { margin-bottom: var(--s-6); }
.full-w { width: 100%; }

.hide-mobile  { display: none; }
.hide-desktop { display: block; }
@media (min-width: 768px) {
  .hide-mobile  { display: block; }
  .hide-desktop { display: none; }
}

/* Geometría decorativa Logan — formas orgánicas reutilizables */
.geom-blob {
  position: absolute;
  border-radius: 64% 36% 51% 49% / 41% 50% 50% 59%;
  pointer-events: none;
  z-index: 0;
}
.geom-blob-yellow { background: var(--logan-yellow); }
.geom-blob-green  { background: var(--logan-green); }
.geom-blob-pink   { background: var(--logan-pink); }
.geom-blob-cyan   { background: var(--logan-cyan); }

/* Divisor irregular Logan (estilo brandbook footer) */
.wave-divider {
  position: relative;
  height: 24px;
  background: var(--logan-yellow);
  margin: var(--s-5) 0;
}
.wave-divider::before {
  content: '';
  position: absolute;
  top: -8px; left: 0; right: 0;
  height: 16px;
  background: var(--logan-yellow);
  clip-path: polygon(0 60%, 4% 30%, 8% 70%, 14% 20%, 20% 65%, 28% 25%, 35% 70%, 42% 28%, 50% 65%, 58% 25%, 66% 70%, 74% 28%, 82% 65%, 90% 28%, 96% 70%, 100% 35%, 100% 100%, 0 100%);
}

/* =========================================================
  19. FOOTER
   ========================================================= */
.foot {
  margin-top: var(--s-8);
  padding: var(--s-5) 0;
  border-top: 2px solid var(--logan-black);
  color: var(--text-dim);
  font-size: 13px;
  background: var(--logan-white);
  font-weight: 500;
}
.foot-grid {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.foot a { color: var(--logan-black); font-weight: 700; }
@media (max-width: 640px) {
  .foot-grid { flex-direction: column; text-align: center; }
}

/* =========================================================
  19.B PUBLICIDAD — banners laterales + pop-up
   ========================================================= */

/* Banners verticales fijos a los lados (solo desktop >= 1400px) */
.ad-slot {
  display: none;
}
@media (min-width: 1400px) {
  .ad-slot {
    display: block;
    position: fixed;
    top: 90px;
    width: 220px;
    z-index: 30;
    border: 2px solid var(--logan-black);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-block);
    overflow: hidden;
  }
  .ad-slot-izq { left: 16px; }
  .ad-slot-der { right: 16px; }
}
@media (min-width: 1600px) {
  .ad-slot {
    width: 260px;
  }
  .ad-slot-izq { left: 20px; }
  .ad-slot-der { right: 20px; }
}
.ad-slot-link {
  display: block;
  text-decoration: none;
  color: var(--logan-black);
}
.ad-slot-img {
  width: 100%;
  height: 460px;
  object-fit: cover;     /* el banner es vertical fijo — cover llena el espacio */
  display: block;
  background: var(--logan-white);
}
@media (min-width: 1600px) {
  .ad-slot-img { height: 540px; }
}
/* Placeholder cuando aún no hay imagen cargada (admin lo reemplaza) */
.ad-slot-placeholder {
  padding: var(--s-4);
  min-height: 460px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: var(--s-3);
  text-align: center;
  background: linear-gradient(180deg, var(--logan-yellow) 0%, #ffd040 100%);
  color: var(--logan-black);
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-slot-placeholder span { font-size: 38px; line-height: 1; }
.ad-slot-placeholder small { font-size: 12px; line-height: 1.35; font-weight: 700; }
@media (min-width: 1600px) {
  .ad-slot-placeholder { min-height: 540px; }
}

/* Pop-up de bienvenida */
.ad-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: var(--s-3);
  animation: fadeIn .3s var(--ease);
}
.ad-popup-card {
  background: var(--surface);
  border: 2px solid var(--logan-black);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0 var(--logan-black);
  max-width: 720px;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: fadeIn .35s var(--ease);
  max-height: 92vh;
  overflow-y: auto;
}
.ad-popup-img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;   /* respeta la imagen original sin recortar */
  display: block;
  background: var(--logan-white);
}
.ad-popup-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--logan-black);
  color: var(--logan-white);
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
  display: grid;
  place-items: center;
}
/* La imagen del popup es 100% clickeable */
.ad-popup-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.ad-popup-link:focus-visible {
  outline: 3px solid var(--logan-yellow);
  outline-offset: -3px;
}
/* Placeholder cuando aún no se ha cargado imagen del popup */
.ad-popup-placeholder {
  padding: var(--s-7) var(--s-5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-3);
  text-align: center;
  background: linear-gradient(180deg, var(--logan-yellow) 0%, #ffd040 100%);
  color: var(--logan-black);
  min-height: 280px;
}
.ad-popup-placeholder-icon { font-size: 56px; line-height: 1; }
.ad-popup-placeholder p {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 0.02em;
  margin: 0;
}
.ad-popup-placeholder small {
  font-size: 13px;
  font-weight: 700;
  color: var(--logan-black);
  opacity: .85;
}

/* =========================================================
  20. ANIMACIONES
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .35s var(--ease) both; }

@keyframes saveFlash {
  0%   { box-shadow: 0 0 0 0 rgba(78,187,122,.5); }
  100% { box-shadow: 6px 6px 0 var(--logan-black); }
}
.save-flash { animation: saveFlash .6s var(--ease); }

/* Countdown legacy (alerts) */
.countdown {
  display: inline-flex; gap: 6px;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--logan-black);
  background: var(--logan-yellow);
  padding: 4px 10px; border-radius: 6px;
}

/* =========================================================
  21. PRINT
   ========================================================= */
@media print {
  .topbar, .bottom-nav, .drawer, .btn { display: none !important; }
  body { background: white; color: black; }
  .match-card, .table-wrap { break-inside: avoid; }
}
