/* =====================================================================
   LigaPro
   Concepto: el tablero de anotación. Superficies tranquilas, el
   marcador oscuro es lo único que levanta la voz.
   ===================================================================== */

:root {
  --board:    #0A2A52;  /* azul marino del escudo de Liga Amateur */
  --board-2:  #123A6B;
  --stripe:   #E4001B;  /* rojo de la bola/franjas del escudo */
  --lane:     #C8964B;  /* arce de la pista */
  --paper:    #F3F1EC;
  --card:     #FFFFFF;
  --ink:      #0A2A52;
  --slate:    #5C6975;
  --rule:     #DCD8D0;

  --shell:    68rem;
  --radius:   3px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Barlow', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--stripe);
  outline-offset: 2px;
}

/* ---------- Barra superior ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.25rem;
  background: var(--board);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand__logo {
  display: block;
  height: 40px;
  width: auto;
}

.topnav {
  display: flex;
  gap: 1.1rem;
  margin-right: auto;
  flex-wrap: wrap;
}

.topnav__link {
  color: #B9C4CF;
  text-decoration: none;
  font-weight: 500;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}

.topnav__link:hover { color: #fff; }

.topnav__link.is-active {
  color: #fff;
  border-bottom-color: var(--stripe);
}

.topbar__session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__who {
  color: #93A2B0;
  font-size: 0.9rem;
}

.linkbtn {
  background: none;
  border: 0;
  color: #B9C4CF;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.linkbtn:hover { color: #fff; }

/* ---------- Contenedor ---------- */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.pagehead { margin-bottom: 0.5rem; }

.pagehead__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.pagehead__meta {
  margin: 0.2rem 0 0;
  color: var(--slate);
}

.pagehead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 0.5rem;
}

.statcards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.statcard {
  flex: 1 1 9rem;
  min-width: 9rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}

.statcard__value {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}

.statcard__label {
  display: block;
  color: var(--slate);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.statcard__label small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.statcard--pair {
  flex: 2 1 16rem;
  display: flex;
  gap: 0.9rem;
}

.statcard__pairitem {
  flex: 1 1 0;
  min-width: 0;
}

.statcard__pairitem + .statcard__pairitem {
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
}

.linechart {
  width: 100%;
  height: auto;
  max-width: 40rem;
  display: block;
  margin: 0.5rem 0 1.25rem;
}

.linechart__line {
  stroke: var(--board);
  stroke-width: 2;
}

.linechart__dot {
  fill: var(--stripe);
}

.linechart__label {
  fill: var(--slate);
  font-size: 9px;
  font-family: 'Barlow', sans-serif;
  text-anchor: middle;
}

.linechart__grid {
  stroke: var(--rule);
  stroke-width: 1;
}

.linechart__ylabel {
  fill: var(--slate);
  font-size: 9px;
  font-family: 'Barlow', sans-serif;
  font-variant-numeric: tabular-nums;
  text-anchor: end;
}

.upnext {
  margin: 1.25rem 0 1.75rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--lane);
  color: var(--slate);
}

/* ---------- Avisos ---------- */

.notice {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin: 0 0 1.25rem;
}

.notice--ok  { background: #EAF3EC; border-color: #3F7D4F; }
.notice--bad { background: #FBEAEC; border-color: var(--stripe); }

/* ---------- Pestañas de posiciones ---------- */

.tabnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.tabnav__link {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  color: var(--slate);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabnav__link:hover { color: var(--ink); }

.tabnav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--stripe);
  font-weight: 600;
}

@media (max-width: 640px) {
  /* Con 10 pestañas, dejarlas envolver en varias líneas (flex-wrap)
     las amontona sin orden claro. En pantallas angostas se vuelve una
     sola fila con scroll horizontal, como una barra de pestañas real. */
  .tabnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .tabnav__link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* ---------- Tabla de posiciones ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--rule);
}

/* Envuelve la tabla en un contenedor con scroll horizontal cuando hay
   muchas columnas de fecha (F01, F02...), sin tocar el display de la
   tabla misma — así queda con exactamente el mismo look que las demás
   pestañas (bordes, encabezado, etc.), solo que puede deslizarse. */
.table-scroll {
  overflow-x: auto;
}

.table-scroll .table {
  min-width: 34rem;
}

/* Todas las columnas centradas menos el nombre (equipo/jugador, sin .num). */
.table--center td.num,
.table--center th.num {
  text-align: center;
}

/* Comparativos head-to-head: la columna de etiqueta de cada fila
   (nombre de la métrica) también centrada, para que toda la tabla
   quede pareja. */
.table--center td.label,
.table--center th.label {
  text-align: center;
}

/* Head-to-head: resalta el lado con mejor número en cada fila. */
.compare-win {
  font-weight: 700;
  color: var(--ink);
  position: relative;
}
.compare-win::after {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: var(--stripe);
  vertical-align: middle;
}

.table__divider td {
  background: var(--paper);
  color: var(--slate);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.6rem;
}

/* Dos tablas (categoría A y B) una a la par de la otra. */
.positions__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.positions__pair--stacked {
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .positions__pair {
    grid-template-columns: 1fr;
  }
}

.table__caption {
  text-align: left;
  color: var(--slate);
  font-size: 0.9rem;
  padding-bottom: 0.5rem;
}

.table th,
.table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.table thead th {
  background: var(--board);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  border-bottom: 0;
}

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

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--slate);
  width: 3rem;
}

.strong {
  font-weight: 600;
  font-size: 1.05rem;
}

.muted { color: var(--slate); }

/* ---------- Controles de posiciones (Equipos/Individual/Altas) ---------- */

.posctrls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}

.posctrls__group {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.posctrls__btn {
  padding: 0.5rem 0.9rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-right: 1px solid var(--rule);
}

.posctrls__btn:last-child { border-right: 0; }

.posctrls__btn:hover { background: var(--paper); }

.posctrls__btn.is-active {
  background: var(--board);
  color: #fff;
  font-weight: 600;
}

.field--inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.field--inline .field__label { margin: 0; white-space: nowrap; }

.field--inline select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

/* ---------- Encabezado explicativo ---------- */

.poshead { margin-bottom: 0.75rem; }

.poshead__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.poshead__sub {
  margin: 0.15rem 0 0;
  color: var(--slate);
}

.poshead__meta,
.poshead__updated {
  margin: 0.2rem 0 0;
  color: var(--slate);
  font-size: 0.88rem;
}

.poshead__pdf {
  display: inline-block;
  margin-top: 0.5rem;
}

.posexplain {
  margin-bottom: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.6rem 0.9rem;
}

.posexplain__toggle {
  cursor: pointer;
  font-weight: 600;
  color: var(--board);
}

.posexplain__body p {
  margin: 0.7rem 0 0;
  color: var(--slate);
  font-size: 0.92rem;
}

.poshelp {
  margin: 0.75rem 0 0;
  color: var(--slate);
  font-size: 0.85rem;
}

/* ---------- Buscador/filtro de tablas ---------- */

.tablefilter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.9rem;
}

.tablefilter .field--grow { flex: 1 1 14rem; }

.tablefilter__query,
.tablefilter__team {
  font: inherit;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

/* ---------- Jugador con equipo debajo (solo en móvil) ---------- */

.playercell__team {
  display: none;
}

/* ---------- Fila "Ver detalle" (solo en móvil) ---------- */

.mobile-only-col { display: none; }

.rowdetail-toggle {
  font: inherit;
  font-size: 0.8rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.3rem 0.55rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.row-detail td {
  background: var(--paper);
  padding: 0.6rem 0.85rem;
}

.rowdetail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
}

.rowdetail__item { display: flex; gap: 0.4rem; }

.rowdetail__item dt {
  color: var(--slate);
  font-size: 0.85rem;
}

.rowdetail__item dd {
  margin: 0;
  font-weight: 600;
}

/* ---------- Selector Serie alta / Línea alta (altas, en móvil) ---------- */

.altapicker {
  display: none;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.altapicker__btn {
  font: inherit;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.altapicker__btn.is-active {
  background: var(--board);
  color: #fff;
  border-color: var(--board);
}

@media (max-width: 640px) {
  /* En celular: Pos./Jugador (con equipo debajo)/resultado principal,
     con el resto detrás de "Ver detalle". Sin scroll horizontal de la
     página completa — cada tabla se ajusta a lo que quepa. */
  .mobile-hide { display: none; }
  .mobile-only-col { display: table-cell; }
  .playercell__team {
    display: block;
    font-size: 0.8rem;
    color: var(--slate);
    font-weight: 400;
  }

  .table--responsive.table { min-width: 0; width: 100%; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .altapicker { display: flex; }
  .positions__pair { grid-template-columns: 1fr; }
  .positions__pair .is-hidden-mobile { display: none; }
}

/* ---------- Estado vacío ---------- */

.empty {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

.empty p {
  margin: 0 0 1.25rem;
  color: var(--slate);
}

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

.form { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.3rem; }

.field__label {
  font-size: 0.9rem;
  color: var(--slate);
  font-weight: 500;
}

.field input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.field input:focus {
  border-color: var(--board);
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--board);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--board-2); }

.btn--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

/* ---------- Jornadas y resultados ---------- */

.statuspill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.statuspill--programada { background: var(--paper); color: var(--slate); border-color: var(--rule); }
.statuspill--en_curso   { background: #FBF6EC; color: #8A6117; border-color: var(--lane); }
.statuspill--cerrada    { background: #EAF3EC; color: #2C5A38; border-color: #3F7D4F; }
.statuspill--latest     { background: var(--board); color: #fff; }

.rachapill {
  display: inline-block;
  min-width: 2.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}

.rachapill--v { background: #EAF3EC; color: #2C5A38; border-color: #3F7D4F; }
.rachapill--d { background: #FBEAEC; color: var(--stripe); border-color: var(--stripe); }

.badge {
  display: inline-block;
  margin: 0.15rem 0.3rem 0.15rem 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #FBF6EC;
  color: #8A6117;
  border: 1px solid var(--lane);
}

.datelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.datelist__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.datelist__item.is-default { border-color: var(--board); }

.datelist__info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.datelist__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}

.matchupgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.matchupcard {
  display: block;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.matchupcard:hover { border-color: var(--board); }

.matchupcard__teams {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
}

.matchupcard__status {
  margin: 0 0 0.4rem;
  color: var(--slate);
  font-size: 0.9rem;
}

.matchupcard__points {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.matchupcard__link {
  color: var(--board);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: underline;
}

.matchscore {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.matchscore__pending { margin: 0; color: var(--slate); font-weight: 600; }

.matchscore__team {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.matchscore__name { color: var(--slate); font-size: 0.9rem; }

.matchscore__value {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
}

.matchscore__note {
  margin: 0;
  color: var(--slate);
  font-size: 0.85rem;
  flex-basis: 100%;
}

.matchside { margin-bottom: 1.75rem; }

.matchside__team {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
}

.matchbreakdown { margin-top: 1.5rem; }

.matchbreakdown__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.matchbreakdown__winner { font-weight: 700; }

.linepicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.linepicker__btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.linepicker__btn.is-active {
  background: var(--board);
  color: #fff;
  border-color: var(--board);
}

/* ---------- Total de equipo (pie de la tabla de resultados) ---------- */
/* Mismos cuatro renglones que la hoja de anotación en papel: sin
   handicap, handicap del equipo, total, y puntos — cada uno su fila. */

.teamtotal-row td { background: var(--paper); }
.teamtotal-row:first-of-type td { border-top: 2px solid var(--rule); }
.teamtotal-row--points td { border-bottom: 2px solid var(--rule); font-weight: 700; }

@media (max-width: 640px) {
  .matchscore { flex-direction: column; gap: 0.75rem; }
}

/* ---------- Acceso ---------- */

.entry {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--paper);
}

.entry__board {
  background: var(--board);
  padding: 1.5rem 1rem;
  overflow: hidden;
}

.board__frames {
  display: flex;
  justify-content: center;
  gap: 2px;
  max-width: var(--shell);
  margin: 0 auto;
}

.board__frame {
  flex: 1 1 0;
  min-width: 0;
  max-width: 4.5rem;
  border: 1px solid #3A4B5E;
  display: grid;
  font-family: 'Barlow Condensed', sans-serif;
  color: #8FA0B1;
}

.board__frame b {
  font-size: 1.1rem;
  text-align: right;
  padding: 0.1rem 0.3rem;
  border-bottom: 1px solid #3A4B5E;
  color: #fff;
  font-weight: 600;
}

.board__frame i {
  font-style: normal;
  font-size: 1rem;
  text-align: center;
  padding: 0.15rem;
}

.entry__panel {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  align-self: start;
}

.entry__logo {
  display: block;
  height: 100px;
  width: auto;
  margin: 0 0 0.5rem;
}

.entry__sub {
  margin: 0.15rem 0 2rem;
  color: var(--slate);
}

.entry .btn { width: 100%; }

.entry__links {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.entry__links > a {
  color: var(--board);
  text-decoration: underline;
}

.entry__forgot summary {
  cursor: pointer;
  color: var(--board);
  text-decoration: underline;
}

.entry__forgot p {
  margin: 0.5rem 0 0;
  color: var(--slate);
}

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

@media (max-width: 640px) {
  .topbar { gap: 0.75rem; }
  .topnav { order: 3; width: 100%; gap: 0.9rem; }
  .topbar__session { margin-left: auto; }
  .pagehead__title { font-size: 1.75rem; }
  .table th, .table td { padding: 0.55rem 0.6rem; }
  .board__frame:nth-child(n+7) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   Administración
   ===================================================================== */

.pagehead--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Formularios en línea ---------- */

.inlineform {
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1rem;
  margin: 1.5rem 0;
}

.inlineform--quiet {
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 0.5rem;
}

.field--grow { flex: 1 1 14rem; }

.rowform {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rowform input[type="text"] {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  width: 100%;
  max-width: 20rem;
}

.rowform input[type="text"]:hover,
.rowform input[type="text"]:focus {
  border-color: var(--rule);
  background: #fff;
}

.linkbtn--dark {
  color: var(--slate);
  text-decoration: underline;
}

.linkbtn--dark:hover { color: var(--ink); }

/* ---------- Formulario largo ---------- */

.form--wide { max-width: 52rem; }

.group {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.group__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0 0.4rem;
}

/* La regla traducida a palabras, sobre fondo de pista */
.group__preview {
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.85rem;
  background: #FBF6EC;
  border-left: 3px solid var(--lane);
  color: #5A4A31;
}

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }

.field--wide { grid-column: 1 / -1; }

.field select {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.field__hint {
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.35;
}

.field__error {
  font-size: 0.85rem;
  color: var(--stripe);
  font-weight: 500;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.check--inline { margin-top: 0; }

.check input { width: 1.05rem; height: 1.05rem; }

.formactions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ---------- Etiquetas de estado ---------- */

.pill {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
}

.pill--activa   { color: #2F6B41; border-color: #9CC5A9; background: #EAF3EC; }
.pill--borrador { color: var(--slate); border-color: var(--rule); background: var(--paper); }
.pill--cerrada  { color: #6B5330; border-color: #D8C4A0; background: #FBF6EC; }
.pill--repo     { color: #7A2230; border-color: #E0AEB6; background: #FBEAEC; }

.hintbox {
  border-left: 3px solid var(--lane);
  padding: 0.7rem 0.85rem;
  background: #FBF6EC;
  color: #5A4A31;
  margin: 0 0 1.5rem;
}

.notice--warn { background: #FBF6EC; border-color: var(--lane); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .inlineform { flex-direction: column; align-items: stretch; }
  /* El 14rem de .field--grow es un flex-basis pensado para el eje
     horizontal (fila). Al pasar el formulario a columna, ese mismo
     valor se aplica a la altura y deja un campo de ~224px con un
     vacío enorme arriba del control. Se anula acá para que el campo
     mida lo que su contenido necesita. */
  .inlineform .field--grow { flex-basis: auto; }
  .inlineform .btn { width: 100%; }
  .formactions { flex-direction: column-reverse; align-items: stretch; gap: 0.75rem; }
  .formactions .btn { width: 100%; }
  .rowform input[type="text"] { max-width: none; }
}

/* ---------- Selector de temporada ---------- */

.seasonpick select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #3A4B5E;
  border-radius: var(--radius);
  background: var(--board-2);
  color: #fff;
  max-width: 15rem;
}

.seasontag {
  font-size: 0.9rem;
  color: #93A2B0;
  border-left: 1px solid #3A4B5E;
  padding-left: 1rem;
}

.topbar__public {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

/* ---------- Edición en línea de equipos ---------- */

.teamrow__name { font-weight: 500; }

.teamrow__input {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
  max-width: 20rem;
}

.rowactions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.iconbtn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--slate);
  padding: 0.25rem;
  cursor: pointer;
  line-height: 0;
}

.iconbtn:hover {
  color: var(--ink);
  border-color: var(--rule);
  background: #fff;
}

.teamrow__deleteform { display: inline-block; line-height: 0; }

.iconbtn--bad:hover {
  color: var(--stripe);
  border-color: var(--stripe);
  background: #fff;
}

@media (max-width: 640px) {
  .seasonpick { order: 4; width: 100%; }
  .seasonpick select { max-width: none; width: 100%; }
  .seasontag { border-left: 0; padding-left: 0; }
  .teamrow__input { max-width: none; }
}

/* ---------- Lista de secciones del panel ---------- */

.sections {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--card);
}

.section {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}

.section:last-child { border-bottom: 0; }

.section__lane {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 1.2rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem;
  min-width: 3.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  background: var(--lane);
  font-family: 'Barlow Condensed', sans-serif;
  font-variant-numeric: tabular-nums;
}

.section__lane-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.section__lane-sep {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.section__lane--empty {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--slate);
  font-weight: 700;
}

.section__link {
  flex: 1;
  display: grid;
  gap: 0.1rem;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}

a.section__link:hover {
  background: #FBF6EC;
  border-left-color: var(--lane);
}

.section__name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
}

.section__desc {
  color: var(--slate);
  font-size: 0.95rem;
}

.section__count {
  font-variant-numeric: tabular-nums;
  color: var(--slate);
  padding-right: 1.2rem;
}

.section--soon .section__name,
.section--soon .section__desc { color: #94A0AB; }

/* ---------- Enlace de regreso ---------- */

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--slate);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.backlink:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Importador de equipos ---------- */

.importer {
  border: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 1.5rem;
}

.importer__toggle {
  cursor: pointer;
  padding: 0.8rem 1rem;
  font-weight: 600;
  list-style: none;
}

.importer__toggle::-webkit-details-marker { display: none; }

.importer__toggle::before {
  content: '+';
  display: inline-block;
  width: 1rem;
  color: var(--lane);
  font-weight: 700;
}

.importer[open] .importer__toggle::before { content: '–'; }

.importer__form {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1rem;
  max-width: 30rem;
}

.importer__form select[multiple] {
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.3rem;
  width: 100%;
}

.importer__form optgroup {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  color: var(--slate);
}

.importer__form option { padding: 0.2rem 0.3rem; font-family: 'Barlow', sans-serif; }

/* ---------- Alias ---------- */

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0.2rem 0.3rem 0.2rem 0.6rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.chip__x {
  background: none;
  border: 0;
  color: var(--slate);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.chip__x:hover { color: var(--stripe); }

.importer__form--panel {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 1rem;
  margin: 1.5rem 0;
  max-width: none;
}

.row--off td { opacity: 0.5; }

/* =====================================================================
   Calendario
   ===================================================================== */

.matchday {
  border: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 1rem;
}

.matchday__head {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--rule);
}

/* El número de jornada, tratado como una casilla del marcador */
.matchday__number {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  min-width: 2.4rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  color: #fff;
  background: var(--board);
  border-radius: var(--radius);
}

.matchday__meta {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-right: auto;
}

.matchday__meta input,
.matchday__meta select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.matchday__tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Enfrentamientos ---------- */

.pairs {
  list-style: none;
  margin: 0;
  padding: 0.4rem 1rem 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.15rem 1.5rem;
}

.pair {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--paper);
}

.pair__team { font-weight: 500; }

.pair__team--repo { color: var(--slate); }

.pair__vs {
  font-family: 'Barlow Condensed', sans-serif;
  color: var(--slate);
  font-size: 0.95rem;
}

.pair__note {
  margin-left: auto;
  font-size: 0.8rem;
  color: #7A2230;
  white-space: nowrap;
}

.pairs__empty,
.pairs__resting {
  margin: 0;
  padding: 0.5rem 1rem 0.8rem;
  color: var(--slate);
  font-size: 0.9rem;
}

.pairs__resting {
  border-top: 1px solid var(--paper);
}

@media (max-width: 640px) {
  .matchday__head { gap: 0.75rem; }
  .matchday__meta { width: 100%; }
  .pairs { grid-template-columns: 1fr; }
  .pair__note { margin-left: 0; }
}

/* ---------- Rondas de eliminatoria ---------- */

.stagelist {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.stagelist li { padding-left: 0.2rem; }

.stagelist strong {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.stagelist span {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Las fechas de eliminatoria llevan el número en el rojo del pin */
.matchday--playoff .matchday__number { background: var(--stripe); }

/* ---------- Correr el calendario ---------- */

.shiftform__row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.shiftform input[type="number"] {
  font: inherit;
  width: 4.2rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.shiftform button { white-space: nowrap; }

@media (max-width: 640px) {
  .shiftform { width: 100%; }
}

/* =====================================================================
   Captura de resultados
   ===================================================================== */

.sheet {
  border: 1px solid var(--rule);
  background: var(--card);
  margin-bottom: 1rem;
}

.sheet__team {
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--board);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sheet__note {
  margin: 0;
  padding: 1rem;
  color: var(--slate);
}

.sheet__table {
  width: 100%;
  border-collapse: collapse;
}

/* Scroll horizontal en vez de comprimir el select de jugador hasta
   cortar el nombre — así el anotador siempre ve con quién quedó
   asociada cada línea antes de guardar. */
.sheet__table-wrap,
.addindividual__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet__table th,
.sheet__table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

.sheet__table thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  color: var(--slate);
  font-size: 1rem;
  border-bottom: 1px solid var(--rule);
}

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

.sheet__who { width: 40%; }

/* Cada fila es un jugador (o "Ausente"): se busca por nombre (mismo
   buscador que "+ Agregar jugador") y su HDCP se muestra aparte, solo
   informativo. Una fila extra por cupo (agregada con "+ Cambiar
   jugador") permite el cambio de jugador a media fecha. */
.rowcombobox {
  position: relative;
  display: block;
}

.rowquery {
  font: inherit;
  width: 100%;
  max-width: 20rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.rowsuggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  max-height: 14rem;
  overflow-y: auto;
}

/* La lista de "Cambiar jugador" es una sola compartida, fuera de la
   tabla con scroll horizontal (que si no, la recorta al abrirla sobre
   la última fila) — el JS la posiciona en coordenadas de pantalla sobre
   el campo activo, así que acá va con position: fixed en vez de
   absolute/relativo a la celda. */
.rowsuggestions--portal {
  position: fixed;
  top: auto;
  left: auto;
  right: auto;
  z-index: 60;
}

.rowsuggestions li {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--ink);
}

.rowsuggestions li:hover { background: var(--paper); }

.rowsuggestions li:focus,
.rowsuggestions li:focus-visible {
  background: var(--board);
  color: #fff;
  outline: none;
}

.rowhcp {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  color: var(--slate);
}

/* Las casillas de score, tratadas como el marcador: anchas, tabulares */
.sheet__table input[type="number"] {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  width: 100%;
  min-width: 3.2rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sheet__table input[type="number"]:focus { border-color: var(--board); }

.sheet__table input:disabled,
.rowquery:disabled {
  background: var(--paper);
  color: var(--slate);
}

.lineup-actions {
  white-space: nowrap;
  text-align: right;
}

/* Fila "Ausente": la línea que le falte a un jugador real de su mismo
   cupo se completa sola al guardar, sin casilla ni chequecito. */
.linecell { min-width: 6.5rem; }

.linecell__auto {
  display: inline-block;
  color: var(--slate);
  font-style: italic;
}

.linecell__auto[hidden] { display: none; }

.sheet__who-note {
  display: block;
  font-size: 0.72rem;
  color: var(--slate);
  margin-top: 0.25rem;
  font-weight: 400;
}

.sheet__who-note[hidden] { display: none; }

/* Confirmación cruzada y fotos de respaldo, debajo de la tabla de cada
   equipo en la captura de un enfrentamiento. */
.sheet__confirm,
.sheet__photos {
  margin-top: 0.9rem;
}

.sheet__photos-label {
  font-size: 0.85rem;
  color: var(--slate);
  margin: 0 0 0.4rem;
}

/* Formulario de subir fotos: estructura propia, sin reusar .inlineform /
   .field / .field--grow. Esas clases compartidas traen otras reglas (un
   @media que las vuelve columna, .field { display:grid }, etc.) que
   competían con lo que necesitábamos acá y el resultado salía distinto
   según si el input decía "Ningún archivo" o "3 archivos" — a veces
   alcanzaba a empujar el botón a su propia línea y a veces no, y por eso
   los dos equipos se veían distinto sin motivo real. Con flex-basis en 0
   (via width:0 + flex-grow) el ancho del input deja de depender de su
   contenido, así que el layout ya no cambia según cuántos archivos haya
   elegidos. */
.sheet__photoform {
  margin-top: 0.9rem;
}

.sheet__photoform-label {
  display: block;
  font-size: 0.85rem;
  color: var(--slate);
  margin: 0 0 0.4rem;
}

.sheet__photoform-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.6rem;
}

.sheet__photoform-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 100%;
}

.sheet__photoform-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sheet__photoform-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sheet__photoform-btn {
    width: 100%;
  }
}

.photogallery {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  margin: 0 0 0.75rem;
}

.photogallery li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 7rem;
}

.photogallery img {
  width: 100%;
  height: 7rem;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.photogallery .muted { font-size: 0.72rem; }

/* Vista previa en vivo de quién va ganando cada línea, mientras se
   escriben los pines (antes del formulario de captura). */
.linepreview {
  margin: 1rem 0 1.4rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}

.linepreview__title {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.linepreview__note {
  font-size: 0.8rem;
  margin: 0 0 0.75rem;
}

.linepreview__lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.linepreview__line {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  padding: 0.6rem 0.7rem;
}

.linepreview__line-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

/* Los dos equipos, uno al lado del otro cuando hay espacio; se van a
   columna en celular (ver @media más abajo). */
.linepreview__teams {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.linepreview__detail {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
}

.linepreview__detail caption {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--slate);
  margin: 0 0 0.2rem;
}

.linepreview__detail td {
  padding: 0.15rem 0.3rem 0.15rem 0;
  border: 0;
}

.linepreview__detail-label {
  color: var(--slate);
  width: 1.6rem;
}

.linepreview__detail-total {
  font-weight: 600;
  border-top: 1px solid var(--rule);
}

.linepreview__line-result {
  font-size: 0.82rem;
  color: var(--slate);
  margin: 0.5rem 0 0;
  text-align: right;
}

.linepreview__summary {
  font-size: 0.82rem;
  margin: 0.6rem 0 0;
}

.lineup-actions .btn-addplayer,
.lineup-actions .btn-removerow {
  font-size: 0.78rem;
}

.sheet__hint {
  color: var(--slate);
  margin: 0 0 1.25rem;
  max-width: 44rem;
}

/* ---------- Agregar jugador individual (lado de reposición) ---------- */

.addindividual {
  margin: 0 1rem 1.25rem;
}

.addindividual > summary {
  cursor: pointer;
  list-style: none;
}

.addindividual > summary::-webkit-details-marker { display: none; }

.addindividual__form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.8rem;
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.addindividual__form .field { flex: 1 1 12rem; }

.addindividual__combobox {
  position: relative;
}

.addindividual__query {
  font: inherit;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.addindividual__suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  max-height: 14rem;
  overflow-y: auto;
}

.addindividual__suggestions li {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  color: var(--ink);
}

.addindividual__suggestions li:hover {
  background: var(--paper);
}

/* Antes quitaba el outline sin reemplazarlo por nada visible: quien
   tabulaba hasta acá no tenía forma de saber cuál sugerencia estaba
   por elegir. */
.addindividual__suggestions li:focus,
.addindividual__suggestions li:focus-visible {
  background: var(--board);
  color: #fff;
  outline: none;
}

.addindividual__form .field--num {
  flex: 0 0 4rem;
}

.addindividual__form .field--num input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.addindividual__form .btn {
  flex: 0 0 auto;
}

/* ---------- Cierre de fecha ---------- */

.closedate {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--stripe);
  background: var(--card);
  padding: 1rem 1.2rem;
  margin-top: 1.5rem;
}

.closedate > div { flex: 1 1 22rem; }

.closedate__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
}

.closedate__note {
  margin: 0;
  color: var(--slate);
  font-size: 0.95rem;
}

.notice__action { display: inline-block; margin-left: 0.4rem; }
.notice__action form { display: inline; }

.closedate__note--blocked {
  color: #7A2E2E;
  font-weight: 600;
}

.field--check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--slate);
  margin-top: 0.6rem;
}
.field--check input[type="checkbox"] { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }

/* ---------- Bloqueo de cierre por enfrentamientos pendientes ---------- */

.closeblock {
  border: 1px solid #E3B8B8;
  border-left: 3px solid #A83A3A;
  background: #FBEFEF;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.closeblock__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem;
  margin: 0 0 0.3rem;
  color: #7A2E2E;
}

.closeblock__note {
  margin: 0 0 0.5rem;
  color: #7A2E2E;
  font-size: 0.92rem;
}

.closeblock__list {
  margin: 0;
  padding-left: 1.1rem;
}
.closeblock__list li { margin-bottom: 0.2rem; }
.closeblock__list a { color: #7A2E2E; text-decoration: underline; }

/* ---------- Reabrir fecha ---------- */

.reopendate {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--lane);
  background: #FBF6EC;
  padding: 1rem 1.2rem;
  margin: 0 0 1.25rem;
}

.reopendate > div { flex: 1 1 22rem; }

.reopendate__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
  color: #5A4A31;
}

.reopendate__note {
  margin: 0;
  color: #5A4A31;
  font-size: 0.95rem;
}

.btn--warn {
  background: var(--lane);
  /* Texto blanco sobre este tono de arce da 2.65:1, por debajo del
     mínimo de accesibilidad (4.5:1). Con el navy del sitio da 5.4:1. */
  color: var(--ink);
}

.btn--warn:hover { background: #A87A38; }

@media (max-width: 640px) {
  /* La captura en el celular ya no es una tabla angosta con scroll
     horizontal: cada fila (un jugador o el "ausente") se convierte en
     una tarjeta con sus campos apilados, con la etiqueta de cada uno
     (data-label) arriba del valor. Así el nombre, el HDCP y las líneas
     quedan siempre a la vista sin desplazar la pantalla a los lados. */
  .sheet__table-wrap,
  .addindividual__table-wrap { overflow-x: visible; }

  .sheet__table { min-width: 0; width: 100%; border-collapse: collapse; }
  .sheet__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sheet__table tbody { display: block; }

  .sheet__table tr.lineup-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--card);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.6rem;
  }

  .sheet__table tr.lineup-row td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .sheet__table tr.lineup-row td.sheet__who { grid-column: 1 / -1; }
  .sheet__table tr.lineup-row td.lineup-actions { grid-column: 1 / -1; text-align: right; padding-top: 0.2rem; }

  .sheet__table tr.lineup-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--slate);
    margin-bottom: 0.15rem;
  }

  .sheet__who .rowquery { width: 100%; min-width: 0; }
  .sheet__table input[type="number"] { width: 100%; min-width: 0; font-size: 1.1rem; padding: 0.35rem; }

  /* Asistente paso a paso (JS lo activa solo en la primera captura): una
     columna oculta desaparece de la tarjeta sin dejar hueco, y la barra
     de navegación queda fija abajo, siempre a mano sin importar cuánto
     se haya scrolleado. */
  .wizard-hidden { display: none !important; }

  .wizard-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.75rem;
    margin: 0;
    background: var(--card);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);
  }

  .wizard-nav__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .wizard-nav__error {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: var(--bad, #b42318);
  }

  .wizard-nav__label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate);
    text-align: center;
  }

  .wizard-nav__back,
  .wizard-nav__next {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* La tabla de reposición/individual (equipo, jugador, líneas) sigue
     siendo tabla, pero también en tarjetas apiladas para no scrollear. */
  .addindividual__table-wrap table {
    min-width: 0;
    width: 100%;
  }
  .addindividual__table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .addindividual__table-wrap tbody { display: block; }
  .addindividual__table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--card);
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.5rem;
  }
  .addindividual__table-wrap td { display: block; padding: 0; border: 0; text-align: left; }
  .addindividual__table-wrap td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--slate);
    margin-bottom: 0.15rem;
  }

  .closedate .btn { width: 100%; }
  .reopendate .btn { width: 100%; }

  /* Vista previa por línea: en celular los dos equipos se apilan (uno
     debajo del otro) en vez de codo a codo, para que la mini tabla
     J1/J2/J3/T de cada uno tenga ancho de sobra y no quede apretada. */
  .linepreview { padding: 0.75rem 0.85rem; }

  .linepreview__teams { flex-direction: column; }

  .linepreview__line-result { text-align: left; }
}

.catinput {
  font: inherit;
  width: 3.5rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
}

/* ---------- Edición en línea de inscripciones ---------- */

.rosterrow select,
.rosterrow .rr-hcp {
  font: inherit;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  max-width: 14rem;
}

.rr-hcpgroup {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rr-hcp {
  width: 4.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rosterrow .rr-edit[type="checkbox"] { width: 1.05rem; height: 1.05rem; }

/* =====================================================================
   Barra inferior fija (celular) — LigaPro instalada como app
   ===================================================================== */

.tabbar { display: none; }

@media (max-width: 640px) {
  :root { --tabbar-h: 58px; }

  /* El menú de arriba se reemplaza por la barra de abajo. */
  .topnav { display: none; }

  /* Deja espacio al final para que la barra fija no tape el contenido. */
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    background: var(--board);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.18);
  }

  .tabbar__link {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: var(--tabbar-h);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: #93A2B0;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
  }

  .tabbar__link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabbar__link:active { background: rgba(255, 255, 255, 0.06); }

  .tabbar__link.is-active { color: #fff; }

  .tabbar__link.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--stripe);
  }

  /* La barra de "Anterior / Siguiente" del asistente de captura queda
     justo encima de la barra inferior, no detrás. */
  .wizard-nav { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  /* Con el teclado abierto (escribiendo un puntaje o buscando un
     jugador) la barra se esconde para no quitar espacio. */
  body.kb-open { padding-bottom: 0; }
  body.kb-open .tabbar { display: none; }
  body.kb-open .wizard-nav { bottom: 0; }
}

@media print {
  .tabbar { display: none !important; }
  body { padding-bottom: 0 !important; }
}


/* =====================================================================
   Ajustes responsive del celular
   ===================================================================== */

/* Texto auxiliar de un encabezado que en celular se oculta. */
@media (max-width: 640px) {
  .th-extra { display: none; }

  /* Barra superior en UNA sola fila: logo · temporada · Salir.
     El menú ya vive abajo, y el nombre de quien entró no cabe. */
  .topbar {
    flex-wrap: nowrap;
    gap: 0.65rem;
    padding: 0.55rem 0.9rem;
  }
  .topbar__who { display: none; }
  .topbar__session { margin-left: 0; flex-shrink: 0; }
  .brand__logo { height: 34px; }
  .seasontag {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
  }
  .seasonpick { order: 0; flex: 1 1 0; min-width: 0; width: auto; }
  .seasonpick select { width: 100%; max-width: none; }
  .topbar__public { flex: 1 1 0; min-width: 0; gap: 0.6rem; }
  .topbar__public .seasontag { flex: 1 1 0; }

  .shell { padding: 1.4rem 1rem 3rem; }

  /* Tablas de datos: menos aire lateral para que quepan sin scroll. */
  .table th, .table td { padding: 0.5rem 0.4rem; }
  .table thead th { font-size: 0.95rem; }

  /* Tablas del panel de administración: una tarjeta por fila, con la
     etiqueta de cada dato arriba del valor (data-label). Sin scroll
     horizontal. */
  .table--stack { border: 0; background: transparent; }
  .table--stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
  .table--stack tbody { display: block; }
  .table--stack tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.9rem;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.6rem;
  }
  .table--stack th,
  .table--stack td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .table--stack td.num { text-align: left; }
  .table--stack td:first-child {
    grid-column: 1 / -1;
    font-weight: 600;
    font-size: 1.02rem;
  }
  .table--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--slate);
    margin-bottom: 0.1rem;
  }
  .table--stack td:first-child[data-label]::before { display: none; }
  .table--stack td.rowactions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    padding-top: 0.5rem;
    margin-top: 0.1rem;
    border-top: 1px solid var(--rule);
  }
  .table--stack td.rowactions form { display: inline-flex; }
  .table--stack td:last-child:not([data-label]) { grid-column: 1 / -1; }
  .table--stack tr.row--off { opacity: 0.6; }
}

@media (max-width: 640px) {
  /* Lista de enfrentamientos / secciones: el texto puede encogerse y
     partir palabras largas en vez de empujar la pantalla hacia un lado. */
  .section__link { min-width: 0; padding: 0.85rem 0.8rem; overflow-wrap: anywhere; }
  .section__count { flex-shrink: 0; padding-right: 0.7rem; }
}

@media (max-width: 640px) {
  /* Ninguna tabla debe exigir 34rem de ancho en el celular: se ajustan
     al ancho de la pantalla (el scroll del contenedor queda solo como
     red de seguridad si algo no cabe). */
  .table-scroll .table { min-width: 0; }

  /* Botones de ícono (editar / borrar) con área táctil cómoda. */
  .iconbtn { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 480px) {
  /* Encabezados numéricos angostos (Líneas 200+, Series 600+, L1...). */
  .table--center thead th.num { font-size: 0.85rem; line-height: 1.15; padding-left: 0.2rem; padding-right: 0.2rem; }
}

/* El atributo hidden debe ganarle a cualquier display de una clase
   (p. ej. .rr-hcpgroup { display: inline-flex }), si no los controles de
   edición en línea aparecen aunque estén "ocultos". */
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .section__name { font-size: 1.2rem; }
}

@media (max-width: 640px) {
  /* La barra Anterior/Siguiente del asistente va fija (no sticky: un
     sticky de "bottom" se pierde apenas se pasa de su lugar en la página,
     y el formulario es largo). Se deja espacio al final del formulario
     para que no tape el último campo. */
  body.has-wizard-nav .shell { padding-bottom: 8rem; }
}

/* Perfil del jugador: detalle por jornada. */
.playerdetail { margin-top: 1.5rem; }
.playerdetail__note { margin: 0.4rem 0 0; font-size: 0.85rem; }

/* Lineaje Metrobowl (admin). */
.lineaje__summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1.25rem 0; }
.lineaje__stat { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.75rem 0.9rem; display: flex; flex-direction: column; min-width: 0; }
.lineaje__stat strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; line-height: 1.2; }
.lineaje__stat small { color: var(--slate); }
.lineaje__stat--main { border-color: var(--board); border-width: 2px; }
.lineaje__label { color: var(--slate); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.lineaje__actions { margin: 0 0 1rem; }
.lineaje__note { color: var(--slate); font-size: 0.85rem; margin-top: 0.75rem; }
.table-scroll .lineaje__matrix { min-width: 0; width: 100%; }
.lineaje__matrix th, .lineaje__matrix td { white-space: nowrap; }
.lineaje__matrix .num { text-align: center; }
.lineaje__team th { background: var(--paper); text-align: left; }
.lineaje__team small { font-weight: 400; color: var(--slate); margin-left: 0.4rem; }
.lineaje__sub td { background: var(--paper); font-weight: 600; }
.lineaje__matrix tfoot td { background: var(--board); color: #fff; font-weight: 700; }
.lineaje__sticky { position: sticky; left: 0; z-index: 1; background: var(--card); }
.lineaje__team .lineaje__sticky { background: var(--paper); }
.lineaje__sub .lineaje__sticky { background: var(--paper); }
.lineaje__matrix tfoot .lineaje__sticky { background: var(--board); }
.lineaje__matrix thead .lineaje__sticky { background: var(--board); color: #fff; }

@media (max-width: 640px) {
  .lineaje__summary { grid-template-columns: repeat(2, 1fr); }
  .lineaje__matrix th, .lineaje__matrix td { padding-left: 0.35rem; padding-right: 0.35rem; font-size: 0.85rem; }
  .lineaje__sticky { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
  .lineaje__team .lineaje__sticky { max-width: none; overflow: visible; }
}
