/* Web pública: portada (/) e partidos (/partidos). Cárgase despois de base.css.
   Deseño OSIX: esquinas rectas, filetes finos en vez de caixas, titulares 800
   con interletrado negativo, múltiplos de 8 px. Tema de Nadal: noite escura,
   tinta clara e grises; a única cor está nas luces do fondo. */

/* ---------- Tema de Nadal: noite escura ----------
   Só nestas páxinas (a mesa non carga esta folla e segue clara): redefínense os
   tokens de base.css, e todo o que os usa (cabeceira, navegación, botóns, punto
   «en xogo», foco) pasa a claro sobre escuro. En papel quedan os de base.css. */
@media screen {
  :root {
    color-scheme: dark;
    --ink: #f3f5f9;        /* texto: 17,3:1 sobre o fondo */
    --paper: #0b1120;      /* fondo (= theme-color) */
    --surface: #1b2337;    /* empate na táboa, hover dos botóns */
    --muted: #aeb6c4;      /* texto secundario: 9,2:1 */
    --accent: #8f98a8;     /* 6,5:1 */
    --line: rgb(255 255 255 / .13);
    --line-strong: rgb(255 255 255 / .28);
    --backing: rgb(11 17 32 / .86); /* --paper case opaco, detrás do texto */
  }
}

/* Excepcións á escala de grises, só na clasificación: barra verde dos que pasan,
   vermella dos que non, e o punto «En xogo». 10,6:1 e 6,1:1 sobre o fondo. */
:root {
  --verde: #3ddc84;
  --vermello: #ff5a4f;
}

/* O fondo vai en html para que as luces (z-index −1) se pinten por riba del. */
html { background: var(--paper); }
body { background: transparent; }

/* ---------- Luces de Nadal ----------
   Lámpadas soltas repartidas por toda a pantalla. Cada unha é un radial-gradient
   en mosaico; os tamaños de tesela son primos distintos, así que o debuxo non
   repite á vista e parece ao chou. A capa de base pinta as lámpadas apagadas;
   catro capas máis pintan o brillo de cada cor (vermello, verde, ouro, azul) e
   acenden e apagan cada unha ao seu ritmo. Sen JS: só se anima a opacidade. */
.luces {
  position: fixed; top: 0; left: 0; z-index: -1;
  width: 100%; height: 100vh; height: 100lvh; /* lvh: non cambia ao esconderse a barra do navegador */
  overflow: hidden; pointer-events: none;
  background-image:
    radial-gradient(circle, rgb(255 60 48 / .5) 0 2.4px, rgb(255 60 48 / .16) 3.4px, rgb(255 60 48 / 0) 4.6px),
    radial-gradient(circle, rgb(255 60 48 / .5) 0 2.4px, rgb(255 60 48 / .16) 3.4px, rgb(255 60 48 / 0) 4.6px),
    radial-gradient(circle, rgb(255 60 48 / .5) 0 2.4px, rgb(255 60 48 / .16) 3.4px, rgb(255 60 48 / 0) 4.6px),
    radial-gradient(circle, rgb(255 60 48 / .5) 0 2.4px, rgb(255 60 48 / .16) 3.4px, rgb(255 60 48 / 0) 4.6px),
    radial-gradient(circle, rgb(48 224 110 / .5) 0 2.4px, rgb(48 224 110 / .16) 3.4px, rgb(48 224 110 / 0) 4.6px),
    radial-gradient(circle, rgb(48 224 110 / .5) 0 2.4px, rgb(48 224 110 / .16) 3.4px, rgb(48 224 110 / 0) 4.6px),
    radial-gradient(circle, rgb(48 224 110 / .5) 0 2.4px, rgb(48 224 110 / .16) 3.4px, rgb(48 224 110 / 0) 4.6px),
    radial-gradient(circle, rgb(48 224 110 / .5) 0 2.4px, rgb(48 224 110 / .16) 3.4px, rgb(48 224 110 / 0) 4.6px),
    radial-gradient(circle, rgb(255 190 60 / .5) 0 2.4px, rgb(255 190 60 / .16) 3.4px, rgb(255 190 60 / 0) 4.6px),
    radial-gradient(circle, rgb(255 190 60 / .5) 0 2.4px, rgb(255 190 60 / .16) 3.4px, rgb(255 190 60 / 0) 4.6px),
    radial-gradient(circle, rgb(255 190 60 / .5) 0 2.4px, rgb(255 190 60 / .16) 3.4px, rgb(255 190 60 / 0) 4.6px),
    radial-gradient(circle, rgb(255 190 60 / .5) 0 2.4px, rgb(255 190 60 / .16) 3.4px, rgb(255 190 60 / 0) 4.6px),
    radial-gradient(circle, rgb(70 150 255 / .5) 0 2.4px, rgb(70 150 255 / .16) 3.4px, rgb(70 150 255 / 0) 4.6px),
    radial-gradient(circle, rgb(70 150 255 / .5) 0 2.4px, rgb(70 150 255 / .16) 3.4px, rgb(70 150 255 / 0) 4.6px),
    radial-gradient(circle, rgb(70 150 255 / .5) 0 2.4px, rgb(70 150 255 / .16) 3.4px, rgb(70 150 255 / 0) 4.6px),
    radial-gradient(circle, rgb(70 150 255 / .5) 0 2.4px, rgb(70 150 255 / .16) 3.4px, rgb(70 150 255 / 0) 4.6px);
  background-size: 173px 211px, 191px 269px, 199px 251px, 179px 233px, 229px 197px, 263px 181px, 241px 293px, 293px 257px, 251px 283px, 211px 307px, 271px 193px, 257px 311px, 307px 239px, 281px 227px, 223px 263px, 233px 199px;
  background-position: 115px 143px, 47px 262px, 77px 36px, 167px 189px, 219px 119px, 243px 161px, 23px 275px, 80px 7px, 115px 260px, 157px 95px, 21px 152px, 32px 30px, 300px 48px, 48px 114px, 101px 231px, 9px 48px;
}
.luces > span {
  position: absolute; inset: 0;
  opacity: .08;
  animation: luz 3s ease-in-out infinite;
}
.luces > span:nth-child(1) {
  background-image: var(--on), var(--on), var(--on), var(--on);
  --on: radial-gradient(circle, #fff 0 1.3px, rgb(255 60 48) 2.8px, rgb(255 60 48 / .5) 5.5px, rgb(255 60 48 / .14) 10px, rgb(255 60 48 / 0) 17px);
  background-size: 173px 211px, 191px 269px, 199px 251px, 179px 233px;
  background-position: 115px 143px, 47px 262px, 77px 36px, 167px 189px;
  animation-duration: 2.9s; animation-delay: -.4s;
}
.luces > span:nth-child(2) {
  background-image: var(--on), var(--on), var(--on), var(--on);
  --on: radial-gradient(circle, #fff 0 1.3px, rgb(48 224 110) 2.8px, rgb(48 224 110 / .5) 5.5px, rgb(48 224 110 / .14) 10px, rgb(48 224 110 / 0) 17px);
  background-size: 229px 197px, 263px 181px, 241px 293px, 293px 257px;
  background-position: 219px 119px, 243px 161px, 23px 275px, 80px 7px;
  animation-duration: 3.5s; animation-delay: -1.9s;
}
.luces > span:nth-child(3) {
  background-image: var(--on), var(--on), var(--on), var(--on);
  --on: radial-gradient(circle, #fff 0 1.3px, rgb(255 190 60) 2.8px, rgb(255 190 60 / .5) 5.5px, rgb(255 190 60 / .14) 10px, rgb(255 190 60 / 0) 17px);
  background-size: 251px 283px, 211px 307px, 271px 193px, 257px 311px;
  background-position: 115px 260px, 157px 95px, 21px 152px, 32px 30px;
  animation-duration: 4.1s; animation-delay: -3.0s;
}
.luces > span:nth-child(4) {
  background-image: var(--on), var(--on), var(--on), var(--on);
  --on: radial-gradient(circle, #fff 0 1.3px, rgb(70 150 255) 2.8px, rgb(70 150 255 / .5) 5.5px, rgb(70 150 255 / .14) 10px, rgb(70 150 255 / 0) 17px);
  background-size: 307px 239px, 281px 227px, 223px 263px, 233px 199px;
  background-position: 300px 48px, 48px 114px, 101px 231px, 9px 48px;
  animation-duration: 3.2s; animation-delay: -1.1s;
}
/* Acende, aguanta un pouco acesa e apaga: vivo pero sen escintilar. */
@keyframes luz { 0%, 100% { opacity: .08; } 38%, 62% { opacity: 1; } }
@media (forced-colors: active), print { .luces { display: none; } }

/* As luces quedan detrás do contido: cada bloque con texto leva un fondo case
   opaco da cor da noite (invisible sobre o fondo), así unha luz que caia detrás
   dun marcador ou dunha fila da táboa apenas se ve e o texto le limpo. */
.page > .eyebrow, .page-title, .section-head, .loading, .conn, .empty,
.board, .group, .legend, .ko, .day-title, .slot {
  background-color: var(--backing);
}

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

/* Cabeceira en teléfonos estreitos: a marca en dúas liñas para que caiba
   co menú en 360 px; se aínda así non cabe, o menú baixa en vez de desbordar. */
@media (max-width: 479px) {
  .site-header { flex-wrap: wrap; gap: 0 8px; }
  .brand { line-height: 1.1; }
  .brand span { display: block; }
  .site-nav { margin-left: auto; }
  .site-nav a { padding: 0 .5rem; font-size: .875rem; white-space: nowrap; }
}

/* Páxina */
.page { padding-block: 32px 96px; }

.loading { margin: 0; padding: 64px 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--muted); }

.conn {
  margin: 80px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: .8125rem; font-weight: 600; color: var(--muted);
}
.conn.is-offline { color: var(--ink); }

.section + .section { margin-top: clamp(4rem, 10vw, 7rem); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px;
}
.section-sub { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: var(--muted); }

.page > .eyebrow { margin: 0 0 8px; }
.page-title { font-size: clamp(2.25rem, 8vw, 4.5rem); letter-spacing: -.05em; }

/* Selector de categoría (botóns con aria-pressed) */
.seg {
  display: grid; grid-template-columns: repeat(var(--seg-n, 3), minmax(0, 1fr)); gap: 8px;
  max-width: 36rem; margin-top: 24px;
}
.seg-btn {
  min-width: 0; min-height: 48px; padding: 0 4px;
  border: 1.5px solid var(--ink); border-radius: 0;
  background: var(--backing); color: var(--ink);
  font-size: clamp(.8125rem, 3.6vw, .9375rem); font-weight: 700; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-btn:hover { background: var(--surface); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg--filter { --seg-n: 2; max-width: 44rem; margin-top: 32px; }
@media (min-width: 520px) { .seg--filter { --seg-n: 4; } }

/* Estado dun partido (en xogo / rematado) */
.state {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.state--live { color: var(--ink); }

.is-tbd { color: var(--muted); }

/* ---------- Portada: marcadores grandes ---------- */

.now-title { font-size: clamp(2.25rem, 8vw, 4.5rem); letter-spacing: -.05em; }

.boards { display: grid; gap: 48px; margin-top: 24px; }
@media (min-width: 900px) { .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; } }

.board { container-type: inline-size; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.board--live { border-top: 2px solid var(--ink); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 24px; }
.board-label { font-size: .875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.board-meta { margin: 4px 0 0; font-size: .9375rem; font-weight: 600; color: var(--muted); }

.board-rows { margin-top: 16px; }
.board-row {
  display: grid; align-items: center; column-gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name score" "gift score";
  padding: 8px 0; border-top: 1px solid var(--line);
}
/* Partido de grupo en xogo: frecha (ou igual) e posto actual, pequenos, nunha
   columna de ancho fixo á esquerda do marcador e centrados en altura con el.
   Os díxitos do marcador van a ancho fixo para que a columna non se mova. */
.board-row--mov {
  grid-template-columns: minmax(0, 1fr) 2.75rem auto;
  grid-template-areas: "name mov score" "gift mov score";
}
.board-row--mov .board-score { font-variant-numeric: tabular-nums; }
/* En pantallas estreitas o regalo co reno precisa todo o ancho ata o marcador:
   a frecha queda á altura do nome e o regalo pasa por debaixo dela. */
@media (max-width: 519px) {
  .board-row--mov { grid-template-areas: "name mov score" "gift gift score"; }
}
.board-team { grid-area: name; }
.board-score { grid-area: score; }
.board-gift { grid-area: gift; justify-self: start; min-width: 0; margin-top: 12px; }
.board-mov { grid-area: mov; justify-self: end; white-space: nowrap; }
.board-mov .mov { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; }
.board-row:first-child { border-top: 0; }
.board-team {
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-size: clamp(1.5rem, 7cqi, 2.75rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.05;
  overflow-wrap: break-word; hyphens: auto; text-wrap: balance;
}
.board-score {
  font-size: clamp(4rem, 18vw, 7rem);
  font-size: clamp(4rem, 22cqi, 9rem);
  font-weight: 800; letter-spacing: -.04em; line-height: .85; text-align: right;
  padding-right: .04em; /* compensa o interletrado negativo do último díxito */
}
.board--pending .board-team {
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-size: clamp(1.25rem, 6cqi, 2.25rem);
}
.board.has-winner .board-row:not(.is-winner) { color: var(--muted); }
.board.has-winner .board-row:not(.is-winner) .board-team { font-weight: 600; }

.board-pens {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: .875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.board-pens-score { font-size: 1.75rem; font-weight: 800; letter-spacing: -.04em; text-transform: none; }

/* ---------- Portada: clasificación ---------- */

.groups { display: grid; gap: 48px; margin-top: 40px; }
@media (min-width: 1180px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 64px; } }
.group h3 { margin-bottom: 16px; }

.standings { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.standings th, .standings td {
  padding: 12px 6px; border-bottom: 1px solid var(--line);
  text-align: right; white-space: nowrap; font-weight: 600;
}
.standings thead th {
  padding-top: 0; padding-bottom: 8px; border-bottom: 1px solid var(--ink);
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.standings abbr[title] { text-decoration: none; cursor: help; }
.standings .c-pos { width: 1%; padding-left: 12px; text-align: left; }
.standings .c-team {
  width: 100%; text-align: left; white-space: normal; font-weight: 700;
  overflow-wrap: break-word; hyphens: auto;
}
.standings td.c-pts { font-weight: 800; }
.standings tbody tr.is-q > :first-child { box-shadow: inset 4px 0 0 var(--verde); }
.standings tbody tr:not(.is-q) > :first-child { box-shadow: inset 4px 0 0 var(--vermello); }
.standings tbody tr.is-tied > * { background: var(--surface); }
.tie-mark { margin-left: 4px; font-weight: 800; }
/* «En xogo» xunto ao nome: vai enteiro; se non colle ao lado, baixa debaixo
   do nome (nunca empurra as columnas de números). */
.row-live {
  display: inline-block; margin-left: 4px; white-space: nowrap;
  font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--vermello);
}
.row-live .live-dot { margin-right: 6px; }

/* Movemento na clasificación (mov.js): frecha ou signo igual; verde se queda en
   postos de clasificación, vermello se non. */
.mov {
  display: inline-block; margin-left: 6px;
  font-size: 1rem; font-weight: 800; line-height: 1; letter-spacing: 0;
}
.mov-ico { display: inline-block; min-width: .75em; text-align: center; } /* frecha e igual ocupan o mesmo */
/* Punta de frecha (sen pau): trazo aberto, non triángulo. */
.mov-ico svg {
  display: inline-block; width: .7em; height: .7em; vertical-align: -.02em; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
/* Posto no que queda e, en negra, a diferenza de goles cando o decide. */
.mov-pos { font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.standings td.c-dg.is-decisive { font-weight: 800; }
.mov--q { color: var(--verde); }
.mov--out { color: var(--vermello); }

/* Caixa de regalo: corpo, tapa, cinta á esquerda e lazo por riba; o texto nunca
   queda sobre a cinta. Por defecto é a de «Actualmente clasificado»: vermello
   escuro con texto branco (6,6:1) e cinta dourada. */
.regalo {
  --caixa: #b3121d; --tapa: #8f0c15; --cinta: #f5c542; --texto: #fff;
  position: relative; display: inline-block;
  margin-top: 4px; padding: 6px 12px 6px 36px;
  background: var(--caixa); color: var(--texto);
  box-shadow: inset 0 3px 0 var(--tapa);
  font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1.3; white-space: nowrap;
}
.regalo::before {                                 /* cinta */
  content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 8px;
  background: var(--cinta);
}
.regalo::after {                                  /* lazo: dous aros */
  content: ""; position: absolute; left: 5px; top: -9px; width: 24px; height: 11px;
  background:
    radial-gradient(circle at 6px 6px, transparent 2.2px, var(--cinta) 2.8px 5px, transparent 5.6px),
    radial-gradient(circle at 18px 6px, transparent 2.2px, var(--cinta) 2.8px 5px, transparent 5.6px);
}
/* «Non clasifica actualmente»: o mesmo regalo todo en gris (texto branco, 5,9:1). */
.regalo--fora { --caixa: #5b6472; --tapa: #454d59; --cinta: #aab2bf; }
/* Regalo do posto final do torneo («1º Posto»… «4º Posto», ou «Empate» se van
   iguais): ouro, prata, bronce, azul e verde, todos do mesmo longo e con cinta e lazo vermellos. Texto escuro sobre
   ouro, prata e bronce, branco sobre azul e verde (todos por riba de 4,5:1). */
.regalo--posto {
  --cinta: #d81f2c; --texto: #17110a;
  box-sizing: border-box; width: 7.5rem; margin-top: 0;
}
.regalo--1 { --caixa: #f0c02a; --tapa: #c99a10; }
.regalo--2 { --caixa: #d3d8df; --tapa: #a4abb6; }
.regalo--3 { --caixa: #cd8544; --tapa: #a3642c; }
.regalo--4 { --caixa: #2a66dd; --tapa: #1c4bb0; --texto: #fff; }
.regalo--empate { --caixa: #17794a; --tapa: #0f5c37; --texto: #fff; }   /* verde de Nadal, van iguais */
.ko-team > .regalo, .ko-team > .regalo-tiro { margin-top: 14px; margin-bottom: 4px; }
.ko-team > .regalo { display: block; }
.ko-team > .regalo-tiro { display: flex; }
/* Partidos, final e 3º/4º posto co regalo. Estreito: cada equipo en dúas liñas
   (nome · goles, e debaixo o seu regalo). Con sitio: marcador nunha liña e
   centrado coma os demais partidos, e debaixo de cada nome o seu regalo. */
.fx--posto .fx-teams {
  grid-template-columns: minmax(0, 1fr) 1.5rem;
  grid-template-areas: "nh gh" "mh mh" "na ga" "ma ma";
}
.fx--posto .fx-mov { justify-content: flex-start; margin: 10px 0 8px; }
.fx--posto .fx-mov .regalo-tiro { margin-top: 0; }
@container (min-width: 520px) {
  .fx--posto .fx-teams {
    grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    grid-template-areas: "nh gh sep ga na" "mh . . . ma";
  }
  .fx--posto .fx-mov { margin: 6px 0 4px; }
  .fx--posto .fx-mov-home { justify-content: flex-end; }
}

/* ---------- Votación do público (votos.js) ----------
   Antes do partido: «A quen apoias?» con dous botóns. Despois de votar, e para
   sempre dende que empeza o partido: barra de dous tramos coa cor de cada equipo. */
.voto { margin-top: 16px; }
.voto-q {
  margin: 0 0 8px; font-size: .6875rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.voto-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.voto-btn {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-strong); background: var(--backing); color: var(--ink);
  font: inherit; font-size: .875rem; font-weight: 700; text-align: left; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.voto-btn::before {                               /* cor do equipo */
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--cor); box-shadow: 0 0 0 1px rgb(255 255 255 / .45);
}
.voto-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voto-btn:hover, .voto-btn:focus-visible { border-color: var(--ink); }
.voto-btn:disabled { opacity: .5; cursor: default; }
.voto-bar { display: flex; gap: 3px; height: 10px; }
.voto-seg {
  flex: 0 1 0; min-width: 6px; background: var(--cor);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3);   /* que se vexan tamén as cores escuras */
  transition: flex-grow .4s var(--ease);
}
.voto-info {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 6px;
  font-size: .75rem; font-weight: 700; color: var(--ink);
}
/* En Partidos, con sitio, o bloque vai centrado baixo o marcador. */
@container (min-width: 520px) { .fx .voto { max-width: 24rem; margin-inline: auto; } }

/* O reno que tira do regalo: voa (sobe e baixa un pouco, pivotando no extremo da
   corda que vai atada á caixa) e a nariz vermella acende e apaga. */
.regalo-tiro { display: inline-flex; align-items: flex-end; margin-top: 4px; }
.regalo-tiro .regalo { margin-top: 0; }
.reno {
  flex: none; width: 56px; height: 32px; margin-bottom: -3px; overflow: visible;
  transform-origin: 0 62%;
  animation: reno-voa 2.6s ease-in-out infinite;
}
.reno path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.reno-corda { stroke: #f5c542; stroke-width: 1; }
.reno-corpo, .pata path { stroke: #a9713f; stroke-width: 1.9; }
.pata.lonxe path { stroke: #8a5a30; }             /* as do outro lado, máis escuras */
/* Galope no aire: a coxa bota a pata adiante e empuxa cara atrás; a canela
   encóllese ao recoller e estírase ao empuxar. Diante e detrás van a contratempo. */
.pata { animation: pata-dian .72s ease-in-out infinite; }
.pata.tras { animation-name: pata-tras; }
.canela { animation: canela .72s ease-in-out infinite; }
@keyframes pata-dian { 0%, 100% { transform: rotate(38deg); } 50% { transform: rotate(-52deg); } }
@keyframes pata-tras { 0%, 100% { transform: rotate(46deg); } 50% { transform: rotate(-34deg); } }
@keyframes canela {
  0%, 100% { transform: rotate(8deg); }
  22% { transform: rotate(78deg); }
  50% { transform: rotate(-6deg); }
}
.reno .reno-pel { fill: #c08a55; stroke: none; }
.reno-cornos { stroke: #e9d3a8; stroke-width: 1.2; }
.reno-arnes { stroke: #f5c542; stroke-width: 1.6; }
.reno-ollo { fill: #1a1208; }
.reno-nariz { fill: #ff2d20; animation: reno-nariz 1.1s ease-in-out infinite; }
.reno-halo { opacity: .4; }
@keyframes reno-voa {
  0%, 100% { transform: translateY(1px) rotate(4deg); }
  50% { transform: translateY(-2px) rotate(-5deg); }
}
@keyframes reno-nariz { 50% { opacity: .2; } }
/* Estreliñas que pasan de diante cara atrás: dan sensación de avance. */
.reno .estrela { animation: estrela 1.1s linear infinite; }
.reno .estrela path { fill: #ffe9a8; stroke: none; }
@keyframes estrela {
  0% { transform: translate(60px, var(--y)) scale(var(--s)); opacity: 0; }
  15% { opacity: 1; }
  75% { opacity: .8; }
  100% { transform: translate(6px, var(--y)) scale(calc(var(--s) * .5)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reno, .reno-nariz, .pata, .canela { animation: none; }
  .reno .estrela { animation: none; opacity: 0; }
}
/* En teléfonos moi estreitos non colle ao lado do regalo sen pisar o marcador. */
@media (max-width: 349px) { .reno { display: none; } }

@media (max-width: 559px) {
  .standings .c-x { display: none; }
  .standings th, .standings td { padding-inline: 4px; }
  .standings .c-pos { padding-left: 12px; }
}

.tie-note { margin: 12px 0 0; font-size: .875rem; font-weight: 600; }
.legend {
  display: flex; align-items: center; gap: 8px;
  margin: 24px 0 0; font-size: .8125rem; font-weight: 600; color: var(--muted);
}
.legend-q { flex-shrink: 0; width: 4px; height: 16px; background: var(--verde); }

/* ---------- Portada: fase final ---------- */

.ko-section { margin-top: 64px; }
.ko-grid { display: grid; gap: 32px; margin: 24px 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .ko-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; } }
@media (min-width: 1180px) { .ko-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ko { padding-top: 12px; border-top: 1px solid var(--line-strong); }
.ko--live { border-top: 2px solid var(--ink); }
.ko-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.ko-phase { font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
.ko-when { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.ko--live .ko-when { color: var(--ink); }
.ko-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 4px 0; }
.ko-team { font-weight: 600; overflow-wrap: break-word; }
.ko-team.is-tbd { font-weight: 500; }
.ko-score { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; text-align: right; }
.ko-row.is-winner .ko-team { font-weight: 800; }
.ko.has-winner .ko-row:not(.is-winner) .ko-team { font-weight: 500; }
.ko.has-winner .ko-row:not(.is-winner) .ko-score { color: var(--muted); }
.ko-pens { margin: 4px 0 0; font-size: .8125rem; font-weight: 600; color: var(--muted); }

/* ---------- Partidos: liña do tempo ---------- */

.timeline { margin-top: 48px; max-width: 60rem; }
.day + .day { margin-top: 80px; }
.day-title { margin-bottom: 8px; }

.slots, .fixtures { margin: 0; padding: 0; list-style: none; }
.slot {
  display: grid; gap: 8px; padding: 16px 0 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.slot--live { border-top: 2px solid var(--ink); }
.slot-time {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1;
}
.slot--past .slot-time { color: var(--muted); }
@media (min-width: 640px) {
  .slot { grid-template-columns: 7rem minmax(0, 1fr); gap: 24px; }
  .slot-time { align-self: start; padding-top: 4px; }
}

.fixtures { display: grid; gap: 16px; }
.fx + .fx { padding-top: 16px; border-top: 1px solid var(--line); }
.fx-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
/* Fila dun partido. Os nomes van sempre nunha liña (nunca se cortan); frecha e
   posto van en celas de ancho fixo para quedar aliñados en todas as filas.
   Estreito: un equipo por liña (nome · goles · frecha e posto).
   Con sitio (o partido mide 520 px ou máis): todo nunha liña, co indicador de
   cada equipo no extremo de fóra. */
.fx { container-type: inline-size; }
.fx-teams {
  display: grid; align-items: center; gap: 6px 12px; margin-top: 8px;
  grid-template-columns: minmax(0, 1fr) 1.5rem 3rem;
  grid-template-areas: "nh gh mh" "na ga ma";
}
.fx-home { grid-area: nh; } .fx-away { grid-area: na; }
.fx-g-home { grid-area: gh; } .fx-g-away { grid-area: ga; }
.fx-mov-home { grid-area: mh; } .fx-mov-away { grid-area: ma; }
.fx-sep { display: none; }
.fx-team {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 1rem; font-weight: 600; line-height: 1.3;
}
.fx-g { text-align: right; font-size: 1.25rem; font-weight: 800; line-height: 1; }
.fx-mov { display: flex; justify-content: flex-end; }
.fx-mov .mov { display: inline-flex; align-items: baseline; gap: 4px; margin: 0; }
.fx.has-winner .fx-team { font-weight: 500; }
.fx.has-winner .fx-team.is-winner { font-weight: 800; }
@container (min-width: 520px) {
  .fx-teams {
    gap: 12px;
    grid-template-columns: 3rem minmax(0, 1fr) auto auto auto minmax(0, 1fr) 3rem;
    grid-template-areas: "mh nh gh sep ga na ma";
  }
  .fx-sep { display: block; grid-area: sep; font-size: 1.25rem; font-weight: 800; line-height: 1; }
  .fx--pending .fx-sep { padding: 0 16px; color: var(--accent); font-weight: 600; }
  .fx-home { text-align: right; }
  .fx-g { text-align: center; }
  /* Local: posto e frecha pegados á esquerda; visitante: frecha e posto á dereita. */
  .fx-mov-home { justify-content: flex-start; }
  .fx-mov-home .mov-pos { order: -1; }
}
.fx-pens { margin: 4px 0 0; text-align: center; font-size: .8125rem; font-weight: 600; color: var(--muted); }

.empty { margin: 0; padding: 32px 0; font-weight: 600; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .seg-btn { transition: none; }
  /* As luces quedan quietas e acesas, unhas máis ca outras. */
  .luces > span { animation: none; opacity: .85; }
  .luces > span:nth-child(even) { opacity: .4; }
}

/* Partidos: selector de grupo e movementos */
.seg--grp { --seg-n: 3; margin-top: 8px; }
.seg--grp[hidden] { display: none; }
@media (max-width: 519px) {
  .seg--grp { --seg-n: 2; }
  .seg--grp .seg-btn:first-child { grid-column: 1 / -1; }
}

/* Sobre o fondo escuro, o verde do club máis claro para que se lea. */
.brand .brand-club { color: #22c55e; }

/* Aviso da conta de visitas, ao final de todo. */
.aviso-visitas { padding-top: 8px; padding-bottom: 32px; }
.aviso-visitas p { margin: 0; font-size: .75rem; line-height: 1.5; color: var(--muted); text-align: center; }
