@font-face {
  font-family: 'Roboto Condensed';
  src: url('assets/roboto-condensed-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --ink: #111318;
  --muted: #69748a;
  --line: #dce1e7;
  --blue: #0969f8;
  --green: #079b60;
  --red: #e4373f;
  --pending: #7b879b;
  --gutter: clamp(11px, 3.515625vw, 18px);
  --card-pad: clamp(8px, 2.34375vw, 12px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  min-height: 100%;
  background: #edf0f3;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 280px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: #edf0f3;
  font-family: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.app-shell {
  width: 100%;
  max-width: 512px;
  min-height: max(768px, 100dvh);
  margin: 0 auto;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 16%, rgb(255 255 255 / 92%) 0 7%, transparent 38%),
    linear-gradient(180deg, #f9fafb 0%, var(--canvas) 58%, #f7f8fa 100%);
  box-shadow: 0 0 24px rgb(35 45 60 / 7%);
}

.topbar {
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 var(--gutter);
  padding: 5px var(--card-pad) 6px;
  background: rgb(255 255 255 / 94%);
  border-radius: 0 0 9px 9px;
  box-shadow: 0 4px 14px rgb(27 36 49 / 3%);
}

.brand-block {
  min-width: 0;
}

.brand-block h1,
.brand-block p {
  margin: 0;
}

.brand-block h1 {
  font-size: clamp(17px, 4.296875vw, 22px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.025em;
}

.brand-block p {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(9px, 2.1484375vw, 11px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.045em;
}

.top-status {
  height: 24px;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: clamp(8px, 1.953125vw, 10px);
  font-weight: 800;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.top-status.is-live {
  color: #fff;
  background: linear-gradient(180deg, #0baa69, #058b54);
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / 9%);
}

.top-status.is-pending {
  color: #536078;
  background: #e7ebf1;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.top-status.is-live .status-dot {
  background: #fff;
}

.source-state {
  height: 23px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 1px calc(var(--gutter) + var(--card-pad)) 0;
  color: var(--muted);
  font-size: clamp(8px, 1.5625vw, 9px);
  font-weight: 500;
  letter-spacing: 0.045em;
}

.content {
  display: grid;
  gap: 8px;
  padding: 0 var(--gutter);
}

.card {
  overflow: hidden;
  background: rgb(255 255 255 / 78%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgb(35 45 60 / 2.5%);
}

.card h2,
.card h3,
.card p {
  margin: 0;
}

.card h2 {
  font-size: clamp(11px, 2.5390625vw, 13px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.015em;
}

.pulse-card {
  height: 95px;
}

.pulse-heading {
  height: 27px;
  display: flex;
  align-items: flex-start;
  padding: 8px var(--card-pad) 0;
}

.pulse-body {
  height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(116px, 1.24fr) 1px minmax(0, 1fr);
  align-items: center;
  padding: 0 calc(var(--card-pad) + 11px);
}

.vertical-rule {
  width: 1px;
  height: 27px;
  background: var(--line);
}

.league-summary {
  min-width: 0;
}

.league-summary h3 {
  overflow: hidden;
  font-size: clamp(8px, 1.953125vw, 10px);
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-summary p {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 3px;
}

.league-summary strong {
  font-size: clamp(15px, 3.515625vw, 18px);
  font-weight: 900;
  line-height: 0.9;
}

.league-summary span {
  color: var(--muted);
  font-size: clamp(7.5px, 1.7578125vw, 9px);
  font-weight: 700;
  letter-spacing: 0.035em;
}

.league-summary-right {
  text-align: right;
}

.league-summary-right p {
  justify-content: flex-end;
}

.points-tiebreak {
  min-width: 0;
  padding: 0 10px;
  text-align: center;
}

.points-tiebreak > p {
  color: var(--muted);
  font-size: clamp(7.5px, 1.7578125vw, 9px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.points-tiebreak > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 5px;
}

.points-tiebreak strong {
  font-size: clamp(10px, 2.34375vw, 12px);
  font-weight: 800;
  line-height: 1;
}

.pulse-footer {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: clamp(8px, 1.953125vw, 10px);
  font-weight: 600;
  letter-spacing: 0.012em;
  text-align: center;
  white-space: nowrap;
}

.selected-card {
  height: 90px;
}

.selected-heading {
  height: 25px;
  display: flex;
  align-items: flex-start;
  padding: 7px var(--card-pad) 0;
}

.selected-body {
  height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(73px, 0.58fr) 1px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 calc(var(--card-pad) + 38px);
}

.selected-rule {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.selected-team {
  min-width: 0;
  text-align: center;
}

.selected-team > p {
  overflow: hidden;
  font-size: clamp(8.5px, 1.953125vw, 10px);
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-scoreline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 4px;
}

.selected-scoreline > strong {
  font-size: clamp(17px, 3.90625vw, 20px);
  font-weight: 900;
  line-height: 0.9;
}

.score-delta {
  min-width: 34px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px 0;
  border-radius: 999px;
  color: #fff;
  font-size: clamp(9px, 2.1484375vw, 11px);
  font-weight: 850;
  line-height: 1;
}

.score-delta.is-positive {
  background: linear-gradient(180deg, #0dac69, #068e56);
}

.score-delta.is-negative {
  background: linear-gradient(180deg, #ef4850, #d92f37);
}

.score-delta.is-neutral {
  color: #68748a;
  background: #e7ebf0;
}

.selected-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(7.5px, 1.7578125vw, 9px);
  font-weight: 800;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.selected-status.is-live {
  color: var(--green);
}

.selected-status.is-pending {
  color: var(--pending);
}

.selected-status .status-dot {
  width: 6px;
  height: 6px;
}

.outer-chevron,
.podium-list i,
.match-chevron {
  width: 7px;
  height: 7px;
  display: block;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.breakdown-link {
  width: calc(100% - (var(--card-pad) * 2));
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 var(--card-pad);
  padding: 1px 0 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  font-size: clamp(8px, 1.953125vw, 10px);
  font-weight: 800;
  letter-spacing: 0.018em;
  cursor: pointer;
}

.matches-card {
  height: 285px;
}

.matches-heading {
  height: 29px;
  display: flex;
  align-items: flex-start;
  padding: 8px var(--card-pad) 0;
}

.matches-list {
  height: 256px;
  display: grid;
  grid-template-rows: repeat(12, 1fr);
  padding: 0 7px;
}

.match-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 25px minmax(0, 1.55fr) 32px 12px 32px minmax(0, 1.25fr) 84px 10px;
  align-items: center;
  padding: 0 4px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.match-row:first-child {
  border-top: 0;
}

.match-row:hover,
.match-row:focus-visible {
  background: rgb(9 105 248 / 3.5%);
}

.match-index {
  color: var(--muted);
  font-size: clamp(8px, 1.7578125vw, 9px);
  font-weight: 500;
}

.match-team {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(8.5px, 1.953125vw, 10px);
  font-weight: 450;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score,
.match-dash {
  font-size: clamp(9px, 2.1484375vw, 11px);
  line-height: 1;
  text-align: center;
}

.match-score {
  font-weight: 800;
}

.match-dash {
  color: var(--muted);
  font-weight: 500;
}

.match-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--pending);
  font-size: clamp(7.5px, 1.7578125vw, 9px);
  font-weight: 650;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.match-status .status-dot {
  width: 5px;
  height: 5px;
}

.match-status.is-live {
  color: var(--green);
  font-weight: 800;
}

.match-chevron {
  justify-self: end;
}

.podium-card {
  min-height: 108px;
  height: auto;
}

.podium-heading {
  height: 29px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px var(--card-pad) 0;
}

.podium-heading > span {
  color: var(--muted);
  font-size: clamp(7.5px, 1.5625vw, 8px);
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.podium-list {
  min-height: 79px;
  height: auto;
  display: grid;
  grid-template-rows: repeat(var(--podium-rows, 3), minmax(26.333px, auto));
  margin: 0;
  padding: 0 7px;
  list-style: none;
}

.podium-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1.35fr) minmax(0, 1.15fr) 54px 72px 9px;
  align-items: center;
  padding: 0 5px;
  border-top: 1px solid var(--line);
  font-size: clamp(8.5px, 1.953125vw, 10px);
}

.podium-list li:first-child {
  border-top: 0;
}

.podium-list strong,
.podium-list b,
.podium-list span {
  min-width: 0;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-list strong,
.podium-list b {
  font-weight: 650;
}

.podium-list span:not(.podium-rank) {
  color: var(--muted);
}

.podium-list b,
.podium-list li > span:nth-last-child(2) {
  text-align: center;
}

.podium-list i {
  justify-self: end;
}

.sync-state {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-size: clamp(7.5px, 1.5625vw, 8px);
  font-weight: 500;
  letter-spacing: 0.035em;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  width: min(100%, 512px);
  height: calc(62px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
}

.nav-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: clamp(8px, 1.7578125vw, 9px);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.nav-item:first-child {
  border-left: 0;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item.is-active {
  color: var(--blue);
}

@media (max-width: 390px) {
  .selected-body {
    grid-template-columns: minmax(0, 1fr) 1px minmax(64px, 0.55fr) 1px minmax(0, 1fr) 8px;
    gap: 6px;
    padding-left: calc(var(--card-pad) + 18px);
  }

  .selected-scoreline {
    gap: 6px;
  }

  .score-delta {
    min-width: 28px;
    padding-inline: 6px;
  }

  .match-row {
    grid-template-columns: 20px minmax(0, 1.5fr) 24px 9px 24px minmax(0, 1.15fr) 70px 8px;
    padding-inline: 2px;
  }

  .match-status {
    gap: 4px;
  }

  .podium-list li {
    grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 0.95fr) 43px 52px 8px;
    padding-inline: 3px;
  }
}

@media (max-width: 320px) {
  .content {
    gap: 7px;
  }

  .pulse-body {
    grid-template-columns: minmax(0, 1fr) 1px minmax(92px, 1.05fr) 1px minmax(0, 1fr);
    padding-inline: calc(var(--card-pad) + 4px);
  }

  .league-summary p {
    gap: 4px;
  }

  .points-tiebreak {
    padding-inline: 6px;
  }

  .points-tiebreak > div {
    gap: 10px;
  }

  .selected-body {
    padding-left: var(--card-pad);
  }

  .match-row {
    grid-template-columns: 18px minmax(0, 1.35fr) 22px 8px 22px minmax(0, 1fr) 63px 7px;
  }

  .match-status {
    letter-spacing: 0;
  }

  .nav-item {
    gap: 4px;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Extensiones de las cuatro páginas: el mismo sistema visual de Jornada. */
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#main-content { outline: none; }
.module-heading {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px var(--card-pad);
}
.module-heading > span {
  color: var(--muted);
  font-size: clamp(7.5px, 1.5625vw, 8px);
  font-weight: 600;
  letter-spacing: .035em;
  white-space: nowrap;
}
.module-note,
.card .module-note {
  margin: 0;
  padding: 10px var(--card-pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.league-filters {
  display: grid;
  grid-template-columns: .7fr 1fr 1.3fr;
  gap: 5px;
  padding: 0 var(--card-pad) 8px;
}
.league-filters button {
  min-height: 34px;
  padding: 5px 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.league-filters button[aria-pressed='true'] {
  color: var(--blue);
  background: #f0f5ff;
  border-color: var(--blue);
}
.card .table-note {
  padding: 0 var(--card-pad) 9px;
  color: var(--muted);
  font-size: 9px;
}
.standings-table {
  width: calc(100% - 14px);
  margin: 0 7px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: clamp(9px, 1.953125vw, 10px);
}
.standings-table .rank-col { width: 22px; }
.standings-table .league-col { width: 60px; }
.standings-table .stat-col { width: 25px; }
.standings-table .pf-col { width: 36px; }
.standings-table th {
  height: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}
.standings-table th,
.standings-table td {
  padding: 0 3px;
  text-align: center;
}
.standings-table th:nth-child(2),
.standings-table th:nth-child(3),
.standings-table td:nth-child(2),
.standings-table td:nth-child(3) { text-align: left; }
.standings-table td {
  height: 30px;
  border-bottom: 1px solid var(--line);
}
.standings-table tr:last-child td { border-bottom: 0; }
.standings-table abbr { text-decoration: none; }
.team-link {
  width: 100%;
  min-height: 30px;
  display: block;
  overflow: hidden;
  padding: 6px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.team-link:hover,
.detail-team-name:hover { color: var(--blue); }
.league-cell,
.rank-cell { color: var(--muted); }
.wins-cell,
.points-cell { font-weight: 750; }
.card .table-legend {
  padding: 10px var(--card-pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}
.podium-list i { visibility: hidden; }
.season-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px var(--card-pad) 13px;
}
.season-facts > div {
  display: grid;
  gap: 5px;
  justify-items: center;
  border-left: 1px solid var(--line);
}
.season-facts > div:first-child { border: 0; }
.season-facts strong { font-size: 23px; font-weight: 850; line-height: 1; }
.season-facts span { font-size: 9px; font-weight: 600; color: var(--muted); }
.week-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 5px;
}
.week-arrow {
  height: 44px;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.week-arrow:disabled { color: #bdc5cf; cursor: default; }
.week-select-label {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.week-select-label select {
  width: 100%;
  min-height: 44px;
  appearance: none;
  padding: 5px 26px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font: 750 13px 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
}
.select-arrow {
  position: absolute;
  right: 18px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 0 var(--card-pad) 10px;
}
.week-grid button {
  min-height: 33px;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.week-grid button[aria-pressed='true'] {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.calendar-footer { padding: 0 var(--card-pad); text-align: center; }
.calendar-footer p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.text-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.text-link span { font-size: 20px; }
.lineup-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 4px var(--card-pad) 10px;
}
.lineup-slots > span {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.lineup-slots b { color: var(--ink); font-size: 18px; line-height: 1; }
.rule-copy,
.card .rule-copy {
  padding: 2px var(--card-pad) 11px;
  font-size: 11px;
  line-height: 1.5;
}
.rule-copy p + p { margin-top: 7px; }
.rule-emphasis { color: var(--blue); font-weight: 750; letter-spacing: .02em; }
.rules-definitions { margin: 0; padding: 0 var(--card-pad) 3px; }
.rules-definitions > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}
.rules-definitions dt { font-weight: 750; }
.rules-definitions dd { margin: 0; color: #596579; }
.scoring-section { border-top: 1px solid var(--line); }
.scoring-section summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px var(--card-pad);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}
.scoring-section summary::-webkit-details-marker { display: none; }
.scoring-section summary > span { font-size: 18px; font-weight: 450; }
.scoring-section[open] summary > span { transform: rotate(45deg); }
.rules-table {
  width: calc(100% - (var(--card-pad) * 2));
  margin: 0 var(--card-pad) 8px;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.4;
}
.rules-table th,
.rules-table td { padding: 7px 0; border-top: 1px solid var(--line); text-align: left; }
.rules-table th { color: var(--muted); font-size: 9px; font-weight: 600; }
.rules-table td:first-child { padding-right: 14px; }
.rules-table th:last-child,
.rules-table td:last-child { text-align: right; white-space: nowrap; }
.rules-table td:last-child { font-weight: 650; }
.card .scoring-note {
  padding: 0 var(--card-pad) 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.scoring-note a { color: var(--blue); text-underline-offset: 2px; }
.scoring-card > .scoring-note { padding-top: 10px; border-top: 1px solid var(--line); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.pending-rules { background: #f8fafc; }
.detail-dialog {
  width: calc(100% - 28px);
  max-width: 472px;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 36px rgb(25 35 50 / 16%);
  font-family: inherit;
}
.detail-dialog::backdrop { background: rgb(18 25 36 / 35%); }
body:has(.detail-dialog[open]) { overflow: hidden; }
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading > div { min-width: 0; }
.dialog-heading p { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 600; }
.dialog-heading h2 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.15; }
.dialog-close {
  width: 40px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 26px;
  cursor: pointer;
}
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 15px 10px; }
.detail-stats > div { display: grid; gap: 4px; text-align: center; border-left: 1px solid var(--line); }
.detail-stats > div:first-child { border: 0; }
.detail-stats strong { font-size: 20px; line-height: 1; }
.detail-stats span { color: var(--muted); font-size: 10px; }
.dialog-note { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.detail-section-title { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.team-schedule { margin: 0; padding: 0 10px 8px; list-style: none; }
.team-fixture {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 10px;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.fixture-week { color: var(--muted); font-size: 10px; }
.fixture-opponent { font-size: 12px; }
.fixture-state { color: var(--muted); font-size: 9px; }
.detail-scoreboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 12px 5px; }
.detail-scoreboard > div { display: grid; justify-items: center; gap: 7px; padding: 0 8px; }
.detail-scoreboard > div + div { border-left: 1px solid var(--line); }
.detail-scoreboard span { color: var(--muted); font-size: 10px; text-align: center; }
.detail-scoreboard strong { font-size: 28px; line-height: 1; }
.detail-team-name { padding: 0; background: transparent; border: 0; font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; }
.lineup-table { width: calc(100% - 24px); margin: 0 12px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.lineup-table th,
.lineup-table td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: center; }
.lineup-table th:first-child { width: 50px; text-align: left; }
.lineup-table th { font-weight: 650; }
.lineup-table td { color: var(--muted); }
.lineup-table th, .lineup-table td { vertical-align: top; overflow-wrap: anywhere; }
.player-detail summary { display: grid; gap: 5px; padding: 3px 0; cursor: pointer; }
.player-name { color: var(--ink); line-height: 1.3; }
.player-points { color: var(--blue); white-space: nowrap; }
.player-detail summary::after { content: 'VER CÁLCULO +'; color: var(--muted); font-size: 8px; }
.player-detail[open] summary::after { content: 'CERRAR −'; }
.player-calculation { margin: 8px 0 0; font-size: 10px; text-align: left; }
.stat-part { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); line-height: 1.35; }
.stat-part dd { margin: 3px 0 0; font-weight: 650; }
.source-state { height: auto; min-height: 23px; padding-block: 6px; line-height: 1.4; }
.dialog-action,
.dialog-back { min-height: 44px; color: var(--blue); background: transparent; border: 0; font-size: 12px; font-weight: 750; cursor: pointer; }
.dialog-action { width: 100%; border-top: 1px solid var(--line); }
.dialog-back { padding: 8px 12px; }
.no-script { max-width: 512px; margin: 0 auto; padding: 14px; font: 14px Arial, sans-serif; }
.selected-card { scroll-margin-top: 10px; }
select:focus-visible,
summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.rules-intro,
.rules-notes { display: contents; }
@media (max-width: 360px) {
  .standings-table .rank-col { width: 18px; }
  .standings-table .league-col { width: 46px; }
  .standings-table .stat-col { width: 20px; }
  .standings-table .pf-col { width: 28px; }
  .standings-table th,
  .standings-table td { padding-inline: 2px; }
  .rules-definitions > div { grid-template-columns: 75px minmax(0, 1fr); gap: 8px; }
}

/* Desde tablet: lienzo fluido y navegación superior, sin alterar el móvil. */
@media (min-width: 768px) {
  :root { --gutter: 24px; --card-pad: 18px; }
  .app-shell {
    width: calc(100% - 48px);
    max-width: 1680px;
    min-height: 100dvh;
    padding-bottom: 24px;
    overflow: visible;
    box-shadow: none;
  }
  .topbar {
    height: 80px;
    margin: 0;
    padding: 18px var(--gutter);
    border-radius: 0;
  }
  .brand-block h1 { font-size: 30px; }
  .brand-block p { margin-top: 6px; font-size: 12px; }
  .top-status { height: 30px; font-size: 11px; }
  .bottom-nav {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    height: 54px;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--line);
    transform: none;
  }
  .nav-item { flex-direction: row; gap: 10px; border-left: 0; font-size: 13px; }
  .nav-item.is-active { background: #f0f5ff; box-shadow: inset 0 -2px var(--blue); }
  .nav-item:hover { background: #f5f8fc; }
  .source-state { height: 42px; padding: 0 var(--gutter); font-size: 10px; }
  .content { gap: 18px; align-items: start; }
  .content > *, .rules-intro > *, .rules-notes > * { min-width: 0; }
  .card h2 { font-size: 16px; }
  .pulse-card { height: 140px; }
  .pulse-heading, .selected-heading, .matches-heading, .podium-heading, .module-heading {
    height: 40px;
    min-height: 40px;
    align-items: center;
    padding: 10px var(--card-pad);
  }
  .pulse-body { height: 63px; padding: 0 var(--card-pad); grid-template-columns: minmax(0, 1fr) 1px minmax(100px, 1fr) 1px minmax(0, 1fr); }
  .league-summary h3 { font-size: 12px; }
  .league-summary p { margin-top: 7px; gap: 6px; }
  .league-summary strong { font-size: 28px; }
  .league-summary span { font-size: 10px; }
  .vertical-rule { height: 38px; }
  .points-tiebreak { padding: 0 8px; }
  .points-tiebreak > p { font-size: 9px; }
  .points-tiebreak > div { margin-top: 10px; gap: 14px; }
  .points-tiebreak strong { font-size: 16px; }
  .pulse-footer { height: 36px; padding-inline: 8px; font-size: 11px; white-space: normal; }
  .selected-card { height: 160px; scroll-margin-top: 72px; }
  .selected-body { height: 77px; padding: 0 var(--card-pad); gap: 8px; grid-template-columns: minmax(0, 1fr) 1px 78px 1px minmax(0, 1fr); }
  .selected-team > p { font-size: 12px; line-height: 1.2; white-space: normal; }
  .selected-scoreline { margin-top: 10px; gap: 9px; }
  .selected-scoreline > strong { font-size: 30px; }
  .selected-status { gap: 4px; font-size: 9px; }
  .selected-rule { height: 35px; }
  .selected-body .outer-chevron { display: none; }
  .breakdown-link { height: 42px; font-size: 11px; }
  .matches-card { height: auto; }
  .matches-list { height: auto; grid-template-rows: repeat(12, minmax(40px, auto)); padding-inline: 12px; }
  .match-row { min-height: 40px; grid-template-columns: 25px minmax(0, 1fr) 32px 12px 32px minmax(0, 1fr) 78px 10px; column-gap: 4px; }
  .match-team { font-size: 13px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; padding-block: 5px; }
  .match-index { font-size: 11px; }
  .match-score, .match-dash { font-size: 15px; }
  .match-status { font-size: 9px; gap: 5px; }
  .podium-card { min-height: 184px; height: auto; }
  .podium-heading > span, .module-heading > span { font-size: 9px; }
  .podium-list { min-height: 143px; height: auto; grid-template-rows: repeat(var(--podium-rows, 3), minmax(47.666px, auto)); padding-inline: 12px; }
  .podium-list li { grid-template-columns: 28px minmax(0, 1fr) minmax(0, .8fr) 50px 50px 0; font-size: 13px; }
  .league-filters { gap: 8px; padding-bottom: 12px; }
  .league-filters button { min-height: 40px; font-size: 12px; }
  .standings-table { width: calc(100% - 24px); margin-inline: 12px; font-size: 14px; }
  .standings-table .rank-col { width: 30px; }
  .standings-table .league-col { width: 78px; }
  .standings-table .stat-col { width: 35px; }
  .standings-table .pf-col { width: 52px; }
  .standings-table th { height: 34px; font-size: 11px; }
  .standings-table td, .team-link { height: 36px; }
  .team-link { white-space: normal; overflow-wrap: anywhere; }
  .card .table-note, .card .table-legend { font-size: 11px; }
  .season-facts { padding: 14px var(--card-pad) 18px; }
  .season-facts strong { font-size: 30px; }
  .season-facts span { font-size: 11px; }
  .module-note, .card .module-note { font-size: 12px; }
  .week-controls { padding-block: 6px; }
  .week-select-label select { font-size: 16px; }
  .week-grid { gap: 7px; padding-bottom: 16px; }
  .week-grid button { min-height: 38px; font-size: 14px; }
  .calendar-footer { padding: 0 16px; }
  .calendar-footer p { font-size: 12px; line-height: 1.6; }
  .text-link { font-size: 13px; }
  .lineup-slots { gap: 8px; padding-bottom: 16px; }
  .lineup-slots > span { padding: 12px 0; font-size: 12px; }
  .lineup-slots b { font-size: 24px; }
  .rule-copy, .card .rule-copy { padding-bottom: 16px; font-size: 14px; line-height: 1.6; }
  .rules-definitions > div { grid-template-columns: 110px minmax(0, 1fr); padding-block: 14px; font-size: 14px; line-height: 1.55; }
  .scoring-section summary { min-height: 48px; font-size: 13px; }
  .rules-table { font-size: 14px; }
  .rules-table th { font-size: 11px; }
  .rules-table th, .rules-table td { padding-block: 10px; }
  .card .scoring-note { font-size: 12px; }
  .sync-state { height: 46px; font-size: 10px; }
  .detail-dialog { max-width: 720px; }
  .dialog-heading { padding: 14px 20px; }
  .dialog-heading h2 { font-size: 22px; }
  .dialog-heading p { font-size: 12px; }
  .detail-stats { padding: 20px; }
  .detail-stats strong { font-size: 28px; }
  .detail-stats span, .fixture-week, .fixture-state { font-size: 12px; }
  .dialog-note, .detail-section-title { padding-inline: 20px; font-size: 14px; }
  .team-schedule { padding-inline: 20px; }
  .team-fixture { min-height: 44px; }
  .fixture-opponent, .detail-team-name { font-size: 16px; }
  .detail-scoreboard { padding: 20px; }
  .detail-scoreboard span { font-size: 12px; }
  .detail-scoreboard strong { font-size: 36px; }
  .lineup-table { font-size: 14px; }
  .lineup-table th, .lineup-table td { padding-block: 12px; }
  .dialog-action, .dialog-back { font-size: 14px; }
}

/* En desktop se redistribuyen los módulos; no se estira una columna móvil. */
@media (min-width: 1100px) {
  .content[data-page='jornada'], .content[data-page='tabla'] {
    grid-template-columns: minmax(350px, .85fr) minmax(0, 1.6fr);
    grid-template-rows: 140px 160px minmax(184px, 1fr);
  }
  [data-page='jornada'] .pulse-card, [data-page='tabla'] .pulse-card { grid-column: 1; grid-row: 1; }
  [data-page='jornada'] .selected-card { grid-column: 1; grid-row: 2; }
  [data-page='jornada'] .podium-card { grid-column: 1; grid-row: 3; }
  [data-page='jornada'] .matches-card { grid-column: 2; grid-row: 1 / 4; }
  .content[data-page='tabla'] { grid-template-rows: 140px minmax(184px, auto) 1fr; }
  [data-page='tabla'] .podium-card { grid-column: 1; grid-row: 2; }
  [data-page='tabla'] .standings-card { grid-column: 2; grid-row: 1 / 4; }
  .content[data-page='calendario'] {
    grid-template-columns: minmax(330px, .8fr) minmax(0, 1.65fr);
    grid-template-rows: auto auto 1fr;
  }
  [data-page='calendario'] .calendar-overview { grid-column: 1; grid-row: 1; }
  [data-page='calendario'] .week-card { grid-column: 1; grid-row: 2; }
  [data-page='calendario'] .calendar-footer { grid-column: 1; grid-row: 3; }
  [data-page='calendario'] .matches-card { grid-column: 2; grid-row: 1 / 4; }
  .rules-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; }
  .rules-intro, .rules-notes { display: grid; gap: 18px; grid-column: 1; }
  .rules-intro { grid-row: 1; }
  .rules-notes { grid-row: 2; }
  .rules-page > .scoring-card { grid-column: 2; grid-row: 1 / 3; }
}
/* Previa de la jornada, separada de los resultados acumulados. */
.projection-comparison { margin: 12px 0; padding: 10px 12px; border-left: 3px solid #247d60; background: #f1f5f3; color: #1e4436; font-size: 14px; line-height: 1.4; }
.projection-comparison:empty { display: none; }
.player-projection { display: block; margin-top: 5px; color: #247d60; font-size: 14px; }
.lineup-pro-team { display: block; color: #777; font-size: 11px; margin-top: 3px; }
