/* deportes-live — estilos (marca configurable via brand.js) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #e11d48;
  --brand-alt: #fb7185;
  --bg: #0b0e14;
  --panel: #131826;
  --panel-2: #1a2133;
  --line: rgba(255, 255, 255, 0.07);
  --txt: #e8ecf4;
  --txt-2: #93a0b4;
  --live: #22c55e;
  --radius: 14px;
}
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(720px 340px at 50% -120px, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%),
    radial-gradient(900px 500px at 100% -200px, rgba(34, 197, 94, 0.05), transparent 60%);
  background-repeat: no-repeat;
}

/* accesibilidad: foco visible en todo lo clicable */
:focus-visible { outline: 2px solid var(--brand-alt); outline-offset: 2px; border-radius: 6px; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--txt-2); }

/* header */
#top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-badge {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-alt));
  border-radius: 12px;
  font-weight: 800; font-size: 15px; color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.15s;
}
.brand:hover .logo-badge { transform: rotate(-4deg) scale(1.05); }
.brand-txt h1 { font-size: 17px; letter-spacing: 0.2px; }
.brand-txt p { font-size: 11px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tabs { display: flex; gap: 6px; }
.tab {
  color: var(--txt-2); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; border: 1px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.tab.on { color: #fff; background: var(--panel-2); border-color: var(--line); }
.tab:hover { color: #fff; }

/* layout */
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; }
#pie {
  padding: 18px 16px 26px; text-align: center; color: var(--txt-2); font-size: 11px;
  border-top: 1px solid var(--line); margin-top: 24px;
}

.cargando { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 0; color: var(--txt-2); }
.spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--panel-2); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* barra filtros */
.barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel); color: var(--txt-2);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.1s;
}
.chip:hover { color: #fff; transform: translateY(-1px); }
.chip.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-alt));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 14px color-mix(in srgb, var(--brand) 35%, transparent);
}
.actualizado { font-size: 11px; color: var(--txt-2); }

.aviso {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; font-size: 13.5px; color: var(--txt-2); margin-bottom: 14px;
}
.aviso a { color: var(--brand-alt); }
.aviso.suave { text-align: center; padding: 34px 16px; font-size: 14px; }
.aviso.suave a { font-weight: 700; }

/* secciones agenda */
.agenda-seccion { margin-bottom: 28px; }
.agenda-seccion h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--txt-2); margin-bottom: 12px;
}
.agenda-seccion h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-alt));
  display: inline-block; flex: 0 0 4px;
}
.agenda-seccion h2 .num { background: var(--panel-2); border-radius: 999px; padding: 1px 9px; font-size: 11px; color: var(--txt); }
.agenda-seccion.vivos h2 { color: var(--live); }
.agenda-seccion.vivos h2::before { background: var(--live); }
#buscar-cat { background: var(--panel); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 6px 10px; font-size: 13px; width: 200px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.grid-canales { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* card evento */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.card.live { border-color: rgba(34, 197, 94, 0.35); }
.card.live::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--live), transparent);
  opacity: 0.9;
}
.card.live:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 197, 94, 0.2); }

.ev-logos { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; }
.ev-logos img { height: 48px; width: 48px; object-fit: contain; border-radius: 8px; background: var(--panel-2); padding: 3px; }
.ev-logos span { color: var(--txt-2); font-size: 11px; font-weight: 700; }
.ev-logos.grande { height: auto; margin: 10px 0 2px; }
.ev-logos.grande img { height: 64px; width: 64px; }
.ev-logos.grande span { font-size: 13px; }
.ev-logos.grande .ev-logoph { width: 64px; height: 64px; font-size: 32px; }
.ev-logoph { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; font-size: 26px; background: var(--panel-2); border-radius: 10px; margin: 0 auto; }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.ev-title { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-meta { font-size: 11.5px; color: var(--txt-2); }
.ev-serv { font-size: 11px; color: var(--brand-alt); font-weight: 600; }

.btv-epg { font-size: 10px; color: var(--txt-2); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.4px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.badge.live { background: var(--live); color: #05270f; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #05270f; animation: pulso 1.6s infinite; }
.badge.up { background: var(--panel-2); color: var(--txt-2); }
.badge.end { background: rgba(255, 255, 255, 0.06); color: var(--txt-2); opacity: 0.7; }
@keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* card canal */
.card.canal { align-items: center; text-align: center; }
.card.canal img { height: 44px; width: 100%; object-fit: contain; border-radius: 8px; }
.card.canal h3 { font-size: 12.5px; font-weight: 600; color: var(--txt); }

/* vista evento / canal */
.volver { display: inline-flex; align-items: center; gap: 4px; color: var(--txt-2); text-decoration: none; font-size: 13px; margin-bottom: 10px; }
.volver:hover { color: #fff; }
.vista-evento h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vista-evento .ev-meta { margin: 4px 0 14px; }

.player-wrap {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.player-wrap video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px; color: var(--txt-2); font-size: 14px; gap: 10px;
  background: rgba(5, 7, 12, 0.72); backdrop-filter: blur(2px);
}
.player-msg p { margin: 0; max-width: 420px; }
.msg-acciones { display: flex; gap: 8px; justify-content: center; }
.chip.serv { font-size: 13px; }
.chip.serv.muerto {
  opacity: 0.4; text-decoration: line-through; cursor: not-allowed; border-style: dashed;
}
.chip.serv.muerto:hover { color: var(--txt-2); }
.servidores { margin-top: 16px; }
.servidores h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt-2); margin-bottom: 10px; }

@media (max-width: 620px) {
  #top { flex-direction: column; align-items: stretch; }
  #tabs { justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .grid-canales { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .brand-txt p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
