:root {
  --bg: #0a0e16;
  --surface: #111827;
  --surface-2: #172033;
  --surface-3: #1e2a42;
  --line: #233049;
  --line-2: #33456a;
  --text: #eef2f8;
  --muted: #8b97ad;
  --faint: #5d6a82;
  --accent: #ffd23f;
  --accent-ink: #15130a;
  --orange: #f07a22;
  --live: #ff4d5e;
  --ok: #3ddc97;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 420px at 15% -120px, #2a1d12 0%, transparent 60%),
    radial-gradient(1100px 520px at 85% -160px, #16264a 0%, transparent 62%),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
button { font: inherit; color: inherit; }

/* ——— Barra superior ——— */
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; max-width: 1280px; margin: 0 auto; }
.h-brand { display: block; line-height: 0; }
.h-logo { height: 76px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(0,0,0,.45)); }
.h-logo[data-era-logo] { display: none; }
[data-era="2010"] .h-logo[data-era-logo="2010"],
[data-era="2000"] .h-logo[data-era-logo="2000"],
[data-era="8090"] .h-logo[data-era-logo="8090"] { display: block; }
/* Los logos 2000 y 80·90 son más cuadrados: algo más altos para que se lean igual */
.h-logo[data-era-logo="2000"], .h-logo[data-era-logo="8090"] { height: 92px; margin: -8px 0; }
.h-today { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-weight: 700; cursor: pointer; }
.h-today:hover { border-color: var(--line-2); }

.h-main { max-width: 1280px; margin: 0 auto; padding: 8px 24px 24px; }

/* ——— Mes ——— */
.h-month { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 10px 0 18px; }
.h-month-title { display: flex; align-items: center; gap: 10px; }
.h-month h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(38px, 6vw, 60px); line-height: .95; text-transform: uppercase; letter-spacing: .5px; min-width: 6ch; }
.h-month h1 span { color: var(--faint); }
.h-arrow { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 22px; line-height: 1; display: grid; place-items: center; padding-bottom: 3px; }
.h-arrow:hover { border-color: var(--line-2); background: var(--surface-2); }
.h-month-stats { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.h-month-stats b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ——— Tira de días ——— */
.h-days-wrap { position: relative; margin: 0 -24px; }
.h-days { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 24px; padding: 14px 24px 14px; scrollbar-width: none; }
.h-days::-webkit-scrollbar { display: none; }
.h-scroll { position: absolute; top: 14px; bottom: 14px; width: 44px; border: 0; z-index: 2; cursor: pointer; font-size: 26px; color: var(--text); opacity: .9; }
.h-scroll.left { left: 0; background: linear-gradient(90deg, var(--bg) 35%, transparent); text-align: left; padding-left: 10px; }
.h-scroll.right { right: 0; background: linear-gradient(-90deg, var(--bg) 35%, transparent); text-align: right; padding-right: 10px; }
.h-scroll:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) { .h-scroll { display: none; } }

.day { flex: 0 0 auto; scroll-snap-align: start; width: 66px; height: 92px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; transition: background .15s, border-color .15s, transform .15s; }
.day:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.day .wd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.day .n { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.day .meta { height: 14px; display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.day .meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); display: inline-block; }
.day .meta.has i { background: var(--muted); }
.day .meta.replay i { background: var(--ok); }
.day .meta.loading { width: 22px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--line), var(--line-2), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.day.empty .n { color: var(--faint); }
.day.today { border-color: #6b5a1c; }
.day.today::before { content: "HOY"; position: absolute; top: -8px; font-size: 9.5px; font-weight: 800; letter-spacing: 1px; background: var(--bg); color: var(--accent); padding: 0 6px; border-radius: 4px; }
.day.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); box-shadow: 0 8px 24px #ffd23f2e; }
.day.on .wd, .day.on .meta { color: #3d3511; }
.day.on .meta i { background: #3d3511; }
.day.on.today::before { background: var(--accent); color: var(--accent-ink); }
.day:focus-visible, .h-arrow:focus-visible, .btn:focus-visible, .h-today:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ——— Día seleccionado ——— */
.h-day { margin-top: 18px; }
.h-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.h-day-head h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.h-day-summary { color: var(--muted); font-size: 13px; }
.h-day-summary b { color: var(--text); }
.h-notice { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #2a2210; border: 1px solid #6b5a1c; color: #ffe08a; font-size: 13px; }

.h-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .h-games { grid-template-columns: 1fr; } }

/* ——— Tarjeta de partido ——— */
.g { position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 14px; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px; animation: rise .35s ease-out both; }
.g::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--ca, #555) 0 50%, var(--ch, #777) 50% 100%); }
.g:hover { border-color: var(--line-2); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.g-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.badge.final { color: var(--text); }
.badge.live { background: #3a1018; color: #ff9aa4; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: blink 1.1s ease-in-out infinite; }
.badge.pre { background: transparent; border: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; }
.badge.demo { background: #4b2a00; color: #ffc46b; }
.g-tv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes blink { 50% { opacity: .25; } }

.g-teams { display: grid; gap: 8px; }
.t { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.t-logo { width: 40px; height: 40px; display: grid; place-items: center; }
.t-logo img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.t-chip { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; letter-spacing: .3px; }
.t-name { min-width: 0; }
.t-name strong { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-name small { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.t-score { font-family: var(--display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; min-width: 2.2ch; text-align: right; }
.t.lost .t-name strong, .t.lost .t-score { color: var(--muted); }
.t.won .t-score { color: var(--text); }
.t.won .t-score::after { content: "◂"; font-size: 14px; color: var(--accent); margin-left: 4px; vertical-align: middle; }

.g-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.g-venue { color: var(--faint); font-size: 12px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-err { color: #ff9aa4; font-size: 12px; }

.btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 9px 14px; font-weight: 800; font-size: 13px; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .12s, box-shadow .12s, background .12s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px #ffd23f40; }
.btn-primary .tri { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn[disabled] { background: transparent; border-color: var(--line); color: var(--faint); cursor: default; transform: none; box-shadow: none; }
.spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ——— Estados ——— */
.skel { height: 196px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 56px 16px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.empty-state strong { display: block; font-family: var(--display); font-size: 24px; text-transform: uppercase; color: var(--text); margin-bottom: 4px; }


@media (max-width: 640px) {
  .h-top, .h-main { padding-left: 16px; padding-right: 16px; }
  .h-days-wrap { margin: 0 -16px; }
  .h-days { padding: 14px 16px 14px; scroll-padding: 0 16px; }
  .day { width: 58px; height: 84px; }
  .day .n { font-size: 26px; }
  .h-day-head h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ——— Pie de página ——— */
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; padding: 18px 16px 24px; margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; }
.site-foot a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 700; text-decoration: none; }
.site-foot a:hover, .site-foot a:focus-visible { text-decoration: underline; }
.site-foot svg { flex: none; }
@media (max-width: 640px) { .sf-sep { display: none; } .site-foot { flex-direction: column; } }
