/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:           #0D0D0D;
  --surface:      #1A1A1A;
  --surface-2:    #212121;
  --surface-hover:#252525;
  --border:       #2A2A2A;
  --border-light: #333333;
  --text:         #FFFFFF;
  --text-muted:   #777777;
  --text-dim:     #444444;
  --live:         #0C7A3D;
  --live-glow:    rgba(12, 122, 61, 0.25);
  --live-bright:  #12A852;
  --radius:       6px;
  --radius-lg:    10px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Header ────────────────────────────────────────── */
header {
  background: #111111;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.brand-icon { width: 22px; height: 22px; }
.brand-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
}
.brand-year { color: var(--live-bright); }

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--surface);
}
/* Labels cortos visibles sólo en móvil pequeño — ver @media más abajo */
.nav-short { display: none; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--live-bright);
  padding: 4px 10px;
  border: 1px solid var(--live);
  border-radius: 20px;
  background: var(--live-glow);
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 var(--live-glow); }
  50%       { box-shadow: 0 0 0 4px transparent; }
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live-bright);
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.refresh-status {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Main ──────────────────────────────────────────── */
#main {
  flex: 1;
  padding: 0;
  overflow-x: auto;
}
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-muted);
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--live);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Groups view ───────────────────────────────────── */
.groups-all {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.week-block {}

.week-block-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.week-block-range {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  min-width: 900px;
}

.calendar-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 120px;
}
.calendar-col.today {
  border-color: #3A3A3A;
}
.calendar-col.today .col-header {
  background: #1F2A24;
  border-bottom-color: #2A3A30;
}

.col-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.day-name {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.day-date {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.today .day-name { color: var(--live-bright); }
.today .day-date { color: var(--live-bright); }

.matches-list { padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.no-matches {
  text-align: center;
  color: var(--text-dim);
  padding: 20px 0;
  font-size: 18px;
}

/* ── Match card ────────────────────────────────────── */
.match-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 8px;
  cursor: default;
  transition: border-color 0.15s;
  position: relative;
}
.match-card:hover { border-color: var(--border-light); }
.match-card.live {
  border-color: var(--live);
  background: rgba(12, 122, 61, 0.06);
}

.live-badge {
  position: absolute;
  top: 5px; right: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--live-bright);
  background: var(--live-glow);
  border: 1px solid var(--live);
  border-radius: 3px;
  padding: 1px 5px;
  animation: blink 1.2s ease-in-out infinite;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.group-badge {
  width: 18px; height: 18px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s, opacity 0.1s;
  letter-spacing: 0;
}
.group-badge:hover { transform: scale(1.15); opacity: 0.85; }
.match-time {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.match-status-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 4px;
}
.team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.team.away { flex-direction: row-reverse; }
.flag {
  width: 18px; height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.team-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.team.away .team-name { text-align: right; }

.score {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 0 4px;
}
.score.has-score { color: var(--live-bright); }
.score-sep { color: var(--text-dim); }

/* ── Bracket view ──────────────────────────────────── */
.bracket-wrapper {
  overflow: auto;
  padding: 16px 20px 24px;
  min-height: calc(100vh - 120px);
}
.bracket-scroll {
  display: flex;
  gap: 0;
  width: max-content;
  position: relative;
  align-items: flex-start;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.round-header {
  text-align: center;
  padding: 0 12px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.round-slots {
  display: flex;
  flex-direction: column;
}
.bracket-slot {
  display: flex;
  align-items: center;
  position: relative;
}

/* connector lines */
.bracket-slot::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--border-light);
  transform: translateY(-50%);
}
.bracket-round:last-child .bracket-slot::after { display: none; }

.bracket-connector {
  width: 20px;
  flex-shrink: 0;
  position: relative;
  align-self: stretch;
}
.bracket-connector::before {
  content: '';
  position: absolute;
  left: 0;
  width: 1px;
  background: var(--border-light);
}
.bracket-connector.top::before    { top: 0; height: 50%; }
.bracket-connector.bottom::before { top: 50%; height: 50%; }
.bracket-connector.both::before   { top: 0; height: 100%; }
.bracket-connector::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  width: 20px; height: 1px;
  background: var(--border-light);
  transform: translateY(-50%);
}
.bracket-connector.no-right::after { display: none; }

/* bracket match card */
.bracket-match {
  width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.bracket-team-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
}
.bracket-team-row:last-child { border-bottom: none; }
.bracket-team-row.winner { background: rgba(12, 122, 61, 0.1); }
.bracket-team-row.tbd { opacity: 0.4; }

.bracket-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.bracket-name {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bracket-score {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 16px;
  text-align: right;
}
.bracket-team-row.winner .bracket-score { color: var(--live-bright); }

.bracket-live-badge {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--live-bright);
  background: var(--live-glow);
  border: 1px solid var(--live);
  border-radius: 3px;
  padding: 1px 4px;
  animation: blink 1.2s ease-in-out infinite;
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: #161616;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 14px 14px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  z-index: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--border-light); }

.modal-body { padding: 16px 20px 24px; }

.modal-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-left: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-group-badge {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  color: #fff;
}
.modal-group-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* standings table */
.standings-table {
  margin-bottom: 20px;
  overflow-x: auto;
}
.standings-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.standings-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
}
.standings-table th:nth-child(2) { text-align: left; }
.standings-table td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.standings-table td:nth-child(2) { text-align: left; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr.qualified td:nth-child(1) {
  color: var(--live-bright);
  font-weight: 700;
}
.standings-table tr.eliminated { opacity: 0.38; }
.standings-table td.pts {
  font-weight: 700;
  color: var(--text);
}
.team-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.flag-sm {
  width: 18px; height: 13px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* matchday sections */
.matchday-section { margin-top: 16px; }
.matchday-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.modal-match {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.modal-match:last-child { border-bottom: none; }
.modal-match.live { background: rgba(12,122,61,0.04); border-radius: var(--radius); padding: 7px 6px; }
.modal-match-info {
  font-size: 10px;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.modal-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.modal-team.away { flex-direction: row-reverse; justify-content: flex-start; }
.modal-team.away .modal-team-name { text-align: right; }
.modal-team-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-score {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.modal-score.has-score { color: var(--live-bright); }
.modal-live-badge {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--live-bright);
  background: var(--live-glow);
  border: 1px solid var(--live);
  border-radius: 3px;
  padding: 1px 4px;
  animation: blink 1.2s ease-in-out infinite;
}

/* ── Bottom bar ────────────────────────────────────── */
.bottom-bar {
  background: #111111;
  border-top: 1px solid var(--border);
  padding: 0 20px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  flex-shrink: 0;
}
.round-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 20px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
.round-pill:first-child { padding-left: 0; }
.round-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.round-dates {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}
.round-pill.active .round-label { color: var(--live-bright); }
.round-pill.active .round-dates  { color: var(--text-muted); }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Error state ───────────────────────────────────── */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px;
  color: var(--text-muted);
  text-align: center;
}
.error-state strong { color: var(--text); font-size: 15px; }
.error-state small { font-size: 11px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ─────────────────────────────────────────────────────
   ≥ 1024px   desktop   — base styles above
   768–1023   tablet    — calendar scrolls h, bracket scrolls h
   < 768px    mobile    — calendar → lista, bracket → scroll h
═══════════════════════════════════════════════════════ */

/* ── Tablet (768 – 1023px) ────────────────────────── */
@media (max-width: 1023px) {
  .refresh-status { display: none; }
  .header-inner   { gap: 16px; }

  /* bracket: momentum scroll on iOS */
  .bracket-wrapper { -webkit-overflow-scrolling: touch; }
}

/* ── Mobile (< 768px) ─────────────────────────────── */
@media (max-width: 767px) {

  /* ·· Header ········································· */
  .header-inner {
    padding: 0 12px;
    height: 48px;
    gap: 8px;
  }
  .brand-icon  { width: 18px; height: 18px; }
  .brand-text  { font-size: 12px; letter-spacing: 0.06em; }
  .main-nav    { flex: 1; min-width: 0; }  /* ocupa el espacio entre brand y header-right */
  .nav-btn     { padding: 5px 11px; font-size: 12px; white-space: nowrap; }
  .refresh-status { display: none; }
  .live-indicator { padding: 3px 8px; font-size: 10px; gap: 5px; flex-shrink: 0; }

  /* ·· Groups → lista ································· */
  .groups-all {
    padding: 0;
    gap: 0;
  }

  /* Cabecera de semana: scroll normal, no sticky (evita tapar los headers de día) */
  .week-block-hdr {
    position: static;
    z-index: auto;
    background: #131313;
    padding: 8px 14px 7px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }
  .week-block { border-bottom: 2px solid var(--border); }
  .week-block:last-child { border-bottom: none; }

  /* Grid → columna */
  .calendar-grid {
    display: flex;
    flex-direction: column;
    min-width: 0;    /* elimina el min-width: 900px */
    gap: 0;
  }

  /* Ocultar días sin partidos (:has() → Chrome 105+, Safari 15.4+, FF 121+) */
  .calendar-col:not(:has(.match-card)) { display: none; }

  .calendar-col {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    min-height: 0;
  }
  .calendar-col:last-child { border-bottom: none; }

  /* Cabecera del día: inline en lugar de centrado */
  .col-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 9px 14px 7px;
    text-align: left;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .day-name {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .day-date {
    font-size: 14px;
    font-weight: 700;
    margin-top: 0;
  }
  .today .col-header    { background: #192218; }
  .today .day-name,
  .today .day-date      { color: var(--live-bright); }

  .matches-list  { padding: 8px 10px 10px; gap: 8px; }
  .no-matches    { display: none; } /* innecesario en lista */

  /* Match card: algo más holgado en lista */
  .match-card  { padding: 8px 10px; }
  .team-name   { font-size: 12px; }
  .score       { font-size: 14px; padding: 0 6px; }
  .flag        { width: 20px; height: 15px; }

  /* ·· Bracket → scroll horizontal (ya funciona, ajustar padding) */
  .bracket-wrapper {
    padding: 12px 0 16px;
    -webkit-overflow-scrolling: touch;
    min-height: calc(100vh - 100px);
  }
  /* Padding interno al contenido del scroll */
  .bracket-scroll { padding: 0 12px 4px; }
  .round-header   { font-size: 9px; padding: 0 6px 12px; }

  /* ·· Bottom bar ···································· */
  .bottom-bar    { padding: 0 8px; height: auto; min-height: 40px; }
  .round-pill    { padding: 5px 10px; }
  .round-label   { font-size: 8px; }
  .round-dates   { font-size: 9px; }

  /* ·· Modal → bottom sheet ························· */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-body { padding: 12px 14px 36px; }

  .standings-table th { font-size: 9px;  padding: 5px 4px; }
  .standings-table td { font-size: 11px; padding: 6px 4px; }

  .modal-match-info { min-width: 72px; }
}

/* ── iPhones pequeños (SE, mini — ≤ 390px) ────────── */
/* Con partido en vivo, "Fase de Grupos" + "Eliminatorias" no caben junto
   al indicador EN VIVO. Se usan etiquetas cortas para ese rango.        */
@media (max-width: 390px) {
  .nav-long  { display: none; }
  .nav-short { display: inline; }
  .nav-btn   { padding: 5px 9px; }
}

/* ── iPhones muy pequeños (SE 1ª gen — ≤ 375px) ───── */
@media (max-width: 375px) {
  .brand-text { font-size: 11px; letter-spacing: 0.03em; }
  .score      { font-size: 13px; }
}

/* ── iPhones grandes (Plus / Pro Max — ≥ 430px) ───── */
/* Hay más espacio: tarjetas algo más holgadas, fuente un poco mayor.   */
@media (min-width: 430px) and (max-width: 767px) {
  .col-header   { padding: 10px 16px 8px; }
  .matches-list { padding: 10px 14px 12px; gap: 10px; }
  .match-card   { padding: 9px 12px; }
  .team-name    { font-size: 13px; }
  .score        { font-size: 15px; }
  .flag         { width: 22px; height: 16px; }
}

/* ── Columna trofeo (bracket) ───────────────────────── */
.trophy-col { flex-shrink: 0; }

.trophy-pending,
.trophy-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  position: relative;
  z-index: 1;
}

.trophy-icon {
  width: 40px;
  height: 50px;
  display: block;
}

.trophy-pending .trophy-icon { opacity: .35; }

.trophy-pending-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.trophy-crest {
  width: 32px;
  height: 24px;
  object-fit: contain;
}

.trophy-champ-name {
  font-size: 12px;
  font-weight: 700;
  color: #F5C518;
  text-align: center;
  line-height: 1.1;
}

.trophy-champ-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #C8960C;
  text-align: center;
}

/* ── Match modal ────────────────────────────────────── */
.mm-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 40px 0; color: var(--text-muted);
}
.mm-error {
  padding: 24px; text-align: center; color: var(--text-muted);
}
.mm-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.mm-live-badge {
  display: inline-block;
  background: var(--live);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.mm-meta  { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.mm-venue { font-size: 11px; color: var(--text-dim); }

/* Scoreboard */
.mm-scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mm-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.mm-team.mm-winner .mm-team-name { color: var(--live-bright); font-weight: 700; }
.mm-crest {
  width: 52px; height: 40px;
  object-fit: contain;
}
.mm-team-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.mm-score-center {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.mm-score-val  { font-size: 28px; font-weight: 800; letter-spacing: .04em; }
.mm-score-dash { font-size: 24px; color: var(--text-dim); }
.mm-halftime   { font-size: 10px; color: var(--text-muted); letter-spacing: .04em; }

/* Details row */
.mm-details {
  display: flex; justify-content: center; gap: 16px;
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 16px;
}

/* Goals */
.mm-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-dim); text-transform: uppercase;
  margin: 16px 0 8px;
}
.mm-goals { display: flex; flex-direction: column; gap: 4px; }
.mm-goal-row {
  display: flex; gap: 8px; font-size: 12px;
  padding: 3px 0;
}
.mm-goal-home { flex-direction: row; }
.mm-goal-away { flex-direction: row-reverse; text-align: right; }
.mm-goal-min  { color: var(--live-bright); font-weight: 700; min-width: 28px; }
.mm-goal-scorer { color: var(--text); }

/* H2H bar */
.mm-h2h-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 4px;
}
.mm-h2h-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; min-width: 40px; }
.mm-h2h-label:last-child { text-align: right; }
.mm-h2h-track {
  flex: 1; height: 8px; border-radius: 4px;
  background: var(--border); overflow: hidden;
  display: flex;
}
.mm-h2h-seg         { height: 100%; transition: width .3s; }
.mm-h2h-seg.home    { background: var(--live-bright); }
.mm-h2h-seg.draw    { background: var(--text-dim); }
.mm-h2h-seg.away    { background: #1458a8; }

.mm-h2h-counts {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  padding: 0 4px; margin-bottom: 12px;
}
.mm-h2h-list  { display: flex; flex-direction: column; gap: 6px; }
.mm-h2h-row   {
  display: flex; gap: 8px; align-items: center;
  font-size: 11px; color: var(--text-muted);
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.mm-h2h-date  { flex-shrink: 0; min-width: 56px; color: var(--text-dim); }
.mm-h2h-teams { flex: 1; color: var(--text); }

.mm-no-h2h {
  font-size: 12px; color: var(--text-dim);
  padding: 8px 0;
}

/* Match card cursor */
.match-card { cursor: pointer; }
.match-card:hover { background: var(--surface-hover); }

/* ── Eventos ─────────────────────────────────────────── */
.mm-events { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }

.ev-row {
  display: grid;
  grid-template-columns: 52px 36px 28px 1fr;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}
.ev-home { direction: ltr; }
.ev-away {
  direction: rtl;
  grid-template-columns: 1fr 28px 36px 52px;
}
.ev-away .ev-desc { text-align: right; direction: ltr; }
.ev-away .ev-min  { text-align: center; }
.ev-away .ev-team { text-align: right; }

.ev-team  { color: var(--text-dim); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-min   { color: var(--live-bright); font-weight: 700; font-size: 11px; text-align: center; }
.ev-desc  { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-out   { color: var(--text-muted); }
.ev-assist{ color: var(--text-muted); }
.ev-icon-wrap { display: flex; gap: 2px; align-items: center; justify-content: center; }

.ev-icon        { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; }
.ev-goal        { background: var(--live); color: #fff; border-radius: 3px; padding: 1px 4px; }
.ev-yellow      { width: 10px; height: 14px; background: #F5C518; border-radius: 2px; display: inline-block; }
.ev-red         { width: 10px; height: 14px; background: #e53935; border-radius: 2px; display: inline-block; }
.ev-subst       { color: var(--text-muted); font-size: 14px; line-height: 1; }
.ev-var         { background: var(--border-light); color: var(--text-muted); border-radius: 3px; padding: 1px 3px; font-size: 8px; letter-spacing: .04em; }

/* ── Estadísticas ────────────────────────────────────── */
.mm-stats-header {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 6px;
}
.mm-stats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }

.stat-row {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
}
.stat-val { font-size: 12px; font-weight: 700; color: var(--text); text-align: center; }
.stat-bar-wrap {
  height: 6px; border-radius: 3px;
  background: var(--border);
  display: flex; overflow: hidden;
}
.stat-bar-h { background: var(--live-bright); height: 100%; }
.stat-bar-a { background: #1458a8; height: 100%; }
.stat-label {
  text-align: center; font-size: 10px; color: var(--text-dim);
  margin-top: -3px;
}

/* ── Alineaciones ────────────────────────────────────── */
.lu-header {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 6px;
}
.lu-header em { color: var(--text-dim); font-style: normal; }

.lu-grid { display: flex; flex-direction: column; gap: 2px; }

.lu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.lu-subs-hdr {
  display: grid; grid-template-columns: 1fr 1fr;
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-dim); text-transform: uppercase;
  padding: 8px 0 4px; border-top: 1px solid var(--border);
  margin-top: 4px;
}
.lu-subs-hdr span:last-child { text-align: right; }

.lu-player {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 4px; font-size: 11px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.lu-row > .lu-player:last-child { flex-direction: row-reverse; text-align: right; }
.lu-row > .lu-player:last-child .lu-name { text-align: right; }

.lu-num  { font-size: 10px; font-weight: 700; color: var(--text-dim); flex-shrink: 0; min-width: 16px; text-align: center; }
.lu-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lu-pos  { font-size: 9px; color: var(--text-dim); flex-shrink: 0; }

/* H2H competición */
.mm-h2h-comp { font-size: 10px; color: var(--text-dim); flex-shrink: 0; text-align: right; }
