/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --azul: #2A398D;
  --verde: #3CAC3B;
  --rojo: #E61D25;
  --blanco: #FFFFFF;
  --gris-claro: #D1D4D1;
  --gris-oscuro: #474A4A;
  --bg: #F4F6F8;
  --card-bg: #ffffff;
  --texto: #2d2d2d;
  --texto2: #6b7280;
  --border: #e2e5ea;
  --radius: 16px;
  --radius-sm: 10px;
  /* Mundial 2026 palette */
  --verde-oscuro: #004C3F;
  --verde-oscuro2: #00684A;
  --verde-vivo: #00A650;
  --verde-lima: #C6E600;
  --rojo-oscuro: #B9151B;
  --negro: #111111;
  --dorado: #D4AF37;
  /* Soft palette */
  --soft-bg: #F4F7F4;
  --soft-card: #F8FAF8;
  --soft-table: #F7F8F7;
  --soft-row-alt: #EEF3EF;
  --soft-row-hover: #E6ECE8;
  --soft-border: #D8E3DA;
  --texto-principal: #26352F;
  --texto-secundario: #5F6F68;
}
html { font-size: 16px; width: 100%; max-width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto); line-height: 1.5;
  width: 100%; max-width: 100%; overflow-x: hidden; min-height: 100vh;
  font-size: 15px;
}
body:not(.admin-page) {
  background: var(--verde-oscuro);
  background-image:
    /* Large soft blobs */
    radial-gradient(ellipse at 15% 10%, rgba(0,166,80,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 20%, rgba(198,230,0,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 75%, rgba(230,29,37,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(0,166,80,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 35% 50%, rgba(198,230,0,0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 30%, rgba(230,29,37,0.05) 0%, transparent 40%),
    /* Concentric rings — top right */
    radial-gradient(circle at 82% 12%, transparent 27%, rgba(0,166,80,0.09) 27%, transparent 30%),
    radial-gradient(circle at 82% 12%, transparent 33%, rgba(198,230,0,0.07) 33%, transparent 36%),
    radial-gradient(circle at 82% 12%, transparent 39%, rgba(230,29,37,0.05) 39%, transparent 42%),
    /* Concentric rings — bottom left */
    radial-gradient(circle at 8% 88%, transparent 21%, rgba(230,29,37,0.09) 21%, transparent 24%),
    radial-gradient(circle at 8% 88%, transparent 27%, rgba(0,166,80,0.07) 27%, transparent 30%),
    radial-gradient(circle at 8% 88%, transparent 33%, rgba(198,230,0,0.05) 33%, transparent 36%),
    /* Concentric rings — mid right */
    radial-gradient(circle at 92% 55%, transparent 15%, rgba(198,230,0,0.06) 15%, transparent 18%),
    radial-gradient(circle at 92% 55%, transparent 21%, rgba(230,29,37,0.05) 21%, transparent 24%),
    /* Concentric rings — mid left */
    radial-gradient(circle at 6% 40%, transparent 12%, rgba(0,166,80,0.06) 12%, transparent 15%),
    radial-gradient(circle at 6% 40%, transparent 18%, rgba(198,230,0,0.05) 18%, transparent 21%),
    /* Dots — red (larger, more visible) */
    radial-gradient(5px 5px at 20% 8%, rgba(230,29,37,0.30) 0%, transparent 100%),
    radial-gradient(4px 4px at 42% 5%, rgba(230,29,37,0.22) 0%, transparent 100%),
    radial-gradient(4px 4px at 68% 10%, rgba(230,29,37,0.20) 0%, transparent 100%),
    radial-gradient(5px 5px at 90% 6%, rgba(230,29,37,0.28) 0%, transparent 100%),
    radial-gradient(4px 4px at 6% 28%, rgba(230,29,37,0.20) 0%, transparent 100%),
    radial-gradient(4px 4px at 50% 92%, rgba(230,29,37,0.22) 0%, transparent 100%),
    radial-gradient(5px 5px at 15% 60%, rgba(230,29,37,0.18) 0%, transparent 100%),
    radial-gradient(3px 3px at 80% 70%, rgba(230,29,37,0.20) 0%, transparent 100%),
    /* Dots — lime (larger, more visible) */
    radial-gradient(5px 5px at 10% 6%, rgba(198,230,0,0.32) 0%, transparent 100%),
    radial-gradient(4px 4px at 28% 14%, rgba(198,230,0,0.25) 0%, transparent 100%),
    radial-gradient(4px 4px at 52% 8%, rgba(198,230,0,0.20) 0%, transparent 100%),
    radial-gradient(5px 5px at 75% 18%, rgba(198,230,0,0.26) 0%, transparent 100%),
    radial-gradient(4px 4px at 94% 22%, rgba(198,230,0,0.20) 0%, transparent 100%),
    radial-gradient(4px 4px at 35% 75%, rgba(198,230,0,0.22) 0%, transparent 100%),
    radial-gradient(5px 5px at 70% 90%, rgba(198,230,0,0.20) 0%, transparent 100%),
    radial-gradient(3px 3px at 55% 50%, rgba(198,230,0,0.18) 0%, transparent 100%),
    /* Dots — green (larger, more visible) */
    radial-gradient(5px 5px at 35% 20%, rgba(0,166,80,0.26) 0%, transparent 100%),
    radial-gradient(4px 4px at 58% 15%, rgba(0,166,80,0.20) 0%, transparent 100%),
    radial-gradient(4px 4px at 82% 28%, rgba(0,166,80,0.18) 0%, transparent 100%),
    radial-gradient(5px 5px at 15% 45%, rgba(0,166,80,0.24) 0%, transparent 100%),
    radial-gradient(4px 4px at 45% 35%, rgba(0,166,80,0.18) 0%, transparent 100%),
    radial-gradient(4px 4px at 65% 65%, rgba(0,166,80,0.20) 0%, transparent 100%),
    radial-gradient(5px 5px at 88% 50%, rgba(0,166,80,0.22) 0%, transparent 100%),
    /* Sweep curves — large arc shapes */
    radial-gradient(ellipse at 0% 50%, transparent 40%, rgba(0,166,80,0.06) 40%, transparent 50%),
    radial-gradient(ellipse at 100% 50%, transparent 35%, rgba(230,29,37,0.05) 35%, transparent 45%);
}
.admin-page { background: var(--bg); }
/* Public decorative blobs */
body:not(.admin-page)::before {
  content: ''; position: fixed;
  width: 550px; height: 650px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle, rgba(0,166,80,0.12) 0%, transparent 70%);
  top: -200px; right: -120px; pointer-events: none; z-index: 0;
}
body:not(.admin-page)::after {
  content: ''; position: fixed;
  width: 420px; height: 500px;
  border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
  background: radial-gradient(circle, rgba(198,230,0,0.09) 0%, transparent 70%);
  bottom: -140px; left: -80px; pointer-events: none; z-index: 0;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== CONTAINER ===== */
.container {
  max-width: 1280px; margin: 20px auto; padding: 24px;
  background: var(--soft-bg); border-radius: var(--radius);
  border: 1px solid var(--soft-border);
  box-shadow: 0 4px 24px rgba(0,76,63,0.12); position: relative; z-index: 1;
}
.container::before {
  content: ''; display: block; position: absolute; top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--verde-vivo) 0%, var(--verde-vivo) 28%, var(--rojo) 28%, var(--rojo) 33%, var(--verde-lima) 33%, var(--verde-lima) 100%);
  border-radius: var(--radius) var(--radius) 0 0; pointer-events: none;
}

/* ===== TRICOLOR ACCENT ===== */
.tricolor-bar { height: 4px; background: linear-gradient(90deg, var(--verde) 33%, var(--blanco) 33%, var(--blanco) 66%, var(--rojo) 66%); }

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--verde-oscuro) 0%, var(--verde-oscuro2) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.site-header::before {
  content: ''; position: absolute; top: -50px; right: -30px;
  width: 220px; height: 220px; border-radius: 45% 55% 55% 45% / 50% 45% 55% 50%;
  background: radial-gradient(circle, rgba(230,29,37,0.13) 0%, transparent 70%);
}
.site-header::after {
  content: ''; position: absolute; bottom: -30px; left: 5%;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(198,230,0,0.10) 0%, transparent 70%);
}
.header-shape {
  position: absolute; top: 0; right: 80px; width: 130px; height: 100%;
  background: rgba(255,255,255,0.03);
  transform: skewX(-15deg);
  pointer-events: none;
}
.header-shape::before {
  content: ''; position: absolute; top: 15%; left: -40px;
  width: 50px; height: 60px;
  border-radius: 50% 0 0 50% / 60% 0 0 40%;
  background: radial-gradient(ellipse at 60% 50%, rgba(198,230,0,0.06) 0%, transparent 70%);
  transform: skewX(15deg);
}
.header-shape::after {
  content: ''; position: absolute; top: 40%; left: 30px; width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,29,37,0.05) 0%, transparent 70%);
  transform: skewX(15deg);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 18px 24px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; position: relative; z-index: 1;
}
.header-inner::before {
  content: ''; position: absolute; bottom: -10px; right: 12%;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,166,80,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.header-inner::after {
  content: ''; position: absolute; top: -15px; left: 18%;
  width: 55px; height: 55px; border-radius: 50% 50% 50% 0;
  background: rgba(198,230,0,0.08);
  transform: rotate(45deg); pointer-events: none;
}
.header-left { display: flex; flex-direction: column; gap: 2px; position: relative; }
.header-left::before {
  content: ''; position: absolute; top: -25px; left: -30px;
  width: 180px; height: 140px;
  border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
  background: radial-gradient(ellipse at 40% 50%, rgba(0,166,80,0.08) 0%, transparent 70%);
  pointer-events: none; z-index: -1;
}
.header-left h1 {
  font-size: 26px; font-weight: 900; color: #fff; line-height: 1.15;
  letter-spacing: -0.5px;
}
.header-sub {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: rgba(255,255,255,0.7);
}
.header-sub span { white-space: nowrap; }
.header-sub .dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--verde-lima); opacity: 0.5; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-link {
  font-size: 13px; font-weight: 700; color: #fff;
  padding: 6px 16px; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: background 0.15s, border-color 0.15s;
}
.header-link:hover { background: var(--verde-vivo); border-color: var(--verde-vivo); text-decoration: none; }
.logo-placeholder {
  width: 44px; height: 54px; border-radius: 9px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.logo-placeholder svg { display: block; }
.logo-placeholder::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--verde-lima); opacity: 0.5;
}
.admin-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: rgba(255,255,255,0.4);
  transition: color 0.15s, background 0.15s;
}
.admin-link:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }

/* ===== SUMMARY STRIP ===== */
.summary-strip {
  display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: center; gap: 10px;
  margin: 0 0 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.summary-strip::before {
  content: ''; position: absolute; left: -35px; top: 50%; transform: translateY(-50%);
  width: 70px; height: 90px;
  border-radius: 0 50% 50% 0 / 0 60% 40% 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(230,29,37,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.summary-strip::after {
  content: ''; position: absolute; right: -35px; top: 50%; transform: translateY(-50%);
  width: 60px; height: 80px;
  border-radius: 50% 0 0 50% / 60% 0 0 40%;
  background: radial-gradient(ellipse at 70% 50%, rgba(198,230,0,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.summary-pill {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0; width: fit-content; max-width: max-content;
  height: 40px; padding: 8px 14px; border-radius: 999px;
  background: var(--soft-card); border: 1px solid rgba(0,166,80,0.15);
  box-shadow: 0 2px 8px rgba(0,76,63,0.06);
  color: var(--gris-oscuro); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.summary-pill strong { color: var(--verde-oscuro); font-weight: 900; }
.summary-pill .pill-icon { font-size: 15px; line-height: 1; }
.top-pill span:last-child { color: var(--verde-vivo); font-weight: 900; }
.summary-strip .summary-pill:nth-child(2) { border-left: 4px solid var(--dorado); }
.summary-strip .summary-pill:nth-child(3) { border-left: 4px solid var(--verde-vivo); }
.summary-strip .summary-pill:nth-child(4) { border-left: 4px solid var(--rojo); }

/* ===== JORNADA TABS ===== */
.tabs-wrapper { position: relative; }
.tabs-wrapper::before {
  content: ''; position: absolute; right: -20px; top: 20%;
  width: 0; height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 70px solid rgba(230,29,37,0.06);
  border-radius: 0 0 50% 50%;
  transform: rotate(20deg); pointer-events: none;
}
.tabs-wrapper::after {
  content: ''; position: absolute; right: 5px; top: 60%; transform: translateY(-50%);
  width: 45px; height: 45px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,166,80,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.jornada-tabs { margin-bottom: 18px; }
.tabs-section { margin-bottom: 8px; }
.tabs-section-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gris-oscuro); margin-bottom: 6px;
}
.tabs-section-header .line { flex: 1; height: 1px; background: var(--border); }
.tabs-section-header .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tabs-group { display: flex; gap: 6px; flex-wrap: wrap; }
.jornada-tab {
  padding: 6px 18px; font-size: 13px; font-weight: 700;
  background: #fff; color: var(--verde-oscuro);
  border: 2px solid var(--gris-claro); border-radius: 20px;
  transition: all 0.12s; white-space: nowrap; cursor: pointer;
  text-decoration: none;
}
.jornada-tab:hover { border-color: var(--rojo); background: #fef2f2; text-decoration: none; }
.jornada-tab.active { background: var(--verde-vivo); color: #fff; border-color: var(--verde-vivo); }
.jornada-tab.todas-tab { font-weight: 900; }
.tabs-group-elim .jornada-tab:hover { border-color: var(--rojo); background: #fef0f0; }
.tabs-group-elim .jornada-tab.active { background: var(--rojo); color: #fff; border-color: var(--rojo); }

/* ===== TABLE WRAPPER ===== */
.table-wrapper {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-bottom: 16px; border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,76,63,0.06);
  position: relative;
}
.table-wrapper::before {
  content: ''; position: absolute; left: -25px; top: 50%; transform: translateY(-50%);
  width: 50px; height: 120px;
  border-radius: 0 50% 50% 0 / 0 40% 60% 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,166,80,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ===== TABLE ===== */
.quiniela-table {
  width: 100%; border-collapse: collapse;
  background: var(--soft-table); font-size: 14px; min-width: 600px;
}
.quiniela-table thead { background: var(--verde-oscuro); color: #fff; }
.quiniela-table thead tr { background: var(--verde-oscuro); }
.quiniela-table th {
  padding: 10px 12px; font-size: 12px; font-weight: 800;
  text-align: center; white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
  vertical-align: middle;
}
.quiniela-table th:last-child { border-right: none; }
.th-match { font-size: 10px; font-weight: 700; line-height: 1.3; white-space: normal; }
.th-score { font-size: 11px; font-weight: 900; margin-top: 3px; color: var(--verde-lima); }
.quiniela-table td {
  padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--soft-border);
  white-space: nowrap; vertical-align: middle;
}
.quiniela-table tbody tr { transition: background 0.08s; }
.quiniela-table tbody tr:nth-child(even) { background: var(--soft-row-alt); }
.quiniela-table tbody tr:hover { background: var(--soft-row-hover); }
.col-pos { width: 40px; min-width: 36px; font-weight: 800; color: var(--texto2); }
.col-name { text-align: left; font-weight: 700; min-width: 130px; }
.col-num { width: 50px; min-width: 40px; font-weight: 600; }
.col-total { font-weight: 900; font-size: 16px; }
.col-subtotal { font-weight: 900; font-size: 15px; }
.col-group-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; }

/* Point cell backgrounds */
.pts-5 {
  background: #e6f5e6 !important;
  color: var(--verde) !important;
  font-weight: 900 !important;
  border-radius: 4px;
}
.pts-3 {
  background: #eef1f8 !important;
  color: var(--verde-oscuro) !important;
  font-weight: 800 !important;
}
.pts-0 {
  color: var(--gris-oscuro) !important;
  font-weight: 400 !important;
}
.pts-star {
  color: var(--gris-claro) !important;
  font-weight: 400 !important;
  font-style: italic !important;
}

/* Total general - green bg white text (tbody only) */
.quiniela-table tbody .col-total {
  background: var(--verde-vivo);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}
/* Subtotal (jornada points) - blue bg white text (tbody only) */
.quiniela-table tbody .col-subtotal {
  background: var(--verde-oscuro);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
}

/* Top positions */
.top { background: #f5f7ff !important; }
.top-1 td { color: #1a1a1a; }
.top-1 .col-pos { color: var(--dorado); font-weight: 900; font-size: 16px; }
.top-2 .col-pos { color: #888; font-weight: 900; font-size: 15px; }
.top-3 .col-pos { color: #A0522D; font-weight: 900; font-size: 14px; }
tr.top-1 { border-left: 3px solid var(--dorado); }
tr.top-2 { border-left: 3px solid #bbb; }
tr.top-3 { border-left: 3px solid #CD7F32; }

.empty { padding: 40px 20px !important; color: var(--texto2); font-style: italic; text-align: center; }

.col-name-clickable { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.col-name-clickable:hover { color: var(--azul); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 24px;
  background: var(--soft-card); border-radius: 12px;
  border: 1px solid var(--soft-border);
}
.empty-state-title {
  font-size: 18px; font-weight: 800; color: var(--texto-principal);
  margin-bottom: 8px;
}
.empty-state-text {
  font-size: 14px; color: var(--texto-secundario);
  max-width: 400px; margin: 0 auto; line-height: 1.5;
}
@media (max-width: 767px) {
  .empty-state { padding: 36px 20px; }
  .empty-state-title { font-size: 16px; }
  .empty-state-text { font-size: 13px; }
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.view-toggle-label {
  font-size: 12px; font-weight: 700; color: var(--texto2);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.view-btn {
  padding: 5px 16px; border: 2px solid var(--soft-border);
  background: transparent; border-radius: 20px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--texto2); transition: all 0.2s;
  font-family: inherit;
}
.view-btn:hover { border-color: var(--verde-oscuro); color: var(--verde-oscuro); }
.view-btn.active {
  background: var(--verde-oscuro); border-color: var(--verde-oscuro);
  color: #fff; cursor: default;
}

/* ===== VIEW HINT ===== */
.view-hint {
  font-size: 12px; color: var(--texto2); font-weight: 600;
  margin-bottom: 10px; padding: 8px 14px;
  background: #f0f4f8; border-radius: 8px;
  display: none;
}
.view-hint.show { display: block; }

/* ===== STICKY COLUMNS (desktop) ===== */
@media (min-width: 768px) {
  .quiniela-table th.col-pos,
  .quiniela-table th.col-name {
    position: sticky;
    background: var(--verde-oscuro);
    z-index: 4;
  }
  .quiniela-table th.col-pos { left: 0; }
  .quiniela-table th.col-name { left: 40px; }

  .quiniela-table td.col-pos,
  .quiniela-table td.col-name {
    position: sticky;
    background: var(--soft-table);
    z-index: 2;
  }
  .quiniela-table td.col-pos { left: 0; }
  .quiniela-table td.col-name { left: 40px; }

  .quiniela-table tbody tr:nth-child(even) td.col-pos,
  .quiniela-table tbody tr:nth-child(even) td.col-name {
    background: var(--soft-row-alt);
  }
  .quiniela-table tbody tr:hover td.col-pos,
  .quiniela-table tbody tr:hover td.col-name {
    background: var(--soft-row-hover);
  }

  .quiniela-table td.col-name::after,
  .quiniela-table th.col-name::after {
    content: ''; position: absolute; right: -4px; top: 0; bottom: -1px;
    width: 4px;
    background: linear-gradient(90deg, rgba(0,0,0,0.07), transparent);
    pointer-events: none;
  }

}

/* ===== COMPLETA VIEW (compact) ===== */
@media (min-width: 768px) {
  .quiniela-table[data-view="completa"] th {
    padding: 7px 5px;
    font-size: 10px;
  }
  .quiniela-table[data-view="completa"] td {
    padding: 5px 5px;
  }
  .quiniela-table[data-view="completa"] .col-num {
    width: 36px;
    min-width: 28px;
  }
  .quiniela-table[data-view="completa"] td.col-name {
    max-width: 130px;
    min-width: 110px;
    width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .quiniela-table[data-view="completa"] .th-match {
    font-size: 8px;
  }
  .quiniela-table[data-view="completa"] .th-score {
    font-size: 9px;
  }
}

/* ===== RESUMEN VIEW ===== */
.quiniela-table[data-view="resumen"] { min-width: auto; }
.quiniela-table[data-view="resumen"] tbody td.col-num:not(.col-subtotal):not(.col-total) {
  display: none;
}
.quiniela-table[data-view="resumen"] .col-name-clickable::after {
  content: 'Ver detalle \2192';
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: var(--verde-vivo); margin-left: 6px;
}
.quiniela-table[data-view="resumen"]:not(.is-todas) th.col-partido {
  display: none;
}
.quiniela-table[data-view="resumen"].is-todas th.col-group-label { display: none; }
.quiniela-table[data-view="resumen"].is-todas thead th.col-num:not(.col-total) {
  display: none;
}

/* ===== FOOTER ===== */
.site-footer { text-align: center; padding: 18px 0 4px; color: var(--texto2); font-size: 13px; border-top: 1px solid var(--border); margin-top: 4px; position: relative; }
.site-footer::before {
  content: ''; position: absolute; right: 10%; bottom: 50%;
  width: 40px; height: 40px;
  border-radius: 50% 50% 0 50%;
  background: rgba(0,166,80,0.05);
  transform: rotate(15deg); pointer-events: none;
}
.site-footer p { margin: 0; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: #fff; border-radius: var(--radius);
  max-width: 700px; width: 100%; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h2 { font-size: 20px; font-weight: 900; color: var(--azul); margin: 0; }
.modal-close {
  background: none; border: none; font-size: 28px;
  cursor: pointer; color: var(--texto2); line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--texto); }
.modal-body { padding: 16px 24px 24px; }
.modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-table th {
  padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 800;
  color: var(--texto2); border-bottom: 2px solid var(--border);
}
.modal-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.modal-table tbody tr:nth-child(even) { background: var(--soft-row-alt); }
.modal-table .m-name { text-align: left; font-weight: 600; }
.modal-table .m-pts { font-weight: 900; color: var(--azul); }
.modal-table .m-pred { font-weight: 700; }
.modal-table .m-real { color: var(--texto2); }
.modal-table .m-exacto { color: var(--verde); }
.modal-table .m-acertado { color: var(--azul); }
.modal-table .m-cero { color: var(--gris-oscuro); }
.modal-table .t-final { font-weight: 900; color: var(--azul); }

/* ===== ADMIN LOGIN ===== */
.admin-login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, var(--azul) 0%, #1a2766 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box {
  background: #fff; border-radius: var(--radius); padding: 36px 32px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.login-box h1 { font-size: 24px; font-weight: 900; color: var(--azul); text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--texto2); font-size: 14px; margin-bottom: 24px; }
.login-footer { text-align: center; margin-top: 20px; font-size: 13px; }

/* ===== ADMIN PAGES ===== */
.admin-page { background: var(--bg); }
.admin-nav {
  background: var(--azul); color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.admin-nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 16px; min-height: 46px; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-nav-inner::-webkit-scrollbar { display: none; }
.admin-brand {
  font-size: 15px; font-weight: 900; color: #fff !important;
  white-space: nowrap; margin-right: 12px; letter-spacing: 0.3px;
  flex-shrink: 0;
}
.admin-brand:hover { text-decoration: none; }
.admin-nav-links { display: flex; gap: 1px; flex: 1; }
.admin-nav-links a {
  color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.admin-nav-links a:hover {
  background: rgba(255,255,255,0.12); color: #fff; text-decoration: none;
}
.admin-nav-links a.active {
  background: rgba(255,255,255,0.18); color: #fff; text-decoration: none;
}
.nav-logout {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5) !important;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  flex-shrink: 0; margin-left: auto; transition: color 0.2s, background 0.2s;
}
.nav-logout:hover { color: #fff !important; background: rgba(255,255,255,0.1); text-decoration: none; }
.admin-container { max-width: 1400px; margin: 0 auto; padding: 16px 16px 24px; }
.admin-container h1 { font-size: 20px; font-weight: 900; color: var(--azul); margin: 0; }
.admin-head { margin-bottom: 14px; }

/* ===== ADMIN CARDS ===== */
.admin-card {
  background: var(--card-bg); border-radius: 12px;
  padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 16px; border: 1px solid var(--border);
}
.admin-card h2 { font-size: 15px; font-weight: 800; color: var(--azul); margin-bottom: 10px; }

/* ===== DASHBOARD CARDS (compact) ===== */
.dash-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.dash-card {
  background: var(--card-bg); border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid var(--border);
  height: 56px;
}
.dash-icon {
  flex-shrink: 0; color: var(--azul); opacity: 0.5;
}
.dash-info { display: flex; flex-direction: column; }
.dash-num { font-size: 20px; font-weight: 900; color: var(--azul); line-height: 1.1; }
.dash-lbl { font-size: 10px; color: var(--texto2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ===== QUICK ACCESS ===== */
.quick-actions { margin-bottom: 14px; }
.qa-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--texto2); margin-bottom: 6px;
}
.qa-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.qa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  background: var(--azul); color: #fff; border-radius: 7px;
  text-decoration: none; transition: opacity 0.15s;
  white-space: nowrap;
}
.qa-btn:hover { opacity: 0.85; text-decoration: none; color: #fff; }
.qa-btn svg { flex-shrink: 0; width: 14px; height: 14px; }
.qa-btn-sec { background: #6b7280; }
.qa-btn-danger { background: var(--rojo); }

/* ===== DASHBOARD PREVIEW ===== */
.preview-header { margin-bottom: 8px; }
.preview-header h2 { font-size: 14px; font-weight: 800; color: var(--azul); margin: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block; padding: 10px 20px; font-size: 14px; font-weight: 700;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity 0.15s, transform 0.1s; text-decoration: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--azul); color: #fff; }
.btn-secondary { background: var(--gris-claro); color: var(--texto); }
.btn-success { background: var(--verde); color: #fff; }
.btn-danger { background: var(--rojo); color: #fff; }
.btn-warning { background: #f0ad4e; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--texto); margin-bottom: 4px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(42,57,141,0.1);
}
.form-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.form-inline input { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ===== ADMIN TABLE FORM ===== */
.admin-page .quiniela-table .form-inline { gap: 4px; }
.admin-page .quiniela-table td { padding: 6px 8px; }
.admin-page .quiniela-table .actions { white-space: nowrap; }

/* ===== ALERTS ===== */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ===== BADGES ===== */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 14px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-grupos { background: #e8f4e8; color: var(--verde); }
.badge-eliminatoria { background: #e8edf8; color: var(--azul); }
.badge-activa { background: #e8f4e8; color: var(--verde); }
.badge-inactiva { background: #f1f1f1; color: var(--texto2); }
.badge-finalizado { background: #e8edf8; color: var(--azul); }
.badge-pendiente { background: #fff3f3; color: var(--rojo); }

/* ===== UTILITIES ===== */
.inactive { opacity: 0.5; }
.actions { white-space: nowrap; }
.sep { font-weight: 700; color: var(--texto2); }
.form-select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: #fff; color: var(--texto); cursor: pointer;
}
.form-select-sm { padding: 4px 8px; font-size: 13px; }
.puntos-form { display: inline-flex; align-items: center; gap: 2px; }
.puntos-input { width: 50px; padding: 4px 6px; text-align: center; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-weight: 700; color: var(--azul); background: #fff; }
.puntos-input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 2px rgba(42,57,141,0.1); }

/* ===== PASSOWORD TOGGLE ===== */
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 40px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #888;
  padding: 6px; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.password-toggle:hover { color: var(--azul); }

/* ===== ADMIN NAV BACK ===== */
.admin-nav-back { margin-top: 20px; padding: 12px 0; border-top: 1px solid var(--border); }
.admin-nav-back a { font-weight: 700; font-size: 14px; color: var(--azul); }

/* ===== BACKUP LIST ===== */
.back-link { display: inline-block; margin-bottom: 10px; font-size: 12px; color: var(--verde-oscuro); text-decoration: none; font-weight: 700; }
.back-link:hover { text-decoration: underline; color: var(--verde-vivo); }

.backup-list { list-style: none; padding: 0; }
.backup-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.backup-list li:last-child { border-bottom: none; }
.backup-list a { font-weight: 600; }
.backup-list small { color: var(--texto2); }

/* ===== FLAGS ===== */
.flag-img { width: 22px; height: 16px; vertical-align: middle; border-radius: 2px; }
.flag-img-table { width: 18px; height: 12px; vertical-align: middle; border-radius: 2px; margin-right: 6px; }

/* ===== RESPONSIVE: PC WIDE (≥1200) ===== */
@media (min-width: 1200px) {
  .container {
    max-width: 1600px;
    margin-left: 20px;
    margin-right: 20px;
    padding: 20px 16px;
  }
  .view-toggle, .view-hint { display: none; }

  /* ===== COMPACT TABLE ON PC ===== */
  .quiniela-table th {
    padding: 6px 8px;
    font-size: 10px;
  }
  .quiniela-table td {
    padding: 5px 7px;
    font-size: 12px;
  }
  .quiniela-table .col-num {
    width: 30px;
    min-width: 24px;
  }
  .quiniela-table th.col-partido {
    padding: 6px 4px;
    max-width: 36px;
  }
  .quiniela-table td.col-name {
    max-width: 140px;
    min-width: 100px;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .quiniela-table .th-match {
    font-size: 8px;
  }
  .quiniela-table .th-score {
    font-size: 9px;
  }
  .quiniela-table .col-name {
    font-size: 12px;
  }
  .quiniela-table .col-pos {
    font-size: 12px;
  }
  .quiniela-table .col-total {
    font-size: 14px;
  }
  .quiniela-table thead .col-total {
    font-size: 11px;
  }
  .quiniela-table tbody .col-subtotal {
    font-size: 12px;
    min-width: 42px;
  }
  .quiniela-table th.col-subtotal {
    font-size: 10px;
    min-width: 42px;
  }
  .top-1 .col-pos {
    font-size: 14px !important;
  }
  .top-2 .col-pos {
    font-size: 13px !important;
  }
  .top-3 .col-pos {
    font-size: 13px !important;
  }
  .quiniela-table th.col-group-label {
    font-size: 9px;
    padding: 4px 8px;
  }
  .quiniela-table tbody tr.top {
    border-left-width: 2px;
  }
  .quiniela-table tbody .col-total {
    min-width: 42px;
  }
  .quiniela-table thead .col-num.col-total {
    min-width: 42px;
  }
}

/* ===== RESPONSIVE: TABLET (≤1024) ===== */
@media (max-width: 1024px) {
  .header-left h1 { font-size: 22px; }
  .container { margin: 16px; padding: 22px; }
  .quiniela-table { min-width: 500px; }
  .quiniela-table th { padding: 8px 8px; font-size: 11px; }
  .quiniela-table td { padding: 6px 7px; font-size: 13px; }
  .col-name { min-width: 110px; }
  .logo-placeholder { width: 38px; height: 48px; border-radius: 8px; }
  .logo-placeholder svg { width: 30px; height: 40px; }
}

/* ===== RESPONSIVE: MOBILE (≤767) ===== */
@media (max-width: 767px) {
  body:not(.admin-page) { background-image: none; }
  body:not(.admin-page)::before, body:not(.admin-page)::after { opacity: 0.4; }

  .container { padding: 16px; margin: 12px; border-radius: 12px; }

  /* ---- HEADER: 2-row grid layout ---- */
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 4px 6px;
    align-items: center;
    padding: 10px 16px 8px;
  }
  .header-left { display: contents; }
  .header-right { display: contents; }

  .header-left h1 {
    grid-column: 1 / 3; grid-row: 1;
    font-size: 17px; line-height: 1.2;
  }
  .logo-placeholder {
    grid-column: 3; grid-row: 1;
    justify-self: end;
    width: 34px; height: 42px; border-radius: 7px;
  }
  .logo-placeholder svg { width: 26px; height: 36px; }
  .logo-placeholder::after { width: 6px; height: 6px; top: -2px; right: -2px; }

  .header-sub {
    grid-column: 1; grid-row: 2;
    font-size: 11px; gap: 4px;
  }
  .header-link {
    grid-column: 2; grid-row: 2;
    justify-self: end;
    font-size: 11px; padding: 3px 12px; border-radius: 16px;
  }
  .admin-link {
    grid-column: 3; grid-row: 2;
    justify-self: end;
    width: 28px; height: 28px;
  }
  .admin-link svg { width: 13px; height: 13px; }

  /* ---- CHIPS: scroll horizontal con padding ---- */
  .summary-strip {
    margin: 0 0 16px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 8px 12px;
    scrollbar-width: none;
  }
  .summary-strip::-webkit-scrollbar { display: none; }
  .summary-pill {
    flex: 0 0 auto; height: 34px;
    padding: 6px 12px; font-size: 12px;
  }
  .summary-pill strong { font-size: 13px; }
  .summary-pill .pill-icon { font-size: 13px; }

  /* ---- JORNADA TABS ---- */
  .jornada-tabs { margin-bottom: 14px; }
  .tabs-group {
    gap: 4px; flex-wrap: nowrap; overflow-x: auto;
    padding: 0 0 4px; scrollbar-width: none;
  }
  .tabs-group::-webkit-scrollbar { display: none; }
  .jornada-tab { padding: 5px 14px; font-size: 12px; flex-shrink: 0; }

  /* Hide decorative blobs */
  .header-left::before, .header-inner::before, .header-inner::after,
  .header-shape, .header-shape::before, .header-shape::after,
  .site-header::before, .site-header::after,
  .summary-strip::before, .summary-strip::after,
  .table-wrapper::before, .tabs-wrapper::before, .tabs-wrapper::after,
  .site-footer::before { display: none; }
  .view-toggle, .view-hint { display: none; }

  /* ===== MOBILE CARD LAYOUT ===== */
  .table-wrapper {
    margin-left: 0; margin-right: 0;
    width: 100%; border-radius: 0;
    overflow: visible; box-shadow: none;
  }
  .quiniela-table thead { display: none; }
  .quiniela-table,
  .quiniela-table tbody {
    display: block; width: 100%;
  }
  .quiniela-table tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    align-items: center;

    margin-bottom: 10px; padding: 12px 14px;
    background: #F8FAF8;
    border-radius: 10px;
    border: 1px solid #D8E3DA;
    box-shadow: 0 1px 6px rgba(0,76,63,0.06);
  }
  .quiniela-table tbody tr:last-child { margin-bottom: 0; }
  .quiniela-table tbody tr:hover { background: #F8FAF8; }

  .quiniela-table tbody td {
    border: none; padding: 0; line-height: 1.3;
    text-align: left;
  }

  /* Position-colored left border (override card border) */
  .quiniela-table tbody tr.top-1 { border-left: 3px solid #D4AF37; }
  .quiniela-table tbody tr.top-2 { border-left: 3px solid #999; }
  .quiniela-table tbody tr.top-3 { border-left: 3px solid #CD7F32; }

  /* ---- ROW 1: position · name · total ---- */
  .col-pos {
    grid-column: 1; grid-row: 1;
    width: auto !important; min-width: auto !important;
    font-size: 16px !important; font-weight: 900;
    color: var(--texto2); line-height: 1;
  }
  .top-1 .col-pos { color: #D4AF37 !important; font-size: 17px !important; }
  .top-2 .col-pos { color: #999 !important; font-size: 16px !important; }
  .top-3 .col-pos { color: #CD7F32 !important; font-size: 15px !important; }

  .col-name {
    grid-column: 2; grid-row: 1;
    display: block !important;
    font-size: 15px; font-weight: 800;
    padding: 0 !important; min-width: auto !important;
    color: var(--texto-principal);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: pointer;
  }
  .col-name:hover { text-decoration: underline; }

  .col-total {
    grid-column: 3; grid-row: 1;
    justify-self: end;
    display: block !important;
    font-size: 16px !important; font-weight: 900;
    background: none !important; color: #00A650 !important;
    white-space: nowrap;
  }

  /* ---- ROW 2: match carousel · ver detalle pill ---- */
  .col-subtotal { display: none !important; }

  .match-carousel {
    grid-column: 1 / 3; grid-row: 2;
    position: relative; height: 24px;
    overflow: hidden;
    background: #EEF3EF; border-radius: 5px;
  }
  .match-carousel-item {
    position: absolute; top: 0; left: 0; right: 0;
    height: 24px; line-height: 24px;
    padding: 0 8px;
    font-size: 11px; font-weight: 600; color: #26352F;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transition: opacity 0.6s ease;
    pointer-events: none;
  }
  .match-carousel-item.active {
    opacity: 1; pointer-events: auto;
  }
  .match-carousel-empty {
    position: absolute; top: 0; left: 0; right: 0;
    height: 24px; line-height: 24px;
    text-align: center;
    font-size: 11px; font-weight: 500; color: #888;
  }

  /* Ver detalle via tr::after (small pill, right-aligned) */
  .quiniela-table tbody tr::after {
    content: 'Ver detalle';
    grid-column: 3; grid-row: 2;
    justify-self: end;
    display: inline-block;
    padding: 4px 10px;
    background: #004C3F;
    color: #fff;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    text-align: center;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Hide old ::after on name */
  .col-name-clickable { text-decoration: none; }
  .col-name-clickable::after { display: none !important; }

  /* Hide match cells in regular jornada view */
  .quiniela-table:not(.is-todas) tbody td.col-num:not(.col-subtotal):not(.col-total) {
    display: none !important;
  }

  /* ---- TODAS VIEW: float-based layout (grid can't flow badges inline) ---- */
  .quiniela-table.is-todas tbody tr {
    display: block;
    padding: 12px 14px 8px;
  }
  .quiniela-table.is-todas tbody td {
    display: inline;
  }
  .quiniela-table.is-todas .col-pos {
    display: inline !important;
    font-size: 16px !important;
    margin-right: 4px;
  }
  .quiniela-table.is-todas .col-total {
    display: inline !important;
    float: right;
    font-size: 16px !important;
    font-weight: 900;
    background: none !important;
    color: #00A650 !important;
  }
  .quiniela-table.is-todas .col-name {
    display: block !important;
    font-size: 15px; font-weight: 800;
    margin: 2px 0 6px;
    padding: 0 !important;
    color: var(--texto-principal);
    clear: both;
  }
  .quiniela-table.is-todas .match-carousel {
    display: block; clear: both;
    margin: 6px 0 4px;
    position: relative; height: 24px;
    overflow: hidden;
    background: #EEF3EF; border-radius: 5px;
  }
  .quiniela-table.is-todas .match-carousel-item {
    position: absolute; top: 0; left: 0; right: 0;
    height: 24px; line-height: 24px;
    padding: 0 8px;
    font-size: 11px; font-weight: 600; color: #26352F;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transition: opacity 0.6s ease;
    pointer-events: none;
  }
  .quiniela-table.is-todas .match-carousel-item.active {
    opacity: 1; pointer-events: auto;
  }
  .quiniela-table.is-todas .match-carousel-empty {
    position: absolute; top: 0; left: 0; right: 0;
    height: 24px; line-height: 24px;
    text-align: center;
    font-size: 11px; font-weight: 500; color: #888;
  }
  .quiniela-table.is-todas tbody td.col-subtotal { display: none !important; }
  .quiniela-table.is-todas tbody td.col-num:not(.col-subtotal):not(.col-total) {
    display: inline-block !important;
    background: #EEF3EF !important;
    color: #26352F !important;
    padding: 2px 8px !important;
    border-radius: 6px;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin: 0 4px 4px 0;
    width: auto !important; min-width: auto !important;
    border: none !important; line-height: 1.4;
  }
  .quiniela-table.is-todas tbody tr::after {
    content: 'Ver detalle';
    display: inline-block;
    padding: 3px 10px;
    background: #004C3F;
    color: #fff;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    margin-left: 6px;
  }

  .admin-nav-inner { padding: 0 10px; gap: 4px; min-height: 44px; }
  .admin-nav-links a { font-size: 11px; padding: 5px 7px; }
  .admin-container { padding: 14px 10px; }
  .admin-container h1 { font-size: 18px; }
  .admin-card { padding: 14px; }
  .admin-card h2 { font-size: 15px; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-card { padding: 10px 12px; }
  .dash-num { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-inline { gap: 4px; }
  .form-inline input { font-size: 13px; }
  .modal-content { max-height: 85vh; border-radius: 14px; }
  .modal-header { padding: 16px 18px 0; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 10px 16px 18px; }

  /* ===== MOBILE MODAL: LIST VIEW ===== */
  .modal-table, .modal-table thead, .modal-table tbody,
  .modal-table tr, .modal-table th, .modal-table td {
    display: block;
  }
  .modal-table thead { display: none; }
  .modal-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--soft-border);
  }
  .modal-table tr:last-child { border-bottom: none; }
  .modal-table td {
    padding: 2px 0;
    text-align: left; border: none;
  }
  .modal-table td.m-name {
    font-size: 14px; font-weight: 700;
    margin-bottom: 4px;
  }
  .modal-table td:not(.m-name) {
    display: inline-block;
    font-size: 12px;
    margin-right: 14px;
  }
  .modal-table td.m-pred::before { content: 'Pronóstico: '; font-weight: 600; color: var(--texto2); }
  .modal-table td.m-real::before { content: 'Real: '; font-weight: 600; color: var(--texto2); }
  .modal-table td.m-pts::before { content: 'Puntos: '; font-weight: 600; color: var(--texto2); }
  /* Subtotal row with colspan */
  .modal-table td[colspan] {
    display: inline;
    font-weight: 800; color: var(--texto2);
    text-align: left !important;
  }
  .modal-table td[colspan] + td {
    display: inline;
    margin-left: 4px;
    font-weight: 900; color: #3CAC3B;
  }
}

/* ===== BRACKET TREE (shared admin + public) ===== */
.bracket-scroll{overflow-x:auto;overflow-y:visible;text-align:center;padding:2px 30px;-webkit-overflow-scrolling:touch;}
.bracket-tree{display:inline-flex;text-align:left;align-items:stretch;gap:8px;}
.bracket-wing-left{display:flex;flex-direction:row;align-items:stretch;gap:3px;}
.bracket-wing-center{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:0 12px;flex-shrink:0;}
.bracket-wing-right{display:flex;flex-direction:row;align-items:stretch;gap:3px;}
.bracket-col{display:flex;flex-direction:column;min-width:170px;flex:1 0 170px;padding:0 4px;}
.bracket-col .round-header{font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.4px;color:var(--texto2);padding:4px 6px;margin-bottom:2px;border-bottom:2px solid #ddd;text-align:center;flex-shrink:0;}
.bracket-col .round-header.activa{color:var(--azul);border-bottom-color:var(--azul);}
.bracket-col-final{min-width:200px;width:220px;flex:0 0 auto;}
.bracket-col-final .round-header.final{color:goldenrod;border-bottom-color:goldenrod;border-bottom-width:3px;}
.bracket-col-final .bcard{border-color:goldenrod;border-width:2px;min-height:36px;}
.match-slot{flex:1;display:flex;flex-direction:column;justify-content:center;position:relative;min-height:0;}
.bcard{background:#fff;border:1px solid #e0e0e0;border-radius:5px;padding:3px 6px;font-size:11px;min-height:32px;display:flex;flex-direction:column;justify-content:center;position:relative;}
.bcard:hover{box-shadow:0 1px 4px rgba(0,0,0,.08);}
.bcard .bcard-title{font-size:7px;font-weight:800;text-transform:uppercase;color:#aaa;margin-bottom:1px;letter-spacing:.2px;line-height:1.2;}
.bcard .team-row{display:flex;align-items:center;gap:2px;padding:1px 0;line-height:1.2;}
.bcard .team-row .flag{font-size:10px;width:12px;text-align:center;flex-shrink:0;line-height:1;}
.bcard .team-row .tname{flex:1;font-weight:600;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2;}
.bcard .team-row .tname.empty{color:#bbb;font-weight:400;font-style:italic;}
.bcard .team-row .tname.placeholder{color:#888;font-weight:500;}
.bcard .team-row .tscore{width:18px;text-align:center;font-weight:700;font-size:9px;flex-shrink:0;}
.bcard .bcard-winner{font-size:8px;font-weight:700;color:#2a7d2a;text-align:center;margin-top:1px;line-height:1.2;}
.tie-type{font-size:7px;font-weight:400;color:#888;}
.bcard .bcard-pend{font-size:8px;color:#999;text-align:center;font-style:italic;line-height:1.2;}
.bracket-wing-left .bracket-col:not(:last-child) .match-slot::after{content:'';position:absolute;right:-3px;top:50%;width:3px;height:1.5px;background:#ccc;z-index:1;pointer-events:none;}
.bracket-wing-left .bracket-col:not(:last-child) .match-slot:nth-child(odd)::before{content:'';position:absolute;right:-3px;top:50%;width:1.5px;height:calc(50% + 1px);background:#ccc;z-index:1;pointer-events:none;}
.bracket-wing-left .bracket-col:not(:last-child) .match-slot:nth-child(even)::before{content:'';position:absolute;right:-3px;bottom:50%;width:1.5px;height:calc(50% + 1px);background:#ccc;z-index:1;pointer-events:none;}
.bracket-wing-right .bracket-col:not(:first-child) .match-slot::after{content:'';position:absolute;left:-3px;top:50%;width:3px;height:1.5px;background:#ccc;z-index:1;pointer-events:none;}
.bracket-wing-right .bracket-col:not(:first-child) .match-slot:nth-child(odd)::before{content:'';position:absolute;left:-3px;top:50%;width:1.5px;height:calc(50% + 1px);background:#ccc;z-index:1;pointer-events:none;}
.bracket-wing-right .bracket-col:not(:first-child) .match-slot:nth-child(even)::before{content:'';position:absolute;left:-3px;bottom:50%;width:1.5px;height:calc(50% + 1px);background:#ccc;z-index:1;pointer-events:none;}
.bracket-tercer{display:flex;flex-direction:column;align-items:center;}
.bracket-tercer .round-header{font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.3px;color:#8B4513;padding:3px 5px;margin-bottom:1px;border-bottom:1.5px solid #8B4513;text-align:center;}
.bracket-tercer .match-slot{flex:0 0 auto;max-width:175px;width:100%;}
.bracket-tercer .bcard-tercer{min-height:26px;padding:2px 5px;border-color:#d4a373;}
.bracket-tercer .bcard-tercer .bcard-title{font-size:6px;}
.bracket-tercer .bcard-tercer .team-row .flag{font-size:8px;width:10px;}
.bracket-tercer .bcard-tercer .team-row .tname{font-size:8px;}
.bracket-tercer .bcard-tercer .team-row .tscore{width:14px;font-size:7px;}
.bracket-tercer .bcard-tercer .bcard-winner{font-size:7px;}
.bracket-form{display:contents;}

/* ===== BRACKET RESPONSIVE ===== */
.bracket-desktop{display:block;}
.bracket-mobile{display:none;}

@media (max-width: 767px) {
  .bracket-desktop{display:none;}
  .bracket-mobile{display:block;padding:0 4px;}
  .mround-section{margin-bottom:10px;}
  .mround-title{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.5px;color:var(--texto2);padding:6px 8px;margin-bottom:4px;border-bottom:2px solid #ddd;text-align:center;}
  .mround-final .mround-title{color:goldenrod;border-bottom-color:goldenrod;font-size:13px;}
  .mround-tercer .mround-title{color:#8B4513;border-bottom-color:#8B4513;font-size:10px;}
  .mcard{background:#fff;border:1px solid #e0e0e0;border-radius:6px;padding:6px 10px;margin-bottom:5px;}
  .mcard-label{font-size:8px;font-weight:800;text-transform:uppercase;color:#aaa;margin-bottom:3px;letter-spacing:.3px;}
  .mcard-row{display:flex;align-items:center;gap:6px;padding:2px 0;}
  .mcard-row .flag{font-size:16px;width:22px;text-align:center;flex-shrink:0;}
  .mcard-name{flex:1;font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mcard-name.empty{color:#bbb;font-weight:400;font-style:italic;}
  .mcard-score{width:26px;text-align:center;font-weight:800;font-size:14px;flex-shrink:0;}
  .mcard-footer{font-size:10px;font-weight:700;color:#2a7d2a;text-align:center;margin-top:3px;padding-top:3px;border-top:1px solid #eee;}
  .mcard-footer.pend{color:#999;font-weight:400;font-style:italic;}
  .mcard-final{border-color:goldenrod;border-width:2px;}
  .mcard-final .mcard-label{color:goldenrod;font-size:9px;}
  .mcard-tercer{border-color:#d4a373;background:#fefaf5;}
  .mcard-tercer .mcard-label{color:#8B4513;font-size:7px;}
  .mcard-tercer .mcard-row .flag{font-size:13px;width:18px;}
  .mcard-tercer .mcard-name{font-size:11px;}
  .mcard-tercer .mcard-score{font-size:12px;width:22px;}
}

/* ===== RESPONSIVE: SMALL (≤480) ===== */
@media (max-width: 480px) {
  .header-inner { padding: 10px 12px; }
  .header-inner::before, .header-inner::after { display: none; }
  .header-left h1 { font-size: 17px; }
  .header-sub { font-size: 11px; }
  .container { padding: 12px; margin: 8px; border-radius: 10px; }
  .logo-placeholder { width: 32px; height: 40px; border-radius: 6px; }
  .logo-placeholder svg { width: 24px; height: 32px; }
  .logo-placeholder::after { display: none; }
  .summary-strip { margin: 0 0 12px; gap: 5px; padding-bottom: 10px; }
  .summary-pill { flex: 0 0 auto; height: 34px; padding: 5px 10px; font-size: 11px; }
  .summary-pill strong { font-size: 13px; }
  .summary-pill .pill-icon { font-size: 12px; }
  .quiniela-table tbody tr { padding: 10px 12px; }
  .col-name { font-size: 14px; }
  .col-pos { font-size: 14px !important; }
  .top-1 .col-pos { font-size: 15px !important; }
  .col-total { font-size: 14px !important; }
  .match-carousel { height: 20px; }
  .match-carousel-item, .match-carousel-empty { height: 20px; line-height: 20px; font-size: 10px; }
  .quiniela-table tbody tr::after { font-size: 10px; padding: 3px 8px; }
}
