/* cinezio — a cinema at night.
   The room is dark and warm; the posters and the pictures of the films bring
   the colour. One bright colour only, the yellow of the bulbs around a
   marquee: what plays, what is lit, where the focus is. Titles are set in
   Big Shoulders Display, tall and narrow like the letters on a cinema front;
   everything else in Archivo. */

@font-face {
  font-family: 'Archivo';
  src: url('vendor/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Big Shoulders Display';
  src: url('vendor/big-shoulders-display-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --room: #1A1211;              /* the room, lights down */
  --seat: #2A1C1A;              /* raised surfaces: a field, a panel, a menu */
  --screen: #F3E9DC;            /* text */
  --dim: #A8968A;
  --line: #3A2A27;              /* rules between things */
  --edge: #5E4842;              /* the outline of a field or a button: it has to be seen */
  --lamp: #FFC861;              /* the bulbs: play, progress, focus */
  --lamp-ink: #2A1600;          /* text on the bulb colour */
  --glow: #FFC861;
  --exit: #FF7A6B;

  /* A screen before its picture arrives. */
  --frame: #120C0B;
  --frame-lit: #2E201E;
  --veil: 26 18 17;

  --display: 'Big Shoulders Display', 'Archivo', system-ui, sans-serif;
  --margin: clamp(1rem, 3.4vw, 3rem);
  --bar: 4.5rem;                /* height of the top bar, measured by the script */
  --poster: clamp(7.5rem, 11.5vw, 11.5rem);     /* width of a poster in a row */
  --wide: clamp(15rem, 23vw, 22rem);            /* width of a picture in "Continue watching" */
}

/* ------------------------------------------------------------------ base -- */

*, *::before, *::after { box-sizing: border-box; }
/* The script shows and hides with this attribute, everywhere. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-block-size: 100dvh;
  background: var(--room);
  color: var(--screen);
  font: 450 1rem/1.5 'Archivo', system-ui, sans-serif;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
body.playing { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
/* On touch, the browser doesn't slap its blue rectangle over our buttons. */
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-inline-size: 100%; }

:focus-visible {
  outline: 2.5px solid var(--glow);
  outline-offset: 2px;
}
/* The page itself takes focus after a jump over the header: no ring for that. */
main:focus { outline: none; }

.visually-hidden {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sprite { position: absolute; inline-size: 0; block-size: 0; }

.skip {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 30;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  background: var(--seat);
  translate: 0 -200%;
}
.skip:focus { translate: 0 0; }

/* ------------------------------------------------------------------- top -- */
/* Over the pages, fixed. Clear over the big picture at the top of the home
   page and of a title, solid once the page has moved (`.solid`, set by the
   script). On a phone: the brand, the buttons and the sections, then the
   search under them. */

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand actions settings" "nav nav nav" "find find find";
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(var(--margin), env(safe-area-inset-right)) 0.625rem max(var(--margin), env(safe-area-inset-left));
  background: linear-gradient(rgb(var(--veil) / 0.92), rgb(var(--veil) / 0));
  transition: background-color 250ms ease, box-shadow 250ms ease;
}
.top.solid { background-color: var(--room); box-shadow: 0 1px 0 var(--line); }

.brand {
  grid-area: brand;
  color: var(--lamp);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
}

.nav {
  grid-area: nav;
  display: flex;
  gap: 1.25rem;
  min-inline-size: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 0.375rem 0;
  color: var(--dim);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--screen); }
.nav a[aria-current] { color: var(--screen); box-shadow: inset 0 -2px 0 var(--lamp); }

.find { grid-area: find; }
.top-actions { grid-area: actions; justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.top-settings { grid-area: settings; }
.top-settings[aria-current] { color: var(--screen); }

/* With room to spare, everything on one line. */
@media (min-width: 60rem) {
  .top {
    grid-template-columns: auto auto minmax(10rem, 1fr) auto auto;
    grid-template-areas: "brand nav find actions settings";
    column-gap: 2rem;
    padding-block: max(1rem, env(safe-area-inset-top)) 1rem;
  }
  .nav { gap: 1.75rem; overflow: visible; }
  .find { justify-self: end; inline-size: min(100%, 20rem); }
  .top-actions { gap: 0.75rem; }
}

/* The pages start under the bar; the big pictures slide under it (see
   .feature and .title-head). */
.page {
  padding: calc(var(--bar) + 1rem) max(var(--margin), env(safe-area-inset-right)) calc(var(--margin) * 2) max(var(--margin), env(safe-area-inset-left));
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-block: 0.5rem 1.5rem;
}
.page-name {
  font-family: var(--display);
  font-size: clamp(2.25rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; }

/* Choices that are places: the families of catalogs. A line of words, the
   one chosen underlined in the bulb colour. */
.chips {
  display: flex;
  gap: 0.125rem;
  min-inline-size: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-block-size: 2.5rem;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 0.25rem;
  background: none;
  color: var(--dim);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { color: var(--screen); }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--seat); color: var(--screen); box-shadow: inset 0 -2px 0 var(--lamp); }
.page-back { margin-block-start: 0.5rem; }
.page-back a { color: var(--dim); text-decoration: none; font-weight: 600; }
.page-back a:hover { color: var(--screen); }
.page-back + .page-head { margin-block-start: 0.25rem; }

/* ------------------------------------------------------------- the field -- */
/* A text field and its button in one piece: logging in, searching. */

.entry {
  display: flex;
  align-items: center;
  background: var(--seat);
  border: 1.5px solid var(--edge);
  border-radius: 0.375rem;
  overflow: hidden;
}
.entry:focus-within {
  border-color: var(--glow);
  outline: 2.5px solid var(--glow);
  outline-offset: 2px;
}
.entry input {
  flex: 1;
  min-inline-size: 0;
  block-size: 2.875rem;
  padding-inline: 1rem 0.5rem;
  border: 0;
  background: none;
  outline: none;
}
.entry input::placeholder { color: var(--dim); opacity: 1; }
.entry input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* The search of the top bar: a quiet field until it is used. */
.entry-quiet { border-color: transparent; background: rgb(255 255 255 / 0.08); }
.entry-quiet input { block-size: 2.5rem; padding-inline-start: 0.5rem; }
.entry-icon {
  flex: none;
  inline-size: 1.125rem;
  block-size: 1.125rem;
  margin-inline-start: 0.875rem;
  color: var(--dim);
  fill: currentColor;
}

.entry-button {
  margin: 0.25rem;
  padding-inline: 1.125rem;
  align-self: stretch;
  border: 0;
  border-radius: 0.25rem;
  background: var(--lamp);
  color: var(--lamp-ink);
  font-weight: 700;
}
.entry-button:disabled { opacity: 0.6; cursor: progress; }

.select {
  min-block-size: 2.5rem;
  max-inline-size: 100%;
  padding: 0.25rem 2.25rem 0.25rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: 0.375rem;
  background: var(--seat);
  -webkit-appearance: none;
  appearance: none;
  /* The little arrow, drawn in the colour of the text. */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(-45deg, transparent 50%, currentColor 50%);
  background-position: right 1.1rem center, right 0.75rem center;
  background-size: 0.375rem 0.375rem;
  background-repeat: no-repeat;
  font-weight: 500;
  text-overflow: ellipsis;
}
.select:hover { border-color: var(--edge); }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.link:hover { color: var(--screen); }

.feedback {
  margin-block-start: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.feedback:empty { display: none; }
.feedback.failure { color: var(--exit); }

/* ---------------------------------------------------------------- buttons -- */
/* Square-ish, in the letters of the marquee. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-block-size: 2.75rem;
  padding: 0.25rem 1.25rem;
  border: 0;
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.12);
  color: var(--screen);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { background: rgb(255 255 255 / 0.2); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button svg { flex: none; inline-size: 1.25rem; block-size: 1.25rem; fill: currentColor; }
.button[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--lamp); }
/* The one thing to do on a page: light, like the screen. */
.button-lamp { background: var(--screen); color: var(--room); }
.button-lamp:hover { background: #fff; }
/* The bulbs: the draw. */
.button-bulb { background: var(--lamp); color: var(--lamp-ink); }
.button-bulb:hover { background: #ffd587; }
.button-large { min-block-size: 3rem; padding-inline: 1.5rem; font-size: 1.375rem; }
.button-light { background: var(--screen); color: var(--room); }
.button-light:hover { background: #fff; }
/* Over a picture or the video. */
.button-onscreen { background: rgb(255 255 255 / 0.16); color: #fff; backdrop-filter: blur(6px); }
.button-onscreen:hover { background: rgb(255 255 255 / 0.26); }
.button-square { inline-size: 2.75rem; padding: 0; }
.button-large.button-square { inline-size: 3rem; }

.icon {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dim);
}
.icon svg { inline-size: 1.375rem; block-size: 1.375rem; fill: currentColor; }
.icon:hover { background: color-mix(in srgb, currentColor 12%, transparent); color: var(--screen); }
.icon[aria-pressed="true"] { color: var(--glow); }

/* --------------------------------------------------------- empty and alert -- */

/* An unlit screen, waiting for its film. */
.empty {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.375rem;
  max-inline-size: 30rem;
  min-block-size: 11rem;
  margin-block: 1rem;
  padding: 1.5rem;
  border: 1.5px dashed var(--line);
  border-radius: 0.375rem;
}
.empty p:first-of-type { font-family: var(--display); font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.empty p + p { color: var(--dim); overflow-wrap: anywhere; }
.empty .button { margin-block-start: 0.75rem; }

.alert {
  margin-block: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--exit) 14%, var(--seat));
  color: var(--screen);
  font-weight: 600;
}

/* ------------------------------------------------------------------ cards -- */
/* A card is its poster. The name comes over the foot of the poster under
   the pointer or the focus: it is written on the poster already. */

.card { position: relative; min-inline-size: 0; }

/* The ⋯ of a card: in the poster's corner, shown on hover where there is a
   mouse, always where there is a finger (except on a wall, see below). */
.card-more {
  position: absolute;
  z-index: 2;
  inset-block-start: 0.375rem;
  inset-inline-end: 0.375rem;
  inline-size: 2rem;
  block-size: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(var(--veil) / 0.82);
  color: #fff;
  cursor: pointer;
}
.card-more svg { inline-size: 1.125rem; block-size: 1.125rem; fill: currentColor; }
.card-more:hover, .card-more[aria-expanded="true"] { background: var(--lamp); color: var(--lamp-ink); }
@media (hover: hover) {
  .card-more { opacity: 0; transition: opacity 150ms ease; }
  .card:hover .card-more, .card:has(:focus-visible) .card-more, .card-more[aria-expanded="true"] { opacity: 1; }
}

/* Its panel covers the poster, and only the poster: a row's strip would cut
   anything that went past it. */
.card-menu {
  position: absolute;
  z-index: 1;
  inset-block-start: 0;
  inset-inline: 0;
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.125rem;
  padding: 2.75rem 0.375rem 0.375rem;
  border-radius: 0.25rem;
  background: rgb(var(--veil) / 0.94);
  overflow-y: auto;
}
.card-wide .card-menu { aspect-ratio: 16 / 9; }
.card-menu[hidden] { display: none; }
.card-action {
  padding: 0.4375rem 0.5rem;
  border: 0;
  border-radius: 0.25rem;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
}
.card-action:hover, .card-action:focus-visible { background: rgb(255 255 255 / 0.14); }
.card-action:disabled { opacity: 0.5; cursor: progress; }
.card-menu-note { margin: 0; padding: 0.5rem; color: rgb(255 255 255 / 0.72); font-size: 0.8125rem; }

.card-link { display: block; border-radius: 0.25rem; text-decoration: none; }
.card-link:focus-visible { outline: none; }

.card-frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 0.25rem;
  overflow: hidden;
  background: linear-gradient(160deg, var(--frame-lit), var(--frame) 120%);
}
/* The ring is drawn inside the frame, over the picture: on a wall, one drawn
   outside would be cut by the neighbours and by the screen. */
.card-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.card-link:focus-visible .card-frame::after { box-shadow: inset 0 0 0 3px var(--lamp); }
@media (hover: hover) {
  .card:hover .card-frame::after { box-shadow: inset 0 0 0 2px var(--lamp); }
}

/* Under the picture, for when there is none: the name on the dark screen. */
.card-blank {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  color: rgb(255 255 255 / 0.72);
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
  overflow: hidden;
}

/* Hidden by opacity, never by `display`: an image that isn't rendered is
   never loaded when it is lazy. */
.poster {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}
.poster.loaded { opacity: 1; }

.card-tag {
  position: absolute;
  inset-block-start: 0.375rem;
  inset-inline-start: 0.375rem;
  padding: 0.0625rem 0.5rem;
  border-radius: 0.25rem;
  background: rgb(var(--veil) / 0.82);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 650;
}
/* How far a video was watched: the bulb colour along the foot of the frame. */
.card-progress {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 0.25rem;
  background: rgb(255 255 255 / 0.22);
}
.card-progress span { display: block; block-size: 100%; background: var(--lamp); }

/* Hidden by opacity: the name is still what the link is called. */
.card-words {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  gap: 0.125rem;
  padding: 2rem 0.625rem 0.5rem;
  border-radius: 0 0 0.25rem 0.25rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.9) 50%);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.05;
}
.card-facts { color: rgb(255 255 255 / 0.74); font-size: 0.75rem; }
.card-link:focus-visible .card-words { opacity: 1; }
@media (hover: hover) {
  .card:hover .card-words { opacity: 1; }
}

/* The list and "watched", one press each, over the foot of the poster under
   the name, where there is a mouse. Kept shown by the keyboard's focus only
   (`:focus-visible`): a button pressed with the mouse keeps the focus, and
   the card would stay as if pointed at once the mouse has left. Lit in the bulb colour when they are on.
   Where there is a finger they are not there: the ⋯ menu holds the same. */
.card-bar {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  inset-block-end: 0;
  display: none;
  gap: 0.375rem;
  padding: 0 0.625rem 0.5rem;
  pointer-events: none;
}
.card-quick {
  inline-size: 2rem;
  block-size: 2rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgb(255 255 255 / 0.6);
  border-radius: 50%;
  background: rgb(var(--veil) / 0.72);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}
.card-quick svg { inline-size: 1.125rem; block-size: 1.125rem; fill: currentColor; }
.card-quick:hover { border-color: var(--lamp); color: var(--lamp); }
.card-quick[aria-pressed="true"] { border-color: var(--lamp); background: var(--lamp); color: var(--lamp-ink); }
.card-quick[aria-pressed="true"]:hover { color: var(--lamp-ink); filter: brightness(1.08); }
@media (hover: hover) {
  .card-bar { display: flex; opacity: 0; transition: opacity 150ms ease; }
  .card:hover .card-bar, .card:has(:focus-visible) .card-bar { opacity: 1; }
  /* The name moves up to leave them room. */
  .card:not(.card-wide) .card-words { padding-block-end: 3rem; }
  /* A poster has nothing more than these two: no ⋯. */
  .card:not(.card-wide) .card-more, .card:not(.card-wide) .card-menu { display: none; }
  /* A wide card: the one button at the end of its name's line. */
  .card-wide .card-bar { inset-inline-start: auto; padding: 0 0.875rem 0.875rem; }
  .card.card-wide .card-words { padding-inline-end: 3.5rem; }
  /* Small posters: the name gives way, the buttons stay. */
  .wall[data-size="s"] .card-bar { gap: 0.25rem; padding: 0 0.3rem 0.3rem; }
  .wall[data-size="s"] .card-quick { inline-size: 1.75rem; block-size: 1.75rem; }
  .wall[data-size="s"] .card:not(.card-drawn) .card-words { display: none; }
}

/* One message at the foot of the screen, and what undoes the change. */
.toast {
  position: fixed;
  z-index: 50;
  inset-block-end: 1.5rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.625rem 0.75rem 0.625rem 1.125rem;
  border-radius: 0.5rem;
  background: var(--seat);
  box-shadow: 0 0 0 1px var(--line), 0 0.75rem 2rem rgb(0 0 0 / 0.45);
  color: var(--screen);
  font-size: 0.875rem;
}
.toast-undo {
  padding: 0.25rem 0.375rem;
  border: 0;
  border-radius: 0.25rem;
  background: none;
  color: var(--lamp);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* "Continue watching": the picture of the film or of the episode, wide, its
   name always written over it. */
.card-wide .card-frame { aspect-ratio: 16 / 9; }
.card-wide .card-words { opacity: 1; padding: 2.5rem 0.875rem 0.75rem; }
.card-wide .card-name { font-size: 1.375rem; -webkit-line-clamp: 1; }
.card-wide .card-facts { font-size: 0.8125rem; color: rgb(255 255 255 / 0.82); }
.card-wide .card-tag { display: none; }

/* A card to come: the frame alone, breathing slowly. */
.card-waiting .card-frame { animation: wait 1.6s ease-in-out infinite alternate; }
@keyframes wait { from { opacity: 0.45; } to { opacity: 1; } }

/* ------------------------------------------------------------------- rows -- */

.rows { display: grid; gap: 2.5rem; }
.rows:empty { display: none; }
.rows + .rows, .feature + .rows { margin-block-start: 2.5rem; }

.row { min-inline-size: 0; }
.row-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-block-end: 0.875rem;
}
.row-name {
  flex: 1;
  min-inline-size: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
}
.row-kind { margin-inline-start: 0.625rem; color: var(--dim); font-family: 'Archivo', sans-serif; font-size: 0.9375rem; font-weight: 500; letter-spacing: 0; }
.row-all { flex: none; color: var(--dim); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.row-all:hover { color: var(--screen); text-decoration: underline; text-underline-offset: 0.2em; }

/* The strip scrolls sideways under the finger; with a mouse, arrows appear
   at its ends. It bleeds to the edge of the screen. */
.strip-wrap { position: relative; margin-inline: calc(var(--margin) * -1); }
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--poster);
  gap: 0.875rem;
  padding: 0.25rem var(--margin) 0.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--margin);
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; }
.strip-wide { grid-auto-columns: var(--wide); }

.strip-arrow {
  position: absolute;
  inset-block: 0.25rem 0.5rem;
  z-index: 3;
  display: none;
  place-items: center;
  inline-size: calc(var(--margin) + 0.5rem);
  min-inline-size: 2.75rem;
  padding: 0;
  border: 0;
  background: rgb(var(--veil) / 0.7);
  color: var(--screen);
}
.strip-arrow svg { inline-size: 1.75rem; block-size: 1.75rem; fill: currentColor; }
.strip-arrow:hover { background: rgb(var(--veil) / 0.9); color: var(--lamp); }
.strip-back { inset-inline-start: 0; }
.strip-forward { inset-inline-end: 0; }
.strip-arrow:disabled { visibility: hidden; }
@media (hover: hover) {
  .strip-wrap:hover .strip-arrow, .strip-arrow:focus-visible { display: grid; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--poster)), 1fr));
  gap: 0.875rem;
}
.more { block-size: 1px; }

/* ------------------------------------------------------------------- wall -- */
/* Posters alone, edge to edge, in three sizes. */

.segment {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 0.375rem;
  overflow: hidden;
}
.segment-option {
  display: grid;
  place-items: center;
  min-inline-size: 2.5rem;
  min-block-size: 2.375rem;
  padding: 0 0.625rem;
  border: 0;
  background: none;
  color: var(--dim);
  font-weight: 600;
}
.segment-option svg { inline-size: 1rem; block-size: 1rem; fill: currentColor; }
.segment-option:hover { color: var(--screen); }
.segment-option[aria-pressed="true"] { background: var(--seat); color: var(--screen); }

.grid.wall {
  --tile: clamp(5.5rem, 9.2vw, 11rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile)), 1fr));
  gap: 2px;
  margin-inline: calc(var(--margin) * -1);
}
.grid.wall[data-size="s"] { --tile: clamp(4.5rem, 6.6vw, 8rem); }
.grid.wall[data-size="l"] { --tile: clamp(7.5rem, 13vw, 15.5rem); }
.wall .card-frame, .wall .card-menu, .wall .card-words, .wall .card-link { border-radius: 0; }
/* Under a finger a press opens the title, where the same choices are: a ⋯ on
   each of a hundred posters would be all one sees. */
@media (hover: none) {
  .wall .card-more { display: none; }
}

/* A draw: the lights go down, one hops from poster to poster and settles on
   the title drawn, which keeps its ring and its name. */
.grid.drawing .card:not(.card-hop):not(.card-drawn) .card-frame { filter: brightness(0.3) saturate(0.5); }
.grid .card-frame { transition: filter 160ms ease; }
.card-hop .card-frame::after, .card-drawn .card-frame::after { box-shadow: inset 0 0 0 3px var(--lamp) !important; }
.card-drawn { z-index: 1; }
.card-drawn .card-frame { animation: drawn 420ms cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes drawn { from { transform: scale(0.9); } }
.card-drawn .card-words { opacity: 1; }
/* While the lights are down, pointing at a poster does not name it. */
.drawing .card:not(.card-drawn) .card-words,
.drawing .card:not(.card-drawn) .card-bar { opacity: 0 !important; }
.drawing .card:not(.card-drawn):not(.card-hop) .card-frame::after { box-shadow: none !important; }
.card-drawn .poster { filter: none; }

/* Watched: the poster dimmed, with a tick, until it is pointed at. Dimmed by
   a filter, not by opacity: what is under the picture would show through. */
.wall [data-mark="watched"] .poster { filter: brightness(0.4) saturate(0.6); }
.wall [data-mark="watched"]:hover .poster,
.wall [data-mark="watched"]:has(:focus-visible) .poster { filter: none; }
.card-seen {
  position: absolute;
  inset-block-start: 0.375rem;
  inset-inline-start: 0.375rem;
  display: grid;
  place-items: center;
  inline-size: 1.375rem;
  block-size: 1.375rem;
  border-radius: 50%;
  background: var(--lamp);
  color: var(--lamp-ink);
}
.card-seen svg { inline-size: 0.875rem; block-size: 0.875rem; }
.wall .card:hover .card-seen, .wall .card:has(:focus-visible) .card-seen { display: none; }
.search-more { margin-block-start: 2rem; }

/* The Films and Series pages: their filters on one line, which stays under
   the top bar while the wall scrolls. */
.browse-head {
  position: sticky;
  inset-block-start: var(--bar);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: -1rem calc(var(--margin) * -1) 0;
  padding: 0.75rem var(--margin) 0.875rem;
  background: var(--room);
  border-block-end: 1px solid var(--line);
}
.browse-head .page-name { margin-inline-end: 0.25rem; }
.browse-head .chips { flex: 1 1 20rem; }
.browse-head + .grid.wall, .browse-head + .empty { margin-block-start: 2px; }
.browse-head + .empty { margin-block-start: 1.5rem; }

/* ---------------------------------------------------------------- feature -- */
/* Tonight's programme: one title, large, at the top of the home page, under
   the top bar. */

.feature {
  position: relative;
  display: grid;
  align-items: end;
  min-block-size: clamp(28rem, 76vh, 52rem);
  margin: calc((var(--bar) + 1rem) * -1) calc(var(--margin) * -1) 0;
  overflow: hidden;
  background: var(--frame);
  color: #fff;
}
.feature-image {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0;
  transition: opacity 600ms ease;
}
.feature-image.loaded { opacity: 1; }
/* The veil that lets the words be read over any picture, and melts the
   picture into the room. */
.feature::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--room), rgb(var(--veil) / 0) 45%),
    linear-gradient(to right, rgb(var(--veil) / 0.92), rgb(var(--veil) / 0.6) 38%, rgb(var(--veil) / 0) 70%);
}
.feature-text {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 0.875rem;
  max-inline-size: 40rem;
  padding: 2rem var(--margin) clamp(2rem, 6vh, 4.5rem);
}
.feature-name {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 0.95;
  text-wrap: balance;
}
.feature-logo {
  max-inline-size: min(100%, 26rem);
  max-block-size: 9rem;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 0.125rem 0.75rem rgb(0 0 0 / 0.5));
}
.feature-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.125rem; color: rgb(255 255 255 / 0.72); font-weight: 500; }
.feature-facts span:first-child { color: #fff; font-weight: 650; }
.feature-story {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: rgb(255 255 255 / 0.88);
  max-inline-size: 36rem;
}
.feature-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-start: 0.625rem; }
/* Why this title is here, in the bulb colour: tonight's pick. */
.feature-lead { order: -1; color: var(--lamp); font-family: var(--display); font-size: 1.375rem; font-weight: 700; letter-spacing: 0.03em; }
/* Where the title being watched was left. */
.feature-where { display: flex; align-items: center; gap: 0.875rem; color: rgb(255 255 255 / 0.88); font-weight: 550; }
.feature-track { inline-size: 10rem; block-size: 0.25rem; border-radius: 0.125rem; background: rgb(255 255 255 / 0.22); }
.feature-track span { display: block; block-size: 100%; border-radius: inherit; background: var(--lamp); }
.feature + .rows { margin-block-start: 0; }

/* ------------------------------------------------------------------- draw -- */
/* "Surprise me": the lights go down, the bulbs of a marquee chase around a
   reel of posters, and the title drawn comes up on the screen. */

.top-surprise { min-block-size: 2.5rem; padding-inline: 0.875rem 1rem; font-size: 1.1875rem; }
@media (max-width: 30rem) {
  .top-surprise { padding-inline: 0.75rem; }
  .top-surprise span { display: none; }
}

.draw {
  inline-size: min(70rem, 100% - 2rem);
  max-inline-size: none;
  max-block-size: 100dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--screen);
  overflow: visible;
}
.draw::backdrop { background: rgb(10 6 5 / 0.92); backdrop-filter: blur(6px); }
.draw[open] { animation: dim 220ms ease-out; }
.draw-close { position: fixed; inset-block-start: 1.25rem; inset-inline-end: 1.25rem; background: rgb(255 255 255 / 0.1); color: var(--screen); }

/* The bulbs: four rows of dots around the screen, that chase while drawing. */
.marquee {
  --dot: radial-gradient(circle, var(--lamp) 0 3.5px, rgb(255 200 97 / 0.2) 4.5px, transparent 7px);
  padding: 1.375rem;
  border-radius: 0.875rem;
  background-color: #241816;
  background-image: var(--dot), var(--dot), var(--dot), var(--dot);
  background-size: 22px 22px;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
}
.marquee.chasing { animation: chase 250ms steps(2) infinite; }
@keyframes chase { to { background-position: 22px 0, -22px 100%, 0 -22px, 100% 22px; } }

.draw-screen {
  position: relative;
  aspect-ratio: 21 / 9;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #000;
}
@media (max-width: 40rem) { .draw-screen { aspect-ratio: 3 / 4; } }

.draw-reel {
  position: absolute;
  inset-block: 9%;
  inset-inline-start: 0;
  display: flex;
  gap: 0.75rem;
  padding-inline-start: 0.75rem;
  inline-size: max-content;
}
.draw-reel li { block-size: 100%; aspect-ratio: 2 / 3; transition: opacity 400ms ease, transform 400ms ease; }
.draw-reel img { inline-size: 100%; block-size: 100%; object-fit: cover; border-radius: 0.25rem; opacity: 0.55; transition: opacity 400ms ease, filter 600ms ease, box-shadow 400ms ease; }
.draw-reel.running { animation: reel 4s linear infinite; }
@keyframes reel { to { translate: -50% 0; } }
/* The blur of speed. */
.draw-reel.fast img { filter: blur(3px); }
/* Stopped on the title drawn: it lights up, the others go dark. */
.draw-reel.landed li:not(.draw-winner) { opacity: 0.12; }
.draw-reel.landed .draw-winner { transform: scale(1.06); }
.draw-reel.landed .draw-winner img { opacity: 1; box-shadow: 0 0 0 3px var(--lamp), 0 0 3rem rgb(255 200 97 / 0.45); }
/* Then it grows into the picture of the film, and goes. */
.draw-reel.zoom li:not(.draw-winner) { opacity: 0; }
.draw-reel.zoom .draw-winner { transform: scale(1.9); opacity: 0; transition: transform 900ms cubic-bezier(0.4, 0, 0.6, 1), opacity 700ms ease 200ms; }

.draw-reveal { position: absolute; inset: 0; display: grid; align-items: end; opacity: 0; visibility: hidden; transition: opacity 500ms ease, visibility 0s 500ms; }
.draw-reveal.on { opacity: 1; visibility: visible; transition: opacity 800ms ease 150ms; }
.draw-reveal.instant { transition: none; }
.draw-reveal .draw-backdrop { transform: scale(1.06); transition: transform 1600ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.draw-reveal.on .draw-backdrop { transform: none; }
.draw-reveal .draw-text { translate: 0 0.75rem; transition: translate 700ms ease 400ms; }
.draw-reveal.on .draw-text { translate: 0 0; }
.draw-backdrop { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.draw-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to right, rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.5) 45%, transparent 75%), linear-gradient(to top, rgb(0 0 0 / 0.7), transparent 50%);
}
.draw-text { position: relative; z-index: 2; display: grid; justify-items: start; gap: 0.75rem; max-inline-size: 32rem; padding: clamp(1.25rem, 4%, 2.5rem); color: #fff; }
.draw-name { font-family: var(--display); font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 900; line-height: 0.95; }
.draw-logo { max-inline-size: min(100%, 22rem); max-block-size: 7rem; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 0.125rem 0.75rem rgb(0 0 0 / 0.5)); }
.draw-story { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: rgb(255 255 255 / 0.86); }
.draw-status { position: absolute; inset: auto 0 1.5rem; z-index: 3; text-align: center; color: var(--dim); }
.draw-status:empty { display: none; }

.draw-options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-block-start: 1.125rem; padding-inline: 0.25rem; }
.draw-label { margin-inline-end: auto; color: var(--lamp); font-family: var(--display); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.02em; }
.draw-kinds { display: inline-flex; padding: 0.1875rem; border-radius: 0.375rem; background: var(--room); }
.draw-kinds button { min-block-size: 2.25rem; padding: 0 0.875rem; border: 0; border-radius: 0.25rem; background: none; color: var(--dim); font-weight: 550; }
.draw-kinds button:hover { color: var(--screen); }
.draw-kinds button[aria-pressed="true"] { background: var(--seat); color: var(--screen); }

/* ------------------------------------------------------------------ title -- */
/* The page of a title: its picture across the page, as on the home page,
   the words and the buttons over its left side. */

/* Not clipped: the menu of its ⋯ may reach below it. Its picture and veil
   stay inside anyway. */
.title-head { min-block-size: clamp(30rem, 86vh, 56rem); overflow: visible; }
.title-head .feature-text { max-inline-size: 44rem; }
/* No picture: the words alone, on the room. */
.title-head-bare { min-block-size: 0; padding-block-start: calc(var(--bar) + 2rem); }
.title-tagline { color: var(--lamp); font-family: var(--display); font-size: 1.375rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.15; }
.title-story { color: rgb(255 255 255 / 0.88); max-inline-size: 38rem; }
.title-credit { color: rgb(255 255 255 / 0.65); font-size: 0.9375rem; }
.credit-link { color: #fff; text-decoration-color: rgb(255 255 255 / 0.35); text-underline-offset: 0.2em; }
.credit-link:hover { text-decoration-color: currentColor; }
.title-head .alert { margin: 0; }

/* A menu under a button: the ⋯ of a title and of an episode. */
.popover-wrap { position: relative; display: inline-flex; }
.popover {
  position: absolute;
  z-index: 15;
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-start: 0;
  display: grid;
  min-inline-size: 15rem;
  padding: 0.375rem;
  border-radius: 0.5rem;
  background: var(--seat);
  box-shadow: 0 0.75rem 2.5rem rgb(0 0 0 / 0.55);
}
.popover-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: var(--screen);
  font-weight: 500;
  text-align: start;
  white-space: nowrap;
}
.popover-item svg { flex: none; inline-size: 1.125rem; block-size: 1.125rem; color: var(--dim); fill: currentColor; }
.popover-item:hover, .popover-item:focus-visible { background: rgb(255 255 255 / 0.08); }

.cast, .episodes-block, .title-head ~ .rows { margin-block-start: 2.5rem; }
.cast .row-name { margin-block-end: 1rem; }
.people {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 8rem;
  gap: 1.25rem;
  margin-inline: calc(var(--margin) * -1);
  padding: 0.25rem var(--margin) 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.people::-webkit-scrollbar { display: none; }
.person { display: grid; justify-items: center; align-content: start; gap: 0.125rem; text-align: center; }
.person-photo {
  position: relative;
  inline-size: 7rem;
  aspect-ratio: 1;
  margin-block-end: 0.5rem;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--frame-lit), var(--frame) 120%);
}
.person-name { font-family: var(--display); font-size: 1.125rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.person-role { color: var(--dim); font-size: 0.8125rem; line-height: 1.25; overflow-wrap: anywhere; }
a.person { text-decoration: none; border-radius: 0.5rem; }
a.person:hover .person-name, a.person:focus-visible .person-name { color: var(--lamp); }
a.person:hover .person-photo { outline: 2px solid var(--lamp); outline-offset: 3px; }

.works { display: grid; gap: 2.5rem; }
.works-kind .row-name { margin-block-end: 0.75rem; }
.works-kind .search-more { margin-block-start: 1.5rem; }

/* --------------------------------------------------------------- episodes -- */
/* A season's episodes as pictures, four abreast on a computer. */

.episodes-block .row-head { align-items: center; }
.seasons { flex: 1; }
.episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1.75rem 1.25rem;
}
.episode { position: relative; min-inline-size: 0; }
.episode-main { display: grid; gap: 0.625rem; text-decoration: none; border-radius: 0.375rem; }
.episode-main:focus-visible { outline-offset: 4px; }
.episode-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 0.375rem;
  overflow: hidden;
  background: linear-gradient(100deg, var(--frame-lit), var(--frame) 140%);
}
.episode.next .episode-frame { box-shadow: 0 0 0 2px var(--lamp); }
.episode-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity 150ms ease;
}
.episode-play svg { inline-size: 2.75rem; block-size: 2.75rem; fill: currentColor; }
a.episode-main:hover .episode-play, .episode-main:focus-visible .episode-play { opacity: 1; }
@media (hover: none) {
  .episode-play { inset: auto auto 0.5rem 0.5rem; inline-size: 2.25rem; block-size: 2.25rem; border-radius: 50%; background: rgb(0 0 0 / 0.6); opacity: 1; }
  .episode-play svg { inline-size: 1.125rem; block-size: 1.125rem; }
}
.episode-text { min-inline-size: 0; display: grid; gap: 0.25rem; }
.episode-name { font-family: var(--display); font-size: 1.3125rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.episode-number { color: var(--lamp); margin-inline-end: 0.125rem; }
.episode-about { color: var(--dim); font-size: 0.8125rem; }
.episode-story {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--dim);
  font-size: 0.875rem;
}
.episode.watched .episode-frame .poster { filter: brightness(0.55) saturate(0.7); }
.episode.watched .episode-name { color: var(--dim); }
.episode.future { opacity: 0.55; }
/* Its ⋯, in the corner of its picture as on a card: shown on hover where
   there is a mouse, always where there is a finger. */
.episode > .popover-wrap { position: absolute; z-index: 2; inset-block-start: 0.375rem; inset-inline-end: 0.375rem; }
.episode .popover { inset-inline: auto 0; }
.episode-more { inline-size: 2rem; block-size: 2rem; background: rgb(var(--veil) / 0.82); color: #fff; }
.episode-more:hover, .episode-more[aria-expanded="true"] { background: var(--lamp); color: var(--lamp-ink); }
@media (hover: hover) {
  .episode-more { opacity: 0; transition: opacity 150ms ease; }
  .episode:hover .episode-more, .episode:focus-within .episode-more, .episode-more[aria-expanded="true"] { opacity: 1; }
}

/* --------------------------------------------------------- panel (sources) -- */
/* A sheet rising from the bottom on a phone, a centred panel on a wider
   screen. */

.detail {
  inline-size: min(46rem, 100% - 2rem);
  max-inline-size: none;
  max-block-size: min(50rem, 100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 1.25rem;
  background: var(--seat);
  color: var(--screen);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.detail[open] { display: flex; animation: rise 220ms ease-out; }
.detail::backdrop { background: rgb(var(--veil) / 0.6); animation: dim 220ms ease-out; }
@keyframes rise { from { opacity: 0; translate: 0 1.5rem; } }
@keyframes dim { from { opacity: 0; } }

@media (max-width: 40rem) {
  .detail {
    inline-size: 100%;
    max-block-size: calc(100dvh - 3rem);
    margin: auto 0 0;
    border-radius: 1.25rem 1.25rem 0 0;
  }
}

.sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  min-block-size: 0;
}
.sheet-head {
  display: flex;
  align-items: start;
  gap: 0.25rem;
  padding: 1.25rem 0.75rem 1rem 1.5rem;
}
.sheet-title { flex: 1; min-inline-size: 0; }
.sheet-title h2 {
  font-size: 1.5rem;
  font-weight: 700;
  font-stretch: 75%;
  line-height: 1.2;
}
.sheet-title p { margin-block-start: 0.25rem; color: var(--dim); font-size: 0.9375rem; overflow-wrap: anywhere; }
/* The list scrolls; the title stays in place. */
.sheet-body {
  flex: 1;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 0 0.75rem max(1rem, env(safe-area-inset-bottom)) 0.75rem;
  border-block-start: 1px solid var(--line);
}

.sources-note { padding: 0.875rem 0.75rem; color: var(--dim); font-size: 0.9375rem; overflow-wrap: anywhere; }
.sources-more summary { padding: 0.875rem 0.75rem; color: var(--dim); font-weight: 650; cursor: pointer; }
.sources-complaints .sources-note { padding-block: 0.25rem; }
.source + .source { border-block-start: 1px solid var(--line); }
/* A source, and beside it the button that saves it. */
.source-row { display: flex; align-items: center; }
.source-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  padding: 0 0.75rem 0.75rem;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.source-status:empty { display: none; }
.source-main {
  flex: 1;
  min-inline-size: 0;
  display: grid;
  gap: 0.25rem;
  inline-size: 100%;
  padding: 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  text-align: start;
}
.source-main:hover { background: color-mix(in srgb, var(--screen) 7%, transparent); }
.source-main:focus-visible { outline-offset: -2px; }
.source-top { display: flex; align-items: center; gap: 0.75rem; }
.source-badges { flex: 1; display: flex; flex-wrap: wrap; gap: 0.3125rem; min-inline-size: 0; }
.badge {
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.badge-strong { border-color: var(--screen); background: var(--screen); color: var(--seat); }
.badge-cached { border-color: var(--glow); color: var(--glow); }
.badge-cached::before { content: "● "; }
.badge-uncached { border-style: dashed; color: var(--dim); }
.source-size { flex: none; font-weight: 650; }
.source-facts { font-size: 0.9375rem; overflow-wrap: anywhere; }
.source-file { color: var(--dim); font-size: 0.8125rem; overflow-wrap: anywhere; }
.source-picked { justify-self: start; color: var(--glow); font-size: 0.8125rem; font-weight: 700; }

/* --------------------------------------------------------------- settings -- */

.settings { display: grid; gap: 1.25rem; max-inline-size: 34rem; margin-block-end: 2.5rem; }
.settings-name { font-size: 1.3125rem; font-weight: 700; font-stretch: 75%; }
.settings-note { color: var(--dim); }
.setting { display: grid; gap: 0.375rem; }
.setting-name { font-weight: 650; }
.setting-help { color: var(--dim); font-size: 0.875rem; }
.signout { font-size: 0.875rem; }
/* The accounts the owner opened: a name, and what can be done with it. */
.accounts { display: grid; gap: 0.25rem; }
.account { display: grid; gap: 0.5rem; padding-block: 0.625rem; border-block-end: 1px solid var(--line); }
.account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.account-name { font-weight: 650; overflow-wrap: anywhere; }
.account-note { color: var(--dim); font-size: 0.875rem; font-weight: 400; }
.setting-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 1rem; }
.setting-form { display: grid; gap: 0.625rem; }
.setting-form[hidden] { display: none; }
.field {
  min-block-size: 2.5rem;
  inline-size: 100%;
  padding: 0.25rem 0.875rem;
  border: 1.5px solid var(--line);
  border-radius: 0.375rem;
  background: var(--seat);
}
.field:hover { border-color: var(--edge); }
.field::placeholder { color: var(--dim); opacity: 1; }

/* ----------------------------------------------------------------- login -- */

.login {
  max-inline-size: 24rem;
  margin-inline: auto;
  padding: max(var(--margin), 18vh) var(--margin) var(--margin);
}
.login .brand { display: block; margin-block-end: 2rem; font-size: 3.5rem; }
.login-label {
  display: block;
  margin-block-end: 0.5rem;
  padding-inline-start: 1.125rem;
  font-weight: 650;
}
.login .entry + .login-label { margin-block-start: 1.25rem; }
.login .feedback { padding-inline-start: 1.125rem; }

/* ---------------------------------------------------------------- player -- */
/* The film, and over it a shade at the top and one at the bottom with the
   controls, gone when nothing moves. */

.player {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: #000;
  color: #fff;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.player video {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  background: #000;
}
/* Subtitles: white on a soft dark band, readable over any picture. */
.player video::cue {
  background: rgb(0 0 0 / 0.66);
  color: #fff;
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 550;
  line-height: 1.35;
}

/* While it opens: the title's own picture, dimmed, behind the waiting. */
.player-backdrop {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  opacity: 0;
  filter: brightness(0.35);
  transition: opacity 600ms ease;
  pointer-events: none;
}
.player.opening .player-backdrop.loaded { opacity: 1; }

.player-top, .player-bottom {
  position: absolute;
  inset-inline: 0;
  transition: opacity 250ms ease;
}
.player-top {
  inset-block-start: 0;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) 3.5rem max(1rem, env(safe-area-inset-left));
  background: linear-gradient(rgb(0 0 0 / 0.75), rgb(0 0 0 / 0));
}
.player-bottom {
  inset-block-end: 0;
  padding: 5rem max(1.5rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  background: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.85));
}
.player.idle .player-top,
.player.idle .player-bottom { opacity: 0; pointer-events: none; }
.player.idle { cursor: none; }

.player-title {
  flex: 1;
  min-inline-size: 0;
  font-family: var(--display);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-episode { margin-inline-start: 0.625rem; color: rgb(255 255 255 / 0.66); font-weight: 600; }
.player-chip {
  flex: none;
  padding: 0.3125rem 0.75rem;
  border-radius: 0.25rem;
  background: rgb(255 255 255 / 0.1);
  color: rgb(255 255 255 / 0.7);
  font-size: 0.8125rem;
}
@media (max-width: 50rem) { .player-chip { display: none; } }

.round {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 3rem;
  block-size: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
}
.round svg { inline-size: 1.625rem; block-size: 1.625rem; fill: currentColor; }
.round text { fill: currentColor; font-family: inherit; }
.round:hover, .round:active, .round[aria-expanded="true"] { background: rgb(255 255 255 / 0.14); }
/* Play and pause: the one round light button. */
.round-play { inline-size: 3.75rem; block-size: 3.75rem; margin-inline-end: 0.375rem; background: var(--screen); color: var(--room); }
.round-play:hover, .round-play:active { background: #fff; }
.round-play svg { inline-size: 1.75rem; block-size: 1.75rem; }
.player :focus-visible { outline-color: var(--lamp); }

/* A button with words: the next episode, the sound and subtitles. */
.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-block-size: 3rem;
  max-inline-size: 22rem;
  padding: 0 1rem 0 0.75rem;
  border: 0;
  border-radius: 1.5rem;
  background: none;
  color: #fff;
  font-weight: 550;
  white-space: nowrap;
}
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill svg { flex: none; inline-size: 1.5rem; block-size: 1.5rem; fill: currentColor; }
.pill:hover, .pill[aria-expanded="true"] { background: rgb(255 255 255 / 0.14); }
.pill-display { font-family: var(--display); font-size: 1.25rem; font-weight: 800; letter-spacing: 0.02em; }

.controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-block-start: 0.375rem;
}
.controls-gap { flex: 1; }
.times {
  display: flex;
  justify-content: space-between;
  padding-inline: 0.125rem;
  color: rgb(255 255 255 / 0.7);
  font-size: 0.8125rem;
}
/* Volume: the speaker mutes, the slider adjusts. */
.volume { display: flex; align-items: center; }
.volume-slider {
  --v: 100%;                      /* filled fraction, kept up to date by the script */
  -webkit-appearance: none;
  appearance: none;
  inline-size: 6rem;
  block-size: 1.75rem;
  margin: 0 0.75rem 0 0.125rem;
  border-radius: 0.25rem;
  background: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-runnable-track {
  block-size: 0.25rem;
  border-radius: 1rem;
  background: linear-gradient(to right, var(--screen) var(--v), rgb(255 255 255 / 0.25) var(--v));
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  inline-size: 0.875rem;
  block-size: 0.875rem;
  margin-block-start: -0.3125rem;
  border: 0;
  border-radius: 50%;
  background: var(--screen);
}
.volume-slider::-moz-range-track { block-size: 0.25rem; border-radius: 1rem; background: rgb(255 255 255 / 0.25); }
.volume-slider::-moz-range-progress { block-size: 0.25rem; border-radius: 1rem; background: var(--screen); }
.volume-slider::-moz-range-thumb { inline-size: 0.875rem; block-size: 0.875rem; border: 0; border-radius: 50%; background: var(--screen); }
/* Phone held upright: no room for the slider, the words of the buttons, nor
   the two jump buttons; what remains is enough to watch. */
@media (max-width: 40rem) {
  .volume-slider { display: none; }
  .pill span { display: none; }
  .pill { padding-inline: 0.75rem; }
}
@media (max-width: 27rem) {
  #p-back, #p-forward { display: none; }
}

/* The time bar: what is ready to play, lighter; what was played, in the
   bulb colour. It thickens under the pointer. */
.bar {
  position: relative;
  block-size: 1.5rem;             /* touch target */
  cursor: pointer;
  touch-action: none;
  border-radius: 0.25rem;
}
.bar-track {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(50% - 0.125rem);
  block-size: 0.25rem;
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.18);
  overflow: hidden;
  transition: block-size 120ms ease, inset-block-start 120ms ease;
}
.bar:hover .bar-track, .bar:focus-visible .bar-track { inset-block-start: calc(50% - 0.21875rem); block-size: 0.4375rem; }
.bar-track span {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 0;
}
.bar-buffered { background: rgb(255 255 255 / 0.36); }
.bar-played { background: var(--lamp); }
.bar-thumb {
  position: absolute;
  inset-block-start: calc(50% - 0.5rem);
  inset-inline-start: 0;
  inline-size: 1rem;
  block-size: 1rem;
  margin-inline-start: -0.5rem;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 0 0.3rem rgb(255 200 97 / 0.25);
}

/* The time of the spot aimed at on the bar. */
.preview {
  position: absolute;
  inset-block-end: calc(100% + 0.25rem);
  inset-inline-start: 0;          /* positioned by the script, under the pointer */
  translate: -50% 0;
  pointer-events: none;
}
.preview-time {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background: var(--screen);
  color: var(--room);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

/* What is happening, in the middle: opening, loading, failing. */
.player-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.125rem;
  padding: 5rem 1.5rem;
  text-align: center;
  pointer-events: none;
}
.player-message p {
  max-inline-size: 30rem;
  color: rgb(255 255 255 / 0.8);
  font-weight: 500;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.8);
}
.player-message.error p { color: #fff; font-weight: 600; }
.player-logo { max-inline-size: min(24rem, 70vw); max-block-size: 8rem; object-fit: contain; margin-block-end: 0.5rem; filter: drop-shadow(0 0.125rem 0.75rem rgb(0 0 0 / 0.6)); }
/* The title's logo only while the film opens, not on a pause to load. */
.player:not(.opening) .player-logo { display: none; }
.player-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-block-start: 0.5rem; }
.player-choices:not(:has(.button:not([hidden]))) { display: none; }
.player-message .button { pointer-events: auto; }
.player-message.error .player-spinner { display: none; }

/* The bulbs, lighting one after the other. */
.player-spinner { display: flex; gap: 0.75rem; }
.player-spinner i { inline-size: 0.625rem; block-size: 0.625rem; border-radius: 50%; background: var(--lamp); opacity: 0.2; animation: bulb 1s infinite; }
.player-spinner i:nth-child(2) { animation-delay: 0.2s; }
.player-spinner i:nth-child(3) { animation-delay: 0.4s; }
.player-spinner i:nth-child(4) { animation-delay: 0.6s; }
.player-spinner i:nth-child(5) { animation-delay: 0.8s; }
@keyframes bulb { 20% { opacity: 1; box-shadow: 0 0 0.75rem var(--lamp); } 60% { opacity: 0.2; box-shadow: none; } }

/* The end of an episode: the next one, its picture, a countdown. */
.player-next {
  position: absolute;
  z-index: 2;
  inset-block-end: calc(9.5rem + env(safe-area-inset-bottom));
  inset-inline-end: max(1.5rem, env(safe-area-inset-right));
  inline-size: min(24rem, 100% - 2rem);
  border-radius: 0.625rem;
  overflow: hidden;
  background: var(--room);
  box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / 0.6);
}
.player-next-picture { position: relative; aspect-ratio: 16 / 9; background: var(--frame); }
.player-next-picture img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.player-next-count { position: absolute; inset-inline-start: 0; inset-block-end: 0; block-size: 0.25rem; inline-size: 0; background: var(--lamp); }
.player-next-count.running { animation: countdown linear forwards; }
@keyframes countdown { to { inline-size: 100%; } }
.player-next-text { padding: 0.875rem 1.125rem 1rem; }
.player-next-when { color: var(--dim); font-size: 0.875rem; }
.player-next-name { margin-block: 0.125rem 0.875rem; font-family: var(--display); font-size: 1.5rem; font-weight: 800; line-height: 1.1; white-space: pre-wrap; }
.player-next-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* The sound and the subtitles: one panel above the buttons, a column each,
   their timing and the change of source at the foot. */
.player-menu {
  position: absolute;
  inset-block-end: calc(8.75rem + env(safe-area-inset-bottom));
  inset-inline-end: max(1.5rem, env(safe-area-inset-right));
  z-index: 3;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  inline-size: min(38rem, 100% - 2rem);
  max-block-size: min(65dvh, 100% - 12rem);
  border-radius: 0.75rem;
  background: rgb(26 18 17 / 0.97);
  box-shadow: 0 1.25rem 3.5rem rgb(0 0 0 / 0.6);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.menu-columns { display: grid; grid-template-columns: 1fr 1fr; min-block-size: 0; }
.menu-column { min-block-size: 0; padding: 1rem 0.5rem 0.75rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.menu-column + .menu-column { border-inline-start: 1px solid var(--line); }
@media (max-width: 34rem) {
  .menu-columns { grid-template-columns: 1fr; overflow-y: auto; }
  .menu-column + .menu-column { border-inline-start: 0; border-block-start: 1px solid var(--line); }
}
.menu-name { padding: 0 0.75rem 0.5rem; font-family: var(--display); font-size: 1.375rem; font-weight: 800; }
.menu-option {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: #fff;
  text-align: start;
}
.menu-option:hover, .menu-option:focus-visible { background: rgb(255 255 255 / 0.08); }
.menu-mark { flex: none; inline-size: 1.25rem; block-size: 1.45rem; display: grid; place-items: center; color: var(--lamp); }
.menu-mark svg { inline-size: 1.125rem; block-size: 1.125rem; fill: currentColor; }
.menu-label { min-inline-size: 0; display: grid; font-weight: 550; overflow-wrap: anywhere; }
.menu-detail { color: rgb(255 255 255 / 0.55); font-size: 0.75rem; font-weight: 450; }
.menu-note { padding: 0.5rem 0.75rem; color: rgb(255 255 255 / 0.55); font-size: 0.8125rem; }
.menu-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem;
  border-block-start: 1px solid var(--line);
}
.menu-delay { display: flex; align-items: center; gap: 0.375rem; color: var(--dim); font-size: 0.875rem; }
.menu-delay > span:first-child { margin-inline-end: 0.375rem; }
.menu-delay-value { min-inline-size: 4.5rem; color: #fff; text-align: center; }
.menu-step {
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border: 0;
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}
.menu-step:hover { background: rgb(255 255 255 / 0.16); }
.menu-source { margin-inline-start: auto; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .player-spinner i, .player-next-count.running, .detail[open], .detail::backdrop, .marquee.chasing, .draw-reel.running, .draw[open], .card-waiting .card-frame, .card-drawn .card-frame { animation: none; }
  .poster, .feature-image, .episode-play, .player-top, .player-bottom, .wall .card-words, .grid .card-frame { transition: none; }
  .strip { scroll-behavior: auto; }
}
