/* FlickPick — dark cinematic theme, mobile-first. */
:root {
  --bg: #0b0b0f;
  --bg2: #121218;
  --surface: #1a1a22;
  --surface2: #23232e;
  --line: #2c2c38;
  --ink: #f2ede3;
  --muted: #a7a29a;
  --accent: #e8b34b;   /* marquee gold */
  --accent-deep: #b9862f;
  --red: #e5484d;
  --green: #57b26a;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: radial-gradient(120% 60% at 50% -10%, #17171f 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5;
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 14px 0 8px; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.mt { margin-top: 26px; }

/* ---------- lock / enroll ---------- */
.lockwrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.lockcard {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 24px; box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #141414; font-size: 1.4rem; font-weight: 800;
}
.brand h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.tagline { margin: 0; color: var(--muted); font-style: italic; font-size: .85rem; }
.pin, .input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 13px 14px; font-size: 1.05rem; margin-bottom: 12px; font-family: inherit;
}
.pin:focus, .input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface2); color: var(--ink);
  border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #171205; border: 0; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-lg { font-size: 1.1rem; padding: 15px; margin: 18px 0; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btnrow { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- app shell ---------- */
.apphead {
  position: sticky; top: 0; z-index: 20; background: rgba(11,11,15,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 12px 16px;
}
.brand.small .brand-mark { width: 30px; height: 30px; font-size: 1rem; border-radius: 8px; }
.pchips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.pchip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px 6px 6px;
  font: inherit; font-size: .9rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.pchip.sel { border-color: var(--accent); background: var(--surface2); box-shadow: 0 0 0 1px var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #141414; font-weight: 800; font-size: .85rem; }

.tabbody { padding: 16px 16px 110px; max-width: 720px; margin: 0 auto; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: rgba(18,18,24,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem;
  font-weight: 600; padding: 10px 4px; border-radius: 10px; cursor: pointer;
}
.tab.sel { color: var(--accent); background: rgba(232,179,75,.1); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); color: var(--ink);
  border-radius: 999px; padding: 9px 15px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.chip.sel { background: var(--accent); border-color: var(--accent); color: #171205; }

/* ---------- poster tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.poster { cursor: pointer; }
.poster-cap { font-size: .75rem; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.tile {
  position: relative; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--line);
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-ph { background: linear-gradient(150deg, hsl(var(--h), 32%, 26%), hsl(calc(var(--h) + 40), 34%, 14%)); }
.tile-ph::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 55% at 50% 0%, rgba(255,255,255,.14), transparent 70%);
}
.tile-ph-inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; }
.tile-ph-title { font-weight: 700; font-size: .82rem; line-height: 1.25; }
.tile-ph-year { color: var(--muted); font-size: .7rem; margin-top: 2px; }
.tile-lg { max-width: 220px; margin: 6px auto 14px; }
.tile-lg .tile-ph-title { font-size: 1.05rem; }
.tile-md { width: 92px; flex: none; }
.tile-sm { width: 84px; flex: none; }
.tile-xs { width: 48px; flex: none; border-radius: 8px; }

/* ---------- recommendations ---------- */
.rec-row { display: flex; gap: 14px; }
.rec-info { flex: 1; min-width: 0; }
.rec-info h3 { margin: 0 0 4px; font-size: 1rem; }
.why { font-size: .88rem; color: var(--ink); opacity: .9; margin: 8px 0; }
.rec-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- rating stars (½-star) ---------- */
.stars { display: inline-flex; gap: 2px; }
.star { position: relative; border: 0; background: none; padding: 2px; cursor: pointer; font-size: 1.9rem; line-height: 1; width: 1.25em; }
.stars-big .star { font-size: 2.6rem; }
.star .s-bg { color: var(--line); }
.star .s-fg { position: absolute; left: 2px; top: 2px; color: var(--accent); width: 0; overflow: hidden; white-space: nowrap; }
.star.full .s-fg { width: calc(1.25em - 4px); }
.star.half .s-fg { width: calc((1.25em - 4px) / 2); }

/* ---------- rows / history ---------- */
.rowitem {
  display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; cursor: pointer;
}
.rowitem-info { flex: 1; min-width: 0; }
.hist { border-bottom: 1px solid var(--line); padding: 8px 0; }

/* ---------- detail sheet ---------- */
#modal { display: none; }
#modal.open {
  display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65);
  overflow-y: auto; padding: 24px 12px 40px;
}
.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  max-width: 560px; margin: 0 auto; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.sheet-hero { display: flex; gap: 14px; margin-bottom: 12px; }
.sheet-hero h2 { margin: 0 0 6px; }
.suit { border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: .88rem; margin: 10px 0; }
.suit-ask_parent { background: rgba(232,179,75,.15); color: var(--accent); border: 1px solid var(--accent); }
.suit-blocked { background: rgba(229,72,77,.14); color: var(--red); border: 1px solid var(--red); }
.suit.ok { background: rgba(87,178,106,.14); color: var(--green); border: 1px solid var(--green); }
.provtiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.prov { display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .55; }
.prov.mine { opacity: 1; }
.prov img { width: 44px; height: 44px; border-radius: 10px; }
.prov span { font-size: .68rem; color: var(--muted); }

/* ---------- onboarding ---------- */
.obwrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.obcard { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; text-align: center; }
.obtop { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.obprog { flex: 1; height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.obprog-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s; }
.obcard h2 { margin: 8px 0 2px; }
.obbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- rating nudge ---------- */
.nudge {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); max-width: 560px; margin: 0 auto;
}
.nudge-head { display: flex; justify-content: space-between; align-items: center; }
.nudge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.nudge-row.done { opacity: .45; }

/* ---------- misc ---------- */
.searchrow { display: flex; gap: 10px; margin-bottom: 6px; }
.searchrow .input { margin-bottom: 0; }
.setup { border-color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #141414; font-weight: 600; font-size: .88rem;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
