/* Obit Movies: a dark screening-room UI. Amber is the projector light. */

/* Archivo (SIL Open Font License, see ../fonts/OFL.txt). Variable in weight and width. */
@font-face {
  font-family: "Archivo";
  font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-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: "Archivo";
  font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-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;
}

:root {
  --bg: #08090d;
  --surface: #11131a;
  --raised: #1b1e29;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f0e9;
  --muted: #9da0ae;
  --accent: #ffb224;
  --accent-strong: #ffc552;
  --accent-ink: #1b1303;
  --danger: #ff7a6b;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --nav-h: 4.25rem;
  --tile-w: clamp(13rem, calc((100vw - 2 * var(--gutter)) / 5.6), 21rem);
  --radius: 6px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Poster-billing type: tall, tight, heavy. Used for titles only. */
.display {
  font-stretch: 62%;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* --- Navigation ------------------------------------------------------------ */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(0.75rem, 2.2vw, 2.25rem);
  padding: 0 var(--gutter);
  background: linear-gradient(rgba(8, 9, 13, 0.8), rgba(8, 9, 13, 0));
  transition: background-color 0.3s;
}
.nav.is-solid, body:not(.has-hero) .nav { background-color: rgba(8, 9, 13, 0.97); }
body.is-watching .nav, body.is-watching .footer { display: none; }

.brand {
  font-stretch: 62%; font-weight: 800; font-size: 1.85rem;
  color: var(--accent); letter-spacing: 0.01em; flex: none;
}
.nav__links { display: flex; gap: clamp(0.9rem, 1.6vw, 1.5rem); flex: 1; min-width: 0; }
.nav__links a { color: #cfd0d8; font-size: 0.95rem; white-space: nowrap; padding: 0.4rem 0; }
.nav__links a:hover { color: var(--muted); }
.nav__links a[aria-current="page"] { color: var(--text); font-weight: 700; }

.search { flex: none; }
.search input {
  width: clamp(9rem, 18vw, 16rem);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px;
  padding: 0.45rem 0.9rem;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--text); outline: none; background: rgba(0, 0, 0, 0.75); }

.account { flex: none; position: relative; }
.account__avatar {
  list-style: none; cursor: pointer; width: 2.3rem; height: 2.3rem; border-radius: 4px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
.account__avatar::-webkit-details-marker { display: none; }
.account__panel {
  position: absolute; right: 0; top: calc(100% + 0.6rem); z-index: 55; min-width: 15rem; padding: 0.5rem;
  background: rgba(17, 19, 26, 0.98); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  display: grid;
}
.account__email { padding: 0.45rem 0.7rem 0.1rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.account__sync { padding: 0 0.7rem 0.5rem; font-size: 0.82rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; }
.account__sync--offline { color: var(--danger); }
.account__panel a, .account__panel button {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border: 0; background: none; border-radius: 4px; cursor: pointer; font-size: 0.92rem;
}
.account__panel a:hover, .account__panel button:hover { background: rgba(255, 255, 255, 0.08); }
.link { color: var(--accent); text-decoration: underline; }

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.65rem 1.6rem; border: 0; border-radius: 4px;
  font-weight: 700; font-size: 1.05rem; cursor: pointer; white-space: nowrap;
  background: rgba(109, 109, 110, 0.7); color: var(--text);
  transition: background-color 0.15s;
}
.btn:hover { background: rgba(109, 109, 110, 0.45); }
.btn--play { background: var(--text); color: #111; }
.btn--play:hover { background: rgba(243, 240, 233, 0.78); }
.btn--small { padding: 0.4rem 0.9rem; font-size: 0.9rem; font-weight: 600; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-strong); }
.btn--quiet { background: none; color: var(--muted); }
.btn--quiet:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.btn--ghost { background: rgba(255, 255, 255, 0.1); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.2); }
.btn--danger:hover { color: var(--danger); }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.btn svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
.btn--ghost svg, .filter-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; }

/* Round icon buttons: My List, more info, sound. */
.round-btn {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; cursor: pointer;
  background: rgba(42, 42, 42, 0.6); color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.55);
  transition: border-color 0.15s, background-color 0.15s;
}
.round-btn:hover { border-color: var(--text); background: rgba(255, 255, 255, 0.1); }
.round-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.2; }
.round-btn--large { width: 2.75rem; height: 2.75rem; }
.round-btn--large svg { width: 1.35rem; height: 1.35rem; }
.round-btn--play { background: var(--text); color: #111; border-color: var(--text); }
.round-btn--play:hover { background: rgba(243, 240, 233, 0.8); }
.round-btn--play svg { fill: currentColor; stroke: none; }
.round-btn__on { display: none; }
.round-btn[aria-pressed="true"] .round-btn__on { display: contents; }
.round-btn[aria-pressed="true"] .round-btn__off { display: none; }
.round-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.round-btn__off, .round-btn__on { line-height: 0; }

.icon-btn {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: none; color: var(--muted);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.icon-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }

/* --- Page frame ------------------------------------------------------------ */

main { flex: 1; padding-top: var(--nav-h); }
body.has-hero main, body.is-watching main { padding-top: 0; }
main:focus { outline: none; }

.page { padding: 2rem var(--gutter) 4rem; }
.page__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.page__title { font-size: clamp(2rem, 5vw, 3.25rem); }
.page__lede { color: var(--muted); max-width: 64ch; margin: -0.25rem 0 1.25rem; }

.notice {
  margin: 0 var(--gutter) 1rem; padding: 0.75rem 1rem;
  background: var(--raised); border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.empty { color: var(--muted); max-width: 48ch; padding: 3rem 0; }
.empty strong { display: block; color: var(--text); font-size: 1.25rem; margin-bottom: 0.4rem; }
.empty .btn { margin-top: 1.25rem; }

.footer { padding: 2rem var(--gutter); color: var(--muted); font-size: 0.8rem; }
.footer p { max-width: 70ch; }

main[aria-busy="true"]::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: 60;
  height: 3px; width: 30%; background: var(--accent);
  animation: loading 1.1s ease-in-out infinite;
}
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(434%); } }

/* --- Shared bits ------------------------------------------------------------ */

.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; color: var(--muted); font-size: 0.95rem; }
.facts strong { color: var(--text); font-weight: 600; }
.badge {
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px;
  padding: 0 0.4rem; font-size: 0.78rem; color: var(--text); line-height: 1.5;
}
.badge--low { border-color: var(--danger); color: var(--danger); }
.star { color: var(--accent); }
.imdb { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--text); }
.imdb__mark { background: #f5c518; color: #000; font-weight: 800; font-size: 0.72rem; padding: 0.05rem 0.3rem; border-radius: 3px; }

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.85rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
  font-size: 0.9rem; color: var(--text); white-space: nowrap;
}
a.chip:hover { background: rgba(255, 255, 255, 0.18); }
.chip[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2.5; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 60rem; }
.chip-cloud .chip { padding: 0.55rem 1.1rem; font-size: 1rem; }
.subhead { font-size: 1.15rem; font-weight: 600; margin: 2.25rem 0 0.9rem; }
.subhead:first-of-type { margin-top: 0; }
.tabs, .sort-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sort-bar { margin-bottom: 1.5rem; }

.progress { height: 4px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }

.select, .field select {
  background: var(--raised); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px;
  padding: 0.45rem 0.6rem; color: var(--text);
}
.field { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2.5rem; color: var(--muted); }

/* --- Home hero --------------------------------------------------------------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  height: min(56.25vw, 88vh); min-height: 32rem;
  display: flex; align-items: center;
  padding: var(--nav-h) var(--gutter) 0;
}
.hero__art, .trailer { position: absolute; inset: 0; z-index: -3; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.trailer { z-index: -2; opacity: 0; transition: opacity 0.8s; pointer-events: none; }
.is-trailing .trailer { opacity: 1; }
/* Crop YouTube's frame to fill, like a backdrop. */
.trailer__frame { position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; border: 0;
  transform: translate(-50%, -50%) scale(1.35); }
@media (min-aspect-ratio: 16/9) { .trailer__frame { height: 56.25vw; } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(8, 9, 13, 0) 28%),
    linear-gradient(77deg, rgba(8, 9, 13, 0.85) 0%, rgba(8, 9, 13, 0.35) 42%, rgba(8, 9, 13, 0) 70%);
}
.hero__body { width: min(36%, 36rem); min-width: 20rem; margin-top: 4vh; }
.hero__title { font-size: clamp(2.5rem, 6vw, 5.5rem); margin-bottom: 1.1rem; }
.hero__logo { width: 100%; max-height: 13rem; object-fit: contain; object-position: left bottom; }
.hero__overview {
  color: var(--text); font-size: clamp(0.95rem, 1.2vw, 1.2rem); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  margin-bottom: 1.4rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transition: opacity 0.6s;
}
.is-trailing .hero__overview { opacity: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.hero__sound { position: absolute; right: var(--gutter); bottom: 30%; }

.rows { position: relative; z-index: 1; padding-bottom: 3rem; }
.hero + .rows { margin-top: -9vw; }

/* --- Rows --------------------------------------------------------------------- */

.row { position: relative; margin-top: max(2rem, 3vw); }
.rows > .row:first-child { margin-top: 0; }
.row__head { display: flex; align-items: baseline; gap: 1rem; padding: 0 var(--gutter); margin-bottom: 0.4rem; }
.row__title { font-size: clamp(1.05rem, 1.4vw, 1.45rem); font-weight: 700; }
.row__more { color: var(--accent); font-size: 0.88rem; font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.row:hover .row__more, .row__more:focus-visible { opacity: 1; }
@media (hover: none) { .row__more { opacity: 1; } }

.row__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--tile-w);
  gap: 0.45rem; padding: 0.4rem var(--gutter);
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.row__track::-webkit-scrollbar { display: none; }
.row__track > * { scroll-snap-align: start; }

.row__arrow {
  position: absolute; top: 2.2rem; bottom: 0.4rem; z-index: 5;
  width: calc(var(--gutter) - 0.2rem); min-width: 2.25rem;
  border: 0; cursor: pointer; color: var(--text);
  background: rgba(8, 9, 13, 0.6);
  opacity: 0; transition: opacity 0.2s, background-color 0.2s;
  display: grid; place-items: center;
}
.row__arrow:hover { background: rgba(8, 9, 13, 0.85); }
.row__arrow svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform 0.15s; }
.row__arrow:hover svg { transform: scale(1.25); }
.row__arrow--prev { left: 0; border-radius: 0 4px 4px 0; }
.row__arrow--next { right: 0; border-radius: 4px 0 0 4px; }
.row:hover .row__arrow:not([hidden]), .row__arrow:focus-visible { opacity: 1; }
@media (hover: none) { .row__arrow { display: none; } }

/* Wide card */
.tile { display: block; min-width: 0; border-radius: 4px; }
.tile__art {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--raised); border-radius: 4px;
}
.tile__art img { width: 100%; height: 100%; object-fit: cover; }
.tile__art--poster img { object-position: center 22%; }
.tile__name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 0.7rem 0.55rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-weight: 700; font-size: 0.95rem; line-height: 1.2; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile__tag, .tile__imdb {
  position: absolute; top: 0.45rem; left: 0.45rem; padding: 0.05rem 0.4rem;
  background: rgba(8, 9, 13, 0.85); border-radius: 3px; font-size: 0.72rem; font-weight: 700;
}
.tile__tag--low { color: var(--danger); }
.tile__imdb { left: auto; right: 0.45rem; background: #f5c518; color: #000; }
.tile:focus-visible { outline-offset: 3px; }
.tile:hover .tile__art { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }

.tile-grid {
  display: grid; gap: 2.2rem 0.45rem;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
}
.tile-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 0.9rem 0.5rem; }

/* Top 10: big outlined numbers beside posters. */
.row--top10 .row__track { grid-auto-columns: calc(var(--tile-w) * 1.05); }
.top10 { position: relative; display: flex; align-items: flex-end; height: calc(var(--tile-w) * 0.75); }
.top10__num {
  flex: 0 0 48%; text-align: right; margin-right: -0.6rem;
  font-size: calc(var(--tile-w) * 0.75); font-weight: 800; font-stretch: 62%; line-height: 0.82;
  color: var(--bg); -webkit-text-stroke: 3px #5c5f6d; letter-spacing: -0.06em;
}
.top10__art { position: relative; flex: 0 0 52%; height: 100%; border-radius: 4px; overflow: hidden; background: var(--raised); }
.top10__art img { width: 100%; height: 100%; object-fit: cover; }
.top10:hover .top10__art { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }

/* Continue watching */
.resume-card { position: relative; min-width: 0; }
.resume-card__link { display: block; }
.resume-card__art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--raised); border-radius: 4px 4px 0 0; }
.resume-card__art img { width: 100%; height: 100%; object-fit: cover; }
.resume-card__art--poster img { object-position: center 18%; }
.resume-card__art .tile__name { bottom: 4px; }
.resume-card__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8, 9, 13, 0.35); opacity: 0; transition: opacity 0.2s;
}
.resume-card__play svg { width: 3.25rem; height: 3.25rem; fill: var(--text); padding: 0.8rem; border: 2px solid var(--text); border-radius: 50%; background: rgba(0, 0, 0, 0.5); }
.resume-card__link:hover .resume-card__play, .resume-card__link:focus-visible .resume-card__play { opacity: 1; }
.resume-card .progress { position: absolute; left: 0; right: 0; bottom: 0; }
.resume-card__sub { display: block; color: var(--muted); font-size: 0.85rem; padding: 0.45rem 2.2rem 0 0.1rem; }
.resume-card__remove { position: absolute; right: 0; bottom: -0.15rem; }

/* --- Hover preview ------------------------------------------------------------ */

.preview {
  position: absolute; z-index: 40; border-radius: 6px; overflow: hidden;
  background: #181818; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75);
  animation: grow 0.22s ease-out both;
}
@keyframes grow { from { transform: scale(var(--from-scale, 0.7)); box-shadow: none; } }
.preview__art { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--raised); }
.preview__art img { width: 100%; height: 100%; object-fit: cover; }
.preview__art--poster img { object-position: center 22%; }
.preview__name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 0.9rem 0.6rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85)); font-weight: 800; font-size: 1.15rem; line-height: 1.15;
}
.preview__body { padding: 0.8rem 0.9rem 1rem; }
.preview__buttons { display: flex; gap: 0.45rem; margin-bottom: 0.7rem; }
.preview__more { margin-left: auto; }
.preview__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.75rem; font-size: 0.9rem; color: #bcbcbc; }
.preview__meta strong { color: var(--text); }
.preview__genres { margin-top: 0.45rem; font-size: 0.88rem; color: var(--text); }

/* --- Details pop-up and title pages ----------------------------------------- */

.modal {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 2rem 1rem;
  border: 0; background: transparent; color: var(--text); overflow-y: auto; overscroll-behavior: contain;
}
.modal::backdrop { background: rgba(0, 0, 0, 0.72); }
.modal[open] .modal__panel { animation: pop 0.25s ease-out both; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
body.modal-open { overflow: hidden; }
.modal__panel {
  position: relative; width: min(56rem, 100%); margin: 0 auto;
  background: #181818; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}
.modal__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 5;
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: #181818; color: var(--text);
}
.modal__close svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.2; }
.modal__loading { min-height: 26rem; display: grid; place-items: center; color: var(--muted); }
.modal__error { padding: 1rem 2.5rem 2rem; }

.tl__hero { position: relative; isolation: isolate; aspect-ratio: 16 / 9; max-height: 32rem; width: 100%; overflow: hidden; background: #000; }
.tl__backdrop { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; }
.tl__hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, #181818 0%, rgba(24, 24, 24, 0) 45%);
}
.tl__hero .trailer__frame { transform: translate(-50%, -50%) scale(1.25); height: 100%; }
.tl__hero-body { position: absolute; left: clamp(1.25rem, 5%, 3rem); right: clamp(1.25rem, 5%, 3rem); bottom: clamp(1rem, 6%, 2.75rem); }
.tl__title { font-size: clamp(2rem, 5vw, 3.6rem); margin-bottom: 1.1rem; max-width: 70%; }
.tl__logo { max-width: min(100%, 22rem); max-height: 8rem; object-fit: contain; object-position: left bottom; }
.tl__actions { display: flex; align-items: center; gap: 0.6rem; }
.tl__sound { margin-left: auto; }
.tl__info { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem 2rem; padding: 0.5rem clamp(1.25rem, 5%, 3rem) 0; }
.tl__overview { margin-top: 0.9rem; line-height: 1.55; }
.tl__tagline { margin-top: 0.75rem; color: var(--muted); font-style: italic; }
.tl__note { margin-top: 0.75rem; color: var(--danger); font-size: 0.9rem; }
.tl__resume { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); }
.tl__resume .progress { flex: 0 0 min(12rem, 40%); }
.tl__side { font-size: 0.9rem; display: grid; gap: 0.6rem; align-content: start; color: var(--text); }
.tl__label { color: #777; margin-right: 0.25rem; }
.tl__label::after { content: ":"; }
.tl__side a:hover { text-decoration: underline; }
.tl__section { padding: 2.25rem clamp(1.25rem, 5%, 3rem) 0; }
.tl__section:last-child { padding-bottom: 2.5rem; }
.tl__section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.tl__section-title { font-size: 1.45rem; font-weight: 700; margin-bottom: 0.9rem; }
.tl__section-head .tl__section-title { margin-bottom: 0; }
.tl__season-name { color: var(--muted); }
.tl--page { max-width: 80rem; margin: 0 auto; padding-bottom: 3rem; }
.tl--page .tl__hero { max-height: 80vh; }
.tl--page .tl__title { font-size: clamp(2.5rem, 6vw, 5rem); }
.tl--page .tl__logo { max-width: min(100%, 30rem); max-height: 11rem; }

/* Episodes */
.episodes { list-style: none; margin: 0; padding: 0; }
.episode { border-bottom: 1px solid #404040; }
.episode:first-child { border-top: 1px solid #404040; }
.episode__link {
  display: grid; grid-template-columns: 2.5rem clamp(7.5rem, 22%, 11rem) 1fr; gap: 1rem;
  align-items: center; padding: 1.1rem 0.75rem; border-radius: 4px;
}
a.episode__link:hover, .episode.is-current .episode__link { background: #333; }
.episode__num { font-size: 1.5rem; color: #d2d2d2; text-align: center; }
.episode__still { position: relative; aspect-ratio: 16 / 9; background: var(--raised); border-radius: 4px; overflow: hidden; }
.episode__still img { width: 100%; height: 100%; object-fit: cover; }
.episode__play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; }
.episode__play svg { width: 2.4rem; height: 2.4rem; padding: 0.55rem; fill: var(--text); border: 2px solid var(--text); border-radius: 50%; background: rgba(0, 0, 0, 0.55); }
a.episode__link:hover .episode__play { opacity: 1; }
.episode__still .progress { position: absolute; left: 0; right: 0; bottom: 0; }
.episode__text { min-width: 0; }
.episode__name { display: flex; justify-content: space-between; gap: 0.75rem; font-weight: 700; }
.episode__meta { color: var(--text); font-weight: 400; flex: none; }
.episode__status { display: block; font-size: 0.85rem; margin-top: 0.15rem; color: var(--muted); }
.episode__overview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: #d2d2d2; font-size: 0.9rem; margin-top: 0.35rem; }
.episode--soon { opacity: 0.5; }
.watched-mark { color: var(--accent); font-weight: 600; }

/* --- Movies and Series pages: filters -------------------------------------- */

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1.25rem; }
.filter-toggle[aria-expanded="true"] { background: var(--text); color: #111; }
.filter-toggle__count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 1.35rem; padding: 0 0.35rem; font-size: 0.8rem; line-height: 1.35rem; }
.filter-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; flex: 1; }
.chip--remove { padding-right: 0.6rem; }
.filter-summary__clear { color: var(--muted); font-size: 0.88rem; text-decoration: underline; }
.filter-summary__sort { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

.filter-panel {
  display: grid; gap: 1.1rem; margin-bottom: 2rem; padding: 1.25rem clamp(1rem, 2.5vw, 1.75rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  animation: drop 0.2s ease-out both;
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.fgroup { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.75rem; align-items: start; }
.fgroup__legend { float: left; padding: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.fgroup__opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.18); color: #d6d6dc; transition: background-color 0.15s;
}
.opt:hover span { background: rgba(255, 255, 255, 0.08); }
.opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.opt input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.filter-panel__actions { display: flex; gap: 0.6rem; padding-top: 0.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* --- Full-screen player ------------------------------------------------------ */

.watch-full { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #000; }
.watch-bar {
  display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap;
  min-height: 3.5rem; padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem);
  background: linear-gradient(#111, #000);
}
.watch-bar__back { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.watch-bar__back:hover { background: rgba(255, 255, 255, 0.12); }
.watch-bar__back svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2.2; }
.watch-bar__title { flex: 1; min-width: 10rem; display: flex; align-items: baseline; gap: 0.75rem; overflow: hidden; white-space: nowrap; }
.watch-bar__title strong { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; }
.watch-bar__title span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.watch-bar__controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 2.2rem; height: 1.25rem; border-radius: 999px; background: rgba(255, 255, 255, 0.25); transition: background-color 0.15s; }
.switch__track::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(0.95rem); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--text); outline-offset: 2px; }
.player--full { position: relative; flex: 1; min-height: 0; background: #000; }
.player--full iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.toast {
  position: absolute; left: 1rem; top: 1rem; z-index: 3; max-width: calc(100% - 2rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.55rem 0.9rem;
  background: rgba(17, 19, 26, 0.94); border: 1px solid var(--line); border-radius: 6px; font-size: 0.92rem;
}
.toast strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.toast--note { top: auto; bottom: 1rem; color: var(--muted); }
.up-next {
  position: absolute; right: 1rem; bottom: 1rem; z-index: 4;
  width: min(22rem, calc(100% - 2rem)); padding: 1rem 1.1rem;
  background: rgba(17, 19, 26, 0.96); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}
.up-next__label { color: var(--muted); font-size: 0.85rem; }
.up-next__title { font-weight: 600; margin: 0.15rem 0 0.75rem; }
.up-next__actions { display: flex; gap: 0.5rem; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: min(30rem, 100%);
  overflow-y: auto; background: rgba(17, 19, 26, 0.98); border-left: 1px solid var(--line);
  padding: 1rem 1rem 2rem; animation: slide 0.2s ease-out both;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.drawer__title { font-size: 1.2rem; }
.drawer .episode__link { grid-template-columns: 1.75rem 6.5rem 1fr; gap: 0.7rem; padding: 0.7rem 0.5rem; }
.drawer .episode__num { font-size: 1.1rem; }

/* --- Sign in ------------------------------------------------------------------ */

.auth { min-height: calc(100vh - var(--nav-h) - 6rem); display: grid; place-items: center; padding: 2.5rem var(--gutter) 4rem; }
.auth__panel { width: min(100%, 28rem); padding: clamp(1.5rem, 5vw, 2.75rem); background: rgba(17, 19, 26, 0.92); border: 1px solid var(--line); border-radius: 10px; }
.auth__title { font-size: 2.6rem; margin-bottom: 0.5rem; }
.auth__lede { color: var(--muted); margin-bottom: 1.5rem; }
.auth__lede strong { color: var(--text); }
.auth__form { display: grid; gap: 1rem; }
.auth__form [hidden] { display: none; }
.auth__field { display: grid; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.auth__field input {
  width: 100%; padding: 0.8rem 0.9rem; font-size: 1rem; color: var(--text);
  background: var(--raised); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 5px;
}
.auth__field input:focus { border-color: var(--accent); outline: none; }
.auth__field small { font-size: 0.8rem; }
.auth__form .btn { width: 100%; margin-top: 0.4rem; }
.auth__status { padding: 0.7rem 0.9rem; border-radius: 5px; font-size: 0.92rem; background: rgba(255, 122, 107, 0.12); color: #ffb3aa; border-left: 3px solid var(--danger); }
.auth__status[data-kind="success"] { background: rgba(255, 178, 36, 0.1); color: var(--text); border-left-color: var(--accent); }
.auth__switch { margin-top: 1.1rem; color: var(--muted); font-size: 0.92rem; }
.auth__switch a { color: var(--accent); }
.auth__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* --- Top IMDb list ------------------------------------------------------------ */

.ranked { list-style: none; margin: 0; padding: 0; max-width: 56rem; }
.ranked__item {
  display: grid; grid-template-columns: 3rem 3.75rem 1fr auto; gap: 1rem; align-items: center;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.ranked__num { font-stretch: 62%; font-weight: 800; font-size: 1.9rem; color: var(--muted);
  text-align: right; font-variant-numeric: tabular-nums; }
.ranked__item:nth-child(-n+3) .ranked__num { color: var(--accent); }
.ranked__art { aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--raised); }
.ranked__art img { width: 100%; height: 100%; object-fit: cover; }
.ranked__title { font-weight: 600; font-size: 1.05rem; }
.ranked__title:hover { color: var(--accent); }
.ranked__meta { color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; margin-top: 0.2rem; }
.ranked__meta strong { color: var(--text); }
.ranked__score { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.9rem; }

/* --- History ------------------------------------------------------------------ */

.history { list-style: none; margin: 0; padding: 0; max-width: 62rem; }
.history__item {
  display: grid; grid-template-columns: clamp(7.5rem, 18vw, 12rem) 1fr auto; gap: 1.1rem;
  align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.history__art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--raised); border-radius: 4px; display: block; }
.history__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.history__art .progress { position: absolute; left: 0; right: 0; bottom: 0; }
.history__title { font-weight: 600; font-size: 1.05rem; }
.history__title:hover { color: var(--accent); }
.history__meta { color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; margin-top: 0.2rem; }
.history__actions { display: flex; gap: 0.25rem; align-items: center; }

/* --- Small screens ------------------------------------------------------------ */

@media (max-width: 760px) {
  :root { --nav-h: 6.25rem; --tile-w: 44vw; }
  .nav { flex-wrap: wrap; align-content: center; row-gap: 0.25rem; height: var(--nav-h); background-color: rgba(8, 9, 13, 0.97); }
  .brand { font-size: 1.5rem; }
  .search { margin-left: auto; }
  .search input { width: 9.5rem; }
  .account { margin-left: 0.25rem; }
  .nav__links { order: 5; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; }
  .nav__links::-webkit-scrollbar { display: none; }
  .hero { height: auto; min-height: 78vh; align-items: flex-end; padding-bottom: 3rem; }
  .hero__body { width: 100%; min-width: 0; text-align: center; }
  .hero__logo { margin: 0 auto; object-position: center bottom; max-height: 8rem; }
  .hero__actions { justify-content: center; }
  .hero__sound { bottom: auto; top: calc(var(--nav-h) + 1rem); }
  .hero + .rows { margin-top: 0; }
  .row { margin-top: 1.75rem; }
  .tile-grid, .tile-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.45rem; }
  .tile__name { font-size: 0.85rem; padding: 1.2rem 0.5rem 0.4rem; }
  .modal { padding: 0; }
  .modal__panel { border-radius: 0; min-height: 100%; }
  .tl__info { grid-template-columns: 1fr; }
  .tl__title { max-width: 100%; }
  .episode__link { grid-template-columns: 1.5rem 6.5rem 1fr; gap: 0.75rem; padding: 0.8rem 0.25rem; }
  .episode__overview { display: none; }
  .fgroup { grid-template-columns: 1fr; gap: 0.4rem; }
  .filter-summary__sort { margin-left: 0; width: 100%; }
  .watch-bar__title span, .watch-bar__controls .btn span, .watch-bar__server { font-size: 0.85rem; }
  .watch-bar__controls .btn span, .switch__label { display: none; }
  .history__item { grid-template-columns: 7rem 1fr; }
  .history__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .ranked__item { grid-template-columns: 2rem 3rem 1fr; gap: 0.75rem; }
  .ranked__num { font-size: 1.4rem; }
  .ranked__score { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
