@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #080d24;
  --bg2: #0f1737;
  --bg3: #182350;
  --line: #25325f;
  --text: #eaf0ff;
  --muted: #8c9bcb;
  --accent: #f0b020;
  --brand: #4d97cc;
  --accent-ink: #1a1300;
  --danger: #e5534b;
  --ok: #3fb950;
  --radius: 10px;
  --poster-w: 160px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body { font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }

/* ---------- topo ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 24px;
  background: linear-gradient(var(--bg) 70%, transparent); }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.brand img { width: 30px; height: 30px; }
.brand b { color: var(--brand); font-weight: 800; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.nav a.on, .nav a:hover { color: var(--text); background: var(--bg3); }
.top .grow { flex: 1; }
.search { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; width: 240px; outline: none; }
.search:focus { border-color: var(--accent); }
.iconbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.iconbtn:hover { color: var(--text); background: var(--bg3); }

main { padding: 8px 24px 60px; }
h1 { font-size: 26px; margin: 12px 0 18px; }
h2 { font-size: 18px; margin: 26px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- botoes e formularios ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg3); padding: 8px 16px;
  border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #4a5160; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=url], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; outline: none; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg3); color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.err { color: var(--danger); }

/* ---------- prateleiras e grades ---------- */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: var(--poster-w); gap: 16px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x proximity; }
.shelf.wide { grid-auto-columns: 280px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--poster-w), 1fr)); gap: 22px 16px; }
.tile { position: relative; cursor: pointer; scroll-snap-align: start; }
.tile .art { position: relative; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--bg3); }
.tile.wide .art { aspect-ratio: 16/9; }
.tile .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.tile:hover .art img { transform: scale(1.04); }
.tile:hover .art { outline: 2px solid var(--accent); }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.tile .t { margin-top: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.6); }
.tile .bar i { display: block; height: 100%; background: var(--accent); }
.tile .corner, .scard .corner { position: absolute; top: 0; right: 0; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; border-bottom-left-radius: 8px; }
.tile .seen { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65);
  display: grid; place-items: center; color: var(--accent); font-size: 13px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }

/* ---------- detalhe ---------- */
.hero { position: relative; margin: -60px -24px 0; padding: 90px 24px 30px; min-height: 420px; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center top; opacity: .35; }
.hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 15%, transparent 70%), linear-gradient(0deg, var(--bg), transparent 60%); }
.hero .inner { position: relative; display: flex; gap: 32px; align-items: flex-start; }
.hero .poster { width: 240px; flex-shrink: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 2/3; background: var(--bg3); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.hero .poster img { width: 100%; height: 100%; object-fit: cover; }
.hero .info { max-width: 820px; }
.hero h1 { font-size: 34px; margin: 0 0 4px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin: 6px 0 14px; }
.ratings { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rating { display: flex; gap: 6px; align-items: center; background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.rating b { color: var(--accent); }
.tagline { font-style: italic; color: var(--muted); margin-bottom: 8px; }
.overview { max-width: 760px; margin-bottom: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cast { display: grid; grid-auto-flow: column; grid-auto-columns: 110px; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.cast .p .ph { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; background: var(--bg3); }
.cast .p img { width: 100%; height: 100%; object-fit: cover; }
.cast .p div { font-size: 13px; text-align: center; margin-top: 6px; }
.cast .p small { display: block; color: var(--muted); text-align: center; font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.tabs button { background: var(--bg3); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.eps { display: flex; flex-direction: column; gap: 10px; }
.ep { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; padding: 12px; border-radius: 12px; align-items: start; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, transform .15s; }
.ep:hover { border-color: var(--accent); }
.ep .thumb { position: relative; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--bg3); cursor: pointer; }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.6); }
.ep .thumb .bar i { display: block; height: 100%; background: var(--accent); }
.ep h3 { margin: 2px 0 4px; font-size: 16px; }
.ep p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep.unavail { opacity: .45; }
.tech { font-size: 13px; color: var(--muted); }
.tech table { border-collapse: collapse; width: 100%; }
.tech td { padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; background: #000; z-index: 50; }
.player video { width: 100%; height: 100%; background: #000; }
.player video::cue { background: rgba(0,0,0,.55); color: #fff; font-size: 1.15em; font-family: inherit; }
.pctl { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 28px 22px; background: linear-gradient(transparent, rgba(0,0,0,.85)); transition: opacity .3s; }
.ptop { position: absolute; left: 0; right: 0; top: 0; padding: 18px 28px; background: linear-gradient(rgba(0,0,0,.75), transparent); display: flex; gap: 16px; align-items: center; transition: opacity .3s; }
.player.idle .pctl, .player.idle .ptop { opacity: 0; }
.player.idle { cursor: none; }
.seek { width: 100%; accent-color: var(--accent); margin: 0 0 10px; }
.prow { display: flex; gap: 14px; align-items: center; }
.prow .grow { flex: 1; }
.pbtn { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.prow select { background: rgba(0,0,0,.6); border-color: #444; font-size: 13px; padding: 6px 8px; }
.nextup { position: absolute; right: 28px; bottom: 120px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; max-width: 340px; }
.perr { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; }

/* ---------- configuracoes ---------- */
.settings { display: grid; grid-template-columns: 210px 1fr; gap: 28px; }
.side { display: flex; flex-direction: column; gap: 2px; }
.side a { padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.side a.on, .side a:hover { background: var(--bg3); color: var(--text); }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.li .grow { flex: 1; min-width: 0; }
.li .grow div { overflow: hidden; text-overflow: ellipsis; }
.order { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.order .li { padding: 8px 12px; }
pre.log { background: #000; padding: 14px; border-radius: 8px; font-size: 12px; overflow: auto; max-height: 520px; white-space: pre-wrap; word-break: break-all; }
code { background: var(--bg3); padding: 2px 6px; border-radius: 5px; font-size: 13px; word-break: break-all; }

/* ---------- login / assistente ---------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.box { width: 100%; max-width: 560px; }
.box.narrow { max-width: 380px; }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--bg3); }
.steps i.on { background: var(--accent); }
.fsbrowser { border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow: auto; margin-top: 8px; }
.fsbrowser div { padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.fsbrowser div:hover { background: var(--bg3); }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal .card { width: 100%; max-width: 620px; max-height: 88vh; overflow: auto; }
.cands { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cand { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 8px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); }
.cand:hover { border-color: var(--accent); }
.cand img, .cand .noimg { width: 60px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; background: var(--bg3); }
.cand p { margin: 4px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: var(--bg3); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#toast div.err { border-color: var(--danger); }

@media (max-width: 760px) {
  :root { --poster-w: 120px; }
  .top { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .search { width: 100%; order: 9; }
  main { padding: 8px 14px 50px; }
  .hero { margin: -60px -14px 0; padding: 80px 14px 20px; }
  .hero .inner { flex-direction: column; }
  .hero .poster { width: 150px; }
  .hero h1 { font-size: 26px; }
  .ep { grid-template-columns: 130px 1fr; }
  .ep > :last-child { grid-column: 1 / -1; }
  .settings { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; }
}

/* ---------- legendas (estilo do usuario) ---------- */
.subbox { position: absolute; left: 6%; right: 6%; text-align: center; pointer-events: none; z-index: 2; }
.subtxt { display: flex; flex-direction: column; align-items: center; gap: .08em; }
.subline { display: inline-block; padding: .05em .4em; border-radius: .2em; white-space: pre-wrap; }
.subprev { position: relative; height: 220px; border-radius: 12px; margin-bottom: 16px; overflow: hidden;
  background: linear-gradient(135deg, #3b6b3a, #1b2a3a 55%, #0b0d11); border: 1px solid var(--line); }
.subed .grid2 { gap: 8px 28px; }
.subed input[type=range] { accent-color: var(--accent); width: 100%; }
.subed input[type=color] { width: 44px; height: 34px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.sw:hover { border-color: var(--text); }
.subpanel { position: absolute; right: 24px; bottom: 120px; width: min(560px, calc(100% - 48px)); max-height: 70vh; overflow: auto; z-index: 5;
  background: rgba(23, 26, 33, .97); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: default; }

/* arquivo e versoes lado a lado; empilha em telas estreitas */
.filever { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 24px; align-items: start; }
.filever > div { min-width: 0; }
.filever td + td { overflow-wrap: anywhere; }

.rating.tag { background: rgba(255,255,255,.08); color: var(--text); font-weight: 600; font-size: 13px; letter-spacing: .2px; }
.badges { margin-top: -4px; }

/* ---------- iPhone / celular no navegador ---------- */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; -webkit-tap-highlight-color: transparent; }
.top { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
main { padding-bottom: max(50px, calc(env(safe-area-inset-bottom) + 30px)); }
.ptop { padding-top: max(18px, env(safe-area-inset-top)); padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
.pctl { padding-bottom: max(22px, env(safe-area-inset-bottom)); padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; } /* abaixo de 16px o iPhone amplia a tela ao tocar no campo */
  .ptop, .pctl { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .pbtn { min-width: 44px; min-height: 44px; }
}
/* puxar para atualizar */
#ptr { position: fixed; left: 50%; top: max(8px, env(safe-area-inset-top)); z-index: 80; width: 40px; height: 40px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 18px; transform: translate(-50%, -60px); transition: transform .2s; pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
#ptr.go { background: var(--accent); color: #1b1306; }
#ptr.spin { animation: ptrspin .8s linear infinite; }
@keyframes ptrspin { to { rotate: 360deg; } }

/* aviso de atividade em segundo plano */
#activity { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; width: min(340px, calc(100vw - 32px)); background: var(--bg3); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#activity[hidden] { display: none; }
#activity .acth { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#activity .acth b { flex: 1; font-size: 14px; }
#activity .spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: ptrspin .8s linear infinite; }
#activity .act { margin-top: 8px; }
#activity .actl { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
#activity .bar { height: 6px; border-radius: 3px; background: var(--bg); margin-top: 4px; overflow: hidden; }
#activity .bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

.rating.tag.ok { background: rgba(63,185,80,.16); border-color: rgba(63,185,80,.5); color: #7ee08f; }
.rating.tag.no { color: var(--muted); }
.ep .badges { gap: 6px; margin-bottom: 4px; }
.ep .rating.tag { padding: 2px 8px; font-size: 12px; }

/* episodio: simbolo de tocar sobre a imagem */
.ep .thumb .playic { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.38); color: rgba(255,255,255,.85); font-size: 20px; padding-left: 3px; box-sizing: border-box; opacity: .8; transition: opacity .15s, color .15s, transform .15s; pointer-events: none; }
.ep .thumb:hover .playic { opacity: 1; color: var(--accent); transform: scale(1.1); }
/* temporadas */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; margin-bottom: 8px; }
.scard { display: block; color: inherit; text-decoration: none; }
.scard .sposter { position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; background: var(--bg3); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.scard:hover .sposter { border-color: var(--accent); transform: translateY(-2px); }
.scard .sposter img { width: 100%; height: 100%; object-fit: cover; }
.scard .sname { font-weight: 600; margin-top: 8px; }

/* ficha do arquivo: rotulo em coluna fixa, idiomas como etiquetas */
.tech td.k { white-space: nowrap; width: 150px; color: var(--muted); vertical-align: top; padding-right: 16px; }
.tech td { vertical-align: top; }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lchip { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.05); font-size: 13px; }
.lchip.pt { border-color: rgba(63,185,80,.5); background: rgba(63,185,80,.14); color: #7ee08f; }
.lchip.ext { border-style: dashed; }
.lmore { display: inline-block; }
.lmore summary { cursor: pointer; color: var(--accent); font-size: 13px; list-style: none; padding: 2px 6px; }
.lmore summary::-webkit-details-marker { display: none; }
.lmore[open] { display: block; flex-basis: 100%; }
.lmore[open] summary { margin-bottom: 6px; }

.rating.tag.alang { background: rgba(240,176,32,.14); border-color: rgba(240,176,32,.5); color: var(--accent); }

/* confirmacao de apagar: lista dos arquivos */
.delfiles { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0 12px; }
.delf { padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.delf:last-child { border-bottom: 0; }

/* progresso assistido na pagina do filme/episodio */
.wbar { margin: 4px 0 12px; max-width: 420px; }
.wtrack { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin-bottom: 6px; }
.wtrack i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0 28px; opacity: .7; }
