/* movies — a small warm shelf for two people. Dark only, rounded everywhere, phone first. */

:root {
  --ink: #171320;
  --ink-2: #1e1829;
  --surface: #241d31;
  --surface-2: #2d2440;
  --line: #3a2f4e;
  --cream: #f7f0ea;
  --muted: #a697bc;
  --faint: #7a6c92;

  --rose: #ff92a8;
  --lilac: #b9a0ff;
  --butter: #ffd79a;
  --mint: #8fe6c4;
  --accent: var(--rose);

  --r-sm: 0.6rem;
  --r-md: 1rem;
  --r-lg: 1.4rem;
  --r-xl: 2rem;

  --pad: 1rem;
  --shadow: 0 1.2rem 2.4rem rgb(8 4 16 / 0.45);
  --shadow-soft: 0 0.4rem 1.2rem rgb(8 4 16 / 0.3);

  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --font-display: var(--font);
  --tap: 2.75rem;
}

[data-accent="rose"] { --accent: var(--rose); }
[data-accent="lilac"] { --accent: var(--lilac); }
[data-accent="butter"] { --accent: var(--butter); }
[data-accent="mint"] { --accent: var(--mint); }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(90rem 50rem at 15% -10%, #2a1d3a 0%, transparent 60%),
    radial-gradient(70rem 40rem at 110% 0%, #2b1f31 0%, transparent 55%),
    var(--ink);
  color: var(--cream);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: calc(4.6rem + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
}

body.has-sheet { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

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

::selection { background: var(--lilac); color: #1a1326; }

/* ---- chrome ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: calc(0.7rem + env(safe-area-inset-top)) var(--pad) 0.7rem;
  background: linear-gradient(var(--ink) 65%, transparent);
  backdrop-filter: blur(0.6rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__mark {
  color: var(--rose);
  font-size: 1.1rem;
  animation: breathe 7s ease-in-out infinite;
}

.brand__text { color: var(--cream); }

.topbar__title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--faint);
}

.topbar__title::before { content: "/ "; }

.app {
  padding: 0 var(--pad) 2rem;
  max-width: 78rem;
  margin: 0 auto;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  gap: 0.2rem;
  padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgb(23 19 32 / 0.9);
  backdrop-filter: blur(0.8rem);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.35rem 0.2rem;
  border-radius: var(--r-md);
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  transition: color 0.18s, background 0.18s, transform 0.18s;
}

.tab__glyph { font-size: 1.15rem; line-height: 1.1; }
.tab.is-on { color: var(--cream); background: var(--surface); }
.tab.is-on .tab__glyph { color: var(--rose); }
.tab:active { transform: scale(0.94); }

.backlink {
  display: inline-block;
  margin: 0.2rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- bits ------------------------------------------------------------------ */

.icon { width: 1.15em; height: 1.15em; display: block; }

.count {
  color: var(--faint);
  font-size: 0.8rem;
  margin: 0.4rem 0 0.7rem;
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.tag--score { color: var(--accent); background: color-mix(in oklab, var(--accent) 16%, transparent); }

.sectiontitle { margin: 0.6rem 0 1rem; }
.sectiontitle h2 { font-size: 1.5rem; }
.sectiontitle p { color: var(--faint); font-size: 0.85rem; }

.modeblurb {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.2rem 0 0.9rem;
  max-width: 34rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--cream);
  font-weight: 560;
  cursor: pointer;
  transition: transform 0.14s, background 0.18s, border-color 0.18s, opacity 0.18s;
}

.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn--primary {
  background: linear-gradient(140deg, var(--rose), #e879a8 60%, var(--lilac));
  border-color: transparent;
  color: #22142a;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(140deg, var(--rose), #e879a8 60%, var(--lilac)); }
.btn--ghost { background: transparent; }
.btn--small { min-height: 2.2rem; padding: 0.25rem 0.75rem; font-size: 0.82rem; }
.btn--big { min-height: 3.2rem; padding: 0.6rem 1.6rem; font-size: 1.05rem; }
.btn--wide { width: 100%; }
.btn[data-accent] { border-color: color-mix(in oklab, var(--accent) 45%, transparent); color: var(--accent); }

.linkbtn {
  background: none;
  border: 0;
  padding: 0.3rem 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.linkbtn--danger { color: #ff9a9a; }

.chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  min-height: 2.1rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.14s;
}

.chip:active { transform: scale(0.95); }
.chip.is-on { background: var(--surface-2); color: var(--cream); border-color: var(--surface-2); }
.chiprow--people .chip.is-on {
  color: #22142a;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 650;
}
.chiprow--big .chip { min-height: 2.8rem; padding: 0.4rem 1.4rem; font-size: 1rem; }

.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--faint);
}

.search:focus-within { border-color: var(--lilac); color: var(--lilac); }
.search--big { padding: 0.25rem 1rem; }

.search__input {
  flex: 1;
  min-height: var(--tap);
  border: 0;
  background: none;
  outline: none;
  color: var(--cream);
}

.search__input::placeholder { color: var(--faint); }
.search__input::-webkit-search-cancel-button { filter: invert(0.6); }

/* ---- library --------------------------------------------------------------- */

.controls {
  display: grid;
  gap: 0.5rem;
  margin: 0.2rem 0 0.4rem;
}

.chiprow--sort { font-variant-caps: all-small-caps; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr));
  gap: 0.75rem 0.6rem;
}

.card {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 14rem;
  transition: transform 0.16s;
}

.card:active { transform: scale(0.96); }
.card:hover .poster { box-shadow: 0 0.8rem 1.6rem rgb(8 4 16 / 0.55); transform: translateY(-2px); }

.card__art { position: relative; }

.card__meta { display: grid; gap: 0.05rem; padding: 0 0.1rem; }

.card__title {
  font-size: 0.8rem;
  font-weight: 560;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__sub { font-size: 0.7rem; color: var(--faint); }

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(165deg, hsl(var(--poster-hue, 300) 42% 32%), hsl(calc(var(--poster-hue, 300) + 45) 38% 16%));
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s, box-shadow 0.16s;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster--blank { display: grid; place-items: center; }

.poster__initials {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: rgb(255 255 255 / 0.55);
  letter-spacing: 0.02em;
}

.pips {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  display: flex;
  gap: 0.2rem;
}

.pip {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #22142a;
  font-size: 0.65rem;
  font-weight: 750;
  box-shadow: 0 0.2rem 0.5rem rgb(0 0 0 / 0.4);
}

.pip--listed { background: transparent; border: 2px solid var(--accent); }
.pip--seen { background: color-mix(in oklab, var(--accent) 55%, #2a2036); }

/* ---- sheet ----------------------------------------------------------------- */

.sheet__scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(10 6 18 / 0.6);
  backdrop-filter: blur(0.2rem);
  animation: fade 0.2s ease;
}

.sheet {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92dvh;
  overflow: hidden auto;
  overscroll-behavior: contain;
  background: var(--ink-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateY(102%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.sheet--on { transform: translateY(0); }

.sheet__close {
  position: sticky;
  top: 0.6rem;
  float: right;
  margin: 0.6rem 0.8rem 0 0;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgb(23 19 32 / 0.75);
  color: var(--cream);
  cursor: pointer;
  z-index: 2;
}

.sheet__body { padding: 0 var(--pad); }

.sheet__backdrop {
  position: relative;
  height: 9rem;
  margin: 0 calc(var(--pad) * -1) 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0.6;
}

.sheet__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, var(--ink-2));
}

.sheet__head {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.9rem;
  margin-top: -2.5rem;
  position: relative;
}

.sheet__poster .poster { box-shadow: var(--shadow); }
.sheet__headtext { align-self: end; display: grid; gap: 0.25rem; }
.sheet__title { font-size: 1.45rem; line-height: 1.15; }
.sheet__original { color: var(--faint); font-size: 0.82rem; }
.sheet__facts { color: var(--muted); font-size: 0.82rem; }
.sheet__genres { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.sheet__tagline {
  margin-top: 1rem;
  color: var(--butter);
  font-style: italic;
}

.sheet__overview { margin-top: 0.7rem; color: var(--cream); opacity: 0.9; }
.sheet__credits { margin-top: 0.6rem; color: var(--faint); font-size: 0.82rem; }

.sheet__people {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0 0.4rem;
}

.personrow {
  padding: 0.7rem 0.8rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}

.personrow__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.personrow__name { font-weight: 650; color: var(--accent); }

.marks { display: flex; gap: 0.3rem; }

.mark {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: transform 0.14s, color 0.16s, background 0.16s, border-color 0.16s;
}

.mark:active { transform: scale(0.9); }
.mark.is-on { color: #22142a; background: var(--accent); border-color: var(--accent); }

.rating { display: flex; gap: 0.22rem; }

.rating__dot {
  flex: 1;
  min-width: 0;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--faint);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}

.rating__dot:active { transform: scale(0.9); }
.rating__dot.is-on {
  background: color-mix(in oklab, var(--accent) 80%, #2a2036);
  border-color: transparent;
  color: #22142a;
  font-weight: 700;
}

.moodbars { display: grid; gap: 0.25rem; min-width: 7rem; }

.moodbar { display: flex; align-items: center; gap: 0.4rem; }
.moodbar__label { width: 3.4rem; font-size: 0.68rem; color: var(--faint); }

.moodbar__track {
  flex: 1;
  height: 0.3rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.moodbar__fill { display: block; height: 100%; border-radius: 999px; background: var(--lilac); }
.moodbar[data-axis="intensity"] .moodbar__fill { background: var(--rose); }
.moodbar[data-axis="tone"] .moodbar__fill { background: var(--butter); }

.moodedit {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0.6rem 0.8rem;
  background: var(--surface);
}

.moodedit summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.moodedit__body { display: grid; gap: 0.7rem; padding-top: 0.8rem; }

.slider { display: grid; gap: 0.2rem; }
.slider__ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--faint); }

.sheet__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.6rem;
  background: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--surface-2);
}

input[type="range"]::-moz-range-track {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--surface-2);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: -0.48rem;
  border-radius: 999px;
  background: var(--rose);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-soft);
}

input[type="range"]::-moz-range-thumb {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--rose);
  border: 2px solid var(--ink);
}

input[type="range"]:disabled { opacity: 0.35; }

/* ---- picking --------------------------------------------------------------- */

.hubgroup__head { margin: 1.3rem 0 0.6rem; }
.hubgroup__head h3 { font-size: 1.05rem; }
.hubgroup__head p { color: var(--faint); font-size: 0.8rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.6rem;
}

.tile {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  padding: 0.9rem;
  min-height: 7.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface), var(--ink-2));
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.tile:hover { border-color: color-mix(in oklab, var(--lilac) 45%, transparent); box-shadow: var(--shadow-soft); }
.tile:active { transform: scale(0.97); }
.tile__glyph { font-size: 1.4rem; color: var(--rose); }
.tile__name { font-weight: 650; }
.tile__blurb { color: var(--faint); font-size: 0.76rem; line-height: 1.35; }

.filters {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-2);
}

.filters__group { display: grid; gap: 0.35rem; }

.filters__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--faint);
}

.filters__group--dials { gap: 0.5rem; }

.dial {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
  transition: opacity 0.18s;
}

.dial.is-on { opacity: 1; }

.dial__toggle {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.dial.is-on .dial__toggle { background: var(--lilac); border-color: var(--lilac); color: #22142a; }
.dial__body { display: grid; }
.dial__ends { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--faint); }

.stage { min-height: 6rem; }

.verdict { display: grid; gap: 0.8rem; }

.verdict__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}

.verdict__clock { color: var(--butter); font-size: 0.85rem; }
.verdict__final { color: var(--faint); font-size: 0.8rem; }

.verdict__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pickcard {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--surface), var(--ink-2));
  box-shadow: var(--shadow-soft);
  animation: rise 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.pickcard__body { display: grid; gap: 0.4rem; align-content: start; }
.pickcard__title { font-size: 1.25rem; line-height: 1.15; }
.pickcard__facts { color: var(--muted); font-size: 0.8rem; }
.pickcard__tagline { color: var(--butter); font-style: italic; font-size: 0.85rem; }

.pickcard__overview {
  font-size: 0.86rem;
  color: var(--cream);
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pickcard__why { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }

.spinner { width: 8rem; margin: 1rem auto; animation: wobble 0.5s ease-in-out infinite alternate; }

.shortlist { display: grid; gap: 0.9rem; }
.shortlist__item { display: grid; gap: 0.5rem; }
.shortlist__actions { display: flex; gap: 0.5rem; }

.rows { display: grid; gap: 0.4rem; }

.row {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.7rem 0.4rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, transform 0.14s;
}

.row:hover { background: var(--surface); }
.row:active { transform: scale(0.99); }
.row__art .poster { border-radius: var(--r-sm); }
.row__text { display: grid; }
.row__title { font-weight: 560; font-size: 0.92rem; }
.row__sub { color: var(--faint); font-size: 0.75rem; }
.row__clock { color: var(--butter); font-size: 0.75rem; white-space: nowrap; }

.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
}

.duel__vs { color: var(--faint); font-size: 0.8rem; }

.contender {
  display: grid;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s;
}

.contender:hover { transform: translateY(-3px); }
.contender:active { transform: scale(0.97); }
.contender__title { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.contender__sub { color: var(--faint); font-size: 0.75rem; }

.hand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}

.handcard {
  display: grid;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s, opacity 0.22s, filter 0.22s;
}

.handcard:hover { transform: translateY(-3px); }
.handcard__title { font-size: 0.76rem; font-weight: 560; line-height: 1.2; }
.handcard__sub { font-size: 0.68rem; color: var(--faint); }

.handcard--burnt {
  opacity: 0;
  transform: translateY(1.2rem) rotate(-6deg) scale(0.9);
  filter: grayscale(1);
}

.wheel {
  position: relative;
  width: min(20rem, 86vw);
  aspect-ratio: 1;
  margin: 1.2rem auto;
}

.wheel__face {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 0.4rem solid var(--surface-2);
  box-shadow: var(--shadow);
}

.wheel__label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  font-size: 0.62rem;
  font-weight: 650;
  color: rgb(255 255 255 / 0.9);
  white-space: nowrap;
  pointer-events: none;
}

.wheel__pin {
  position: absolute;
  top: -0.6rem;
  left: 50%;
  translate: -50% 0;
  width: 0;
  height: 0;
  border-left: 0.6rem solid transparent;
  border-right: 0.6rem solid transparent;
  border-top: 1.1rem solid var(--butter);
  z-index: 2;
  filter: drop-shadow(0 0.2rem 0.3rem rgb(0 0 0 / 0.5));
}

.ladder__yes { margin: 0.9rem 0 0.6rem; }
.ladder__no { display: grid; gap: 0.35rem; }

.trail { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-bottom: 0.7rem; }
.trail__label { font-size: 0.72rem; color: var(--faint); letter-spacing: 0.06em; }

.blind {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.6rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-xl);
  background: var(--ink-2);
  text-align: center;
}

.blind__mask {
  width: 5rem;
  height: 7.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--surface-2), var(--ink));
  font-size: 2.4rem;
  color: var(--faint);
}

.blind__facts { color: var(--muted); font-size: 0.9rem; }
.blind__words { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }
.blind__tease { color: var(--cream); opacity: 0.85; max-width: 28rem; font-size: 0.9rem; }

.commit { display: grid; justify-items: center; gap: 1rem; margin: 1rem 0; }
.commit__seal { width: 7rem; animation: breathe 3.4s ease-in-out infinite; }
.reveal { animation: reveal 0.5s cubic-bezier(0.2, 0.9, 0.2, 1); }

.swipe {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
  padding: 0.4rem 0 0.8rem;
}

.swipe__art { width: min(14rem, 54vw); }
.swipe__title { font-size: 1.3rem; line-height: 1.15; }
.swipe__sub { color: var(--muted); font-size: 0.85rem; }
.swipe__overview {
  color: var(--cream);
  opacity: 0.8;
  font-size: 0.85rem;
  max-width: 30rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe__actions { display: flex; gap: 0.5rem; justify-content: center; }
.swipe__actions .btn { flex: 1; max-width: 10rem; }
.swipe__rate { display: grid; gap: 0.3rem; margin-top: 1rem; }

.joinpanel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.joincode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.2rem;
  letter-spacing: 0.25em;
  color: var(--butter);
}

/* ---- add, import, shelf ----------------------------------------------------- */

.results { display: grid; gap: 0.6rem; }

.result {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-2);
  transition: opacity 0.3s, background 0.2s;
}

.result--done { opacity: 0.5; background: var(--surface); }

.result__art {
  width: 3.6rem;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-2);
}

.result__art--blank { display: grid; place-items: center; color: var(--faint); font-weight: 700; }
.result__text { display: grid; gap: 0.25rem; }
.result__title { font-size: 1rem; }
.result__sub { color: var(--faint); font-size: 0.78rem; }

.result__overview {
  font-size: 0.8rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result__actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.2rem; }

.steps {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  display: grid;
  gap: 0.25rem;
}

.steps a { color: var(--lilac); text-decoration: underline; text-underline-offset: 0.2em; }

.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field__label { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--faint); }

.filepick {
  padding: 0.6rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  width: 100%;
}

.csvbox {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  color: var(--cream);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  resize: vertical;
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.checkline input { margin-top: 0.3rem; accent-color: var(--rose); }

.progress {
  position: relative;
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, color-mix(in oklab, var(--rose) 30%, transparent), color-mix(in oklab, var(--lilac) 30%, transparent));
  transition: width 0.3s ease;
}

.progress__text { position: relative; font-size: 0.85rem; color: var(--cream); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.stat {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--r-md);
  background: var(--ink-2);
  border: 1px solid var(--line);
}

.stat[data-accent] { border-color: color-mix(in oklab, var(--accent) 30%, transparent); }
.stat__value { font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); }
.stat[data-accent] .stat__value { color: var(--accent); }
.stat__label { font-size: 0.7rem; color: var(--faint); }

.colophon { margin-top: 2rem; color: var(--faint); font-size: 0.75rem; display: grid; gap: 0.2rem; }

/* ---- states ---------------------------------------------------------------- */

.empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 3rem 1rem;
  text-align: center;
  grid-column: 1 / -1;
}

.empty__mark { font-size: 1.6rem; color: var(--faint); }
.empty__message { font-size: 1rem; }
.empty__hint { color: var(--faint); font-size: 0.85rem; max-width: 22rem; }

.splash {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 25dvh 1rem;
  color: var(--faint);
}

.splash__mark { font-size: 2rem; color: var(--rose); animation: breathe 1.6s ease-in-out infinite; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.4rem + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 60;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(0.8rem);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast--on { opacity: 1; transform: translateY(0); }
.toast[data-tone="warn"] { border-color: #ff9a9a; color: #ffc9c9; }

/* ---- motion ---------------------------------------------------------------- */

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(0.8rem); } }
@keyframes reveal { from { opacity: 0; transform: scale(0.94) rotate(-1.5deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes wobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- bigger screens --------------------------------------------------------- */

@media (min-width: 46rem) {
  :root { --pad: 1.6rem; }

  /* The nav comes after <main> in the markup, which is right for a phone's bottom bar. On a
     desktop it belongs under the title, so reorder it rather than moving it in the DOM. */
  body {
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
    padding-top: 0;
  }

  .topbar { order: 0; padding-top: 1rem; }
  .nav { order: 1; }
  .app { order: 2; width: 100%; }

  .nav {
    position: static;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 var(--pad) 0.8rem;
    background: none;
    backdrop-filter: none;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    margin: 0 auto 1.2rem;
    width: 100%;
    max-width: 78rem;
  }

  .tab { flex: 0 0 auto; display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; font-size: 0.85rem; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1.1rem 0.9rem; }

  .sheet {
    left: auto;
    top: 0;
    bottom: 0;
    width: min(32rem, 100%);
    max-height: 100dvh;
    border-radius: var(--r-xl) 0 0 var(--r-xl);
    border-top: 0;
    border-left: 1px solid var(--line);
    transform: translateX(102%);
  }

  .sheet--on { transform: translateX(0); }

  .pickcard { grid-template-columns: 10rem 1fr; }
  .shortlist { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
  .toast { bottom: 2rem; }
}
