/* Componentes (docs/11-frontend.md). Solo variables de tokens.css; prefijo rp-. */
.rp-h1 { font: 600 clamp(30px, 5vw, 40px)/1.12 var(--font-display); margin: 0; }
.rp-h2 { font: 600 24px/1.12 var(--font-display); margin: 0; }
.rp-lead { color: var(--text-2); font-size: 18px; line-height: 1.5; max-width: 60ch; }
.rp-eyebrow { color: var(--text-2); font: 500 13px var(--font-body); text-transform: uppercase; letter-spacing: .08em; }
.rp-coverage, .rp-source { color: var(--text-2); font-size: 14px; }

/* Botones */
.rp-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font-body);
  padding: 11px 16px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  white-space: nowrap; background: var(--accent-text); color: var(--on-accent); }
.rp-button:hover { background: var(--accent); }
.rp-button--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.rp-button--secondary:hover { background: var(--surface-sunk); }
.rp-button--ghost { background: transparent; color: var(--text); padding-inline: 10px; }
.rp-button--ghost:hover { background: var(--surface-sunk); }
.rp-button--danger { background: var(--surface); color: var(--discrepancy); border-color: var(--discrepancy); }
.rp-button--sm { padding: 8px 12px; font-size: 14px; }
.rp-link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }

/* Perfil */
.rp-profile { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; }
.rp-profile__info { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.rp-avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--surface-sunk); border: 1px solid var(--border);
  display: grid; place-items: center; flex: none; font: 600 32px/1 var(--font-display); color: var(--text-2); }
.rp-source-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--verified); font-weight: 600; }
.rp-source-tag svg { width: 18px; height: 18px; }

/* KPI unidos en una franja */
.rp-kpis { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.rp-kpi { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; align-content: start; min-width: 0; margin: 0; }
.rp-kpi dt, .rp-kpi dd { margin: 0; }
.rp-kpi__label { font-size: 14px; color: var(--text-2); }
.rp-kpi__value { font: 600 32px/1.05 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-kpi__note { font-size: 13px; color: var(--text-2); }

/* Paneles y tablas */
.rp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px;
  min-width: 0; display: grid; gap: 12px; align-content: start; }
.rp-panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.rp-panel__head h2 { font-size: 21px; }
.rp-table-scroll { overflow-x: auto; max-width: 100%; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 15px; background: transparent; border: 0; }
.rp-table th, .rp-table td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.rp-table th { font-weight: 600; font-size: 14px; color: var(--text-2); background: transparent; }
.rp-table tbody tr:hover td { background: var(--surface-sunk); }
.rp-table .rp-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-body); }
.rp-table .rp-wrap-cell { white-space: normal; min-width: 160px; }
.rp-sub { display: block; color: var(--text-2); font-size: 13px; }

/* Estados (icono + texto, nunca solo color) */
.rp-st { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.rp-st svg { width: 15px; height: 15px; flex: none; }
.rp-st--ok { color: var(--verified); } .rp-st--bad { color: var(--discrepancy); } .rp-st--na { color: var(--unverifiable); }

/* Listas, vacíos, formularios */
.rp-list { list-style: none; padding: 0; display: grid; gap: 8px; margin: 0; }
.rp-list a { font-weight: 500; }
.rp-inline { list-style: none; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.rp-role { color: var(--text-2); font-family: var(--font-mono); font-size: 13px; margin-right: 8px; }
.rp-empty { background: var(--surface-sunk); border-radius: var(--radius-lg); padding: 24px; color: var(--text-2); }
.rp-empty__title { font-weight: 600; color: var(--text); margin-top: 0; }
.rp-search { display: flex; gap: 8px; max-width: 32rem; }
.rp-search input { flex: 1; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; min-width: 0; }
.rp-more { text-align: center; }
.rp-form { display: grid; gap: 12px; max-width: 28rem; }
.rp-form input:not([type="hidden"]), .rp-form textarea { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.rp-error { color: var(--discrepancy); font-weight: 600; }
.rp-messages { list-style: none; padding: 12px; background: var(--surface-sunk); border-radius: var(--radius-lg); }
.rp-card-count { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.rp-card-count__chip { width: .75rem; height: 1rem; border-radius: 2px; display: inline-block; }
.rp-card-count--yellow .rp-card-count__chip { background: var(--yellow-card); }
.rp-card-count--red .rp-card-count__chip { background: var(--red-card); }

/* Portada */
.rp-hero { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); padding: 40px 28px; }
.rp-hero > * { position: relative; }
.rp-hero__pitch { position: absolute; right: -2rem; top: 50%; width: min(34rem, 80%); transform: translateY(-50%); color: var(--border); pointer-events: none; }
.rp-hero .rp-h1 { max-width: 16ch; font-size: clamp(34px, 6vw, 52px); }
.rp-hero .rp-search { margin-top: 16px; }
.rp-value { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 16px; }
.rp-value h3 { margin: 0 0 4px; }
.rp-value p { color: var(--text-2); }
.rp-tight { gap: 8px; }

@media (max-width: 560px) {
  .rp-hide-sm { display: none; }
  .rp-table th, .rp-table td { white-space: normal; padding-right: 8px; }  /* sin desbordar la tabla */
  .rp-table .rp-num { white-space: nowrap; }
  .rp-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }  /* sin celda vacía en la rejilla de 2 columnas */
}

/* Escudos */
.rp-crest { width: 22px; height: 22px; flex: none; object-fit: contain; vertical-align: middle; }
.rp-crest--empty { display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-sunk);
  border: 1px solid var(--border); color: var(--text-2); font: 600 11px/1 var(--font-display); }
.rp-team { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }

/* Lista con recuento */
.rp-rows { list-style: none; padding: 0; margin: 0; }
.rp-rows > li { display: flex; align-items: center; gap: 10px; padding-block: 7px; border-bottom: 1px solid var(--border); min-width: 0; }
.rp-rows > li:last-child { border-bottom: 0; }
.rp-rows__grow { flex: 1; min-width: 0; }
.rp-rows__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-rows__count { font: 600 18px/1 var(--font-display); font-variant-numeric: tabular-nums; flex: none; }

/* Tabla de calor: temporada por competición, celdas partidas por rol */
.rp-heat { width: auto; table-layout: fixed; border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.rp-heat th { font-weight: 500; color: var(--text-2); white-space: nowrap; padding: 0 4px; text-align: left; }
.rp-heat thead th { font-size: 12px; vertical-align: bottom; width: 96px; white-space: normal; line-height: 1.2; padding-bottom: 4px; }
.rp-heat thead th:first-child { width: 72px; }
.rp-heat thead th.rp-heat__total { width: 52px; }
.rp-heat tbody th, .rp-heat tfoot th { color: var(--text); padding-right: 10px; }
.rp-heat td { padding: 0; min-width: 44px; }
.rp-heat .rp-heat__total { text-align: center; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.rp-split { display: flex; gap: 2px; height: 26px; border-radius: 3px; overflow: hidden; min-width: 36px; }
.rp-split > span { display: grid; place-items: center; font: 600 12px/1 var(--font-body); font-variant-numeric: tabular-nums; min-width: 14px; }
.rp-split__main { background: var(--role-main); color: var(--on-role-main); }
.rp-split__assist { background: var(--role-assist); color: var(--on-role-assist); }
.rp-split__other { background: var(--line-strong); color: var(--text); }
.rp-split__zero { background: var(--surface-sunk); color: var(--text-2); font-weight: 400; flex: 1; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-2); }
.rp-legend__key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Mapa */
.rp-map { width: 100%; height: 340px; border-radius: var(--radius); background: var(--surface-sunk); border: 1px solid var(--border);
  overflow: hidden; position: relative; }
.rp-map__fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--text-2); font-size: 14px; }
.rp-grid-map { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .rp-grid-map { grid-template-columns: minmax(0, 1fr); } }

/* Pesos del reparto por rol (1..20) y colores de la leyenda: sin estilos en línea */
.rp-f1 { flex: 1; }
.rp-f2 { flex: 2; }
.rp-f3 { flex: 3; }
.rp-f4 { flex: 4; }
.rp-f5 { flex: 5; }
.rp-f6 { flex: 6; }
.rp-f7 { flex: 7; }
.rp-f8 { flex: 8; }
.rp-f9 { flex: 9; }
.rp-f10 { flex: 10; }
.rp-f11 { flex: 11; }
.rp-f12 { flex: 12; }
.rp-f13 { flex: 13; }
.rp-f14 { flex: 14; }
.rp-f15 { flex: 15; }
.rp-f16 { flex: 16; }
.rp-f17 { flex: 17; }
.rp-f18 { flex: 18; }
.rp-f19 { flex: 19; }
.rp-f20 { flex: 20; }
.rp-legend__key--main { background: var(--role-main); }
.rp-legend__key--assist { background: var(--role-assist); }
.rp-legend__key--other { background: var(--line-strong); }
.rp-legend__key--zero { background: var(--surface-sunk); border: 1px solid var(--border); }

.rp-match { white-space: nowrap; }
.rp-match .rp-team { vertical-align: middle; }
@media (max-width: 560px) { .rp-match { white-space: normal; } }
.rp-match .rp-team:last-child { margin-left: 4px; }

.rp-division { display: grid; gap: 8px; min-width: 0; }
.rp-division + .rp-division { border-top: 1px solid var(--border); padding-top: 14px; }
.rp-division h3 { font-size: 18px; }
