/* ─── Fanta's Picture House ─────────────────────────────────────
   Black velvet, cream silver-screen white, lipstick red.          */

:root {
  --ink: #0b0909;
  --ink-2: #141011;
  --ink-3: #1d1718;
  --ink-4: #2a2122;
  --line: rgba(245, 239, 230, 0.1);
  --line-2: rgba(245, 239, 230, 0.18);
  --cream: #f5efe6;
  --cream-2: #d9d0c4;
  --muted: #9a8f86;
  --red: #d7192b;
  --red-hi: #ff3347;
  --red-deep: #7d0b16;
  --bulb: #fff3dc;
  --glow: 0 0 18px rgba(215, 25, 43, 0.55);

  --f-marquee: 'Limelight', 'Playfair Display', Georgia, serif;
  --f-display: 'Playfair Display', Georgia, serif;
  --f-body: 'Jost', system-ui, sans-serif;

  --r: 14px;
  --r-lg: 22px;
  --pad: 16px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(125, 11, 22, 0.35), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(125, 11, 22, 0.12), transparent 70%),
    var(--ink);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.sheet-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--red); color: var(--cream); }

/* Film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-1%, 3%); }
}

/* Opening curtain */
.curtain { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: flex; animation: curtainFailsafe 0s 4s forwards; }
@keyframes curtainFailsafe { to { visibility: hidden; } }
.curtain-l, .curtain-r {
  flex: 1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.45), transparent 8%, rgba(0,0,0,.35) 16%, transparent 24%, rgba(0,0,0,.4) 33%, transparent 41%, rgba(0,0,0,.35) 50%, transparent 58%, rgba(0,0,0,.4) 66%, transparent 75%, rgba(0,0,0,.35) 83%, transparent 91%, rgba(0,0,0,.45)),
    linear-gradient(180deg, #a3101f, #6e0712 70%, #3d030a);
  transition: transform 1.3s cubic-bezier(.7, 0, .2, 1);
}
.curtain-l { box-shadow: inset -20px 0 30px rgba(0,0,0,.5); }
.curtain-r { box-shadow: inset 20px 0 30px rgba(0,0,0,.5); }
body.curtain-up .curtain-l { transform: translateX(-102%); }
body.curtain-up .curtain-r { transform: translateX(102%); }
body.curtain-gone .curtain { display: none; }

/* ─── Header + marquee ───────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 24px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--pad) 12px;
  background: linear-gradient(180deg, rgba(11,9,9,.96), rgba(11,9,9,.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.marquee {
  --b: 6px;
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 10px 26px 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1a0d0f, #0f0909);
  box-shadow: inset 0 0 0 2px var(--red), 0 0 24px rgba(215, 25, 43, .25);
  user-select: none;
}
.marquee::before {
  /* chasing bulbs */
  content: ''; position: absolute; inset: 4px; border-radius: 9px;
  padding: 3px;
  background: repeating-linear-gradient(90deg, var(--bulb) 0 var(--b), transparent var(--b) calc(var(--b) * 2.6));
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  filter: drop-shadow(0 0 3px rgba(255, 220, 160, .9));
  animation: chase 2.4s linear infinite;
  opacity: .85;
}
@keyframes chase { to { background-position: -36px 0; } }
.marquee-name {
  font-family: var(--f-marquee);
  font-size: 30px; line-height: 1;
  letter-spacing: .06em;
  color: var(--cream);
  text-shadow: 0 0 6px rgba(255, 243, 220, .6), 0 0 22px rgba(215, 25, 43, .8);
}
.marquee-sub {
  font-family: var(--f-display); font-style: italic;
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--red-hi);
  margin-top: 3px;
}
.marquee.lights-flicker .marquee-name { animation: flicker 1.2s steps(1) 1; }
@keyframes flicker {
  0%, 18%, 22%, 52%, 56%, 100% { opacity: 1; }
  20%, 54% { opacity: .15; }
}

.nav { display: none; }
.nav a, .tabbar a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--cream-2);
  font-size: 14px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: color .2s;
}
.nav a:hover { color: var(--cream); }
.nav a.on, .tabbar a.on { color: var(--red-hi); }
.nav .add-btn { color: var(--cream); }

@media (min-width: 860px) {
  .top { justify-content: space-between; padding-inline: 40px; }
  .nav { display: flex; align-items: center; gap: 28px; }
  .tabbar { display: none !important; }
}

/* Mobile tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(11, 9, 9, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex-direction: column; gap: 3px; font-size: 10px; letter-spacing: .1em; justify-content: center; }
.tabbar svg { width: 22px; height: 22px; }
.tabbar .add-fab {
  justify-self: center;
  width: 56px; height: 56px; margin-top: -22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--red-hi), var(--red) 55%, var(--red-deep));
  box-shadow: 0 6px 24px rgba(215, 25, 43, .55), inset 0 0 0 2px rgba(255,255,255,.12);
  color: var(--cream);
}
.tabbar .add-fab svg { width: 26px; height: 26px; }

/* ─── Layout ─────────────────────────────────────────────────── */
main {
  max-width: 1120px; margin: 0 auto;
  padding: 24px var(--pad) calc(var(--nav-h) + var(--safe-b) + 40px);
  outline: none;
}
@media (min-width: 860px) { main { padding: 40px 40px 80px; } }
.view { animation: rise .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--red-hi);
}
.h1 {
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(34px, 7vw, 56px); line-height: 1.02;
  margin: 6px 0 0;
}
.h1 em { font-style: italic; font-weight: 500; color: var(--red-hi); }
.h2 {
  font-family: var(--f-display); font-style: italic; font-weight: 700;
  font-size: 26px; margin: 0;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.muted { color: var(--muted); }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rule { display: flex; align-items: center; gap: 14px; }
.rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--red), transparent); }

/* ─── Buttons, inputs, chips ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px;
  font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: 13px;
  transition: transform .15s, background .2s, box-shadow .2s, color .2s;
}
.btn { white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); color: var(--cream); box-shadow: 0 6px 22px rgba(215, 25, 43, .35); }
.btn-red:hover { background: var(--red-hi); }
.btn-ghost { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--cream); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--cream-2); }
.btn-text { color: var(--muted); min-height: 40px; padding: 0 10px; }
.btn-text:hover { color: var(--cream); }
.btn-danger { color: var(--red-hi); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--cream-2); }
.icon-btn:hover { background: var(--ink-3); color: var(--cream); }
.icon-btn svg { width: 22px; height: 22px; }

.field { display: grid; gap: 8px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.input, .textarea, .select {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 25, 43, .2); }
.textarea {
  min-height: 130px; resize: vertical;
  font-family: var(--f-display); font-size: 17px; line-height: 1.6;
}
.input::placeholder, .textarea::placeholder { color: #6d635c; }
.search { position: relative; }
.search svg { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; border-radius: 999px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 13px;
  border-radius: 999px;
  font-size: 13.5px;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--cream-2);
  transition: background .15s, color .15s, box-shadow .15s, transform .15s;
}
button.chip:hover { color: var(--cream); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.on { background: var(--red); color: var(--cream); box-shadow: none; }
.chip.on:active { transform: scale(.95); }
.chip.small { min-height: 26px; padding: 0 10px; font-size: 12px; }
.chip-x { opacity: .7; margin-left: 2px; }

.seg { display: inline-grid; grid-auto-flow: column; padding: 4px; border-radius: 999px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { min-height: 40px; padding: 0 18px; border-radius: 999px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--cream); color: var(--ink); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--ink-4); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.switch input:checked { background: var(--red); }
.switch input:checked::after { transform: translateX(20px); }

/* ─── Stars ──────────────────────────────────────────────────── */
.stars { --w: 90px; position: relative; display: inline-block; width: var(--w); height: calc(var(--w) / 5); flex: none; }
.stars svg { width: var(--w); height: calc(var(--w) / 5); display: block; }
.stars .bg { fill: rgba(245, 239, 230, .14); }
.stars .fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; }
.stars .fill svg { fill: var(--red-hi); filter: drop-shadow(0 0 4px rgba(255, 51, 71, .5)); }
.stars.lg { --w: 150px; }
.stars.xl { --w: min(300px, 78vw); }
.score { font-family: var(--f-marquee); color: var(--cream); letter-spacing: .02em; }
.rating-line { display: inline-flex; align-items: center; gap: 10px; }
.rating-line .score { font-size: 15px; }

.rater { display: grid; justify-items: center; gap: 12px; padding: 22px 12px 18px; border-radius: var(--r-lg); background: radial-gradient(circle at 50% 0%, rgba(215, 25, 43, .16), transparent 70%), var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.rater .stars { cursor: pointer; touch-action: none; }
.rater-num { display: flex; align-items: center; gap: 18px; }
.rater-num .score { font-size: 46px; min-width: 2.6ch; text-align: center; line-height: 1; }
.rater-num .score small { font-size: 18px; color: var(--muted); }
.rater-step { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 22px; display: grid; place-items: center; color: var(--cream-2); }
.rater-step:hover { color: var(--cream); box-shadow: inset 0 0 0 1px var(--cream-2); }
.rater-word { font-family: var(--f-display); font-style: italic; font-size: 19px; color: var(--red-hi); min-height: 1.5em; }
.rater-hint { font-size: 12px; color: var(--muted); }

/* ─── Posters ────────────────────────────────────────────────── */
.poster {
  position: relative; aspect-ratio: 2 / 3;
  border-radius: 10px; overflow: hidden;
  background: var(--ink-3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12% 10%;
  background:
    radial-gradient(circle at 50% 120%, rgba(215, 25, 43, .55), transparent 60%),
    linear-gradient(160deg, #1f1012, #0b0909);
  text-align: center;
}
.poster-fallback::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(215, 25, 43, .55); border-radius: 6px; }
.poster-fallback .pf-star { color: var(--red-hi); font-size: 12px; letter-spacing: .3em; }
.poster-fallback .pf-title { font-family: var(--f-display); font-weight: 900; font-style: italic; font-size: clamp(12px, 2.4vw, 22px); line-height: 1.05; overflow-wrap: anywhere; }
.poster-fallback .pf-year { font-family: var(--f-marquee); font-size: 11px; color: var(--cream-2); letter-spacing: .2em; }
.poster.sm .pf-title { font-size: 11px; }
.poster.sm .pf-star, .poster.sm .pf-year { font-size: 8px; }
.poster .badge-tv {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  font-size: 9.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px;
  background: var(--cream); color: var(--ink);
}
.poster .fav-heart { position: absolute; top: 7px; right: 7px; z-index: 1; width: 22px; height: 22px; color: var(--red-hi); filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }

/* ─── Diary ──────────────────────────────────────────────────── */
.now-showing {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: end;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  isolation: isolate;
}
.now-showing .bd { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center 25%; opacity: .45; filter: saturate(.85); }
.now-showing .bd::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,9,9,.95) 0%, rgba(11,9,9,.7) 55%, rgba(11,9,9,.35)), linear-gradient(0deg, rgba(11,9,9,.9), transparent 60%); }
.now-showing .title { font-family: var(--f-display); font-weight: 900; font-size: clamp(24px, 5vw, 40px); line-height: 1.05; margin: 6px 0 10px; }
.now-showing .quote { font-family: var(--f-display); font-style: italic; color: var(--cream-2); margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 700px) { .now-showing { grid-template-columns: 170px 1fr; padding: 28px; gap: 30px; min-height: 300px; } }

.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 120px; gap: 14px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--pad) * -1); padding: 4px var(--pad) 12px; scroll-snap-type: x mandatory; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; }
.shelf-item { display: grid; gap: 8px; }
.shelf-item .t { font-size: 13px; line-height: 1.25; color: var(--cream-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-item .stars { --w: 70px; }
@media (min-width: 700px) { .shelf { grid-auto-columns: 150px; gap: 20px; } }

.verdict-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red-hi); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.toolbar { display: grid; gap: 12px; margin-bottom: 8px; }
@media (min-width: 700px) { .toolbar { grid-template-columns: 1fr auto; align-items: center; } }
.toolbar .select { width: auto; border-radius: 999px; padding: 11px 38px 11px 16px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239a8f86' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }

.month { margin-top: 34px; }
.month-title { font-family: var(--f-display); font-style: italic; font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.month-title span { font-family: var(--f-body); font-style: normal; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-left: 10px; }

.entry {
  display: grid; grid-template-columns: 48px 64px 1fr; gap: 14px; align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.entry:hover .entry-title { color: var(--red-hi); }
.stub { text-align: center; padding-top: 2px; }
.stub .d { font-family: var(--f-marquee); font-size: 26px; line-height: 1; }
.stub .w { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.stub .x { font-family: var(--f-display); font-style: italic; color: var(--muted); font-size: 22px; }
.entry .poster { border-radius: 6px; }
.entry-title { font-family: var(--f-display); font-weight: 700; font-size: 19px; line-height: 1.2; margin: 0; transition: color .2s; }
.entry-title small { font-family: var(--f-body); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 6px; }
.entry-review { margin: 8px 0 0; font-family: var(--f-display); font-style: italic; color: var(--cream-2); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry .chips { margin-top: 8px; gap: 6px; }
.rewatch-mark { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 700px) {
  .entry { grid-template-columns: 64px 84px 1fr; gap: 22px; padding: 20px 8px; }
  .entry-title { font-size: 22px; }
}

.empty {
  text-align: center; padding: 60px 20px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-2);
}
.empty .big { font-family: var(--f-display); font-style: italic; font-size: 28px; margin: 10px 0 8px; }
.empty p { color: var(--muted); max-width: 36ch; margin: 0 auto 20px; }

.banner {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 18px; margin-bottom: 22px;
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(215, 25, 43, .22), rgba(215, 25, 43, .05));
  box-shadow: inset 0 0 0 1px rgba(215, 25, 43, .35);
  font-family: var(--f-display); font-style: italic;
}
.banner .x { margin-left: auto; color: var(--muted); }

/* ─── Watchlist grid ─────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 22px 18px; } }
.grid-item { display: grid; gap: 8px; position: relative; }
.grid-item .t { font-size: 13px; line-height: 1.25; color: var(--cream-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-item .gp { position: relative; }
.grid-item .quick {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(11, 9, 9, .8); color: var(--cream);
  box-shadow: inset 0 0 0 1px var(--line-2);
  backdrop-filter: blur(4px);
}
.grid-item .quick:hover { background: var(--red); }
.grid-item .quick svg { width: 18px; height: 18px; }

/* ─── Detail ─────────────────────────────────────────────────── */
.detail-hero { position: relative; margin: -24px calc(var(--pad) * -1) 0; padding: 28px var(--pad) 0; isolation: isolate; }
.detail-hero .bd { position: absolute; inset: 0 0 -80px; z-index: -1; background-size: cover; background-position: center 20%; opacity: .4; -webkit-mask: linear-gradient(180deg, #000 30%, transparent); mask: linear-gradient(180deg, #000 30%, transparent); }
@media (min-width: 860px) { .detail-hero { margin: -40px -40px 0; padding: 56px 40px 0; } }
.detail-top { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: end; }
@media (min-width: 700px) { .detail-top { grid-template-columns: 230px 1fr; gap: 40px; } }
.detail-title { font-family: var(--f-display); font-weight: 900; font-size: clamp(28px, 6vw, 58px); line-height: 1; margin: 8px 0 12px; }
.detail-meta { color: var(--cream-2); font-size: 14px; line-height: 1.6; }
.detail-meta b { color: var(--red); font-weight: 400; }
.verdict { margin-top: 30px; display: grid; gap: 14px; padding: 24px; border-radius: var(--r-lg); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.verdict-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.verdict-top .score { font-size: 40px; line-height: 1; }
.verdict-top .word { font-family: var(--f-display); font-style: italic; color: var(--red-hi); font-size: 18px; }
.review-text { font-family: var(--f-display); font-size: 19px; line-height: 1.7; margin: 0; white-space: pre-wrap; }
.review-text::first-letter { font-size: 3.1em; float: left; line-height: .9; margin: 6px 10px 0 0; color: var(--red-hi); font-weight: 900; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.overview { color: var(--cream-2); max-width: 70ch; }
.cast { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--cream-2); }

/* ─── Stats ──────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.kpi { padding: 18px; border-radius: var(--r); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.kpi .v { font-family: var(--f-marquee); font-size: 40px; line-height: 1; }
.kpi .v small { font-size: 18px; color: var(--muted); }
.kpi .k { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.kpi.red { background: linear-gradient(160deg, var(--red), var(--red-deep)); box-shadow: none; }
.kpi.red .k { color: rgba(245, 239, 230, .8); }

.panel { padding: 22px; border-radius: var(--r-lg); background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.panels { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 860px) { .panels { grid-template-columns: 1fr 1fr; } }
.panel h3 { font-family: var(--f-display); font-style: italic; font-weight: 700; font-size: 20px; margin: 0 0 16px; }

.hist { display: grid; grid-template-columns: repeat(10, 1fr); align-items: end; gap: 5px; height: 140px; }
.hist .col { display: grid; align-content: end; gap: 6px; height: 100%; text-align: center; }
.hist .bar { background: var(--red); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .6s cubic-bezier(.2, .7, .2, 1); }
.hist .bar.zero { background: var(--ink-4); }
.hist .lab { font-size: 10px; color: var(--muted); }
.hist .n { font-size: 11px; color: var(--cream-2); }
.months { grid-template-columns: repeat(12, 1fr); }

.bars { display: grid; gap: 12px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; }
.brow .track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--ink-4); overflow: hidden; }
.brow .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--red-deep), var(--red-hi)); border-radius: inherit; }
.brow .c { color: var(--muted); font-variant-numeric: tabular-nums; }

.ranked { display: grid; gap: 12px; }
.ranked a { display: grid; grid-template-columns: 22px 44px 1fr auto; gap: 12px; align-items: center; }
.ranked .i { font-family: var(--f-marquee); color: var(--muted); }
.ranked .poster { border-radius: 5px; }
.ranked .t { font-size: 15px; line-height: 1.25; }
.ranked .score { font-size: 15px; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge {
  display: grid; justify-items: center; text-align: center; gap: 4px;
  padding: 18px 12px; border-radius: var(--r);
  background: radial-gradient(circle at 50% 0%, rgba(215, 25, 43, .25), transparent 70%), var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(215, 25, 43, .35);
}
.badge .e { font-size: 34px; line-height: 1.1; }
.badge .n { font-family: var(--f-display); font-weight: 700; font-style: italic; font-size: 16px; }
.badge .d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.badge.locked { background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.badge.locked .e { filter: grayscale(1) brightness(.4); }
.badge.locked .n { color: var(--muted); }

/* ─── Sheet (add / edit) ─────────────────────────────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0;
  max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--ink); border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .6), inset 0 1px 0 var(--line-2);
  padding: 8px var(--pad) calc(var(--safe-b) + 28px);
  animation: up .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(100%); } }
@media (min-width: 760px) {
  .sheet { left: 50%; top: 50%; bottom: auto; right: auto; width: 640px; max-height: 88vh; transform: translate(-50%, -50%); border-radius: 24px; padding: 8px 32px 32px; animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
}
.sheet-grip { width: 42px; height: 4px; border-radius: 4px; background: var(--ink-4); margin: 6px auto 10px; }
@media (min-width: 760px) { .sheet-grip { display: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 14px; position: sticky; top: -8px; background: var(--ink); z-index: 2; }
.sheet-head .h2 { font-size: 24px; }
.sheet-body { display: grid; gap: 22px; }

.results { display: grid; gap: 4px; margin-top: 4px; }
.result { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 8px; border-radius: 12px; text-align: left; transition: background .15s; }
.result:hover, .result:focus-visible { background: var(--ink-3); }
.result .poster { border-radius: 5px; }
.result .t { font-family: var(--f-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.result .m { font-size: 13px; color: var(--muted); }
.result .tag { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-4); border-top-color: var(--red); animation: spin .8s linear infinite; margin: 22px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.picked { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; }
.picked .t { font-family: var(--f-display); font-weight: 900; font-size: 22px; line-height: 1.1; }
.row2 { display: grid; gap: 16px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.tag-add { display: flex; gap: 8px; margin-top: 10px; }
.tag-add .input { padding: 9px 14px; border-radius: 999px; font-size: 14px; }
.toggles { display: flex; gap: 10px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--cream-2); font-size: 14px; }
.toggle.on { box-shadow: inset 0 0 0 1px var(--red); color: var(--cream); background: rgba(215, 25, 43, .14); }
.toggle svg { width: 18px; height: 18px; }
.toggle.on svg { color: var(--red-hi); }

/* ─── Auth ───────────────────────────────────────────────────── */
.auth { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.auth .h1 { font-size: clamp(34px, 9vw, 48px); }
.auth form { display: grid; gap: 14px; margin-top: 30px; text-align: left; }
.auth .err { color: var(--red-hi); font-size: 14px; min-height: 1.4em; }
body.no-chrome .top .nav, body.no-chrome .tabbar { display: none !important; }

/* ─── Settings ───────────────────────────────────────────────── */
.settings { max-width: 640px; display: grid; gap: 16px; }
.settings .panel { display: grid; gap: 16px; }
.share-link { display: flex; gap: 8px; align-items: center; padding: 10px 10px 10px 16px; border-radius: 999px; background: var(--ink-3); font-size: 13px; color: var(--cream-2); overflow: hidden; }
.share-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-top: 60px; }
.foot b { color: var(--red-hi); font-weight: 500; }

/* ─── Toasts ─────────────────────────────────────────────────── */
#toast-root { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); translate: -50% 0; z-index: 150; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
@media (min-width: 860px) { #toast-root { bottom: 32px; } }
.toast { padding: 12px 20px; border-radius: 999px; background: var(--cream); color: var(--ink); font-weight: 500; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); text-align: center; animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(12px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ─── Easter egg effects ─────────────────────────────────────── */
#fx-root { position: fixed; inset: 0; pointer-events: none; z-index: 180; overflow: hidden; }
.rose { position: absolute; top: -60px; font-size: 30px; animation: fall linear forwards; will-change: transform; }
.petal { position: absolute; top: -30px; width: 14px; height: 20px; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, var(--red-hi), var(--red-deep)); animation: fall linear forwards; }
@keyframes fall {
  to { transform: translate(var(--dx, 0), 115vh) rotate(var(--rot, 360deg)); }
}

.heart-burst { position: fixed; left: 50%; top: 45%; width: 130px; height: 130px; margin: -65px 0 0 -65px; color: var(--red-hi); filter: drop-shadow(0 0 30px rgba(255, 51, 71, .8)); animation: burst .9s ease forwards; }
@keyframes burst { 0% { transform: scale(0); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(.95); } 100% { transform: scale(1.4); opacity: 0; } }

.fx-overlay { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; text-align: center; pointer-events: auto; cursor: pointer; animation: fade .4s; padding: 24px; }
.fx-dark { background: #000; }
.fx-msg { font-family: var(--f-display); font-style: italic; font-size: clamp(26px, 6vw, 48px); line-height: 1.2; opacity: 0; animation: msg 1s ease forwards; }
.fx-msg small { display: block; font-family: var(--f-body); font-style: normal; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 22px; }
@keyframes msg { to { opacity: 1; } }

.eyes { position: absolute; display: flex; gap: 22px; animation: blink 3s steps(1) infinite; }
.eyes i { width: 26px; height: 12px; border-radius: 50%; background: var(--red-hi); box-shadow: 0 0 18px 6px rgba(255, 51, 71, .6); }
@keyframes blink { 0%, 46%, 50%, 100% { opacity: 1; } 47%, 49% { opacity: 0; } }

body.sinking #app, body.sinking .top { transition: transform 2.4s cubic-bezier(.6, 0, .4, 1), filter 2.4s, opacity 2.4s; transform: scale(.55) translateY(70vh); filter: blur(6px); opacity: 0; }
#app, .top { transition: transform .8s, filter .8s, opacity .8s; }
.sunken { background: radial-gradient(circle at 50% 40%, #150a0b, #000 60%); }
.teacup { font-size: 64px; display: inline-block; animation: stir 1.1s ease-in-out infinite; }
@keyframes stir { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

.redrum { font-family: var(--f-marquee); font-size: clamp(56px, 16vw, 180px); color: var(--red); letter-spacing: .08em; text-shadow: 0 0 30px rgba(215, 25, 43, .7); animation: mirror 2.6s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes mirror { 0%, 35% { transform: scaleX(1); } 70%, 100% { transform: scaleX(-1); } }

.card-wrap { perspective: 900px; }
.biz-card {
  width: min(380px, 84vw); aspect-ratio: 3.5 / 2;
  padding: 26px 28px; text-align: left;
  display: grid; grid-template-rows: auto 1fr auto;
  background: linear-gradient(135deg, #efe8d8, #e3dac6);
  color: #2b2620; border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .7);
  font-family: 'Jost', sans-serif;
  animation: cardIn 1s cubic-bezier(.2, .8, .2, 1);
}
@keyframes cardIn { from { transform: rotateX(70deg) translateY(60px); opacity: 0; } }
.biz-card .co { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; }
.biz-card .nm { align-self: center; text-align: center; font-family: var(--f-display); font-size: 26px; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 -1px 0 rgba(0,0,0,.15); }
.biz-card .nm small { display: block; font-family: 'Jost', sans-serif; font-size: 10px; letter-spacing: .32em; margin-top: 6px; }
.biz-card .ft { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: .2em; text-transform: uppercase; }

.reel-spin { display: grid; justify-items: center; gap: 18px; }
.reel-window { width: 170px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 3px var(--red), 0 0 40px rgba(215, 25, 43, .5); position: relative; }
.reel-window .poster { position: absolute; inset: 0; border-radius: 0; }

/* Noir mode (konami code): posters drained to black & white */
body.noir .poster img, body.noir .bd { filter: grayscale(1) contrast(1.15) !important; }
body.noir .grain { opacity: .16; }
body.noir::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 99; box-shadow: inset 0 0 160px rgba(0, 0, 0, .9); }

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