:root{
  --bg:#0B0D12; --bg2:#141926; --card:#1A2030; --card2:#222A3D;
  --line:#2A3040; --txt:#F7F5F0; --dim:#8A93A6; --dim2:#7A8496;
  --accent:#FF4D2E; --accent-ink:#0B0D12;
  --ok:#2BD9C0; --warn:#FFC531;
  --r:14px; --shadow:0 10px 30px rgba(0,0,0,.5);
  --maxw:1180px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--txt);
  font:16px/1.55 Outfit,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 16px}

/* ---------- header ---------- */
header{
  position:sticky; top:0; z-index:20;
  background:linear-gradient(180deg,rgba(11,13,18,.98),rgba(11,13,18,.92));
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.bar{display:flex; align-items:center; gap:14px; padding:14px 0; flex-wrap:wrap}
.logo{display:flex; align-items:center; gap:9px; font-weight:800; letter-spacing:-.6px; font-size:21px; white-space:nowrap}
.logo .mark{flex:none; display:block}
.logo b{color:var(--accent); font-weight:800}
.searchbox{flex:1 1 320px; display:flex; gap:8px; min-width:240px}
.searchbox input{
  flex:1; background:var(--card); border:1px solid var(--line); color:var(--txt);
  border-radius:999px; padding:12px 18px; font-size:16px; outline:none; min-width:0;
  font-family:inherit;
}
.searchbox input:focus{border-color:var(--accent)}
.btn{
  background:var(--accent); color:var(--accent-ink); border:0; cursor:pointer;
  border-radius:999px; padding:12px 20px; font-weight:700; font-size:15px; white-space:nowrap;
  font-family:inherit;
}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:transparent; color:var(--dim); border:1px solid var(--line)}
.btn.ghost:hover{color:var(--txt); border-color:var(--dim2); filter:none}

.rowtabs{display:flex; gap:8px; align-items:center; padding:0 0 12px; flex-wrap:wrap}
.tab{
  background:var(--card); border:1px solid var(--line); color:var(--dim);
  border-radius:999px; padding:7px 14px; font-size:14px; cursor:pointer; font-family:inherit;
}
.tab[aria-pressed="true"]{background:var(--txt); color:#0B0D12; border-color:var(--txt); font-weight:700}
.spacer{flex:1}

/* ---------- filtros de la portada ---------- */
.filters{padding:0 0 12px}
.fstrip{
  display:flex; gap:8px; overflow-x:auto; padding-bottom:8px;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.fstrip::-webkit-scrollbar{display:none}
.fchip{
  display:inline-flex; align-items:center; gap:7px; white-space:nowrap; cursor:pointer;
  background:var(--card); border:1px solid var(--line); color:var(--dim);
  border-radius:999px; padding:7px 14px; font-size:13.5px; font-family:inherit; flex:none;
}
.fchip .dot{width:9px;height:9px;border-radius:50%;flex:none}
.fchip[aria-pressed="true"]{background:var(--txt); color:#0B0D12; border-color:var(--txt); font-weight:700}
.frow{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.sel{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--card); border:1px solid var(--line); border-radius:999px;
  padding:5px 8px 5px 14px; font-size:13px; color:var(--dim2);
}
.sel select{
  background:transparent; border:0; color:var(--txt); font-family:inherit;
  font-size:13.5px; padding:3px 4px; outline:none; cursor:pointer;
}
.sel select option{background:var(--bg2); color:var(--txt)}

/* ---------- plataformas ---------- */
.platpanel{border-top:1px solid var(--line); padding:14px 0 18px; display:none}
.platpanel.open{display:block}
.platpanel h3{margin:0 0 4px; font-size:15px}
.platpanel p{margin:0 0 12px; color:var(--dim); font-size:13.5px}
.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  background:var(--card); border:1px solid var(--line); color:var(--dim);
  border-radius:999px; padding:7px 14px 7px 10px; font-size:14px; user-select:none;
  font-family:inherit;
}
.chip .dot{width:10px;height:10px;border-radius:50%;flex:none}
.chip[aria-pressed="true"]{color:var(--txt); border-color:var(--dim2); background:var(--card2)}
.chip[aria-pressed="true"] .tick:after{content:"✓"; margin-left:2px; color:var(--ok); font-weight:700}

/* ---------- estados ---------- */
.state{padding:64px 16px; text-align:center; color:var(--dim)}
#bstate{padding:10px 16px 48px}
.state .big{font-size:40px; margin-bottom:14px; line-height:1}
.state h2{margin:0 0 6px; color:var(--txt); font-size:19px; font-weight:700}
.state p{margin:0 auto; max-width:460px; font-size:14.5px}
.err{color:var(--accent)}
.spin{
  width:34px;height:34px;margin:0 auto 14px;border-radius:50%;
  border:3px solid var(--line); border-top-color:var(--accent);
  animation:sp .8s linear infinite;
}
@keyframes sp{to{transform:rotate(360deg)}}

/* ---------- grilla ---------- */
.meta{color:var(--dim); font-size:13.5px; padding:4px 0 14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.meta .tab{padding:5px 12px; font-size:13px}
#sentinel{height:1px}
.grid{
  display:grid; gap:18px 16px; padding-bottom:40px;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
}
.card{background:none; border:0; padding:0; text-align:left; cursor:pointer; color:inherit; font-family:inherit}
.poster{
  position:relative; width:100%; aspect-ratio:2/3; border-radius:var(--r);
  overflow:hidden; background:var(--card2); border:1px solid var(--line);
}
.poster img{width:100%;height:100%;object-fit:cover;display:block}
.poster .ph{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:var(--dim2); font-size:30px;
}
.card:hover .poster{border-color:var(--accent)}
.poster .flag{
  position:absolute; top:7px; left:7px; background:var(--warn); color:#0B0D12;
  font-size:10px; font-weight:800; padding:3px 7px; border-radius:6px; letter-spacing:.2px;
}
.badges{position:absolute; left:7px; right:7px; bottom:7px; display:flex; gap:5px; flex-wrap:wrap}
.pill{
  font-size:10.5px; font-weight:800; letter-spacing:.2px;
  padding:3px 7px; border-radius:6px; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.45);
}
.pill.more{background:rgba(0,0,0,.7)}
.pill.none{background:rgba(0,0,0,.72); color:var(--dim)}
.ttl{margin:9px 2px 0; font-size:14px; font-weight:600; line-height:1.3}
.sub{margin:2px 2px 0; font-size:12.5px; color:var(--dim)}

/* ---------- ficha ---------- */
.ov{
  position:fixed; inset:0; z-index:50; background:rgba(4,5,8,.75);
  backdrop-filter:blur(4px); overflow-y:auto; padding:24px 16px; display:none;
}
.ov.open{display:block}
.sheetwrap{position:relative; max-width:820px; margin:0 auto}
.sheet{
  background:var(--bg2); border:1px solid var(--line);
  border-radius:18px; box-shadow:var(--shadow); overflow:hidden;
}
.sheet .top{display:flex; gap:20px; padding:22px; border-bottom:1px solid var(--line)}
.sheet .top .pp{width:150px; flex:none; border-radius:10px; overflow:hidden; background:var(--card2)}
.sheet .top .pp img{width:100%;display:block}
.sheet h2{margin:0 0 4px; font-size:24px; letter-spacing:-.4px}
.orig{color:var(--dim); font-size:13.5px; margin:0 0 10px}
.facts{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px}
.fact{background:var(--card); border:1px solid var(--line); border-radius:7px; padding:3px 9px; font-size:12.5px; color:var(--dim)}
.fact.score{color:var(--warn); border-color:rgba(255,197,49,.35)}
.ovw{color:var(--dim); font-size:14.5px; margin:0}
.crew{margin:12px 0 0; font-size:13px; color:var(--dim2); line-height:1.6}
.crew b{color:var(--dim); font-weight:600}

.where{padding:22px}
.where h3{margin:0 0 16px; font-size:17px}
.grp{margin-bottom:20px}
.grp:last-child{margin-bottom:0}
.grp h4{margin:0 0 9px; font-size:12px; letter-spacing:.9px; text-transform:uppercase; color:var(--dim2)}
.opt{
  display:flex; align-items:center; gap:12px; padding:11px 13px; margin-bottom:8px;
  background:var(--card); border:1px solid var(--line); border-radius:11px; flex-wrap:wrap;
}
.opt:last-child{margin-bottom:0}
.svc{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:38px; height:38px; border-radius:9px; font-weight:800; font-size:15px; color:#fff;
}
.oinfo{flex:1 1 130px; min-width:0}
.oname{font-size:14.5px; font-weight:600; display:block}
.odet{font-size:12.5px; color:var(--dim); margin-top:1px; display:block}
.odet .mine{color:var(--ok); font-weight:600}
.odet .soon{color:var(--warn); font-weight:600}
.go{
  background:var(--accent); color:var(--accent-ink); text-decoration:none; font-weight:700;
  font-size:13.5px; padding:9px 15px; border-radius:9px; white-space:nowrap;
}
.go:hover{filter:brightness(1.08)}
.go.sec{background:transparent; color:var(--dim); border:1px solid var(--line); font-weight:600}
.go.sec:hover{color:var(--txt); filter:none}
.nowhere{color:var(--dim); font-size:14px; background:var(--card); border:1px dashed var(--line); border-radius:11px; padding:16px}
.close{
  position:absolute; top:0; right:0; margin:14px; background:rgba(0,0,0,.55); color:#fff;
  border:0; width:34px; height:34px; border-radius:50%; font-size:19px; cursor:pointer; line-height:1;
}

footer{border-top:1px solid var(--line); padding:20px 0 40px; color:var(--dim2); font-size:12.5px}
footer a{color:var(--dim)}
.quota{margin-top:6px}
.quota b{color:var(--dim)}

/* ---------- modo TV ---------- */
.tvrow{margin-top:10px; display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.tvrow span{font-size:12px}
.tvhint{
  background:rgba(255,197,49,.10); border:1px solid rgba(255,197,49,.35);
  color:var(--txt); border-radius:12px; padding:14px 16px; margin-bottom:18px; font-size:15px;
}
.tvhint b{color:var(--warn)}

body.tv{font-size:20px}
body.tv .wrap{max-width:none; padding:0 5vw}      /* margen de pantalla segura */
body.tv header{position:static; padding-top:2vh}
body.tv .logo{font-size:30px}
body.tv .logo .mark{width:42px; height:42px}
body.tv .searchbox input{font-size:22px; padding:16px 26px}
body.tv .btn{font-size:20px; padding:16px 30px}
body.tv .btn.ghost{font-size:18px}
body.tv .tab, body.tv .fchip, body.tv .chip{font-size:18px; padding:12px 22px}
body.tv .sel{font-size:16px; padding:8px 12px 8px 18px}
body.tv .sel select{font-size:18px}
body.tv .grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:30px 24px}
body.tv .ttl{font-size:19px}
body.tv .sub{font-size:16px}
body.tv .pill{font-size:13px; padding:4px 9px}
body.tv .poster .flag{font-size:12px; padding:4px 9px}
body.tv .meta{font-size:18px}
body.tv .state{font-size:19px}
body.tv .state h2{font-size:26px}
body.tv .sheet h2{font-size:34px}
body.tv .sheet .top .pp{width:220px}
body.tv .ovw{font-size:19px}
body.tv .fact{font-size:15px; padding:5px 12px}
body.tv .where h3{font-size:22px}
body.tv .grp h4{font-size:15px}
body.tv .opt{padding:16px 18px; gap:16px}
body.tv .svc{width:52px; height:52px; font-size:19px}
body.tv .oname{font-size:20px}
body.tv .odet{font-size:16px}
body.tv .go{font-size:18px; padding:14px 24px}
body.tv .close{width:52px; height:52px; font-size:26px}
body.tv footer{font-size:15px}
body.tv .tvrow span{font-size:15px}

/* El foco tiene que verse desde el sillón. */
body.tv :focus{outline:none}
body.tv a:focus, body.tv button:focus, body.tv select:focus, body.tv input:focus{
  outline:4px solid var(--accent); outline-offset:4px; border-radius:12px;
}
body.tv .card:focus .poster{border-color:var(--accent); transform:scale(1.05)}
body.tv .card:focus .ttl{color:var(--accent)}
.card .poster{transition:transform .12s ease}

@media (max-width:620px){
  /* En el teléfono el encabezado ocupa demasiado si queda fijo:
     lo dejamos scrollear para que las tapas tengan toda la pantalla. */
  header{position:static}
  .bar{padding:12px 0 10px; gap:10px}
  .logo{font-size:19px}
  .searchbox{flex:1 1 100%}
  .btn.ghost{padding:9px 14px; font-size:13.5px}
  .rowtabs{padding-bottom:10px}
  .spacer{display:none}
  .filters{padding-bottom:10px}
  .frow{gap:6px}
  .sel{padding:4px 6px 4px 11px; font-size:12px}
  .sel select{font-size:12.5px}
  .sheet .top{flex-direction:column}
  .sheet .top .pp{width:120px}
  .grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:14px 10px}
  .ttl{font-size:13px}
  .sub{font-size:11.5px}
  .pill{font-size:9.5px; padding:2px 5px}
  .poster .flag{font-size:9px; padding:2px 5px}
}
