/* ==========================================================================
   Cinematic Universe — visual system
   Deep black / midnight navy, electric blue, violet, cyan, subtle gold.
   ========================================================================== */
:root {
  --bg-0: #03050b;
  --bg-1: #070b18;
  --bg-2: #0c1226;
  --ink-0: #eef2ff;
  --ink-1: #b9c2dc;
  --ink-2: #8b95b4;
  --ink-3: #636d8d;
  --blue: #4d7cff;
  --cyan: #58e6ff;
  --violet: #9b7bff;
  --gold: #f2c56b;
  --danger: #ff5d7a;
  --glass: rgba(12, 17, 36, 0.62);
  --glass-strong: rgba(10, 14, 30, 0.86);
  --line: rgba(150, 170, 255, 0.12);
  --line-strong: rgba(150, 170, 255, 0.24);
  --radius: 14px;
  --radius-sm: 9px;
  --blur: 18px;
  --top-h: 60px;
  --bottom-h: 34px;
  --panel-w: 300px;
  --right-w: 400px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 800px at 70% 20%, rgba(77, 124, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at 15% 85%, rgba(155, 123, 255, 0.09), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(88, 230, 255, 0.04), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  color: var(--ink-0);
  font: 14px/1.45 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }

#universe { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: fixed; top: 10px; left: 10px; right: 10px; height: var(--top-h);
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 18px;
  border-radius: var(--radius); z-index: 30;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink-0); text-decoration: none; white-space: nowrap;
  letter-spacing: .22em; font-size: 12.5px; font-weight: 500; }
.logo b { font-weight: 700; color: var(--cyan); }
.nav { display: flex; gap: 2px; }
.nav-btn { padding: 8px 12px; border-radius: 8px; color: var(--ink-1); font-size: 13px; letter-spacing: .02em; transition: color .2s, background .2s; }
.nav-btn:hover, .nav-btn.active { color: var(--ink-0); background: rgba(120, 140, 255, 0.10); }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; height: 38px; padding: 0 38px 0 38px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(4, 7, 18, 0.55); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: rgba(88, 230, 255, 0.45); box-shadow: 0 0 0 4px rgba(88, 230, 255, 0.08); }
.search-icon { position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; color: var(--ink-2); pointer-events: none; }
.search-kbd { position: absolute; right: 10px; top: 9px; font: 11px var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.search input:focus ~ .search-kbd { display: none; }
.search-results { position: absolute; top: 46px; left: 0; right: 0; max-height: min(58vh, 500px); overflow: auto; border-radius: 12px; padding: 6px; background: var(--glass-strong); }
.sr-group { display: flex; align-items: center; gap: 8px; padding: 10px 10px 5px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.sr-group + .sr-item { margin-top: 1px; }
.sr-group:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }
.sr-group .sr-n { margin-left: auto; font: 10.5px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.sr-badge { flex: none; font-size: 10.5px; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-1); }
.sr-badge.d { border-color: rgba(242, 197, 107, .45); color: var(--gold); }
.sr-badge.a { border-color: rgba(88, 230, 255, .4); color: var(--cyan); }
.sr-badge.k { border-color: rgba(155, 123, 255, .45); color: var(--violet); }
.sr-foot { display: flex; gap: 14px; padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.sr-foot kbd { font: 10.5px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--ink-2); }
.sr-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; color: var(--ink-1); }
.sr-item:hover, .sr-item.active { background: rgba(88, 230, 255, 0.09); color: var(--ink-0); }
.sr-item .sr-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .sr-meta { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.sr-item .sr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.sr-item mark { background: none; color: var(--cyan); }
.sr-empty { padding: 14px; color: var(--ink-2); }

.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-1); transition: background .2s, color .2s; flex: none; }
.icon-btn:hover { background: rgba(120, 140, 255, 0.12); color: var(--ink-0); }
.icon-btn svg { width: 18px; height: 18px; }
.mobile-only { display: none; }

/* explore menu */
.menu { position: fixed; z-index: 40; min-width: 250px; padding: 6px; border-radius: 12px; background: var(--glass-strong); }
.menu button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink-1); text-align: left; }
.menu button span { width: 18px; text-align: center; color: var(--cyan); }
.menu button:hover { background: rgba(88, 230, 255, 0.08); color: var(--ink-0); }
.menu button:disabled { opacity: .4; cursor: default; }

/* ------------------------------------------------------------------ panels */
.panel {
  position: fixed; top: calc(var(--top-h) + 20px); bottom: calc(var(--bottom-h) + 20px);
  border-radius: var(--radius); z-index: 20; display: flex; flex-direction: column;
  transition: transform .45s var(--ease), opacity .35s;
}
.panel-left { left: 10px; width: var(--panel-w); }
.panel-right { right: 10px; width: var(--right-w); }
.panel.collapsed.panel-left { transform: translateX(calc(-100% - 20px)); opacity: 0; pointer-events: none; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; flex: 1; }
.tab { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; letter-spacing: .03em; }
.tab.active { color: var(--ink-0); background: rgba(120, 140, 255, 0.12); }
.tab-body { flex: 1; overflow: auto; padding: 14px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.reopen { position: fixed; top: calc(var(--top-h) + 22px); left: 10px; z-index: 19; width: 34px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-1); }
.reopen svg { width: 18px; height: 18px; }

.field { margin: 0 0 18px; }
.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 9px; }
.field-label .val { letter-spacing: 0; text-transform: none; color: var(--ink-0); font: 12px var(--mono); }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }
.link { color: var(--cyan); font-size: 11.5px; letter-spacing: 0; text-transform: none; opacity: .85; }
.link:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12px; color: var(--ink-1); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); transition: all .2s; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip:hover { border-color: var(--line-strong); color: var(--ink-0); }
.chip.on { color: var(--ink-0); border-color: rgba(88, 230, 255, 0.45); background: rgba(88, 230, 255, 0.10); }
.chip.static { cursor: default; }
.catalogue { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; margin: 0 2px 14px; font-size: 12px; color: var(--ink-2); }
.catalogue > b { font: 600 17px var(--mono); color: var(--ink-0); }
.catalogue .cat-sub { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); }
.catalogue .cat-sub b { font: 500 11.5px var(--mono); color: var(--ink-2); }

/* collapsible filter groups: essentials stay open, advanced filters fold away */
.fgroup { border-top: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.fgroup summary { display: flex; align-items: center; gap: 10px; padding: 11px 2px; cursor: pointer; list-style: none;
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-1); }
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary > span:first-child { flex: 1; }
.fgroup summary::after { content: '›'; margin-left: 2px; font-size: 15px; letter-spacing: 0; color: var(--ink-3); transition: transform .2s; }
.fgroup[open] summary::after { transform: rotate(90deg); }
.fgroup summary:hover { color: var(--ink-0); }
.fsum { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 11.5px var(--mono); letter-spacing: 0; text-transform: none; color: var(--cyan); }
.fsum:empty { display: none; }
.fgroup .fbody { padding: 2px 2px 14px; }
.fgroup .fbody .field:last-child { margin-bottom: 0; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: rgba(4, 7, 18, 0.5); border: 1px solid var(--line); margin-bottom: 18px; }
.seg-btn { flex: 1; padding: 7px 6px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.seg-btn.active { background: linear-gradient(135deg, rgba(77, 124, 255, .35), rgba(155, 123, 255, .3)); color: var(--ink-0); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12.5px; margin-top: 8px; cursor: pointer; }
.check input { accent-color: var(--cyan); }
select, .input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(4, 7, 18, 0.55); outline: none;
}
select:focus, .input:focus { border-color: rgba(88, 230, 255, 0.45); }
.btn { padding: 9px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line-strong); color: var(--ink-0); background: rgba(120, 140, 255, 0.08); transition: background .2s; }
.btn:hover { background: rgba(120, 140, 255, 0.16); }
.btn.ghost { background: transparent; }
.btn.primary { background: linear-gradient(135deg, rgba(77, 124, 255, .55), rgba(155, 123, 255, .5)); border-color: transparent; }
.btn.wide { width: 100%; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, rgba(88,230,255,.35), rgba(155,123,255,.35)); border-radius: 3px; }
input[type=range]::-moz-range-track { height: 3px; background: linear-gradient(90deg, rgba(88,230,255,.35), rgba(155,123,255,.35)); border-radius: 3px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--ink-0); box-shadow: 0 0 0 3px rgba(88,230,255,.25), 0 0 12px rgba(88,230,255,.6); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink-0); box-shadow: 0 0 0 3px rgba(88,230,255,.25), 0 0 12px rgba(88,230,255,.6); }
.range2 { position: relative; height: 22px; }
.rating-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rating-grid .mini { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--ink-3); }
.rating-grid .mini.wide { grid-column: 1 / -1; }
.rating-grid .mini[hidden] + .mini:not(.wide), .rating-grid .mini:only-of-type { grid-column: 1 / -1; }
.rating-grid select { height: 32px; }
#rating-field .link { margin-top: 6px; }
.range2 input { position: absolute; inset: 0; pointer-events: none; }
.range2 input::-webkit-slider-thumb { pointer-events: auto; }
.range2 input::-moz-range-thumb { pointer-events: auto; }
.range2 input + input::-webkit-slider-runnable-track { background: transparent; }
.range2 input + input::-moz-range-track { background: transparent; }

/* cluster explorer */
.cluster-sort { display: flex; gap: 14px; margin: 10px 2px 8px; }
.cluster-sort .link { color: var(--ink-2); }
.cluster-sort .link.active { color: var(--cyan); }
.cluster-list { display: flex; flex-direction: column; gap: 6px; }
/* region groups in the cluster explorer */
.rg-item { border-radius: 12px; border: 1px solid transparent; transition: border-color .2s, background .2s; }
.rg-item.open { background: rgba(255, 255, 255, 0.025); border-color: var(--line); }
.rg-item.active { border-color: rgba(88, 230, 255, 0.35); }
.rg-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 12px; }
.rg-head:hover { background: rgba(255, 255, 255, 0.04); }
.rg-dot { width: 12px; height: 12px; }
.rg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rg-name { font-size: 13.5px; font-weight: 600; color: var(--ink-0); }
.rg-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.rg-caret { color: var(--ink-3); transition: transform .2s; font-size: 15px; }
.rg-item.open .rg-caret { transform: rotate(90deg); }
.rg-children { display: none; padding: 0 8px 10px 14px; }
.rg-item.open .rg-children { display: flex; flex-direction: column; gap: 4px; }
.rg-desc { margin: 0 4px 6px; font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.rg-swatches { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 4px 8px; }
.rg-swatches i { width: 12px; height: 6px; border-radius: 2px; }
.cluster-list { gap: 4px; }
.rg-line { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 3px; }
.cl-item { text-align: left; padding: 10px 12px; border-radius: 11px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.02); transition: all .2s; display: block; width: 100%; }
.cl-item:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.cl-item.active { border-color: rgba(88, 230, 255, 0.35); background: rgba(88, 230, 255, 0.06); }
.cl-top { display: flex; align-items: center; gap: 9px; }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; background: currentColor; }
.cl-name { flex: 1; font-size: 13.5px; color: var(--ink-0); line-height: 1.35; }
.cl-size { font: 11.5px var(--mono); color: var(--ink-2); }
.cl-sub { margin: 5px 0 0 19px; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.cl-detail { margin: 10px 0 2px 19px; display: none; }
.cl-item.active .cl-detail { display: block; }
.cl-detail .reps-h { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.cl-detail .reps { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.cl-detail .reps button { text-align: left; color: var(--ink-1); font-size: 12.5px; padding: 3px 0; }
.cl-detail .reps button:hover { color: var(--cyan); }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }

/* results list (people / keywords) */
.results-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.results-head p { margin: 0 0 12px; font-size: 12.5px; }
.results-list { display: flex; flex-direction: column; gap: 2px; }
.rl-item { display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 6px 8px; border-radius: 8px; color: var(--ink-1); width: 100%; }
.rl-item:hover { background: rgba(88, 230, 255, 0.07); color: var(--ink-0); }
.rl-item .n { font: 11px var(--mono); color: var(--ink-3); width: 26px; flex: none; }
.rl-item .t .o { display: block; font-size: 11.5px; color: var(--ink-3); }
.rl-item .m { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 11px var(--mono); color: var(--ink-2); white-space: nowrap; }
.rl-item .m .star { color: var(--gold); }
.results-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.results-filter { font-size: 12px; margin: -2px 0 10px; }
.sort-ctl { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sort-ctl select { height: 30px; width: auto; font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--ink-0); padding: 0 8px; }
.rl-item .t { flex: 1; min-width: 0; }
.rl-item .y { font: 12px var(--mono); color: var(--ink-3); }

/* ------------------------------------------------------------------ details panel */
.crumbs { flex: 1; display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--ink-3); }
.crumbs button { color: var(--ink-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.crumbs button:hover { color: var(--cyan); }
.crumbs .sep { opacity: .5; }
.detail { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.hero { position: relative; display: flex; gap: 18px; padding: 20px 20px 16px; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-bg, none) center/cover; opacity: .18; filter: blur(30px) saturate(1.4); mask-image: linear-gradient(#000, transparent); pointer-events: none; }
.poster { position: relative; width: 136px; flex: none; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; background: linear-gradient(145deg, rgba(77,124,255,.25), rgba(155,123,255,.18)); box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; text-align: center; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .4s; z-index: 1; }
.poster-fallback { padding: 10px; font-size: 12px; line-height: 1.3; color: var(--ink-1); font-weight: 600; letter-spacing: .01em; }
.poster img.loaded { opacity: 1; }
.hero-text { position: relative; min-width: 0; }
.kicker { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.kicker.doc { color: var(--gold); }
.hero h2 { margin: 0; font-size: 23px; line-height: 1.18; font-weight: 650; letter-spacing: -.015em; }
.hero .orig { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-1); font-size: 12.5px; margin-top: 10px; }
.meta-line .star { color: var(--gold); }
.hero .chips { margin-top: 10px; }
.hero .chip { font-size: 11px; padding: 2px 8px; }
.dtabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--glass-strong); z-index: 2; }
.dtab { padding: 12px 12px 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s; }
.dtab:hover { color: var(--ink-0); }
.dtab.active { color: var(--ink-0); border-color: var(--cyan); text-shadow: 0 0 14px rgba(88, 230, 255, .35); }
.dbody { padding: 18px 20px 28px; }
.overview { color: #cfd6ee; font-size: 14.5px; line-height: 1.68; margin: 0 0 18px; max-width: 62ch; }
.tagline { color: var(--ink-2); font-style: italic; margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 0 14px; font-size: 13px; margin: 0 0 18px; }
.kv dt, .kv dd { padding: 7px 0; border-bottom: 1px solid rgba(150, 170, 255, 0.07); line-height: 1.5; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink-1); }
.kv dd button { color: var(--ink-1); text-decoration: underline; text-decoration-color: rgba(150, 170, 255, .25); text-underline-offset: 3px; }
.kv dd button:hover { color: var(--cyan); }
.cluster-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); margin-bottom: 16px; text-align: left; width: 100%; }
.cluster-card:hover { border-color: var(--line-strong); }
.cluster-card .cl-dot { margin-top: 4px; }
.cluster-card .t { font-size: 13px; color: var(--ink-0); }
.cluster-card .s { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links a { font-size: 12px; color: var(--ink-1); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; text-decoration: none; }
.links a:hover { color: var(--ink-0); border-color: var(--line-strong); }
.section-title { font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 10px; }

.sim-list { display: flex; flex-direction: column; gap: 4px; }
.sim { display: grid; grid-template-columns: 22px 38px 1fr; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; text-align: left; width: 100%; transition: background .2s; }
.sim:hover, .sim.hover { background: rgba(88, 230, 255, 0.07); }
.sim .rank { font: 11px var(--mono); color: var(--ink-3); text-align: right; }
.sim .thumb { width: 38px; aspect-ratio: 2/3; border-radius: 5px; overflow: hidden; background: linear-gradient(145deg, rgba(77,124,255,.2), rgba(155,123,255,.15)); }
.sim .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.sim .thumb img.loaded, .tooltip .tp-poster img.loaded { opacity: 1; }
.sim .st { min-width: 0; }
.sim .tt { font-size: 13px; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim .tt span { color: var(--ink-3); font: 11.5px var(--mono); margin-left: 6px; }
.sim .why { font-size: 11px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim .why b { color: var(--violet); font-weight: 500; }
.sim .score { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.sim .score .bar { flex: 1; max-width: 120px; }
.sim .score em { font: 10.5px var(--mono); color: var(--ink-2); font-style: normal; }
.sim .score em.rv { margin-left: auto; color: var(--ink-3); }
.graph-wrap { position: relative; border-radius: 12px; border: 1px solid var(--line); background: rgba(3, 5, 12, 0.5); overflow: hidden; }
.graph-wrap canvas { display: block; width: 100%; height: 360px; cursor: pointer; }
.graph-legend { font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }

/* ------------------------------------------------------------------ controls */
.controls { position: fixed; left: calc(50% - var(--shift-x, 0px)); transform: translateX(-50%); bottom: calc(var(--bottom-h) + 18px); z-index: 20; display: flex; flex-direction: row; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 13px; transition: left .45s var(--ease); }
.ctl { width: 36px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-2); transition: all .2s; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.ctl svg { width: 18px; height: 18px; }
.ctl:hover { color: var(--ink-0); background: rgba(120, 140, 255, 0.12); }
.ctl.on, .ctl[aria-pressed=true] { color: var(--cyan); }
.ctl.txt { font-family: var(--mono); }
.ctl-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }

/* ------------------------------------------------------------------ tooltip + labels */
.tooltip { position: fixed; z-index: 35; pointer-events: none; width: 300px; padding: 10px; border-radius: 12px; display: flex; gap: 10px; background: var(--glass-strong); transform: translate(16px, 16px); }
.tooltip .tp-poster { width: 54px; flex: none; aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; background: linear-gradient(145deg, rgba(77,124,255,.25), rgba(155,123,255,.18)); }
.tooltip .tp-poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.tooltip .tp-body { min-width: 0; flex: 1; }
.tooltip .tp-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.tooltip .tp-title span { color: var(--ink-2); font-weight: 400; font: 12px var(--mono); margin-left: 4px; }
.tooltip .tp-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
.tooltip .tp-meta .star { color: var(--gold); }
.tooltip .tp-cluster { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-1); margin-top: 5px; }
.tooltip .tp-cluster i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: none; }
.tooltip .tp-desc { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.labels { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-1); text-shadow: 0 0 12px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .9); transition: opacity .3s; will-change: transform, opacity; }
.lbl i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
/* Region labels sit on top of their own (same-coloured) stars, so they get a dark pill and
   near-white text; the coloured dot keeps the colour key. */
.lbl.region, .lbl:not(.title) { pointer-events: none; cursor: pointer; }
.lbl:not(.title):hover { filter: brightness(1.35); }
.trail { position: fixed; top: calc(var(--top-h) + 22px); left: calc(50% - var(--shift-x, 0px)); transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 6px; max-width: min(720px, calc(100vw - var(--panel-w) - var(--right-w) - 60px));
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; transition: left .45s var(--ease); }
.trail button { color: var(--ink-1); display: inline-flex; align-items: center; gap: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.trail button:hover { color: var(--cyan); }
.trail i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; flex: none; }
.trail .sep { color: var(--ink-3); }
.trail .here { color: var(--ink-0); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lbl.region { font-size: 12px; font-weight: 600; letter-spacing: .16em; padding: 4px 10px 4px 8px; border-radius: 999px;
  background: rgba(4, 7, 18, 0.62); border: 1px solid rgba(255, 255, 255, 0.08); text-shadow: none; }
.lbl.region i { width: 8px; height: 8px; }
.lbl.active { padding: 4px 9px; border-radius: 7px; background: rgba(4, 7, 18, 0.78); border: 1px solid currentColor; font-weight: 600; letter-spacing: .1em; }
.lbl.active { box-shadow: 0 0 18px rgba(0, 0, 0, .6); }
.lbl.title { padding: 2px 7px; border-radius: 6px; background: rgba(4, 7, 18, 0.66); text-shadow: none; }
.lbl.title.near { font-size: 11.5px; color: var(--ink-1); background: rgba(4, 7, 18, 0.5); }
.lbl.title { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink-0); }
.lbl.title.sel { color: var(--gold); font-weight: 600; font-size: 13px; }

/* ------------------------------------------------------------------ status bar */
.statusbar { position: fixed; left: 10px; right: 10px; bottom: 10px; height: var(--bottom-h); border-radius: 10px; z-index: 25; display: flex; align-items: center; gap: 22px; padding: 0 14px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.statusbar b { color: var(--ink-0); font-weight: 500; font-family: var(--mono); font-size: 11.5px; }
.stat.grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.stat.grow b { font-family: var(--font); font-size: 12px; }
.status { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot.ok { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot.err { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.attribution { font-size: 11px; color: var(--ink-3); }
/* The creator credit never clips: other status items shrink first, then the credit sheds detail. */
.statusbar .attribution { flex: none; margin-left: auto; }
.statusbar .status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.statusbar .stat.grow { min-width: 60px; }
@media (max-width: 1500px) { .attr-disc { display: none; } }
@media (max-width: 1180px) { .attr-data { display: none; } .statusbar .stat-filters { display: none; } }
.attribution a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid rgba(150, 170, 255, .25); }
.attribution a:hover { color: var(--cyan); }
.about-credits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 6px; }
.about-credits > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.about-credits h4 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.about-credits p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-1); }
.about-credits b { color: var(--ink-0); font-weight: 600; }
.about-credits a { color: var(--cyan); text-decoration: none; }
.about-credits a:hover { text-decoration: underline; }
@media (max-width: 560px) { .about-credits { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ loader */
.loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: radial-gradient(800px 600px at 50% 45%, #0b1430, var(--bg-0)); transition: opacity .8s, visibility .8s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-orb { width: 74px; height: 74px; margin: 0 auto 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c8f6ff, var(--cyan) 30%, var(--violet) 70%, transparent 72%); box-shadow: 0 0 60px rgba(88, 230, 255, .45), 0 0 120px rgba(155, 123, 255, .3); animation: orb 3s ease-in-out infinite; }
@keyframes orb { 50% { transform: scale(1.08); box-shadow: 0 0 80px rgba(88, 230, 255, .6), 0 0 160px rgba(155, 123, 255, .4); } }
.loader-title { letter-spacing: .32em; font-size: 15px; }
.loader-title b { color: var(--cyan); }
.loader-sub { margin-top: 10px; color: var(--ink-2); font-size: 12.5px; min-height: 18px; }
.loader-bar { width: 220px; height: 2px; margin: 18px auto 0; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width .3s; }

/* ------------------------------------------------------------------ modal */
.modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 60px); padding: 28px 30px; border-radius: 16px; color: var(--ink-0); background: var(--glass-strong); overflow: auto; }
.modal::backdrop { background: rgba(2, 3, 8, 0.6); backdrop-filter: blur(4px); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h2 { margin: 0 0 6px; font-weight: 650; letter-spacing: -.01em; }
.about-kicker { margin: 0 0 4px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.about-lede { font-size: 15px; line-height: 1.65; color: #cfd6ee; max-width: 60ch; }
.about-sec { border-top: 1px solid var(--line); }
.about-sec summary { padding: 14px 2px; cursor: pointer; list-style: none; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-0); display: flex; align-items: center; }
.about-sec summary::-webkit-details-marker { display: none; }
.about-sec summary::after { content: '›'; margin-left: auto; font-size: 16px; color: var(--ink-3); transition: transform .2s; }
.about-sec[open] summary::after { transform: rotate(90deg); }
.about-sec > :not(summary) { margin-top: 0; }
.about-sec ol { padding-left: 20px; margin: 0 0 16px; }
.about-sec li { margin-bottom: 8px; line-height: 1.6; }
.about-sec .kv { margin-bottom: 16px; }
.about-sec .legend { margin-bottom: 16px; }
.modal h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin: 22px 0 8px; font-weight: 600; }
.modal p, .modal li { color: var(--ink-1); line-height: 1.6; }
.modal .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.modal .stats-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.modal .stats-grid b { display: block; font: 600 18px var(--mono); color: var(--ink-0); }
.modal .stats-grid span { font-size: 11.5px; color: var(--ink-2); }
.modal .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.modal .legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-1); }
.modal .legend i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; background: currentColor; }
.modal .tmdb { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.lite-btn { padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(88, 230, 255, 0.35); color: var(--cyan); font-size: 11px; white-space: nowrap; }
.lite-btn:hover { background: rgba(88, 230, 255, 0.1); }

/* ------------------------------------------------------------------ share menu */
.share-menu { position: fixed; z-index: 40; width: 250px; padding: 6px; border-radius: 13px; background: var(--glass-strong); }
.share-head { margin: 4px 8px 6px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-head b { color: var(--ink-0); font-weight: 600; }
.share-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 13px; color: var(--ink-1); text-align: left; }
.share-menu button:hover, .share-menu button:focus-visible { background: rgba(88, 230, 255, 0.08); color: var(--ink-0); }
.share-menu svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ first-minute onboarding */
.welcome-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(600px 400px at 50% 45%, rgba(3, 5, 11, 0.25), rgba(3, 5, 11, 0.6)); animation: wfade .4s var(--ease); }
@keyframes wfade { from { opacity: 0; } }
.welcome { width: min(460px, 100%); padding: 28px 28px 20px; border-radius: 18px; background: var(--glass-strong); text-align: center; animation: wrise .5s var(--ease); }
@keyframes wrise { from { transform: translateY(14px); opacity: 0; } }
.welcome-kicker { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.welcome h2 { margin: 4px 0 10px; font-size: 26px; font-weight: 650; letter-spacing: -.015em; }
.welcome-lede { margin: 0 auto 20px; max-width: 36ch; color: #cfd6ee; line-height: 1.6; font-size: 14.5px; }
.welcome .btn.primary { padding: 12px 16px; font-size: 14px; }
.welcome-or { margin: 18px 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.welcome-grid button { text-align: left; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); transition: all .2s; }
.welcome-grid button:hover, .welcome-grid button:focus-visible { border-color: rgba(88, 230, 255, 0.4); background: rgba(88, 230, 255, 0.06); }
.welcome-grid b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-0); }
.welcome-grid span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-2); }
.welcome-skip { margin-top: 16px; color: var(--ink-2); }
.hint-toast { position: fixed; left: calc(50% - var(--shift-x, 0px)); bottom: calc(var(--bottom-h) + 76px); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; font-size: 13px; color: var(--ink-0);
  max-width: calc(100vw - 32px); background: var(--glass-strong); opacity: 0; transform: translate(-50%, 8px); transition: opacity .35s, transform .35s var(--ease); pointer-events: auto; }
.hint-toast.show { opacity: 1; transform: translate(-50%, 0); }
.hint-toast .icon-btn { width: 26px; height: 26px; }
.hint-toast .icon-btn svg { width: 14px; height: 14px; }
.about-replay { margin: 4px 0 8px; }

/* ------------------------------------------------------------------ no-WebGL list view */
body.fallback-mode { overflow: auto; }
.fallback { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.fb-head .logo { margin-bottom: 14px; }
.fb-note { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(242, 197, 107, .3); background: rgba(242, 197, 107, .06); color: var(--ink-1); line-height: 1.55; font-size: 13.5px; }
.fb-head .input { height: 44px; font-size: 15px; margin-top: 6px; }
.fb-status { font-size: 12.5px; margin: 8px 2px 18px; }
.fb-region h3 { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; font-size: 14px; font-weight: 600; }
.fb-region h3 i { width: 9px; height: 9px; border-radius: 50%; }
.fb-region h3 .muted { font-weight: 400; font-size: 12px; }
.fb-list { display: flex; flex-direction: column; gap: 2px; }
.fb-row { display: flex; gap: 12px; justify-content: space-between; text-align: left; padding: 9px 10px; border-radius: 9px; color: var(--ink-1); width: 100%; }
.fb-row:hover, .fb-row:focus-visible { background: rgba(88, 230, 255, 0.07); color: var(--ink-0); }
.fb-row .m { font: 12px var(--mono); color: var(--ink-2); white-space: nowrap; }
.fb-title { display: flex; gap: 18px; margin: 12px 0 8px; }
.fb-poster { width: 132px; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; flex: none; }
.fb-title h2 { margin: 0 0 4px; font-size: 22px; }
.fb-meta { color: var(--ink-2); font-size: 13px; }
.fb-ov { color: #cfd6ee; line-height: 1.65; }
.fb-h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 8px; }
.fb-foot { margin-top: 34px; font-size: 12px; }
.fb-foot a { color: var(--ink-1); }
@media (max-width: 560px) { .fb-title { flex-direction: column; } .fb-poster { width: 120px; } .welcome-grid { grid-template-columns: 1fr; } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 200; background: var(--bg-0); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1440px) {
  :root { --panel-w: 284px; --right-w: 372px; }
  .poster { width: 120px; }
}
@media (max-width: 1180px) {
  :root { --right-w: 352px; --panel-w: 272px; }
  .nav { display: none; }
}
@media (max-width: 860px) {
  :root { --top-h: 52px; --bottom-h: 30px; }
  .topbar { top: 8px; left: 8px; right: 8px; gap: 10px; padding: 0 8px 0 12px; }
  .logo span { display: none; }
  .search-kbd { display: none; }
  .mobile-only { display: grid; }
  .hide-sm { display: none !important; }
  .statusbar { left: 8px; right: 8px; bottom: 8px; gap: 14px; }

  /* panels become bottom sheets */
  /* Bottom sheets open at half height so the galaxy stays in view; drag the handle (or scroll the
     content) to expand, drag down to shrink or close. */
  .panel { top: auto; left: 0 !important; right: 0 !important; bottom: 0; width: auto; height: min(50vh, 460px);
    border-radius: 18px 18px 0 0; transform: translateY(0); z-index: 45; padding-bottom: env(safe-area-inset-bottom);
    transition: transform .45s var(--ease), opacity .35s, height .35s var(--ease); touch-action: pan-y; }
  .panel.expanded { height: calc(100vh - var(--top-h) - 24px); height: calc(100dvh - var(--top-h) - 24px); }
  .panel::before { content: ""; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-strong); }
  .sheet-grip { position: absolute; top: 0; left: 50%; width: 120px; height: 22px; margin-left: -60px; z-index: 3; cursor: grab; touch-action: none; }
  .panel-head { padding-top: 16px; }
  .panel.collapsed.panel-left { transform: translateY(calc(100% + 20px)); }
  .panel-left:not(.collapsed) ~ .panel-right { display: none; }
  .reopen-left { display: none !important; }
  .controls { left: auto; right: 8px; transform: none; bottom: calc(var(--bottom-h) + 16px); flex-direction: column; }
  .ctl-sep { width: auto; height: 1px; margin: 3px 6px; }
  body.sheet-open .controls { display: none; }
  .tooltip { display: none !important; }
  .trail { top: calc(var(--top-h) + 14px); max-width: calc(100vw - 24px); font-size: 12px; }
  .hero { padding: 14px; }
  .poster { width: 92px; }
  .ctl { width: 40px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
