/* Movi — one stylesheet, built from the tokens below. Components use tokens, not raw values. */

:root {
  /* Color, by role */
  --bg: #161616;            /* page */
  --bg-2: #1c1c1c;          /* sheets, dialogs */
  --card: #222222;          /* raised surfaces */
  --card-2: #2b2b2b;        /* controls, nested surfaces */
  --card-3: #353535;        /* hover, selected */
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f2f0ee;
  --text-2: #d8d5d2;        /* long-form text: plots, notes, bios */
  --muted: #a8a5a2;
  --dim: #99958f;
  --accent: #d63a3f;        /* fills: primary buttons, active marks */
  --accent-hover: #e2474c;
  --accent-lt: #ff8589;     /* red used as text on dark */
  --accent-tint: rgba(229, 72, 77, .16);
  --accent-ring: rgba(229, 72, 77, .45);
  --on-accent: #ffffff;
  --on-score: #1b1b1b;
  --loved: #6fdcb0;
  --fine: #f5cf6b;
  --disliked: #f4a6a6;

  /* Type */
  --font: Poppins, system-ui, -apple-system, sans-serif;
  --font-brand: Righteous, Poppins, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 34px;
  --measure: 62ch;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Shape and depth */
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 18px;
  --radius: 22px;
  --pill: 999px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --soft: 0 8px 28px rgba(0, 0, 0, .25);
  /* Motion: quiet by default — short, small, eased; one bigger moment for the score reveal */
  --ease: cubic-bezier(.25, .8, .25, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --dur-fast: 180ms;
  --dur-med: 280ms;
  --dur-slow: 420ms;
  --tabbar: 68px;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: var(--fs-base)/1.5 var(--font); }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .025;
  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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: .6; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent-lt); outline-offset: 3px; border-radius: 12px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Text helpers and spacing utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.sub-line { margin: var(--space-1) 0 0; color: var(--muted); max-width: var(--measure); }
.center-t { text-align: center; display: block; margin: var(--space-3) auto 0; }
.link, .linkish { color: var(--accent-lt); }
.link { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; }
.linkish { font-weight: 500; font-size: var(--fs-md); }
.linkish:hover, .uname:hover, .ftitle:hover { text-decoration: underline; }
.uname { font-weight: 600; }
.row-c { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; margin-top: var(--space-4); }
.h2m { font-size: var(--fs-xl); margin: var(--space-6) 0 var(--space-3); }
.mt-0 { margin-top: 0 !important; }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.flush { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--space-3); top: -60px; z-index: 200; padding: 10px var(--space-4); border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip:focus { top: var(--space-3); }
#view:focus { outline: none; }

/* ---------- Top bar and tab bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 10px max(var(--space-4), calc((100vw - 1160px) / 2));
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(22, 22, 22, .82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}
.logo {
  font-family: var(--font-brand); font-size: 28px; line-height: 1;
  background: linear-gradient(120deg, var(--accent-lt), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo.big { font-size: 44px; }
.topnav { display: flex; gap: 2px; }
.topnav a {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 9px var(--space-4); border-radius: var(--pill);
  color: var(--muted); font-weight: 500; font-size: var(--fs-md);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.topnav a:hover { color: var(--text); background: var(--card); }
.topnav a.active { background: var(--accent-tint); color: var(--accent-lt); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.iconbtn:hover, .iconbtn.active { color: var(--text); background: var(--card-2); }
.bell b { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--disliked); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.me-link { margin-left: 6px; border-radius: 50%; }
.me-link.active .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.mobile-only, .tabbar { display: none; }
.backbtn { display: none; margin-right: -10px; color: var(--text); }

@media (max-width: 860px) {
  .topbar { gap: var(--space-3); padding-left: var(--space-4); padding-right: var(--space-4); backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(22, 22, 22, .97); }
  .topnav { display: none; }
  .desktop-only { display: none !important; }
  .mobile-only { display: grid; }
  .backbtn:not([hidden]) { display: grid; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; justify-content: space-around; align-items: center;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(28, 28, 28, .97);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .04);
  }
  .guest .tabbar { display: none; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2) 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
  .tabbar a.active { color: var(--accent-lt); }
  .tab-add { width: 52px; height: 52px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center; color: var(--on-accent); background: var(--accent); box-shadow: 0 8px 22px rgba(229, 72, 77, .3); }
  .tab-add svg { width: 26px; height: 26px; stroke-width: 2.6; }
  body:not(.guest) .view { padding-bottom: calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
}

/* ---------- Page layout ---------- */
.view { max-width: 1160px; margin: 0 auto; padding: var(--space-5) var(--space-4) 72px; }
.section { margin-top: var(--space-7); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-head h2 { font-size: var(--fs-xl); }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); max-width: var(--measure); }
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.list-head h1, .feed-head h1 { font-size: var(--fs-2xl); }
.empty { text-align: center; padding: var(--space-7) 20px; border: 1.5px dashed rgba(255, 255, 255, .09); border-radius: var(--radius); color: var(--muted); margin-top: 20px; }
.empty h3 { color: var(--text); font-size: var(--fs-xl); margin-bottom: 6px; }
.empty p { max-width: 440px; margin: 0 auto; }
.empty .btn, .empty .row-c { margin-top: var(--space-4); }
.loading { display: grid; place-items: center; gap: var(--space-4); padding: 100px 0; color: var(--muted); }
.reel { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { display: flex; align-items: center; gap: 10px; padding: var(--space-3) var(--space-4); margin: var(--space-4) 0; border-radius: var(--radius-l); background: var(--card); font-weight: 500; }
.banner.accent { background: var(--accent-tint); color: var(--accent-lt); }
.panel-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--soft); padding: 18px; margin-bottom: var(--space-4); }
.panel-card h3 { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }

/* ---------- Buttons, chips, segmented controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 11px 22px; border-radius: var(--pill);
  font-weight: 600; font-size: var(--fs-md); white-space: nowrap;
  background: var(--card-2); border: 0;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px rgba(229, 72, 77, .22); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { color: var(--disliked); }
.btn.danger-fill { background: var(--disliked); color: #2a0d0d; }
.btn.sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; stroke-width: 2.2; }
.btn.google { background: #fff; color: #1f1f1f; min-height: 48px; }
.btn.google:hover { background: #f2f2f2; }
.g-logo { width: 18px !important; height: 18px !important; stroke: none !important; }

.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; padding: var(--space-2) var(--space-4); border-radius: var(--pill); font-size: var(--fs-sm); font-weight: 500; background: var(--card); color: var(--muted); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.chip:hover { background: var(--card-2); color: var(--text); }
.chip.on { background: var(--accent-tint); color: var(--accent-lt); }
.tag { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: var(--fs-xs); background: var(--card-2); color: var(--muted); vertical-align: middle; }
.tag.demo { padding: 1px 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: rgba(155, 152, 168, .14); margin-left: var(--space-1); }
.tag.ai { background: var(--accent-tint); color: var(--accent-lt); display: inline-flex; align-items: center; gap: var(--space-1); }
.tag.ai svg { width: 13px; height: 13px; }
.seg { display: inline-flex; gap: var(--space-1); padding: 5px; border-radius: var(--pill); background: var(--card); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg a { padding: var(--space-2) 18px; border-radius: var(--pill); font-size: var(--fs-md); font-weight: 500; color: var(--muted); white-space: nowrap; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.seg .on { background: var(--card-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.seg.big { display: flex; width: fit-content; margin: var(--space-2) 0 var(--space-1); }

/* ---------- Posters, cards, rails ---------- */
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-m); overflow: hidden; background: var(--card-2); box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.poster img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.poster .fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--space-3); font-weight: 600; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; overflow: hidden; }
.poster .fallback small { font-size: 11px; font-weight: 400; opacity: .75; margin-top: var(--space-1); }
/* Small thumbnails: no title text on the fallback, smaller corners */
.rowi .poster, .mposter .poster { border-radius: var(--radius-s); box-shadow: none; }
.nposter .poster, .crow .poster, .qa-row .poster { border-radius: 6px; }
.rowi .fallback, .mposter .fallback, .nposter .fallback, .crow .fallback, .qa-row .fallback { font-size: 0 !important; }
.rowi .fallback small, .mposter .fallback small, .nposter .fallback small, .crow .fallback small, .qa-row .fallback small { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
.card { position: relative; text-align: left; display: block; width: 100%; min-width: 0; }
.card .hit { display: block; width: 100%; text-align: left; }
.card .meta { padding: var(--space-2) 2px 0; }
.card .t { font-weight: 600; font-size: var(--fs-md); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .y { color: var(--dim); font-size: var(--fs-xs); }
.card .poster { transition: transform var(--dur-med) var(--ease); }
@media (hover: hover) { .card .hit:hover .poster { transform: translateY(-2px); } }
.badge { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 2; min-width: 38px; padding: 3px var(--space-2); border-radius: var(--pill); text-align: center; font-weight: 700; font-size: var(--fs-sm); color: var(--on-score); pointer-events: none; }
.badge.loved, .score.loved, .big-score.loved { background: var(--loved); }
.badge.fine, .score.fine, .big-score.fine { background: var(--fine); }
.badge.disliked, .score.disliked, .big-score.disliked { background: var(--disliked); }
.ribbon { position: absolute; top: var(--space-2); left: var(--space-2); z-index: 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(22, 22, 22, .75); pointer-events: none; }
.ribbon svg { width: 14px; height: 14px; fill: var(--accent-lt); stroke: var(--accent-lt); }
.quick .card { display: flex; flex-direction: column; }
.quick .card .acts { display: flex; gap: 6px; margin-top: auto; padding-top: var(--space-2); }
.quick .card .acts button { flex: 1; min-height: 34px; padding: 6px 0; border-radius: 12px; font-size: var(--fs-xs); font-weight: 600; background: var(--card-2); transition: background var(--dur-fast) var(--ease); }
.quick .card .acts button:hover { background: var(--card-3); }
.quick .card .acts button:first-child { background: var(--accent-tint); color: var(--accent-lt); }
.quick .card .acts button:first-child:hover { background: rgba(229, 72, 77, .24); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail > * { scroll-snap-align: start; }
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-4) 10px; }
  .poster .fallback { font-size: var(--fs-xs); padding: var(--space-2); }
  .rail { grid-auto-columns: 116px; }
}

.score { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; font-weight: 700; color: var(--on-score); font-size: var(--fs-md); }
.score.lg { width: 56px; height: 56px; font-size: var(--fs-lg); }
.avatar { --s: 40px; flex: none !important; width: var(--s) !important; min-width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: calc(var(--s) * .42); color: var(--on-score); background: var(--card-2); }
.lock svg { width: 15px; height: 15px; vertical-align: -2px; color: var(--muted); }

/* ---------- Discover, search ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--soft); padding: 36px 28px; background: radial-gradient(120% 140% at 100% 0%, rgba(229, 72, 77, .16), transparent 55%), linear-gradient(160deg, #272727, #1c1c1c); }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.05; max-width: 680px; }
.hero h1 em { font-style: normal; color: var(--accent-lt); }
.hero p { color: var(--muted); max-width: 560px; margin: var(--space-3) 0 22px; }
.hero .row { display: flex; gap: 10px; flex-wrap: wrap; }
.hero.compact { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-5) 26px; }
.hero.compact h1 { font-size: 32px; }
.hero.compact p { margin: var(--space-1) 0 0; }
.searchbar { position: relative; display: block; }
.searchbar > svg { position: absolute; left: var(--space-4); top: 50%; translate: 0 -50%; color: var(--muted); }
.searchbar input { width: 100%; padding: 14px 18px 14px 48px; border-radius: var(--pill); font-size: var(--fs-base); background: var(--card); border: 0; box-shadow: var(--soft); outline: none; }
.searchbar input:focus { box-shadow: 0 0 0 2px var(--accent-ring); }
.searchbar.fake { margin-top: 20px; padding: 14px 18px 14px 48px; border-radius: var(--pill); background: var(--card); box-shadow: var(--soft); color: var(--dim); }
.searchbar.fake:hover { background: var(--card-2); }
.filters { display: flex; gap: 10px; margin: 14px 0 10px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { background: var(--card); border: 0; border-radius: var(--pill); padding: 9px var(--space-4); font-size: var(--fs-sm); outline: none; max-width: 100%; }
.filters input { min-width: 180px; flex: 1 1 180px; }
.filters input:focus, .filters select:focus { box-shadow: 0 0 0 2px var(--accent-ring); }
@media (max-width: 560px) {
  .list-controls .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--space-4)); margin-right: calc(-1 * var(--space-4)); padding: 0 var(--space-4); }
  .list-controls .filters > * { flex: none; }
  .list-controls .filters input { min-width: 150px; }
}
.count { color: var(--muted); font-size: var(--fs-sm); margin: 14px 0; }
.more { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- Lists ---------- */
.list-controls { margin-top: 18px; }
.rows { display: flex; flex-direction: column; gap: var(--space-2); margin-top: 10px; }
.rowi { display: grid; grid-template-columns: 34px 50px 1fr auto; align-items: center; gap: 14px; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); border-radius: var(--radius-l); background: var(--card); text-align: left; width: 100%; transition: background var(--dur-fast) var(--ease); }
.rowi:hover { background: var(--card-2); }
.rowi .n { color: var(--dim); text-align: center; font-size: 17px; font-weight: 600; }
.rinfo { display: flex; flex-direction: column; min-width: 0; }
.rinfo .t { font-weight: 600; }
.rinfo .sub { color: var(--dim); font-size: var(--fs-sm); }
.rnote { color: var(--muted); font-size: var(--fs-sm); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recs { display: flex; flex-direction: column; gap: var(--space-3); margin-top: 18px; }
.rec { display: grid; grid-template-columns: 84px 1fr; gap: var(--space-4); padding: 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--soft); }
.rec-from { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); flex-wrap: wrap; }
.ftitle { font-weight: 600; text-align: left; }
.ftitle.big { display: block; font-size: 20px; margin: 6px 0 2px; }
.ftitle.big .muted { font-size: var(--fs-sm); font-weight: 400; }
.rec-msg { margin: var(--space-1) 0; color: var(--text-2); font-style: italic; }
.rec-acts { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: 10px; align-items: center; }
.pmine { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--fs-sm); }
.pmine .score { width: 34px; height: 34px; font-size: var(--fs-xs); }

/* ---------- To rank: bulk add ---------- */
.bulk p { margin: 0 0 var(--space-3); max-width: var(--measure); }
.bulk-text { min-height: 120px; font-size: 15px; }
.bulk-acts { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.review-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.match-list { display: flex; flex-direction: column; gap: var(--space-2); }
.match-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: start; padding: 10px var(--space-3); border-radius: var(--radius-l); background: var(--card-2); transition: opacity var(--dur-fast) var(--ease); }
.match-row.off { opacity: .55; }
.mposter { width: 48px; display: block; }
.mposter.none { aspect-ratio: 2 / 3; border-radius: var(--radius-s); background: var(--card-3); display: grid; place-items: center; color: var(--dim); font-weight: 600; }
.minfo { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.minfo small { color: var(--dim); }
.minfo .linkish { font-size: var(--fs-xs); }
.mtitle .tag { margin-left: var(--space-1); }
.mfix { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-1); }
.malt, .msearch .msq { background: var(--card); border: 0; border-radius: 10px; padding: 7px 10px; font-size: var(--fs-sm); color: var(--text); outline: none; }
.malt { max-width: 100%; }
.msearch .msq { width: 100%; max-width: 360px; }
.malt:focus, .msearch .msq:focus { box-shadow: 0 0 0 2px var(--accent-ring); }
.msr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msr:empty { display: none; }
.mseries { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--fs-sm); cursor: pointer; margin-top: 2px; }
.mseries input, .mtoggle input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.mseries input { margin-top: 1px; }
.mtoggle { padding-top: var(--space-1); cursor: pointer; }

/* ---------- Feed ---------- */
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.feed-side { position: sticky; top: 84px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.week { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.week .btn { grid-column: 1 / -1; }
.wk { display: flex; align-items: center; gap: 10px; }
.wk b { display: block; font-size: 15px; }
.wk small { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.flame { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--dim); flex: none; }
.flame.on { color: #fdba74; background: rgba(253, 186, 116, .12); }
.goal { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.goal em { position: absolute; font-style: normal; font-size: 11px; font-weight: 700; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: var(--card-2); stroke-width: 3.5; }
.ring circle + circle { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 100; }
@media (max-width: 960px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-side { position: static; order: -1; }
  .feed-side #suggest { display: none; }
  .week { grid-template-columns: 1fr 1fr auto; align-items: center; }
  .week .btn { grid-column: auto; }
}
@media (max-width: 560px) { .week { grid-template-columns: 1fr 1fr; } .week .btn { grid-column: 1 / -1; } }

.posts, #posts { display: flex; flex-direction: column; gap: 14px; }
.post { background: var(--card); border-radius: var(--radius); box-shadow: var(--soft); padding: 20px; }
.post header { display: flex; gap: var(--space-3); align-items: flex-start; }
.pwho { flex: 1; min-width: 0; line-height: 1.4; }
.pverb { color: var(--muted); }
.pverb .ftitle { color: var(--text); }
.pwho small { display: block; color: var(--dim); font-size: var(--fs-sm); }
.ptime { color: var(--dim); font-size: var(--fs-sm); white-space: nowrap; }
.pbody { display: grid; grid-template-columns: 92px 1fr; gap: var(--space-4); margin: 14px 0 6px 54px; align-items: start; }
.pposter { display: block; width: 100%; }
.pposter .poster .fallback { font-size: var(--fs-xs); padding: var(--space-2); }
.ptext p { margin: 10px 0 0; color: var(--text-2); font-size: 15px; max-width: var(--measure); }
.post footer { display: flex; gap: 6px; margin-left: 46px; }
.pbtn { display: inline-flex; align-items: center; gap: 6px; padding: var(--space-2) var(--space-3); border-radius: var(--pill); color: var(--muted); font-size: var(--fs-sm); font-weight: 500; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.pbtn:hover { background: var(--card-2); color: var(--text); }
.pbtn svg { width: 18px; height: 18px; }
.pbtn.like.on { color: #f9a8b8; }
.pbtn.like.on svg { fill: #f9a8b8; }
.pbtn.on:not(.like) { color: var(--accent-lt); }
.pbtn.on:not(.like) svg { fill: var(--accent); }
.pbtn.end { margin-left: auto; }
.cmts { margin: 10px 0 0 54px; padding-top: var(--space-3); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cmts[hidden] { display: none; }
.cmt { display: flex; gap: 10px; font-size: var(--fs-md); }
.cmt small { display: block; color: var(--dim); font-size: var(--fs-xs); }
.cmt-form { display: flex; gap: var(--space-2); }
.cmt-form input { flex: 1; min-width: 0; padding: 9px 14px; border-radius: var(--pill); background: var(--card-2); border: 0; outline: none; }
.cmt-form input:focus { box-shadow: 0 0 0 2px var(--accent-ring); }
@media (max-width: 560px) {
  .pbody { grid-template-columns: 76px 1fr; margin-left: 0; }
  .post footer, .cmts { margin-left: 0; }
}

/* ---------- People ---------- */
.urow { display: flex; align-items: center; gap: 10px; padding: var(--space-2) 0; }
.urow + .urow { border-top: 1px solid var(--line); }
.urow-main { flex: 1; display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.urow-main > span { min-width: 0; }
.urow-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow-main small { display: block; color: var(--dim); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.un .tag.demo { margin-left: 2px; flex: none; }
.ulist { background: var(--card); border-radius: var(--radius); box-shadow: var(--soft); padding: 6px var(--space-4); }
.dialog .ulist { background: none; box-shadow: none; padding: 0; }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: var(--space-4); flex-wrap: wrap; }
.invite small { display: block; color: var(--muted); }
.pick-people { display: flex; flex-direction: column; gap: var(--space-1); max-height: 320px; overflow-y: auto; margin: 14px 0; }
.pick-people.inline { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pp { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-l); background: var(--card-2); border: 2px solid transparent; cursor: pointer; }
.pp span { flex: 1; min-width: 0; font-weight: 500; }
.pp small { display: block; color: var(--dim); font-weight: 400; font-size: var(--fs-xs); }
.pp input { width: 20px; height: 20px; accent-color: var(--accent); }
.pp.on, .pp:has(input:checked) { border-color: var(--accent); }

/* ---------- Leaderboard, notifications ---------- */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.board li { display: flex; align-items: center; gap: 14px; padding: 10px var(--space-4); border-radius: var(--radius-l); background: var(--card); }
.board li.me { box-shadow: inset 0 0 0 1.5px rgba(229, 72, 77, .55); }
.place { width: 32px; text-align: center; font-size: var(--fs-lg); font-weight: 600; color: var(--dim); }
.place.p1 { color: #fcd34d; } .place.p2 { color: #d1d5db; } .place.p3 { color: #d97706; }
.count-big { font-size: var(--fs-xl); font-weight: 600; text-align: right; line-height: 1; }
.count-big small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.notes { display: flex; flex-direction: column; }
.note-row { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3); border-radius: var(--radius-m); }
.note-row > div { flex: 1; min-width: 0; color: var(--text-2); }
.note-row small { display: block; color: var(--dim); font-size: var(--fs-xs); }
.note-row.unread { background: rgba(229, 72, 77, .07); }
.nposter { width: 40px; flex: none; }

/* ---------- Profile ---------- */
.phead { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.pinfo { flex: 1; min-width: 240px; }
.pinfo h1 { font-size: 32px; line-height: 1.1; }
.archetype { color: var(--accent-lt); font-weight: 600; }
.bio { margin: var(--space-2) 0 0; color: var(--text-2); max-width: var(--measure); }
.pstats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: var(--space-3); font-size: var(--fs-md); color: var(--muted); }
.pstats b { color: var(--text); }
.pstats a:hover, .pstats button:hover { color: var(--text); }
.match { display: inline-block; margin-top: var(--space-3); padding: 6px 14px; border-radius: var(--pill); background: rgba(52, 211, 153, .12); color: #a7f3d0; font-size: var(--fs-md); }
.match.muted { background: var(--card); color: var(--muted); }
.pacts { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-top: 20px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--soft); padding: var(--space-4); }
.tile b { display: block; font-size: 26px; font-weight: 600; }
.tile b small { font-size: var(--fs-md); margin-left: 2px; color: var(--muted); }
.tile span { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.goal-tile { display: flex; align-items: center; gap: var(--space-3); }
.goal-tile .goal { width: 54px; height: 54px; }
.goal-tile b { font-size: var(--fs-xl); }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.top4 { display: grid; grid-template-columns: repeat(4, minmax(0, 170px)); gap: 14px; }
.bars { display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: var(--radius); box-shadow: var(--soft); padding: 18px; }
.bar { display: grid; grid-template-columns: 120px 1fr 70px; align-items: center; gap: var(--space-3); font-size: var(--fs-md); }
.track { height: 10px; border-radius: var(--pill); background: var(--card-2); overflow: hidden; }
.fill { height: 100%; border-radius: var(--pill); background: linear-gradient(90deg, #c93a3f, var(--accent-lt)); }
.bar .v { color: var(--muted); text-align: right; font-size: var(--fs-sm); }
@media (max-width: 480px) { .bar { grid-template-columns: 92px 1fr 58px; } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.bdg { padding: 14px; border-radius: var(--radius-m); background: var(--card); display: flex; flex-direction: column; gap: var(--space-1); opacity: .75; }
.bdg.on { opacity: 1; background: linear-gradient(160deg, rgba(229, 72, 77, .1), var(--card)); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, .3); }
.bdg i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--dim); margin-bottom: var(--space-1); }
.bdg.on i { background: var(--accent-tint); color: var(--accent-lt); }
.bdg small { color: var(--muted); font-size: var(--fs-xs); }
.bdg .track { height: 6px; margin-top: 6px; }
.compare-hero { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: var(--space-5); }
.compare-hero > div:not(.big-match) { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.big-match { font-family: var(--font-brand); font-size: 44px; color: var(--loved); text-align: center; line-height: 1; }
.big-match small { display: block; font-family: var(--font); font-size: var(--fs-xs); color: var(--muted); margin-top: var(--space-1); }
.crows { display: flex; flex-direction: column; gap: var(--space-2); }
.crow { display: grid; grid-template-columns: 40px 1fr auto auto 64px; gap: 14px; align-items: center; padding: var(--space-2) 14px var(--space-2) var(--space-2); background: var(--card); border-radius: var(--radius-l); text-align: left; }
.crow .t { font-weight: 600; min-width: 0; }
.crow .t small { display: block; color: var(--dim); font-weight: 400; }
.cs { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); max-width: 70px; overflow: hidden; }
.cs .score { width: 38px; height: 38px; font-size: var(--fs-sm); }
.cd { text-align: right; font-size: var(--fs-sm); color: var(--muted); }
.cd.agree { color: var(--loved); }
.cd.clash { color: var(--disliked); }
@media (max-width: 520px) { .crow { grid-template-columns: 34px 1fr auto auto; } .cd { display: none; } }

/* ---------- Film page (sheet) and dialogs ---------- */
.sheet, .modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; }
.modal { z-index: 45; }
.sheet[hidden], .modal[hidden], .flow[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(10, 10, 10, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade var(--dur-med) var(--ease); }
.panel, .dialog { position: relative; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-2); border-radius: 24px 24px 0 0; box-shadow: var(--shadow); animation: up var(--dur-slow) var(--ease-out); }
.panel { width: min(860px, 100%); }
.dialog { width: min(520px, 100%); max-height: 88vh; padding: var(--space-5); }
.dialog.wide { width: min(640px, 100%); }
@media (min-width: 761px) { .sheet, .modal { place-items: center; } .panel, .dialog { border-radius: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.backdrop { position: absolute; inset: 0 0 auto; height: 280px; overflow: hidden; pointer-events: none; }
.backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(30px) saturate(1.2); opacity: .45; transform: scale(1.3); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--bg-2)); }
.close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.close:hover { background: rgba(255, 255, 255, .14); }
.close svg { width: 18px; height: 18px; stroke-width: 2.4; }
.film { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 26px; padding: 28px; }
.film h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; padding-right: 36px; }
.film .facts { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: 10px 0 var(--space-4); }
.film .plot { color: var(--text-2); font-size: 15px; max-width: var(--measure); }
.film .cast { color: var(--muted); font-size: var(--fs-md); }
.film .cast b { color: var(--text); font-weight: 500; }
.film .acts { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-4) 0; }
.yourscore { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-m); background: var(--card); margin: 6px 0 var(--space-1); }
.yourscore small { display: block; color: var(--muted); }
.yourscore.rec { border: 1px dashed var(--line-2); }
.statline { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-md); color: var(--muted); margin-bottom: var(--space-3); }
.statline b { color: var(--text); }
.statline svg { width: 16px; height: 16px; }
.film-more { padding: 0 28px 28px; position: relative; }
.whos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2); }
.who { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-radius: var(--radius-l); background: var(--card); }
.who > span:not(.avatar):not(.score) { flex: 1; min-width: 0; }
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .score { width: 38px; height: 38px; font-size: var(--fs-sm); }
.wiki { color: var(--muted); font-size: var(--fs-sm); text-decoration: underline; }
@media (max-width: 600px) {
  .film { grid-template-columns: 110px 1fr; gap: var(--space-4); padding: 22px var(--space-4); }
  .film .body { grid-column: 1 / -1; }
  .film-more { padding: 0 var(--space-4) var(--space-5); }
}
.dlg-title { font-size: var(--fs-xl); margin-bottom: var(--space-2); padding-right: 40px; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.qa-results { margin-top: 14px; display: flex; flex-direction: column; gap: var(--space-1); min-height: 200px; }
.qa-row { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-2); border-radius: 12px; text-align: left; }
.qa-row:hover, .qa-row:focus-visible { background: var(--card); }
.qa-row small { display: block; color: var(--dim); }
.qa-row .score { width: 36px; height: 36px; font-size: var(--fs-xs); }
.qa-go { color: var(--accent-lt); padding-right: 6px; }
.qa-hint { margin: var(--space-1) var(--space-2) var(--space-2); font-size: var(--fs-sm); }
.qa-bulk { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); padding: var(--space-3) 14px; border-radius: var(--radius-l); background: var(--card); }
.qa-bulk:hover { background: var(--card-2); }
.qa-bulk > span { flex: 1; }
.qa-bulk small { display: block; color: var(--muted); }
.qa-bulk > svg:first-child { color: var(--accent-lt); }

/* ---------- Watch details form (film page and ranking reveal) ---------- */
.details { display: flex; flex-direction: column; gap: 10px; margin-top: var(--space-3); }
.details label { margin: 0; }
.drow { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.drow label { display: flex; flex-direction: row; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--muted); }
.details input[type=date], .details input[type=text] { background: var(--card-2); border: 0; border-radius: var(--radius-m); padding: 9px var(--space-3); outline: none; color-scheme: dark; }
.details input[type=text] { width: 100%; }
.check { cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check svg { width: 16px; height: 16px; }
.note { width: 100%; min-height: 76px; resize: vertical; padding: var(--space-3); border-radius: var(--radius-m); background: var(--card-2); border: 0; outline: none; }
.details input:focus, .note:focus { box-shadow: 0 0 0 2px var(--accent-ring); }

/* ---------- Ranking flow ---------- */
.flow { position: fixed; inset: 0; z-index: 50; background: radial-gradient(90% 70% at 50% 0%, #2a1718, var(--bg) 70%); overflow-y: auto; animation: fade var(--dur-fast) var(--ease-out); }
.flow-in { min-height: 100%; max-width: 760px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) var(--space-4) 40px; display: flex; flex-direction: column; }
.flow-top { display: flex; justify-content: space-between; align-items: center; }
.flow-top .step { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.flow h2 { text-align: center; font-size: clamp(26px, 5vw, 38px); margin: 22px 0 6px; }
.flow .sub { text-align: center; color: var(--muted); margin: 0 0 var(--space-5); }
.flow .center { display: flex; flex-direction: column; align-items: center; flex: 1; justify-content: center; }
.feel-poster { width: 150px; margin: 6px auto 0; }
.feels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); width: 100%; max-width: 560px; }
.feel { position: relative; padding: 20px 10px; border-radius: var(--radius); background: var(--card); box-shadow: var(--soft); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); font-weight: 600; text-align: center; transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.feel:hover { background: var(--card-2); }
@media (hover: hover) { .feel:hover { transform: translateY(-3px); } }
.feel i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.feel i svg { width: 24px; height: 24px; stroke: var(--on-score); stroke-width: 2.4; }
.feel small { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.feel kbd { position: absolute; top: var(--space-2); right: 10px; font: 600 11px var(--font); color: var(--dim); }
@media (hover: none) { .feel kbd { display: none; } }
.feel.loved i { background: var(--loved); }
.feel.fine i { background: var(--fine); }
.feel.disliked i { background: var(--disliked); }
.feel.loved:hover { box-shadow: 0 0 0 2px rgba(111, 220, 176, .6), var(--soft); }
.feel.fine:hover { box-shadow: 0 0 0 2px rgba(245, 207, 107, .6), var(--soft); }
.feel.disliked:hover { box-shadow: 0 0 0 2px rgba(243, 154, 154, .6), var(--soft); }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; width: 100%; max-width: 600px; }
.pick { border-radius: 24px; padding: var(--space-3); background: var(--card); box-shadow: var(--soft); text-align: center; transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease), opacity var(--dur-med) var(--ease); }
.pick .poster { width: min(100%, 210px); margin: 0 auto; }
@media (hover: hover) { .pick:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px rgba(229, 72, 77, .55), 0 18px 40px rgba(0, 0, 0, .3); } }
.pick.chosen { box-shadow: 0 0 0 2.5px var(--accent), 0 18px 40px rgba(229, 72, 77, .18); transform: scale(1.02); }
.pick.lost { opacity: .4; transform: scale(.97); }
.pick .t { font-weight: 600; margin-top: 10px; line-height: 1.3; }
.pick .y { color: var(--dim); font-size: var(--fs-sm); }
.pick .new { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--accent-lt); letter-spacing: .1em; text-transform: uppercase; }
.vs { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--accent-lt); background: var(--card-3); box-shadow: 0 0 0 6px rgba(255, 255, 255, .03); }
@media (max-width: 520px) {
  .duel { gap: var(--space-2); }
  .vs { width: 38px; height: 38px; font-size: var(--fs-md); }
  .pick { padding: var(--space-2); }
  .feels { gap: var(--space-2); }
  .feel { padding: var(--space-4) 6px; font-size: var(--fs-md); }
}
.flow-foot { display: flex; justify-content: center; gap: 10px; margin-top: var(--space-5); flex-wrap: wrap; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent-lt); }
.reveal { text-align: center; }
.big-score { width: 140px; height: 140px; margin: 14px auto; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-brand); font-size: 52px; color: var(--on-score); box-shadow: 0 0 80px rgba(229, 72, 77, .14); animation: pop .7s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.reveal .rank { color: var(--muted); margin: 6px 0 0; }
.reveal .rank b { color: var(--text); }
.beat { color: var(--dim); font-size: var(--fs-sm); margin: var(--space-1) 0 0; }
.reveal-details { max-width: 480px; margin: 14px auto 0; text-align: left; }
.spark { position: fixed; top: 22%; left: 50%; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; animation: burst 1s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }

/* ---------- Welcome, sign in, onboarding, settings ---------- */
.welcome { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-7); align-items: center; min-height: calc(100vh - 160px); }
@media (max-width: 860px) { .welcome { grid-template-columns: 1fr; gap: 28px; } }
.w-copy h1 { font-size: clamp(34px, 5.5vw, 56px); line-height: 1.04; margin: 18px 0 14px; }
.lead { color: var(--text-2); font-size: 17px; max-width: 540px; margin: 0; }
.w-feats { list-style: none; padding: 0; margin: 26px 0; display: flex; flex-direction: column; gap: var(--space-3); }
.w-feats li { display: flex; gap: var(--space-3); align-items: center; color: var(--muted); }
.w-feats li > svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--card); color: var(--accent-lt); }
.w-feats b { color: var(--text); font-weight: 600; }
.auth { background: var(--card); border-radius: 24px; padding: var(--space-5); box-shadow: var(--shadow); }
.auth .seg { display: flex; margin-bottom: 18px; background: var(--card-2); }
.auth .seg button { flex: 1; }
.auth .seg .on { background: var(--card-3); }
.auth h2 { font-size: 26px; margin-bottom: var(--space-2); }
.or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; color: var(--dim); font-size: var(--fs-sm); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#auth-form label, .form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); margin-bottom: var(--space-3); }
#auth-form input, .form input:not([type=checkbox]):not([type=range]), .form textarea, .field {
  width: 100%; padding: var(--space-3) 14px; border-radius: var(--radius-m); background: var(--card-2); border: 0; outline: none; font-size: 15px; color: var(--text);
}
#auth-form input:focus, .form input:focus, .form textarea:focus, .field:focus-within { box-shadow: 0 0 0 2px var(--accent-ring); }
.field { display: flex; align-items: center; padding: 0; }
.field .at { padding: 0 var(--space-1) 0 14px; color: var(--dim); font-size: 15px; }
.field .at:last-child { padding: 0 14px 0 var(--space-1); }
.field input { box-shadow: none !important; background: none !important; padding-left: 2px !important; }
.hint { font-weight: 400; color: var(--dim); }
.hint.good { color: var(--loved); }
.hint.bad { color: var(--disliked); }
.form-err { color: var(--disliked); font-size: var(--fs-md); margin: 0 0 10px; }
.form-err:empty { display: none; }
.demo-note { display: flex; gap: 10px; margin-top: 18px; padding: var(--space-3); border-radius: 12px; background: var(--bg-2); color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.demo-note svg { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-lt); }
.ob { max-width: 920px; margin: 0 auto; text-align: center; }
.ob h1 { font-size: 36px; margin: 18px 0 6px; }
.ob .ulist { text-align: left; margin-top: 20px; }
.ob .grid { text-align: left; }
.ob-steps { display: flex; gap: 6px; justify-content: center; }
.ob-steps i { width: 36px; height: 5px; border-radius: var(--pill); background: var(--line); }
.ob-steps i.on { background: var(--accent); }
.form { max-width: 640px; display: flex; flex-direction: column; }
.form h3 { margin-bottom: 14px; }
.form .btn { align-self: flex-start; }
.form p { margin: 0 0 var(--space-3); }
.av-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.av-edit label { flex: 1; margin: 0; }
.av-edit input[type=range] { accent-color: var(--accent); }
.switch { flex-direction: row !important; align-items: flex-start; gap: var(--space-3) !important; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.switch b { color: var(--text); display: block; }
.switch small { font-weight: 400; }
.settings { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: var(--radius-l); background: var(--card-3); color: var(--text); box-shadow: var(--shadow); font-weight: 500; font-size: var(--fs-md); transition: opacity .25s, translate .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 860px) { body:not(.guest) .toast { bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); } }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sink { to { opacity: 0; transform: translateY(24px); } }
.view.enter > * { animation: rise var(--dur-med) var(--ease-out) both; }
.flow-in { animation: rise var(--dur-med) var(--ease-out) both; }
.closing { pointer-events: none; }
.closing .scrim, .flow.closing { animation: fade-out var(--dur-fast) var(--ease-in) forwards; }
.closing .panel, .closing .dialog { animation: sink var(--dur-fast) var(--ease-in) forwards; }
/* Touch screens: a quick press-in instead of hover lifts */
@media (hover: none) {
  .card .hit:active .poster, .pick:active, .feel:active, .rowi:active, .qa-row:active { transform: scale(.97); transition: transform 90ms var(--ease-out); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.qa-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.qa-head .qa-hint { margin: 0 var(--space-2); }

/* ---------- View transitions (tab switches, removed items) ---------- */
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }
.seg .on { view-transition-name: seg-on; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-fast); }
::view-transition-group(seg-on) { animation-duration: var(--dur-med); animation-timing-function: var(--ease-out); }
.vt-cards .grid .card, .vt-cards .rec, .vt-cards .post, .vt-cards .urow { view-transition-name: match-element; view-transition-class: item; }
::view-transition-group(.item) { animation-duration: var(--dur-med); animation-timing-function: var(--ease-out); }
::view-transition-old(.item):only-child { animation: vt-out var(--dur-fast) var(--ease-in) forwards; }
::view-transition-new(.item):only-child { animation: vt-in var(--dur-med) var(--ease-out); }
@keyframes vt-in { from { opacity: 0; transform: scale(.92); } }
@keyframes vt-out { to { opacity: 0; transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
