/* Americano de pádel: pista azul, líneas blancas, cristal alrededor y pelota amarilla como acento. */

:root {
  --pista: #1D4F9C;
  --pista-hondo: #143B78;
  --linea: rgba(255, 255, 255, 0.9);
  --bola: #DCEB3A;
  --bola-borde: #A8B51E;
  --bola-tinta: #2C3100;
  --cristal: #EAF0F6;
  --superficie: #FFFFFF;
  --tinta: #0F1C2E;
  --tinta-suave: #546378;
  --borde: #D3DCE7;
  --marcador: #0C1A2E;
  --acento-texto: #1D4F9C;
  --indicador: #1D4F9C;
  --rojo: #B3392A;
  --ok: #1E7A4C;
  --display: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --texto: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radio: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pista: #1C4A93;
    --pista-hondo: #0F2C5A;
    --cristal: #08111F;
    --superficie: #0F1D33;
    --tinta: #E6EDF6;
    --tinta-suave: #97A6BC;
    --borde: #22354F;
    --marcador: #050C17;
    --acento-texto: #9DBCF2;
    --indicador: #DCEB3A;
    --rojo: #F08470;
    --ok: #63CF95;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cristal);
  color: var(--tinta);
  font: 400 1rem/1.5 var(--texto);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

:focus-visible { outline: 3px solid var(--acento-texto); outline-offset: 2px; }
abbr { text-decoration: none; }
.muted { color: var(--tinta-suave); }
.center { text-align: center; }

/* ---------- Cabecera ---------- */

.masthead {
  background: var(--pista);
  color: #fff;
  border-bottom: 3px solid var(--linea);
  padding: calc(22px + env(safe-area-inset-top)) 16px 18px;
}
.masthead-inner { max-width: 960px; margin: 0 auto; }
.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 850;
  font-stretch: 125%;
  font-size: clamp(1.55rem, 6.4vw, 2.7rem);
  line-height: 0.98;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
/* Con enlace personal, el nombre del jugador manda: estrecho, enorme, y el torneo encima. */
.masthead h1.is-player {
  font-stretch: 72%;
  font-size: clamp(2.7rem, 12.5vw, 5rem);
  line-height: 0.9;
  letter-spacing: 0;
}
.kicker {
  margin: 0 0 8px;
  color: var(--bola);
  font: 800 clamp(0.95rem, 3.8vw, 1.2rem)/1.1 var(--display);
  font-stretch: 125%;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.masthead .meta { margin: 10px 0 0; color: rgba(255, 255, 255, 0.8); font-size: 0.92rem; }

.eyebrow {
  margin: 0 0 8px;
  font: 700 0.74rem/1.2 var(--display);
  font-stretch: 105%;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--acento-texto);
}
.next .eyebrow { color: var(--bola); }

/* ---------- Navegación: barra inferior en móvil, pestañas arriba en escritorio ---------- */

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--superficie);
  border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 4px;
  color: var(--tinta-suave);
  text-decoration: none;
  font: 750 0.7rem/1 var(--display);
  font-stretch: 110%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tabs a[aria-current="page"] { color: var(--tinta); }
.tabs a[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--indicador);
}

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabs {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    border-top: 0;
    border-bottom: 1px solid var(--borde);
    padding-bottom: 0;
  }
  .tabs a { min-height: 52px; padding: 0 18px; font-size: 0.78rem; }
  .tabs a[aria-current="page"]::before { top: auto; bottom: 0; left: 18px; right: 18px; border-radius: 3px 3px 0 0; }
}

main { max-width: 960px; margin: 0 auto; padding: 20px 16px 28px; outline: none; }
.loading { text-align: center; color: var(--tinta-suave); padding: 48px 0; }

/* ---------- Bloques comunes ---------- */

h2 {
  margin: 0 0 6px;
  font: 800 1.12rem/1.1 var(--display);
  font-stretch: 118%;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.panel {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 18px 16px;
  margin-bottom: 16px;
}
.panel-tight { max-width: 760px; margin-inline: auto; padding: 16px 12px 6px; }
.panel > p { margin: 0 0 12px; }
.section-head { margin-bottom: 12px; }
.section-head p { margin: 0; color: var(--tinta-suave); font-size: 0.9rem; }

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 6px 2px;
  border: 1px solid var(--borde);
  border-radius: 4px;
  color: var(--tinta-suave);
  font: 700 0.62rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.you {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 6px 2px;
  border-radius: 4px;
  background: var(--bola);
  color: var(--bola-tinta);
  font: 800 0.62rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.empty { max-width: 440px; margin: 0 auto; padding: 48px 8px; text-align: center; }
.empty p { color: var(--tinta-suave); margin: 0 0 18px; }
.empty-inline { color: var(--tinta-suave); padding: 12px 0; }
.hint-box {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px dashed var(--borde);
  border-radius: var(--radio);
  color: var(--tinta-suave);
  font-size: 0.92rem;
}

/* ---------- Botones y formularios ---------- */

.btn, .btn-small, .btn-ghost {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--texto);
  font-weight: 700;
  line-height: 1;
}
.btn { min-height: 46px; padding: 13px 18px; border: 0; background: var(--pista); color: #fff; font-size: 0.95rem; }
.btn:hover { background: var(--pista-hondo); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { min-height: 44px; padding: 12px 16px; border: 1px solid var(--borde); background: transparent; color: var(--tinta); font-size: 0.92rem; }
.btn-small { min-height: 36px; padding: 8px 12px; border: 1px solid var(--borde); background: var(--superficie); color: var(--tinta); font-size: 0.82rem; white-space: nowrap; }
.btn-ghost:hover, .btn-small:hover { border-color: var(--tinta-suave); }
.danger { color: var(--rojo) !important; }
.linklike { appearance: none; border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

.form .field, fieldset.field { display: grid; align-content: start; gap: 6px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.field > span, legend { font-weight: 700; font-size: 0.9rem; padding: 0; }
.field small { color: var(--tinta-suave); font-size: 0.8rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--cristal);
  color: var(--tinta);
  font: inherit;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

.check, .radio { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 0.94rem; }
.check input, .radio input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--pista); }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login { max-width: 400px; margin: 24px auto; }

/* ---------- Clasificación ---------- */

.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th {
  padding: 0 6px 8px;
  border-bottom: 2px solid var(--tinta);
  color: var(--tinta-suave);
  text-align: right;
  font: 700 0.68rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.standings td { padding: 11px 6px; border-bottom: 1px solid var(--borde); text-align: right; }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings .pos { width: 2.2em; text-align: left; }
.standings .name { width: 100%; text-align: left; }
.standings td.name { font-weight: 700; overflow-wrap: anywhere; }
.standings td.pos { font: 850 1.4rem/1 var(--display); font-stretch: 62%; color: var(--tinta-suave); }
.standings tr:nth-child(-n+3) td.pos { color: var(--tinta); }
.standings td.pts { font: 850 1.5rem/1 var(--display); font-stretch: 62%; }
.standings tr.is-me td { background: color-mix(in srgb, var(--bola) 24%, transparent); }

/* ---------- Partidos: cada partido es una pista vista desde arriba ---------- */

.next {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: var(--radio);
  background: var(--marcador);
  color: #fff;
}
.next-line { margin: 0; font-size: 1.05rem; }

.round { margin-bottom: 20px; }
.round > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 12px;
  list-style: none;
  cursor: pointer;
}
.round > summary::-webkit-details-marker { display: none; }
.round > summary h3 {
  margin: 0;
  font: 850 1.65rem/1 var(--display);
  font-stretch: 62%;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.round > summary::after {
  content: '';
  width: 9px;
  height: 9px;
  margin: 0 6px 4px auto;
  border-right: 2px solid var(--tinta-suave);
  border-bottom: 2px solid var(--tinta-suave);
  transform: rotate(45deg);
}
.round[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.round-state {
  padding: 4px 7px 3px;
  border: 1px solid var(--borde);
  border-radius: 4px;
  color: var(--tinta-suave);
  font: 700 0.66rem/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.round-state.is-live { background: var(--bola); border-color: var(--bola); color: var(--bola-tinta); }
.round .tag { margin-left: 0; vertical-align: 0; }
.rests { margin: 10px 2px 0; color: var(--tinta-suave); font-size: 0.88rem; }
.round-tools { margin: 10px 0 0; }

.courts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* El marco translúcido hace de cristal alrededor de la pista. */
.match {
  padding: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--pista) 16%, var(--superficie));
}
.match.is-mine { box-shadow: 0 0 0 2px var(--bola); }

/* Pista de 20 × 10 m: líneas de saque a 6,95 m de la red (15,25 % y 84,75 %) y línea central entre ellas. */
.court {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 6px;
  color: #fff;
  background-color: var(--pista);
  background-image:
    linear-gradient(var(--linea), var(--linea)),
    linear-gradient(var(--linea), var(--linea)),
    linear-gradient(var(--linea), var(--linea));
  background-size: 2px 100%, 2px 100%, 69.5% 2px;
  background-position: 15.25% 0, 84.75% 0, 50% 50%;
  background-repeat: no-repeat;
}
.net {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.95) 0 2px, rgba(255, 255, 255, 0.3) 2px 5px);
}
/* Cada jugador ocupa un cuadro de saque de su lado. */
.side { position: relative; display: grid; grid-template-rows: 1fr 1fr; align-items: center; min-width: 0; }
.side-a { padding: 0 8px 0 30.5%; }
.side-b { padding: 0 30.5% 0 8px; }
.pl {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.pl.is-me span {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bola);
  color: var(--bola-tinta);
  text-shadow: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.bug {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px 4px;
  border-radius: 6px;
  background: var(--marcador);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.bug b { font: 850 1.5rem/1 var(--display); font-stretch: 62%; color: rgba(255, 255, 255, 0.75); }
.bug b.win { color: var(--bola); }
.bug i { font-style: normal; color: rgba(255, 255, 255, 0.4); }
.bug .vs { padding: 3px 0; color: rgba(255, 255, 255, 0.7); font: 700 0.68rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; }

.match-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-height: 46px;
  padding: 6px 4px 0;
  color: var(--tinta-suave);
  font-size: 0.82rem;
}
.court-no { color: var(--tinta); font: 750 0.7rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

.score-form, .players-form { padding: 10px 4px 4px; }
.score-form { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 10px; align-items: end; }
.score-form label { display: grid; gap: 4px; color: var(--tinta-suave); font-size: 0.78rem; line-height: 1.25; }
.score-form input { background: var(--superficie); text-align: center; font: 850 1.7rem/1 var(--display); font-stretch: 62%; }
.score-form .dash { padding-bottom: 12px; font-weight: 700; }
.score-form .hint, .score-form .form-actions { grid-column: 1 / -1; }
.hint { margin: 0; color: var(--tinta-suave); font-size: 0.8rem; }
.players-form fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.players-form legend { margin-bottom: 4px; font-size: 0.82rem; }
.players-form select { background: var(--superficie); }
.players-form .hint { margin-bottom: 10px; }

/* ---------- Votar ---------- */

.vote-intro { margin-bottom: 16px; }
.vote-intro > p { margin: 0 0 12px; color: var(--tinta-suave); }
.vote-progress { display: flex; flex-wrap: wrap; gap: 8px; }
.vote-progress span {
  padding: 6px 11px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--superficie);
  font-size: 0.86rem;
}
.vote-progress span.is-done { border-color: var(--ok); color: var(--ok); }

/* Tu top: puestos numerados que se van llenando con lo que tocas en la lista. */
.top-list { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: none; }
.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 6px 4px 10px;
  border: 1px dashed var(--borde);
  border-radius: 8px;
  color: var(--tinta-suave);
}
.slot.is-filled { border-style: solid; background: var(--cristal); color: var(--tinta); }
.slot.is-next { border-color: var(--acento-texto); color: var(--acento-texto); }
.slot-n { flex: none; width: 1.4em; text-align: right; font: 850 1.5rem/1 var(--display); font-stretch: 62%; }
.slot.is-filled .slot-n { color: var(--acento-texto); }
.slot-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.slot:not(.is-filled) .slot-name { font-weight: 400; font-size: 0.88rem; }
.slot-tools { display: flex; flex: none; gap: 2px; }
.icon-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--tinta);
  font: 700 1.05rem/1 var(--texto);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--superficie); }
.icon-btn:disabled { opacity: 0.25; cursor: default; }

.pool-label { margin: 0 0 8px; color: var(--tinta-suave); font-size: 0.86rem; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.pool-chip {
  appearance: none;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--tinta);
  font: 700 0.9rem/1.1 var(--texto);
  cursor: pointer;
}
.pool-chip:hover:not(:disabled) { border-color: var(--acento-texto); }
.pool-chip:disabled { opacity: 0.4; cursor: default; }

/* Los premios a votar: una tarjeta por premio con su desplegable. */
.ballot-awards { margin-top: 24px; }
.pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.pick-card { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); }
.pick-card .award-desc { flex: 1; margin-bottom: 10px; }
.pick-card select { background: var(--cristal); font-weight: 700; }
.pick-card.is-done { border-color: var(--ok); }
.pick-card.is-done select { border-color: var(--ok); }

.warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bola) 30%, var(--superficie));
  font-size: 0.9rem;
}

/* ---------- Premios ---------- */

.award-group { margin-bottom: 26px; }
.awards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.award { padding: 16px; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); }
.award-title {
  margin: 0;
  color: var(--acento-texto);
  font: 800 0.76rem/1.2 var(--display);
  font-stretch: 118%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.award-desc { margin: 4px 0 12px; color: var(--tinta-suave); font-size: 0.85rem; }
.award-winner { margin: 8px 0 0; font: 850 1.75rem/1.02 var(--display); font-stretch: 72%; overflow-wrap: anywhere; }
.award-value { margin: 4px 0 0; font-size: 0.88rem; }
.award-none { margin: 0; color: var(--tinta-suave); font-size: 0.9rem; }
.tie { margin-left: 4px; padding: 2px 5px; border-radius: 3px; background: var(--bola); color: var(--bola-tinta); letter-spacing: 0.06em; }
.runners { display: grid; gap: 6px; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--borde); list-style: none; font-size: 0.9rem; }
.runners li { display: flex; align-items: baseline; gap: 8px; }
.runners .rank { flex: none; width: 1.1em; color: var(--tinta-suave); font: 850 1.05rem/1 var(--display); font-stretch: 62%; }
.runners .who { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.runners .v { margin-left: auto; color: var(--tinta-suave); font-size: 0.8rem; text-align: right; }

/* Los dos premios principales, sobre azul de pista. */
.award.is-featured { border-color: var(--pista); background: var(--pista); color: #fff; }
.award.is-featured .award-title { color: var(--bola); }
.award.is-featured .award-desc, .award.is-featured .runners .v, .award.is-featured .runners .rank { color: rgba(255, 255, 255, 0.75); }
.award.is-featured .runners { border-top-color: rgba(255, 255, 255, 0.25); }

/* Top de los jugadores: la lista completa sobre azul de pista. */
.top-card { margin-bottom: 12px; }
.top-ranking { display: grid; gap: 0 28px; margin: 6px 0 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .top-ranking { grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); } }
.top-ranking li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.top-ranking .rank { flex: none; width: 1.3em; color: var(--bola); font: 850 1.4rem/1 var(--display); font-stretch: 62%; text-align: right; }
.top-ranking .who { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.top-ranking .v { margin-left: auto; color: rgba(255, 255, 255, 0.75); font-size: 0.82rem; white-space: nowrap; }
.top-ranking li.is-first .who { font: 850 1.5rem/1.05 var(--display); font-stretch: 72%; }

.reveal-wait { max-width: 460px; margin: 0 auto; padding: 48px 8px; text-align: center; }
.reveal-wait h2 { font-size: 1.5rem; }
.reveal-wait p { color: var(--tinta-suave); margin: 0 0 18px; }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bola) 32%, var(--superficie));
}
.banner p { margin: 0; font-size: 0.92rem; }

/* ---------- Organización ---------- */

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
}
.segmented button {
  flex: 1 0 auto;
  appearance: none;
  padding: 11px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--tinta-suave);
  cursor: pointer;
  font: 750 0.74rem/1 var(--display);
  font-stretch: 108%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.segmented button[aria-pressed="true"] { background: var(--pista); color: #fff; }

.switch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--borde); }
.panel h2 + .switch-row { border-top: 0; padding-top: 4px; }
.switch-row p { margin: 2px 0 0; color: var(--tinta-suave); font-size: 0.88rem; }

.player-list { margin: 0; padding: 0; list-style: none; }
.player-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--borde); }
.pr-main { display: grid; gap: 2px; min-width: 0; }
.pr-main b { overflow-wrap: anywhere; }
.pr-main small { color: var(--tinta-suave); font-size: 0.8rem; }
.player-row.is-off .pr-main b { color: var(--tinta-suave); }
.pr-actions { display: flex; align-items: center; gap: 6px; }
.more { position: relative; }
.more summary { list-style: none; letter-spacing: 0.1em; }
.more summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  display: grid;
  min-width: 210px;
  padding: 4px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--superficie);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.menu button { padding: 11px 12px; border: 0; border-radius: 6px; background: none; color: var(--tinta); font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--cristal); }

.cat-row { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--borde); }
.cat-row.is-off input { opacity: 0.6; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 680px) {
  .cat-row { grid-template-columns: 1fr 1.6fr auto; align-items: center; }
}

.participation { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 18px; margin: 0; padding: 0; list-style: none; }
.participation li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--borde); font-size: 0.92rem; }
.participation b { font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; }
.ratings { min-width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.ratings th, .ratings td { padding: 8px; border-bottom: 1px solid var(--borde); text-align: right; white-space: nowrap; }
.ratings thead th { color: var(--tinta-suave); font: 700 0.68rem/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: bottom; }
.ratings th:first-child { text-align: left; }

/* ---------- Pie y avisos ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 4px 16px 28px;
  color: var(--tinta-suave);
  font-size: 0.86rem;
}
.foot a { color: var(--tinta-suave); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--marcador);
  color: #fff;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: #B3392A; }
@media (min-width: 760px) { #toast { bottom: 24px; } }

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