/*
 * Movie Buddy styles. White on black, one red accent for the main action,
 * large type and matches. Colour otherwise comes from the film posters.
 *
 * Order: tokens, base, page frame, shared pieces, then one section per screen.
 */

:root {
  color-scheme: dark;

  /* Design tokens (from the landing page redesign) */
  --mb-ground: #000000;        /* page background */
  --mb-ground-raised: #17171A; /* top of page gradient, raised surfaces */
  --mb-tile-a: #1E1E22;        /* placeholder tile stripe */
  --mb-tile-b: #26262B;        /* placeholder tile stripe (matched tile) */
  --mb-line: #232327;          /* section dividers */
  --mb-line-strong: #38383F;   /* pill, tile and field borders */
  --mb-line-control: #55555E;  /* secondary button border */
  --mb-line-dashed: #6A6A75;   /* unknown-visitor icon border */
  --mb-text: #FFFFFF;          /* headings, primary text */
  --mb-text-soft: #C4C4CA;     /* body copy */
  --mb-text-muted: #ABABB3;    /* captions, footer, timestamps */
  --mb-accent: #E5182B;        /* red accent: fills, icons, large type only */
  --mb-on-accent: #FFFFFF;     /* text on accent fills */
  --mb-glow: rgba(229, 24, 43, 0.2);

  --mb-font-display: 'Bricolage Grotesque', 'Arial Narrow', Arial, sans-serif;
  --mb-font-body: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mb-h1: 800 clamp(46px, 7.4vw, 96px)/0.95 var(--mb-font-display);
  --mb-h1-tracking: -0.035em;
  --mb-h2: 700 22px/1.2 var(--mb-font-display);
  --mb-row-title: 700 20px/1.2 var(--mb-font-display);
  --mb-step-number: 800 40px/1 var(--mb-font-display);
  --mb-lede: 400 19px/1.55 var(--mb-font-body);
  --mb-body: 400 16px/1.55 var(--mb-font-body);
  --mb-button: 600 17px/1 var(--mb-font-body);
  --mb-label: 600 15px/1.3 var(--mb-font-body);
  --mb-caption: 400 14px/1.4 var(--mb-font-body);
  --mb-footer: 400 13px/1.5 var(--mb-font-body);

  --mb-max: 1240px;
  --mb-gutter: clamp(20px, 5vw, 72px);
  --mb-radius-pill: 999px;
  --mb-radius-tile: 8px;
  --mb-control-h: 56px;
  --mb-icon: 44px;             /* visitor icons, minimum touch target */

  --mb-fade-duration: 10s;     /* keep in step with FADE_MS in app.js */
  --mb-fade-stagger: 0.9s;     /* keep in step with FADE_STAGGER_MS */

  /* The names the rest of this file uses, mapped onto the tokens. */
  --ink: var(--mb-text);
  --muted: var(--mb-text-muted);
  --soft: var(--mb-text-soft);
  --line: var(--mb-line);
  --line-strong: var(--mb-line-strong);
  --fill: var(--mb-ground-raised);
  --paper: var(--mb-ground);
  --accent: var(--mb-accent);
  --on-accent: var(--mb-on-accent);
  --danger: #FF8A8A;           /* error text: a light red that reads on black */
  --radius: 12px;
  --pill: var(--mb-radius-pill);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: var(--mb-body);
  background:
    radial-gradient(1100px 620px at 80% -10%, var(--mb-glow), transparent 62%),
    linear-gradient(180deg, var(--mb-ground-raised) 0, var(--mb-ground) 520px);
  background-color: var(--mb-ground);
  /* Drawn once at the top. Repeating, it started again every screen-height
     down the page, as a red band behind the lower sections. */
  background-repeat: no-repeat;
}

h1, h2 { font-family: var(--mb-font-display); }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
h1:focus { outline: none; }

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

.wrap {
  width: 100%;
  max-width: var(--mb-max);
  margin: 0 auto;
  padding-inline: var(--mb-gutter);
}

.site-header {
  width: 100%;
  max-width: var(--mb-max);
  margin: 0 auto;
  padding: 24px var(--mb-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-actions { display: flex; align-items: center; gap: 20px; }

.brand,
.link-button {
  min-height: 44px;
  padding: 10px 0;
  background: none;
  border: 0;
}

.brand { font: 800 22px/1 var(--mb-font-display); letter-spacing: -0.01em; }
.link-button { font-size: 15px; color: var(--muted); }

/* Rounds left: a pill with a small red dot. */
.meter {
  min-height: 44px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
}

.meter::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.mode-note {
  margin: 0;
  padding: 8px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: var(--fill);
}

.app {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-footer { border-top: 1px solid var(--line); }

.site-footer .wrap {
  padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  font: var(--mb-footer);
  color: var(--muted);
}

/* ---------- Shared pieces ---------- */

.screen {
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.screen--medium { max-width: 560px; }
.screen--wide { max-width: 680px; }
.screen--deck { max-width: 700px; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { min-height: 20px; color: var(--danger); }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.title--small { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.button {
  min-height: 48px;
  padding: 13px 26px;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--mb-line-control);
  border-radius: var(--pill);
}

.button--primary {
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.button[aria-pressed="true"] { background: var(--fill); border-color: var(--ink); }

.notice {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.text-input,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.text-input { min-height: 52px; }
textarea { font-size: 16px; resize: vertical; }

/* A plain titled block where a poster would be. */
.poster-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  aspect-ratio: 2 / 3;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--fill);
}

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

.home {
  padding-block: 48px 72px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.pitch { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }

.pitch h1 {
  margin: 0;
  font: var(--mb-h1);
  letter-spacing: var(--mb-h1-tracking);
  text-wrap: balance;
}

.pitch h1 { font-size: clamp(32px, 6.2vw, 84px); }
.pitch h1 em { display: block; font-style: normal; color: var(--accent); }

.lede { margin: 0; max-width: 34em; font: var(--mb-lede); color: var(--soft); text-wrap: pretty; }

/* The home page sections: find, can't decide, your services. */
.pitch-head { display: flex; flex-direction: column; gap: 14px; }
.home-part { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.home-head { margin: 0; font: var(--mb-h2); font-size: 24px; letter-spacing: -0.01em; }
.home-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.home-edit { min-height: 0; padding: 0; font-size: 17px; color: var(--accent); }
.home-rule { width: 100%; max-width: 760px; margin: 0; border: 0; border-top: 1px solid var(--line); }
.home-services { margin: 0; padding: 0; list-style: none; gap: 10px; }
.chip--mine { cursor: default; }
.home-note, .home-none, .home-caption { margin: 0; }
.home-caption .link-button { min-height: 0; padding: 0; font: inherit; color: var(--soft); text-decoration: underline; }

.surprise {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--fill);
  border: 1px solid rgba(229, 24, 43, 0.35);
  border-radius: 22px;
}
.surprise-title { margin: 0; display: flex; align-items: center; gap: 12px; font: 800 28px/1.1 var(--mb-font-display); letter-spacing: -0.02em; }
.surprise-icon { flex: none; color: var(--accent); }
.surprise-text { margin: 0; font: var(--mb-lede); color: var(--soft); }
.surprise-go { justify-content: center; text-align: center; width: 100%; min-height: 60px; font: var(--mb-button); font-size: 19px; border-radius: 16px; }
.surprise-more { margin: 0; text-align: center; }
.surprise-link { min-height: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; }

/* Who has used the site: a live count that stays, and the newest visitors,
   who appear, flash, and then leave entirely. */
.mb-visitors {
  width: 100%;
  max-width: 560px;
  margin-top: 12px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.mb-who { display: flex; align-items: center; gap: 14px; min-height: var(--mb-icon); }

/* The live count: a blinking red dot and the number, like a live viewer count. */
.mb-live {
  flex: none;
  min-height: var(--mb-icon);
  padding: 0 16px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 18px/1 var(--mb-font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
}

.mb-live__dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(229, 24, 43, 0.8);
  animation: mb-blink 1.4s ease-in-out infinite;
}

@keyframes mb-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; box-shadow: none; }
}

.mb-who__icon {
  position: relative;
  flex: none;
  width: var(--mb-icon);
  height: var(--mb-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.mb-who__icon--person { color: var(--on-accent); background: var(--accent); font: 800 18px/1 var(--mb-font-display); }
.mb-who__icon--unknown { color: var(--soft); border: 1px dashed var(--mb-line-dashed); }

/* As a visitor appears their icon flashes twice: a quick brighten and a red
   ring that spreads out. app.js sets --flash-delay to line up with the row. */
.mb-flash { animation: mb-flash-icon 1.2s ease-out 2; animation-delay: var(--flash-delay, 0ms); }

.mb-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  animation: mb-flash-ring 1.2s ease-out 2;
  animation-delay: var(--flash-delay, 0ms);
}

@keyframes mb-flash-icon {
  0%, 100% { transform: none; filter: none; }
  18% { transform: scale(1.1); filter: brightness(1.5); }
}

@keyframes mb-flash-ring {
  0% { box-shadow: 0 0 0 0 rgba(229, 24, 43, 0.75); }
  100% { box-shadow: 0 0 0 16px rgba(229, 24, 43, 0); }
}

.mb-who__text { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mb-who__label { font-size: 15px; color: var(--soft); }
.mb-who__name { font: var(--mb-label); }
.mb-who__place { display: inline-flex; align-items: center; gap: 6px; font: var(--mb-caption); color: var(--soft); }
.mb-who__time { font: var(--mb-caption); color: var(--muted); }

/* The text beside the count: appears, holds, then blurs and drifts away. */
@keyframes mb-fade {
  0%   { opacity: 0; filter: blur(6px); transform: translateX(-8px); }
  8%   { opacity: 1; filter: blur(0);   transform: translateX(0); }
  38%  { opacity: 1; filter: blur(0);   transform: translateX(0); }
  88%  { opacity: 0; filter: blur(5px); transform: translateX(10px); }
  100% { opacity: 0; filter: blur(5px); transform: translateX(10px); }
}

/* A visitor row, icon and all: the same fade, then the row closes up. */
@keyframes mb-leave {
  0%   { opacity: 0; filter: blur(6px); transform: translateX(-8px); max-height: var(--mb-icon); margin-top: 14px; }
  8%   { opacity: 1; filter: blur(0);   transform: translateX(0);    max-height: var(--mb-icon); margin-top: 14px; }
  38%  { opacity: 1; filter: blur(0);   transform: translateX(0);    max-height: var(--mb-icon); margin-top: 14px; }
  80%  { opacity: 0; filter: blur(5px); transform: translateX(10px); max-height: var(--mb-icon); margin-top: 14px; }
  100% { opacity: 0; filter: blur(5px); transform: translateX(10px); max-height: 0;              margin-top: 0; }
}

/* Each plays once. app.js sets the delay so rows start 0.9s apart and a
   re-render continues where it was rather than restarting. */
.mb-fade { animation: mb-fade var(--mb-fade-duration) ease-in-out both; }
/* No minimum height, so a row that has left can close up to nothing. */
.mb-who--visitor { min-height: 0; margin-top: 14px; }
.mb-leave { animation: mb-leave var(--mb-fade-duration) ease-in-out both; pointer-events: none; }

/* Finished: the count's text is hidden and the visitor rows are gone. */
.mb-fade--rest { animation: none; opacity: 0; }
.mb-leave--rest { display: none; }

/* Hovering or focusing the count brings everything back. */
.mb-visitors:hover .mb-fade,
.mb-visitors:focus-within .mb-fade,
.mb-visitors:hover .mb-who--visitor,
.mb-visitors:focus-within .mb-who--visitor {
  display: flex;
  animation: none;
  opacity: 1;
  filter: none;
  transform: none;
  max-height: none;
  margin-top: 14px;
}

.mb-visitors:hover .mb-fade,
.mb-visitors:focus-within .mb-fade { margin-top: 0; }

/* Popular right now: TMDB's popular films. */
.picks { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.picks h2 { margin: 0; font: var(--mb-row-title); letter-spacing: -0.01em; }
.rail { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }

.tile {
  flex: 1 0 200px;
  height: 220px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--soft);
  background: repeating-linear-gradient(135deg, var(--mb-ground-raised) 0 14px, var(--mb-tile-a) 14px 28px);
  border: 1px solid var(--line-strong);
  border-radius: var(--mb-radius-tile);
}


/* A tile showing a popular film: the still fills it, the title sits on a
   dark fade at the bottom. */
.tile--film { position: relative; overflow: hidden; color: var(--ink); background: var(--fill); }

.tile--film img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile--film::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.85));
}

.tile-title { position: relative; z-index: 1; }

.tile-title { font: var(--mb-label); letter-spacing: 0; }

/* Film details over the still, on hover, keyboard focus or a tap. The
   invisible button covers the tile; the panel sits above it but lets clicks
   through, except on its trailer link. */
.tile-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: inherit;
}

.tile-hit:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }

.tile-details {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  color: var(--ink);
  letter-spacing: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.tile--has-details:hover .tile-details,
.tile--has-details:focus-within .tile-details,
.tile--has-details.is-open .tile-details {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tile-details__title { font: 700 18px/1.2 var(--mb-font-display); letter-spacing: -0.01em; }
.tile-details__meta { font: var(--mb-caption); color: var(--soft); }

.tile-details__about {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-details__watch { font: var(--mb-label); font-size: 14px; }

.tile-details__link {
  align-self: flex-start;
  pointer-events: auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}


/* Pick your own: one giant button, then the two ways to start. */
.steps { border-top: 1px solid var(--line); }

.steps-grid {
  padding-block: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 40px;
}

.step { display: flex; flex-direction: column; gap: 10px; }
.step b { font: var(--mb-step-number); color: var(--accent); }
.step h2 { margin: 0; font: var(--mb-h2); letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--soft); }

/* ---------- Questions ---------- */

.options { display: flex; flex-direction: column; gap: 10px; }
.options--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

.option {
  min-height: 56px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-weight: 500;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.option[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.option-logo { flex: none; width: 32px; height: 32px; object-fit: cover; border-radius: 8px; }

.check { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }

/* Genres: pick up to three. */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 500;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
}

.chip { display: inline-flex; align-items: center; gap: 8px; }
/* Picked: accent border, tinted fill and (Just me) a check. Not solid red,
   so the label stays white on dark. */
.chip[aria-pressed="true"] { padding: 9px 17px; color: var(--ink); background: rgba(229, 24, 43, 0.18); border: 2px solid var(--accent); }
.chip:disabled { cursor: not-allowed; opacity: 0.4; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------- Just me: rate films ---------- */

.screen--rate { max-width: 792px; }
.step-count { font-variant-numeric: tabular-nums; }

.button--ghost { color: var(--ink); background: transparent; border-color: var(--mb-line-control); }
.button--quiet { color: var(--ink); background: var(--mb-tile-b); border-color: var(--mb-tile-b); }
.button--sm { min-height: 46px; padding: 10px 20px; font-size: 15px; }
.button svg { flex: none; }

/* One group per genre, three segments each. Liked and not-for-me differ in
   lightness as well as colour. */
.rate-progress { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; }
.progress-group { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.progress-group.is-now { color: var(--ink); }
.segs { display: flex; gap: 6px; }
.seg { width: 56px; height: 8px; border-radius: var(--pill); background: #2B2B31; }
.seg--like { background: var(--accent); }
.seg--dislike { background: #8A8A94; }
.seg--now { background: transparent; border: 2px solid var(--ink); }
.progress-count { margin-left: auto; font-variant-numeric: tabular-nums; }

.film {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 24px;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}
.film--status { flex-direction: column; align-items: flex-start; gap: 16px; min-height: 200px; justify-content: center; }
.film--status p { margin: 0; }
.film-poster { flex: 0 0 200px; width: 200px; height: 300px; object-fit: cover; border-radius: 8px; background: var(--mb-tile-a); }
.film-body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.film-body h2 { margin: 0; font: 800 32px/1.05 var(--mb-font-display); letter-spacing: -0.02em; }
.tag { align-self: flex-start; padding: 5px 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--mb-line-control); border-radius: var(--pill); }
.film-overview {
  margin: 0;
  color: var(--soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rate-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 16px; }
.rate-actions .button { flex: 1 1 130px; justify-content: center; gap: 8px; padding: 13px 16px; white-space: nowrap; }

/* ---------- Just me: results ---------- */

.screen--results { max-width: var(--mb-max); padding-inline: var(--mb-gutter); }
.title em { font-style: normal; color: var(--accent); }
.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.rec { display: flex; flex-direction: column; overflow: hidden; background: var(--fill); border: 1px solid var(--line-strong); border-radius: 12px; }
.rec-art { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--mb-tile-a); }
.rec-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; }
.rec-body h2 { margin: 0; font: 700 24px/1.1 var(--mb-font-display); letter-spacing: -0.01em; }
.why { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 15px; line-height: 1.45; }
.why svg { flex: none; margin-top: 1px; color: var(--accent); }
.rec-note { margin: 0; }
/* How a film feels, from Muse Ember's tags: "Tense · twisty · dark". */
.tones { color: var(--soft); letter-spacing: 0.01em; }
.rec-body .tones { margin-top: -6px; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 10px; }

/* ---------- Group: who is here ---------- */

.members { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 16px; }

.member {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.member:first-child { border-top: 0; }

.share-box {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.share-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

/* ---------- Waiting for the agent ---------- */

.reel {
  width: 100%;
  margin-bottom: 16px;
  overflow: hidden;
  /* Fade the strip out at both edges. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.reel-track {
  width: max-content;
  display: flex;
  gap: 16px;
  padding-right: 16px;
  animation: reel 70s linear infinite;
}

.reel img {
  width: clamp(120px, 14vw, 180px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--fill);
  border-radius: var(--radius);
}

/* The track holds the posters twice; sliding by half lands on an identical frame. */
@keyframes reel { to { transform: translateX(-50%); } }

/* ---------- Swipe cards ---------- */

.card {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.card:active { cursor: grabbing; }

.card > img,
.card > .poster-blank {
  flex: 1 1 240px;
  width: 240px;
  max-width: 100%;
  pointer-events: none;
}

.card > img { display: block; aspect-ratio: 2 / 3; object-fit: cover; background: var(--fill); }

.card-body {
  flex: 1 1 280px;
  min-width: 0;
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-body h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; }

/* Why this pick / Where to watch / Where this came from */
.detail {
  margin-top: 10px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
}

.detail p { margin: 0; font-size: 16px; }

.deck-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.round {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--mb-line-control);
  border-radius: 50%;
}

.round--yes { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

.progress { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; background: var(--line-strong); border-radius: 50%; }
.dot--on { background: var(--accent); }

/* What this round cost in Muse Ember. */
.cost { margin: 0; text-align: center; }

/* ---------- Results ---------- */

/* Someone is waiting for the next round: a note, or for the host a prompt. */
.next-round {
  margin: 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--soft);
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.next-round--host {
  flex-direction: column;
  align-items: flex-start;
  border-color: var(--accent);
}

.next-round--host p { margin: 0; }
.next-round p { margin: 0; }
.next-round--ask { flex-direction: column; align-items: flex-start; }
.next-round--ask p { display: flex; align-items: baseline; gap: 12px; }
.next-round--host strong { color: var(--ink); }

.pick {
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.pick > img,
.pick > .poster-blank { width: 72px; border-radius: 8px; font-size: 11px; padding: 4px; }
.pick > img { aspect-ratio: 2 / 3; object-fit: cover; background: var(--fill); }

.pick-body { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pick-title { font-size: 18px; font-weight: 600; }
.pick .button { min-height: 46px; padding: 11px 20px; font-size: 15px; }

/* ---------- Tonight ---------- */

.tonight {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.tonight-poster { flex: 0 1 260px; min-width: 0; }
.tonight-poster img,
.tonight-poster .poster-blank { display: flex; width: 100%; border-radius: 16px; }
.tonight-poster img { display: block; aspect-ratio: 2 / 3; object-fit: cover; background: var(--fill); }

.tonight-body { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tonight-body p { margin: 0; }
.tonight-body .row { padding-top: 14px; }

/* ---------- Find a film: the search box, the mic, the results ---------- */

/* The search box: a roomy field with the mic and Find inside its corner. */
.find-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 12px 18px;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  transition: border-color 0.15s;
}
.find-box:focus-within { border-color: var(--mb-line-control, var(--ink)); }
.find-note { margin: 6px 2px 0; }
.find-input {
  width: 100%;
  min-height: 56px;
  padding: 0;
  font: 400 19px/1.4 var(--mb-font-body);
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
}
.find-input::placeholder { color: var(--muted); }
.find-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.find-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: var(--mb-on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 14px;
}
.find-go svg { width: 22px; height: 22px; }
.find-go:disabled { opacity: 0.5; }
.find-kids { align-items: center; }
.find-kids input { margin: 0; }

.find { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.find-mic {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 14px;
}
.find-mic:hover { background: var(--mb-line); }
.find-mic.is-listening {
  color: var(--mb-on-accent);
  background: var(--accent);
  border-color: var(--accent);
  animation: mb-listen 1.2s ease-in-out infinite;
}
@keyframes mb-listen { 50% { box-shadow: 0 0 0 6px var(--mb-glow); } }
.find-status { margin: 0; min-height: 20px; color: var(--soft); }
.find-listen {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  background: var(--fill);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.find-listen[hidden] { display: none; }
.find-listen-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.02em; }
.find-listen-tag { margin-left: auto; }
.find-listen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: mb-blink 1s steps(2, start) infinite; }
@keyframes mb-blink { to { visibility: hidden; } }
.find-scope { display: block; width: 100%; height: 104px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.find-step { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.35; }
.find-listen .find-link { align-self: flex-start; }
.find-status:empty { display: none; }
.find-link { min-height: 0; padding: 0; font: inherit; color: var(--soft); text-decoration: underline; }
.find-privacy { margin: 0; }
.find-page { gap: 20px; }
.find-head { margin: 12px 0 0; font: var(--mb-row-title); }
.find-busy { display: flex; flex-direction: column; gap: 12px; }
.find-where { margin: 0; font-size: 15px; }
.find-card--yours { border-color: var(--mb-line-control); }

@media (prefers-reduced-motion: reduce) {
  .find-mic.is-listening { animation: none; }
  .find-listen-dot { animation: none; }
}

/* ---------- Usage ---------- */

.bar { height: 8px; overflow: hidden; background: var(--fill); border-radius: 4px; }
.bar span { display: block; height: 100%; background: var(--accent); }

/* ---------- Small screens and reduced motion ---------- */

@media (max-width: 480px) {
  .site-header { padding-block: 16px; }
  .home { padding-block: 32px 56px; gap: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none !important; }
  .reel-track { animation: none; }
  /* No fade: the visitor details stay visible. */
  .mb-fade,
  .mb-fade--rest,
  .mb-leave,
  .mb-leave--rest { display: flex; animation: none; opacity: 1; filter: none; transform: none; }
  .mb-flash,
  .mb-flash::after,
  .mb-live__dot { animation: none; }
  .tile-details { transition: none; }
}

/* ---------- How's this pick? (Just me results) ---------- */

.pick-rate { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pick-rate__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip--sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.chip--sm[aria-pressed="true"] { padding: 5px 13px; }
.pick-rate__note { margin: 0; color: var(--ink); }

/* ---------- Data for Nerds (footer, every page) ---------- */

.site-footer .nerds.wrap { display: block; padding-block: 22px 0; font: var(--mb-footer); color: var(--muted); }
.nerds__title { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.nerds__grid { margin: 0; display: grid; gap: 6px; }
.nerds__row { display: grid; grid-template-columns: 150px 1fr; gap: 2px 16px; }
.nerds__row dt { color: var(--ink); font-weight: 600; }
.nerds__row dd { margin: 0; font-variant-numeric: tabular-nums; }
.nerds__row--head { margin-top: 6px; }
.nerds__note { opacity: 0.75; }
.nerds__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: help;
}

@media (max-width: 560px) {
  .nerds__row { grid-template-columns: 1fr; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Phones: the brand already goes home, so "Start over" gives its room to the rounds left. */
@media (max-width: 480px) {
  #start-over { display: none; }
}

/* ---------- Where to watch: a row of app icons ---------- */

.watch-apps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 12px 14px; }
.watch-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 52px;
  color: var(--muted);
  text-decoration: none;
}
.watch-app__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  font: 700 18px/1 var(--mb-font-display);
  color: var(--ink);
  background: var(--mb-ground-raised, #1c1c22);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}
.watch-app__icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.watch-app__kind { font-size: 12px; line-height: 1.2; white-space: nowrap; }
.watch-app--yours .watch-app__icon { border: 2px solid var(--accent); box-shadow: 0 0 0 3px rgba(229, 24, 43, 0.25); }
.watch-app--yours .watch-app__kind { color: var(--ink); font-weight: 600; }
a.watch-app:hover .watch-app__icon { transform: translateY(-1px); }
a.watch-app:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.watch-apps--compact { gap: 8px; margin-top: 6px; }
.watch-apps--compact .watch-app { min-width: 0; }
.watch-apps--compact .watch-app__icon { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.watch-apps--compact .watch-app--yours .watch-app__icon { box-shadow: none; }

/* Too few words to search: ask for more. */
.find-more { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--fill); border: 1px solid var(--line-strong); border-radius: 18px; }
.find-more p { margin: 0; }
.find-more__title { font: var(--mb-row-title); }

/* Find a film: "Is this the one?" and searching again. */
.find-check { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.find-check__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.find-thanks { display: flex; align-items: center; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--soft); }
.find-thanks svg { color: var(--accent); }
.find-thanks:focus { outline: none; }
.find-again { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px; background: var(--fill); border: 1px solid var(--line-strong); border-radius: 18px; }
.find-again p { margin: 0; }
.find-again--missed { border-color: rgba(229, 24, 43, 0.45); }
.find-again .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding-inline: 16px; white-space: nowrap; }

/* "What should we call you?": the pop-up asked once per device. */
.intro {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--mb-ground-raised, #16161b);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.intro::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.intro-form { display: flex; flex-direction: column; gap: 12px; padding: 26px 24px 22px; }
.intro-title { margin: 0; font: 800 28px/1.1 var(--mb-font-display); letter-spacing: -0.02em; }
.intro-lede { margin: 0 0 6px; }
.intro-form .check { margin-top: 4px; }
.intro-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.intro-actions .button { width: 100%; justify-content: center; min-height: 54px; }
.intro-anon { background: transparent; }
.intro-note { margin: 2px 0 0; text-align: center; }
/* No <dialog> support: the same box, fixed over a dark page. */
.intro--plain { z-index: 1000; display: block; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.7), 0 30px 80px rgba(0, 0, 0, 0.6); }
