/* ==========================================================================
   Componentes, módulos y comportamiento responsive
   ========================================================================== */

/* -------------------------------- Botones -------------------------------- */

.btn {
  --btn-bg: transparent;
  --btn-border: var(--line-strong);
  --btn-color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--btn-border);
  border-radius: 9px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), opacity 0.18s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  --btn-bg: linear-gradient(180deg, var(--brand), var(--brand-strong));
  --btn-border: rgba(var(--brand-light-rgb), 0.6);
  --btn-color: var(--on-brand);
  box-shadow: 0 10px 24px -12px rgba(var(--brand-deep-rgb), 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
  --btn-bg: linear-gradient(180deg, var(--brand-strong), var(--brand-deep));
}

.btn-ghost {
  --btn-bg: rgba(148, 163, 184, 0.06);
}

.btn-ghost:hover {
  --btn-bg: rgba(148, 163, 184, 0.12);
  --btn-border: var(--line-strong);
}

.btn-quiet {
  --btn-border: transparent;
  --btn-bg: transparent;
  color: var(--muted);
}

.btn-quiet:hover {
  --btn-bg: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.btn-danger {
  --btn-bg: rgba(239, 68, 68, 0.12);
  --btn-border: rgba(239, 68, 68, 0.4);
  --btn-color: #fca5a5;
}

.btn-danger:hover {
  --btn-bg: rgba(239, 68, 68, 0.2);
}

.btn-success {
  --btn-bg: rgba(34, 197, 94, 0.13);
  --btn-border: rgba(34, 197, 94, 0.4);
  --btn-color: #86efac;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 10.5px;
  border-radius: 7px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.link:hover {
  color: var(--brand-lighter);
}

/* ------------------------------- Secciones ------------------------------- */

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 22px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.section-head h2::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-deep));
  box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.5);
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 72ch;
}

.section-head .head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------- Cards --------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(19, 30, 51, 0.92), rgba(12, 19, 33, 0.94));
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.card-head h3 .icon {
  color: var(--brand);
}

.card-body {
  padding: 16px 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.split-even {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* -------------------------------- Badges --------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-soft);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge .icon {
  width: 12px;
  height: 12px;
}

.badge-brand {
  background: var(--brand-soft);
  border-color: rgba(var(--brand-rgb), 0.35);
  color: var(--brand-pale);
}

.badge-win {
  background: var(--win-soft);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.badge-draw {
  background: var(--draw-soft);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.badge-loss {
  background: var(--loss-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.badge-gold {
  background: rgba(245, 196, 81, 0.12);
  border-color: rgba(245, 196, 81, 0.4);
  color: var(--gold);
}

.badge-neutral {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

/* --------------------------------- Chips ---------------------------------- */

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.18s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-active {
  background: var(--brand-soft);
  border-color: rgba(var(--brand-rgb), 0.45);
  color: var(--brand-pale);
}

.chip .icon {
  width: 14px;
  height: 14px;
}

/* -------------------------------- Tablas --------------------------------- */

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 25, 42, 0.95), rgba(7, 22, 38, 0.97));
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 8px;
  background: #0c1526;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

table.data thead th.col-team {
  text-align: left;
  padding-left: 14px;
}

table.data tbody td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

table.data tbody td.col-team {
  text-align: left;
  padding-left: 14px;
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr {
  transition: background 0.16s var(--ease);
}

table.data tbody tr:hover {
  background: rgba(var(--brand-rgb), 0.055);
}

table.data tr.is-qualified td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

table.data tr.is-qualified {
  background: linear-gradient(90deg, rgba(var(--brand-rgb), 0.06), transparent 45%);
}

table.data tr.is-champion {
  background: linear-gradient(90deg, rgba(245, 196, 81, 0.08), transparent 50%);
}

table.data tr.is-champion td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}

table.data tr.is-cutline td {
  border-bottom: 2px solid rgba(var(--brand-rgb), 0.38);
}

.pos-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 900;
}

tr.is-qualified .pos-badge {
  background: rgba(var(--brand-rgb), 0.16);
  border-color: rgba(var(--brand-rgb), 0.4);
  color: var(--brand-pale);
}

tr.is-champion .pos-badge {
  background: rgba(245, 196, 81, 0.14);
  border-color: rgba(245, 196, 81, 0.45);
  color: var(--gold);
}

.pts {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.dg-plus {
  color: #86efac;
}

.dg-minus {
  color: #fca5a5;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.team-dot {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: var(--dot, var(--brand));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  --crest-a: var(--team, var(--brand));
  --crest-b: #111827;
}

.team-cell-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-cell-name b {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-cell-name span {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-pills {
  display: inline-flex;
  gap: 3px;
}

.form-pill {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  color: #06121e;
}

.form-pill.w {
  background: var(--win);
}

.form-pill.d {
  background: var(--draw);
}

.form-pill.l {
  background: var(--loss);
  color: #fff;
}

.form-pill.empty,
.form-pill.is-empty {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted-2);
}

.qualified-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(var(--brand-rgb), 0.15);
  color: var(--brand-lighter);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ------------------------------ Partidos ---------------------------------- */

.matchday-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matchday-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
  flex-wrap: wrap;
}

.matchday-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.matchday-number {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--brand-soft);
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  color: var(--brand-pale);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.matchday-title h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.matchday-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.leg-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  border-radius: var(--radius-full);
  background: rgba(var(--brand-rgb), 0.14);
  color: var(--brand-pale);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.bye-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 11px;
  border: 1px dashed rgba(var(--brand-rgb), 0.35);
  border-radius: 10px;
  background: rgba(var(--brand-rgb), 0.07);
  font-size: 12px;
}

.bye-team-dot {
  width: 20px;
  height: 22px;
  flex: none;
  border-radius: 5px 5px 8px 8px;
  background: var(--dot, var(--brand));
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.bye-row b {
  font-size: 12px;
}

.match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 24, 41, 0.66);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.match-cards {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 197, 255, 0.13);
}

.match-cards-side {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.match-cards-side.away {
  margin-left: auto;
  justify-content: flex-end;
}

.match-cards-team {
  margin-right: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-card-icon {
  width: 18px;
  height: 22px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 2px;
  color: #111827;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.match-card-icon--yellow {
  background: linear-gradient(145deg, #fde047, #facc15 60%, #eab308);
  color: #1f2937;
}

.match-card-icon--red {
  background: linear-gradient(145deg, #f87171, #ef4444 60%, #dc2626);
  color: #fff;
}

.card-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.card-count b {
  color: var(--text);
  font-size: 12px;
}

.kpi-label .match-card-icon,
th .match-card-icon {
  display: inline-grid;
  vertical-align: -4px;
  width: 12px;
  height: 15px;
  margin-right: 3px;
  font-size: 0;
}

.match:hover {
  border-color: var(--line-strong);
  background: rgba(16, 36, 58, 0.82);
}

.match-team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.match-team.away {
  justify-content: flex-end;
  text-align: right;
}

.match-team .team-cell-name b {
  font-size: 13px;
}

.match-team.away .team-cell-name {
  align-items: flex-end;
}

.score-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #08101e;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.02em;
}

.score-box .sep {
  color: var(--muted-2);
  font-weight: 400;
}

.score-box.is-pending {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-style: dashed;
  min-width: 64px;
}

.score-box .pens {
  display: block;
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.04em;
  font-family: var(--font);
  font-weight: 800;
  text-align: center;
  margin-top: 1px;
}

.match-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.match-status {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}

.match-status.win {
  color: var(--win);
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* -------------------------- Próxima jornada (hero) ------------------------ */

.next-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(8, 14, 25, 0.55);
  padding: 12px;
}

.next-card .label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.next-card .when {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.next-card .when > span {
  white-space: nowrap;
}

.next-card .when small {
  max-width: 150px;
  margin-top: 1px;
  text-align: right;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.next-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.next-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 24, 41, 0.72);
  border: 1px solid var(--line);
  font-size: 10.5px;
}

.next-row .n-team {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
}

.next-row .n-team.away {
  justify-content: flex-end;
  text-align: right;
}

.next-row .n-vs {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.next-bye {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-strong);
  font-size: 11px;
  color: var(--text-soft);
}

.next-bye b {
  color: #fff;
  font-size: 11px;
}

.mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
  background: var(--dot, var(--brand));
}

/* ------------------------------- Equipos ---------------------------------- */

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

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(16, 36, 58, 0.92), rgba(7, 22, 38, 0.96));
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.team-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--team, var(--brand));
  opacity: 0.9;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.team-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 54px;
}

.team-card-position {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}

.team-card-position span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.team-card-position b {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.team-crest {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--team, var(--brand)) 22%, #071626);
  border: 1px solid color-mix(in srgb, var(--team, var(--brand)) 55%, transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --crest-a: var(--team, var(--brand));
  --crest-b: #111827;
}

.crest-initials {
  display: grid;
  place-items: center;
}

[class*="crest-pattern--"] .crest-initials {
  padding: 1px 3px;
  border-radius: 4px;
  background: rgba(4, 16, 29, 0.62);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

[class*="crest-pattern--"] {
  border-color: rgba(148, 197, 255, 0.3);
}

.team-dot[class*="crest-pattern--"] {
  box-shadow:
    inset 0 0 0 1px rgba(4, 16, 29, 0.35),
    0 0 0 1px rgba(148, 197, 255, 0.14);
}

/* Identidad de los equipos: patrones configurables desde el color del equipo. */
.crest-pattern--morelia {
  background: linear-gradient(
    135deg,
    var(--crest-a) 0 43%,
    var(--crest-b) 43% 57%,
    var(--crest-a) 57% 100%
  );
}

.crest-pattern--inter {
  background: repeating-linear-gradient(90deg, var(--crest-a) 0 25%, var(--crest-b) 25% 50%);
}

.crest-pattern--atlas {
  background: linear-gradient(90deg, var(--crest-a) 0 50%, var(--crest-b) 50% 100%);
}

.crest-pattern--italia,
.crest-pattern--umac,
.crest-pattern--presa-a,
.crest-pattern--iglesias,
.crest-pattern--imperio,
.crest-pattern--leon,
.crest-pattern--mexico-70,
.crest-pattern--resto {
  background: var(--crest-a);
}

.crest-pattern--presa-b {
  background: linear-gradient(90deg, var(--crest-a) 0 62%, var(--crest-b) 62% 100%);
}

.crest-pattern--potrero {
  background: repeating-linear-gradient(90deg, var(--crest-a) 0 25%, var(--crest-b) 25% 50%);
}

.crest-pattern--mikihuana {
  background: repeating-linear-gradient(90deg, var(--crest-a) 0 25%, var(--crest-b) 25% 50%);
}

.crest-pattern--umac,
.crest-pattern--presa-a,
.crest-pattern--presa-b,
.crest-pattern--potrero,
.crest-pattern--resto {
  border-color: rgba(15, 23, 42, 0.35);
}

.team-card h3 {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.team-card .team-sub {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.team-record {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.team-card .team-record {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-record div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-record b {
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.team-record span {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.team-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------ Goleadores -------------------------------- */

.scorers-list {
  display: flex;
  flex-direction: column;
}

.scorer-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.16s var(--ease);
}

.scorer-row:last-child {
  border-bottom: 0;
}

.scorer-row:hover {
  background: rgba(var(--brand-rgb), 0.05);
}

.scorer-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.podium-card {
  padding: 18px;
}

.podium-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.podium-medal {
  --metal: #f5c451;
  --metal-hi: #fff3b0;
  --metal-dark: #8a5a12;
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--metal-hi);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.42), transparent 28%),
    conic-gradient(
      from 12deg,
      var(--metal-dark),
      var(--metal-hi),
      var(--metal),
      var(--metal-hi),
      var(--metal-dark),
      var(--metal),
      var(--metal-hi),
      var(--metal-dark)
    );
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(255, 255, 255, 0.05),
    inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  isolation: isolate;
}

.podium-medal::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #3a3428 0, #15130f 48%, #080706 100%);
  border: 2px solid var(--metal);
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.55);
}

.podium-medal--1 {
  --metal: #f5c451;
  --metal-hi: #fff3b0;
  --metal-dark: #8a5a12;
}

.podium-medal--2 {
  --metal: #cbd5e1;
  --metal-hi: #ffffff;
  --metal-dark: #64748b;
}

.podium-medal--3 {
  --metal: #d08a4a;
  --metal-hi: #ffd7a8;
  --metal-dark: #7c3f16;
}

.medal-ribbon {
  position: absolute;
  top: 3px;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 50px;
  height: 15px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #211b12, #080706 80%);
  color: var(--metal-hi);
  font-size: 5.2px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000;
  clip-path: polygon(0 0, 100% 0, 91% 100%, 50% 82%, 9% 100%);
}

.medal-number {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: var(--metal-hi);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 33px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  text-align: center;
  text-shadow:
    0 2px 0 var(--metal-dark),
    0 4px 7px rgba(0, 0, 0, 0.7);
}

.medal-number sup {
  margin-left: 1px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 9px;
  font-weight: 900;
  vertical-align: top;
  letter-spacing: 0;
}

.medal-stars {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  color: var(--metal);
  font-size: 5.5px;
  letter-spacing: 1.5px;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.medal-laurel {
  position: absolute;
  top: 28px;
  z-index: 2;
  width: 14px;
  height: 30px;
  border: 2px solid var(--metal);
  opacity: 0.9;
}

.medal-laurel--left {
  left: 15px;
  border-right: 0;
  border-radius: 50% 0 0 50%;
  transform: rotate(-13deg);
}

.medal-laurel--right {
  right: 15px;
  border-left: 0;
  border-radius: 0 50% 50% 0;
  transform: rotate(13deg);
}

.medal-laurel::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 2px;
  width: 5px;
  height: 2px;
  border-radius: 50%;
  background: var(--metal);
  box-shadow:
    0 5px 0 var(--metal),
    0 10px 0 var(--metal),
    0 15px 0 var(--metal),
    0 20px 0 var(--metal);
  transform: rotate(-22deg);
}

.medal-laurel--right::before {
  right: -3px;
  left: auto;
  transform: rotate(22deg);
}

.scorer-team-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.scorer-row:nth-child(1) .scorer-rank {
  background: rgba(245, 196, 81, 0.16);
  color: var(--gold);
  border: 1px solid rgba(245, 196, 81, 0.35);
}

.scorer-row:nth-child(2) .scorer-rank,
.scorer-row:nth-child(3) .scorer-rank {
  background: rgba(203, 213, 225, 0.12);
  color: #e2e8f0;
}

.scorer-info {
  min-width: 0;
}

.scorer-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorer-info span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.scorer-goals {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.scorer-goals b {
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.scorer-goals span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ------------------------------ Estadísticas ------------------------------ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.kpi {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(16, 36, 58, 0.88), rgba(7, 22, 38, 0.92));
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent);
  opacity: 0.6;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.kpi-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-value small {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.kpi-foot {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.bar-item .bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 700;
}

.bar-track {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand), var(--brand-light));
  box-shadow: 0 0 14px rgba(var(--brand-rgb), 0.35);
}

.bar-item b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: #fff;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 76px;
  padding-top: 6px;
}

.spark-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--brand-light), var(--brand), rgba(var(--brand-deep-rgb), 0.3));
  min-height: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.spark-value {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.spark-bar--vuelta {
  background: linear-gradient(180deg, #fbbf24, #d97706, rgba(120, 53, 15, 0.45));
}

.leg-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.leg-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
}

.leg-dot--vuelta {
  background: #f59e0b;
}

/* -------------------------------- Liguilla -------------------------------- */

.bracket {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.bracket--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bracket-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-around;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stage-title .count {
  margin-left: auto;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}

.tie {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(170deg, rgba(16, 36, 58, 0.92), rgba(7, 22, 38, 0.95));
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}

.tie:hover {
  border-color: var(--line-strong);
}

.tie-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 14, 25, 0.45);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.tie-head .tie-label {
  color: var(--muted);
}

.tie-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  font-size: 12.5px;
}

.tie-team:last-of-type {
  border-bottom: 0;
}

.tie-team.is-winner {
  background: linear-gradient(90deg, rgba(var(--brand-rgb), 0.09), transparent);
}

.tie-team .t-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tie-team .t-seed {
  min-width: 18px;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted-2);
}

.tie-team .t-score {
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.tie-team .t-score .pen {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.tie-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 25, 0.4);
  font-size: 10px;
  color: var(--muted-2);
}

.tie-foot .legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

.champion-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 196, 81, 0.4);
  background:
    radial-gradient(420px 220px at 80% -20%, rgba(245, 196, 81, 0.22), transparent 60%),
    linear-gradient(150deg, #1b2237, #0d1524);
  display: flex;
  align-items: center;
  gap: 18px;
}

.champion-card .champ-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(245, 196, 81, 0.14);
  border: 1px solid rgba(245, 196, 81, 0.4);
  color: var(--gold);
}

.champion-card h3 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.champion-card .champ-name {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* ------------------------------- Formularios ------------------------------ */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.field-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-hint {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0a1321;
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
  background: #0b1626;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.select option {
  background: #0b1220;
}

/* Los controles dentro de una fila no deben ocupar todo el ancho. */
.row > .select,
.row > .input,
.head-actions > .select,
.head-actions > .input,
.card-head .select,
.card-head .input {
  width: auto;
  flex: 0 0 auto;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0a1321;
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
}

.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form-error {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 12px;
}

.score-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-inputs .input {
  text-align: center;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 900;
  min-height: 58px;
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.radio-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0a1321;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.radio-card input {
  margin-top: 2px;
  accent-color: var(--brand);
}

.radio-card:has(input:checked) {
  border-color: rgba(var(--brand-rgb), 0.55);
  background: rgba(var(--brand-rgb), 0.09);
}

.radio-card b {
  display: block;
  font-size: 12.5px;
}

.radio-card span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  margin-top: 1px;
}

/* -------------------------------- Modales --------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 14, 0.74);
  backdrop-filter: blur(7px);
  animation: fade-in 0.18s var(--ease);
}

.modal {
  width: 100%;
  max-width: 540px;
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(170deg, #111d31, #0a1220);
  box-shadow: var(--shadow-lg);
  animation: rise 0.22s var(--ease);
}

.modal--wide {
  max-width: 760px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.modal-head p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.modal-body {
  padding: 18px 20px;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
}

/* --------------------------------- Toast ---------------------------------- */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 380px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #101b2d;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: rise 0.24s var(--ease);
}

.toast.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: #1c1119;
}

.toast.is-success {
  border-color: rgba(34, 197, 94, 0.4);
  background: #0d1b19;
}

.toast .icon {
  margin-top: 1px;
}

.toast.is-error .icon {
  color: var(--loss);
}

.toast.is-success .icon {
  color: var(--win);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted-2);
  padding: 0;
  line-height: 1;
}

/* ------------------------------ Empty / skeleton -------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 46px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: radial-gradient(520px 200px at 50% 0%, rgba(var(--brand-rgb), 0.07), transparent 70%);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border: 1px solid rgba(var(--brand-rgb), 0.28);
  background: rgba(var(--brand-rgb), 0.1);
  color: var(--brand-lighter);
}

.empty h3 {
  font-size: 16px;
  font-weight: 800;
}

.empty p {
  max-width: 52ch;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.empty .empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.06) 0px,
    rgba(148, 163, 184, 0.13) 120px,
    rgba(148, 163, 184, 0.06) 240px
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
}

.loading-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ------------------------------ Login / acceso ---------------------------- */

.login-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 6px;
}

.login-hero .crest {
  width: 54px;
  height: 58px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 16%, 100% 62%, 50% 100%, 0% 62%, 0% 16%);
  background: linear-gradient(155deg, var(--brand), #0b1220);
  font-weight: 900;
  font-size: 14px;
}

.login-note {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(var(--brand-rgb), 0.08);
  border: 1px solid rgba(var(--brand-rgb), 0.25);
  font-size: 11.5px;
  color: var(--brand-pale);
}

.login-note .icon {
  color: var(--brand);
  margin-top: 1px;
}

/* --------------------------------- Admin ---------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-top: 22px;
}

.admin-side {
  position: sticky;
  top: calc(var(--header-h) + var(--nav-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 20, 35, 0.85);
}

.admin-side .side-label {
  padding: 6px 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.16s var(--ease);
}

.admin-link .icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.admin-link:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.admin-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-pale);
}

.admin-link.is-active .icon {
  color: var(--brand);
  opacity: 1;
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 340px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  width: 15px;
  height: 15px;
}

.search-box .input {
  padding-left: 34px;
  min-height: 38px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(16, 36, 58, 0.88), rgba(7, 22, 38, 0.92));
}

.stat-tile .tile-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-lighter);
}

.stat-tile .tile-value {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat-tile .tile-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(15, 24, 41, 0.7);
  color: var(--text-soft);
  text-align: left;
  transition: all 0.17s var(--ease);
}

.quick-action:hover {
  border-color: rgba(var(--brand-rgb), 0.4);
  background: rgba(var(--brand-rgb), 0.08);
  color: #fff;
  transform: translateY(-1px);
}

.quick-action .qa-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(var(--brand-rgb), 0.14);
  color: var(--brand-lighter);
}

.quick-action b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
}

.quick-action span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row .grow {
  flex: 1;
  min-width: 0;
}

.table-actions {
  display: inline-flex;
  gap: 5px;
  justify-content: flex-end;
}

.empty-inline {
  padding: 22px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
}

/* ------------------------------ Panel: partidos --------------------------- */

.admin-match-list {
  display: flex;
  flex-direction: column;
}

.admin-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.15s var(--ease);
}

.admin-match:hover {
  background: rgba(var(--brand-rgb), 0.045);
}

.admin-match:last-child {
  border-bottom: 0;
}

.am-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.am-team {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-team.away {
  justify-content: flex-end;
  text-align: right;
}

.am-score {
  padding: 3px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #08101e;
  color: #fff;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.am-score.is-pending {
  padding: 5px 0;
  border-style: dashed;
  color: var(--muted-2);
  font-family: var(--font);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.am-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 84px;
}

.am-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --------------------------- Selector de equipos -------------------------- */

.team-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 11, 20, 0.4);
}

.team-pick {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 19, 33, 0.7);
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.team-pick input {
  accent-color: var(--brand);
  flex: none;
}

.team-pick:has(input:checked) {
  border-color: rgba(var(--brand-rgb), 0.45);
  background: rgba(var(--brand-rgb), 0.09);
}

.team-pick:has(input:disabled) {
  opacity: 0.7;
  cursor: default;
}

.team-pick input:disabled {
  cursor: default;
}

.team-pick span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------- Editor de goles ---------------------------- */

.goal-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-row {
  display: grid;
  grid-template-columns: 100px 86px 72px 112px 34px;
  gap: 6px;
  align-items: center;
}

.goal-row .select,
.goal-row .input {
  min-height: 36px;
  font-size: 12px;
  padding-block: 6px;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Evita que tablas y tarjetas ensanchen la página en pantallas pequeñas. */
.card,
.table-wrap,
.stack,
.split,
.split-even,
.grid,
.admin-shell,
.admin-content,
.matchday-block {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
}

/* ------------------------------- Responsive ------------------------------- */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split,
  .split-even {
    grid-template-columns: minmax(0, 1fr);
  }

  .bracket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bracket-stage:last-child {
    grid-column: 1 / -1;
  }

  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }

  .admin-side .side-label {
    display: none;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    text-align: left;
  }

  .footer-legal {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 820px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    padding-inline: 11px;
    font-size: 11px;
  }

  .nav-link .icon {
    display: none;
  }

  .brand-title {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .brand-sub {
    font-size: 8.5px;
    letter-spacing: 0.22em;
  }

  .bracket {
    grid-template-columns: minmax(0, 1fr);
  }

  .hide-md {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 62px;
  }

  body {
    font-size: 14px;
  }

  .header-inner {
    gap: 10px;
  }

  .brand-crest {
    width: 38px;
    height: 42px;
  }

  .brand-logo {
    height: 54px;
  }

  .brand-crest span {
    font-size: 11px;
  }

  .season-select-wrap {
    display: block;
  }

  .season-select-wrap .select {
    max-width: 138px !important;
    min-height: 32px !important;
    font-size: 10.5px !important;
    padding-left: 9px;
    padding-right: 24px;
    background-position: right 8px center;
  }

  .brand-title {
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .brand-sub {
    font-size: 8px;
    letter-spacing: 0.18em;
  }

  .hero {
    margin-top: 14px;
    padding: 20px 18px;
    border-radius: 16px;
  }

  .hero::after {
    font-size: 170px;
    bottom: -60px;
  }

  .hero-title {
    font-size: clamp(26px, 9vw, 36px);
  }

  .hero-sub {
    font-size: 13px;
  }

  .hero-strip {
    gap: 8px;
    margin-top: 20px;
  }

  .hero-stat {
    padding: 10px 11px;
  }

  .hero-stat b {
    font-size: 18px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .hide-sm {
    display: none !important;
  }

  table.data {
    font-size: 12.5px;
  }

  table.data thead th,
  table.data tbody td {
    padding: 9px 6px;
  }

  table.data thead th.col-team,
  table.data tbody td.col-team {
    padding-left: 10px;
  }

  .team-cell-name b {
    font-size: 12.5px;
  }

  .team-cell-name span {
    font-size: 9px;
  }

  .match {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 10px 11px;
    gap: 7px;
  }

  .match-team .team-cell-name span {
    display: none;
  }

  .score-box {
    min-width: 58px;
    font-size: 15px;
    padding: 3px 6px;
  }

  .teams-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scorer-row {
    padding: 11px 12px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .scorer-rank {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .scorer-goals b {
    font-size: 19px;
  }

  .modal {
    max-height: 88vh;
    border-radius: 14px;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-inline: 16px;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .card-head > .row {
    width: 100%;
    justify-content: space-between;
  }

  .toast-root {
    left: 12px;
    right: 12px;
    max-width: none;
    bottom: 12px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head h2 {
    font-size: 17px;
  }

  .admin-side {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .admin-link {
    white-space: nowrap;
    font-size: 11.5px;
  }

  .admin-link .icon {
    display: none;
  }

  .admin-match {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .am-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .am-actions {
    justify-content: flex-start;
  }

  .goal-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .goal-row [data-goal-team] {
    grid-column: 1;
    grid-row: 1;
  }

  .goal-row [data-goal-shirt] {
    grid-column: 2;
    grid-row: 1;
  }

  .goal-row [data-goal-minute] {
    grid-column: 1;
    grid-row: 2;
  }

  .goal-row [data-goal-kind] {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .goal-row [data-remove-goal] {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .goal-row [data-card-team] {
    grid-column: 1;
    grid-row: 1;
  }

  .goal-row [data-card-shirt] {
    grid-column: 2;
    grid-row: 1;
  }

  .goal-row [data-card-minute] {
    grid-column: 1;
    grid-row: 2;
  }

  .goal-row [data-card-kind] {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .goal-row [data-remove-card] {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .footer-inner {
    padding-block: 20px;
  }
}

@media (max-width: 400px) {
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hide-xs {
    display: none !important;
  }
}

@page {
  size: letter portrait;
  margin: 8mm 7mm;
}

@media print {
  html,
  body {
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .site-header,
  .site-nav,
  .site-footer,
  .toast-root,
  .no-print,
  .standings-page [data-print] {
    display: none !important;
  }

  .standings-page {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .standings-page *,
  .standings-page *::before,
  .standings-page *::after {
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .standings-page .section-head {
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between;
    gap: 5mm;
    margin: 0 0 3mm !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .standings-page .section-head h2 {
    margin: 0 !important;
    font-size: 17pt !important;
    line-height: 1.05 !important;
    color: #000 !important;
  }

  .standings-page .section-head p {
    margin: 1mm 0 0 !important;
    font-size: 8pt !important;
    line-height: 1.3 !important;
    color: #333 !important;
  }

  .standings-page .hero-kicker {
    margin: 0 0 1.5mm !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    font-size: 7pt !important;
    letter-spacing: 0.1em !important;
    color: #000 !important;
  }

  .standings-page .card {
    margin: 0 0 3mm !important;
    border: 1px solid #555 !important;
    border-radius: 0 !important;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: visible !important;
  }

  .standings-page .card-head {
    padding: 2mm 3mm !important;
    border-bottom: 1px solid #777 !important;
    background: #fff !important;
  }

  .standings-page .card-head h3 {
    font-size: 9pt !important;
    letter-spacing: 0.03em !important;
    color: #000 !important;
  }

  .standings-page .card-body {
    padding: 2mm 3mm !important;
  }

  .standings-page .standings {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 7pt !important;
  }

  .standings-page .table-wrap {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .standings-page .standings thead {
    display: table-header-group !important;
  }

  .standings-page .standings thead th {
    position: static !important;
    padding: 1.4mm 1mm !important;
    border: 1px solid #000 !important;
    background: #e5e5e5 !important;
    color: #000 !important;
    font-size: 6.5pt !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
  }

  .standings-page .hide-sm,
  .standings-page .hide-md {
    display: table-cell !important;
  }

  .standings-page .card-head .badge {
    display: inline-block !important;
    padding: 0.3mm 1mm !important;
    white-space: nowrap !important;
    font-size: 5.5pt !important;
  }

  .standings-page .card-head .badge svg {
    display: none !important;
  }

  .standings-page .row > span[style*="background"] {
    background: #000 !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }

  .standings-page .standings .team-dot {
    display: none !important;
  }

  .standings-page .standings tbody td {
    padding: 1.25mm 1mm !important;
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 7pt !important;
    line-height: 1.1 !important;
  }

  .standings-page .standings tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff !important;
  }

  .standings-page .standings tbody tr.is-qualified,
  .standings-page .standings tbody tr.is-champion,
  .standings-page .standings tbody tr.is-cutline {
    background: #fff !important;
  }

  .standings-page .standings tbody tr.is-cutline td {
    border-top: 2px solid #000 !important;
  }

  .standings-page .standings .col-team {
    width: 34mm !important;
    min-width: 0 !important;
    text-align: left !important;
    padding-left: 1.5mm !important;
  }

  .standings-page .team-cell,
  .standings-page .team-cell-name {
    display: flex !important;
    gap: 1.5mm !important;
    align-items: center !important;
  }

  .standings-page .team-cell-name b {
    color: #000 !important;
    font-size: 7.2pt !important;
    line-height: 1.1 !important;
  }

  .standings-page .team-cell-name span {
    color: #333 !important;
    font-size: 5.8pt !important;
  }

  .standings-page .team-dot,
  .standings-page .team-crest {
    width: 5mm !important;
    height: 5mm !important;
    min-width: 5mm !important;
    border: 1px solid #000 !important;
    border-radius: 1mm !important;
    background: #fff !important;
    filter: grayscale(1) !important;
  }

  .standings-page .crest-initials {
    color: #000 !important;
    font-size: 5pt !important;
    background: transparent !important;
  }

  .standings-page .pos-badge,
  .standings-page .badge,
  .standings-page .qualified-tag {
    display: inline-block !important;
    padding: 0.4mm 1.2mm !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 6pt !important;
    font-weight: 800 !important;
    box-shadow: none !important;
  }

  .standings-page .form-pills,
  .standings-page .form-pill {
    gap: 0.6mm !important;
  }

  .standings-page .form-pill {
    width: 4.2mm !important;
    height: 4.2mm !important;
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 5.5pt !important;
  }

  .standings-page .standings + div,
  .standings-page .card > div:last-child {
    padding: 1.5mm 2mm !important;
    border-top: 1px solid #777 !important;
    font-size: 6.5pt !important;
    line-height: 1.25 !important;
  }

  .standings-page .split,
  .standings-page .split-even {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3mm !important;
    margin: 0 !important;
  }

  .standings-page .split > .card,
  .standings-page .split-even > .card {
    margin: 0 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .standings-page .split .card-body,
  .standings-page .split-even .card-body {
    padding: 2mm !important;
    gap: 2mm !important;
    font-size: 6.8pt !important;
    line-height: 1.3 !important;
  }

  .standings-page .split p,
  .standings-page .split-even p {
    margin: 0 0 1.5mm !important;
  }

  .standings-page .split ol,
  .standings-page .split-even ol {
    margin: 1mm 0 0 !important;
    padding-left: 4mm !important;
    line-height: 1.35 !important;
  }

  .standings-page .split .field-label,
  .standings-page .split-even .field-label {
    font-size: 6pt !important;
    color: #000 !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .card,
  .table-wrap {
    border-color: #ccc;
    background: #fff;
  }
}
