:root {
  color-scheme: dark;
  --bg: #111413;
  --surface: #1a1f1c;
  --raised: #232a25;
  --line: #2c352e;
  --ink: #f4f6f2;
  --soft: #b7c0b8;
  --muted: #9da99f;
  --mint: #b6f874;
  --mint-dark: #142012;
  --shell: min(100% - 112px, 1344px);
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 300px; margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, summary { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.shell { width: var(--shell); margin-inline: auto; }
.icon { display: inline-grid; flex: none; place-items: center; width: 20px; height: 20px; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--mint); color: var(--mint-dark); padding: 10px; transform: translateY(-150%); }
.skip:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 5; background: #111513f7; border-bottom: 1px solid #ffffff0e; backdrop-filter: blur(16px); }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 56px; }
.wordmark { display: inline-flex; flex: none; align-items: center; gap: 4px; font-size: 20px; font-weight: 850; letter-spacing: -.055em; white-space: nowrap; }
.wordmark img { margin-right: 6px; }
.wordmark span { color: var(--mint); }
.primary-nav, .header-actions { display: flex; align-items: center; }
.primary-nav { align-self: stretch; gap: 31px; white-space: nowrap; color: var(--soft); font-size: .91rem; font-weight: 600; }
.primary-nav > a, .genres-menu summary { display: flex; height: 100%; align-items: center; position: relative; }
.primary-nav a:hover, .genres-menu summary:hover, .primary-nav a[aria-current='page'] { color: var(--ink); }
.primary-nav > a[aria-current='page']::after { content: ''; position: absolute; height: 2px; border-radius: 8px; inset: auto 0 0; background: var(--mint); }
.genres-menu { position: relative; height: 100%; }
.genres-menu summary { gap: 4px; list-style: none; }
.genres-menu summary::-webkit-details-marker { display: none; }
.genres-menu .icon { width: 15px; height: 15px; }
.genre-links { position: absolute; top: calc(100% + 1px); left: -14px; padding: 6px; min-width: 208px; max-height: 65vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px #0007; }
.genre-links a { display: block; padding: 10px 12px; border-radius: 6px; }
.genre-links a:hover { background: var(--raised); }
.header-actions { margin-left: auto; gap: 14px; }
.search-button, .account-button, .icon-button { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 0; background: transparent; color: var(--soft); font-size: .875rem; white-space: nowrap; }
.search-button { min-width: 112px; justify-content: flex-start; padding: 0 12px; background: #1a201c; border-color: var(--line); }
.search-button .icon, .account-button .icon { width: 17px; height: 17px; }
.icon-button { width: 40px; }
.account-button { border-color: #afed744d; padding: 0 13px; color: var(--mint); font-weight: 685; }
.search-button:hover, .icon-button:hover, .account-button:hover { color: var(--ink); background: var(--raised); }
#account-label { text-overflow: ellipsis; overflow: hidden; max-width: 108px; }

#content { min-height: 65vh; }
.loading { padding: 120px 0; color: var(--soft); }
.hero { --hero-image: linear-gradient(130deg, #31423b, #3b261f); position: relative; display: grid; isolation: isolate; min-height: 550px; background: #18201b; }
.hero::before, .hero::after { content: ''; position: absolute; inset: 0; z-index: -1; }
.hero::before { background-image: var(--hero-image); background-size: cover; background-position: center 43%; }
.hero::after { background: linear-gradient(0deg, var(--bg), #1114131a 33%, transparent 70%), linear-gradient(90deg, #111413f7 1%, #111413df 20%, #111413a1 37%, #11141319 67%, #11141308 100%); }
.hero-inner { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: inherit; position: relative; padding: 66px 0 82px; }
.feature-label { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 5px 10px; border: 1px solid #b6f87442; border-radius: 5px; color: var(--mint); background: #203123b8; font-size: .78rem; font-weight: 750; letter-spacing: .065em; text-transform: uppercase; }
.feature-label .icon { width: 14px; height: 14px; }
.hero h1 { max-width: min(680px, 64%); margin: 17px 0 15px; font-size: clamp(3rem, 5.35vw, 5.45rem); line-height: .99; letter-spacing: -.073em; font-weight: 850; text-wrap: balance; }
.metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .94rem; font-weight: 560; color: #dae2da; }
.metadata > span:not(.tag) + span:not(.tag)::before { content: '·'; margin-right: 8px; color: #829287; }
.tag { display: inline-flex; padding: 3px 6px; border: 1px solid #b2c3b853; border-radius: 4px; font-size: .73rem; line-height: 1; font-weight: 750; color: #e1eae1; }
.hero-description { max-width: 475px; margin: 17px 0 24px; color: #d1d7d0; font-size: 1rem; line-height: 1.67; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 17px; font-weight: 700; font-size: .93rem; border: 1px solid transparent; border-radius: 8px; white-space: nowrap; transition: background-color .18s, color .18s, border-color .18s; }
.button-primary { background: var(--mint); color: var(--mint-dark); }
.button-primary:hover { background: #cefca6; }
.button-secondary { background: #222a25b8; border-color: #eef9ef32; color: var(--ink); }
.button-secondary:hover { background: #354037; border-color: #eef9ef56; }
.button .icon { width: 18px; height: 18px; }
.hero-controls { position: absolute; display: flex; align-items: center; justify-content: space-between; bottom: 25px; left: 0; right: 0; }
.hero-dots { display: flex; align-items: center; gap: 5px; }
.hero-dot { display: inline-grid; place-items: center; padding: 0; width: 18px; height: 30px; border: 0; background: transparent; }
.hero-dot::before { content: ''; width: 7px; height: 7px; border-radius: 14px; background: #c1ccc184; }
.hero-dot[aria-current='true'] { width: 31px; }
.hero-dot[aria-current='true']::before { width: 26px; background: var(--mint); }
.hero-arrows { display: flex; gap: 8px; }
.hero-arrows button { border-color: #f4f7f34f; color: var(--ink); background: #11141368; border-radius: 50%; }

.catalog { padding-bottom: 66px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 25px; margin-top: 3px; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--soft); font-size: .875rem; font-weight: 615; background: #191e1a; }
.filter:hover { background: var(--raised); color: var(--ink); }
.filter[aria-current='page'] { border-color: #a7e56d55; background: #253620; color: var(--mint); }
.filter .icon { width: 15px; height: 15px; }
.shelf { margin-top: 8px; }
.shelf + .shelf { margin-top: 41px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.section-head h2 { position: relative; padding-left: 13px; font-size: clamp(1.34rem, 2.3vw, 1.7rem); line-height: 1.2; letter-spacing: -.043em; font-weight: 760; }
.section-head h2::before { position: absolute; content: ''; width: 3px; top: 4px; bottom: 3px; left: 0; border-radius: 5px; background: var(--mint); }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--mint); white-space: nowrap; font-size: .875rem; font-weight: 650; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 25px 17px; }
.movie-card { position: relative; min-width: 0; }
.card-open { display: block; width: 100%; border: 0; background: none; color: inherit; padding: 0; text-align: left; border-radius: 9px; }
.card-art { display: block; position: relative; aspect-ratio: 1.55; overflow: hidden; border-radius: 8px; border: 1px solid #ffffff16; background: linear-gradient(145deg, #2e4840, #212724 65%, #584631); }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .26s; }
.card-art::after { position: absolute; content: ''; inset: 0; background: linear-gradient(0deg, #070b09b5, transparent 44%); }
.card-open:hover .card-art img, .card-open:focus-visible .card-art img { transform: scale(1.065); }
.card-open:hover .movie-title { color: var(--mint); }
.card-quality { z-index: 1; position: absolute; top: 8px; left: 8px; border: none; background: #141a17da; color: #f5f6f2; padding: 5px 6px 4px; }
.card-play { z-index: 1; position: absolute; display: grid; place-items: center; left: calc(50% - 20px); top: calc(50% - 20px); width: 40px; height: 40px; opacity: 0; transform: scale(.9); border-radius: 50%; background: var(--mint); color: var(--mint-dark); transition: transform .2s, opacity .2s; }
.card-open:hover .card-play, .card-open:focus-visible .card-play { opacity: 1; transform: none; }
.movie-title { display: block; margin: 10px 0 4px; padding-right: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .965rem; letter-spacing: -.015em; font-weight: 700; }
.card-info { display: flex; gap: 6px; align-items: center; overflow: hidden; color: var(--muted); font-size: .825rem; white-space: nowrap; }
.card-info span:last-child { overflow: hidden; text-overflow: ellipsis; }
.card-info > span + span::before { content: '·'; margin-right: 6px; }
.progress-track { position: absolute; height: 4px; inset: auto 0 0; z-index: 2; background: #161c16b3; }
.progress-track::before { content: ''; display: block; width: var(--progress); height: 100%; background: var(--mint); }
.listing { padding-top: 38px; }
.listing h1, .watch h1 { margin: 0 0 9px; font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.08; letter-spacing: -.06em; }
.listing .filter-bar { margin-top: 19px; }
.listing-note { color: var(--soft); margin-bottom: 21px; }
.top-periods { padding-bottom: 15px; }
.top-heading { margin: 0 0 12px; font-size: 1.25rem; font-weight: 720; letter-spacing: -.025em; }
.top-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 9px; padding: 0; margin: 0; list-style: none; }
.top-list li { min-width: 0; }
.top-item { display: grid; grid-template-columns: 27px 74px minmax(0, 1fr) 20px; align-items: center; min-height: 68px; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.top-item:hover { background: var(--raised); }
.top-rank { color: var(--mint); text-align: center; font-weight: 760; font-variant-numeric: tabular-nums; }
.top-art { display: grid; place-items: center; overflow: hidden; aspect-ratio: 1.55; border-radius: 5px; background: #27332b; }
.top-art img { width: 100%; height: 100%; object-fit: cover; }
.top-copy { display: grid; gap: 4px; min-width: 0; }
.top-copy strong { line-height: 1.25; overflow-wrap: anywhere; }
.top-copy small, .top-state { color: var(--soft); }
.top-state { padding: 14px 0; }
.top-state .inline-button { margin-left: 7px; }
.empty { display: grid; justify-items: center; place-content: center; min-height: 260px; gap: 12px; padding: 25px; border: 1px dashed var(--line); border-radius: 12px; color: var(--soft); text-align: center; }
.empty h2 { color: var(--ink); }
.empty .icon { width: 27px; height: 27px; color: var(--mint); }
.empty .button { justify-self: center; margin: 4px 0; }

.watch { padding: 28px 0 60px; }
.watch-back { margin-bottom: 17px; }
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 22px; align-items: start; }
.player { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #080a09; }
.player video, .player iframe { height: 100%; width: 100%; display: block; border: 0; }
.player-youtube { min-height: 200px; }
.embed-link { margin-top: 12px; }
.player-message { padding: 17px; margin-top: 10px; border-radius: 8px; background: var(--surface); color: var(--soft); }
.watch-copy { margin-top: 22px; }
.watch-description { max-width: 72ch; margin: 13px 0 18px; color: var(--soft); line-height: 1.65; }
.sources { padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sources h2 { margin-bottom: 12px; font-size: 1rem; }
.sources .button { width: 100%; justify-content: flex-start; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; }
.related { margin-top: 40px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { display: flex; align-items: center; gap: 20px; min-height: 95px; }
.footer-inner .wordmark { color: var(--ink); font-size: 17px; }
.footer-inner nav { display: flex; gap: 24px; flex-wrap: wrap; margin-left: auto; }
.footer-inner nav a { font-size: .875rem; }
.footer-inner nav a:hover { color: var(--mint); }

.dialog { max-height: 88vh; width: min(92vw, 510px); margin: auto; padding: 24px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 100px #0009; }
.dialog::backdrop { background: #080b09bb; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 18px; }
.dialog-top h2 { font-size: 1.5rem; letter-spacing: -.043em; }
.dialog-top .icon-button { border: 1px solid var(--line); }
.dialog .icon-button { background: #111613b9; }
.search-dialog { width: min(92vw, 610px); }
.search-field { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; background: #111613; border: 1px solid var(--line); border-radius: 8px; }
.search-field input { color: var(--ink); min-width: 0; flex: 1; padding: 8px 0; background: none; border: none; }
.search-field .button { min-height: 36px; }
.search-results { display: grid; gap: 4px; margin-top: 13px; }
.search-result { display: flex; align-items: center; gap: 13px; padding: 8px; border-radius: 7px; }
.search-result:hover { background: var(--raised); }
.search-result img { width: 69px; height: 44px; object-fit: cover; border-radius: 4px; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); }
.search-results p { padding: 6px; color: var(--soft); }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; color: var(--soft); font-size: .9rem; font-weight: 650; }
.auth-form input { min-height: 45px; padding: 0 12px; background: #111613; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.auth-form .button { margin-top: 4px; }
.account-panel { width: min(100%, 440px); padding: clamp(16px, 4vw, 24px); margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.account-panel .listing-note { margin: 0; overflow-wrap: anywhere; }
.field-hint { margin-top: -7px; color: var(--soft); font-size: .85rem; }
.form-error { color: #ffb5a9; line-height: 1.5; }
.auth-alt { margin-top: 18px; color: var(--soft); font-size: .9rem; }
.inline-button { color: var(--mint); padding: 0; border: 0; background: none; font-weight: 700; }
.inline-button:hover { text-decoration: underline; }
.movie-dialog { width: min(92vw, 690px); padding: 0; }
.movie-visual { display: grid; position: relative; align-items: end; isolation: isolate; min-height: 260px; padding: 62px 24px 19px; overflow: hidden; background: #25372b; }
.movie-visual::before, .movie-visual::after { position: absolute; content: ''; z-index: -1; inset: 0; }
.movie-visual::before { background: var(--hero-image) center 42% / cover; }
.movie-visual::after { background: linear-gradient(0deg, var(--surface), #141a15a6 44%, #11171309); }
.movie-visual .icon-button { position: absolute; top: 15px; right: 15px; }
.movie-visual h2 { font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1.05; letter-spacing: -.06em; }
.movie-visual p { color: #d6ded7; margin-top: 5px; }
.movie-body { padding: 0 24px 24px; }
.movie-body > p { color: var(--soft); line-height: 1.65; margin: 15px 0; }
.movie-body dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0 0 20px; font-size: .88rem; }
.movie-body dt { color: var(--muted); }
.movie-body dd { margin: 0; }
.toast { position: fixed; z-index: 15; bottom: 22px; right: 22px; max-width: min(92vw, 430px); padding: 13px 18px; border: 1px solid #b6f87467; border-radius: 8px; background: #253327; color: var(--ink); box-shadow: 0 8px 20px #0006; }

@media (max-width: 1100px) {
  :root { --shell: calc(100% - 66px); }
  .header-inner { gap: 32px; }
  .primary-nav { gap: 22px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { min-height: 520px; }
}
@media (max-width: 820px) {
  :root { --shell: calc(100% - 40px); }
  .header-inner { gap: 22px; }
  .primary-nav { gap: 15px; }
  .header-actions { gap: 5px; }
  .search-button { min-width: auto; width: 37px; justify-content: center; padding: 0; }
  .search-button span + span { display: none; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .sources .button { width: auto; margin-right: 6px; }
}
@media (max-width: 640px) {
  :root { --shell: calc(100% - 32px); }
  .site-header { position: relative; }
  .header-inner { flex-wrap: wrap; min-height: 60px; gap: 0 10px; padding-top: 9px; }
  .primary-nav { width: 100%; order: 3; justify-content: space-between; height: 42px; gap: 6px; font-size: .8rem; }
  .genres-menu { display: grid; }
  .genre-links { left: auto; right: 0; }
  .wordmark { font-size: 18px; }
  .wordmark img { width: 31px; height: 31px; margin-right: 4px; }
  .library-button { width: 35px; }
  .search-button { background: transparent; border: 0; }
  .account-button { min-height: 35px; padding: 0 8px; gap: 5px; }
  #account-label { max-width: 75px; }
  .hero { min-height: 480px; }
  .hero::before { background-position: 60% center; }
  .hero::after { background: linear-gradient(0deg, var(--bg) 2%, #111413dc 21%, #11141372 64%, #11141310 88%), linear-gradient(90deg, #111413a3, #11141317); }
  .hero-inner { justify-content: end; padding-top: 88px; padding-bottom: 68px; }
  .hero h1 { max-width: 100%; margin: 11px 0 12px; font-size: clamp(2.55rem, 11vw, 3.7rem); }
  .hero-description { margin: 11px 0 15px; line-height: 1.5; -webkit-line-clamp: 2; }
  .hero-controls { bottom: 13px; }
  .hero-arrows button { width: 34px; min-height: 34px; }
  .filter-bar { padding-bottom: 19px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 11px; }
  .shelf + .shelf { margin-top: 29px; }
  .catalog { padding-bottom: 42px; }
  .footer-inner { flex-wrap: wrap; padding: 17px 0 23px; gap: 14px; }
  .footer-inner nav { order: 3; width: 100%; margin: 0; gap: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
