/* Web pública de OddsIQ. Un solo fichero, sin build. Primero el móvil.

   Colores del 1X2 comprobados con el validador de paletas (daltonismo, contraste ≥3:1) contra la
   superficie de las tarjetas en claro (#ffffff) y en oscuro (#151c33): local azul y visitante
   naranja en los polos, empate gris neutro en medio. La identidad la llevan la posición y el
   cuadradito junto a cada nombre; el color solo la refuerza. El amarillo es el de la tarjeta del
   árbitro: marca lo tuyo (tu jugada, tus ligas) y lo destacado, nunca un dato del modelo. */

:root {
  color-scheme: light;
  --paper: #f4f6fb;
  --card: #ffffff;
  --strong: #0f1733;        /* tarjetas destacadas: fondo azul noche */
  --strong-ink: #f4f6fb;
  --ink: #0f1733;
  --ink-2: #475070;
  --muted: #5f6886;
  --line: #e2e6f0;
  --line-2: #c5cbdc;
  --accent: #ffd23f;
  --accent-ink: #0f1733;
  --good: #11713d;
  --home: #2a78d6;
  --draw: #8c91a1;
  --away: #eb6834;

  --f-display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-card: 16px;
  --tabbar: 62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b1020;
    --card: #151c33;
    --strong: #1f2a4d;
    --strong-ink: #eef1fa;
    --ink: #eef1fa;
    --ink-2: #b8bfd8;
    --muted: #949cba;
    --line: #252e4a;
    --line-2: #39446a;
    --good: #4fd18b;
    --home: #3987e5;
    --draw: #76767a;
    --away: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b1020;
  --card: #151c33;
  --strong: #1f2a4d;
  --strong-ink: #eef1fa;
  --ink: #eef1fa;
  --ink-2: #b8bfd8;
  --muted: #949cba;
  --line: #252e4a;
  --line-2: #39446a;
  --good: #4fd18b;
  --home: #3987e5;
  --draw: #76767a;
  --away: #d95926;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--f-text);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
main { max-width: 40rem; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--home); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.3rem, 10vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.ico-s { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.note { color: var(--muted); font-size: 0.88rem; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 2rem 0 0; }
.empty { padding: 2rem 0; color: var(--ink-2); }
.empty a { font-weight: 600; }

/* ------------------------------------------------------------ cabecera y navegación */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.brand { font: 800 1.5rem/1 var(--f-display); text-decoration: none; letter-spacing: 0.01em; }
.top-nav { display: none; }
/* Selector de idioma: siempre a la vista, también en el móvil (allí la navegación va abajo). */
.lang { display: flex; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line);
  border-radius: 999px; }
.lang a { padding: 0.2rem 0.55rem; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; }
.lang a[aria-current] { background: var(--ink); color: var(--paper); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600;
}
.tabbar a .ico { width: 44px; height: 26px; padding: 2px 11px; border-radius: 13px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .ico { background: var(--accent); color: var(--accent-ink); }

@media (min-width: 48rem) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .top { height: 60px; padding: 0 max(16px, calc((100vw - 40rem) / 2)); }
  .top-nav { display: flex; gap: 0.4rem; margin-left: auto; }
  .lang { margin-left: 0.75rem; }
  .top-nav a { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem;
    border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600;
    font-size: 0.92rem; }
  .top-nav a .ico { width: 18px; height: 18px; }
  .top-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
}

.foot { max-width: 40rem; margin: 2.5rem auto 0; padding: 1.25rem 16px 1.5rem;
  color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ portada */
.hero { padding: 1.25rem 0 1rem; display: grid; gap: 0.6rem; }
.hero > p { color: var(--ink-2); max-width: 32em; }
.hero > .score-banner { justify-self: start; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; padding: 0.45rem 0.85rem; border-radius: 999px; font-size: 0.92rem;
  text-decoration: none; }

/* Destacados: la única parte de la portada que grita. Carrusel con el pulgar. */
/* «Big matches»: las competiciones grandes, antes que el resto */
.top-games { margin: 0.25rem 0 1rem; }
.sec-h { font-size: 1.35rem; margin: 0.25rem 0 0.6rem; }
.rail { margin: 0.25rem -16px 0; }
.rail ol {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 10px;
  scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none;
}
.rail ol::-webkit-scrollbar { display: none; }
.rail li { flex: 0 0 min(78%, 17rem); scroll-snap-align: start; }
.hl {
  display: grid; gap: 0.3rem; height: 100%;
  padding: 14px 16px 16px; border-radius: var(--r-card);
  background: var(--strong); color: var(--strong-ink); text-decoration: none;
}
.hl-tag { justify-self: start; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 0.78rem; padding: 0.18rem 0.6rem; border-radius: 999px; }
.hl-teams { display: grid; font-weight: 600; line-height: 1.25; margin-top: 0.35rem; }
.hl-vs { font-weight: 400; font-size: 0.8rem; opacity: 0.7; }
.hl-num { font: 800 2.6rem/1 var(--f-display); margin-top: 0.4rem; }
.hl-sub { font-size: 0.85rem; opacity: 0.85; }
.hl-time { font-size: 0.8rem; opacity: 0.7; margin-top: 0.2rem; }

/* Filtros fijos arriba mientras bajas. */
.filters { position: sticky; top: 52px; z-index: 10; margin: 0 -16px; padding: 8px 16px 6px;
  background: var(--paper); display: grid; gap: 8px; }
.filters:empty { display: none; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; padding: 0.55rem 0.5rem; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); font-weight: 700; font-size: 0.95rem; }
.tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; display: flex; align-items: center; gap: 0.35rem;
  padding: 0.38rem 0.8rem; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); }
.chip-c { font-weight: 400; opacity: 0.75; }
@media (min-width: 48rem) { .filters { top: 60px; } }

.day { padding-top: 0.75rem; }
.day-h { font-size: 1.05rem; color: var(--muted); font-family: var(--f-text); font-weight: 600;
  margin: 0.75rem 0 0.25rem; }
.lg { margin-top: 0.9rem; }
.lg-h { display: flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; margin-bottom: 0.5rem; }
.lg-h a { text-decoration: none; }
.lg-c, .lg-sub { font: 500 0.85rem/1 var(--f-text); color: var(--muted); }
.star { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 999px; border: 0; background: none; color: var(--muted); }
.star[aria-pressed="true"] { color: var(--accent-ink); }
.star[aria-pressed="true"] .ico { fill: var(--accent); stroke: var(--accent-ink); }
h1 .star { display: inline-grid; vertical-align: middle; margin-left: 0.25rem; }

/* ------------------------------------------------------------ tarjeta de partido */
.cards { display: grid; gap: 10px; }
.card a {
  display: grid; gap: 6px; padding: 12px 16px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  text-decoration: none; transition: transform 120ms ease, border-color 120ms ease;
}
.card a:hover { border-color: var(--line-2); }
.card a:active { transform: scale(0.985); }
.card.started a { opacity: 0.55; }
.c-top { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.c-time { font: 700 1rem/1 var(--f-display); color: var(--ink); }
.c-lg { font-weight: 600; color: var(--ink-2); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mine { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-weight: 700;
  font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 999px; }
.t-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; }
.t-name { font-size: 1.05rem; font-weight: 500; line-height: 1.25; }
.t-p { font: 700 1.4rem/1 var(--f-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-row.fav .t-name { font-weight: 700; }
.t-row.fav .t-p { color: var(--ink); }
.c-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px;
  padding-top: 8px; border-top: 1px solid var(--line); }
.c-foot > span { display: grid; gap: 1px; }
.c-foot small { display: flex; align-items: center; gap: 5px; font-size: 0.74rem;
  color: var(--muted); line-height: 1.2; }
.c-foot b { font: 700 1.05rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }

.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.key-h { background: var(--home); }
.key-d { background: var(--draw); }
.key-a { background: var(--away); }

/* ------------------------------------------------------------ barra 1X2 */
.bar { display: flex; gap: 2px; height: 8px; margin: 4px 0 2px; transform-origin: left center;
  animation: crece 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.bar.big { height: 14px; margin: 14px 0 4px; }
.seg { flex-basis: 0; min-width: 3px; forced-color-adjust: none; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg-h { background: var(--home); }
.seg-d { background: var(--draw); }
.seg-a { background: var(--away); }
@keyframes crece { from { transform: scaleX(0.04); } }
@media (prefers-reduced-motion: reduce) {
  .bar { animation: none; }
  .card a { transition: none; }
}

/* ------------------------------------------------------------ partido */
.back { padding-top: 0.75rem; }
.back a { display: inline-flex; align-items: center; gap: 0.2rem; text-decoration: none;
  font-weight: 600; color: var(--ink-2); padding: 0.4rem 0; }
.match-hero { margin-top: 0.5rem; padding: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; display: grid; gap: 0.25rem; }
.mh-league a { font-weight: 700; text-decoration: none; }
.mh-when { color: var(--muted); font-size: 0.88rem; }
.cd { color: var(--muted); }
.cd.soon { color: var(--ink); font-weight: 600; }
.mh-cd .cd:not(:empty) { display: inline-block; margin-top: 0.3rem; padding: 0.15rem 0.6rem;
  border-radius: 999px; background: var(--paper); font-size: 0.85rem; font-weight: 600; }
.mh-cd .cd:not(:empty)::first-letter { text-transform: uppercase; }
.scoreboard { margin-top: 0.75rem; display: grid; gap: 4px; }
.sb-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; }
.sb-row .key { width: 12px; height: 12px; }
.sb-name { font-size: 1.15rem; font-weight: 500; line-height: 1.2; }
.sb-p { font: 800 2.5rem/1 var(--f-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sb-p small { font-size: 0.55em; font-weight: 700; }
.sb-row.fav .sb-name { font-weight: 700; }
.sb-row.fav .sb-p { color: var(--ink); }
.xg { display: grid; gap: 0.15rem; margin-top: 0.75rem; color: var(--ink-2); font-size: 0.92rem; }
.xg strong { font: 700 1.3rem/1 var(--f-display); color: var(--ink); margin-right: 0.25rem; }
.share { justify-self: start; margin-top: 0.75rem; display: inline-flex; align-items: center;
  gap: 0.45rem; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--line-2);
  background: none; font-weight: 700; }
.share .ico { width: 18px; height: 18px; }

/* El juego. */
.pick { margin-top: 12px; padding: 16px; border-radius: 20px; background: var(--strong);
  color: var(--strong-ink); display: grid; gap: 12px; }
.pick-btns { display: grid; gap: 8px; }
.pick-btns button { display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--strong-ink) 30%, transparent);
  background: color-mix(in srgb, var(--strong-ink) 8%, transparent); color: var(--strong-ink);
  font-weight: 700; font-size: 1.02rem; text-align: left; }
.pick-btns button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); }
.pick-btns button:disabled { cursor: default; opacity: 0.6; }
.pick-btns button[aria-pressed="true"]:disabled { opacity: 1; }
.pick-msg { font-size: 0.95rem; min-height: 1.5em; }
.pick-msg a { font-weight: 700; }

.block { margin-top: 1.75rem; display: grid; gap: 0.75rem; }
.lead { color: var(--ink-2); }

.ledgers { display: grid; gap: 10px; }
.ledger { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 16px; display: grid; gap: 0.5rem; }
.ledger h3 { display: flex; align-items: center; gap: 8px; }
.lr-base { color: var(--ink-2); font-size: 0.92rem; }
.lr-base strong { color: var(--ink); }
.ledger ol { display: grid; }
.ledger li { display: grid; grid-template-columns: 1fr 28% 3.6rem; align-items: center; gap: 10px;
  padding: 0.5rem 0; border-top: 1px solid var(--line); }
.lr-l { font-size: 0.95rem; line-height: 1.25; }
.lr-n { text-align: right; font: 700 1.1rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.dev { position: relative; height: 10px; }
.dev::before { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px;
  background: var(--line-2); }
.dev-up, .dev-down { position: absolute; top: 0; bottom: 0; forced-color-adjust: none; }
.dev-up { left: 50%; background: var(--ink); border-radius: 0 4px 4px 0; }
.dev-down { right: 50%; background: var(--muted); border-radius: 4px 0 0 4px; }
.lr-total { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--ink); padding-top: 0.5rem; font-weight: 600; }
.lr-total strong { font: 800 1.6rem/1 var(--f-display); }

.lines { display: grid; gap: 2px; }
.lines li { display: grid; grid-template-columns: minmax(8.5rem, 1fr) 1.2fr 3rem; align-items: center;
  gap: 10px; padding: 0.35rem 0; }
.ln-l { font-size: 0.92rem; }
.ln-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ln-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.ln-n { text-align: right; font: 700 1.05rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.facts { display: grid; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 0 16px; }
.facts li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; }
.facts li + li { border-top: 1px solid var(--line); }
.facts strong { font: 700 1.1rem/1 var(--f-display); }

.niches { display: grid; gap: 10px; }
@media (min-width: 36rem) { .niches { grid-template-columns: 1fr 1fr; } }
.niche { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 16px; display: grid; gap: 0.35rem; }
.nc-num strong { font: 800 2rem/1 var(--f-display); margin-right: 0.3rem; }
.nc-num { color: var(--ink-2); }
.nc-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.25rem; }
.niche .lines li { grid-template-columns: minmax(6.5rem, 1fr) 1fr 3rem; }

.stamp { margin-top: 1.75rem; color: var(--muted); font-size: 0.82rem; }

/* ------------------------------------------------------------ mi juego */
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel p { background: var(--strong); color: var(--strong-ink); border-radius: var(--r-card);
  padding: 14px 16px; display: grid; gap: 0.2rem; }
.duel span { font-size: 0.85rem; opacity: 0.8; font-weight: 600; }
.duel strong { font: 800 3rem/1 var(--f-display); }
.duel p:first-child { background: var(--accent); color: var(--accent-ink); }
.duel-sub { margin-top: 0.6rem; color: var(--ink-2); }
.game-h { font-size: 1.25rem; margin: 1.5rem 0 0.6rem; }
.plays { display: grid; gap: 8px; }
.plays li { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; display: grid; gap: 0.3rem; }
.pl-teams { font-weight: 600; }
.pl-teams a { text-decoration: none; }
.pl-line { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.88rem; color: var(--ink-2); }
.pl-ok { color: var(--good); font-weight: 700; }
.pl-ko { color: var(--muted); font-weight: 700; }
.big-stat strong { font: 800 2.6rem/1 var(--f-display); margin-right: 0.3rem; }
.big-stat { color: var(--ink-2); }

/* ------------------------------------------------------------ metodología */
.method { padding-top: 1.25rem; }
.method h1 { margin-bottom: 0.75rem; }
.method h2 { margin: 1.75rem 0 0.4rem; font-size: 1.4rem; }
.method p + p { margin-top: 0.75rem; }
.method ul { list-style: disc; padding-left: 1.2rem; display: grid; gap: 0.5rem; }

@media print {
  .tabbar, .top-nav, .filters, .pick, .share { display: none !important; }
  body { padding-bottom: 0; }
}
