/* ---------- Página Agenda (agenda.html) ---------- */
.page-agenda { background: var(--bg); }

/* Topo (mesmo fundo das páginas de setup e campeonatos) */
.ag-hero {
  position: relative; overflow: hidden; color: #fff; padding: 130px 0 64px;
  background:
    radial-gradient(700px 420px at 85% 10%, rgba(255, 212, 0, .18), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(43, 107, 255, .45), transparent 60%),
    var(--navy);
}
.ag-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.ag-hero .wrap { position: relative; }
.ag-back { display: block; width: fit-content; margin-bottom: 18px; font-size: 14px; font-weight: 700; color: #c9d6f5; }
.ag-back:hover { color: #fff; }
.ag-hero h1 { font-size: clamp(54px, 9vw, 120px); margin-top: 18px; }
.ag-hero h1 span { color: var(--yellow); }
.ag-lead { color: #c9d6f5; font-size: 18px; max-width: 60ch; margin: 22px 0 0; }
.ag-lead b { color: #fff; }
.ag-lead .ag-live-txt { color: #ff6b7a !important; }
#agenda { padding-top: 64px; }
.ag-empty { margin: 0; padding: 22px 24px; border-radius: 18px; border: 2px dashed var(--line); color: var(--muted); }

/* Lista por dia */
.ag { display: grid; gap: 14px; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: start; }
.ag-date { position: sticky; top: 90px; display: grid; justify-items: center; padding: 12px 8px; border-radius: 16px; background: var(--navy); color: #fff; text-align: center; }
.ag-date b { font: 900 38px/.9 var(--font-d); font-stretch: 70%; color: var(--yellow); }
.ag-date span { font: 800 13px/1 var(--font-d); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.ag-date small { margin-top: 6px; font-size: 11px; color: #9fb4e8; }
.ag-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-day li {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto; align-items: center; gap: 6px 16px;
  padding: 12px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.ag-day li:hover { border-color: var(--blue); box-shadow: 0 10px 22px rgba(21, 70, 214, .08); transform: translateX(3px); }
.ag-day li.main { background: linear-gradient(100deg, #fff8d6, #fff 70%); border-color: #ffe27a; }
.ag-day li.live { border-color: #e0263a; box-shadow: 0 0 0 3px rgba(224, 38, 58, .1); }
.ag-time { font: 900 22px/1 var(--font-d); font-stretch: 75%; color: var(--blue); font-variant-numeric: tabular-nums; }
.ag-time small { display: block; margin-top: 3px; font: 600 11px/1 var(--font-b); color: var(--muted); }
.ag-name { min-width: 0; }
.ag-name b { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.ag-name small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
/* Máximo de partidas da sessão (matchCap da Epic) */
.ag-name small .ag-matches { display: inline; font-weight: 700; color: var(--ink); }
.ag-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ag-tags i { font-style: normal; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--ink); white-space: nowrap; }
.ag-tags .ag-main { background: var(--yellow); }
.ag-tags .ag-on { background: #e0263a; color: #fff; animation: agPulse 1.6s ease-in-out infinite; }
@keyframes agPulse { 50% { opacity: .55; } }
.ag-go { font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.ag-go:hover { text-decoration: underline; }
.ag-src { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.ag-src a { color: var(--blue); font-weight: 600; }
@media (max-width: 700px) {
  .ag-day { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ag-date { position: static; display: flex; justify-content: flex-start; align-items: baseline; gap: 8px; padding: 8px 12px; justify-self: start; }
  .ag-date b { font-size: 24px; }
  .ag-date small { margin-top: 0; }
  .ag-day li { grid-template-columns: 58px minmax(0, 1fr) auto; padding: 12px; }
  .ag-name { grid-column: 2 / -1; }
  .ag-tags { grid-column: 2; justify-content: flex-start; }
  .ag-go { grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) { .ag-tags .ag-on { animation: none; } .ag-day li:hover { transform: none; } }
/* Contagem regressiva no topo: números de largura fixa, para não "tremer" a cada segundo */
.ag-cd { font-variant-numeric: tabular-nums; color: var(--yellow) !important; white-space: nowrap; }

/* Reserva espaço enquanto a agenda é montada, para a página não "pular" ao carregar */
#agNext { min-height: calc(2 * 1.6em); }
.ag:empty { min-height: 100vh; }
@media (max-width: 600px) { #agNext { min-height: calc(5 * 1.6em); } }

/* Filtros por tipo/modo */
.ag-filters { display: grid; gap: 10px; margin: 0 0 22px; }
.ag-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ag-flabel { margin-right: 4px; font: 800 11px/1 var(--font-b); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ag-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font: 700 14px/1 var(--font-b); color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.ag-chip small { min-width: 20px; padding: 3px 6px; border-radius: 99px; background: var(--bg-alt); color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; }
.ag-chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.ag-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ag-chip.on small { background: var(--yellow); color: var(--ink); }
.ag-chip:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ag-clear { margin-left: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; text-decoration: underline; }
@media (max-width: 600px) {
  .ag-filters { margin: 0 0 18px; }
  .ag-frow { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .ag-frow::-webkit-scrollbar { display: none; }
  .ag-flabel { flex: none; }
  .ag-chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .ag-chip { transition: none; } }
/* Cores por filtro: ponto no chip e etiqueta na sessão (cor em --c, definida no agenda.js) */
.ag-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--c); }
.ag-chip.on .ag-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.ag-tags .ag-cat { background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 82%, #000); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); }
.ag-tags i:not(.ag-cat):not(.ag-on) { background: #fff; border: 1px solid var(--line); color: var(--muted); } /* formato: Solo, Duplas… */
/* Formato: chips e etiqueta neutros, escuros quando marcados */
.ag-tags .ag-fmt-tag { background: #fff; border: 1px solid #c9d3ea; color: var(--ink); }
/* Rótulos "Próximo" e "Destaque" no topo da Agenda */
.ag-lead .ag-lbl { display: inline-block; margin: 0 6px 6px 0; padding: 5px 10px 4px; font: 800 12px/1 var(--font-d); font-stretch: 100%; letter-spacing: .12em; text-transform: uppercase;
  background: var(--yellow); color: var(--ink); transform: skewX(-10deg); vertical-align: 2px; }
.ag-lead .ag-lbl-main { background: transparent; color: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow); }
