:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #141414;
  --panel-2: #1f1f1f;
  --line: #2a2a2a;
  --text: #e9e9e9;
  --muted: #a8a8a8;
  --red: #e50914;
  --edge: clamp(16px, 4vw, 58px);
  --radius: 6px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 320px; -webkit-font-smoothing: antialiased; }
body.watching { background: #000; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; background: none; border: 0; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; top: -60px; left: 16px; z-index: 300; background: var(--red); color: #fff; padding: 10px 16px; border-radius: var(--radius); }
.skip:focus { top: 12px; }

/* Barra superior */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 68px; z-index: 60; display: flex; align-items: center; gap: 30px; padding: 0 var(--edge); background: linear-gradient(180deg, #000000d9, #00000059 62%, transparent); transition: background .3s; }
.topbar.solid { background: #0b0b0cf7; border-bottom: 1px solid #ffffff12; }
body.watching .topbar { display: none; }
.logo { font: 900 25px/1 'Manrope', sans-serif; letter-spacing: 1px; color: var(--red); text-transform: uppercase; }
.topnav { display: flex; gap: 21px; }
.topnav a { font-size: 14px; color: #d6d6d6; transition: color .2s; }
.topnav a:hover, .topnav a.active { color: #fff; font-weight: 600; }
.topactions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.quicksearch { display: flex; align-items: center; gap: 8px; width: 200px; padding: 7px 10px; border: 1px solid #ffffff3d; border-radius: 4px; background: #000000a6; transition: border-color .2s, width .2s; }
.quicksearch:focus-within { border-color: #fff; width: 250px; }
.quicksearch svg { width: 17px; height: 17px; color: #cfcfcf; }
.quicksearch input { width: 100%; border: 0; outline: none; background: none; color: #fff; font-size: 13px; }
.classic { font-size: 12px; color: #c2c2c2; border: 1px solid #ffffff33; border-radius: 4px; padding: 7px 12px; transition: .2s; }
.classic:hover { color: #fff; border-color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 4px; display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .5px; background: linear-gradient(135deg, #c0392b, #7b1e12); }

/* Destaque */
.hero { position: relative; min-height: min(76vh, 660px); display: flex; align-items: flex-end; padding: 0 var(--edge) 56px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 32%; }
.hero-bg.grad { background: radial-gradient(circle at 74% 34%, hsl(var(--h), 58%, 42%), hsl(var(--h), 52%, 17%) 52%, #080808 100%); }
.hero:before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #0b0b0cf2 0%, #0b0b0ccc 38%, transparent 74%), linear-gradient(0deg, #0b0b0c 3%, transparent 52%); }
.hero-copy { position: relative; z-index: 2; max-width: 620px; }
.hero-badge { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 11px; font-weight: 800; letter-spacing: 2.6px; color: #d4d4d4; }
.hero-badge .n { background: var(--red); color: #fff; border-radius: 3px; padding: 3px 7px; letter-spacing: 1.4px; }
.hero h1 { font: 900 clamp(32px, 4.4vw, 64px)/1.05 'Manrope', sans-serif; letter-spacing: -2.4px; margin: 0 0 15px; text-shadow: 0 3px 26px #000c; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-bottom: 14px; font-size: 13px; color: #dedede; }
.chip { border: 1px solid #ffffff47; border-radius: 3px; padding: 3px 8px; font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.hero p { max-width: 540px; margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: #d3d3d3; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 22px; border-radius: 4px; font-size: 14px; font-weight: 800; transition: .18s; }
.btn.white { background: #fff; color: #000; }
.btn.white:hover { background: #d9d9d9; }
.btn.grey { background: #ffffff2e; color: #fff; }
.btn.grey:hover { background: #ffffff45; }
.btn svg { width: 20px; height: 20px; }

/* Prateleiras */
.rail { padding: 0 var(--edge); }
.rail + .rail { margin-top: 6px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 2px; }
.rail-head h2 { font: 800 clamp(17px, 1.5vw, 22px)/1.2 'Manrope', sans-serif; margin: 0; letter-spacing: -.4px; }
.rail-head a { font-size: 12px; color: var(--muted); font-weight: 600; }
.rail-head a:hover { color: #fff; }
.rail-wrap { position: relative; }
.rail-track { --edge: clamp(16px, 4vw, 58px); display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 24px var(--edge) 38px; margin: 0 calc(-1 * var(--edge)); scroll-behavior: smooth; scrollbar-width: none; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-nav { position: absolute; top: 0; bottom: 26px; width: 42px; z-index: 8; display: grid; place-items: center; background: #0b0b0cb8; color: #fff; opacity: 0; transition: opacity .2s; }
.rail-wrap:hover .rail-nav { opacity: 1; }
.rail-nav svg { width: 26px; height: 26px; }
.rail-nav[data-rail-nav="prev"] { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.rail-nav[data-rail-nav="next"] { right: 0; border-radius: var(--radius) 0 0 var(--radius); }

/* Cartões */
.card { position: relative; flex: 0 0 clamp(180px, 19vw, 268px); transition: transform .24s ease, z-index 0s; }
.card:hover, .card:focus-visible { transform: scale(1.15); z-index: 6; outline: none; }
.poster { position: relative; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; background: #1a1a1a; box-shadow: 0 6px 16px #0006; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.poster .art { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(36px, 4vw, 62px)/1 'Manrope', sans-serif; letter-spacing: -2px; color: #ffffff2b; background: radial-gradient(circle at 72% 26%, hsl(var(--h), 62%, 44%), hsl(var(--h), 55%, 20%) 56%, #0c0c0c 100%); }
.poster:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, #000000e6); pointer-events: none; }
.card-overlay { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 9px 11px 10px; opacity: 0; transform: translateY(8px); transition: .22s; }
.card:hover .card-overlay, .card:focus-visible .card-overlay, .grid .card-overlay { opacity: 1; transform: none; }
.card-title { font: 700 13px/1.28 'Manrope', sans-serif; margin: 0 0 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; font-size: 11px; color: #c6c6c6; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: #8a8a8a; }
.card-actions { display: flex; align-items: center; gap: 7px; }
.rbtn { width: 30px; height: 30px; border-radius: 50%; border: 1.6px solid #ffffff8c; background: #141414b8; display: grid; place-items: center; transition: .18s; }
.rbtn:hover { border-color: #fff; background: #000000d6; }
.rbtn svg { width: 14px; height: 14px; }
.rbtn.primary { background: #fff; border-color: #fff; color: #000; }
.rbtn.primary:hover { background: #dcdcdc; }
.card-bar { position: absolute; left: 11px; right: 11px; bottom: 6px; height: 3px; z-index: 2; border-radius: 3px; background: #ffffff45; }
.card-bar span { display: block; height: 100%; border-radius: 3px; background: var(--red); }
.card-bar + .card-overlay { padding-bottom: 16px; }

/* Páginas em grade */
.page { min-height: 100vh; padding: 104px var(--edge) 80px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font: 800 clamp(27px, 3.3vw, 44px)/1.1 'Manrope', sans-serif; letter-spacing: -1.6px; margin: 0 0 8px; }
.page-head p { margin: 0; font-size: 14px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px 12px; }
.grid .card { flex: none; }
.grid .card:hover, .grid .card:focus-visible { transform: scale(1.05); }

/* Modal de detalhes */
.modal { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding: 44px 16px 60px; background: #000000c9; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(920px, 100%); border-radius: 8px; overflow: hidden; background: var(--panel); box-shadow: 0 24px 60px #000c; }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #141414d9; }
.modal-close:hover { background: #000; }
.modal-hero { position: relative; aspect-ratio: 16/7; display: flex; align-items: flex-end; padding: 32px 34px 26px; overflow: hidden; background: #141414; }
.modal-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
.modal-hero.grad { background: radial-gradient(circle at 72% 32%, hsl(var(--h), 60%, 40%), #101010 74%); }
.modal-hero:after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(0deg, var(--panel) 3%, #14141499 48%, transparent); }
.modal-hero-copy { position: relative; z-index: 3; max-width: 600px; }
.modal-hero h2 { font: 900 clamp(25px, 3vw, 42px)/1.07 'Manrope', sans-serif; letter-spacing: -1.6px; margin: 0 0 14px; text-shadow: 0 2px 20px #000a; }
.modal-body { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 34px; padding: 24px 34px 34px; }
.modal-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; font-size: 13px; color: #d0d0d0; }
.match { color: #46d369; font-weight: 700; }
.modal-desc { margin: 0 0 26px; font-size: 14px; line-height: 1.62; color: #d6d6d6; }
.modal-sub { font: 700 18px 'Manrope', sans-serif; margin: 0 0 4px; }
.mod-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 4px 11px; border-bottom: 1px solid var(--line); font: 700 14px 'Manrope', sans-serif; color: #eaeaea; }
.mod-label small { font-weight: 500; font-size: 12px; color: var(--muted); }
.ep-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid #232323; transition: background .18s; }
.ep-row:hover { background: #1e1e1e; }
.ep-num { width: 22px; text-align: right; font-size: 13px; color: var(--muted); flex: none; }
.ep-name { flex: 1; min-width: 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-size { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ep-play { width: 30px; height: 30px; border-radius: 50%; border: 1.4px solid #ffffff8c; display: grid; place-items: center; flex: none; }
.ep-play svg { width: 13px; height: 13px; }
.ep-row:hover .ep-play { border-color: #fff; background: #ffffff1f; }
.modal-side { font-size: 12px; line-height: 1.6; color: var(--muted); }
.modal-side p { margin: 0 0 12px; }
.modal-side span { color: #8c8c8c; }
.modal-side strong { color: #e2e2e2; font-weight: 600; }

/* Player */
.watch { min-height: 100vh; background: #000; }
.watch-bar { display: flex; align-items: center; gap: 16px; padding: 14px var(--edge); }
.wback { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #d8d8d8; }
.wback:hover { color: #fff; }
.wback svg { width: 18px; height: 18px; }
.watch-title { font-size: 13px; color: #b9b9b9; border-left: 1px solid #3a3a3a; padding-left: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-pct { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--red); white-space: nowrap; }
.player-box { width: 100%; background: #000; }
.player-box video { display: block; width: 100%; max-height: calc(100vh - 160px); aspect-ratio: 16/9; background: #000; }
.watch-info { max-width: 1080px; margin: 0 auto; padding: 22px var(--edge) 10px; }
.watch-info h1 { font: 800 clamp(21px, 2.4vw, 32px)/1.15 'Manrope', sans-serif; letter-spacing: -1px; margin: 0 0 8px; }
.watch-info p { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.watch-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ep-strip { max-width: 1080px; margin: 0 auto; padding: 18px var(--edge) 70px; }
.ep-strip h2 { font: 700 15px 'Manrope', sans-serif; margin: 0 0 10px; color: #dcdcdc; }
.ep-strip .ep-row { border-radius: 4px; padding: 12px 10px; }
.ep-strip .ep-row.active { background: #191919; }
.ep-strip .ep-row.active .ep-name { color: #fff; font-weight: 600; }
.ep-strip .ep-row.active .ep-play { border-color: var(--red); color: var(--red); }
 
/* Anotações */
.notes-box { max-width: 1080px; margin: 0 auto 30px; padding: 0 var(--edge); }
.notes-box h2 { font: 700 15px 'Manrope', sans-serif; margin: 0 0 12px; color: #dcdcdc; }
.notes-area { width: 100%; min-height: 120px; padding: 14px; border-radius: 4px; border: 1px solid #333; background: #141414; color: #fff; font-size: 14px; line-height: 1.5; resize: vertical; outline: none; transition: border-color .2s; }
.notes-area:focus { border-color: #666; }
.notes-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-save { padding: 8px 16px; border-radius: 4px; background: #fff; color: #000; font-size: 13px; font-weight: 700; transition: .18s; }
.btn-save:hover { background: #d9d9d9; }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
 
 /* Vazio e rodapé */
.empty { min-height: 100vh; display: grid; place-items: center; padding: 110px var(--edge) 70px; }
.empty-inner { max-width: 520px; text-align: center; }
.empty-inner .mark { font: 900 44px 'Manrope', sans-serif; color: var(--red); letter-spacing: 1px; text-transform: uppercase; }
.empty-inner h1 { font: 800 clamp(22px, 2.6vw, 32px)/1.2 'Manrope', sans-serif; letter-spacing: -1px; margin: 16px 0 12px; }
.empty-inner p { margin: 0 0 22px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.footer { padding: 44px var(--edge) 60px; border-top: 1px solid #1c1c1c; color: #6f6f6f; font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; }
.footer strong { color: var(--red); font: 900 15px 'Manrope', sans-serif; letter-spacing: .6px; text-transform: uppercase; }
.footer .spacer { margin-left: auto; }

.toast { position: fixed; right: 30px; bottom: 30px; z-index: 200; padding: 14px 20px; border-radius: var(--radius); background: #fff; color: #111; font-size: 13px; font-weight: 700; box-shadow: 0 18px 44px #000a; opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .modal-body { grid-template-columns: 1fr; gap: 22px; }
  .modal-hero { aspect-ratio: 16/9; }
}
@media (max-width: 760px) {
  :root { --edge: 16px; }
  .topbar { height: 56px; gap: 10px; padding: 0 16px; }
  .topnav { gap: 14px; }
  .topnav a { font-size: 13px; }
  .classic { display: none; }
  .avatar { display: none; }
  .quicksearch { width: 120px; }
  .quicksearch:focus-within { width: 160px; }
  .quicksearch svg { width: 15px; height: 15px; }
  .hero { min-height: 62vh; padding-bottom: 32px; }
  .hero h1 { font-size: 28px; letter-spacing: -1px; }
  .hero p { display: none; }
  .hero-badge { font-size: 10px; }
  .hero-meta { font-size: 12px; gap: 8px; }
  .hero-actions .btn { height: 42px; padding: 0 16px; font-size: 13px; }
  .card { flex: 0 0 44vw; }
  .card:hover, .card:focus-visible { transform: none; }
  .card-overlay { opacity: 1; transform: none; }
  .card-title { font-size: 12px; }
  .card-meta { font-size: 10px; }
  .rail-nav { display: none; }
  .rail-track { padding: 18px 16px 30px; gap: 8px; }
  .page { padding: 76px 16px 60px; }
  .page-head h1 { font-size: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 10px; }
  .watch-title { display: none; }
  .watch-bar { padding: 10px 16px; gap: 10px; }
  .watch-info h1 { font-size: 18px; }
  .watch-info p { font-size: 12px; }
  .watch-actions .btn { height: 40px; padding: 0 14px; font-size: 12px; }
  .player-box video { max-height: calc(100vh - 120px); }
  .notes-area { min-height: 80px; font-size: 13px; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100vh; }
  .modal-hero { aspect-ratio: 16/10; padding: 20px 16px 18px; }
  .modal-hero h2 { font-size: 22px; }
  .modal-body { padding: 18px 16px 24px; }
  .modal-tags { font-size: 12px; gap: 8px; }
  .modal-desc { font-size: 13px; }
  .ep-row { padding: 14px 4px; gap: 10px; }
  .ep-name { font-size: 13px; }
  .ep-num { width: 18px; font-size: 12px; }
  .ep-size { font-size: 10px; }
  .ep-play { width: 28px; height: 28px; }
  .toast { right: 12px; left: 12px; bottom: 12px; text-align: center; font-size: 12px; padding: 12px 16px; }
  .footer { padding: 30px 16px 40px; gap: 6px 16px; font-size: 11px; }
  .footer .spacer { width: 100%; }
  .empty-inner h1 { font-size: 20px; }
  .empty-inner p { font-size: 13px; }
  .empty-inner .btn { height: 42px; font-size: 13px; }
}

@media (max-width: 420px) {
  .topnav a { font-size: 12px; }
  .hero h1 { font-size: 22px; }
  .hero-meta { font-size: 11px; }
  .hero-meta .chip { font-size: 9px; padding: 2px 6px; }
  .hero-actions .btn { height: 38px; padding: 0 14px; font-size: 12px; }
  .hero-actions .btn span { display: none; }
  .hero-actions .btn.grey::after { content: ' Lista'; }
  .card { flex: 0 0 42vw; }
  .quicksearch { width: 90px; }
  .quicksearch:focus-within { width: 130px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Safe area para iPhones com notch/Dynamic Island */
@supports (padding: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .watch-bar { padding-top: calc(10px + env(safe-area-inset-top)); }
  .toast { bottom: calc(12px + env(safe-area-inset-bottom)); }
}
