/* vdo – library pages */

.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgb(26 21 48 / 88%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(62 52 102 / 60%);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: var(--wordmark-tracking);
  font-variation-settings: var(--display-axes);
  color: var(--marquee);
}
.wordmark.big { font-size: 4.5rem; text-align: center; margin-bottom: 24px; }

/* ---------- the logo: an admit-one ticket ----------
   Three nested layers (cream edge, bronze band, amber body), each with the corners cut out in
   circles that share one centre, so the notches stay concentric like a printed ticket. */
.ticket {
  --r: 16px;    /* notch radius at the outer edge */
  --edge: 2px;  /* cream outline */
  --band: 7px;  /* bronze border */
  --o: 0px;
  display: inline-block;
  vertical-align: middle;
  padding: var(--edge);
  background: #fff0cc;
  line-height: 1;
  letter-spacing: normal;
  transition: transform 0.2s ease;
}
.ticket-band { --o: var(--edge); display: block; padding: var(--band); background: linear-gradient(125deg, #7a4d0e 0%, #d9a544 28%, #8d5c15 52%, #e6b85a 78%, #7a4d0e 100%); }
.ticket-body { --o: calc(var(--edge) + var(--band)); display: grid; grid-template-columns: auto 1fr auto; background: linear-gradient(180deg, #ffd56b 0%, #ffc94d 55%, #f2b232 100%); color: var(--marquee-ink); }
.ticket, .ticket-band, .ticket-body {
  --cut: calc(var(--r) + var(--o));
  --keep: calc(var(--cut) + 0.5px);
  -webkit-mask:
    radial-gradient(circle at calc(var(--o) * -1) calc(var(--o) * -1), #0000 var(--cut), #000 var(--keep)) top left / 51% 51% no-repeat,
    radial-gradient(circle at calc(100% + var(--o)) calc(var(--o) * -1), #0000 var(--cut), #000 var(--keep)) top right / 51% 51% no-repeat,
    radial-gradient(circle at calc(var(--o) * -1) calc(100% + var(--o)), #0000 var(--cut), #000 var(--keep)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at calc(100% + var(--o)) calc(100% + var(--o)), #0000 var(--cut), #000 var(--keep)) bottom right / 51% 51% no-repeat;
  mask:
    radial-gradient(circle at calc(var(--o) * -1) calc(var(--o) * -1), #0000 var(--cut), #000 var(--keep)) top left / 51% 51% no-repeat,
    radial-gradient(circle at calc(100% + var(--o)) calc(var(--o) * -1), #0000 var(--cut), #000 var(--keep)) top right / 51% 51% no-repeat,
    radial-gradient(circle at calc(var(--o) * -1) calc(100% + var(--o)), #0000 var(--cut), #000 var(--keep)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at calc(100% + var(--o)) calc(100% + var(--o)), #0000 var(--cut), #000 var(--keep)) bottom right / 51% 51% no-repeat;
}
.ticket-center { display: grid; justify-items: center; align-content: center; min-width: 0; border-inline: 2px solid currentColor; }
.ticket-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-variation-settings: var(--display-axes);
  letter-spacing: 0.02em;
}
.ticket-top, .ticket-foot { width: 100%; text-align: center; font-family: var(--font-display); font-variation-settings: var(--display-axes); white-space: nowrap; }
/* the movie on the stub never widens the ticket: long titles end in an ellipsis */
.ticket-foot { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ticket-top { padding: 2px 0 6px; border-bottom: 2px solid currentColor; font-size: 1.45rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ticket-foot { padding: 6px 0 2px; border-top: 2px solid currentColor; font-size: 1.05rem; font-weight: 600; }
.ticket-serial {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.06em;
}
.ticket-serial-l { transform: rotate(180deg); }

/* sign-in and invite pages */
.ticket-big { --r: 16px; --edge: 2px; --band: 7px; filter: drop-shadow(0 14px 30px rgb(8 4 20 / 55%)); }
.ticket-big .ticket-body { padding: 12px 6px; }
.ticket-big .ticket-center { width: 17rem; padding: 0 20px; }
.ticket-big .ticket-name { padding: 8px 0 4px; font-size: 4.4rem; }
.login-ticket { justify-self: center; transform: rotate(-2deg); }

/* header: the same ticket, small */
.ticket-small { --r: 7px; --edge: 1px; --band: 3px; }
.ticket-small .ticket-body { padding: 3px 1px; }
.ticket-small .ticket-center { width: 7.25rem; padding: 0 6px; border-inline-width: 1.5px; }
.ticket-small .ticket-top { padding: 1px 0 2px; border-bottom-width: 1.5px; font-size: 0.5625rem; letter-spacing: 0.1em; }
.ticket-small .ticket-name { padding: 2px 0 1px; font-size: 1.3rem; }
.ticket-small .ticket-foot { padding: 2px 0 1px; border-top-width: 1.5px; font-size: 0.5625rem; font-weight: 700; }
.ticket-small .ticket-serial { padding: 0 4px; font-size: 0.5625rem; letter-spacing: 0.08em; }

/* the logo is the way home: hovering it says so, just under it */
.topbar { padding-top: 8px; padding-bottom: 8px; }
.topbar .wordmark { position: relative; display: inline-block; padding: 2px 0; line-height: 0; }
.topbar .wordmark:hover .ticket, .topbar .wordmark:focus-visible .ticket { transform: rotate(-3deg); }
.wordmark-hint {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-3);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.wordmark:hover .wordmark-hint,
.wordmark:focus-visible .wordmark-hint { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .wordmark-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .wordmark-hint, .ticket { transition: none; }
  .topbar .wordmark:hover .ticket, .topbar .wordmark:focus-visible .ticket { transform: none; }
}

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
}
.nav a:hover { color: var(--text); background: rgb(255 255 255 / 5%); }
.nav a.active { color: var(--text); background: var(--ink-3); }

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 420px;
}
.search-field > .icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--faint);
  pointer-events: none;
}
.search-field .input { padding-left: 38px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.main { padding: 28px clamp(16px, 4vw, 48px) 80px; }

/* ---------- marquee (the one loud thing) ---------- */
.marquee {
  --bulb: var(--marquee);
  position: relative;
  margin-bottom: 40px;
  padding: 34px clamp(20px, 4vw, 44px) 36px;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgb(255 201 77 / 12%), transparent 55%),
    linear-gradient(180deg, #2a2150, #211a3e);
  isolation: isolate;
}
.marquee::before {
  /* a frame of light bulbs */
  --b: radial-gradient(circle, var(--bulb) 0 2.6px, transparent 3.3px);
  content: '';
  position: absolute;
  inset: 3px 8px;
  border-radius: inherit;
  background:
    var(--b) 0 0 / 18px 14px repeat-x,
    var(--b) 0 100% / 18px 14px repeat-x,
    var(--b) 0 0 / 14px 18px repeat-y,
    var(--b) 100% 0 / 14px 18px repeat-y;
  filter: drop-shadow(0 0 3px rgb(255 201 77 / 75%));
  animation: chase 1.6s steps(1) infinite;
  pointer-events: none;
  z-index: -1;
}
.marquee.quiet { --bulb: #4a3f74; }
.marquee.quiet::before { filter: none; animation: none; }
@keyframes chase {
  50% { background-position: 9px 0, 9px 100%, 0 9px, 100% 9px; }
}

.marquee-title {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, var(--step-4));
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  font-variation-settings: var(--display-axes);
  line-height: 1;
  letter-spacing: -0.02em;
}
.marquee-hint { margin: 12px 0 0; max-width: 56ch; color: var(--muted); font-size: var(--step-1); }

.room-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  margin-top: 22px;
}
.room-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 170px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: #120e22;
}
.room-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.4s;
}
.room-card:hover img { opacity: 0.75; transform: scale(1.02); }
.room-card-body {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgb(10 6 24 / 85%) 45%);
}
.room-card-state { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--muted); }
.room-card-title { font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
.room-card-sub { color: var(--muted); font-size: var(--step--1); }
.room-card-people { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--step--1); color: var(--marquee); }
.room-card-people .icon { width: 16px; height: 16px; }

/* ---------- rows ---------- */
.row { margin-bottom: 36px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.row-title { margin: 0; font-size: var(--step-1); font-weight: 700; }
.row-title.spaced { margin: 32px 0 14px; }
.row-link { color: var(--muted); font-size: var(--step--1); font-weight: 600; }
.row-link:hover { color: var(--marquee); }

.scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 158px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.scroller > * { scroll-snap-align: start; }
.scroller.episodes { grid-auto-columns: 280px; }

/* ---------- posters ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 16px;
}
@media (max-width: 520px) {
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px 12px; }
}

.poster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
}
.poster-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(160deg, #3a2f66, #241d40);
  box-shadow: 0 6px 18px rgb(6 3 16 / 45%);
  transition: transform 0.18s ease, box-shadow 0.18s;
}
.poster:hover .poster-art, .poster:focus-visible .poster-art {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgb(6 3 16 / 60%), 0 0 0 2px var(--marquee);
}
.poster-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.poster.loaded .poster-art img { opacity: 1; }

/* frame-grab artwork becomes a typographic one-sheet */
.poster.framed .poster-art img { filter: saturate(0.85) brightness(0.8); }
.poster.framed .poster-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(20 14 40 / 0%) 30%, rgb(20 14 40 / 92%) 85%);
}
.poster-type {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  font-variation-settings: var(--display-axes);
  font-size: 1.3rem;
  line-height: 1.02;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgb(0 0 0 / 50%);
}
.poster-meta { display: grid; gap: 1px; min-width: 0; }
.poster-name { font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-sub { color: var(--faint); font-size: var(--step--1); }

/* ---------- episodes ---------- */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px 16px;
}
.episode-card {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
}
.still {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(160deg, #3a2f66, #241d40);
}
.still img { width: 100%; height: 100%; object-fit: cover; }
.episode-card:hover .still { box-shadow: 0 0 0 2px var(--marquee); }
.episode-card-text { display: grid; gap: 1px; }
.episode-card-show { color: var(--muted); font-size: var(--step--1); }
.episode-card-title { font-weight: 600; line-height: 1.3; }
.episode-card-title b { color: var(--marquee); font-weight: 700; margin-right: 6px; }

/* ---------- grid pages ---------- */
.grid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-title {
  margin: 0 0 4px;
  font-size: var(--step-3);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  font-variation-settings: var(--display-axes);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.page-title .count { color: var(--faint); font-weight: 500; font-size: var(--step-1); letter-spacing: 0; margin-left: 6px; }
.grid-tools { display: flex; gap: 10px; }
.grid-tools .filter { width: 220px; }
.grid-tools .sort { width: auto; }

.empty { color: var(--muted); padding: 40px 0; }
.empty-library { padding: 32px; border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty-library h2 { margin: 0 0 8px; }
.empty-library p { margin: 0; color: var(--muted); max-width: 60ch; }

.detail-loading { display: grid; place-items: center; min-height: 240px; }
.detail-loading.full { min-height: 100vh; }

/* ---------- detail ---------- */
.detail-hero {
  position: relative;
  margin: -28px calc(-1 * clamp(16px, 4vw, 48px)) 28px;
  padding: 72px clamp(16px, 4vw, 48px) 40px;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.detail.compact .detail-hero { margin: 0 0 24px; padding: 48px 24px 24px; min-height: 220px; border-radius: var(--r-lg); }
.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.detail-backdrop.framed { filter: blur(2px) saturate(0.8); }
.detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(26 21 48 / 92%) 0%, rgb(26 21 48 / 55%) 55%, transparent 100%);
  pointer-events: none;
}
.detail-hero-inner { position: relative; z-index: 1; max-width: 760px; }
.detail-back { position: absolute; top: -56px; left: -12px; color: var(--muted); }
.detail.compact .detail-back { top: -40px; }
.detail-title {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  font-variation-settings: var(--display-axes);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.detail-facts { margin: 0 0 14px; color: var(--muted); white-space: pre-wrap; }
.detail-overview { margin: 0 0 22px; max-width: 64ch; line-height: 1.6; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

.detail-tech {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 28px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  overflow-wrap: anywhere;
}

.season-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
}
.season-tab {
  flex: none;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.season-tab:hover { color: var(--text); }
.season-tab.active { background: var(--text); border-color: var(--text); color: var(--ink); }

.episode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.episode-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  text-align: left;
  color: inherit;
}
.episode-row:hover { background: var(--ink-2); border-color: var(--line); }
.episode-row.current, .episode-row.focus { border-color: var(--marquee); }
.episode-row .still-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(10 6 24 / 45%);
  opacity: 0;
  transition: opacity 0.15s;
}
.episode-row .still-play .icon { width: 34px; height: 34px; color: var(--marquee); }
.episode-row:hover .still-play { opacity: 1; }
.episode-text { display: grid; align-content: center; gap: 4px; min-width: 0; }
.episode-head { font-weight: 650; font-size: var(--step-1); line-height: 1.3; }
.episode-head b { color: var(--marquee); margin-right: 10px; font-weight: 700; }
.episode-overview {
  color: var(--muted);
  font-size: var(--step--1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.episode-meta { color: var(--faint); font-size: var(--step--1); }
@media (max-width: 640px) {
  .episode-row { grid-template-columns: 128px 1fr; gap: 12px; }
  .episode-head { font-size: var(--step-0); }
}

/* ---------- settings ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 28px; }
.stats div { padding: 16px 18px; border-radius: var(--r-md); background: var(--ink-2); border: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: var(--step--1); }
.stats dd { margin: 2px 0 0; font-size: var(--step-2); font-weight: 700; }
.settings-block { margin-bottom: 32px; }
.settings-block h2 { font-size: var(--step-1); margin: 0 0 12px; }
.settings-block p { margin: 0 0 8px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.error-text { color: var(--danger); }
.jobs { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.jobs th, .jobs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.jobs th { color: var(--muted); font-weight: 600; }

/* ---------- login / dialogs ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 440px); place-content: center; gap: 28px; padding: 24px; }
.login .dialog { display: grid; gap: 12px; }
.login .dialog p { margin: 0; }
.login-submit { margin-top: 4px; }
.login-join { width: min(440px, 100%); }
.join-row { display: flex; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--ink-3);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------- picker (room "choose a video") ---------- */
.picker { display: flex; flex-direction: column; height: 100%; }
.picker-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.picker-tabs { display: flex; gap: 4px; }
.picker-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.picker-tabs button .icon { width: 18px; height: 18px; }
.picker-tabs button.active { background: var(--ink-3); color: var(--text); }
.picker-bar .search-field { max-width: none; }
.picker-body { flex: 1; overflow-y: auto; padding: 22px 18px 40px; }
.picker-body .poster-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 8px; padding-top: 10px; padding-bottom: 10px; }
  .wordmark { margin-right: 2px; }
  .ticket-big .ticket-name { font-size: 3.4rem; }
  .ticket-big .ticket-top { font-size: 1.15rem; }
  .ticket-big .ticket-serial { font-size: 1.1rem; padding: 0 7px; }
  .ticket-big .ticket-center { width: 13rem; padding: 0 14px; }
  .nav a { padding: 0.35rem 0.45rem; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .btn { min-height: 36px; padding: 0.4rem 0.6rem; border-color: transparent; background: transparent; }
  .top-search { order: 3; max-width: none; flex-basis: 100%; }
  .hide-sm { display: none; }
  .detail-hero { min-height: 260px; padding-top: 64px; }
  .main { padding-top: 20px; }
  .picker-bar { flex-wrap: wrap; }
  .picker-bar .search-field { order: 3; flex-basis: 100%; }
}
@media (max-width: 499px) {
  /* on phones the section links don't fit beside the ticket logo and buttons: give them their own row */
  .topbar-actions { order: 1; }
  .topbar .nav { order: 2; flex-basis: 100%; justify-content: space-between; }
}

/* ---------- settings: metadata keys ---------- */
.narrow { max-width: 70ch; }
.keys { display: grid; gap: 12px; margin: 14px 0; max-width: 900px; }
.key-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; align-items: center; gap: 14px; }
.key-name { display: grid; font-weight: 600; }
.key-name small { color: var(--faint); font-weight: 400; font-size: var(--step--1); }
.key-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--step--1); }
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
@media (max-width: 760px) {
  .key-row { grid-template-columns: 1fr; gap: 6px; }
}
.link-btn {
  margin-left: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--marquee); }
.link-btn:disabled { opacity: 0.5; }
.link-note { margin-left: 10px; color: #ffb3bd; font-size: var(--step--1); }

/* ---------- show actions ---------- */
.season-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.season-bar .season-tabs { min-width: 0; }
.season-shuffle { flex: none; }

/* ---------- fix match ---------- */
.match-dialog { width: min(720px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.match-head { display: flex; align-items: center; justify-content: space-between; }
.match-search { display: flex; gap: 8px; margin-bottom: 10px; }
.match-year { width: 90px; flex: none; }
.match-providers { display: flex; gap: 6px; margin-bottom: 10px; }
.match-results { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 6px; }
.match-results li { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; padding: 8px; border-radius: var(--r-sm); background: rgb(255 255 255 / 4%); }
.match-poster { width: 54px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--ink-3); }
.match-poster img { width: 100%; height: 100%; object-fit: cover; }
.match-text { display: grid; gap: 2px; min-width: 0; }
.match-orig { font-size: var(--step--1); }
.match-overview { color: var(--muted); font-size: var(--step--1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- "can't decide?" spotlight ---------- */
.spotlight {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 360px;
  margin-bottom: 40px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--ink-2);
  isolation: isolate;
}
.spotlight-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 72%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  animation: spotlight-in 0.5s ease-out;
}
.spotlight-art.framed { filter: saturate(0.85); }
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--ink-2) 28%, rgb(34 27 61 / 88%) 45%, rgb(34 27 61 / 20%) 75%, transparent),
    linear-gradient(0deg, rgb(34 27 61 / 85%), transparent 45%);
}
@keyframes spotlight-in { from { opacity: 0; transform: scale(1.03); } }
.spotlight-body { position: relative; width: min(640px, 100%); padding: 26px clamp(20px, 4vw, 40px) 30px; }
.spotlight-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 26px; }
.spotlight-kicker { margin: 0 6px 0 0; font-size: var(--step-1); font-weight: 700; color: var(--marquee); }
.spotlight-select { width: auto; min-height: 36px; padding: 0.3rem 0.7rem; font-size: var(--step--1); }
.spotlight-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-tracking);
  font-variation-settings: var(--display-axes);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  cursor: pointer;
}
.spotlight-facts { margin: 0 0 10px; color: var(--muted); white-space: pre-wrap; }
.spotlight-overview {
  margin: 0 0 20px;
  max-width: 60ch;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spotlight-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) {
  .spotlight-art { width: 100%; opacity: 0.45; }
  .spotlight::before { background: linear-gradient(0deg, var(--ink-2) 35%, rgb(34 27 61 / 60%)); }
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(0 0 0 / 18%);
}
.segmented button {
  padding: 0.35rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--text); color: var(--ink); }

/* ---------- grouped grids ---------- */
.grid-tools { flex-wrap: wrap; align-items: center; }
.group-section { margin-bottom: 36px; scroll-margin-top: calc(var(--topbar-h, 66px) + 74px); }
.group-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; font-size: var(--step-1); font-weight: 700; }
.group-title .count { color: var(--faint); font-weight: 500; font-size: var(--step--1); }
.show-all { margin-top: 12px; }
.letter-bar {
  position: sticky;
  top: var(--topbar-h, 66px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: -8px 0 22px;
  padding: 6px 0;
  background: rgb(26 21 48 / 92%);
  backdrop-filter: blur(10px);
}
.letter-bar button {
  min-width: 28px;
  padding: 0.2rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--step--1);
}
.letter-bar button:hover { background: var(--ink-3); color: var(--marquee); }

.feed-end { display: grid; justify-items: center; gap: 12px; min-height: 80px; padding: 20px 0 10px; color: var(--muted); }
.feed-end p { margin: 0; }
@media (max-width: 760px) {
  .grid-tools { max-width: 100%; }
  .grid-tools .segmented { overflow-x: auto; max-width: 100%; }
}

/* ---------- shared by the library and room pages ---------- */
.share-row { display: flex; gap: 8px; }
.share-url { font-size: var(--step--1); }
.toggle { display: flex; align-items: center; gap: 10px; padding: 6px 4px; color: var(--muted); font-size: var(--step--1); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--marquee); }
.toggle input:disabled { opacity: 0.5; }
.tag {
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 2px;
}
.tag.host { background: rgb(255 201 77 / 18%); color: var(--marquee); }

/* ---------- forms ---------- */
.field { display: grid; gap: 2px; }
.field .label { margin-bottom: 4px; }
.field.grow { flex: 1; min-width: 200px; }
.hint { color: var(--faint); font-size: var(--step--1); margin-top: 4px; }
.small { font-size: var(--step--1); }
.input.invalid { border-color: var(--danger); }
.ok-text { color: var(--live); }
.notice {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgb(255 201 77 / 9%);
  border: 1px solid rgb(255 201 77 / 30%);
  color: var(--text) !important;
  font-size: var(--step--1);
}
.login .dialog .small { margin-top: 4px; }
.login code, .muted code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / 30%);
  color: var(--text);
  font-size: 0.9em;
}
select.input { appearance: auto; }

.btn-sm { min-height: 32px; padding: 0.3rem 0.75rem; font-size: var(--step--1); }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-danger { background: rgb(255 107 125 / 14%); border-color: rgb(255 107 125 / 45%); color: #ffb3bd; }
.btn-danger:hover { background: rgb(255 107 125 / 24%); border-color: var(--danger); }

.chip { margin-left: 6px; }
.chip-admin { background: rgb(157 140 255 / 20%); color: #cfc6ff; }
.chip-off { background: rgb(255 107 125 / 16%); color: #ffb3bd; }
.chip-live { background: rgb(82 214 164 / 16%); color: var(--live); }
.count { color: var(--faint); font-weight: 500; font-size: var(--step--1); margin-left: 4px; }

.card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-2);
}
.dialog.wide { width: min(620px, 100%); }

/* ---------- account menu ---------- */
.account-menu { position: relative; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--avatar-bg, #7b68ee), color-mix(in srgb, var(--avatar-bg, #7b68ee) 55%, #1a1530));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn { padding: 3px; border: 0; border-radius: 50%; background: transparent; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--marquee); }
.menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 230px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  box-shadow: var(--shadow);
}
.menu-who { display: grid; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-who .muted { font-size: var(--step--1); }
.menu-pop a, .menu-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--ink-3); }
.menu-pop .icon { width: 18px; height: 18px; color: var(--muted); }

/* ---------- account page ---------- */
.account-page { max-width: 760px; }
.account-page .page-title { margin-bottom: 4px; }
.account-page > .muted { margin: 0 0 24px; }
.account-page .card { margin-bottom: 18px; }
.inline-form { display: flex; gap: 8px; max-width: 460px; }
.stack-form { display: grid; gap: 12px; max-width: 460px; }
.stack-form p { margin: 0; }
.session-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.session-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 4%);
}
.session-list li > .muted { grid-column: 1; }
.session-list li > .btn { grid-column: 2; grid-row: 1 / span 2; }
.session-what { display: flex; align-items: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- admin ---------- */
.admin { max-width: 1100px; }
.title-icon { width: 0.9em; height: 0.9em; margin-right: 10px; color: var(--marquee); vertical-align: -0.08em; }
.admin-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.admin-tabs a .icon { width: 18px; height: 18px; }
.admin-tabs a:hover { color: var(--text); background: rgb(255 255 255 / 5%); }
.admin-tabs a.active { color: var(--text); background: var(--ink-3); }
.admin-tabs a.active .icon { color: var(--marquee); }
.admin h2 .count { font-size: var(--step--1); }
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tab-head p { margin: 0; }

.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
}
.person-card.off { opacity: 0.65; }
.person-card.off .avatar { background: var(--ink-3); }
.person-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.person-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.person-line .chip { margin-left: 0; }
.person-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; color: var(--muted); font-size: var(--step--1); }
.person-sub .dot { margin-right: 2px; }
.person-actions { display: flex; align-items: center; gap: 6px; flex: none; }

details.more { position: relative; }
details.more summary { list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { background: var(--ink-3); }
.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  display: grid;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  box-shadow: var(--shadow);
}
.more-menu button {
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  font-size: var(--step--1);
  font-weight: 500;
}
.more-menu button:hover:not(:disabled) { background: var(--ink-3); }
.more-menu button:disabled { color: var(--faint); cursor: default; }
.more-menu button.danger:not(:disabled) { color: #ffb3bd; }

.invite-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.invite-form select { width: auto; min-width: 120px; }
.invite-form .toggle { min-height: 42px; }
.created-invite {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid rgb(255 201 77 / 40%);
  background: rgb(255 201 77 / 7%);
}
.created-invite > p { margin: 0 0 10px; }
.link-box .muted { margin: 8px 0 0; }
.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.invite-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 4%);
}
.invite-list li > .muted { grid-column: 1; }
.invite-list li > .btn { grid-column: 2; grid-row: 1 / span 2; }
.invite-list.past li { background: transparent; border-bottom: 1px solid rgb(62 52 102 / 50%); border-radius: 0; }
.invite-list a:hover { color: var(--marquee); }

.room-admin-list { display: grid; gap: 12px; }
.room-admin { display: flex; gap: 16px; padding: 14px; }
.room-admin-art { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); flex: none; background: var(--ink-3); }
.room-admin-body { display: grid; gap: 10px; flex: 1; min-width: 0; }
.room-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.room-admin-head .dot { margin-right: 4px; }
.room-admin-title { font-weight: 700; font-size: var(--step-1); }
.room-admin-title:hover { color: var(--marquee); }
.room-admin-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.room-admin-people li { display: flex; align-items: center; gap: 10px; font-size: var(--step--1); }
.room-admin-people .link-btn { margin-left: auto; }
.file-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .person-card { flex-wrap: wrap; }
  .person-actions { width: 100%; justify-content: flex-end; }
  .room-admin { flex-direction: column; }
  .room-admin-art { width: 100%; }
  .room-admin-head { flex-direction: column; }
  .tab-head { flex-direction: column; align-items: flex-start; }
  .jobs { display: block; overflow-x: auto; }
  .inline-form { flex-direction: column; }
}

/* ---------- watch progress ---------- */
.progress-track { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / 55%); }
.progress-fill { display: block; height: 100%; background: var(--marquee); }
.progress-fill.done { background: var(--live); }
.watched-note { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--muted); }
.watched-note.seen { color: var(--live); }
.watched-note .icon { width: 14px; height: 14px; }
.chip-watched .icon { width: 14px; height: 14px; }

/* ---------- history page ---------- */
.history-page { max-width: 960px; }
.history-page .grid-head { align-items: flex-start; }
.history-lede { margin: 6px 0 0; max-width: 62ch; }
.history-day { margin-bottom: 28px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.history-entry { display: flex; align-items: center; gap: 8px; border-radius: var(--r-md); }
.history-entry:hover { background: var(--ink-2); }
.history-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  text-align: left;
}
.history-still { width: 168px; flex: none; }
.history-text { display: grid; gap: 2px; min-width: 0; }
.history-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-title b { color: var(--marquee); margin-right: 8px; }
.history-show { color: var(--muted); font-size: var(--step--1); }
.history-meta { display: flex; align-items: center; gap: 4px; color: var(--faint); font-size: var(--step--1); }
.history-meta .done-icon { width: 15px; height: 15px; color: var(--live); }
.history-remove { flex: none; margin-right: 6px; opacity: 0; }
.history-entry:hover .history-remove, .history-remove:focus-visible { opacity: 1; }
@media (max-width: 760px) {
  .history-still { width: 112px; }
  .history-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .history-main { gap: 12px; }
  .history-remove { opacity: 1; }
  .history-page .grid-head { flex-direction: column; }
}
@media (hover: none) { .history-remove { opacity: 1; } }
.picture-row { display: flex; align-items: center; gap: 18px; }
.picture-actions { display: grid; gap: 6px; }
.picture-actions p { margin: 0; }

/* ---------- "continue watching" ---------- */
.scroller.continue { grid-auto-columns: 300px; }
.continue-card { display: grid; gap: 8px; align-content: start; }
.continue-still { padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.continue-still .still { box-shadow: 0 6px 18px rgb(6 3 16 / 45%); transition: transform 0.18s ease, box-shadow 0.18s; }
.continue-still:hover .still, .continue-still:focus-visible .still { transform: translateY(-3px); box-shadow: 0 12px 26px rgb(6 3 16 / 60%), 0 0 0 2px var(--marquee); }
.continue-still .still-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(10 6 24 / 45%);
  opacity: 0;
  transition: opacity 0.15s;
}
.continue-still .still-play .icon { width: 38px; height: 38px; color: var(--marquee); }
.continue-still:hover .still-play, .continue-still:focus-visible .still-play { opacity: 1; }
.continue-still .progress-track { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(255 255 255 / 25%); }
.continue-still .progress-fill { display: block; height: 100%; background: var(--marquee); }
.continue-text { display: grid; gap: 1px; min-width: 0; }
.continue-title { display: grid; gap: 1px; min-width: 0; }
.continue-title:hover .continue-show, .continue-title:hover .continue-ep { color: var(--marquee); }
.continue-show { font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-ep { line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-ep b { color: var(--marquee); font-weight: 700; margin-right: 6px; }
.continue-note { color: var(--faint); font-size: var(--step--1); }
.continue-actions { display: flex; align-items: center; gap: 6px; }
.continue-actions .btn { min-width: 0; }
.continue-remove { opacity: 0; transition: opacity 0.15s; }
.continue-card:hover .continue-remove, .continue-card:focus-within .continue-remove { opacity: 1; }
@media (hover: none) { .continue-remove { opacity: 1; } .continue-still .still-play { opacity: 1; } }
@media (max-width: 520px) { .scroller.continue { grid-auto-columns: min(300px, 82vw); } }

/* the spotlight on the Movies / Shows / Anime pages: a shorter take on the one at home */
.spotlight.compact { min-height: 260px; margin-bottom: 28px; }
.spotlight.compact .spotlight-body { padding-top: 18px; padding-bottom: 22px; }
.spotlight.compact .spotlight-controls { margin-bottom: 16px; }
.spotlight.compact .spotlight-title { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
.spotlight.compact .spotlight-overview { -webkit-line-clamp: 2; margin-bottom: 14px; }

/* phones: the spotlight's buttons share the rows instead of each taking one */
@media (max-width: 520px) {
  .spotlight-actions .btn { flex: 1 1 auto; }
  .spotlight-actions .btn-lg { min-height: 44px; padding: 0.55rem 1rem; font-size: var(--step-0); }
  .spotlight-body { padding-bottom: 22px; }
  .spotlight { min-height: 300px; }
}
