:root {
  --verde: #009246;
  --bianco: #ffffff;
  --rosso: #ce2b37;
  --oro: #b8912a;
  --oro-claro: #d4af37;
  --azzurro: #0a2a5e;
  --azzurro-vivo: #1f5fbf;

  --bg: #f7f3ea;
  --surface: #fffdf8;
  --text: #1b2333;
  --muted: #6b6457;
  --line: #e7dfcd;
  --accent: var(--azzurro);
  --accent-soft: #e8eef8;
  --hero-bg: #0a2a5e;
  --chip-bg: #fffdf8;
  --fila-alt: #f0e8d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1424;
    --surface: #121d33;
    --text: #eef1f6;
    --muted: #a5adbd;
    --line: #24314d;
    --accent: #7fb0ff;
    --accent-soft: #1a2c4f;
    --oro: #d9b552;
    --hero-bg: #071733;
    --chip-bg: #121d33;
    --fila-alt: #1a2842;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1424; --surface: #121d33; --text: #eef1f6; --muted: #a5adbd; --line: #24314d;
  --accent: #7fb0ff; --accent-soft: #1a2c4f; --oro: #d9b552; --hero-bg: #071733; --chip-bg: #121d33; --fila-alt: #1a2842;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2 { font-family: "Bodoni Moda", Didot, Georgia, serif; font-weight: 700; }

/* Franja tricolor */
.fascia {
  height: 8px;
  background: linear-gradient(90deg, var(--verde) 0 33.33%, var(--bianco) 33.33% 66.66%, var(--rosso) 66.66% 100%);
}

/* Encabezado */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -20%, rgba(31, 95, 191, .55), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    var(--hero-bg);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--oro-claro), transparent);
}
.hero-inner { display: flex; align-items: center; gap: 22px; padding-top: 30px; padding-bottom: 34px; }
.scudetto { width: 92px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.kicker { margin: 0 0 6px; color: var(--oro-claro); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; }
.hero h1 { margin: 0; font-size: clamp(36px, 8vw, 64px); line-height: 1; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--oro-claro); }
.motto { margin: 10px 0 0; font-family: "Bodoni Moda", Georgia, serif; font-style: italic; font-size: 17px; opacity: .9; }
.sub { margin: 6px 0 0; opacity: .6; font-size: 12px; }
@media (max-width: 520px) {
  .hero-inner { gap: 14px; padding-top: 22px; padding-bottom: 26px; }
  .scudetto { width: 64px; }
  .motto { font-size: 15px; }
}

/* Categorías */
.cats { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.cats-list { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.cats button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--chip-bg); color: var(--text);
  padding: 8px 18px; border-radius: 999px; font: 600 14px Inter, sans-serif; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cats button:hover { border-color: var(--oro); }
.cats button[aria-selected="true"] {
  background: var(--azzurro); border-color: var(--azzurro); color: #fff;
  box-shadow: inset 0 -3px 0 var(--oro-claro);
}

/* Tarjetas */
main { padding-top: 10px; padding-bottom: 28px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px; margin: 16px 0; min-width: 0; position: relative;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 8px 24px -18px rgba(10,42,94,.35);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 20px; width: 54px; height: 4px;
  background: linear-gradient(90deg, var(--verde) 0 33.33%, #fff 33.33% 66.66%, var(--rosso) 66.66%);
  box-shadow: 0 0 0 1px var(--line);
}
.card h2 { margin: 6px 0 14px; font-size: 24px; color: var(--accent); line-height: 1.15; }
.card h2 span {
  display: block; font-family: "Bodoni Moda", Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 14px; color: var(--oro); letter-spacing: .02em;
}
.destacada { border-color: var(--oro); }
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid .card { margin: 0; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

/* Tablas */
.table-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th, .tabla td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tabla td.eq, .tabla th.eq { text-align: left; }
.tabla td.eq { font-weight: 600; }
.tabla td.pts { font-weight: 700; color: var(--accent); font-size: 16px; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:nth-child(even) { background: var(--fila-alt); }
.tabla tbody tr:hover { background: var(--accent-soft); }
.tabla td:first-child, .tabla th:first-child { padding-left: 10px; }
.tabla td:last-child, .tabla th:last-child { padding-right: 10px; }
.tabla td.pos { font-family: "Bodoni Moda", Georgia, serif; font-weight: 700; color: var(--muted); }
.tabla tr.primo td.pos { color: var(--oro); }
.tabla tr.primo td.eq::after { content: " ★"; color: var(--oro); }
.tabla tr.primo { background: linear-gradient(90deg, rgba(212,175,55,.14), transparent 70%); }
.nota { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.vacio { color: var(--muted); margin: 0; font-style: italic; }

/* Fixture */
.fecha { margin-top: 22px; }
.fecha:first-child { margin-top: 0; }
.fecha-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.fecha-head strong { font-family: "Bodoni Moda", Georgia, serif; font-size: 19px; color: var(--accent); }
.fecha-head span { color: var(--muted); font-size: 13px; }
.tag {
  font-size: 10px; padding: 2px 9px; border-radius: 999px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--oro); color: #fff;
}
.partido {
  display: grid; grid-template-columns: 112px 1fr auto 1fr; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.fecha .partido { padding-left: 10px; padding-right: 10px; }
.fecha .partido:nth-of-type(even) { background: var(--fila-alt); }
.partido .meta { color: var(--muted); font-size: 12px; line-height: 1.3; white-space: nowrap; }
.partido .local { text-align: right; font-weight: 600; }
.partido .visita { font-weight: 600; }
.marcador {
  min-width: 66px; text-align: center; font: 700 17px "Bodoni Moda", Georgia, serif;
  background: var(--azzurro); color: #fff; border-radius: 4px; padding: 3px 10px;
  box-shadow: inset 0 -2px 0 var(--oro-claro);
}
.marcador.pend { background: transparent; color: var(--muted); box-shadow: none; font-style: italic; font-weight: 500; font-size: 15px; border: 1px solid var(--line); }
.por-definir { color: var(--muted); font-style: italic; font-weight: 400 !important; }
.libre { color: var(--muted); font-size: 13px; padding-top: 7px; border-top: 1px solid var(--line); font-style: italic; }
@media (max-width: 480px) {
  .partido { grid-template-columns: 1fr auto 1fr; }
  .partido .meta { grid-column: 1 / -1; }
}

/* Pie */
.pie { background: var(--hero-bg); color: rgba(255,255,255,.75); margin-top: 8px; }
.pie p { margin: 0; padding: 22px 16px 30px; text-align: center; font-size: 13px; }
.pie em { font-family: "Bodoni Moda", Georgia, serif; color: var(--oro-claro); }

/* Agregar al calendario */
.agendar {
  background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--oro);
  border-radius: 4px; padding: 12px 14px; margin-bottom: 20px;
}
.agendar-txt { margin: 0 0 10px; font-size: 14px; }
.agendar-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; font: 600 13px Inter, sans-serif;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { border-color: var(--oro); }
.btn-prim { background: var(--azzurro); border-color: var(--azzurro); color: #fff; box-shadow: inset 0 -2px 0 var(--oro-claro); }
.btn-link { border-color: transparent; background: transparent; color: var(--accent); text-decoration: underline; }
.add-gcal {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 3px;
  color: var(--accent); font-weight: 600; text-decoration: none; font-size: 12px;
}
.add-gcal:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .partido .meta br { display: none; }
  .add-gcal { margin: 0 0 0 8px; }
}
