:root {
  --fundo: #141414;
  --fundo2: #1f1f1f;
  --fundo3: #2a2a2a;
  --texto: #f2f2f2;
  --fraco: #a3a3a3;
  --marca: #e5091a;
  --marca2: #b20710;
  --ok: #46d369;
  --raio: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- topo ---------- */
#topo { position: fixed; inset: 0 0 auto 0; z-index: 20; background: linear-gradient(#000c, #0000); transition: background .3s; padding-top: env(safe-area-inset-top); }
#topo.solido { background: var(--fundo); }
.topo-in { display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 4%; }
.logo { background: none; border: 0; color: var(--marca); font-weight: 900; font-size: 30px; letter-spacing: 1px; cursor: pointer; padding: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transform: scaleY(1.15); }
.selo { font-size: 12px; border: 1px solid var(--fraco); color: var(--fraco); padding: 1px 8px; border-radius: 3px; margin-left: -18px; }
#menu { display: flex; gap: 20px; flex: 1; }
#menu a { color: #e5e5e5; font-size: 14px; }
#menu a.ativo { font-weight: 700; color: #fff; }
#menu a:hover { color: #b3b3b3; }
.btn-icone { background: none; border: 0; cursor: pointer; padding: 6px; color: #fff; }

#abas { position: fixed; inset: auto 0 0 0; z-index: 20; display: none; background: #0f0f0fee; border-top: 1px solid #222; padding-bottom: env(safe-area-inset-bottom); }
#abas a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; color: var(--fraco); }
#abas a.ativo { color: #fff; }

@media (max-width: 760px) {
  #menu { display: none; }
  #abas:not([hidden]) { display: flex; }
  .topo-in { height: 54px; }
  .logo { font-size: 26px; }
  main { padding-bottom: 70px; }
}

main { min-height: 100vh; }
.pagina { padding: 90px 4% 40px; max-width: 1100px; }
.pagina h1 { font-size: 28px; margin: 0 0 20px; }
.pagina h2 { font-size: 18px; margin: 28px 0 12px; }

/* ---------- destaque ---------- */
.heroi { position: relative; height: 80vh; min-height: 420px; max-height: 820px; background: #000 center/cover no-repeat; display: flex; align-items: flex-end; }
.heroi::before { content: ""; position: absolute; inset: 0; background: linear-gradient(77deg, #000b 0%, #0000 60%), linear-gradient(0deg, var(--fundo) 0%, #0000 35%); }
.heroi-in { position: relative; padding: 0 4% 12vh; max-width: 640px; }
.heroi h2 { font-size: clamp(30px, 5vw, 58px); line-height: 1.05; margin: 0 0 12px; text-shadow: 2px 2px 6px #0008; }
.heroi p { font-size: clamp(14px, 1.5vw, 18px); margin: 0 0 18px; text-shadow: 1px 1px 3px #000a; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: #ddd; font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.meta .hd { border: 1px solid #aaa; border-radius: 3px; padding: 0 5px; font-size: 11px; line-height: 18px; }
.botoes { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 4px; padding: 9px 22px; font-size: 16px; font-weight: 700; cursor: pointer; background: #6d6d6eb3; color: #fff; }
.btn:hover { opacity: .85; }
.btn.branco { background: #fff; color: #000; }
.btn.marca { background: var(--marca); }
.btn.fino { font-weight: 500; font-size: 14px; padding: 7px 14px; background: var(--fundo3); }
.btn.perigo { background: #5a1a1a; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- fileiras ---------- */
.fileiras { position: relative; margin-top: -9vh; z-index: 2; padding-bottom: 40px; }
.sem-heroi .fileiras { margin-top: 0; padding-top: 80px; }
.fileira { margin: 0 0 3vw; }
.fileira h3 { margin: 0 4% 8px; font-size: clamp(16px, 1.4vw, 21px); font-weight: 600; }
.trilho-c { position: relative; }
.trilho { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4%; scrollbar-width: none; scroll-padding: 0 4%; }
.trilho::-webkit-scrollbar { display: none; }
.seta { position: absolute; top: 4px; bottom: 4px; width: 4%; min-width: 32px; border: 0; background: #000a; color: #fff; font-size: 34px; cursor: pointer; z-index: 3; opacity: 0; transition: opacity .2s; }
.trilho-c:hover .seta { opacity: 1; }
.seta.esq { left: 0; } .seta.dir { right: 0; }
@media (hover: none) { .seta { display: none; } }

.cartao { flex: 0 0 calc((92vw - 30px) / 6); min-width: 150px; scroll-snap-align: start; cursor: pointer; position: relative; border-radius: var(--raio); overflow: hidden; background: var(--fundo2); transition: transform .25s; }
@media (max-width: 1100px) { .cartao { flex-basis: calc((92vw - 18px) / 4); } }
@media (max-width: 760px) { .cartao { flex-basis: calc((92vw - 12px) / 2.3); } }
@media (hover: hover) { .cartao:hover { transform: scale(1.06); z-index: 4; } }
.capa { aspect-ratio: 16/9; background: var(--fundo3) center/cover no-repeat; display: flex; align-items: flex-end; }
.capa .sem { padding: 8px; font-weight: 700; font-size: 14px; line-height: 1.2; }
.cartao .tit { padding: 6px 8px 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ddd; }
.cartao .dur { position: absolute; right: 6px; top: 6px; background: #000b; font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.barra { height: 3px; background: #555; }
.barra > i { display: block; height: 100%; background: var(--marca); }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 8px; }
.grade .cartao { min-width: 0; }
@media (max-width: 760px) { .grade { grid-template-columns: repeat(2, 1fr); } }
.vazio { color: var(--fraco); padding: 40px 0; text-align: center; }

/* ---------- formulários ---------- */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 13px; color: var(--fraco); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; background: #333; border: 1px solid #444; border-radius: 4px; padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #888; }
textarea { min-height: 110px; resize: vertical; }
.linha { display: flex; gap: 8px; align-items: center; }
.linha > input { flex: 1; }
.cartao-form { background: var(--fundo2); border-radius: 8px; padding: 18px; }

.entrar { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at top, #2a0a0d 0%, var(--fundo) 60%); }
.entrar .caixa { width: 100%; max-width: 380px; background: #000b; padding: 40px 34px; border-radius: 8px; }
.entrar .logo { display: block; margin: 0 auto 26px; font-size: 44px; }
.entrar h1 { font-size: 24px; margin: 0 0 18px; }
.entrar .btn { width: 100%; justify-content: center; margin-top: 8px; }
.erro { color: #ff6b6b; font-size: 14px; min-height: 20px; margin: 6px 0; }
.dica { color: var(--fraco); font-size: 13px; }

/* ---------- downloads ---------- */
.down { background: var(--fundo2); border-radius: 6px; padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.down .info { flex: 1; min-width: 0; }
.down .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.down .s { font-size: 13px; color: var(--fraco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.down .s.err { color: #ff8a8a; white-space: normal; }
.down .barra { margin-top: 6px; border-radius: 2px; }
.down .acoes { display: flex; gap: 6px; flex-shrink: 0; }
.estado-pronto { color: var(--ok) !important; }

.medidor { height: 10px; border-radius: 5px; background: #333; overflow: hidden; margin: 6px 0 4px; }
.medidor > i { display: block; height: 100%; background: var(--ok); }
.medidor > i.alto { background: #f5a623; } .medidor > i.cheio { background: var(--marca); }

.cats .cat { display: flex; align-items: center; gap: 6px; background: var(--fundo2); padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; }
.cats .cat input { flex: 1; background: transparent; border-color: transparent; padding: 6px; }
.cats .cat input:focus { background: #333; }
.cats .n { color: var(--fraco); font-size: 12px; min-width: 60px; text-align: right; }

/* ---------- janela de detalhes ---------- */
#camada:empty { display: none; }
.fundo-modal { position: fixed; inset: 0; z-index: 40; background: #000b; overflow-y: auto; display: flex; justify-content: center; padding: 30px 12px; }
.modal { background: #181818; border-radius: 8px; width: 100%; max-width: 850px; align-self: flex-start; overflow: hidden; position: relative; box-shadow: 0 10px 40px #000; }
.modal.peq { max-width: 420px; padding: 26px; margin-top: 12vh; }
.modal .fechar { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #181818; color: #fff; font-size: 20px; cursor: pointer; }
.modal .topo-capa { position: relative; aspect-ratio: 16/9; background: #000 center/cover no-repeat; }
.modal .topo-capa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #181818 0%, #0000 50%); }
.modal .topo-capa .botoes { position: absolute; left: 4%; bottom: 8%; z-index: 2; }
.modal .topo-capa h2 { position: absolute; left: 4%; bottom: calc(8% + 54px); z-index: 2; margin: 0; font-size: clamp(22px, 4vw, 38px); max-width: 90%; text-shadow: 2px 2px 6px #000a; }
.modal .corpo { padding: 6px 4% 28px; }
.modal .desc { white-space: pre-wrap; color: #ddd; max-height: 260px; overflow-y: auto; margin: 10px 0 18px; }
.modal .origem { font-size: 13px; color: var(--fraco); word-break: break-all; }
.modal .barra { margin: 4px 0 12px; border-radius: 2px; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 60; background: #000; }
.player video { width: 100%; height: 100%; background: #000; }
.player .barra-topo { position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(#000c, #0000); transition: opacity .4s; z-index: 2; }
.player .barra-topo .t { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player.quieto .barra-topo { opacity: 0; pointer-events: none; }
.player .voltar { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
.player .voltar svg { width: 30px; height: 30px; }

#aviso { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: #fff; color: #000; padding: 10px 18px; border-radius: 4px; font-weight: 600; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; max-width: 90vw; text-align: center; }
#aviso.ver { opacity: 1; transform: translateX(-50%); }

.carregando { display: flex; justify-content: center; padding: 120px 0; }
.carregando::after { content: ""; width: 44px; height: 44px; border: 4px solid #333; border-top-color: var(--marca); border-radius: 50%; animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- séries ---------- */
.cartao .tit small { display: block; color: var(--fraco); font-size: 11px; margin-top: 1px; }
.selo-serie { position: absolute; left: 6px; top: 6px; background: var(--marca); font-size: 10px; font-weight: 800; letter-spacing: .5px; padding: 1px 6px; border-radius: 3px; }
.link-serie { color: #fff; }
.link-serie:hover { text-decoration: underline; }
.acomp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--fundo2); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.acomp label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.eps .ep { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid #2a2a2a; cursor: pointer; border-radius: 4px; }
.eps .ep:hover { background: #222; }
.eps .n { width: 26px; text-align: center; font-size: 20px; color: var(--fraco); flex-shrink: 0; }
.eps .ep-capa { width: 130px; aspect-ratio: 16/9; flex-shrink: 0; background: var(--fundo3) center/cover; border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.eps .ep-capa .barra { width: 100%; }
.eps .ep-info { flex: 1; min-width: 0; }
.eps .ep-info .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 760px) { .eps .ep-capa { width: 96px; } .eps .n { display: none; } }
.player .proximo { position: absolute; right: 24px; bottom: 90px; z-index: 3; background: #000d; border: 1px solid #333; border-radius: 8px; padding: 14px 16px; max-width: 360px; display: grid; gap: 10px; }

#chips-tipo { display: none; gap: 8px; padding: 0 4% 8px; }
#chips-tipo a { border: 1px solid #ffffff80; border-radius: 16px; padding: 4px 14px; font-size: 13px; }
#chips-tipo a.ativo { background: #fff; color: #000; border-color: #fff; }
@media (max-width: 760px) { #chips-tipo { display: flex; } .heroi { height: 72vh; } .heroi-in { padding-bottom: 28px; } .fileiras { margin-top: 0; } }
optgroup { color: var(--fraco); }
.eps .ep.breve { cursor: default; opacity: .7; }
.eps .ep.breve:hover { background: none; }
