/* Identidad: pizarra de cancha de barrio. Grafito, cal y verde césped.
   El marcador pintado (.sc) y los escudos son lo único que levanta la voz. */
@font-face { font-family: "Big Shoulders Display"; src: url(/fonts/bigshoulders.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --graphite: #2b2f33;
  --graphite-2: #3b4146;
  --ink: #1f2326;
  --cal: #ffffff;
  --ground: #eef0ea;
  --line: #d9dcd4;
  --mute: #5f666a;
  --grass: #2e8b3d;
  --grass-dark: #1f6a2c;
  --grass-tint: #e2f0df;
  --yellow: #e8b417;
  --red: #c8372d;
  --amber-ink: #7a5200;
  --amber-tint: #fbefc9;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "Hanken Grotesk", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.45 var(--text); color: var(--ink); background: var(--ground); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--grass); outline-offset: 2px; border-radius: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.crest { flex: none; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--graphite-2); color: #fff; font-weight: 600; letter-spacing: .02em; }

/* Marcador pintado */
.sc { display: inline-flex; gap: 4px; align-items: center; }
.sc b { display: grid; place-items: center; min-width: 1.5em; height: 1.7em; padding: 0 .28em; background: var(--graphite); color: #fff; border-radius: 4px; font: 800 1em/1 var(--display); font-variant-numeric: tabular-nums; }
.sc.lg { font-size: 44px; gap: 8px; }
.sc.md { font-size: 24px; }
.sc.sm { font-size: 19px; }
.sc.on-dark b { background: #fff; color: var(--ink); }

/* Estados: siempre icono + texto, no solo color */
.st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.st-final { background: var(--grass-tint); color: var(--grass-dark); }
.st-draft { background: var(--amber-tint); color: var(--amber-ink); }
.st-sched { background: #fff; color: var(--mute); border-color: var(--line); }
.st-post { background: #ece9f5; color: #4b3d85; }
.st-debt { background: #fbe4e1; color: #96261d; }

/* Tarjetas (de árbitro): forma + letra además del color */
.cardmark { display: inline-grid; place-items: center; width: 15px; height: 20px; border-radius: 3px; font: 700 10px/1 var(--text); flex: none; }
.cardmark.y { background: var(--yellow); color: #3a2c00; }
.cardmark.r { background: var(--red); color: #fff; }
.cardmark.s { background: linear-gradient(135deg, var(--yellow) 50%, var(--red) 50%); color: #fff; text-shadow: 0 0 2px #000; }
.goalmark { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; color: var(--ink); }
.goalmark .ic { width: 18px; height: 18px; stroke-width: 1.7; }

/* ================= Sitio público ================= */
.pub { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.top { background: var(--graphite); color: #fff; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 800 22px/1 var(--display); letter-spacing: .01em; }
.brand svg { width: 26px; height: 26px; }
.top-ed { margin-left: auto; font-size: 13px; color: #c9cfd2; text-decoration: none; border: 1px solid #596066; border-radius: 99px; padding: 3px 10px; }
.top-nav { display: none; }
.past { background: var(--amber-tint); color: var(--amber-ink); font-size: 13.5px; }
.past div { max-width: 1080px; margin: 0 auto; padding: 8px 16px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1080px; }
.page-h { font: 800 30px/1.05 var(--display); margin-bottom: 14px; }
.sec { margin-top: 24px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-h h2 { font: 700 21px/1.1 var(--display); }
.sec-h a { font-size: 13.5px; font-weight: 600; color: var(--grass-dark); }
.hint { color: var(--mute); font-size: 13.5px; }
.panel { background: var(--cal); border: 1px solid var(--line); border-radius: var(--r); }
.empty { padding: 28px 18px; text-align: center; color: var(--mute); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Barra inferior */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--cal); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; min-height: 56px; text-decoration: none; font-size: 11.5px; font-weight: 600; color: var(--mute); border-top: 3px solid transparent; margin-top: -1px; }
.tabbar a .ic { width: 23px; height: 23px; stroke-width: 1.8; }
.tabbar a[aria-current] { color: var(--grass-dark); border-top-color: var(--grass); }

/* Inicio: próximo partido sobre la pizarra */
.board { background: var(--graphite); color: #fff; position: relative; overflow: hidden; }
.board::before { content: ""; position: absolute; left: 50%; top: -30px; bottom: -30px; width: 2px; background: #ffffff1c; }
.board::after { content: ""; position: absolute; left: 50%; top: 50%; width: 190px; height: 190px; margin: -95px 0 0 -95px; border: 2px solid #ffffff1c; border-radius: 50%; }
.board-in { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 14px 16px 22px; }
.board-k { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: #cdd3d6; }
.board-k strong { color: #fff; font: 700 19px/1 var(--display); letter-spacing: .01em; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; margin-top: 16px; text-decoration: none; }
.duel-t { display: grid; justify-items: center; gap: 8px; text-align: center; font: 700 19px/1.08 var(--display); min-width: 0; }
.duel-t span { overflow-wrap: anywhere; }
.duel-mid { display: grid; justify-items: center; gap: 4px; padding-top: 14px; }
.duel-time { font: 800 40px/1 var(--display); }
.duel-vs { font: 800 30px/1 var(--display); color: #aeb5b9; padding-top: 6px; }
.duel-pens { font-size: 13px; color: #dfe4e6; white-space: nowrap; }
.board-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 16px; font-size: 13.5px; color: #dfe4e6; }
.board-meta span { display: inline-flex; align-items: center; gap: 5px; }
.board-meta .ic { width: 16px; height: 16px; }
.board-note { margin-top: 12px; text-align: center; font-size: 13.5px; color: #f3d98a; }
.board .st-sched { background: transparent; color: #fff; border-color: #ffffff55; }

/* Tarjeta de partido */
.mlist { display: grid; gap: 8px; }
.mc { display: block; text-decoration: none; padding: 10px 12px; background: var(--cal); border: 1px solid var(--line); border-radius: var(--r); }
.mc-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mc-t { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; line-height: 1.2; }
.mc-t.away { flex-direction: row-reverse; text-align: right; }
.mc-t span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mc-t.tbd { color: var(--mute); font-weight: 500; font-size: 14px; }
.mc-t.tbd .ic { width: 26px; height: 26px; stroke-width: 1.4; color: #a9aea8; }
.mc-t.won span { text-decoration: underline; text-decoration-color: var(--grass); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.mc-mid { display: grid; justify-items: center; min-width: 58px; }
.mc-time { font: 800 22px/1 var(--display); }
.mc-pens { font-size: 11.5px; color: var(--mute); margin-top: 2px; white-space: nowrap; }
.mc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--mute); }
.mc-meta .st { margin-left: auto; }
.daylabel { font-weight: 600; font-size: 14px; margin: 16px 0 8px; }
.daylabel:first-child { margin-top: 0; }

/* Selector de fechas, rondas y vistas */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a, .chips button { flex: none; padding: 7px 13px; min-height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--cal); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); cursor: pointer; }
.chips [aria-current], .chips [aria-selected="true"] { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #dfe2da; border-radius: 9px; padding: 3px; margin-bottom: 14px; }
.seg a { text-align: center; padding: 8px 6px; border-radius: 7px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--mute); }
.seg a[aria-current] { background: var(--cal); color: var(--ink); box-shadow: 0 1px 2px #0002; }

/* Detalle de partido */
.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { display: grid; grid-template-columns: 1fr 46px 1fr; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-min { text-align: center; font-weight: 700; font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; }
.tl-ev { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-ev.away { flex-direction: row-reverse; text-align: right; }
.tl-ev div { min-width: 0; }
.tl-ev strong { display: block; font-weight: 600; line-height: 1.2; }
.tl-ev small { color: var(--mute); font-size: 12.5px; }
.tl-ev.pending strong { color: var(--amber-ink); font-weight: 500; font-style: italic; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--amber-tint); color: var(--amber-ink); font-size: 14px; }
.notice .ic { margin-top: 1px; }
.notice.info { background: #e6ebee; color: #33414a; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 14px; font-size: 14px; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; font-weight: 500; }

/* Tablas */
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 12.5px; font-weight: 600; color: var(--mute); text-align: center; padding: 9px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .l { text-align: left; }
.tbl .pos { width: 34px; font-weight: 700; color: var(--mute); position: relative; }
.tbl tr.q .pos { color: var(--grass-dark); }
.tbl tr.q .pos::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 4px; border-radius: 0 3px 3px 0; background: var(--grass); }
.tbl .team { display: flex; align-items: center; gap: 9px; font-weight: 600; text-align: left; text-decoration: none; min-width: 0; }
.tbl .pts { font-weight: 800; font-size: 17px; }
.tbl .x { display: none; }
.tbl.full .x { display: table-cell; }
.tbl-scroll { overflow-x: auto; }
.tbl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 4px; height: 14px; border-radius: 2px; background: var(--grass); }
.btn-q { border: 1px solid var(--line); background: var(--cal); border-radius: 8px; padding: 8px 12px; min-height: 38px; font-weight: 600; font-size: 14px; cursor: pointer; }
.group-h { font: 700 21px/1 var(--display); margin: 20px 0 8px; }
.group-h:first-of-type { margin-top: 0; }

/* Goleadores */
.leader { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; background: var(--graphite); color: #fff; border-radius: var(--r); margin-bottom: 10px; }
.leader .avatar { background: #fff; color: var(--ink); }
.leader h2 { font: 800 26px/1.05 var(--display); }
.leader p { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #dfe4e6; margin-top: 4px; }
.leader-n { text-align: center; font: 800 52px/.9 var(--display); }
.leader-n small { display: block; font: 500 12.5px/1.2 var(--text); color: #dfe4e6; margin-top: 4px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { font-weight: 700; color: var(--mute); text-align: center; font-variant-numeric: tabular-nums; }
.rank strong { display: block; font-weight: 600; line-height: 1.2; }
.rank small { display: flex; align-items: center; gap: 5px; color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.rank .g { font-weight: 800; font-size: 20px; min-width: 30px; text-align: right; }
.filter { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.filter select { flex: 1; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cal); }
.filter button { min-height: 42px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--graphite); color: #fff; font-weight: 600; cursor: pointer; }

/* Llaves */
.rounds { display: grid; gap: 14px; }
.tie { padding: 0; overflow: hidden; display: block; text-decoration: none; }
.tie-h { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--mute); border-bottom: 1px dashed var(--line); }
.tie-h strong { color: var(--ink); font-weight: 600; }
.tie-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; font-weight: 600; }
.tie-row + .tie-row { border-top: 1px solid var(--line); }
.tie-row.tbd { font-weight: 500; color: var(--mute); }
.tie-row.tbd .ic { width: 30px; height: 30px; stroke-width: 1.3; color: #a9aea8; }
.tie-row.won { background: var(--grass-tint); }
.tie-row .res { display: flex; align-items: center; gap: 6px; }
.tie-row .res small { font-weight: 500; font-size: 12.5px; color: var(--mute); }
.tie-row .res .ic { color: var(--grass-dark); width: 18px; height: 18px; stroke-width: 2.6; }
.round-h { font: 700 21px/1 var(--display); margin-bottom: 8px; }
.rounds[data-tabs] .round[hidden] { display: block; }
.js .rounds[data-tabs] .round[hidden] { display: none; }

/* Más, equipos, premios */
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); min-height: 56px; }
.menu li:last-child a { border-bottom: 0; }
.menu a > .ic:first-child { color: var(--grass-dark); width: 24px; height: 24px; stroke-width: 1.8; }
.menu a div { flex: 1; }
.menu small { display: block; font-weight: 400; color: var(--mute); font-size: 13px; }
.menu .ic:last-child { color: #a9aea8; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.teams a { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 14px; text-align: center; text-decoration: none; font-weight: 600; line-height: 1.2; }
.teams small { font-weight: 400; color: var(--mute); }
.team-h { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.team-h h1 { font: 800 30px/1.05 var(--display); }
.squad { list-style: none; margin: 0; padding: 0; }
.squad li { display: grid; grid-template-columns: 34px auto 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.squad li:last-child { border-bottom: 0; }
.squad .n { font-weight: 800; font-size: 17px; text-align: center; }
.prize { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.prize:last-child { border-bottom: 0; }
.prize .place { font: 800 34px/1 var(--display); text-align: center; color: var(--grass-dark); }
.prize h2 { font: 700 20px/1.1 var(--display); }
.prize .who { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; }
.foot { margin-top: 28px; text-align: center; font-size: 12.5px; color: var(--mute); }

@media (min-width: 900px) {
  .pub { padding-bottom: 32px; }
  .tabbar { display: none; }
  .top-in { padding: 12px 24px; }
  .top-nav { display: flex; gap: 2px; margin-left: 24px; }
  .top-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: #dfe4e6; }
  .top-nav a[aria-current] { background: #fff; color: var(--ink); }
  .wrap { padding: 24px; }
  .tbl .x { display: table-cell; }
  [data-toggle-full] { display: none; }
  .rounds[data-tabs] { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; gap: 24px; }
  .js .rounds[data-tabs] .round[hidden] { display: block; }
  [data-round-tabs] { display: none; }
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
}
@media (max-width: 370px) {
  .sc.lg { font-size: 38px; }
  .duel-t { font-size: 17px; }
  .mc { padding: 10px; }
  .mc-t { font-size: 14px; gap: 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tabbar a, .chips a, .seg a { transition: background-color .12s, color .12s; }
}
.sec.first { margin-top: 4px; }
@media (min-width: 900px) { .sec.first-d { margin-top: 4px; } }
