/* Just One — mobile first, and mobile only for v1.
   Desktop parity (§5.2a) is deliberately deferred. */

:root {
  --bg: #14100f;
  --card: #1e1917;
  --card-2: #272120;
  --ink: #f4ece4;
  --ink-dim: #a99e95;
  --accent: #e8834a;
  --accent-soft: rgba(232, 131, 74, 0.14);
  --good: #6fc08a;
  --line: rgba(244, 236, 228, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
        "Segoe UI", system-ui, sans-serif;
  overscroll-behavior-y: contain;
}

body {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 20px 56px;
  min-height: 100vh;
}

a { color: var(--accent); }

.brand {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 26px;
}
.brand b { color: var(--accent); font-weight: 600; }

h1 {
  font-size: 27px;
  line-height: 1.25;
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
h2 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.sub { color: var(--ink-dim); margin: 0 0 26px; font-size: 15.5px; }

/* ── mood chips ─────────────────────────────────────────────── */

.chips { display: flex; flex-direction: column; gap: 11px; margin-bottom: 26px; }

.chip {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.09s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:active { transform: scale(0.985); background: var(--card-2); }
.chip .label { font-weight: 600; font-size: 18px; display: block; }
.chip .blurb { color: var(--ink-dim); font-size: 14.5px; margin-top: 2px; display: block; }
.chip-text { min-width: 0; }

/* Emoji render at their own colours on every platform, so they carry the
   whole palette here — the chip stays quiet and the face does the talking.
   Sized off the label rather than fixed, so it scales with Dynamic Type. */
.chip-icon {
  font-size: 27px;
  line-height: 1;
  flex: 0 0 auto;
  width: 34px;
  text-align: center;
}

.free { display: flex; align-items: center; gap: 14px; }
.free .chip-icon { font-size: 23px; width: 34px; }
.free input[type="text"] { flex: 1 1 auto; margin: 0; }

/* ── forms ──────────────────────────────────────────────────── */

input[type="text"], textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  padding: 14px 15px;
  font: inherit;
  margin-bottom: 11px;
}
input::placeholder, textarea::placeholder { color: #6d635c; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #1a1210;
  border: 0;
  border-radius: 13px;
  padding: 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.btn:active { transform: scale(0.99); }
.btn.ghost {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  font-weight: 500;
}
.btn.quiet {
  background: none; border: 0; color: var(--ink-dim);
  text-decoration: underline; padding: 13px; font-size: 15px;
}

.divider { height: 1px; background: var(--line); margin: 26px 0; }
.muted { color: var(--ink-dim); font-size: 14px; }

/* ── swipe cards ────────────────────────────────────────────── */

.counter {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: center;
  margin-bottom: 10px;
}

/* Arrows sit outside the card so the swipe direction is stated before you
   touch anything. The card itself read as two buttons before this. */
.deckwrap { display: flex; align-items: center; gap: 6px; margin: 4px 0 16px; }
.swipe-hint {
  flex: none; width: 20px; text-align: center;
  color: var(--ink-dim); font-size: 21px; opacity: .5;
}

.deck { position: relative; flex: 1; height: 290px; }

.swipe-card {
  --hint: 0;
  position: absolute;
  inset: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  /* Cards behind peek out, so it reads as a stack of three. */
  transform: translateY(calc(var(--depth) * 7px)) scale(calc(1 - var(--depth) * .035));
}

.swipe-card .q {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 6px;
}

/* Two halves of one card divided by a hairline — NOT two filled buttons. */
.swipe-card .opts {
  flex: 1;
  display: flex;
  align-items: stretch;
  margin: 4px 0;
}
.swipe-card .rule { width: 1px; background: var(--line); flex: none; }
.swipe-card .opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-dim);
  transition: color .12s ease;
}
.swipe-card.tilt-left  .opt.left,
.swipe-card.tilt-right .opt.right { color: var(--accent); }
.swipe-card.tilt-left  .opt.right,
.swipe-card.tilt-right .opt.left  { opacity: .3; }

.swipe-card .drag-note {
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: .55;
}

/* Accent wash builds as you drag, on whichever side you are heading. */
.swipe-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 22px;
  pointer-events: none;
  opacity: var(--hint);
  background: linear-gradient(90deg, transparent 40%, var(--accent-soft));
}
.swipe-card.tilt-left::after {
  background: linear-gradient(270deg, transparent 40%, var(--accent-soft));
}

.deck-buttons { display: flex; gap: 11px; }
.deck-buttons .btn { flex: 1; }
.tapnote { text-align: center; margin: 10px 0 0; font-size: 13px; }

.progress { display: flex; gap: 6px; margin-bottom: 22px; }
.progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.progress i.on { background: var(--accent); }

/* ── poster grid ────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 22px;
}
.tile {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--card-2);
  cursor: pointer;
  /* Horizontal drags belong to us, vertical ones scroll the page. Without
     this iOS Safari claims the gesture and pointermove never fires — which
     is why swiping did nothing. */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform .12s ease;
}
.tile img { pointer-events: none; -webkit-user-drag: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile .cap {
  position: absolute; inset: auto 0 0 0; padding: 16px 7px 6px;
  font-size: 11px; line-height: 1.2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}
.tile.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile.on::after {
  content: "✓";
  position: absolute; top: 6px; right: 6px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--accent); color: #1a1210;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sticky {
  position: sticky; bottom: 0;
  padding: 14px 0 6px;
  background: linear-gradient(transparent, var(--bg) 26%);
}

/* ── the pick ───────────────────────────────────────────────── */

.pick { text-align: center; }
.pick .poster {
  width: 62%; max-width: 240px; border-radius: 15px; margin: 4px auto 22px;
  display: block; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.pick h1 { font-size: 31px; margin-bottom: 5px; }
.pick .meta { color: var(--ink-dim); font-size: 14.5px; margin-bottom: 22px; }

.reason {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 13px;
  padding: 18px 19px;
  text-align: left;
  font-size: 17px;
  line-height: 1.62;
  margin-bottom: 12px;
}
.hedge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 11px;
}
.actions { display: flex; flex-direction: column; gap: 9px; margin-top: 22px; }
.actions .row { display: flex; gap: 9px; }
.actions .row .btn { flex: 1; }

/* ── stats ──────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.quote {
  background: var(--card); border-radius: 11px; padding: 12px 14px;
  margin-bottom: 8px; font-size: 15px;
}

/* ── TMDB attribution (required by their terms) ─────────────── */

.attrib {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.55;
}
.attrib svg { width: 62px; height: auto; flex: none; }
.attrib span { font-size: 11px; line-height: 1.4; color: var(--ink-dim); }

/* ── three-state poster tiles ───────────────────────────────── */

.tile .mark {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #1a1210;
}
.tile.loved { outline: 3px solid var(--good); outline-offset: -3px; }
.tile.loved .mark { display: flex; background: var(--good); }
.tile.loved .mark::after { content: "♥"; }
.tile.nope { outline: 3px solid #c96a5e; outline-offset: -3px; }
.tile.nope img { opacity: 0.42; }
.tile.nope .mark { display: flex; background: #c96a5e; }
.tile.nope .mark::after { content: "✕"; }
.tile.meh { outline: 3px solid var(--ink-dim); outline-offset: -3px; }
.tile.meh img { opacity: 0.5; }
.tile.meh .mark { display: flex; background: var(--ink-dim); }
.tile.meh .mark::after { content: "•"; }

.legend b.k-loved { color: var(--good); }
.legend b.k-nope  { color: #c96a5e; }
.legend b.k-meh   { color: var(--ink-dim); }

.tally { text-align: center; margin-bottom: 9px; font-size: 13.5px; }

/* ── where to watch ─────────────────────────────────────────── */

.where { display: flex; gap: 7px; justify-content: center; margin-bottom: 18px; }
.pill {
  font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em;
  padding: 5px 12px; border-radius: 999px;
  background: var(--card-2); color: var(--ink);
  border: 1px solid var(--line);
}
.pill.netflix { color: #ff6b5e; border-color: rgba(255,107,94,0.35); }
.pill.prime   { color: #58b7e8; border-color: rgba(88,183,232,0.35); }

.trailer { margin-bottom: 4px; text-decoration: none; text-align: center; }

/* ── thinking / loading ─────────────────────────────────────── */

.thinking { text-align: center; padding-top: 22vh; }
.pulse { display: flex; gap: 8px; justify-content: center; margin-bottom: 26px; }
.pulse i {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: bob 1.1s infinite ease-in-out;
}
.pulse i:nth-child(2) { animation-delay: 0.16s; }
.pulse i:nth-child(3) { animation-delay: 0.32s; }
@keyframes bob {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40%           { transform: translateY(-9px); opacity: 1; }
}

/* ── segmented control: film / series / either ──────────────── */

.seg {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
}
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 10px 4px; border-radius: 10px;
  font-size: 14.5px; font-weight: 550; color: var(--ink-dim);
  transition: background 0.14s ease, color 0.14s ease;
}
.seg input:checked + span { background: var(--accent); color: #1a1210; font-weight: 650; }

/* ── poster deck ────────────────────────────────────────────── */

.legend {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  font-size: 12.5px; color: var(--ink-dim); margin-bottom: 16px;
}
.legend b { color: var(--accent); font-size: 14px; }

.posterdeck { position: relative; aspect-ratio: 2/3; max-height: 46vh; margin: 0 auto 14px; width: 74%; }
.poster-card {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  background: var(--card-2); touch-action: none; user-select: none;
  will-change: transform; box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}
.poster-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pc-cap {
  position: absolute; inset: auto 0 0 0; padding: 26px 12px 11px;
  font-size: 14px; font-weight: 600; line-height: 1.25;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
}
.pc-cap span { color: var(--ink-dim); font-weight: 400; }
.pc-verdict {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%) scale(0.9);
  padding: 7px 15px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: #1a1210; opacity: 0; transition: opacity .12s ease, transform .12s ease;
}
.pc-verdict.show { opacity: 1; transform: translateX(-50%) scale(1); }
.pc-verdict.liked    { background: var(--good); }
.pc-verdict.disliked { background: #c96a5e; }
.pc-verdict.neutral  { background: var(--ink-dim); }
.pc-verdict.unseen   { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

.deck-empty {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 24px;
  color: var(--ink-dim); border: 1px dashed var(--line); border-radius: 16px;
}
.deck-buttons .btn { padding: 13px 0; font-size: 19px; }

/* ── swipe feedback on grid tiles ───────────────────────────── */

.tile { --hint: 0; }
.tile::before {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  opacity: var(--hint);
  pointer-events: none;
  transition: opacity .08s linear;
  background: transparent;
}
.tile.hint-right::before { background: rgba(111,192,138,.55); }
.tile.hint-left::before  { background: rgba(201,106,94,.55); }

@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
.tile.pop { animation: pop .22s ease; }

.tallyrow {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 9px;
}
.undo {
  background: none; border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 13px;
  cursor: pointer;
}

/* ── back link ──────────────────────────────────────────────── */

.back {
  display: inline-block;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14.5px;
  margin-bottom: 14px;
}
.back::before { content: "‹  "; }
.back:active { color: var(--accent); }

/* ── working veil ───────────────────────────────────────────── */

#veil {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .16s ease;
}
/* [hidden] is only display:none in the UA stylesheet, so the rule above beats
   it — leaving an invisible full-screen layer swallowing every tap. Both
   guards, because this failure mode is silent and total. */
#veil[hidden] { display: none; }
#veil:not(.on) { pointer-events: none; }
#veil.on { opacity: 1; }
.veil-inner { text-align: center; }
.veil-msg { color: var(--ink-dim); font-size: 15.5px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .pulse i, .tile.pop { animation: none; }
  #veil { transition: none; }
}

/* ─── who's watching ──────────────────────────────────────────────────────────
   The bare domain is what people actually save, and a private link is what
   they were sent — those two facts don't reconcile, so the domain has to be a
   real front door. Three names, tap yours. No auth: a password before dinner
   is the friction this product exists to remove. */

.whos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 18px 8px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.who:active { transform: scale(0.97); background: var(--card-2); }
.who.last { border-color: var(--accent); }

.face {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: block;
  /* The SVGs are drawn to their own circle, but a ring keeps them from
     dissolving into the card on the darker palettes. */
  box-shadow: inset 0 0 0 1px rgba(244, 236, 228, 0.14);
}

/* Fallback for anyone without a drawn avatar. */
.face.initial {
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 600;
  color: #14100f;
  background: hsl(var(--face) 62% 62%);
}

.who-name { font-size: 15.5px; font-weight: 600; }
.who-note {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: -4px;
}
