.finales-page {
  background: #f0f2f7;
}

/* ── Barra de progreso del torneo ─────────────────────────────────────────── */
#torneoProgressWrap {
  position: relative;
  background: #092b63;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  overflow: hidden;
}

#torneoProgressBar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #ffb81c 0%, #f59500 100%);
  transition: width 1s ease;
  overflow: hidden;
}

#torneoProgressBar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 50%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { left: -60%; }
  100% { left: 120%; }
}

#torneoProgressLabel {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ── Botón Solo Finales ───────────────────────────────────────────────────── */
.solo-finales-row {
  padding: 4px 0 2px;
}

.solo-finales-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border: 2px solid #ffb81c;
  border-radius: 10px;
  background: transparent;
  color: #ffb81c;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .01em;
}

.solo-finales-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.solo-finales-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,184,28,.08);
}

.solo-finales-btn.active {
  background: #092b63;
  color: #ffb81c;
  border-color: #092b63;
  box-shadow: 0 4px 14px rgba(9,43,99,.3);
}

.finales-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 24px auto 0;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.finales-lock,
.finales-summary,
.finales-metrics,
.finales-toolbar,
.champions-section,
.finales-status,
.time-block {
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(9, 43, 99, .06);
}

.finales-lock {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 42px 24px;
  text-align: center;
}

.finales-lock-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: #ffb81c;
  background: #092b63;
}

.finales-lock-icon svg {
  width: 34px;
  height: 34px;
}

.finales-lock h2,
.finales-summary h2,
.section-head h2 {
  margin: 0;
  color: #092b63;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.finales-lock p,
.finales-summary p {
  margin: 0;
  color: #627086;
  font-size: 15px;
  line-height: 1.5;
}

.finales-kicker {
  margin: 0 0 8px;
  color: #9a6a00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.finales-primary-link,
.finales-actions a,
.finales-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #ffb81c;
  border-radius: 9px;
  color: #092b63;
  background: #fff8e8;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.finales-actions button {
  color: #fff;
  background: #092b63;
  border-color: #092b63;
}

.finales-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 4vw, 34px);
  border-top: 5px solid #ffb81c;
}

.finales-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.finales-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-top: 16px;
}

.finales-metrics div {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  text-align: center;
}

.finales-metrics div + div {
  border-left: 1px solid #d8dee8;
}

.finales-metrics strong {
  color: #092b63;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1;
  font-weight: 850;
}

.finales-metrics span {
  color: #627086;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.champions-section,
.finales-toolbar,
.finales-status,
.finales-content {
  margin-top: 18px;
}

.champions-section {
  padding: 20px;
}

.section-head {
  margin-bottom: 14px;
}

.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.champion-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: #f8faff;
}

.champion-mini img,
.team-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #d8dee8;
  background: #fff;
}

.champion-mini strong,
.champion-mini span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champion-mini strong {
  color: #172033;
  font-size: 14px;
}

.champion-mini span {
  color: #627086;
  font-size: 12px;
  font-weight: 700;
}

.finales-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
  gap: 14px;
  padding: 16px;
}

.finales-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.finales-filter::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1.5px solid #d8dee8;
  border-radius: 999px;
  background: #fff;
  color: #627086;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.active {
  color: #092b63;
  background: #fff8e8;
  border-color: #ffb81c;
}

.finales-toolbar label {
  display: grid;
  gap: 6px;
  color: #627086;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.finales-toolbar input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  padding: 0 12px;
  color: #172033;
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.finales-toolbar input:focus {
  border-color: #ffb81c;
  box-shadow: 0 0 0 3px rgba(255, 184, 28, .18);
}

.finales-status {
  padding: 14px 16px;
  color: #627086;
  font-size: 14px;
  font-weight: 700;
}

.finales-content {
  display: grid;
  gap: 18px;
}

.time-block {
  overflow: hidden;
}

.time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #092b63;
  color: #fff;
}

.time-head strong {
  font-size: 22px;
  line-height: 1;
}

.time-head span {
  color: #c9d7f3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.final-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  padding: 14px;
}

.final-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(9, 43, 99, .05);
}

.final-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px 0;
}

.final-card-header span {
  color: #092b63;
  font-size: 12px;
  font-weight: 850;
}

.final-card-header small {
  color: #9a6a00;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.final-teams {
  display: grid;
  gap: 10px;
  padding: 14px 13px;
}

.final-team-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.final-team-name {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-score {
  color: #092b63;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.final-team-row.loser .final-team-name,
.final-team-row.loser .final-score {
  color: #7a8596;
  font-weight: 600;
}

.final-team-row.winner .team-logo {
  border-color: #ffb81c;
  box-shadow: 0 0 0 2px rgba(255, 184, 28, .28);
}

.final-card-footer {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  color: rgba(255,255,255,.82);
  background: #1356b3;
  font-size: 12px;
  font-weight: 750;
}

.final-card-footer.done {
  background: linear-gradient(135deg, #092b63 0%, #1356b3 100%);
}

.penalty-note {
  color: #ffe7a3;
  font-size: 11px;
}

.final-card-footer strong {
  color: #fff;
  font-size: 13px;
}

.empty-finals {
  padding: 44px 20px;
  color: #627086;
  text-align: center;
}

@media (max-width: 720px) {
  .finales-summary,
  .finales-toolbar {
    grid-template-columns: 1fr;
  }

  .finales-summary {
    display: grid;
  }

  .finales-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .finales-actions a,
  .finales-actions button,
  .finales-primary-link {
    flex: 1;
  }

  .finales-metrics div {
    padding: 14px 10px;
  }

  .final-card-list {
    grid-template-columns: 1fr;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .finales-shell {
    width: min(100% - 18px, 1120px);
    margin-top: 14px;
  }

  .finales-metrics strong {
    font-size: 28px;
  }

  .finales-metrics span {
    font-size: 10px;
  }
}
