:root {
  --bg: #0b0a0d;
  --surface: #17151b;
  --surface-2: #211e27;
  --line: #2e2a36;
  --text: #f4f1ea;
  --muted: #a39db0;
  --amber: #f5b942;
  --amber-ink: #1a1304;
  --red: #e5484d;
  --green: #4cc38a;
  --radius: 18px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.pad { padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 24px); }

/* ---- top bar ---- */
.bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.brand span { color: var(--amber); }
.bar nav { display: flex; gap: 4px; }
.link { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 10px; }
.link:hover { color: var(--text); background: var(--surface); }
.back { color: var(--muted); font-size: 15px; font-weight: 500; padding: 8px 12px 8px 0; }

/* ---- home ---- */
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 9vw, 44px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 16px; line-height: 1.45; }
.moods { display: grid; gap: 12px; }
.mood {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.mood:hover { border-color: #4a4456; background: var(--surface-2); }
.mood:active { transform: scale(.98); }
.mood .emoji { font-size: 30px; width: 40px; text-align: center; }
.mood b { display: block; font-family: var(--display); font-size: 21px; font-weight: 500; }
.mood small { color: var(--muted); font-size: 14px; }
.mood.surprise { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.mood.surprise small { color: #5c4508; }

.nudge {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; margin-bottom: 12px; border-radius: 14px;
  background: linear-gradient(135deg, #2a2110, #1b1710); border: 1px solid #4d3b12;
}
.nudge img { width: 44px; height: 66px; object-fit: cover; border-radius: 6px; }
.nudge b { display: block; font-size: 15px; }
.nudge small { color: #d9c08a; font-size: 13px; }
.nudge .go { margin-left: auto; color: var(--amber); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nudges { margin-bottom: 24px; }

/* ---- pick ---- */
.hero { position: relative; aspect-ratio: 16 / 10; background: #000 center / cover no-repeat; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,10,13,.35) 0%, rgba(11,10,13,0) 30%, rgba(11,10,13,.2) 60%, var(--bg) 100%); pointer-events: none; }
.hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; background: #000; }
.hero.playing::after { display: none; }
.hero-top { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 12px; right: 12px; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.pill { background: rgba(11,10,13,.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--text); }
.play {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; padding: 14px 22px 14px 18px; border-radius: 99px;
  background: rgba(244,241,234,.95); color: #111; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: transform .15s ease;
}
.play:active { transform: translate(-50%, -50%) scale(.96); }
.play svg { width: 18px; height: 18px; }

.info { padding: 0 20px 150px; margin-top: -34px; position: relative; z-index: 2; }
.info .row { display: flex; gap: 16px; align-items: flex-end; }
.poster { width: 104px; aspect-ratio: 2 / 3; border-radius: 10px; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,.6); background: var(--surface); flex: none; }
.info h2 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 7vw, 34px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 14px; }
.blurb { font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.3; margin: 22px 0 14px; }
.because { display: inline-block; color: var(--amber); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip { padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.chip.on { background: #12291e; border-color: #1f4a35; color: #7fe0b0; }
.overview { color: #cfc9d8; font-size: 15px; line-height: 1.55; margin: 0; }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(to top, var(--bg) 70%, rgba(11,10,13,0));
}
.actions-in { max-width: 528px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { padding: 15px 14px; border-radius: 14px; font-weight: 600; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .12s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { grid-column: 1 / -1; background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-size: 17px; padding: 17px; }
.btn[disabled] { opacity: .4; }

/* ---- quiz ---- */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.who button { padding: 28px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-family: var(--display); font-size: 24px; }
.who small { display: block; font-family: var(--body); font-size: 13px; color: var(--muted); margin-top: 6px; }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 4px 0 22px; }
.progress i { display: block; height: 100%; background: var(--amber); transition: width .25s ease; }
.card { text-align: center; }
.card img { width: min(56vw, 250px); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); background: var(--surface); }
.card h2 { font-family: var(--display); font-size: 26px; margin: 18px 0 2px; letter-spacing: -0.01em; }
.card .meta { margin-bottom: 20px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answers .btn.loved { background: #12291e; border-color: #1f4a35; color: #8be8ba; }
.answers .btn.no { background: #2b1416; border-color: #4f2226; color: #ff9a9e; }
.answers .btn.unseen { grid-column: 1 / -1; color: var(--muted); }
.fade { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- sheet ---- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(env(safe-area-inset-bottom) + 20px); animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.sheet h3 { font-family: var(--display); font-size: 22px; margin: 0 0 4px; }
.sheet p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.person { margin-bottom: 16px; }
.person label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { padding: 12px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }

/* ---- history ---- */
.hrow { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hrow img { width: 46px; height: 69px; object-fit: cover; border-radius: 6px; background: var(--surface); }
.hrow b { display: block; font-size: 15px; }
.hrow small { color: var(--muted); font-size: 13px; }
.hrow .marks { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---- login / empty ---- */
.center { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.field { width: 100%; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 17px; margin-bottom: 12px; }
.error { color: #ff9a9e; font-size: 14px; min-height: 20px; margin: 0 0 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
