:root {
  /* Absolute Cinema: the logo's ink, paper and "pick" blue. Blue is for
     everything you can touch; gold, silver and bronze keep meaning #1-#3. */
  --bg: #10141b; /* ink */
  --panel: #181d27;
  --panel-2: #202632;
  --line: #2a313e;
  --line-strong: #3d4657;
  --text: #f9fafc; /* paper */
  --muted: #a3acbb;

  --pick: #2e5bda; /* the logo's blue: wordmark and filled buttons */
  --accent: #6a91f6; /* the same blue, light enough to read on ink */
  --accent-2: #3a67e3;
  --accent-grad: linear-gradient(135deg, var(--pick), var(--accent-2));
  --accent-ink: #ffffff;
  --accent-soft: rgba(46, 91, 218, 0.18);
  --accent-line: rgba(106, 145, 246, 0.75);
  --accent-glow: rgba(46, 91, 218, 0.38);
  --label: #8eaaf5;

  --gold: #ffd04d;
  --silver: #dfe3f6;
  --bronze: #eba26b;
  --star-off: #4f5869; /* unfilled stars: dim, but still visible as tap targets */
  --tmdb: #90cea1; /* TMDB's green, for its scores */
  --tmdb-soft: rgba(144, 206, 161, 0.14);

  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, 0.16);
  --danger-text: #ffb9c6;

  --header-bg: rgba(16, 20, 27, 0.82);
  --scrim: rgba(8, 10, 14, 0.74);
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-deep: rgba(0, 0, 0, 0.68);

  --glow-1: rgba(46, 91, 218, 0.30);
  --glow-2: rgba(46, 91, 218, 0.14);
  --glow-3: rgba(140, 160, 190, 0.10);
  --card: rgba(24, 29, 39, 0.86); /* movie rows: lets the glow show through */

  /* Google's sign-in button guidelines: white button, dark text */
  --google-bg: #ffffff;
  --google-ink: #1f1f1f;
  --google-line: #dadce0;

  /* Geist, the wordmark's font. Headings and big numbers: bold, set tight. */
  --font: Geist, system-ui, sans-serif;
  --display: Geist, system-ui, sans-serif;

  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
}

/* A slow-drifting aurora behind everything (color only; still when reduced motion is on) */
body::before {
  content: "";
  position: fixed;
  inset: -10vmax; /* a little overscan so the drift never shows an edge */
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 25% 20%, var(--glow-1), transparent 70%),
    radial-gradient(34vmax 28vmax at 80% 38%, var(--glow-2), transparent 70%),
    radial-gradient(40vmax 32vmax at 40% 85%, var(--glow-3), transparent 70%);
  animation: aurora 38s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3vmax, 2vmax, 0) rotate(6deg) scale(1.06); }
  100% { transform: translate3d(-2vmax, 4vmax, 0) rotate(-5deg) scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
/* iOS zooms into any text box under 16px when you tap it */
input, textarea, select { font-size: 16px; }

/* Like an app on phones: a double tap doesn't zoom (pinching still does), and
   holding a finger down doesn't select text or pop up the copy menu. Text
   boxes can still be selected, so typing and pasting work as usual. */
html { touch-action: manipulation; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 16px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

/* The logo beside both lines, the wordmark and the stats under it, centred on
   the pair. --brand-size is the wordmark's size; the logo scales with it. */
.brand { --brand-size: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: calc(var(--brand-size) * 0.45); }
.brand h1 {
  grid-column: 2;
  align-self: end;
  margin: 0;
  font-family: var(--display);
  font-weight: 650;
  font-size: var(--brand-size);
  letter-spacing: -0.035em;
  line-height: 1;
  white-space: nowrap;
}
.brand-mark { grid-row: 1 / span 2; width: auto; height: calc(var(--brand-size) * 1.75); }
.brand-my { color: var(--pick); font-weight: 400; }
.stats { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.brand .stats { grid-column: 2; align-self: start; margin-top: 3px; }
.brand .stats:empty { display: none; }
.brand .stats span { white-space: nowrap; }
.brand:has(.stats:empty) .brand-mark { height: calc(var(--brand-size) * 1.3); }

.search { position: relative; max-width: 560px; width: 100%; justify-self: end; }
.search input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* under 16px, iOS zooms in when you tap the box */
  outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px var(--shadow);
  max-height: 70vh;
  overflow: auto;
}
.results li { display: flex; align-items: center; gap: 6px; }
.results li button[data-i] {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
}
.results li button[data-i]:hover, .results li button[data-i].active { background: var(--panel-2); }
.results .r-rerank {
  flex: none;
  margin-right: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.results .r-rerank:hover { background: var(--accent-soft); }
.results img, .results .noimg { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; background: var(--panel-2); }
.results .r-title { font-weight: 600; }
.results .r-sub { color: var(--muted); font-size: 12px; }
.results .tag { font-size: 12px; color: var(--muted); }
.results .tag.in { color: var(--accent); }
.results .hint { padding: 10px; color: var(--muted); font-size: 13px; }

.btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 600;
  white-space: nowrap;
}
/* buttons that are links look the same as real buttons */
a.btn { color: var(--text); text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent-grad); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: none; }

.banner {
  margin: 16px auto 0;
  width: calc(100% - 2 * clamp(16px, 4vw, 40px));
  max-width: 980px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.banner.error { border-color: var(--danger); color: var(--danger-text); }

/* ---------- list ---------- */

main { padding: 24px clamp(16px, 4vw, 40px) calc(110px + env(safe-area-inset-bottom)); }

.empty { max-width: 520px; margin: 10vh auto; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-family: var(--display); letter-spacing: -0.03em; font-weight: 700; font-size: 30px; margin: 0 0 8px; }

.list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 980px;
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 64px 74px 1fr auto;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  gap: 18px;
  align-items: center;
  padding: 10px 14px 10px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: grab;
  transition: border-color 0.15s, transform 0.15s;
}
.row:hover { border-color: var(--line-strong); }
.row { cursor: pointer; }

/* --- dragging --- */

/* the row you pressed: lifts slightly while the hold timer runs */
.row.picked { border-color: var(--accent); }

/* the empty slot left in the list: shows only the rank it will land on */
.row.drop-slot {
  background: var(--accent-soft);
  border: 2px dashed var(--accent-line);
  box-shadow: none;
}
.row.drop-slot > :not(.rank) { visibility: hidden; }
.row.drop-slot .rank { color: var(--accent); }

/* the card that follows your finger / cursor */
.row.drag-card {
  opacity: 1 !important;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  box-shadow: 0 24px 48px var(--shadow-deep), 0 0 0 4px var(--accent-soft);
  cursor: grabbing;
  z-index: 1000;
}
.row.drag-card .controls, .row.drag-card .grip, .row.drag-card .rank { visibility: hidden; }

body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
body.is-dragging .row:not(.drag-card):hover { border-color: var(--line); }
body.is-dragging .results { display: none; }
.row img { -webkit-user-drag: none; pointer-events: none; }

/* grip dots on the left edge: shows the row can be dragged */
.grip {
  position: absolute;
  left: 6px;
  top: 50%;
  translate: 0 -50%;
  width: 6px;
  height: 22px;
  background-image: radial-gradient(circle, var(--muted) 1.2px, transparent 1.6px);
  background-size: 6px 6px;
  opacity: 0.45;
}
.row:hover .grip { opacity: 0.9; }
.row.flash, .f-list .f-row.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); } }

.rank {
  font-family: var(--display); letter-spacing: -0.03em; font-weight: 700;
  font-size: 33px;
  line-height: 1;
  text-align: center;
  color: var(--muted);
}
.rank.gold { color: var(--gold); font-size: 56px; }
.rank.silver { color: var(--silver); font-size: 52px; }
.rank.bronze { color: var(--bronze); font-size: 50px; }

.poster {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  border: 0;
  padding: 0;
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .noimg, .noimg {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  color: var(--muted);
}

.info { min-width: 0; }
.title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.title:hover { color: var(--accent); }
.year { color: var(--muted); font-weight: 500; }
.meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--muted);
  text-decoration: none;
}
.pill.first { background: var(--gold); color: var(--accent-ink); }
.row-glow, .w-glow { display: none; }
.pill.mine { color: var(--text); }
.pill.mine b { color: var(--gold); }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lock input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.lock input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lock-error { margin: 8px 0 0; color: var(--danger-text); font-size: 13px; overflow-wrap: anywhere; }

.controls { display: flex; flex-direction: column; gap: 4px; }
.icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 15px;
}
.icon:hover { background: var(--panel-2); color: var(--text); }
.icon:disabled { opacity: 0.25; pointer-events: none; }

/* ---------- modals ---------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
}
.modal::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.modal h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 25px; letter-spacing: -0.03em; line-height: 1.05; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; color: var(--label); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.muted { color: var(--muted); font-size: 13px; }

.duel { width: min(640px, calc(100vw - 32px)); text-align: center; }
.duel h2:focus { outline: none; }
/* both cards as tall as the taller one, poster at the top, so a long title doesn't make them uneven */
.duel-cards { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.duel-cards .vs { align-self: center; }
.vs { font-family: var(--display); letter-spacing: -0.03em; font-weight: 700; font-size: 21px; color: var(--muted); }
.duel-card {
  padding: 12px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--panel-2);
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}
.duel-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.duel-card .img { flex: none; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--bg); margin-bottom: 10px; }
.duel-card img { width: 100%; height: 100%; object-fit: cover; }
.duel-card strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; overflow-wrap: break-word; }
.duel-card span { color: var(--muted); font-size: 13px; }
.duel-card .nowrap { white-space: nowrap; }
@media (max-width: 760px) {
  .duel-cards { gap: 10px; }
  .duel-card { padding: 10px; }
  .duel-card strong { font-size: 15px; line-height: 1.3; }
}
.duel-progress { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.duel-tie { margin-top: 14px; }
.duel-meter { height: 4px; max-width: 320px; margin: 8px auto 0; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.duel-meter span { display: block; height: 100%; width: 0; background: var(--accent-grad); transition: width 0.25s; }
.duel-rate { display: grid; justify-items: center; gap: 12px; margin-top: 4px; }
.duel-rate p { margin: 0; }
.duel-stars button { font-size: 28px; }
.duel-stars button:hover, .duel-stars button:hover ~ button { color: var(--star-off); }
.duel-stars:hover button { color: var(--gold); }

.details { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
.details[open] { display: flex; flex-direction: column; }
/* sized by its content and shrinking to scroll when the card is full ("flex: 1"
   alone made it zero high in Safari and the iPhone app: the card was only its buttons) */
.d-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.d-close { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%; background: rgba(16, 20, 27, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.d-close:hover { background: rgba(16, 20, 27, 0.9); border-color: var(--accent-line); }
/* the movie grows out of the list into its full card */
.details[open] { animation: d-expand 0.24s cubic-bezier(0.2, 0, 0, 1); }
.details[open]::backdrop { animation: d-fade 0.24s ease-out; }
@keyframes d-expand { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
@keyframes d-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .details[open], .details[open]::backdrop { animation: none; } }
/* the card: a header with the whole poster over a blurred copy of itself, the
   details under it (they scroll), and the buttons in a bar that's always there */
.d-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: end; padding: 28px 64px 22px 28px; }
.d-hero::before { content: ""; position: absolute; inset: -60px; z-index: -1; background: var(--poster, none) center / cover; filter: blur(40px) saturate(1.3); opacity: 0.5; }
.d-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, transparent 30%, var(--panel)); }
.d-poster { aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--panel-2) var(--poster, none) center / cover; box-shadow: 0 18px 40px var(--shadow-deep); }
.d-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.d-poster .noimg { font-size: 40px; }
.d-head { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.d-head .eyebrow { margin: 0; }
.modal .d-head h2 { margin: 0; font-size: 30px; overflow-wrap: anywhere; }
.d-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--muted); font-size: 14px; }
.d-line .pill { margin: 0; }
.d-imdb { align-self: flex-start; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.d-imdb:hover { text-decoration: underline; }
.d-body { display: flex; flex-direction: column; gap: 14px; padding: 6px 28px 24px; }
.d-body p { margin: 0; line-height: 1.5; }
.d-body:empty { display: none; }
.d-foot { flex: none; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.d-foot .btn { text-align: center; white-space: nowrap; }
.d-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.d-facts dt { color: var(--muted); }
.d-facts dd { margin: 0; }
.move-to { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.move-to input {
  width: 72px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.stars { display: flex; gap: 2px; flex-wrap: wrap; }
.stars button { border: 0; background: none; padding: 0 1px; font-size: 22px; color: var(--star-off); line-height: 1; }
.stars button.on { color: var(--gold); }
.stars button:hover { transform: scale(1.15); }

/* ---------- tournament ---------- */


.tourney { max-width: 980px; margin: 0 auto; }
.t-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 4vw, 32px); }
.tourney h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 4.4vw, 33px); letter-spacing: -0.03em; line-height: 1.05; }
.tourney h3 { margin: 26px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.t-facts { padding-left: 18px; margin: 16px 0; display: grid; gap: 8px; }
.t-facts b { color: var(--label); font-weight: 600; }
/* generating a tournament: pick the movies and the format */
.t-setup > .muted { margin: 0; }
.t-group { margin-top: 22px; }
.t-group h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--label); }
.t-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.t-opt { display: grid; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: var(--text); text-align: left; }
.t-opt:hover { border-color: var(--line-strong); }
.t-opt b { font-size: 15px; }
.t-opt span { color: var(--muted); font-size: 12px; }
.t-opt.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line) inset; }
.t-opt.on b { color: var(--accent); }
.t-formats { grid-template-columns: repeat(2, 1fr); }
.t-format { gap: 4px; padding: 14px 16px; }
.t-format span { font-size: 13px; }
.t-format .t-opt-n { margin-top: 4px; color: var(--text); font-weight: 700; }
.t-how { margin-top: 20px; color: var(--muted); }
.t-how summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.t-how .t-facts { color: var(--text); }
.t-go { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.t-go p { margin: 0; }
.t-go .modal-actions { margin-top: 0; }
@media (max-width: 760px) {
  .t-opts { grid-template-columns: repeat(2, 1fr); }
  .t-formats { grid-template-columns: 1fr; }
  .t-go .modal-actions { width: 100%; }
  .t-go .btn.primary { flex: 1; }
}

.t-head { text-align: center; }
.t-head p { margin: 0; }
.t-bar { height: 6px; max-width: 420px; margin: 12px auto 0; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.t-bar span { display: block; height: 100%; background: var(--accent-grad); transition: width 0.3s; }

.t-match { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: start; margin-top: 22px; }
.t-match .vs { align-self: center; }
.t-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s, border-color 0.18s, opacity 0.18s, box-shadow 0.18s;
}
.t-pick strong { font-size: 16px; line-height: 1.25; }
.t-pick .muted { font-size: 13px; }
@media (hover: hover) { .t-pick:hover { border-color: var(--accent); transform: translateY(-3px); } }
.t-pick.won { border-color: var(--accent); transform: scale(1.03); box-shadow: 0 0 0 5px var(--accent-glow); }
.t-pick.lost { opacity: 0.3; transform: scale(0.96); }
.t-poster {
  position: relative;
  width: min(100%, 300px, calc((100svh - 360px) * 0.667));
  min-width: 110px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-2);
}
.t-poster img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.t-seed {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--header-bg);
  color: var(--label);
  font-size: 12px;
  font-weight: 700;
}
.t-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.t-hint { text-align: center; margin-top: 10px; }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.duel .modal-actions { justify-content: center; }

.t-champ { display: flex; gap: 18px; align-items: center; margin: 14px 0 6px; }
.t-champ p { margin: 0; }
.t-champ-poster { width: 110px; flex: none; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: 0 0 0 3px var(--gold); }
.t-champ-poster img { width: 100%; height: 100%; object-fit: cover; }

.t-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.t-list li { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--panel-2); }
.t-rank { width: 34px; flex: none; text-align: center; font-family: var(--display); letter-spacing: -0.03em; font-weight: 700; font-size: 18px; color: var(--muted); }
.t-standings li:nth-child(1) .t-rank { color: var(--gold); }
.t-standings li:nth-child(2) .t-rank { color: var(--silver); }
.t-standings li:nth-child(3) .t-rank { color: var(--bronze); }
.t-thumb { width: 34px; flex: none; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--bg); }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-thumb .noimg { font-size: 14px; }
.t-name { flex: 1; min-width: 0; font-size: 14px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.t-chips .pill { font-size: 11px; padding: 1px 7px; }
.t-avg { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }

.draw { width: min(640px, calc(100vw - 32px)); max-height: 86vh; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--accent-grad); border-color: transparent; color: var(--accent-ink); }
.chip:disabled { opacity: 0.35; }
.draw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 52vh; overflow: auto; }
.draw-list li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.draw-list .draw-group { background: none; padding: 10px 2px 0; color: var(--label); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.draw-list .seed { display: inline-block; min-width: 26px; margin-right: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.draw-list .won { color: var(--accent); font-weight: 700; }
.draw-list .out { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }

/* at the top, clear of the buttons you're tapping (and it never catches a tap) */
/* a save that hasn't gone through yet: stays until it has */
.save-state {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 49;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: 0 12px 30px var(--shadow);
  color: var(--danger-text);
  font-size: 13px;
  translate: -50% 0;
}
.save-state[hidden], body.signed-out .save-state { display: none; }
.save-state button { flex: none; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--text); font-size: 13px; font-weight: 700; }
.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 50;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--accent-line);
  background: var(--panel-2);
  box-shadow: 0 12px 30px var(--shadow);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  translate: -50% -12px;
  pointer-events: none;
  transition: opacity 0.25s, translate 0.25s;
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- rating check ---------- */

.c-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.c-row {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  border-radius: 12px;
  background: var(--panel-2);
}
.c-info { min-width: 0; display: grid; gap: 2px; font-size: 14px; }
.c-info b { overflow-wrap: anywhere; }
.c-info .muted { font-size: 12px; }
.c-change { font-size: 14px; white-space: nowrap; color: var(--muted); }
.c-change b { color: var(--gold); }
.c-actions { display: flex; gap: 6px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

/* ---------- pages & tab bar ---------- */

.view { max-width: 980px; margin: 0 auto; }
.view-h { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 4.4vw, 33px); letter-spacing: -0.03em; line-height: 1.05; }
.view > .muted { margin: 0 0 14px; }
.modal-actions.start { justify-content: flex-start; margin-top: 12px; }

.add-view .search { max-width: none; }
.add-view .results { position: static; margin-top: 12px; max-height: none; box-shadow: none; }

/* profile: who you are and your numbers, then a grid of things to do */
.p-hero { display: grid; gap: 22px; }
.p-who { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; }
.p-pic { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--panel-2); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-line); font-size: 30px; }
.p-name { display: grid; min-width: 0; }
.p-name .view-h { margin: 0; font-size: clamp(24px, 6.4vw, 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-name .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-signout { align-self: start; }
.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.p-stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: var(--text); text-decoration: none; }
a.p-stat:hover { border-color: var(--accent-line); }
.p-stat b { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: -0.03em; }
.p-stat b i { font-style: normal; color: var(--gold); font-size: 0.8em; }
.p-stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.p-pic-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; color: inherit; font: inherit; }
.p-pic-btn .p-pic { display: grid; place-items: center; }
.p-pic-badge { position: absolute; right: -4px; bottom: -2px; display: grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--panel); font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: -0.03em; line-height: 1; }
.p-pic-btn:hover .p-pic-badge, .p-pic-btn:focus-visible .p-pic-badge { transform: scale(1.08); }
.p-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-edit { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.p-edit:hover { color: var(--accent); border-color: var(--accent-line); }
.p-edit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.name-dlg .muted { margin: 0 0 16px; }
/* Phones: at the top of the screen, so the keyboard opening for the name box never covers it. */
@media (max-width: 760px) {
  .name-dlg { margin-top: calc(env(safe-area-inset-top) + 16px); margin-bottom: auto; }
}
.name-input input { font-size: 16px; }
.name-error { margin: 10px 0 0; color: var(--accent); font-size: 13px; }

/* reliability: a small ring beside your name */
.rel-ring { position: relative; display: grid; justify-items: center; gap: 4px; width: 64px; }
.rel-ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.rel-track, .rel-fill { fill: none; stroke-width: 6; }
.rel-track { stroke: var(--panel-2); }
.rel-fill { stroke-linecap: round; } /* its gradient comes with each ring */
.rel-stop-a { stop-color: var(--accent); }
.rel-stop-b { stop-color: var(--accent-2); }
.rel-ring b { position: absolute; top: 0; width: 64px; height: 64px; display: grid; place-content: center; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.rel-ring span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.p-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.p-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 28px 0 8px; font-size: 13px; }
.p-legal a, .p-legal .link-btn { color: var(--muted); font-size: 13px; }
.p-legal .p-delete { color: var(--danger-text); }
.p-legal .p-tmdb { flex-basis: 100%; margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 11.5px; }
.p-legal .p-tmdb a { font-size: inherit; }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.danger:disabled { opacity: 0.45; }
.delete-confirm { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 14px; }
.delete-confirm input { width: 18px; height: 18px; accent-color: var(--danger); }
.p-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.p-card:last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd one out spans the row */
.p-card.p-alert { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.p-card-head { display: flex; align-items: center; gap: 12px; }
.p-card h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--label); }
.p-card p { margin: 0; font-size: 14px; }
.p-card p b { color: var(--text); }
.p-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.p-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* For You: the watchlist row at the top */
.fy-watch { margin-bottom: 26px; }
.fy-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fy-watch h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--label); }
.fy-watch-empty h3 { margin-bottom: 4px; }
.fy-watch-empty p { margin: 0; }
.fy-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.fy-item { display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; scroll-snap-align: start; }
.fy-poster { display: block; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: 0 8px 20px var(--shadow); transition: transform 0.15s; }
.fy-poster img { width: 100%; height: 100%; object-fit: cover; }
.fy-item:hover .fy-poster { transform: translateY(-3px); }
/* Friends who've seen a watchlist movie: a badge on the poster, tap for names and ratings (friendsseen.js). */
/* Friends who've seen a watchlist movie: their first names and ratings along the bottom of its poster (friendsseen.js). */
.fy-poster, .r-poster { position: relative; }
.fs-over { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 26px 8px 7px; background: linear-gradient(to top, rgba(10, 13, 19, 0.94) 0%, rgba(10, 13, 19, 0.82) 55%, transparent 100%); font-size: 12px; line-height: 1.25; text-align: left; pointer-events: none; }
.fs-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.fs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 600; }
.fs-row b { flex: none; color: var(--gold); font-weight: 800; }
.fs-row i { flex: none; color: rgba(255, 255, 255, 0.7); font-style: normal; font-size: 11px; }
/* three or more friends: a window two names tall, the names rolling up through it and fading out at the top */
.fs-rolling { --fs-row: 17px; padding-top: 30px; }
.fs-roll { display: block; height: calc(var(--fs-row) * 2.4); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 42%, #000 82%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 42%, #000 82%, transparent 100%); }
.fs-track { display: block; animation: fs-roll linear infinite; will-change: transform; }
.fs-rolling .fs-row { height: var(--fs-row); align-items: center; }
@keyframes fs-roll { to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .fs-track { animation: none; } }
.fy-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* friends */
.comm-tabs { margin-bottom: 22px; }
.comm-tabs a .seg-n[hidden] { display: none; }
.community-friends > .muted { margin: 0; }

/* rating a movie you've seen */
.rate-dlg { width: min(460px, calc(100vw - 32px)); }
.rate-head { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; }
.rate-head h2 { margin: 0 0 4px; font-size: 28px; }
.rate-head .year { font-size: 18px; color: var(--muted); }
.rate-head .muted { margin: 0; }
.rate-poster { width: 72px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.rate-poster img { width: 100%; height: 100%; object-fit: cover; }
.rate-stars { justify-content: center; margin-top: 20px; }
.rate-stars button { font-size: 30px; padding: 0 2px; }

.signin-invite { margin: -10px 0 22px; display: grid; gap: 10px; justify-items: center; }
.signin-invite p { margin: 0; }
.signin-invite-who { margin: 4px 0 0; font-size: 17px; }
.signin-invite .f-pic-lg { width: 88px; height: 88px; font-size: 34px; }
.f-main { display: grid; gap: 20px; min-width: 0; margin-top: 20px; }
.f-block { display: grid; gap: 10px; }
.f-block h3, .f-add h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--label); }
.f-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 24px; text-align: center; }
.f-empty svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.f-empty b { font-size: 17px; }
.f-empty p { margin: 0; max-width: 320px; }
.f-empty .btn { margin-top: 10px; }
.f-add { display: grid; gap: 14px; max-width: 440px; margin-top: 20px; padding: 22px; }
.f-add-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.f-add .f-form { margin-top: 0; }
.f-pic { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; background: var(--panel-2); font-size: 16px; }
.f-pic-lg { width: 72px; height: 72px; font-size: 28px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-line); }
.f-requests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.f-requests li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--accent-line); border-radius: 14px; background: var(--accent-soft); }
.f-req-text { flex: 1; min-width: 0; font-size: 14px; }
.f-req-actions { display: flex; gap: 6px; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.f-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.f-tile:hover { border-color: var(--accent-line); }
.f-tile-text { display: grid; flex: 1; min-width: 0; }
.f-tile-text b, .f-tile-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-go { color: var(--muted); font-size: 22px; line-height: 1; }
.f-new { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: 2px; }
.f-waiting { margin: 0; }
.f-pending .link-btn { margin-left: 2px; color: var(--muted); text-decoration: none; }

/* your code, adding someone, accepting an invite */
.friend-dlg { width: min(460px, calc(100vw - 32px)); }
.f-code { display: grid; justify-items: center; gap: 4px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--panel-2); }
.f-code b { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: 0.12em; line-height: 1; color: var(--accent); }
/* invite QR codes: yours (tap for a big one) and the camera scanner */
.f-qr { display: block; width: 168px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.f-qr .qr, .qr-big .qr { display: block; width: 100%; height: auto; }
.f-qr-hint { margin: 2px 0 10px; font-size: 12px; }
.f-scan { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.f-scan svg, .qr-cam-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qr-dlg { width: min(440px, calc(100vw - 32px)); }
.qr-dlg h2 { margin-bottom: 6px; }
.qr-big { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr-big h2 { margin: 0; }
.qr-big .qr { width: min(300px, 70vw); border-radius: 18px; }
.qr-big .muted { margin: 0; max-width: 320px; }
.f-code-inline { margin: 0; font-family: var(--display); font-weight: 700; font-size: 25px; letter-spacing: 0.12em; color: var(--accent); }
.qr-cam { position: relative; aspect-ratio: 1; margin-top: 14px; border-radius: 18px; overflow: hidden; background: #000; }
.qr-cam video { width: 100%; height: 100%; object-fit: cover; }
.qr-frame { position: absolute; inset: 16%; border: 3px solid var(--accent); border-radius: 20px; box-shadow: 0 0 0 999px rgba(16, 20, 27, 0.45); opacity: 0; transition: opacity 0.3s; }
.qr-cam.live .qr-frame { opacity: 1; }
.qr-cam-icon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.qr-cam-icon svg { width: 40px; height: 40px; }
.qr-cam.live .qr-cam-icon { display: none; }
.qr-status { margin: 12px 0 0; text-align: center; }
.f-form { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.f-form label { font-weight: 600; font-size: 14px; }
.f-input { display: flex; gap: 8px; }
.f-input input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); }
.f-input input:focus { outline: none; border-color: var(--accent-line); }
.f-msg { margin: 0; font-size: 13px; }
.f-msg.ok { color: var(--text); }
.f-msg.error { color: var(--danger-text); }
.f-invite { display: grid; justify-items: center; gap: 6px; text-align: center; }
.f-invite .f-pic-lg { margin-bottom: 8px; }
.f-invite h2 { margin: 0; }
.f-invite p { margin: 0; }

/* a friend's page */
.f-hero { display: flex; align-items: center; gap: 20px; }
.f-hero-text { min-width: 0; }
.f-hero .view-h { margin: 0 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the name, with their reliability ring beside it */
.f-name-row { display: flex; align-items: center; gap: 16px; min-width: 0; margin-bottom: 8px; }
.f-hero .f-name-row .view-h { margin: 0; min-width: 0; }
.f-name-row .rel-ring { flex: none; }
.f-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.f-stats span { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 13px; }
.f-stats b { color: var(--text); }
.f-stats .f-match { border-color: var(--accent-line); background: var(--accent-soft); }
.f-stats .f-match b { color: var(--accent); }
.f-section { margin-top: 26px; }
.f-section h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--label); }
.f-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- find a movie on a list (findinlist.js) ---------- */
/* a small round magnifier, out of the way of the design */
.find-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.find-btn:hover, .find-btn:focus-visible { color: var(--text); border-color: var(--line-strong); }
.find-btn svg, .find-field svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.list-hero { position: relative; }
.list-hero > .find-btn { position: absolute; top: 0; right: 0; z-index: 1; }
/* the search panel: at the top of the screen, over a dimmed page */
.find-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.find-scrim[hidden] { display: none; }
.find-panel { width: min(520px, calc(100vw - 24px)); margin: calc(12px + env(safe-area-inset-top)) auto 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 60px var(--shadow-deep); animation: find-in 0.18s ease-out; }
@keyframes find-in { from { opacity: 0; translate: 0 -8px; } }
.find-field { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--panel-2); color: var(--muted); }
.find-field input { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.find-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.find-results { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 420px); overflow-y: auto; }
.find-results:not(:empty) { margin-top: 6px; }
.find-results button { display: grid; grid-template-columns: 44px 32px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.find-results button:hover, .find-results button:focus-visible { background: var(--panel-2); }
.find-rank { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--accent); text-align: right; }
.find-thumb { position: relative; width: 32px; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.find-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.find-thumb .noimg { font-size: 12px; }
.find-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.find-none { padding: 14px 10px 10px; color: var(--muted); font-size: 14px; }
.f-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.f-poster-card { display: grid; gap: 6px; align-content: start; cursor: pointer; }
.f-poster-card b { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-poster-card .btn { justify-self: start; }
.f-poster { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: 0 10px 24px var(--shadow); transition: transform 0.15s; }
.f-poster img { width: 100%; height: 100%; object-fit: cover; }
.f-poster-card:hover .f-poster { transform: translateY(-3px); }
.f-poster-rating { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(16, 20, 27, 0.85); color: var(--gold); font-size: 12px; font-weight: 700; }
.f-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.f-row { display: grid; grid-template-columns: 34px 44px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px 8px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.f-row:hover { border-color: var(--line-strong); }
.f-rank { font-family: var(--display); letter-spacing: -0.03em; font-weight: 700; font-size: 18px; text-align: center; color: var(--muted); }
/* every poster the same size, however tall its image is */
.f-thumb { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--panel-2); }
.f-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.f-row-text { display: grid; min-width: 0; }
.f-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-row-text .muted { font-size: 12px; }
/* a friend's list: seen ones plain, not-seen ones stand out with Rate it / + Watchlist */
.f-you { color: var(--muted); font-size: 12px; }
.f-you i, .f-act i { font-style: normal; color: var(--gold); }
.f-list .f-row.f-unseen { border-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--card); }
.f-unseen-tag { justify-self: start; margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; }
/* Rank it and + Watchlist: their own line under the poster and title */
.f-acts { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.f-act { padding: 5px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.f-act:hover { border-color: var(--accent-line); }
.f-act.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.f-row .pill.mine.f-theirs { display: grid; justify-items: center; line-height: 1; }
.f-theirs small { color: var(--muted); font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; margin-top: 3px; }
.f-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 26px; }
.f-pending [data-fr=unblock] { color: var(--accent); }
@media (max-width: 760px) {
  .f-hero { gap: 14px; }
  .f-pic-lg { width: 60px; height: 60px; font-size: 24px; }
  .f-posters { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .f-requests li { flex-wrap: wrap; }
  .f-req-actions { width: 100%; padding-left: 52px; }
}

.p-action { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
@media (max-width: 760px) {
  .p-who { grid-template-columns: auto 1fr auto; gap: 14px; }
  .p-pic { width: 60px; height: 60px; font-size: 24px; }
  .p-signout { grid-column: 1 / -1; justify-self: start; }
  .p-stats { grid-template-columns: repeat(2, 1fr); }
  .p-grid { grid-template-columns: 1fr; }
  .p-card { padding: 18px; }
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Add sits in the middle as a raised accent button */
.tabbar a.tab-add svg {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  margin-top: -20px;
  padding: 11px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: var(--accent-ink);
  stroke-width: 2.4;
  box-shadow: 0 6px 16px var(--shadow), 0 0 0 4px var(--bg);
}
.tabbar a.tab-add[aria-current="page"] svg { color: var(--accent-ink); }
.tabbar a.tab-add[aria-current="page"]::before { display: none; }
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] svg { color: var(--accent); }
.tabbar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent-grad);
}
.tabbar .badge {
  position: absolute;
  top: 1px;
  left: calc(50% + 7px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
@media (min-width: 761px) {
  .tabbar {
    left: 50%;
    right: auto;
    bottom: 16px;
    width: 520px;
    translate: -50% 0;
    padding-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 40px var(--shadow);
  }
}

/* ---------- sign-in & account ---------- */

/* Nothing shows until we know whether you're signed in */
body.booting .top, body.booting main, body.booting .tabbar, body.booting #banner { visibility: hidden; }
.boot-mark { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; }
.boot-mark img { opacity: 0; animation: boot-in 0.4s ease 0.5s forwards, boot-pulse 1.6s ease-in-out 0.9s infinite; }
body:not(.booting) .boot-mark { display: none; }
@keyframes boot-in { to { opacity: 0.45; } }
@keyframes boot-pulse { 0%, 100% { opacity: 0.45; transform: scale(1); } 50% { opacity: 0.2; transform: scale(0.94); } }
body.signed-out .top, body.signed-out main, body.signed-out .tabbar, body.signed-out #banner { display: none; }

.signin {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.signin-card {
  width: min(420px, 100%);
  padding: 36px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  text-align: center;
  box-shadow: 0 30px 60px var(--shadow);
}
.signin-mark { display: block; margin: 0 auto 14px; width: 96px; height: auto; }
.signin-title { margin: 0; font-family: var(--display); font-weight: 650; font-size: clamp(26px, 8vw, 38px); letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.signin-tag { margin: 10px auto 26px; max-width: 300px; color: var(--muted); }
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border: 1px solid var(--google-line);
  border-radius: 999px;
  background: var(--google-bg);
  color: var(--google-ink);
  font-size: 16px;
  font-weight: 600;
}
.google-btn svg { width: 20px; height: 20px; flex: none; }
.google-btn:hover { box-shadow: 0 0 0 4px var(--accent-soft); }
.google-btn:disabled { opacity: 0.6; pointer-events: none; }
.apple-btn { margin-bottom: 10px; }
.apple-btn[hidden] { display: none; }
.signin-small { margin: 16px 0 0; color: var(--muted); font-size: 12px; }

.acct-initial { display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); font-weight: 800; }

/* ---------- welcome: rate famous movies ---------- */

body.in-welcome .top { display: none; }
body.in-welcome main { padding-top: max(18px, env(safe-area-inset-top)); }
.w-head { margin-bottom: 16px; }
.w-head .view-h { margin: 0 0 4px; }
.w-head .muted { margin: 0; }
/* the movie and, under it, how far you've got and the way out */
.w-deck { border: 1px solid var(--line); border-radius: 20px; background: var(--card); overflow: hidden; }
.w-empty { padding: 24px; }
/* after the first 25: build the list, or keep rating */
.w-checkpoint { display: grid; justify-items: center; gap: 10px; padding: 40px 24px 32px; text-align: center; }
.w-checkpoint > * { margin: 0; }
.w-checkpoint .muted { max-width: 420px; font-size: 14px; }
.w-checkpoint-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.w-checkpoint-acts .btn { padding: 12px 22px; font-size: 15px; }
.w-checkpoint .link-btn { margin-top: 6px; color: var(--muted); font-size: 13px; text-decoration: none; }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(16, 20, 27, 0.25); }
.w-encourage { margin: 0; color: var(--muted); font-size: 13px; }
.w-enough { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; font-size: 15px; white-space: nowrap; box-shadow: 0 10px 26px var(--accent-glow); }
.w-enough span { display: inline-block; transition: transform 0.15s; }
.w-enough:hover span { transform: translateX(3px); }
.w-card {
  display: grid;
  grid-template-columns: minmax(0, 280px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 20px;
  transition: transform 0.26s ease, opacity 0.26s ease;
}
.w-card.w-out-rate { transform: translateX(-24px) rotate(-1.5deg); opacity: 0; }
.w-card.w-out-skip { transform: translateX(24px) rotate(1.5deg); opacity: 0; }
.w-poster { aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--panel-2); box-shadow: 0 16px 36px var(--shadow); }
.w-poster img { width: 100%; height: 100%; object-fit: cover; }
.w-info { display: grid; gap: 8px; }
.w-info p { margin: 0; }
.w-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 4.4vw, 33px); line-height: 1.02; letter-spacing: -0.03em; }
.w-stars { margin-top: 6px; gap: 2px; }
.w-stars button { display: grid; justify-items: center; gap: 1px; padding: 0 2px; }
.w-stars button:hover { transform: none; }
.w-glyph { font-size: 30px; line-height: 1; transition: transform 0.1s; }
.w-n { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1; }
.w-stars button.on, .w-stars button.on .w-n { color: var(--gold); }
/* hover preview: real mouse only, and only once it has moved over this card's stars */
@media (hover: hover) {
  .w-stars.armed:hover button, .w-stars.armed:hover button .w-n { color: var(--gold); }
  .w-stars.armed button:hover ~ button, .w-stars.armed button:hover ~ button .w-n { color: var(--star-off); }
  .w-stars.armed button:hover .w-glyph { transform: scale(1.15); }
}
.w-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; max-width: 440px; }
.w-unseen, .w-watch { flex: 1 1 0; min-width: 0; border-color: var(--line-strong); }
.w-unseen:hover, .w-watch:hover { border-color: var(--accent-line); }
.w-undo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.w-undo:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.w-undo:disabled { opacity: 0.35; cursor: default; }

/* ---------- for you ---------- */

.seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.seg a { padding: 7px 16px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.seg a.on { background: var(--accent-grad); color: var(--accent-ink); }
.seg-n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--panel-2); color: var(--text); font-size: 12px; text-align: center; }
.seg a.on .seg-n { background: var(--accent-ink); color: var(--pick); }
.h-tabs { display: flex; gap: 22px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.h-tabs::-webkit-scrollbar { display: none; }
.h-tab { position: relative; flex: none; padding: 2px 0 10px; color: var(--muted); font-family: var(--display); font-size: clamp(21px, 5.4vw, 30px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; white-space: nowrap; text-decoration: none; opacity: 0.55; transition: opacity 0.15s, color 0.15s; }
.h-tab:hover { opacity: 0.85; }
.h-tab.on { color: var(--text); opacity: 1; }
.h-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; border-radius: 3px; background: var(--accent-grad); }
.h-n { margin-left: 2px; color: var(--muted); font-size: 0.5em; font-weight: 700; letter-spacing: 0; vertical-align: 0.5em; }
@media (min-width: 1024px) { .h-tabs { gap: 32px; margin-bottom: 12px; } .h-tab { font-size: clamp(30px, 2.6vw, 42px); } }
.fy-sub { margin: 0 0 14px; }
.fy-empty-h { margin: 6px 0 4px; font-family: var(--display); font-size: 19px; letter-spacing: -0.02em; }
/* what the watchlist page is, and a quiet "Sort by Friends' average ⌄" beside it */
.wl-sub { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-bottom: 14px; }
.wl-sub .muted { flex: 1 1 260px; margin: 0; }
.sort-pick { display: inline-flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.sort-pick select { appearance: none; -webkit-appearance: none; padding: 2px 16px 2px 0; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236a91f6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.sort-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.r-friends { color: var(--gold); font-size: 13px; font-weight: 700; }
.btn.saved { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.results .r-watch { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: 4px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); }
.results .r-watch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.results .r-watch.on { border-color: var(--accent-line); color: var(--accent); }
.results .r-watch.on svg { fill: currentColor; }
.r-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.r-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: opacity 0.2s, transform 0.2s;
}
.r-card.r-gone { opacity: 0; transform: translateX(24px); }
.r-card { cursor: pointer; }
.r-card:hover { border-color: var(--line-strong); }
.r-poster { display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.r-poster img { width: 100%; height: 100%; object-fit: cover; }
.r-info { display: grid; gap: 3px; min-width: 0; }
.r-title { padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; text-align: left; }
.r-meta { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-why { color: var(--label); font-size: 13px; font-weight: 600; }
.r-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 14px; text-decoration: none; }

/* ---------- add to home screen ---------- */

.install-pill {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 12px 30px var(--shadow), 0 0 0 4px var(--accent-soft);
  animation: pill-in 0.4s ease-out both;
}
body.signed-out .install-pill { bottom: calc(20px + env(safe-area-inset-bottom)); }
body.in-welcome .install-pill { display: none; }
/* signing up: no menus until "That's enough for now" */
body.onboarding .top, body.onboarding .tabbar, body.onboarding .install-pill { display: none !important; }
body.onboarding main { margin-left: 0 !important; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
@keyframes pill-in { from { opacity: 0; translate: -50% 12px; } }
.install-go {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 6px 11px 16px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.install-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.install-x { padding: 11px 14px 11px 8px; border: 0; background: none; color: var(--accent-ink); font-size: 14px; opacity: 0.75; }

.install-sheet { width: min(460px, calc(100vw - 24px)); }
.i-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.i-step { display: grid; grid-template-columns: 26px 44px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); }
.i-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-grad); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
.i-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); color: var(--accent); }
.i-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i-ico svg.fill { fill: currentColor; stroke: none; }
.i-txt { display: grid; gap: 2px; font-size: 15px; }
.i-txt small { color: var(--muted); font-size: 12.5px; }
.i-jump { margin-top: 14px; }
.i-jump .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding-block: 12px; font-size: 15px; }
.i-jump svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-or { margin: 14px 0 0; }
/* iPhone Safari: point at Safari's own toolbar, below the sheet */
.i-arrow { position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); translate: -50% 0; display: grid; justify-items: center; gap: 2px; color: var(--text); font-size: 13px; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); pointer-events: none; animation: i-bob 1.2s ease-in-out infinite; }
.i-arrow b { font-size: 28px; line-height: 1; color: var(--accent); }
@keyframes i-bob { 50% { translate: -50% 6px; } }
/* iPhone Safari: pinned to the top and compact, so the steps stay visible above the share menu */
.install-sheet.i-top { margin: max(10px, env(safe-area-inset-top)) auto auto; padding: 18px 18px 16px; max-height: calc(100svh - 20px); overflow: auto; }
.install-sheet.i-top h2 { margin-bottom: 0; font-size: 26px; }
.i-top .i-steps { margin-top: 10px; gap: 6px; }
.i-top .i-step { grid-template-columns: 22px 34px 1fr; gap: 10px; padding: 7px 10px; }
.i-top .i-num { width: 22px; height: 22px; font-size: 12px; }
.i-top .i-ico { width: 34px; height: 34px; border-radius: 10px; }
.i-top .i-ico svg { width: 20px; height: 20px; }
.i-top .i-txt { font-size: 14px; }
.i-top .i-txt small { font-size: 12px; }
.i-top .i-or { margin-top: 10px; font-size: 12.5px; }
.i-top .modal-actions { margin-top: 12px; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; gap: 12px; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .brand { --brand-size: clamp(20px, 6.6vw, 26px); }
  .row { grid-template-columns: 38px 56px 1fr auto; gap: 10px; padding: 8px 8px 8px 2px; }
  .grip { left: 3px; }
  .t-match { gap: 8px; margin-top: 16px; }
  .t-match .vs { font-size: 20px; }
  .t-pick { padding: 8px; border-radius: 14px; }
  .t-pick strong { font-size: 14px; }
  .t-pick .muted { font-size: 12px; }
  .t-poster { width: 100%; min-width: 0; }
  .t-hint { display: none; }
  .t-champ-poster { width: 84px; }
  .t-avg { display: none; }
  .w-card { grid-template-columns: 1fr; gap: 14px; padding: 14px; text-align: center; }
  .w-foot { padding: 14px; flex-direction: column; gap: 10px; }
  .w-enough { width: 100%; justify-content: center; }
  /* the poster takes whatever height is left, so the stars and buttons always fit above the tab bar */
  .w-poster { width: min(62vw, 240px, calc((100svh - 560px) * 0.667)); min-width: 120px; justify-self: center; }
  .w-stars { justify-content: center; }
  .w-stars { flex-wrap: nowrap; gap: 0; }
  .w-stars button { padding: 0 1px; }
  .w-glyph { font-size: 26px; }
  .w-actions { justify-content: center; max-width: none; }
  .c-row { grid-template-columns: 34px 1fr auto; }
  .c-actions { grid-column: 2 / -1; }
  .poster { width: 56px; }
  .rank, .rank.gold, .rank.silver, .rank.bronze { font-size: 30px; }
  .title { font-size: 15px; }
  .meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .details { width: calc(100vw - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .d-hero { grid-template-columns: 108px minmax(0, 1fr); gap: 16px; padding: 20px 60px 16px 18px; }
  .modal .d-head h2 { font-size: 22px; }
  .d-line { font-size: 13px; }
  .d-body { padding: 4px 18px 18px; }
  /* the buttons share one row, so the bar stays short */
  .d-foot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; padding: 12px; }
  .d-foot .btn { padding-inline: 6px; }
  .btn { padding: 9px 12px; font-size: 13px; }
}

/* shared motion: the title shine, #1's gold sheen, rows rising in, a floating poster */
@keyframes lh-shine { 0%, 15% { background-position: 100% 0; } 65%, 100% { background-position: 0% 0; } }
@keyframes no1-sheen { 0% { translate: -100% 0; } 35%, 100% { translate: 100% 0; } }
@keyframes row-rise { from { opacity: 0; scale: 0.94; } }
@keyframes w-float { 50% { translate: 0 -8px; } }

/* ---------- desktop (1024px and wider) ----------
   A sidebar on the left (Absolute Cinema, + Add, the tabs, Profile at the bottom)
   instead of the phone tab bar, wider pages, and the list as a leaderboard
   under a big "My top N" header with the shortcuts. Phones and tablets get
   the same look, sized for them, at the end of this file. */

.list-hero { display: none; }
.list-gate { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.list-gate p { margin: 0 0 8px; }
@media (min-width: 1024px) { #view-list > .list-gate { grid-column: 1 / -1; } }

@media (min-width: 1024px) {
  :root { --side: 248px; --page: 1240px; --gutter: max(32px, calc((100vw - var(--side) - var(--page)) / 2)); }

  /* the sidebar: the header's brand sits at its top, the tab bar fills the rest */
  .top { position: fixed; top: 0; left: 0; width: var(--side); height: auto; padding: 28px 24px 0; display: block; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; z-index: 22; }
  .brand { --brand-size: 21px; }
  .brand .stats { margin-top: 5px; }
  .tabbar {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--side);
    height: auto;
    translate: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 118px 16px 24px;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }
  .tabbar a {
    display: flex;
    align-items: center;
    justify-items: start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
  }
  .tabbar a:hover { color: var(--text); background: var(--panel); }
  .tabbar a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
  .tabbar a[aria-current="page"]::before { top: 10px; bottom: 10px; left: -16px; width: 4px; height: auto; translate: none; border-radius: 0 4px 4px 0; }
  .tabbar svg { width: 22px; height: 22px; flex: none; }
  .tabbar .badge { position: static; margin-left: auto; }
  /* + Add first, as a big button; Profile pinned to the bottom */
  .tabbar a.tab-add { order: -1; justify-content: center; margin-bottom: 14px; padding: 13px 16px; border-radius: 999px; background: var(--accent-grad); color: var(--accent-ink); font-weight: 700; box-shadow: 0 10px 26px var(--accent-glow); }
  .tabbar a.tab-add:hover { background: var(--accent-grad); filter: brightness(1.08); }
  .tabbar a.tab-add svg { width: 18px; height: 18px; margin: 0; padding: 0; background: none; box-shadow: none; color: inherit; stroke-width: 2.6; }
  .tabbar a.tab-add[aria-current="page"] { box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 26px var(--accent-glow); }
  .tabbar a.tab-add[aria-current="page"]::before { display: none; }
  .tabbar a[data-tab="profile"] { margin-top: auto; }
  body.in-welcome .tabbar { display: none; }

  main, .banner { margin-left: var(--side); }
  body.in-welcome main { margin-left: 0; }
  main { padding: 36px var(--gutter) 72px; }
  .view { max-width: var(--page); }
  .banner { width: auto; max-width: var(--page); margin-right: var(--gutter); margin-left: calc(var(--side) + var(--gutter)); }

  /* List: a big "My top N" header with the shortcuts, then the ranking as a leaderboard */
  .list-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; margin: 4px 0 28px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
  .list-hero[hidden] { display: none; }
  .lh-head { min-width: 0; }
  .lh-head .eyebrow { margin-bottom: 2px; }
  .lh-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(47px, 4.7vw, 77px);
    line-height: 0.88;
    letter-spacing: -0.03em;
    background: linear-gradient(100deg, var(--text) 0%, var(--text) 35%, var(--accent) 50%, var(--accent-2) 58%, var(--text) 72%, var(--text) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lh-shine 9s ease-in-out infinite;
  }
  .lh-title span { -webkit-text-stroke: 2px var(--accent); }
  .lh-sub { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
  .lh-sub b { color: var(--gold); }
  .lh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .lh-actions .btn { padding: 12px 20px; font-size: 14px; transition: translate 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.25s, border-color 0.15s; }
  .lh-actions .btn:hover { translate: 0 -3px; }
  .lh-actions .btn.primary { box-shadow: 0 10px 28px var(--accent-glow); }
  .lh-actions .btn.primary:hover { box-shadow: 0 16px 36px var(--accent-glow); }

  .list { max-width: none; gap: 8px; }
  .row {
    grid-template-columns: 84px 56px minmax(0, 1fr) 88px 36px;
    grid-template-areas:
      "rank poster title mine ctrl"
      "rank poster meta  mine ctrl";
    align-content: center;
    column-gap: 20px;
    row-gap: 3px;
    padding: 10px 18px 10px 4px;
    isolation: isolate;
    overflow: hidden;
    border-color: transparent;
    background: var(--card);
    transition: border-color 0.2s, translate 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.25s;
  }
  .row .info, .row .scores { display: contents; }
  .row .rank { grid-area: rank; }
  .row .poster { grid-area: poster; width: 56px; border-radius: 7px; box-shadow: 0 6px 16px var(--shadow); }
  .row .title { grid-area: title; align-self: end; font-size: 17px; }
  .row .meta { grid-area: meta; margin: 0; }
  .row .controls { grid-area: ctrl; opacity: 0; transition: opacity 0.2s; }
  .row:hover .controls, .row:focus-within .controls { opacity: 1; }

  /* your score: a big number */
  .row .pill.mine { display: flex; flex-direction: column-reverse; align-items: center; gap: 3px; padding: 0; border-radius: 0; background: none; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
  .row .pill.mine { grid-area: mine; color: var(--muted); }
  .row .scores b { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; letter-spacing: -0.03em; text-transform: none; }

  /* hover: lifts, a sunset bar slides in, the poster leans forward */
  .row::before { content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-grad); scale: 1 0; transition: scale 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  .row:hover { border-color: var(--line-strong); translate: 0 -2px; box-shadow: 0 14px 34px var(--shadow); }
  .row:hover::before { scale: 1 1; }
  .row .poster img { transition: scale 0.4s cubic-bezier(0.2, 0.9, 0.3, 1); }
  .row:hover .poster img { scale: 1.08; }
  .grip { left: 8px; }

  /* ranks: outlined numerals that fill with the accent on hover; medals stay solid */
  .rank, .rank.gold, .rank.silver, .rank.bronze { font-size: 46px; }
  .rank:not(.gold):not(.silver):not(.bronze) { color: transparent; -webkit-text-stroke: 1.2px var(--muted); opacity: 0.75; transition: -webkit-text-stroke-color 0.2s, color 0.2s; }
  .row:hover .rank:not(.gold):not(.silver):not(.bronze) { color: var(--accent); -webkit-text-stroke-color: var(--accent); opacity: 1; }

  /* the top three: bigger, lit by their own poster */
  #list > .row:nth-child(-n+3) { grid-template-columns: 96px 84px minmax(0, 1fr) 96px 36px; column-gap: 24px; padding-block: 16px; margin-bottom: 4px; border-color: var(--line); }
  #list > .row:nth-child(-n+3) .poster { width: 84px; border-radius: 10px; box-shadow: 0 14px 30px var(--shadow-deep); }
  #list > .row:nth-child(-n+3) .title { font-size: 24px; letter-spacing: -0.2px; }
  #list > .row:nth-child(-n+3) .meta { font-size: 14px; }
  #list > .row:nth-child(-n+3) .scores b { font-size: 38px; }
  #list > .row:nth-child(-n+3) .rank { font-size: 84px; text-shadow: 0 0 34px currentColor; }
  #list > .row:nth-child(-n+3) .row-glow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    filter: blur(34px) saturate(1.6);
    scale: 1.4;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 85%);
    pointer-events: none;
  }
  #list > .row:nth-child(1) { border-color: rgba(255, 208, 77, 0.45); box-shadow: 0 0 0 1px rgba(255, 208, 77, 0.12), 0 18px 44px rgba(255, 208, 77, 0.1); }
  /* #1: a slow gold sheen sweeps across it */
  #list > .row:nth-child(1)::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 208, 77, 0.16) 50%, transparent 65%); translate: -100% 0; animation: no1-sheen 7s ease-in-out 1.2s infinite; }

  /* narrower desktop windows: tighter columns so titles keep their room */
  @media (max-width: 1279px) {
    .row { grid-template-columns: 64px 48px minmax(0, 1fr) 72px 36px; column-gap: 16px; }
    .row .poster { width: 48px; }
    #list > .row:nth-child(-n+3) { grid-template-columns: 72px 72px minmax(0, 1fr) 76px 36px; column-gap: 16px; }
    #list > .row:nth-child(-n+3) .poster { width: 72px; }
    #list > .row:nth-child(-n+3) .rank { font-size: 68px; }
    #list > .row:nth-child(-n+3) .title { font-size: 20px; }
    #list > .row:nth-child(-n+3) .scores b { font-size: 32px; }
  }

  /* rows rise in as they scroll into view (not on iPhones and iPads: Apple's
     WebKit redraws the posters while it runs, so they flashed) */
  @supports (animation-timeline: view()) and (not (-webkit-touch-callout: none)) {
    #list > .row { animation: row-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
  @media (prefers-reduced-motion: reduce) {
    #list > .row, #list > .row:nth-child(1)::after, .lh-title { animation: none; }
    .lh-title { background-position: 100% 0; }
  }

  /* dragging keeps its own look */
  .row.drag-card { translate: none; }
  .row.drag-card::before, .row.drop-slot::before { display: none; }
  #list > .row.drop-slot .row-glow { visibility: hidden; }
  #list > .row.drop-slot { border-color: var(--accent-line); box-shadow: none; }
  #list > .row.flash { animation: flash 1.6s ease-out; }

  /* search results: two columns */
  .add-view .results { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .fy-strip { grid-auto-columns: 128px; }
  .add-view .search { max-width: 760px; justify-self: start; margin-top: 8px; }

  /* Profile: the cards in a row */
  .p-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
  .p-card:last-child:nth-child(odd) { grid-column: auto; }

  /* Community: wider matchups, roomier draw */
}

/* ---------- desktop pages: the list page's look on every page ----------
   Big shining titles, open headers instead of header cards, big numbers
   instead of stat boxes, and rows and tiles that lift on hover and rise in
   as you scroll. */

@media (min-width: 1024px) {
  /* titles */
  .view-h, .tourney .t-card > h2, .t-head h2 {
    margin: 0 0 10px;
    font-size: clamp(40px, 3.6vw, 58px);
    line-height: 0.98;
    letter-spacing: -0.035em;
    background: linear-gradient(100deg, var(--text) 0%, var(--text) 35%, var(--accent) 50%, var(--accent-2) 58%, var(--text) 72%, var(--text) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lh-shine 9s ease-in-out infinite;
  }
  .view > .muted, .t-card > .muted { font-size: 14px; }

  /* headers sit on the page, not in a card */
  .p-hero, .f-hero, .tourney > .t-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .p-hero, .f-hero { margin-bottom: 26px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }

  /* numbers: big figures, no boxes */
  .p-stats, .f-stats { display: flex; flex-wrap: wrap; gap: 18px 48px; }
  .p-stat, .f-stats span { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; }
  .p-stat b, .f-stats b { color: var(--text); font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 0.9; letter-spacing: -0.03em; text-transform: none; }
  .f-stats b { font-size: 44px; }
  a.p-stat b { transition: color 0.15s; }
  a.p-stat:hover b { color: var(--accent); }
  .f-stats .f-match { border: 0; background: none; }
  .f-stats .f-match b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* rows and tiles: glass that lifts on hover */
  .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .t-opt {
    position: relative;
    isolation: isolate;
    background: var(--card);
    transition: translate 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3), border-color 0.2s, box-shadow 0.25s, opacity 0.2s, transform 0.2s;
  }
  .r-card:hover, .f-row:hover, .c-row:hover, .t-list li:hover, .f-tile:hover, .p-card:hover, .t-opt:hover { translate: 0 -3px; border-color: var(--line-strong); box-shadow: 0 16px 36px var(--shadow); }
  .c-row, .t-list li { border: 1px solid transparent; }
  /* rows: the sunset bar slides in on the left */
  .f-row::before, .c-row::before, .t-list li::before { content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-grad); scale: 1 0; transition: scale 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  .f-row:hover::before, .c-row:hover::before, .t-list li:hover::before { scale: 1 1; }

  /* everything rises in as it scrolls into view */
  @supports (animation-timeline: view()) and (not (-webkit-touch-callout: none)) {
    .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .f-poster-card, .fy-item { animation: row-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }

  /* posters lean forward on hover */
  .r-poster img, .f-poster img, .fy-poster img, .f-thumb img, .t-thumb img, .c-row img, .t-poster img { transition: scale 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); }
  .r-card:hover .r-poster img, .f-poster-card:hover .f-poster img, .fy-item:hover .fy-poster img, .f-row:hover .f-thumb img, .t-list li:hover .t-thumb img, .c-row:hover img, .t-pick:hover .t-poster img { scale: 1.07; }

  /* ----- For You and the watchlist: a poster grid ----- */
  .fy-watch { margin-bottom: 40px; }
  .fy-strip { grid-auto-columns: 150px; gap: 18px; padding: 4px 4px 14px; }
  .fy-poster { border-radius: 14px; transition: translate 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.3s; }
  .fy-item:hover .fy-poster { transform: none; translate: 0 -5px; box-shadow: 0 18px 36px var(--shadow-deep), 0 0 0 2px var(--accent-line); }
  .fy-title { font-size: 14px; }
  #view-foryou .r-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; margin-top: 22px; }
  #view-foryou .r-card { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; padding: 10px 10px 14px; border-color: transparent; }
  #view-foryou .r-poster { border-radius: 10px; box-shadow: 0 14px 30px var(--shadow-deep); }
  #view-foryou .r-info { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 0 4px; }
  #view-foryou .r-title { font-size: 16px; line-height: 1.3; }
  #view-foryou .r-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }
  #view-foryou .r-actions { margin-top: auto; padding-top: 10px; }
  #view-foryou .r-actions .btn { flex: 1 1 0; padding-inline: 6px; font-size: 12.5px; text-align: center; white-space: nowrap; }
  #view-foryou .r-actions .btn.primary { flex-basis: 100%; }

  /* ----- Add: a big search field ----- */
  .add-view .search { max-width: 820px; margin-top: 18px; }
  .add-view .search input { padding: 18px 26px; font-size: 18px; background: var(--card); border-color: var(--line-strong); box-shadow: 0 18px 44px var(--shadow); transition: border-color 0.2s, box-shadow 0.3s; }
  .add-view .search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 18px 50px var(--accent-glow); }
  .add-view .results { max-width: 1100px; gap: 10px; padding: 0; background: none; border: 0; }
  .add-view .results li:not(.hint) { padding: 6px 10px 6px 6px; border: 1px solid transparent; border-radius: 16px; background: var(--card); transition: translate 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3), border-color 0.2s, box-shadow 0.25s; }
  .add-view .results li:not(.hint):hover { translate: 0 -3px; border-color: var(--line-strong); box-shadow: 0 16px 36px var(--shadow); }
  .add-view .results li button[data-i] { grid-template-columns: 56px 1fr auto; gap: 16px; }
  .add-view .results li button[data-i]:hover { background: none; }
  .add-view .results img, .add-view .results .noimg { width: 56px; height: 84px; border-radius: 8px; box-shadow: 0 8px 18px var(--shadow); }
  .add-view .results .r-title { font-size: 16px; }
  .add-view .results .r-sub { font-size: 13px; }

  /* ----- Community ----- */
  .community-friends > .muted { margin-bottom: 4px; }
  .f-main, .f-add { margin-top: 28px; }
  .f-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
  .f-tile { gap: 16px; padding: 16px 18px; border-color: transparent; }
  .f-tile .f-pic { width: 56px; height: 56px; font-size: 22px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line); }
  .f-tile-text b { font-size: 16px; }
  .f-go { transition: translate 0.25s, color 0.2s; }
  .f-tile:hover .f-go { translate: 4px 0; color: var(--accent); }
  .f-add { background: var(--card); border-color: var(--line-strong); }

  /* ----- a friend's page ----- */
  .f-hero { gap: 28px; }
  .f-hero .f-pic-lg { width: 112px; height: 112px; font-size: 40px; }
  .f-name-row { margin-bottom: 18px; }
  .f-section { margin-top: 36px; }
  .f-posters { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
  .f-poster { border-radius: 14px; transition: translate 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.3s; }
  .f-poster-card:hover .f-poster { transform: none; translate: 0 -5px; box-shadow: 0 18px 36px var(--shadow-deep), 0 0 0 2px var(--accent-line); }
  .f-list { gap: 8px; }
  .f-row { grid-template-columns: 72px 52px minmax(0, 1fr) auto; gap: 8px 18px; padding: 10px 20px 10px 4px; border-color: transparent; }
  .f-rank { font-size: 40px; color: transparent; -webkit-text-stroke: 1.2px var(--muted); opacity: 0.75; transition: color 0.2s, -webkit-text-stroke-color 0.2s; }
  .f-row:hover .f-rank { color: var(--accent); -webkit-text-stroke-color: var(--accent); opacity: 1; }
  .f-list .f-row:nth-child(1) .f-rank { color: var(--gold); -webkit-text-stroke: 0; opacity: 1; }
  .f-list .f-row:nth-child(2) .f-rank { color: var(--silver); -webkit-text-stroke: 0; opacity: 1; }
  .f-list .f-row:nth-child(3) .f-rank { color: var(--bronze); -webkit-text-stroke: 0; opacity: 1; }
  .f-thumb { border-radius: 7px; box-shadow: 0 6px 16px var(--shadow); }
  .f-row-title { font-size: 16px; }
  .f-row-text .muted { font-size: 13px; }
  .f-row .pill.mine { padding: 0; background: none; font-family: var(--display); letter-spacing: -0.03em; font-size: 21px; font-weight: 700; color: var(--gold); }

  /* ----- Profile ----- */
  .p-hero { gap: 30px; }
  .p-who { gap: 26px; }
  .p-pic { width: 112px; height: 112px; font-size: 42px; }
  .p-pic-badge { min-width: 34px; height: 30px; font-size: 20px; }
  .p-grid { gap: 16px; margin-top: 0; }
  .p-card { padding: 24px; border-color: transparent; }
  .p-card.p-alert { border-color: var(--accent-line); }
  .p-icon { width: 46px; height: 46px; border-radius: 14px; transition: scale 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4), box-shadow 0.3s; }
  .p-card:hover .p-icon { scale: 1.1; box-shadow: 0 0 24px var(--accent-glow); }
  .p-icon svg { width: 24px; height: 24px; }

  /* ----- Rating check ----- */
  .c-list { gap: 8px; margin-top: 22px; }
  .c-row { grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 18px; padding: 10px 16px 10px 12px; }
  .c-row .t-thumb { width: 48px; }
  .c-info { font-size: 15px; }
  .c-info .muted { font-size: 13px; }
  .c-change { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }

  /* ----- Tournament ----- */
  .tourney { max-width: var(--page); }
  .t-group { margin-top: 30px; }
  .t-opts { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  .t-opt { padding: 14px 16px; border-color: transparent; }
  .t-opt b { font-size: 16px; }
  .t-opt.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line) inset, 0 12px 30px var(--accent-glow); }
  .t-formats { grid-template-columns: repeat(3, 1fr); }
  .t-go { position: sticky; bottom: 0; z-index: 2; margin-top: 30px; padding: 18px 0 22px; background: linear-gradient(transparent, var(--bg) 30%); border-top: 0; }
  .t-champ { gap: 28px; margin: 22px 0 10px; }
  .t-champ-poster { width: 150px; box-shadow: 0 0 0 3px var(--gold), 0 0 50px rgba(255, 208, 77, 0.35); }
  .t-champ h2 { font-size: 36px; }
  .t-list { gap: 8px; }
  .t-list li { gap: 18px; padding: 10px 20px 10px 8px; }
  .t-rank { width: 56px; font-size: 38px; }
  .t-thumb { width: 44px; border-radius: 6px; box-shadow: 0 6px 16px var(--shadow); }
  .t-name { font-size: 16px; }
  .t-avg { font-size: 13px; }
  .t-head { margin-bottom: 8px; }
  .t-match { gap: 40px; margin-top: 30px; }
  .t-pick { padding: 16px; border-color: transparent; background: var(--card); }
  .t-pick strong { font-size: 19px; }
  .t-poster { box-shadow: 0 20px 44px var(--shadow-deep); }
  .t-pick:hover { box-shadow: 0 0 0 2px var(--accent-line), 0 24px 50px var(--accent-glow); }
  .vs { font-size: 44px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* ----- Rate famous movies: the card is lit by its poster ----- */
  .w-head { margin-bottom: 24px; }
  .w-deck { position: relative; isolation: isolate; background: var(--card); border-color: var(--line-strong); box-shadow: 0 30px 70px var(--shadow); }
  .w-card { position: relative; isolation: isolate; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; padding: 32px; }
  .w-glow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    filter: blur(60px) saturate(1.6);
    scale: 1.3;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.55) 50%, transparent 95%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.55) 50%, transparent 95%);
    pointer-events: none;
  }
  .w-poster { border-radius: 16px; box-shadow: 0 26px 56px var(--shadow-deep); animation: w-float 7s ease-in-out infinite; }
  .w-title { font-size: clamp(38px, 3.4vw, 58px); line-height: 0.98; }
  .w-info { gap: 12px; }
  .w-info > .muted { font-size: 15px; }
  .w-glyph { font-size: 40px; }
  .w-n { font-size: 12px; }
  .w-stars { gap: 4px; margin-top: 10px; }
  .w-actions { max-width: 520px; margin-top: 14px; }
  .w-actions .btn, .w-undo { background: rgba(16, 20, 27, 0.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .w-foot { padding: 16px 32px; }

  /* the Add to Home Screen pill: tucked in the corner, clear of the page */
  .install-pill { left: auto; right: 28px; bottom: 28px; translate: none; animation-name: pill-in-corner; }
  @keyframes pill-in-corner { from { opacity: 0; translate: 0 12px; } }

  @media (prefers-reduced-motion: reduce) {
    .view-h, .tourney .t-card > h2, .t-head h2 { animation: none; background-position: 100% 0; }
    .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .f-poster-card, .fy-item, .w-poster { animation: none; }
  }
}

/* ---------- phones and tablets: the same look, sized for a small screen ----------
   Everything the desktop pages have except hover: titles shine, headers sit
   on the page, numbers are big, the top three are lit by their posters, rows
   rise in as you scroll, and tiles give a little press when you tap them. */

@media (max-width: 1023px) {
  /* titles */
  .view-h, .lh-title, .tourney .t-card > h2, .t-head h2 {
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1;
    letter-spacing: -0.035em;
    background: linear-gradient(100deg, var(--text) 0%, var(--text) 35%, var(--accent) 50%, var(--accent-2) 58%, var(--text) 72%, var(--text) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lh-shine 9s ease-in-out infinite;
  }

  /* the list: "My top N" above it */
  .list-hero { display: block; margin: 0 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .list-hero[hidden] { display: none; }
  .lh-title { margin: 0; font-family: var(--display); letter-spacing: -0.03em; font-weight: 700; font-size: clamp(36px, 9.6vw, 47px); }
  .lh-title span { -webkit-text-stroke: 1.5px var(--accent); }
  .lh-sub { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
  .lh-sub b { color: var(--gold); }
  .lh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

  /* rows: glass, outlined ranks, a press when tapped */
  .row { isolation: isolate; overflow: hidden; border-color: transparent; transition: border-color 0.15s, scale 0.15s; }
  .row:active { scale: 0.985; }
  .rank:not(.gold):not(.silver):not(.bronze) { color: transparent; -webkit-text-stroke: 1.3px var(--muted); }
  #list > .row.drop-slot .rank { color: var(--accent); -webkit-text-stroke: 0; opacity: 1; }
  .row .poster { box-shadow: 0 6px 16px var(--shadow); }

  /* the top three: bigger, lit by their own poster; #1 gets the gold sheen */
  #list > .row:nth-child(-n+3) { padding-block: 12px; border-color: var(--line); }
  #list > .row:nth-child(-n+3) .rank { font-size: 52px; text-shadow: 0 0 26px currentColor; }
  #list > .row:nth-child(-n+3) .poster { box-shadow: 0 12px 26px var(--shadow-deep); }
  #list > .row:nth-child(-n+3) .title { font-size: 17px; }
  #list > .row:nth-child(-n+3) .row-glow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    filter: blur(28px) saturate(1.6);
    scale: 1.4;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.5) 50%, transparent 95%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.5) 50%, transparent 95%);
    pointer-events: none;
  }
  #list > .row:nth-child(1) { border-color: rgba(255, 208, 77, 0.45); box-shadow: 0 14px 34px rgba(255, 208, 77, 0.1); }
  #list > .row:nth-child(1)::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255, 208, 77, 0.16) 50%, transparent 65%); translate: -100% 0; animation: no1-sheen 7s ease-in-out 1.2s infinite; }
  #list > .row.drop-slot .row-glow { visibility: hidden; }
  #list > .row.drop-slot { border-color: var(--accent-line); box-shadow: none; }

  /* headers sit on the page, not in a card */
  .p-hero, .f-hero, .tourney > .t-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .p-hero, .f-hero { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }

  /* numbers: big figures, no boxes */
  .p-stats, .f-stats { display: flex; flex-wrap: wrap; gap: 14px 28px; }
  .p-stat, .f-stats span { display: flex; flex-direction: column; gap: 3px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
  .p-stat b, .f-stats b { color: var(--text); font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 0.9; letter-spacing: -0.03em; text-transform: none; }
  .f-stats b { font-size: 34px; }
  .p-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 10px; }
  .p-stat b { font-size: 36px; }
  .f-stats .f-match { border: 0; background: none; }
  .f-stats .f-match b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

  /* tiles and rows on every page: glass, with a press when tapped */
  .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .t-opt { background: var(--card); transition: scale 0.15s, border-color 0.15s, opacity 0.2s, transform 0.2s; }
  .r-card, .f-row, .f-tile, .p-card { border-color: transparent; }
  .c-row, .t-list li { border: 1px solid transparent; }
  .r-card:active, .f-row:active, .f-tile:active, .p-card:active, .t-opt:active { scale: 0.98; }
  .p-card.p-alert { border-color: var(--accent-line); }

  /* posters get some depth */
  .r-poster, .f-thumb, .t-thumb, .fy-poster, .f-poster { box-shadow: 0 8px 20px var(--shadow); }

  /* For You and the watchlist: a two-column poster grid */
  #view-foryou .r-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
  #view-foryou .r-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; padding: 8px 8px 12px; }
  #view-foryou .r-poster { border-radius: 10px; box-shadow: 0 12px 26px var(--shadow-deep); }
  #view-foryou .r-info { display: flex; flex-direction: column; flex: 1; gap: 3px; padding: 0 2px; }
  #view-foryou .r-title { font-size: 14px; line-height: 1.3; }
  #view-foryou .r-meta { font-size: 12px; }
  #view-foryou .r-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; }
  #view-foryou .r-actions { flex-direction: column; align-items: stretch; gap: 6px; margin-top: auto; padding-top: 8px; }
  #view-foryou .r-actions .btn { text-align: center; padding: 8px 6px; font-size: 12.5px; }
  /* "Not for me": a ✕ on the poster's corner */
  #view-foryou .r-actions [data-r="no"] { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(16, 20, 27, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 0; }
  #view-foryou .r-actions [data-r="no"]::before { content: "✕"; color: var(--text); font-size: 13px; }

  /* Add: a bigger search field and card results */
  .add-view .search input { padding: 14px 20px; background: var(--card); border-color: var(--line-strong); box-shadow: 0 12px 30px var(--shadow); }
  .add-view .search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 36px var(--accent-glow); }
  .add-view .results { display: grid; gap: 8px; padding: 0; background: none; border: 0; }
  .add-view .results li:not(.hint) { padding: 6px 8px 6px 6px; border-radius: 14px; background: var(--card); }
  .add-view .results li button[data-i] { grid-template-columns: 48px 1fr auto; gap: 12px; }
  .add-view .results li button[data-i]:hover { background: none; }
  .add-view .results img, .add-view .results .noimg { width: 48px; height: 72px; border-radius: 7px; box-shadow: 0 6px 14px var(--shadow); }

  /* a friend's page: their ranking like yours */
  .f-hero .f-pic-lg { width: 76px; height: 76px; }
  .f-name-row { margin-bottom: 14px; }
  .f-row { grid-template-columns: 40px 44px minmax(0, 1fr) auto; row-gap: 10px; }
  .f-acts { grid-column: 2 / -1; flex-wrap: nowrap; gap: 8px; }
  .f-act { flex: 1 1 0; min-width: 0; padding: 8px 10px; text-align: center; }
  .f-rank { font-size: 30px; color: transparent; -webkit-text-stroke: 1.3px var(--muted); }
  .f-list .f-row:nth-child(1) .f-rank { color: var(--gold); -webkit-text-stroke: 0; opacity: 1; }
  .f-list .f-row:nth-child(2) .f-rank { color: var(--silver); -webkit-text-stroke: 0; opacity: 1; }
  .f-list .f-row:nth-child(3) .f-rank { color: var(--bronze); -webkit-text-stroke: 0; opacity: 1; }
  .f-row .pill.mine { padding: 0; background: none; font-family: var(--display); letter-spacing: -0.03em; font-size: 18px; font-weight: 700; color: var(--gold); }
  .f-tile .f-pic { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line); }

  /* Profile */
  .p-pic { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-line), 0 0 30px var(--accent-glow); }

  /* Tournament */
  .t-opt { border-color: transparent; }
  .t-opt.on { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line) inset, 0 10px 24px var(--accent-glow); }
  .t-list li { gap: 12px; padding: 8px 12px 8px 6px; }
  .t-rank { font-size: 30px; }
  .t-list .t-thumb { width: 40px; border-radius: 6px; }
  .t-pick { border-color: transparent; background: var(--card); }
  .t-poster { box-shadow: 0 14px 30px var(--shadow-deep); }
  .vs { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .t-champ-poster { box-shadow: 0 0 0 3px var(--gold), 0 0 36px rgba(255, 208, 77, 0.35); }

  /* Rating check */
  .c-change { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.03em; }

  /* Rate famous movies: the card is lit by its poster, and the poster floats */
  .w-deck { position: relative; isolation: isolate; border-color: var(--line-strong); box-shadow: 0 24px 50px var(--shadow); }
  .w-card { position: relative; isolation: isolate; }
  .w-glow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    filter: blur(50px) saturate(1.6);
    scale: 1.3;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 55%, transparent 100%);
    pointer-events: none;
  }
  .w-poster { box-shadow: 0 20px 44px var(--shadow-deep); animation: w-float 7s ease-in-out infinite; }
  .w-actions .btn, .w-undo { background: rgba(16, 20, 27, 0.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

  /* everything rises in as it scrolls into view */
  @supports (animation-timeline: view()) and (not (-webkit-touch-callout: none)) {
    #list > .row, .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .f-poster-card { animation: row-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
  #list > .row.flash { animation: flash 1.6s ease-out; }

  @media (prefers-reduced-motion: reduce) {
    .view-h, .lh-title, .tourney .t-card > h2, .t-head h2 { animation: none; background-position: 100% 0; }
    #list > .row, #list > .row:nth-child(1)::after, .r-card, .f-row, .c-row, .t-list li, .f-tile, .p-card, .f-poster-card, .w-poster { animation: none; }
  }
}

/* phones: the list's shortcuts live in the tab bar and Profile */
@media (max-width: 760px) {
  .lh-actions, .lh-tip { display: none; }
}

/* ---------- notifications: what friends have just ranked (notifications.js) ---------- */

.notif-btn {
  position: relative;
  grid-column: -2;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.notif-btn:hover { color: var(--text); border-color: var(--line-strong); }
.notif-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 0 0 2px var(--bg);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
body.in-welcome .notif-btn { display: none; }
/* desktop: the sidebar has no room beside the name, so the bell sits at the page's top right */
@media (min-width: 1024px) {
  .notif-btn { position: fixed; top: 22px; right: 24px; z-index: 25; box-shadow: 0 6px 18px var(--shadow); }
}

/* Full screen, like a page of its own: a header with ✕ and every movie a row. */
.notif-dlg { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; display: none; flex-direction: column; background: var(--bg); }
.notif-dlg[open] { display: flex; }
.nt-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right), calc(50vw - 320px)) 12px max(16px, env(safe-area-inset-left), calc(50vw - 320px)); border-bottom: 1px solid var(--line); background: var(--panel); }
.nt-head h2 { margin: 0; }
.nt-close { width: 40px; height: 40px; font-size: 18px; }
.nt-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 12px max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.nt-scroll > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.nt-empty { padding: 24px 6px; text-align: center; }
.nt-list { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 14px; }
.nt-list > li, .nt-rows > li { min-width: 0; } /* long titles shorten instead of widening the panel */
.nt-item { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.nt-item.unread { border-color: var(--accent-line); }
.nt-item.unread .nt-who { background: var(--accent-soft); }
.nt-item a { color: inherit; text-decoration: none; }
.nt-who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nt-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nt-line { font-size: 15px; font-weight: 700; line-height: 1.3; }
.nt-go { color: var(--muted); font-size: 22px; line-height: 1; }
.nt-rows { list-style: none; margin: 0; padding: 4px 0; }
.nt-rows a { display: flex; align-items: center; gap: 12px; padding: 7px 14px; font-size: 14px; }
.nt-rows a:hover { background: var(--panel-2); }
.nt-rows > li + li a { border-top: 1px solid var(--line); }
.nt-thumb { flex: none; width: 34px; height: 51px; overflow: hidden; border-radius: 5px; background: var(--panel-2); }
.nt-thumb img, .nt-thumb .noimg { width: 100%; height: 100%; object-fit: cover; font-size: 12px; }
.nt-rank { width: 22px; flex: none; color: var(--muted); font-weight: 800; text-align: right; }
.nt-rows.ranked li:nth-child(1) .nt-rank { color: var(--gold); }
.nt-rows.ranked li:nth-child(2) .nt-rank { color: var(--silver); }
.nt-rows.ranked li:nth-child(3) .nt-rank { color: var(--bronze); }
.nt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nt-star { flex: none; color: var(--gold); font-weight: 800; font-size: 14px; }
.nt-star.none { color: var(--muted); font-weight: 600; font-size: 12px; }
/* a movie a friend shared: its row is a button that opens the movie */
.nt-rows button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 14px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.nt-rows button:hover { background: var(--panel-2); }
.nt-ask { flex: none; color: var(--accent); font-weight: 700; font-size: 13px; }

/* ---------- sharing a movie with friends (share.js) ---------- */
.d-share { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.d-share svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.d-friends:empty { display: none; }
.d-friends-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.d-friends-list li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); font-size: 13px; }
.d-friends-list .nt-star { font-size: 13px; }
.share-dlg { width: min(460px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 48px)); padding: 20px; }
.sh-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sh-thumb { flex: none; width: 44px; height: 66px; overflow: hidden; border-radius: 6px; background: var(--panel-2); }
.sh-thumb img, .sh-thumb .noimg { width: 100%; height: 100%; object-fit: cover; }
.sh-what { flex: 1; min-width: 0; }
.sh-what .eyebrow { margin: 0 0 2px; }
.modal .sh-what h2 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.sh-friends { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.sh-friends label { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.sh-friends label:hover { background: var(--panel-2); }
.sh-friends label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.sh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sh-friends input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
/* phones: Share is just its icon, so the card's other buttons keep their room */
@media (max-width: 760px) {
  .d-foot:has(.d-share) { grid-template-columns: auto; }
  .d-foot .d-share { padding-inline: 13px; }
  .d-share span { display: none; }
}

/* ---------- Community: Friends and Everyone as plain rows (people.js) ---------- */

.comm-tabs { margin-bottom: 12px; gap: clamp(12px, 4vw, 22px); }
/* Friends · Community · Add friends fit on one line on a phone (320px and up) */
@media (max-width: 1023px) { .comm-tabs .h-tab { font-size: clamp(17.5px, 5.4vw, 30px); } }
.community-friends { display: grid; gap: 22px; }
.pp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pp-row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.pp-main { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.pp-main:hover .pp-name { color: var(--accent); }
.pp-pic { flex: none; width: 46px; height: 46px; border-radius: 10px; object-fit: cover; object-position: center 25%; background: var(--panel-2); }
.pp-initial { display: grid; place-items: center; background: var(--accent-grad); color: var(--accent-ink); font-size: 18px; font-weight: 800; }
.pp-text { display: grid; gap: 2px; min-width: 0; }
.pp-name { overflow: hidden; font-size: 15.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pp-meta { color: var(--muted); font-size: 13px; line-height: 1.35; }
.pp-match { color: var(--accent); font-weight: 700; }
.pp-act { display: flex; flex: none; align-items: center; gap: 6px; }
.pp-go { padding: 0 2px 0 6px; color: var(--muted); font-size: 22px; line-height: 1; }
.pp-search { position: relative; }
.pp-search svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; translate: 0 -50%; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.pp-search input { width: 100%; padding: 12px 14px 12px 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); }
.pp-search input:focus { border-color: var(--accent-line); outline: none; }
.pp-results { margin-top: 12px; }
.pp-note { padding: 18px 2px; }
#community-people { gap: 12px; }

/* The List page: your reliability beside "My top N", just the ring and its
   number, no bigger than the title's capitals (--ring follows the title's size) */
.lh-title-row { --ring: clamp(28px, 7.5vw, 36px); display: flex; align-items: center; gap: 0.4em; }
@media (min-width: 1024px) { .lh-title-row { --ring: clamp(36px, 3.6vw, 58px); } }
.lh-title-row .rel-ring { flex: none; width: var(--ring); }
.lh-title-row .rel-ring svg { width: var(--ring); height: var(--ring); }
.lh-title-row .rel-ring b { width: var(--ring); height: var(--ring); font-size: calc(var(--ring) * 0.36); }
.lh-title-row .rel-ring span { display: none; }
@media (min-width: 1024px) { .community-friends { max-width: 820px; } }

/* ---------- signing in with your email: a 6-digit code (emailsignin.js) ---------- */

.signin-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; text-transform: lowercase; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.signin-email { display: grid; gap: 10px; }
.signin-email[hidden], .signin-email input[hidden] { display: none; }
.signin-email input { width: 100%; padding: 13px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 16px; text-align: center; }
.signin-email input::placeholder { color: var(--muted); }
.signin-email input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.signin-go { width: 100%; padding: 13px 18px; border-radius: 999px; font-size: 16px; }
.signin-code-sent { margin: 0 0 4px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.signin-code-sent b { color: var(--text); }
.signin-email input.signin-code { padding: 12px 18px; border-radius: 16px; font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 0.5em; text-indent: 0.5em; font-variant-numeric: tabular-nums; }
.signin-code-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.signin-code-links .link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
/* While you type the code, the other ways to sign in step aside. */
.signin-card .signin-away { display: none !important; }
