:root {
  --bg: #0b0d12; --surface: #141821; --card: #1b202c; --line: #272e3d;
  --text: #f3f5f9; --muted: #98a1b3; --accent: #5eead4; --accent2: #818cf8;
  --radius: 14px;
}
* { box-sizing: border-box; }
/* O atributo [hidden] tem de ganhar: o stylesheet do autor vence sempre o do UA,
   por isso uma regra como .sheet{display:flex} deixava o modal colado ao ecrã
   (e a cobrir as capas) mesmo com hidden — nenhum toque chegava ao resto. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       padding-bottom: env(safe-area-inset-bottom); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(11,13,18,.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; white-space: nowrap; letter-spacing: .2px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); margin-right: 6px; }
.search { display: flex; flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); padding: 9px 12px; font-size: 14px; }
.search button { border: 0; background: transparent; color: var(--accent); font-size: 20px;
  padding: 0 14px; cursor: pointer; }
.channels { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px; scrollbar-width: none; }
.channels::-webkit-scrollbar { display: none; }
.channels button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.channels button.active { color: #061014; background: var(--accent); border-color: var(--accent); font-weight: 700; }
main { padding: 0 14px 24px; }
.status { padding: 12px; margin: 8px 0; border-radius: var(--radius); background: var(--surface);
  color: var(--muted); font-size: 13px; }
.status.error { color: #fca5a5; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid transparent; }
.card:active { transform: scale(.98); }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: var(--surface); }
.card .t { padding: 7px 8px 9px; font-size: 12px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { display: block; width: 100%; margin: 18px 0; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.72);
  display: flex; align-items: flex-end; }
.sheet-inner { position: relative; width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); }
.close { position: absolute; right: 14px; top: 12px; border: 0; background: var(--surface);
  color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.sheet-pic { width: 120px; aspect-ratio: 2/3; object-fit: cover; border-radius: 12px; float: left; margin-right: 14px; }
.sheet h2 { font-size: 18px; margin: 0 0 6px; }
.meta, .blurb { color: var(--muted); font-size: 13px; margin: 6px 0; }
.blurb { clear: both; padding-top: 10px; }
.episodes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.episodes button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; }
.episodes button.active { background: var(--accent); color: #061014; font-weight: 700; }
.player-wrap { margin-top: 16px; }
.player-wrap video { width: 100%; border-radius: 12px; background: #000; }
.note { color: var(--muted); font-size: 12px; }
.note.error { color: #fca5a5; }
.sec-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.seasons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.seasons button { border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer; }
.seasons button.active { background: var(--accent2); border-color: var(--accent2);
  color: #0b0d12; font-weight: 700; }
.alt { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px;
  text-decoration: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; background: var(--surface); }
img.broken { background: repeating-linear-gradient(45deg, #141821, #141821 8px, #1b202c 8px, #1b202c 16px); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
