/* ============================================================
   css/pages/ideales.css — estilos exclusivos de ideales.php
   (cargado por head.php cuando la página define $page_css='ideales')
   Reutiliza .ideal / .table / .card / .stat-cards de rincon.css.
   ============================================================ */

/* ---------- Cabecera de página ---------- */
.ideales-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap;
}
.ideales-head h1 {
  font-family: var(--score); font-size: 28px; font-weight: 700;
  letter-spacing: .01em; color: var(--ink); line-height: 1.1;
}
.ideales-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Selector de jornada / modo ---------- */
.ideales-nav {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4); margin-top: var(--sp-4);
}
.ideales-nav .fgroup { display: flex; flex-direction: column; gap: 6px; }
.ideales-nav .flabel {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
.ideales-nav__row { display: flex; align-items: center; gap: var(--sp-2); }
.ideales-nav select {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  background-color: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-input); padding: 6px 32px 6px 12px;
  appearance: none; -webkit-appearance: none; cursor: pointer; min-width: 190px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235B6577' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.ideales-nav select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ideales-nav .btn { padding: 7px 16px; font-size: 13px; }

/* Segmented de modos (mismo look que ranking.css .seg) */
.ideales-nav__modes {
  display: inline-flex; background: var(--ground);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px;
}
.ideales-nav__modes a {
  font-size: 12.5px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--r-pill); color: var(--muted); white-space: nowrap;
}
.ideales-nav__modes a:hover { color: var(--ink); }
.ideales-nav__modes a.is-active { background: var(--ink); color: #fff; }
.ideales-nav__modes a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Navegación anterior/siguiente (vista de una sola jornada) */
.ideales-jnav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-3); }
.ideales-jnav .btn { white-space: nowrap; }

/* ---------- Rejilla de quintetos ---------- */
.ideales-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4); align-items: start;
}
.ideales-single { max-width: 620px; }
.ideales-more { display: flex; justify-content: center; margin-top: var(--sp-4); }

/* Totales del quinteto (SM + valor) en la cabecera de la tarjeta ideal */
.ideal__totals { text-align: right; }
.ideal__valor {
  font-family: var(--score); font-weight: 700; font-size: 16px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px;
}
.ideal__valor small {
  display: block; font-family: var(--sans); font-weight: 600; font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
/* Nª aparición del jugador junto al equipo */
.ideal-player__apps { color: var(--accent-deep); font-weight: 700; }
/* Pie de la tarjeta ideal: enlace a la jornada completa */
.ideal__foot { margin-top: var(--sp-4); text-align: right; }

/* ---------- Rankings de apariciones (3 tarjetas) ---------- */
.ideales-rankings {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4);
}
.ideales-rankings .card { display: flex; flex-direction: column; overflow: hidden; }
.ideales-rankings .table { width: 100%; }
/* La tabla de JUGADORES (4 columnas) usa table-layout:fixed para que un nombre
   largo (p.ej. "Timothé Luwawu-Cabarrot") no ensanche la columna ni fuerce
   scroll: columnas #/Equipo/Apariciones fijas (Apariciones ancha para que su
   cabecera no se recorte) y Jugador se lleva el resto, truncando con ellipsis.
   Las tablas de EQUIPOS (3 columnas, nombres cortos) quedan en auto y encajan. */
.rk-players { table-layout: fixed; }
.rk-players th:nth-child(1), .rk-players td:nth-child(1) { width: 40px; }
.rk-players th:nth-child(3), .rk-players td:nth-child(3) { width: 64px; }
/* Cabecera "Aparic." (no "Apariciones") para que la columna del número sea
   estrecha y el nombre del jugador se lleve el ancho sobrante. */
.rk-players th:nth-child(4), .rk-players td:nth-child(4) { width: 78px; }
.rk-players td .player-cell { min-width: 0; }
.rk-players td .player-cell a {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ideales-rankings .table td.c-ap strong { color: var(--accent-deep); }
.ideales-rankings .table td .team-tag { color: var(--ink); font-weight: 600; }
.ideales-rankings .table td .team-tag:hover { color: var(--accent-deep); }
.ideales-note { margin-top: var(--sp-3); font-size: 12.5px; }

/* ---------- Estado sin datos ---------- */
.ideales-empty { padding: var(--sp-5); max-width: 640px; margin-top: var(--sp-4); }
.ideales-empty__links { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ideales-rankings { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .ideales-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ideales-head h1 { font-size: 23px; }
  .ideales-nav { gap: var(--sp-3); }
  .ideales-nav select { min-width: 0; flex: 1; }
  .ideales-nav__row { width: 100%; }
}
