/* moviescene — design system
 *
 * Forced dark, using the site's real brand: signal red (#e50914) on a near-black
 * (#141414) ground, set in Rubik. The UI chrome stays quiet; the artwork carries
 * the colour, and brand red appears on CTAs, active states, rating chips and
 * focus. Minimum text size 14px. Every text/background pair here clears WCAG AA
 * (>= 4.5:1 body, >= 3:1 large) — note the solid brand red is used only as a
 * fill under white text, while a lightened red serves any red-on-dark text.
 */

@font-face {
  font-family: Rubik;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/rubik.woff2") format("woff2");
}

:root {
  /* brand: red on near-black (from the theme's maincolor/bgcolor) */
  --background: #141414;
  --foreground: #fafafa;
  --card: #1c1c1e;
  --card-foreground: #fafafa;
  --muted: #2a2a2c;
  --muted-foreground: #a9a9ad; /* ~7.8:1 on background */
  --border: #303033;
  --input: #262628;
  --primary: #fafafa;
  --primary-foreground: #141414;
  --brand: #e50914;            /* solid brand red — fill only, white text on it */
  --accent: #ff5964;           /* accessible red for text/icons on dark (~5:1) */
  --accent-foreground: #fff;
  --destructive: #ff5964;
  --ring: #ff5964;

  --radius: 0.375rem;

  --font-body: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --max-width: 1280px;
  --header-height: 60px;
}

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

html {
  color-scheme: dark;
  /* Full-bleed sections (e.g. the single-page hero) break out with
     margin: calc(50% - 50vw); 50vw includes the scrollbar, so they overhang a
     few px and add a horizontal scrollbar. Clip it — no scrollbar, and unlike
     overflow:hidden this keeps vertical scrolling and the sticky header. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 15px; /* never below the 14px floor */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--foreground);
}

img {
  max-width: 100%;
  display: block;
}

/* Visible keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-foreground);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Header ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0; /* never let the flex header squeeze the logo out of ratio */
}
/* The real brand logo. Sized by height so the 476x69 asset scales cleanly;
   max-width:none overrides the global img cap that would otherwise distort it
   when the mobile header narrows. */
.wordmark img {
  height: 22px;
  width: auto;
  max-width: none;
  display: block;
}
.wordmark span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 14px;
  font-weight: 500;
}
.main-nav a {
  color: var(--muted-foreground);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

.header-search {
  margin-left: auto;
  flex: 0 1 320px;
  display: flex;
}
.header-search input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 14px;
}
.header-search input::placeholder {
  color: var(--muted-foreground);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: var(--muted);
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, black);
  color: var(--primary-foreground);
}
.btn-accent {
  /* solid brand red with white text (4.8:1) — the accent variable is the
     lighter red for text on dark, which would be too pale as a fill. */
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-accent:hover {
  background: #f6121d;
  color: #fff;
}

/* ---- Section headings ------------------------------------------------ */

.section {
  margin: 2.5rem 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head a {
  font-size: 14px;
  color: var(--muted-foreground);
}
.section-head a:hover {
  color: var(--accent);
}

/* ---- Poster wall ----------------------------------------------------- */

/* Fixed, always-even column counts (6 / 4 / 2) so every full row shows an even
   number of tiles and a 12-item section fills exactly. */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem 0.9rem;
}
@media (max-width: 1024px) { .poster-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px)  { .poster-grid { grid-template-columns: repeat(2, 1fr); } }

.poster-card {
  position: relative;
  display: block;
}
.poster-card .poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}
.poster-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.25s ease;
}
.poster-card:hover .poster img,
.poster-card:focus-visible .poster img {
  transform: scale(1.04);
  filter: blur(2px) brightness(0.6);
}
/* Hover overlay: play button + IMDb rating, consistent across every thumb. */
.poster-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.poster-card:hover .poster-hover,
.poster-card:focus-visible .poster-hover {
  opacity: 1;
}
.play-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding-left: 3px; /* optically centre the triangle */
  box-shadow: 0 4px 14px rgb(0 0 0 / 50%);
}
.imdb-badge {
  background: #f5c518;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.poster-card .title {
  margin: 0.5rem 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-card .meta {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

.rating-chip {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--background) 78%, transparent);
  backdrop-filter: blur(4px);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

/* ---- Backdrop hero (the signature element) --------------------------- */

.hero {
  position: relative;
  margin-bottom: 2rem;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--background) 30%, transparent) 0%, var(--background) 92%),
    linear-gradient(90deg, color-mix(in srgb, var(--background) 70%, transparent) 0%, transparent 60%);
}
/* An episode hero carries no poster, so its heading sits directly on the still.
   The padding keeps the title clear of the gradient's darkest edge. */
.episode-hero .page-head {
  position: relative;
  margin: 0;
  padding: 2.5rem 0 1.5rem;
}
.episode-hero:not(:has(.hero-backdrop)) .page-head {
  padding-top: 0;
}
.hero-inner {
  position: relative;
  display: flex;
  gap: 2rem;
  padding: 3.5rem 0 1.5rem;
  align-items: flex-end;
}
.hero-poster {
  flex: 0 0 200px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 70%);
}
.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-body {
  padding-bottom: 0.5rem;
}
.hero-body h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}
.hero-tagline {
  color: var(--muted-foreground);
  font-style: italic;
  margin: 0 0 0.75rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}
.hero-meta .imdb {
  color: var(--accent);
  font-weight: 600;
}
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.genre-pills a {
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted-foreground);
}
.genre-pills a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
}

.overview {
  max-width: 70ch;
  color: color-mix(in srgb, var(--foreground) 90%, var(--muted-foreground));
}

/* ---- Player ---------------------------------------------------------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
/* Click-to-play overlay: the embed loads only when pressed. */
.player-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle at center, rgb(0 0 0 / 25%), rgb(0 0 0 / 55%));
}
.player-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  padding-left: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  box-shadow: 0 8px 30px rgb(0 0 0 / 55%);
  transition: transform 0.12s ease;
}
.player-play:hover .player-play-btn { transform: scale(1.08); }
.player.playing .player-play { display: none; }
@media (prefers-reduced-motion: reduce) {
  .player-play-btn { transition: none; }
}
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.source-btn {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
}
.source-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Cast / people --------------------------------------------------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
}
.person {
  text-align: center;
}
.person .avatar {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.person .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.person .name {
  font-size: 14px;
  font-weight: 600;
}
.person .character {
  font-size: 14px;
  color: var(--muted-foreground);
}

/* ---- Episode / season lists ------------------------------------------ */

.episode-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.episode-row:hover {
  border-color: var(--accent);
  background: var(--card);
}
.episode-still {
  flex: 0 0 150px;
  aspect-ratio: 16 / 9;
  border-radius: 0.35rem;
  overflow: hidden;
  background: var(--muted);
}
.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.episode-body .num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}
.episode-body .name {
  font-weight: 600;
  margin: 0.1rem 0;
}

/* ---- Pagination ------------------------------------------------------ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2.5rem 0;
  font-family: var(--font-mono);
  font-size: 14px;
}
.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .current {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ---- Tabs ------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tabs a {
  padding: 0.6rem 1rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a[aria-current="page"] {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

/* ---- Footer ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2.5rem 0;
  color: var(--muted-foreground);
  font-size: 14px;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}
.site-footer nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---- Page title (archives) ------------------------------------------- */

.page-head {
  margin: 2rem 0 1.5rem;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head .count {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.filter-bar { margin: 1rem 0 1.5rem; }
.filter-bar ul {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.filter-bar a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted-foreground);
}
.filter-bar a[aria-current="page"] {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ---- Utilities ------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted-foreground);
}
.empty-state h1 {
  font-family: var(--font-display);
  color: var(--foreground);
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
  }
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .hero-poster {
    flex-basis: 130px;
    width: 130px;
  }
  .episode-still {
    flex-basis: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- Interactions: favorites, rating, comments ----------------------- */

.interaction-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ibtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ibtn:hover { border-color: var(--accent); }
/* Reserve the width of the longer label so the button doesn't resize when it
   toggles between "Add to favorites" and "In favorites". */
.ibtn.favorite { min-width: 12.5rem; justify-content: center; }
.ibtn.favorite .on { display: none; }
.ibtn.favorite .off { display: inline; }
.ibtn.favorite.active { border-color: var(--accent); color: var(--accent); }
.ibtn.favorite.active .on { display: inline; }
.ibtn.favorite.active .off { display: none; }

.rate { display: inline-flex; align-items: center; gap: 0.15rem; }
.rate-label { color: var(--muted-foreground); font-size: 14px; margin-right: 0.35rem; }
.star {
  background: none; border: none; cursor: pointer; font-size: 1.15rem;
  color: var(--border); padding: 0 1px; line-height: 1;
  transition: color 0.12s ease, text-shadow 0.12s ease;
}
.star.on { color: var(--accent); }
/* .hover is set by JS on the hovered star and every star before it, so the whole
   run lights up and glows together. */
.star.hover { color: var(--accent); text-shadow: 0 0 10px rgb(255 89 100 / 85%); }

.agg-rating {
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}
.agg-rating small { color: var(--muted-foreground); }

.comment-form { margin-bottom: 1.5rem; }
.comment-form textarea {
  width: 100%;
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 0.6rem;
}
.comment-status { color: var(--muted-foreground); font-size: 14px; margin: 0.4rem 0 0; }
.comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.comment-list li { border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.comment-head { display: flex; justify-content: space-between; font-size: 14px; }
.comment-author { font-weight: 600; }
.comment-when { color: var(--muted-foreground); }
.comment-body { margin: 0.35rem 0 0; }
.muted { color: var(--muted-foreground); }

.header-account {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.header-account.signin { color: var(--muted-foreground); }
.header-account.signin:hover { color: var(--accent); }
/* click-to-open dropdown (native <details>) */
.header-account summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted-foreground);
}
.header-account summary::-webkit-details-marker { display: none; }
.header-account summary::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.header-account[open] summary,
.header-account summary:hover { color: var(--foreground); }
.header-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 50;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem;
  box-shadow: 0 12px 34px -12px rgb(0 0 0 / 65%);
}
.header-account-menu a {
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  color: var(--foreground);
  font-weight: 500;
}
.header-account-menu a:hover { background: var(--muted); color: var(--accent); }

/* ---- Auth pages ------------------------------------------------------ */

.auth-card { max-width: 380px; margin: 6vh auto; }
.auth-card h1 { font-family: var(--font-display); margin-bottom: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 1rem; }
.auth-card label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 14px; color: var(--muted-foreground); }
.auth-card input {
  background: #1c1c20; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--foreground); padding: 0.6rem 0.75rem; font-size: 15px;
}
.auth-error { color: var(--destructive); font-size: 14px; }
.auth-alt { margin-top: 1.25rem; font-size: 14px; color: var(--muted-foreground); text-align: center; }
.auth-alt a { color: var(--accent); }

/* ---- Two-column layout + sidebar ------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
  /* Breathing room below the sticky header so the sidebar (and content) do not
     butt up against the navbar. */
  margin-top: 1.75rem;
}
.layout-main { min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.widget-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { margin: 0; }
.widget-list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 14px;
  color: var(--foreground);
}
.widget-list a:hover { color: var(--accent); }

/* ranked "popular" list with thumbnails */
.rank-list { counter-reset: rank; }
.rank-list li { counter-increment: rank; }
.rank-list a {
  display: grid;
  grid-template-columns: 1.4rem 32px 1fr;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
}
.rank-list a::before {
  content: counter(rank);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted-foreground);
  text-align: center;
}
.rank-poster img,
.rank-poster-blank {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--muted);
  display: block;
}
.rank-title {
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.genre-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.genre-cloud a {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted-foreground);
}
.genre-cloud a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* ---- Prose + contact / DMCA pages ------------------------------------ */

.prose { max-width: 70ch; }
.prose h1 { font-family: var(--font-display); margin-bottom: 0.75rem; }
.prose h2 { font-family: var(--font-display); font-size: 18px; margin: 1.75rem 0 0.6rem; }
.prose p, .prose li { color: var(--muted-foreground); line-height: 1.65; }
.prose ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.prose a { color: var(--accent); }

.contact-form {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 14px; color: var(--muted-foreground);
}
.contact-form input,
.contact-form textarea {
  background: #1c1c20; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--foreground); padding: 0.6rem 0.75rem; font-size: 15px;
  font-family: inherit; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 8rem; }
/* honeypot: hidden from humans, tempting to bots */
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 14px; color: var(--muted-foreground); }
.form-note.ok { color: #4ade80; }
.form-note.error { color: var(--destructive); }
@media (max-width: 620px) {
  .contact-form .row { grid-template-columns: 1fr; }
}

/* ---- Accessibility helpers ------------------------------------------- */

/* Visually hidden but available to screen readers and SEO (e.g. the home h1). */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* List semantics without list chrome, for grids/link groups converted to <ul>. */
.poster-grid, .people-grid, .genre-pills, .genre-cloud, .episode-list {
  list-style: none;
}
.poster-grid, .people-grid, .episode-list { margin: 0; padding: 0; }
.genre-pills, .genre-cloud { padding: 0; }
.episode-list > li { list-style: none; }

/* ---- Breadcrumbs ----------------------------------------------------- */

.breadcrumb { margin: 1rem 0 0.5rem; font-size: 14px; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.35rem; }
.breadcrumb li + li::before { content: "›"; color: var(--muted-foreground); }
.breadcrumb a { color: var(--muted-foreground); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--foreground); }

/* ---- Share bar ------------------------------------------------------- */

.sharebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.share-label {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-right: 0.15rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 1rem; height: 1rem; display: block; }
.share-copy.copied { border-color: #4ade80; color: #4ade80; }

/* ---- Error page + admin help ----------------------------------------- */

.error-code {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.admin-help { display: block; margin-top: 0.35rem; font-size: 14px; color: var(--muted-foreground); }

/* ---- Home charts (Top Movies / Top TV Shows, side by side) ------------ */

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  margin: 2.5rem 0;
}
.chart-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  counter-reset: chart;
}
.chart-list > li { counter-increment: chart; }
.chart-list a {
  display: grid;
  grid-template-columns: 1.6rem 46px 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.chart-list a::before {
  content: counter(chart);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--muted-foreground);
  text-align: center;
}
.chart-poster img,
.chart-poster-blank {
  width: 46px;
  height: 69px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--muted);
  display: block;
}
.chart-meta { min-width: 0; }
.chart-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-sub { font-size: 14px; color: var(--muted-foreground); }
.imdb-mini { color: #f5c518; font-weight: 600; }
@media (max-width: 720px) { .charts { grid-template-columns: 1fr; } }

/* ---- Sidebar "Popular now" (poster + year, no rank) ------------------- */

.popular-list { list-style: none; margin: 0; padding: 0; }
.popular-list a {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
}
.popular-poster img,
.popular-poster-blank {
  width: 64px;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--muted);
  display: block;
}
.popular-meta { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.popular-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-year { font-size: 14px; color: var(--muted-foreground); }
.popular-rating { font-size: 14px; color: #f5c518; font-weight: 600; }

/* ---- Detail-page rating badges --------------------------------------- */

.ratings { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.rating-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--foreground);
  background: var(--card);
}
.rating-badge small { color: var(--muted-foreground); font-size: 14px; }
.rating-badge.imdb b { color: #f5c518; }
.rating-badge.tmdb b { color: #01b4e4; }
.rating-badge.network { color: var(--muted-foreground); }
.rating-badge.network:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Gallery carousel (screengrabs) ---------------------------------- */

.gallery-carousel {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem;
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.gallery-carousel > li { flex: 0 0 auto; scroll-snap-align: start; }
.gallery-item img {
  width: 300px;
  height: 169px;
  max-width: 70vw;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.gallery-item { padding: 0; border: 0; background: none; cursor: pointer; display: block; }
.gallery-item:hover img { border-color: var(--accent); }

/* ---- Lightbox (gallery preview modal) -------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none; } /* wins over the display:flex above */
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgb(0 0 0 / 60%);
}
.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

/* ---- Episode-row sub-meta + footer brand ----------------------------- */

.episode-sub {
  display: flex;
  gap: 0.75rem;
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 0.2rem;
}

/* Prev / all-episodes / next, directly under the player. Empty spans hold the
   ends so a lone "Next" stays right-aligned. */
.episode-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.footer-brand .wordmark img { opacity: 0.45; }
.footer-brand p {
  margin: 0.85rem 0 0;
  max-width: 52ch;
  color: var(--muted-foreground);
  opacity: 0.75;
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Account security: 2FA, passkeys, nudge -------------------------------- */
.mfa-nudge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin: 0 0 1.5rem; font-size: 15px;
}
.mfa-nudge strong { color: var(--accent); }
.mfa-nudge .btn { margin-left: auto; }
.security-page { max-width: 640px; }
.sec-block {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; margin: 1.25rem 0;
}
.sec-block h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.sec-on { color: #4ade80; font-weight: 600; }
.sec-qr { display: block; border-radius: var(--radius); background: #fff; padding: 0.5rem; margin: 0.75rem 0; }
.sec-secret code { background: #1c1c20; padding: 0.15rem 0.4rem; border-radius: 4px; word-break: break-all; }
.sec-confirm { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.75rem; }
.sec-passkeys { list-style: none; padding: 0; margin: 0 0 1rem; }
.sec-passkeys li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.sec-addkey { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.sec-confirm label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 14px; color: var(--muted-foreground); }
/* Match the adjacent .btn (40px tall) so inputs and buttons line up. */
.sec-confirm input,
.sec-addkey input {
  height: 40px; padding: 0 0.75rem; min-width: 12rem;
  background: #1c1c20; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--foreground); font-size: 14px;
}
.auth-passkey { margin-top: 1rem; text-align: center; }
.auth-status { color: var(--muted-foreground); font-size: 14px; margin-top: 0.5rem; min-height: 1.2em; }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
