:root {
  --fondo: #14110f;
  --panel: #1f1a17;
  --borde: #3a322c;
  --texto: #f2ebe2;
  --tenue: #b3a899;
  --acento: #e0a83c;
  --acento-texto: #14110f;
  --error: #ff9a8a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, .marca { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
a { color: var(--acento); }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 6px; padding: .55rem 1rem; background: var(--acento); color: var(--acento-texto); font-weight: 600; }
button.discreto { background: transparent; color: var(--texto); border: 1px solid var(--borde); font-weight: 400; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
.tarjeta, .canal { scroll-margin: 7rem 0 1.5rem; }
.tarjeta:focus .portada, .tarjeta:focus-visible .portada { box-shadow: 0 0 0 3px var(--acento), 0 0 0 5px var(--texto); }
.canal:focus, .canal:focus-visible { background: var(--acento); color: var(--acento-texto); outline: 2px solid var(--texto); }
.canal:focus small { color: var(--acento-texto); }
select, input[type=search], input[name] {
  background: var(--panel); border: 1px solid var(--borde); border-radius: 6px; padding: .55rem .7rem; min-width: 0;
}

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-caja { width: min(360px, 100%); display: grid; gap: .9rem; }
.login-caja h1 { font-size: 2.6rem; margin: 0; color: var(--acento); }
.login-caja p { margin: 0; color: var(--tenue); }
.login-caja label { display: grid; gap: .25rem; }
.login-caja .error { color: var(--error); }

.barra {
  position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  padding: .7rem 24px; background: var(--fondo); border-bottom: 1px solid var(--borde);
}
.marca { font-size: 1.5rem; color: var(--acento); text-decoration: none; }
.pestanas { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.pestanas button { background: none; color: var(--tenue); font-weight: 400; padding: .4rem .7rem; white-space: nowrap; border-radius: 0; border-bottom: 2px solid transparent; }
.pestanas button.activa { color: var(--texto); border-bottom-color: var(--acento); }
.cuenta { display: flex; align-items: center; gap: .7rem; color: var(--tenue); }
.cuenta button { padding: .3rem .7rem; }

.filtros { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(0, 1fr)) auto; gap: .6rem; padding: 1rem 24px .4rem; align-items: center; }
.casilla { display: flex; gap: .4rem; align-items: center; white-space: nowrap; color: var(--tenue); }
.resumen { padding: 0 24px; color: var(--tenue); margin: .4rem 0 .9rem; font-size: .92rem; }

.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.4rem 1rem; padding: 0 24px; }
.tarjeta { all: unset; cursor: pointer; display: block; align-self: start; min-width: 0; }
.tarjeta:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }
.portada { position: relative; aspect-ratio: 2 / 3; background: var(--panel); border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.portada img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.tarjeta:hover img { transform: scale(1.04); }
.portada .sin-imagen { padding: .7rem; text-align: center; color: var(--tenue); font-family: Georgia, serif; }
.distintivo { position: absolute; left: .4rem; top: .4rem; background: var(--acento); color: var(--acento-texto); font-size: .72rem; font-weight: 700; border-radius: 4px; padding: .1rem .35rem; }
.tarjeta h3 { font-size: .95rem; font-weight: 500; margin: .45rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tarjeta small { color: var(--tenue); }
.vacio { grid-column: 1 / -1; color: var(--tenue); padding: 3rem 0; text-align: center; }

.paginacion { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 2rem 16px; color: var(--tenue); }

dialog {
  width: min(860px, 100%); max-height: calc(100dvh - 32px); padding: 0; color: var(--texto); background: var(--panel);
  border: 1px solid var(--borde); border-radius: 10px; overflow-y: auto;
}
dialog::backdrop { background: rgb(0 0 0 / .75); }
.cerrar { position: sticky; top: .5rem; float: right; margin: .5rem .5rem -2.7rem 0; z-index: 1; width: 2.2rem; height: 2.2rem; padding: 0; font-size: 1.3rem; line-height: 1; background: var(--fondo); color: var(--texto); border-radius: 50%; }
.reproductor { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #000; }
.ficha-texto { padding: 1.2rem 1.5rem 1.6rem; }
.ficha-texto h2 { margin: 0 2.2rem .2rem 0; font-size: 1.9rem; line-height: 1.2; overflow-wrap: anywhere; }
.datos { color: var(--tenue); margin: 0 0 .9rem; }
.acciones, .enlaces { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0; }
.acciones button[aria-pressed=true] { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.enlaces a { border: 1px solid var(--borde); border-radius: 6px; padding: .45rem .8rem; text-decoration: none; }
.aviso { background: var(--fondo); border-left: 3px solid var(--acento); padding: .6rem .8rem; color: var(--tenue); font-size: .92rem; }
.descripcion { overflow-wrap: anywhere; }

.enlace-vivo { white-space: nowrap; text-decoration: none; }
.vivo { max-width: 1100px; margin: 0 auto; padding: 1rem 24px; }
.vivo-reproductor { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #000; border-radius: 6px; }
.vivo-titulo { font-size: 1.3rem; margin: .7rem 0 .2rem; }
.vivo-filtros { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.vivo-filtros input { flex: 1 1 220px; }
.vivo-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.canal { display: block; text-align: left; font-weight: 400; background: var(--panel); color: var(--texto); border: 1px solid var(--borde); text-decoration: none; border-radius: 6px; padding: .6rem .8rem; }
.canal small { display: block; color: var(--tenue); }
.canal[aria-pressed=true] { border-color: var(--acento); }

.pie { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; padding: 1rem 16px 1.6rem; font-size: .9rem; }
.pie a { color: var(--tenue); }
.legal { max-width: 720px; margin: 0 auto; padding: 1.5rem 24px 1rem; }
.legal h1 { font-size: 2rem; line-height: 1.2; margin: .4rem 0; }
.legal h2 { font-size: 1.35rem; margin: 1.8rem 0 .4rem; }
.legal .fecha { color: var(--tenue); }
.legal a { overflow-wrap: anywhere; }

.vincular { padding: 1.4rem 1.5rem; }
.vincular h2 { margin: 0 0 .5rem; }
.vincular input { width: 100%; font-size: 1.6rem; letter-spacing: .2em; text-transform: uppercase; }
#dialogo-vincular { width: min(440px, 100%); }

@media (max-width: 900px) {
  .filtros { grid-template-columns: 1fr 1fr; }
  .filtros #q { grid-column: 1 / -1; }
  .casilla { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .barra { padding: .6rem 16px; }
  .marca { flex: 1; }
  .pestanas { order: 3; flex-basis: 100%; }
  .filtros, .resumen, .rejilla { padding-left: 16px; padding-right: 16px; }
  .rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog { max-height: 100dvh; max-width: 100%; border-radius: 0; margin: 0; height: 100dvh; }
  .ficha-texto { padding: 1rem 16px 1.5rem; }
}
