/* ZZZLore — Random Play back-room archive.
   One loud element (the CRT wall); everything else quiet. */
:root {
  color-scheme: dark;
  --ink: #16141b;
  --ink-2: #1c1922;
  --panel: #221f29;
  --panel-2: #2a2632;
  --line: rgba(243, 239, 230, .09);
  --line-2: rgba(243, 239, 230, .16);
  --paper: #f3efe6;
  --muted: #a9a3b4;
  --dim: #746e80;
  --signal: #ffd21f;
  --signal-ink: #1a1503;
  --ether: #ff3d7f;
  --crt: #45d4e6;
  --glass: rgba(34, 31, 41, .72);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
  --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --max: 1240px;
  --display: 'Dela Gothic One', 'Arial Black', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --header: 64px;
}
body.light {
  color-scheme: light;
  --ink: #ecebf0; --ink-2: #e4e2ea; --panel: #f8f7fa; --panel-2: #fff;
  --line: rgba(22, 20, 27, .1); --line-2: rgba(22, 20, 27, .18);
  --paper: #18161d; --muted: #57525f; --dim: #8a8494;
  --signal: #f2b705; --ether: #d81b60; --crt: #0e8fa0;
  --glass: rgba(248, 247, 250, .8); --shadow: 0 20px 50px -24px rgba(30, 20, 50, .35);
}
body.oled { --ink: #000; --ink-2: #07070a; --panel: #111015; --panel-2: #18161d; --glass: rgba(10, 10, 14, .8); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ink); color: var(--paper);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--ether) 14%, transparent), transparent 70%),
    radial-gradient(700px 500px at -10% 30%, color-mix(in srgb, var(--crt) 9%, transparent), transparent 70%);
}
body.reduce *, body.reduce *::before, body.reduce *::after { animation: none !important; transition: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--signal); color: var(--signal-ink); }
.skip { position: absolute; left: -999px; top: 10px; z-index: 200; background: var(--signal); color: var(--signal-ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 10px; }
main { flex: 1; outline: none; }
main:focus, main:focus-visible { outline: none; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .wrap { padding: 0 18px; } }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- type ---------- */
.d1, .d2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; margin: 0; }
.d1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }
.d2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; margin: 12px 0 0; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 60; height: var(--header); background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-bottom: 1px solid var(--line); }
.top .wrap { height: 100%; display: flex; align-items: center; gap: 18px; max-width: 1400px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.pill { font: 700 11px/1 var(--body); padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav > a, .nav .dd > button { display: flex; align-items: center; gap: 4px; padding: 8px 11px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--muted); background: none; border: 0; white-space: nowrap; }
.nav > a:hover, .nav .dd > button:hover, .nav .dd.open > button { color: var(--paper); background: var(--panel); }
.nav > a.on, .nav .dd.on > button { color: var(--paper); box-shadow: inset 0 -2px 0 var(--signal); border-radius: 9px 9px 2px 2px; }
.nav .dd > button .icon { width: 14px; height: 14px; opacity: .7; }
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 270px; padding: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); display: none; }
.dd.open .dd-menu { display: block; animation: drop .14s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.dd-menu a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; align-items: flex-start; }
.dd-menu a:hover { background: var(--panel-2); }
.dd-menu b { display: block; font-size: 14.5px; font-weight: 650; }
.dd-menu small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.dd-menu .icon { margin-top: 2px; color: var(--signal); }
.tools-r { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.ibtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.ibtn:hover { color: var(--paper); border-color: var(--line-2); }
.searchbtn { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); min-width: 170px; font-size: 14.5px; }
.searchbtn:hover { border-color: var(--line-2); color: var(--paper); }
.searchbtn span { flex: 1; text-align: left; }
kbd { font: 600 11.5px var(--body); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.menu-btn { display: none; }
@media (max-width: 1120px) { .searchbtn { min-width: 0; } .searchbtn span, .searchbtn kbd { display: none; } }
@media (max-width: 980px) {
  .menu-btn { display: grid; }
  .nav { position: fixed; inset: var(--header) 0 0 0; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 18px 40px; background: var(--ink); overflow-y: auto; display: none; }
  .nav.open { display: flex; }
  .nav > a, .nav .dd > button { font-size: 18px; padding: 14px 8px; width: 100%; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav > a.on, .nav .dd.on > button { box-shadow: none; color: var(--signal); }
  .dd-menu { position: static; display: block; box-shadow: none; border: 0; background: none; padding: 0 0 8px 8px; min-width: 0; }
  .dd > button .icon { display: none; }
}

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 15px; border: 1px solid transparent; background: var(--signal); color: var(--signal-ink); white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--panel); color: var(--paper); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--signal); filter: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip:hover { color: var(--paper); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chip .n { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.chip .glyph { width: 16px; height: 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seg button { height: 34px; padding: 0 12px; border: 0; background: none; border-radius: 9px; color: var(--muted); font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; }
.seg button[aria-pressed="true"] { background: var(--signal); color: var(--signal-ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.glyph { display: inline-block; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--g) center/contain no-repeat; mask: var(--g) center/contain no-repeat; }

/* ---------- breadcrumb & page head ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin: 24px 0 16px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--paper); }
.crumbs .icon { width: 14px; height: 14px; opacity: .6; }
.phead { padding: 4px 0 26px; }
.phead p { color: var(--muted); max-width: 64ch; margin: 10px 0 0; font-size: 17px; }

/* ---------- HERO: the CRT wall ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 52px; align-items: center; min-height: min(78vh, 700px); padding-top: 36px; padding-bottom: 64px; }
.hero .kick { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 650; font-size: 15px; }
.hero .kick img { width: 22px; height: 22px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(54px, 7.4vw, 104px); line-height: .95; margin: 14px 0 0; letter-spacing: -.02em; }
.hero .lede { margin-top: 18px; }
.hero-search { display: flex; align-items: center; gap: 12px; margin-top: 28px; height: 58px; padding: 0 8px 0 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); max-width: 520px; color: var(--muted); cursor: text; box-shadow: var(--shadow); width: 100%; text-align: left; }
.hero-search:hover { border-color: var(--signal); }
.hero-search span { flex: 1; font-size: 16px; }
.hero-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; max-width: 520px; }
.hero-tiles a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); font-size: 13.5px; font-weight: 650; color: var(--muted); }
.hero-tiles a:hover { color: var(--paper); border-color: var(--line-2); background: var(--panel); }
.hero-tiles .icon { width: 20px; height: 20px; color: var(--signal); }
.tvwall { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; aspect-ratio: 16 / 11.5; transform: perspective(1400px) rotateY(-7deg) rotateX(2deg); }
.tv { position: relative; border-radius: var(--r-lg); padding: 10px; background: linear-gradient(160deg, #3a3542, #1d1a22); box-shadow: 0 30px 60px -20px #000c, inset 0 1px 0 #ffffff1a; min-height: 0; }
body.light .tv { background: linear-gradient(160deg, #cfccd6, #a9a4b4); }
.tv:first-child { grid-row: span 2; }
.tv .screen { position: relative; height: 100%; border-radius: 16px; overflow: hidden; background: #0b0a0e; }
.tv .screen img { width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.tv .screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px), radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.6)); }
.tv .screen::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.12), transparent 30%); }
.tv .osd { position: absolute; left: 16px; bottom: 14px; z-index: 2; color: #fff; text-shadow: 0 1px 8px #000; }
.tv .osd b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.tv .osd span { font-size: 13px; font-weight: 600; opacity: .85; }
.tv:first-child .osd b { font-size: 30px; }
.tv .ch { position: absolute; right: 14px; top: 12px; z-index: 2; font: 800 15px var(--body); color: #8dffb8; text-shadow: 0 0 10px #8dffb8aa; font-variant-numeric: tabular-nums; }
.tv a { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.tv a:focus-visible { outline-offset: -4px; }
.tv.switch .screen img { opacity: 0; }
.tvctl { position: absolute; right: 4px; bottom: -46px; display: flex; gap: 6px; }
.tvctl button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); display: grid; place-items: center; }
.tvctl button:hover { color: var(--paper); }
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; gap: 28px; padding-top: 22px; }
  .tvwall { transform: none; order: -1; }
  .tvctl { display: none; }
}
@media (max-width: 560px) { .hero-tiles a { font-size: 12px; } .tv:first-child .osd b, .tv .osd b { font-size: 17px; } .tv .osd span { display: none; } }

/* ---------- sections ---------- */
.sec { padding: 76px 0 0; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.sec-head p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; font-size: 15px; white-space: nowrap; }
.more:hover { color: var(--signal); }
.more .icon { width: 16px; height: 16px; }

/* start here */
.picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.picker button { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); text-align: left; font-weight: 650; color: var(--muted); }
.picker button .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--paper); }
.picker button:hover { color: var(--paper); border-color: var(--line-2); }
.picker button[aria-pressed="true"] { color: var(--paper); border-color: var(--signal); background: color-mix(in srgb, var(--signal) 7%, var(--panel)); }
.picker button[aria-pressed="true"] .ic { background: var(--signal); color: var(--signal-ink); border-color: transparent; }
.picker-view { margin-top: 12px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--ink-2); min-height: 420px; }
.picker-view .row1 { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.picker-view .row1 p { margin: 0; color: var(--muted); }
@media (max-width: 900px) { .picker { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .picker { grid-template-columns: repeat(2, 1fr); } .picker-view { padding: 16px; } }

/* horizontal rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, calc((100% - 42px) / 4)); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.rail-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.rail-nav { display: flex; gap: 4px; }
.rail-nav button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; }
.rail-nav button:hover { color: var(--paper); }
@media (max-width: 700px) { .rail { grid-auto-columns: 72%; } }

/* poster card */
.poster { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--panel); isolation: isolate; }
.poster.wide { aspect-ratio: 16 / 10; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.poster:hover img { transform: scale(1.04); }
.poster::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10, 8, 14, .94) 6%, rgba(10, 8, 14, .25) 55%, transparent); }
.poster .in { position: absolute; inset: auto 0 0 0; padding: 16px 18px 18px; color: #fff; }
.poster .meta { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.poster h3 { margin: 0; font-size: 19px; font-weight: 750; line-height: 1.25; }
.poster .sub { font-size: 14px; opacity: .75; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px); white-space: nowrap; }
.badge.y { background: var(--signal); color: var(--signal-ink); }
.badge.m { background: var(--ether); color: #fff; }
.badge.line { background: none; border: 1px solid var(--line-2); color: var(--muted); backdrop-filter: none; }

/* live tool cards */
.tools3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.toolc { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); padding: 20px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 10%, transparent), 0 24px 60px -34px var(--c); overflow: hidden; min-height: 340px; }
.toolc:hover { border-color: var(--c); }
.toolc h3 { margin: 0; font-size: 19px; font-weight: 750; display: flex; align-items: center; gap: 12px; }
.toolc h3 .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.toolc p { color: var(--muted); margin: 12px 0 0; font-size: 15px; }
.toolc .live { flex: 1; margin: 16px 0 14px; border-radius: 12px; background: var(--ink-2); position: relative; overflow: hidden; min-height: 150px; }
.toolc .live canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.toolc .go { color: var(--muted); font-weight: 650; font-size: 14.5px; }
.toolc:hover .go { color: var(--c); }
@media (max-width: 900px) { .tools3 { grid-template-columns: 1fr; } }
.tl-mini { position: absolute; inset: 0; }
.tl-mini .bar { position: absolute; left: 22px; right: 22px; top: 62%; height: 2px; background: var(--line-2); }
.tl-mini .pt { position: absolute; top: 62%; width: 12px; height: 12px; margin: -5px 0 0 -6px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--c); }
.tl-mini .pt.on { background: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); }
.tl-mini .lab { position: absolute; top: calc(62% + 14px); transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--dim); }
.tl-mini .lab.on { color: var(--paper); }
.tl-mini .faces { position: absolute; left: 0; right: 0; top: 14%; display: flex; justify-content: center; gap: 6px; padding-left: 0; }
.tl-mini .faces img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--c); margin: 0; background: var(--panel); animation: pop .35s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.comic-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .7s; }

/* news */
.news { display: grid; grid-template-columns: 1.1fr 2fr; gap: 14px; }
.news-big { border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--panel); padding: 24px; position: relative; overflow: hidden; min-height: 250px; }
.news-big img { position: absolute; right: -50px; bottom: 0; height: 92%; pointer-events: none; opacity: .9; }
.news-big .t { color: var(--muted); font-size: 14px; font-weight: 650; }
.news-big h3 { margin: 6px 0 10px; font-size: 22px; font-weight: 750; position: relative; }
.news-big p { color: var(--muted); max-width: 24ch; position: relative; }
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.news-item { display: flex; gap: 12px; align-items: center; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; }
.news-item:hover { border-color: var(--line-2); }
.news-item img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--panel-2); flex: none; }
.news-item b { display: block; font-size: 15px; font-weight: 700; }
.news-item small { color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .news, .news-grid { grid-template-columns: 1fr; } }

/* ---------- agent cards ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 14px; }
.acard { --fc: #6d6878; position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; isolation: isolate; border: 1px solid var(--line); background: radial-gradient(120% 70% at 50% 105%, color-mix(in srgb, var(--fc) 60%, transparent), transparent 70%), linear-gradient(170deg, color-mix(in srgb, var(--fc) 20%, var(--panel)), var(--panel) 65%); }
.acard .nc { position: absolute; inset: 0; z-index: -2; background: center/cover; opacity: .18; }
.acard .art { position: absolute; left: 50%; bottom: 0; height: 92%; width: auto; max-width: none; transform: translateX(-50%); z-index: -1; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); transition: transform .35s ease; }
.acard:hover { border-color: color-mix(in srgb, var(--fc) 70%, white); }
.acard:hover .art { transform: translateX(-50%) translateY(-4px) scale(1.03); }
.acard .marks { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; }
.acard .mk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 10, 16, .72); backdrop-filter: blur(6px); color: #fff; }
.acard .mk .glyph { width: 18px; height: 18px; }
.rk { font-family: var(--display); font-size: 16px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.acard .rk { position: absolute; top: 10px; right: 10px; }
.rk-S { background: linear-gradient(140deg, #ffd96a, #ff9d00); color: #2a1700; }
.rk-A { background: linear-gradient(140deg, #d6a8ff, #8b55ff); color: #19003a; }
.acard .cap { position: absolute; inset: auto 0 0 0; padding: 44px 14px 13px; background: linear-gradient(0deg, rgba(10, 8, 14, .95) 25%, transparent); color: #fff; }
.acard .cap b { display: block; font-size: 17px; font-weight: 750; line-height: 1.2; }
.acard .cap span { font-size: 13.5px; opacity: .72; }
.agent-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.arow { display: grid; grid-template-columns: 46px 1.3fr 1.5fr 1fr 1fr 60px 64px; gap: 14px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--panel); font-size: 15px; }
.arow:first-child { border-top: 0; }
a.arow:hover { background: var(--panel-2); }
.arow img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.arow .cell { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14.5px; }
.arow.head { background: var(--ink-2); color: var(--dim); font-size: 13.5px; font-weight: 700; }
@media (max-width: 760px) { .arow { grid-template-columns: 44px 1fr 1fr; } .arow > :nth-child(n+4) { display: none; } }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.field-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.field-search:focus-within { border-color: var(--signal); }
.field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--paper); font-size: 15px; }
.select { height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--paper); font-weight: 600; font-size: 14.5px; }
.filter-panel { display: none; padding: 16px; margin-bottom: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-2); }
.filter-panel.open { display: grid; gap: 12px; }
.filter-panel .grp { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter-panel .grp > span { width: 92px; color: var(--dim); font-size: 14px; font-weight: 650; }
.countline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; margin: 6px 0 16px; flex-wrap: wrap; }
.countline .icon { width: 16px; height: 16px; }
.countline button { border: 0; background: none; color: var(--signal); font-weight: 650; padding: 0; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty .btn { margin-top: 14px; }

/* ---------- article ---------- */
.atabs { position: sticky; top: var(--header); z-index: 30; padding: 10px 0; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.atabs .bar { display: flex; justify-content: space-between; gap: 12px; padding: 5px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.atabs nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.atabs nav a { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: 14.5px; white-space: nowrap; }
.atabs nav a:hover { color: var(--paper); }
.atabs nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.atabs nav a .icon { width: 16px; height: 16px; }
.atabs nav a .n { font-size: 12.5px; opacity: .6; }
.atabs .acts { display: flex; gap: 2px; flex: none; }
.atabs .acts .ibtn { width: 36px; height: 36px; border-color: transparent; background: none; }
.atabs .acts .ibtn[aria-pressed="true"] { color: var(--signal); }
.atabs .acts .ibtn[aria-pressed="true"] .icon { fill: currentColor; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding: 14px 0 20px; }
@media (max-width: 1020px) { .layout { grid-template-columns: 1fr; } }
.herocard { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 8.6; background: var(--panel); isolation: isolate; border: 1px solid var(--line); display: block; width: 100%; padding: 0; text-align: left; color: #fff; }
button.herocard { cursor: zoom-in; }
.herocard .bg { position: absolute; inset: 0; z-index: -3; background: center 30%/cover; }
.herocard::before { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, rgba(14,12,18,.88), rgba(14,12,18,.3) 60%, rgba(14,12,18,.15)), linear-gradient(0deg, rgba(14,12,18,.7), transparent 45%); }
.herocard .fig { position: absolute; right: 4%; bottom: 0; height: 104%; width: auto; max-width: none; z-index: -1; filter: drop-shadow(0 16px 40px rgba(0,0,0,.6)); }
.herocard .in { position: absolute; left: 0; bottom: 0; padding: 26px 28px; max-width: 70%; }
.herocard .kick { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.herocard h1 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 5.4vw, 66px); line-height: 1.02; margin: 0; }
.herocard .full { margin-top: 8px; font-size: 16px; opacity: .82; }
.herocard .marks { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 8px; }
.herocard .marks span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(12,10,16,.72); backdrop-filter: blur(6px); color: #fff; }
.herocard .marks .glyph { width: 22px; height: 22px; }
.herocard.plain { aspect-ratio: 16 / 7; }
@media (max-width: 640px) { .herocard { aspect-ratio: 4 / 4.4; } .herocard .fig { right: -16%; height: 90%; } .herocard.plain { aspect-ratio: 4 / 3; } .herocard .in { max-width: 100%; padding: 20px; } }
.readtime { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.readtime .icon { width: 14px; height: 14px; }
.tldr { margin: 22px 0 8px; padding: 18px 20px; border-radius: var(--r); background: var(--ink-2); border: 1px solid var(--line); }
.tldr h2 { font-size: 15px; font-weight: 750; margin: 0 0 8px; color: var(--muted); }
.tldr ul { margin: 0; padding-left: 20px; }
.tldr li { margin: 5px 0; }
.tldr a { text-decoration: underline; text-decoration-color: var(--ether); text-underline-offset: 3px; }
.prose { font-size: 17px; line-height: 1.75; max-width: 70ch; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.2; margin: 40px 0 12px; scroll-margin-top: calc(var(--header) + 80px); }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--ether); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ether); }
.prose .lead { font-size: 19px; }
.prose .callout, .note { margin: 22px 0; padding: 14px 18px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--crt) 40%, transparent); background: color-mix(in srgb, var(--crt) 7%, transparent); color: var(--muted); font-size: 15.5px; }
.note b { color: var(--paper); }
.sources { font-size: 15px; color: var(--muted); padding-left: 22px; }
.sources li { margin: 4px 0; }
.sources a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.endline { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.endline a { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.endline a:hover { color: var(--signal); }
.side .sticky { position: sticky; top: calc(var(--header) + 76px); display: flex; flex-direction: column; gap: 16px; }
.box { border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.box > h2 { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 0; padding: 14px 16px 6px; }
.box .bd { padding: 6px 16px 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 650; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.facts dd a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.facts dd a:hover { color: var(--signal); }
.facts dd .glyph { width: 18px; height: 18px; }
.facts .wide { grid-column: 1 / -1; text-align: left; justify-content: flex-start; }
.pending { color: var(--dim); font-weight: 500; font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a, .chips span { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 650; }
.chips a:hover { border-color: var(--signal); }
.chips img { width: 18px; height: 18px; object-fit: contain; }
.namecard { width: 100%; aspect-ratio: 1400 / 138; object-fit: cover; }
.lgraph { position: relative; height: 280px; background: var(--ink-2); }
.lgraph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lgraph-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.lgraph-foot a { display: inline-flex; gap: 4px; align-items: center; }
.lgraph-foot a:hover { color: var(--signal); }
.toc { display: flex; flex-direction: column; border-left: 2px solid var(--line); margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: 14.5px; }
.toc a:hover { color: var(--paper); }
.toc a.on { color: var(--paper); border-color: var(--signal); }
.toc-title { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 6px 0 8px; }
.rel { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); }
.rel:hover { background: var(--panel-2); }
.rel .av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); }
.rel b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.rel small { color: var(--muted); font-size: 13px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 26px 0 0; }
.pager a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.pager a:last-child { justify-content: flex-end; text-align: right; }
.pager a:hover { border-color: var(--line-2); }
.pager img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.pager small { display: block; color: var(--dim); font-size: 13px; }
.pager b { font-weight: 700; }

/* entry cards */
.ecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ecard { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.ecard:hover { border-color: var(--line-2); }
.ecard .th { aspect-ratio: 16 / 8; background: var(--panel-2) center/cover; position: relative; }
.ecard .th .badge { position: absolute; left: 12px; top: 12px; }
.ecard .in { padding: 14px 16px 16px; }
.ecard h3 { margin: 0 0 4px; font-size: 17px; font-weight: 750; }
.ecard p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.ecard.compact { flex-direction: row; align-items: center; gap: 14px; padding: 12px; }
.ecard.compact .th { width: 64px; height: 64px; aspect-ratio: 1; border-radius: 10px; flex: none; }
.ecard.compact .in { padding: 0; }
.group { margin: 36px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.group h2 { font-size: 20px; font-weight: 750; margin: 0; }
.group span { color: var(--dim); font-weight: 600; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

/* factions */
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.fcard { --fc: var(--signal); position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.fcard:hover { border-color: color-mix(in srgb, var(--fc) 60%, transparent); }
.fcard .ban { height: 130px; background: center 30%/cover; position: relative; }
.fcard .ban::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--panel), transparent 85%); }
.fcard .emb { position: absolute; left: 18px; top: 86px; width: 64px; height: 64px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; z-index: 1; }
.fcard .emb img { width: 54px; height: 54px; object-fit: contain; }
.fcard .emb i { width: 18px; height: 18px; border-radius: 4px; background: var(--fc); transform: rotate(45deg); }
.fcard .in { padding: 30px 18px 18px; }
.fcard h3 { margin: 0; font-size: 19px; font-weight: 750; }
.fcard p { margin: 6px 0 14px; color: var(--muted); font-size: 14.5px; }
.faces { display: flex; padding-left: 6px; }
.faces img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; margin-left: -6px; border: 2px solid var(--panel); background: var(--panel-2); }

/* masonry & lightbox */
.masonry { columns: 4 230px; column-gap: 12px; }
.masonry figure { break-inside: avoid; margin: 0 0 12px; position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); cursor: zoom-in; }
.masonry figure.cut { background: radial-gradient(100% 60% at 50% 100%, color-mix(in srgb, var(--ether) 16%, transparent), transparent), var(--panel); }
.masonry img { width: 100%; height: auto; }
.masonry figcaption { padding: 9px 12px; font-size: 13.5px; font-weight: 650; color: var(--muted); border-top: 1px solid var(--line); }
.lightbox { margin: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; background: rgba(8, 6, 12, .95); color: #fff; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-size: 14.5px; gap: 10px; }
.lb-top .acts { display: flex; gap: 8px; }
.lb-top .ibtn { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.lb-stage { flex: 1; display: grid; place-items: center; position: relative; min-height: 0; padding: 0 76px 20px; }
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 100px); object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
@media (max-width: 640px) { .lb-stage { padding: 0 8px 76px; } .lb-nav { top: auto; bottom: 14px; transform: none; } }

/* comic reader */
.reader { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.reader figure { margin: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: zoom-in; }
.reader img { width: 100%; height: auto; }
.reader .brk { text-align: center; color: var(--dim); font-weight: 650; font-size: 14px; padding: 22px 0 8px; }
.progress { position: fixed; left: 0; top: var(--header); height: 3px; z-index: 61; background: var(--signal); width: 0; }

/* database */
.dbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.dbi { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); text-align: center; cursor: zoom-in; }
.dbi:hover { border-color: var(--line-2); background: var(--panel-2); }
.dbi img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.dbi.tall img { aspect-ratio: 3 / 4; }
.dbi b { font-size: 14px; font-weight: 650; line-height: 1.3; }
.dbi.hl { border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 25%, transparent); }

/* timeline */
.tline { position: relative; margin-top: 10px; }
.tline::before { content: ""; position: absolute; left: 98px; top: 8px; bottom: 0; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.tv-row { display: grid; grid-template-columns: 98px 1fr; gap: 0 32px; padding-bottom: 40px; position: relative; }
.tv-row::before { content: ""; position: absolute; left: 92px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid var(--signal); }
.tv-row .v { text-align: right; padding-right: 22px; }
.tv-row .v b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; display: block; }
.tv-row .v small { color: var(--muted); font-size: 13px; display: block; margin-top: 6px; line-height: 1.3; }
.tv-row .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
.titem { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.titem:hover { border-color: var(--line-2); }
.titem img, .titem .sw { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel-2); }
.titem b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; }
.titem small { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .tline::before, .tv-row::before { display: none; } .tv-row { grid-template-columns: 1fr; } .tv-row .v { text-align: left; padding: 0 0 10px; } }

/* graph page */
.gpage { position: relative; height: calc(100dvh - var(--header)); overflow: hidden; background: radial-gradient(80% 80% at 50% 50%, var(--ink-2), var(--ink)); }
.gpage canvas.main { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.gpage canvas.main:active { cursor: grabbing; }
.gpanel { position: absolute; left: 16px; top: 16px; width: 290px; max-height: calc(100% - 160px); display: flex; flex-direction: column; gap: 10px; z-index: 2; overflow-y: auto; scrollbar-width: none; }
.gcard { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 12px; }
.gcard h2 { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 0 0 8px; }
.gsearch { position: relative; }
.gsearch input { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); padding: 0 12px; outline: 0; color: var(--paper); }
.gsearch input:focus { border-color: var(--signal); }
.gsug { position: absolute; left: 0; right: 0; top: 44px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; z-index: 5; box-shadow: var(--shadow); }
.gsug button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none; text-align: left; font-size: 14px; }
.gsug button:hover { background: var(--panel-2); }
.layers { display: flex; flex-direction: column; gap: 2px; }
.layers button { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 0; background: none; font-size: 14.5px; font-weight: 600; text-align: left; }
.layers button:hover { background: var(--panel); }
.layers button[aria-pressed="false"] { opacity: .4; }
.layers button .n { margin-left: auto; color: var(--dim); font-size: 13px; }
.gfind { display: grid; gap: 6px; }
.gfind .res { font-size: 14px; color: var(--muted); line-height: 1.6; }
.gfind .res a { color: var(--paper); font-weight: 650; text-decoration: underline; text-decoration-color: var(--crt); text-underline-offset: 3px; }
.gmini { position: absolute; left: 16px; bottom: 16px; width: 190px; height: 124px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); z-index: 2; overflow: hidden; cursor: pointer; }
.gmini canvas { width: 100%; height: 100%; display: block; }
.gzoom { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; z-index: 2; }
.gzoom button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(10px); display: grid; place-items: center; color: var(--paper); }
.gdrawer { position: absolute; right: 16px; top: 16px; width: 340px; max-height: calc(100% - 88px); overflow-y: auto; z-index: 3; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); padding: 16px; box-shadow: var(--shadow); }
.gdrawer .ph { height: 200px; border-radius: 12px; background: var(--panel) center/cover; position: relative; overflow: hidden; margin-bottom: 12px; }
.gdrawer .ph img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; max-width: none; transform: translateX(-50%); }
.gdrawer h3 { font-size: 22px; margin: 8px 0 6px; font-weight: 750; }
.gdrawer p { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.gdrawer .x { position: absolute; right: 24px; top: 24px; z-index: 2; background: rgba(12,10,16,.7); color: #fff; border: 0; }
.gdrawer .row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.gdrawer .rel { padding: 8px 4px; }
.gtip { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; display: flex; gap: 14px; align-items: center; width: min(560px, calc(100% - 460px)); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(12px); font-size: 14px; color: var(--muted); }
.gtip b { color: var(--paper); }
@media (max-width: 900px) {
  .gpanel { width: auto; right: 16px; max-height: none; }
  .gpanel .hide-sm, .gmini, .gtip { display: none; }
  .gdrawer { left: 12px; right: 12px; width: auto; top: auto; bottom: 66px; max-height: 58%; }
}

/* dialogs */
dialog { color: var(--paper); }
.sdlg { width: min(680px, 94vw); margin: 10vh auto auto; padding: 0; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 40px 100px -20px #000; }
.sdlg::backdrop { background: rgba(8, 6, 12, .6); backdrop-filter: blur(3px); }
.sbox { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 60px; border-bottom: 1px solid var(--line); color: var(--muted); }
.sbox input { flex: 1; border: 0; outline: 0; background: none; color: var(--paper); font-size: 17px; }
.sres { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.sres .g { font-size: 13px; font-weight: 700; color: var(--dim); padding: 10px 10px 4px; }
.sres a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.sres a.sel { background: var(--panel-2); }
.sres img, .sres .av { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel-2); }
.sres b { display: block; font-weight: 650; }
.sres small { color: var(--muted); font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.sres .none { padding: 30px; text-align: center; color: var(--muted); }
.sfoot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }

/* settings */
.settings { display: grid; gap: 12px; max-width: 760px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.setting b { display: block; font-weight: 700; }
.setting p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; max-width: 52ch; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.switch input:checked + span { background: var(--signal); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--signal-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); z-index: 300; padding: 10px 16px; border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 650; font-size: 14.5px; opacity: 0; pointer-events: none; transition: .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.foot { margin-top: 96px; border-top: 1px solid var(--line); background: var(--ink-2); }
.foot .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; padding-top: 40px; padding-bottom: 36px; }
.foot p { color: var(--dim); font-size: 14px; max-width: 46ch; }
.foot h2 { font-size: 14px; font-weight: 700; color: var(--muted); margin: 4px 0 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14.5px; }
.foot ul a { color: var(--dim); }
.foot ul a:hover { color: var(--paper); }
.foot-strip { border-top: 1px solid var(--line); padding: 14px 0; color: var(--dim); font-size: 14px; }
.foot-strip .wrap { display: flex; gap: 22px; flex-wrap: wrap; }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr 1fr; } .foot .cols > :first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .top .pill, .hero-search kbd { display: none; } .top .wrap { gap: 10px; } .tools-r { gap: 6px; } .tools-r .ibtn, .searchbtn { width: 36px; height: 36px; } }

/* =================== v3: identity, effects, motion =================== */
/* logo */
.brand { gap: 9px; }
.logo-mark { width: 32px; height: 32px; flex: none; transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.wordmark { font-family: var(--display); font-size: 20px; letter-spacing: -.01em; line-height: 1; }
.wordmark span { color: var(--signal); }

/* support button: StarBorder-style orbiting light + pink glow */
.support { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; font-weight: 700; font-size: 14.5px; color: #fff; background: linear-gradient(180deg, #3a1526, #2a0f1c); box-shadow: 0 0 0 1px rgba(255,61,127,.45), 0 0 22px -4px rgba(255,61,127,.55); overflow: hidden; transition: box-shadow .25s, transform .2s; }
.support:hover { box-shadow: 0 0 0 1px rgba(255,61,127,.8), 0 0 30px -2px rgba(255,61,127,.75); transform: translateY(-1px); }
.support .heart { width: 17px; height: 17px; fill: #ff3d7f; stroke: none; filter: drop-shadow(0 0 6px #ff3d7f); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 76% { transform: scale(1.22); } 84% { transform: scale(.96); } 90% { transform: scale(1.12); } }
.support .orbit { position: absolute; inset: -60%; z-index: -1; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(255,120,170,.9) 330deg, transparent 360deg); animation: orbit 3.6s linear infinite; }
.support::after { content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: 10px; background: linear-gradient(180deg, #3a1526, #2a0f1c); }
@keyframes orbit { to { transform: rotate(1turn); } }
body.light .support { color: #fff; }
@media (max-width: 1240px) { .support span:last-child { display: none; } .support { padding: 0 11px; } }

/* spotlight cards (SpotlightCard) */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--spot-c, var(--signal)) 13%, transparent), transparent 45%); }
.spot::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; padding: 1px; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--spot-c, var(--signal)), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.spot.lit::before, .spot.lit::after { opacity: 1; }

/* tilted cards (TiltedCard) */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .25s; will-change: transform; }
.tilt.tilting { transition: border-color .25s; }
.tilt .glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.22), transparent 55%); mix-blend-mode: overlay; }
.tilt.tilting .glare { opacity: 1; }

/* click sparks */
canvas.sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }

/* decrypting text */
.decrypting { font-variant-numeric: tabular-nums; }

/* reveal: one orchestrated entrance per page */
.rv { opacity: 0; }
.rv.rv-in { animation: rvIn .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rvIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* page transitions (View Transitions API, with a CSS fallback) */
::view-transition-old(root) { animation: vtOut .18s ease both; }
::view-transition-new(root) { animation: vtIn .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
.top { view-transition-name: topbar; }
::view-transition-old(topbar), ::view-transition-new(topbar) { animation: none; }
main.enter { animation: vtIn .35s cubic-bezier(.2,.8,.2,1) both; }

/* buttons & cards: tactile feedback */
.btn, .chip, .ibtn, .searchbtn, .seg button, .picker button { transition: transform .15s ease, background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
.btn:active, .chip:active, .ibtn:active, .picker button:active { transform: scale(.96); }
.ecard, .fcard, .news-item, .titem, .dbi, .poster, .acard, .toolc, .rel, .pager a { transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .25s, background-color .25s, box-shadow .35s; }
.ecard:hover, .fcard:hover, .news-item:hover, .titem:hover, .dbi:hover, .pager a:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.dd-menu a { transition: background-color .15s, transform .15s; }
.dd-menu a:hover { transform: translateX(2px); }
.nav > a, .nav .dd > button { transition: color .2s, background-color .2s, box-shadow .25s; }
.nav .dd.open > button .icon { transform: rotate(180deg); }
.nav .dd > button .icon { transition: transform .2s; }

/* hero: CRT terminal background + glitch title */
.hero .term { position: absolute; inset: 0; z-index: -1; opacity: .55; mask-image: radial-gradient(120% 90% at 30% 40%, #000 30%, transparent 85%); -webkit-mask-image: radial-gradient(120% 90% at 30% 40%, #000 30%, transparent 85%); }
.hero .term canvas { width: 100%; height: 100%; display: block; }
.hero { isolation: isolate; }
body.light .hero .term { opacity: .3; }
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.glitch::before { color: var(--crt); transform: translate(-3px, 0); clip-path: inset(10% 0 60% 0); }
.glitch::after { color: var(--ether); transform: translate(3px, 0); clip-path: inset(55% 0 12% 0); }
.glitch:hover::before, .glitch.auto::before { animation: gA 2.6s steps(1) infinite; }
.glitch:hover::after, .glitch.auto::after { animation: gB 2.6s steps(1) infinite; }
@keyframes gA { 0%, 86%, 100% { opacity: 0; } 87% { opacity: .9; clip-path: inset(8% 0 70% 0); transform: translate(-4px, -1px); } 90% { opacity: .9; clip-path: inset(40% 0 35% 0); transform: translate(3px, 1px); } 93% { opacity: .9; clip-path: inset(70% 0 5% 0); transform: translate(-2px, 0); } }
@keyframes gB { 0%, 86%, 100% { opacity: 0; } 88% { opacity: .9; clip-path: inset(60% 0 15% 0); transform: translate(4px, 1px); } 91% { opacity: .9; clip-path: inset(15% 0 60% 0); transform: translate(-3px, 0); } 94% { opacity: .9; clip-path: inset(30% 0 50% 0); transform: translate(2px, -1px); } }
.stats { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.tv { transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s; }
.tv:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 36px 70px -20px #000d, 0 0 0 2px var(--signal), inset 0 1px 0 #ffffff1a; }
.tv.switch .screen { animation: tvOff .42s ease-in both; }
@keyframes tvOff { 0% { filter: none; } 50% { filter: brightness(3) contrast(2); transform: scaleY(.04); } 100% { filter: brightness(0); transform: scaleY(.01); } }
.tv .screen img { animation: tvOn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tvOn { 0% { transform: scaleY(.02); filter: brightness(4); } 60% { transform: scaleY(1.02); filter: brightness(1.4); } 100% { transform: none; filter: none; } }

/* faction visuals: emblems, never member art */
.emblem-bg { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--fc) 45%, transparent), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--fc) 22%, var(--panel-2)), var(--panel)); }
.emblem-bg::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.4px); background-size: 7px 7px; }
.emblem-bg .ghost { position: absolute; right: -6%; top: 50%; width: 62%; aspect-ratio: 1; transform: translateY(-50%) rotate(-10deg); object-fit: contain; opacity: .22; filter: blur(.5px) saturate(1.2); }
.fcard .ban { height: 140px; }
.fcard .ban::after { z-index: 1; }
.fcard .emb { width: 76px; height: 76px; top: 92px; border-radius: 20px; background: var(--panel); }
.fcard .emb img { width: 64px; height: 64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.fcard:hover .emb img { transform: scale(1.1) rotate(-4deg); }
.fcard .in { padding-top: 36px; }
.mono { font-family: var(--display); font-size: 22px; color: var(--fc); }
.herocard.faction .fig { height: 76%; bottom: 12%; right: 7%; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(-2deg); } }

/* story */
.catchup { position: relative; padding: 26px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--ether) 40%, var(--line)); background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--ether) 12%, transparent), transparent 60%), var(--panel); margin-bottom: 30px; }
.catchup .row { display: flex; gap: 16px; align-items: flex-start; }
.catchup .ic { width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--ether); }
.catchup h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 750; }
.catchup p { margin: 0; color: var(--muted); }
.catchup .lbl { margin: 18px 0 10px; color: var(--dim); font-weight: 700; font-size: 14px; }
.catchup .chips a { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 15px; }
.catchup .chips a small { color: var(--dim); font-weight: 600; margin-left: 4px; }
.catchup .acts { display: flex; gap: 14px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.catchup .acts a.link { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
.chapters { display: flex; flex-direction: column; gap: 14px; counter-reset: ch; }
.chapter { position: relative; display: grid; grid-template-columns: 300px 1fr; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); overflow: hidden; min-height: 190px; }
.chapter .art { position: relative; background: var(--panel-2) center/cover; }
.chapter .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, var(--panel)); }
.chapter .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.chapter:hover .art img { transform: scale(1.05); }
.chapter .in { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.chapter .num { font-family: var(--display); font-size: 15px; color: var(--signal); }
.chapter h3 { margin: 0; font-size: 22px; font-weight: 750; line-height: 1.2; }
.chapter p { margin: 0; color: var(--muted); max-width: 62ch; }
.chapter .foot2 { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chapter .faces img { width: 32px; height: 32px; }
@media (max-width: 720px) { .chapter { grid-template-columns: 1fr; } .chapter .art { height: 170px; } .chapter .art::after { background: linear-gradient(0deg, var(--panel), transparent 60%); } }
.recap { border-left: 2px solid var(--line-2); margin-left: 8px; padding-left: 26px; display: flex; flex-direction: column; gap: 22px; }
.recap .step { position: relative; }
.recap .step::before { content: ""; position: absolute; left: -34px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--ether); }
.recap .step h3 { margin: 0 0 4px; font-size: 19px; font-weight: 750; }
.recap .step .v { color: var(--dim); font-weight: 650; font-size: 13.5px; }

/* graph drawer: portrait over faction-tinted panel, no mindscapes */
.gdrawer .ph { background: radial-gradient(100% 80% at 50% 100%, color-mix(in srgb, var(--fc, var(--signal)) 45%, transparent), transparent 70%), var(--panel); }
.gdrawer .ph::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.4px); background-size: 6px 6px; }
.gdrawer .ph img.emb { left: 50%; top: 50%; bottom: auto; height: 70%; transform: translate(-50%, -50%); }
.gdrawer { animation: drawerIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes drawerIn { from { opacity: 0; transform: translateX(16px); } }
.th > .emblem-bg, .ban > .emblem-bg { position: absolute; inset: 0; }
.th .badge { z-index: 1; }
.fthumb { display: grid; place-items: center; }
.fthumb img { position: relative; width: 80%; height: 80%; object-fit: contain; }
.herocard .bg > .emblem-bg { position: absolute; inset: 0; }

/* rank icons */
.rkimg { display: inline-block; vertical-align: middle; filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); flex: none; }
.acard .rkpos { position: absolute; top: 8px; right: 8px; line-height: 0; }
.rankbadge { line-height: 0; }
.seg button .rkimg { margin: 0 2px; }
.facts dd .rkimg { margin-right: 2px; }

/* mobile */
.mob-only { display: none !important; }
@media (max-width: 980px) { .nav .mob-only { display: flex !important; } }
@media (max-width: 560px) {
  .desk-only { display: none !important; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .acard .cap { padding: 34px 10px 10px; } .acard .cap b { font-size: 15px; } .acard .cap span { font-size: 12px; }
  .acard .mk { width: 26px; height: 26px; } .acard .mk .glyph { width: 15px; height: 15px; } .acard .rkimg { width: 24px; height: 24px; }
  .ecards, .fcards { grid-template-columns: 1fr; }
  .phead h1, .d1 { font-size: clamp(34px, 10vw, 44px); }
  .toolbar { gap: 8px; } .toolbar .field-search { flex-basis: 100%; }
  .toolbar .select { flex: 1; }
  .layout { gap: 24px; }
  .catchup { padding: 18px; } .catchup .row { flex-direction: column; }
  .chapter .in { padding: 16px; } .chapter h3 { font-size: 19px; }
  .stats { gap: 18px; } .stats b { font-size: 23px; }
  .sec { padding-top: 56px; }
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -18px; margin-right: -18px; padding: 0 18px; }
  .subtabs::-webkit-scrollbar { display: none; }
  .dbgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .dbi { padding: 10px 6px 8px; } .dbi b { font-size: 12px; }
  .tv-row .items { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .wordmark { font-size: 18px; } .logo-mark { width: 28px; height: 28px; }
}
@media (max-width: 380px) { .support { padding: 0 9px; } }
.rail.strip { grid-auto-columns: minmax(220px, calc((100% - 28px) / 3)); }
.rail.strip .poster { border: 0; padding: 0; cursor: zoom-in; }
.rail.strip .poster::after { background: none; }
.prose .callout b { color: var(--paper); }

/* =================== v4: CardNav dropdowns, picker, smoothing =================== */
/* dropdown panel (CardNav-style): height + staggered card rise are driven by js/fx/cardnav.js */
.dd-menu { display: block; position: absolute; top: calc(100% + 10px); left: -8px; min-width: 340px; padding: 0; border: 0; overflow: hidden; border-radius: 18px; background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 24px 48px -20px rgba(0,0,0,.8), 0 6px 16px -8px rgba(0,0,0,.5), inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.07); animation: none !important; transform-origin: top left; }
.dd.open .dd-menu { display: block; }
.dd-menu[hidden] { display: none !important; }
.dd-menu.two { min-width: 560px; }
.dd-inner { display: grid; gap: 8px; padding: 8px; }
.dd-menu.two .dd-inner { grid-template-columns: 1fr 1fr; }
.dd-card { position: relative; display: flex !important; align-items: center; gap: 12px; padding: 12px 40px 12px 12px !important; border-radius: 12px !important; background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 100%, #fff 3%), var(--panel)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 0 rgba(255,255,255,.09), 0 4px 10px -4px rgba(0,0,0,.6); will-change: transform, opacity; transition: background .2s, box-shadow .25s !important; }
body.light .dd-card { background: linear-gradient(180deg, #fff, #f6f5f8); box-shadow: inset 0 0 0 1px rgba(24,24,27,.07), 0 4px 10px -5px rgba(24,24,27,.2); }
.dd-menu .dd-card:hover, .dd-menu .dd-card:focus-visible { background: linear-gradient(180deg, color-mix(in srgb, var(--signal) 14%, var(--panel-2)), var(--panel)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal) 45%, transparent), 0 10px 24px -10px rgba(0,0,0,.7); }
.dd-menu a.dd-card:hover { transform: none; }
.dd-ic { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--signal) 14%, transparent); color: var(--signal); }
.dd-ic .icon { margin: 0 !important; width: 19px; height: 19px; }
.dd-tx b { display: block; font-size: 14.5px; font-weight: 700; }
.dd-tx small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.dd-arrow { position: absolute; right: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; overflow: hidden; color: var(--muted); }
.dd-arrow .icon { position: absolute; inset: 0; width: 18px; height: 18px; margin: 0 !important; color: inherit; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.dd-arrow .in { transform: translate(-120%, 120%); }
.dd-card:hover .dd-arrow { color: var(--signal); }
.dd-card:hover .dd-arrow .out { transform: translate(120%, -120%); }
.dd-card:hover .dd-arrow .in { transform: none; }
@media (max-width: 980px) {
  .dd-menu, .dd-menu[hidden], .dd-menu.two { display: block !important; position: static; height: auto !important; opacity: 1 !important; min-width: 0; background: none; box-shadow: none; backdrop-filter: none; border-radius: 0; }
  .dd-menu.two .dd-inner { grid-template-columns: 1fr; }
  .dd-card { transform: none !important; opacity: 1 !important; background: none !important; box-shadow: none !important; padding: 8px 8px 8px 4px !important; }
  .dd-arrow { display: none; }
}

/* picker */
.picker button { position: relative; overflow: hidden; gap: 16px; transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .25s, background-color .25s, color .25s, box-shadow .3s; }
.picker button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.picker button[aria-pressed="true"]::after { transform: scaleX(1); }
.picker button:hover { transform: translateY(-2px); }
.picker button[aria-pressed="true"] { box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--signal) 70%, transparent); }
.picker .pt b { display: block; font-size: 15px; font-weight: 700; color: var(--paper); }
.picker .pt small { display: block; font-size: 12.5px; font-weight: 600; color: var(--dim); margin-top: 2px; }
.picker button[aria-pressed="true"] .pt small { color: var(--muted); }
.picker-view { min-height: 0; position: relative; overflow: hidden; transition: height .4s cubic-bezier(.22,1,.36,1); background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--signal) 6%, transparent), transparent 55%), var(--ink-2); }
.pv-in { animation: pvIn .38s cubic-bezier(.22,1,.36,1) both; }
@keyframes pvIn { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.picker-view .row1 p { font-size: 15.5px; }

/* posters: readable text on any art */
.poster .in { padding: 14px 16px 16px; }
.poster h3 { font-size: 18px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.poster .sub { text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster.wide::after { background: linear-gradient(0deg, rgba(10,8,14,.96) 10%, rgba(10,8,14,.55) 48%, rgba(10,8,14,.05) 85%); }
.poster .badge { margin-bottom: 8px; }

/* rails: whole-card steps, fading edges, disabled arrows */
.rail { scroll-snap-type: x proximity; scroll-padding-inline: 0; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
.rail.at-start { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%); }
.rail.at-start.at-end { -webkit-mask-image: none; mask-image: none; }
.rail.at-end:not(.at-start) { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px); mask-image: linear-gradient(90deg, transparent 0, #000 28px); }
.rail-nav button { transition: opacity .2s, color .2s, border-color .2s, transform .15s; }
.rail-nav button:hover:not(:disabled) { color: var(--paper); border-color: var(--line-2); }
.rail-nav button:active:not(:disabled) { transform: scale(.92); }
.rail-nav button:disabled { opacity: .35; cursor: default; }
.rail .acard .art { transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .45s ease; }

/* images fade in once decoded instead of popping */
img[loading="lazy"] { opacity: 0; transition: opacity .45s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
img[loading="lazy"].ld { opacity: 1; }
.acard .art[loading="lazy"] { transition: opacity .45s ease, transform .35s ease; }
body.reduce img[loading="lazy"] { opacity: 1; }

/* TV switch: CRT off → on, no layout jump */
.tv.switch .screen img { animation: tvOff .38s ease-in both !important; }
.tv .screen img.ld { animation: tvOn .5s cubic-bezier(.2,.8,.2,1) both; }
.tv .osd b, .tv .osd span { transition: opacity .3s; }
.tv.switch .osd b, .tv.switch .osd span, .tv.switch .ch { opacity: 0; }

/* smoother global interactions */
a, button { -webkit-tap-highlight-color: transparent; }
.chip, .btn, .ibtn, .searchbtn, .seg button { transition: transform .18s cubic-bezier(.2,.8,.2,1), background-color .25s, border-color .25s, color .25s, box-shadow .3s, filter .2s; }
.subtabs .chip[aria-pressed="true"] { box-shadow: 0 8px 20px -12px rgba(0,0,0,.8); }
.seg button[aria-pressed="true"] { box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--signal) 70%, transparent); }
.box, .tldr, .catchup, .chapter { transition: border-color .25s, box-shadow .35s, transform .35s cubic-bezier(.2,.8,.2,1); }
.chapter:hover { border-color: var(--line-2); box-shadow: 0 20px 44px -26px rgba(0,0,0,.85); transform: translateY(-2px); }
.sres a { transition: background-color .15s; }
.sdlg[open] { animation: dlgIn .28s cubic-bezier(.22,1,.36,1); }
.sdlg[open]::backdrop { animation: fadeIn .25s ease; }
.lightbox[open] { animation: fadeIn .25s ease; }
.lightbox[open] .lb-stage img { animation: lbIn .4s cubic-bezier(.22,1,.36,1); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } }
.nav.open { animation: fadeIn .2s ease; }
.herocard.npc .fig { height: 96%; right: 6%; bottom: 0; filter: drop-shadow(0 16px 40px rgba(0,0,0,.55)); }

/* v5: compact list dropdowns (Teyvatica-style), spring animation kept */
.dd-menu, .dd-menu.two { min-width: 236px; border-radius: 14px; }
.dd-inner, .dd-menu.two .dd-inner { grid-template-columns: 1fr; gap: 2px; padding: 6px; }
.dd-card { padding: 9px 12px !important; gap: 12px; border-radius: 9px !important; background: none !important; box-shadow: none !important; }
.dd-menu .dd-card:hover, .dd-menu .dd-card:focus-visible { background: color-mix(in srgb, var(--paper) 7%, transparent) !important; box-shadow: none !important; }
.dd-ic { width: auto; height: auto; background: none; color: var(--muted); }
.dd-card:hover .dd-ic { color: var(--signal); }
.dd-ic .icon { width: 18px; height: 18px; }
.dd-tx b { font-weight: 600; font-size: 15px; }
.dd-arrow { display: none; }
.nav .dd.on > button, .nav > a.on { box-shadow: inset 0 -2px 0 var(--signal); }

.ccard .art { height: 94%; object-fit: contain; }
.ccard .art.wide { height: auto; width: 100%; max-width: 100%; bottom: 0; }
.ccard .rkpos .badge { background: rgba(12,10,16,.7); }

/* v5: database */
.hubsearch { max-width: 720px; height: 50px; border-radius: 14px; }
.dbcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dbcat { display: flex; flex-direction: column; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.dbcat:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.dbcat .ic { height: 118px; display: grid; place-items: center; background: var(--ink-2); border-bottom: 1px solid var(--line); }
.dbcat .ic img { max-height: 86px; max-width: 70%; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.dbcat:hover .ic img { transform: scale(1.08) rotate(-3deg); }
.dbcat .in { padding: 14px 16px; }
.dbcat b { display: block; font-size: 18px; font-weight: 700; }
.dbcat span { color: var(--muted); font-size: 14px; }
.dbsec { margin-top: 44px; max-width: 900px; }
.dbsec h2 { font-size: 24px; font-weight: 750; margin: 0 0 6px; }
.dbsec p { color: var(--muted); margin: 0 0 14px; }
.dbrow { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.dbrow:hover { border-color: var(--signal); }
.dbrow .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--signal) 14%, var(--ink-2)); color: var(--signal); flex: none; }
.dbrow b { display: block; font-size: 17px; }
.dbrow small { color: var(--muted); font-size: 14px; }
.dbgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.dbcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.dbcard:hover { border-color: var(--line-2); transform: translateY(-3px); }
.dbcard .pic { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--ink-2); display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; }
.dbcard .pic.tall { aspect-ratio: 4 / 5; }
.dbcard .pic img { width: 86%; height: 86%; object-fit: contain; }
.dbcard b { font-size: 14.5px; font-weight: 650; line-height: 1.3; }
.dbcard small { color: var(--muted); font-size: 12.5px; }
.rkchip { position: absolute; top: 6px; left: 6px; font-family: var(--display); font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.rk-B { background: linear-gradient(140deg, #7fc3ff, #2c6dd6); color: #001a3a; }
.dblist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dbline { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.dbline:first-child { border-top: 0; }
.dbline:hover { background: var(--panel-2); }
.dbline img, .dbline .ph { width: 52px; height: 52px; object-fit: contain; flex: none; border-radius: 10px; background: var(--ink-2); display: grid; place-items: center; color: var(--dim); }
.dbline b { display: block; font-weight: 650; }
.dbline small { color: var(--muted); font-size: 13px; display: block; }
.dbline em { color: var(--dim); font-size: 13.5px; font-style: normal; display: block; }
.dbcard .ph, .dbitem-art .ph { color: var(--dim); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.dbitem { display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: start; padding: 4px 0 10px; }
.dbitem-art { aspect-ratio: 1; border-radius: var(--r-lg); border: 1px solid var(--line); background: radial-gradient(80% 80% at 50% 60%, color-mix(in srgb, var(--signal) 14%, transparent), transparent 70%), var(--panel); display: grid; place-items: center; cursor: zoom-in; padding: 0; position: sticky; top: calc(var(--header) + 20px); }
.dbitem-art img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 16px 32px rgba(0,0,0,.5)); }
.effect { margin: 16px 0; padding: 16px 18px; border-radius: var(--r); background: var(--ink-2); border: 1px solid var(--line); }
.effect h2 { font-size: 14px; font-weight: 750; color: var(--signal); margin: 0 0 6px; }
.effect h2 + p { margin: 0 0 12px; }
.effect p:last-child { margin-bottom: 0; }
.gamequote { margin: 16px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ether); color: var(--paper); font-style: italic; font-size: 17px; line-height: 1.65; }
.dbitem .facts { max-width: 520px; }
@media (max-width: 800px) { .dbitem { grid-template-columns: 1fr; } .dbitem-art { position: static; max-width: 320px; } }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin: 0; }
.term { padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); scroll-margin-top: 90px; }
.term:target { border-color: var(--signal); }
.term dt { font-weight: 750; font-size: 16px; margin-bottom: 4px; }
.term dt a { text-decoration: underline; text-decoration-color: var(--ether); text-underline-offset: 3px; }
.term dd { margin: 0; color: var(--muted); font-size: 15px; }

/* v5: in-universe timeline */
.tlbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.segl { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 9px; color: var(--muted); font-weight: 650; font-size: 14px; }
.segl[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.tlchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; position: sticky; top: var(--header); z-index: 5; padding: 10px 0; background: color-mix(in srgb, var(--ink) 90%, transparent); backdrop-filter: blur(10px); }
.tlwrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; }
.tlmain { position: relative; padding-left: 26px; }
.tlmain::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 0; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.tlgroup { margin-bottom: 34px; scroll-margin-top: calc(var(--header) + 70px); }
.tlgroup h2 { position: relative; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 22px; font-weight: 750; margin: 0 0 14px; }
.tlgroup h2 .node { position: absolute; left: -26px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 2px solid var(--ether); }
.tlgroup h2 small { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.tlgroup h2 em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--dim); font-weight: 600; }
.tlitems { display: flex; flex-direction: column; gap: 10px; }
.tlcard { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); transition: border-color .25s, background-color .25s, transform .3s cubic-bezier(.2,.8,.2,1); }
.tlcard::before { content: ""; position: absolute; left: -24px; top: 26px; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .25s, box-shadow .25s; }
.tlcard:hover { border-color: var(--line-2); transform: translateX(2px); }
.tlcard.on { border-color: color-mix(in srgb, var(--ether) 55%, var(--line)); background: color-mix(in srgb, var(--ether) 5%, var(--panel)); }
.tlcard.on::before { background: var(--ether); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ether) 22%, transparent); }
.tlcard img, .tlcard .ph { width: 120px; height: 86px; border-radius: 10px; object-fit: cover; object-position: center 25%; background: var(--ink-2); display: grid; place-items: center; color: var(--dim); }
.tlcard .tx small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--dim); font-size: 12.5px; font-weight: 600; }
.tlcard .tx b { display: block; font-size: 16.5px; font-weight: 700; margin: 3px 0 4px; line-height: 1.3; }
.tlcard .tx > span { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icon.mini { width: 13px; height: 13px; }
.tlside { position: relative; }
.tldial { position: sticky; top: calc(var(--header) + 70px); padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); text-align: center; }
.dial { width: 100%; max-width: 280px; display: block; margin: 0 auto; }
.dial .ring { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.dial .ticks line { stroke: var(--dim); stroke-width: 1.2; }
.dial .arc { fill: none; stroke: var(--ether); stroke-width: 3; stroke-linecap: round; transition: d .6s cubic-bezier(.22,1,.36,1); }
.dial .labels text { fill: var(--muted); font: 600 10.5px Figtree, sans-serif; text-anchor: middle; }
.dial .hand { transform-origin: 150px 150px; transition: transform .7s cubic-bezier(.34,1.4,.5,1); }
.dial .hand line { stroke: var(--ether); stroke-width: 3; stroke-linecap: round; }
.dial .hand circle { fill: var(--ink); stroke: var(--ether); stroke-width: 3; }
.dial .pin { fill: var(--ether); }
.dialtext b { display: block; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.1; margin-top: 8px; }
.dialtext span { color: var(--muted); font-size: 14px; }
.dialnote { font-size: 13px; text-align: left; margin: 14px 0 0; }
@media (max-width: 960px) { .tlwrap { grid-template-columns: 1fr; } .tlside { order: -1; } .tldial { position: static; display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 14px; text-align: left; padding: 12px; } .dialtext b { font-size: 28px; margin: 0; } .dialnote { display: none; } }
@media (max-width: 560px) { .tlcard { grid-template-columns: 84px 1fr; gap: 12px; } .tlcard img, .tlcard .ph { width: 84px; height: 64px; } }

/* v5: graph (Teyvatica-style chrome) */
.gpanel { display: none; }
.gtools { position: absolute; left: 16px; top: 16px; z-index: 3; display: flex; gap: 6px; align-items: center; }
.gbtn { height: 38px; min-width: 38px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(12px); color: var(--paper); font-weight: 650; font-size: 14px; }
.gbtn:hover { border-color: var(--signal); }
.gbtn[aria-expanded="true"] { border-color: var(--signal); color: var(--signal); }
.gs-main { width: 260px; }
.gs-main input { height: 38px; background: var(--glass); backdrop-filter: blur(12px); border-color: var(--line-2); padding-right: 34px; }
.gs-main kbd { position: absolute; right: 8px; top: 9px; }
.gfindpop { position: absolute; left: 16px; top: 62px; width: 320px; z-index: 4; padding: 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--glass); backdrop-filter: blur(16px); box-shadow: var(--shadow); animation: dlgIn .25s cubic-bezier(.22,1,.36,1); }
.gfindpop h2 { font-size: 13.5px; font-weight: 700; color: var(--dim); margin: 0 0 8px; }
.glayers { position: absolute; left: 18px; bottom: 156px; z-index: 2; transition: opacity .25s, transform .3s; }
.glayers h2 { font-size: 11.5px; letter-spacing: .08em; font-weight: 700; color: var(--dim); margin: 0 0 4px 8px; text-transform: none; }
.glayers .layers button { padding: 4px 8px; font-size: 14px; background: none; }
.glayers .layers button:hover { background: color-mix(in srgb, var(--paper) 6%, transparent); }
.gpage.nopanel .glayers, .gpage.nopanel .gmini { opacity: 0; pointer-events: none; transform: translateX(-12px); }
.ghover { position: absolute; left: 0; top: 0; z-index: 5; width: 300px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow); pointer-events: none; transition: transform .08s linear; }
.ghover .hh { display: flex; align-items: center; gap: 8px; }
.ghover b { font-size: 15.5px; }
.ghover small { color: var(--dim); font-size: 12.5px; font-weight: 600; }
.ghover p { margin: 6px 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.ghover .cnt { font-size: 12.5px; color: var(--paper); }
.ghover .hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.gtip { left: 50%; }
.gdrawer { width: 330px; padding: 16px; }
.gdrawer .dhead { display: flex; gap: 12px; align-items: center; padding-right: 34px; }
.gdrawer .dav { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--line-2); display: grid; place-items: center; background: var(--panel-2); }
.gdrawer h3 { margin: 0; font-size: 19px; }
.gdrawer .dhead small { color: var(--dim); font-size: 13px; font-weight: 600; }
.gdrawer > p { margin: 12px 0; }
.gdrawer .x { right: 12px; top: 12px; background: none; color: var(--muted); }
.openp { width: 100%; justify-content: center; background: var(--ether); color: #fff; }
.dacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 14px; }
.dacts button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.dacts button:hover, .dacts button[aria-pressed="true"] { color: var(--paper); border-color: var(--signal); }
.dacts .icon { width: 16px; height: 16px; }
.cgroup { border-top: 1px solid var(--line); padding: 4px 0; }
.cgroup summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 2px; font-weight: 700; font-size: 14px; cursor: pointer; }
.cgroup summary::-webkit-details-marker { display: none; }
.cgroup summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
.cgroup[open] summary::before { transform: rotate(45deg); }
.cgroup summary .n { margin-left: auto; color: var(--dim); font-weight: 600; font-size: 13px; }
.crow { display: flex; justify-content: space-between; gap: 8px; padding: 5px 4px 5px 22px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.crow:hover { background: var(--panel); color: var(--paper); }
.crow span { color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.crow.more { display: none; }
.cgroup.all .crow.more { display: flex; }
.showall { margin: 2px 0 4px 22px; border: 0; background: none; color: var(--signal); font-weight: 650; font-size: 13px; padding: 4px 0; }
@media (max-width: 900px) { .gs-main { width: 150px; } .gbtn.wide span { display: none; } .glayers { display: none; } .gfindpop { left: 12px; right: 12px; width: auto; } }

.tlchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tlchips::-webkit-scrollbar { display: none; }

/* v6: agent data tabs */
.adata { min-height: 300px; }
.adata .skel { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 200% 100%; animation: skel 1.2s linear infinite; margin-bottom: 12px; }
.adata .skel.short { width: 60%; height: 60px; }
@keyframes skel { to { background-position: -200% 0; } }
.adata .d2 { margin: 8px 0 6px; }
.adata > .muted { margin: 0 0 18px; }
.srcline { margin-top: 28px; font-size: 13px; color: var(--dim); }
.srcline a { text-decoration: underline; text-underline-offset: 2px; }
.sknav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; position: sticky; top: calc(var(--header) + 56px); z-index: 4; padding: 8px 0; background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(10px); }
.sknav a { display: inline-flex; gap: 6px; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 650; font-size: 13.5px; color: var(--muted); }
.sknav a:hover { color: var(--paper); border-color: var(--line-2); }
.sknav span { color: var(--dim); font-size: 12px; }
.skgroup { margin-bottom: 26px; scroll-margin-top: calc(var(--header) + 110px); }
.skgroup h3 { font-size: 20px; font-weight: 750; margin: 0 0 10px; }
.skill { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-bottom: 8px; overflow: hidden; }
.skill summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.skill summary::-webkit-details-marker { display: none; }
.skill summary b { font-size: 16px; }
.sk-kind { font-size: 12px; font-weight: 700; color: var(--signal); flex: none; }
.skill p { margin: 0; padding: 0 16px 14px; color: var(--muted); line-height: 1.6; font-size: 15px; }
.skill[open] { border-color: var(--line-2); }
.kc { display: inline-block; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--ink-2); color: var(--paper); font: 650 12.5px var(--body, Figtree), sans-serif; line-height: 1.6; }
.num { color: var(--paper); font-weight: 700; }
.mindart { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--ink-2); margin-bottom: 18px; aspect-ratio: 16/7; }
.mindart img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.mindart:hover img { transform: scale(1.03); }
.minds { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.minds li { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.minds .mn { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--signal); font-family: var(--display); font-size: 18px; color: var(--signal); }
.minds b { font-size: 16.5px; }
.minds p { margin: 4px 0 0; color: var(--muted); line-height: 1.6; font-size: 15px; }
.profgrid { display: grid; grid-template-columns: 1fr 240px; gap: 24px; align-items: start; margin-bottom: 10px; }
.facts.big dt { font-size: 14px; } .facts.big dd { font-size: 15px; }
.profart { width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--r); background: var(--panel); }
.h3 { font-size: 19px; font-weight: 750; margin: 26px 0 8px; }
.lorechips { display: flex; flex-wrap: wrap; gap: 6px; }
.lorechips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.lorechips a:hover { color: var(--paper); border-color: var(--signal); }
.vagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.va { padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.va small { color: var(--dim); font-weight: 650; font-size: 12.5px; }
.va b { font-size: 16.5px; }
.va span { color: var(--muted); font-size: 13.5px; }
.vobars { display: grid; gap: 8px; margin: 12px 0 18px; max-width: 560px; }
.vobars div { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.vobars span { color: var(--muted); }
.vobars i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ether), var(--signal)); width: var(--w); }
.vobars b { text-align: right; font-variant-numeric: tabular-nums; }
.facts .dl { display: inline-flex; gap: 6px; align-items: center; color: var(--signal); font-weight: 650; }
.facts .dl .icon { width: 15px; height: 15px; }
@media (max-width: 700px) { .profgrid { grid-template-columns: 1fr; } .profart { max-height: 280px; } .vobars div { grid-template-columns: 100px 1fr 34px; } }

/* v6: episode archive */
.quests { display: grid; gap: 22px; }
.qact h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 750; margin: 0 0 10px; }
.qact h3 span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); font-size: 14px; }
.qep { position: relative; margin-left: 13px; padding: 12px 16px 14px 24px; border-left: 2px solid var(--line-2); }
.qep::before { content: ""; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 2px solid var(--ether); }
.qep .qt { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.qep b { font-size: 16px; }
.qlink { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--dim); flex: none; }
.qlink:hover { color: var(--signal); }
.qlink .icon { width: 13px; height: 13px; }
.qep p { margin: 4px 0 8px; color: var(--muted); line-height: 1.55; }
.qcast { display: flex; flex-wrap: wrap; gap: 6px; }
.qcast a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--muted); }
.qcast a:hover { border-color: var(--signal); color: var(--paper); }
.qcast img, .qcast span { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; }
.qcast em { font-style: normal; }

/* v6: entry art that should not be cropped (logos, items, creatures) */
.ecard .th.fit { background-size: contain !important; background-repeat: no-repeat; background-position: center; background-color: color-mix(in srgb, var(--ink) 70%, var(--panel-2)); }
.ecard .th .phico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); }
.ecard .th .phico .icon { width: 40px; height: 40px; opacity: .5; }
.herocard.npc.logo .fig { object-fit: contain; height: 80%; bottom: 10%; right: 4%; max-width: 46%; }
.poster.fit img { object-fit: contain; padding: 18px 18px 70px; background: color-mix(in srgb, var(--ink) 70%, var(--panel-2)); }
.poster .phico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); background: linear-gradient(135deg, color-mix(in srgb, #c09bff 22%, transparent), var(--panel-2)); }
.poster .phico .icon { width: 46px; height: 46px; opacity: .45; margin-bottom: 60px; }
.ccard .art.land { inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 30%; transform: none; }
.ccard:has(.art.land) .cap { background: linear-gradient(0deg, rgba(10,9,14,.92), rgba(10,9,14,.5) 60%, transparent); }
.skic { width: 30px; height: 30px; flex: none; align-self: center; border-radius: 50%; background: #0c0b10; padding: 3px; }
.skill summary { align-items: center; }
.skgroup h3 { display: flex; align-items: center; gap: 10px; }
.skgroup h3 img, .sknav img { width: 22px; height: 22px; border-radius: 50%; background: #0c0b10; padding: 2px; }
.sknav img { width: 18px; height: 18px; padding: 1px; }
.kc img { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; border-radius: 50%; background: #0c0b10; }
.kc { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kc img { display: inline-block; margin: 0; vertical-align: middle; }

/* v7: timeline VHS deck */
.deck { position: sticky; top: calc(var(--header) + 70px); padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 80%, #000), var(--panel)); --p: 0; --rot: 0deg; }
.deck-top { display: grid; gap: 12px; }
.cassette { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-radius: 12px; background: #0d0c11; border: 1px solid #2a2733; box-shadow: inset 0 2px 10px rgba(0,0,0,.6); }
.cassette .window { position: absolute; left: 50%; top: 50%; width: 46%; height: 34%; transform: translate(-50%, -50%); border-radius: 6px; background: rgba(69,212,230,.06); border: 1px solid rgba(69,212,230,.18); overflow: hidden; }
.cassette .strip { position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, #3a2d22 0 6px, #2a2018 6px 12px); background-position: calc(var(--p) * -240px) 0; transition: background-position .6s cubic-bezier(.22,1,.36,1); }
.reel { width: 72px; height: 72px; z-index: 1; }
.reel .tape-wind { fill: #2b2119; stroke: #3d2f23; stroke-width: 1; transition: r .6s cubic-bezier(.22,1,.36,1); }
.reel .hub { transform-origin: 40px 40px; transform: rotate(var(--rot)); transition: transform .9s cubic-bezier(.22,1,.36,1); }
.reel .hub circle:first-child { fill: #e9e4d8; }
.reel .hub rect { fill: #0d0c11; }
.reel .axle { fill: var(--signal); }
.counter { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 10px; padding: 12px 14px; border-radius: 10px; background: #071113; border: 1px solid rgba(69,212,230,.25); color: var(--crt); text-shadow: 0 0 10px rgba(69,212,230,.45); }
.counter small { grid-column: 1 / -1; font-size: 12px; font-weight: 650; opacity: .7; }
.counter b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.05; }
.counter #dialSub { grid-column: 1; font-size: 13.5px; opacity: .85; }
.counter .cnt { grid-column: 2; grid-row: 2 / 4; align-self: center; font-variant-numeric: tabular-nums; font-size: 13px; padding: 4px 8px; border-radius: 6px; background: rgba(69,212,230,.08); }
.transport { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.tbtn { width: 46px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--paper); box-shadow: 0 3px 0 #0006; transition: transform .12s, box-shadow .12s, border-color .2s; }
.tbtn:hover { border-color: var(--signal); }
.tbtn:active { transform: translateY(3px); box-shadow: 0 0 0 #0006; }
.tbtn.play { width: 58px; color: var(--signal); }
.tape { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 42vh; overflow: auto; scrollbar-width: thin; }
.tape button { position: relative; width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: color-mix(in srgb, var(--paper) 4%, transparent); color: var(--muted); font-size: 14px; font-weight: 650; text-align: left; overflow: hidden; --f: 0; }
.tape button .fill { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--f) * 100%); background: var(--ether); transition: width .5s cubic-bezier(.22,1,.36,1); }
.tape button .idx { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12px; }
.tape button .n { font-size: 12px; color: var(--dim); }
.tape button:hover { color: var(--paper); border-color: var(--line-2); }
.tape button[aria-current="true"] { color: var(--paper); border-color: color-mix(in srgb, var(--ether) 60%, transparent); background: color-mix(in srgb, var(--ether) 10%, var(--panel)); }
.tape button[aria-current="true"] .idx { color: var(--ether); }
.deck .dialnote { margin: 10px 0 0; font-size: 13px; }
@media (max-width: 960px) {
  .deck { position: static; padding: 12px; }
  .deck-top { grid-template-columns: auto 1fr; align-items: center; }
  .cassette { padding: 8px 10px; gap: 30px; } .reel { width: 44px; height: 44px; }
  .tape { display: none; } .deck .dialnote { display: none; } .transport { margin: 10px 0 0; }
}

/* v7: lore glossary */
.gt-tools { display: grid; gap: 12px; margin-bottom: 10px; position: sticky; top: var(--header); z-index: 5; padding: 10px 0; background: color-mix(in srgb, var(--ink) 92%, transparent); backdrop-filter: blur(10px); }
.gt-tools .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-az { display: flex; flex-wrap: wrap; gap: 2px; }
.gt-az button { width: 30px; height: 30px; border-radius: 7px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.gt-az button:hover { background: var(--panel); color: var(--signal); }
.gt-sec { margin: 26px 0 8px; }
.gt-h { font-size: 22px; font-weight: 750; margin: 0 0 12px; }
.gt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; align-items: start; }
.gterm { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px; scroll-margin-top: calc(var(--header) + 160px); transition: border-color .3s, box-shadow .6s; }
.gterm.flash { border-color: var(--signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 25%, transparent); }
.gt-head { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; }
.gt-head img, .gt-ph { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--ink-2); display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--signal); }
.gt-head h3 { margin: 0 0 3px; font-size: 16.5px; font-weight: 750; }
.gt-head h3 a:hover { color: var(--signal); }
.gt-head p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.gterm details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.gterm summary { cursor: pointer; color: var(--dim); font-size: 13px; font-weight: 700; list-style: none; }
.gterm summary::-webkit-details-marker { display: none; }
.gterm summary::after { content: " +"; } .gterm details[open] summary::after { content: " −"; }
.gterm details p { color: var(--paper); font-size: 14.5px; line-height: 1.6; margin: 8px 0; }
.gterm dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0; font-size: 13.5px; }
.gterm dt { color: var(--dim); font-weight: 650; }
.gt-rel { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-rel a { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; }
.gt-rel a:hover { border-color: var(--signal); color: var(--signal); }
@media (max-width: 600px) { .gt-grid { grid-template-columns: 1fr; } .gt-az { display: none; } }
#gtcats .chip .n { background: none; border: 0; padding: 0; min-width: 0; height: auto; color: inherit; opacity: .6; }

/* v8: graph layers readable over nodes */
.glayers .layers button { background: rgba(10,9,14,.82); box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 4px 14px rgba(0,0,0,.55); border-radius: 999px; margin: 3px 0; padding: 5px 12px 5px 10px; text-shadow: 0 1px 2px #000; backdrop-filter: blur(6px); }
.glayers .layers button:hover { background: rgba(22,20,28,.92); }
.glayers h2 { display: inline-block; background: rgba(10,9,14,.82); padding: 2px 8px; border-radius: 6px; text-shadow: 0 1px 2px #000; }
.gmini { box-shadow: 0 6px 20px rgba(0,0,0,.6); }
.gdrawer .dav { object-position: center 12%; }
.qcast img, .crow img, .rel .av, .gsug img { object-position: center 15%; }

/* v9: episode stills */
.qep.has-still { display: grid; grid-template-columns: 168px 1fr; column-gap: 16px; }
.qep.has-still > :not(.qstill) { grid-column: 2; }
.qstill { grid-row: 1 / span 3; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--ink-2); aspect-ratio: 16 / 9; align-self: start; margin-top: 2px; cursor: zoom-in; }
.qstill img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.qstill:hover img { transform: scale(1.05); }
@media (max-width: 640px) { .qep.has-still { grid-template-columns: 1fr; } .qep.has-still > :not(.qstill) { grid-column: 1; } .qstill { grid-row: auto; margin-bottom: 8px; } }
.tbtn.pressed { transform: translateY(3px); box-shadow: 0 0 0 #0006; border-color: var(--signal); }
.gtip[hidden] { display: none !important; }

/* v10: our projects */
.projs { display: grid; gap: 18px; margin-bottom: 34px; }
.proj { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); }
.proj-shot { border-radius: 12px; overflow: hidden; background: var(--ink-2); aspect-ratio: 16 / 10; border: 1px solid var(--line); }
.proj-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.proj-shot:hover img { transform: scale(1.03); }
.proj-in { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 4px 0; }
.proj-head { display: flex; gap: 12px; align-items: center; }
.proj-ic { width: 48px; height: 48px; border-radius: 12px; }
.proj h3 { margin: 4px 0 0; font-size: 24px; font-weight: 750; }
.proj p { margin: 0; color: var(--muted); line-height: 1.6; }
.proj ul { margin: 0; padding-left: 18px; color: var(--paper); font-size: 14.5px; line-height: 1.7; }
.proj .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 860px) { .proj { grid-template-columns: 1fr; } }

/* v11: phone pass */
@media (max-width: 600px) {
  .deck-top { grid-template-columns: 1fr; }
  .cassette { justify-content: space-around; }
  .counter b { font-size: 26px; }
  .sknav, .tlchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; background: var(--ink); -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .sknav::-webkit-scrollbar, .tlchips::-webkit-scrollbar { display: none; }
  .sknav > *, .tlchips > * { flex: none; }
  .sknav, .tlchips, .atabs { contain: inline-size; max-width: 100%; }
  .atabs { overflow-x: auto; scrollbar-width: none; }
}

/* v12: episode anchors from search */
.qep { scroll-margin-top: calc(var(--header) + 80px); }
.qep:target { border-radius: 12px; background: color-mix(in srgb, var(--signal) 8%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--signal) 45%, transparent); }

/* v13: VHS tapes */
.shelf-wrap { margin: 4px 0 26px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: end; }
.shelf-peek { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); color: inherit; text-decoration: none; }
.shelf-peek img { width: 110px; aspect-ratio: 438 / 719; object-fit: cover; border-radius: 3px; box-shadow: 0 10px 20px #0008; }
.shelf-peek small { display: block; font-size: 12px; color: var(--dim); font-weight: 650; }
.shelf-peek b { display: block; font-size: 17px; line-height: 1.25; margin: 4px 0 6px; }
.shelf-peek em { font-style: normal; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) { .shelf-wrap { grid-template-columns: 1fr; } .shelf-peek { display: none; } }
.shelf { display: flex; align-items: flex-end; gap: 4px; padding: 30px 16px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 60%, #000), var(--panel)); border: 1px solid var(--line); border-bottom: 0; }
.tape { position: relative; flex: none; display: block; transition: transform .35s cubic-bezier(.22,1,.36,1); }
.tape img { display: block; height: 220px; width: auto; border-radius: 2px; box-shadow: inset 0 0 0 1px #0006, 2px 0 4px #0008; }
.tape::after { content: ''; position: absolute; inset: 0; border-radius: 2px; background: linear-gradient(90deg, #fff1, transparent 30%, transparent 70%, #0004); pointer-events: none; }
.tape:hover, .tape:focus-visible { transform: translateY(-16px); outline: none; }
.tape:focus-visible img { box-shadow: 0 0 0 2px var(--signal); }
/* label replaced by .shelf-peek */ .tape .tlab { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; font-weight: 650; padding: 4px 8px; border-radius: 6px; background: var(--paper); color: var(--ink); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2; }
.tape:first-child .tlab { left: 0; transform: none; }
.tape:hover .tlab, .tape:focus-visible .tlab { opacity: 1; }
.shelf-board { height: 14px; border-radius: 0 0 8px 8px; background: linear-gradient(180deg, #3a2f28, #241c17); box-shadow: 0 8px 18px #0007; }
@media (max-width: 600px) { .tape img { height: 160px; } .shelf { padding-top: 26px; } }

.vtape { text-align: center; }
.vtape h2 { text-align: left; }
.vcase { --h: 300px; --w: calc(var(--h) * .61); --s: calc(var(--h) * .13); display: block; margin: 6px auto 10px; padding: 0 0 0 var(--s); border: 0; background: none; cursor: zoom-in; perspective: 1100px; }
.vcase.hidden { display: none; }
.vbox { position: relative; display: block; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateY(32deg); transition: transform .6s cubic-bezier(.22,1,.36,1); }
.vcase:hover .vbox, .vcase:focus-visible .vbox { transform: rotateY(6deg); }
.vspine { position: absolute; left: 0; top: 0; width: var(--s); height: 100%; background-size: 100% 100%; transform-origin: left center; transform: rotateY(-90deg); filter: brightness(.82); }
.vfront { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: translateZ(var(--s)); border-radius: 2px; box-shadow: 0 18px 30px #0008; }
.vab { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.vab button { border: 0; padding: 5px 12px; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.vab button.on { background: var(--paper); color: var(--ink); }
.vtape .muted { font-size: 12.5px; margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .vbox, .tape { transition: none; } }
.shelf::before, .shelf::after { content: ''; flex: 1 0 0; }

/* v14: questline */
.qline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: ql; }
.qline > li { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.qlc { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.qlc img, .qlc > span:first-child { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--ink-2); }
.qlc small { display: block; font-size: 12px; color: var(--dim); font-weight: 600; }
.qlc b { font-size: 16.5px; }
.qlc em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.qlc:hover b { color: var(--signal); }
.qline ul { list-style: none; margin: 0; padding: 6px; }
.qline ul a { display: block; padding: 9px 12px 9px 30px; border-radius: 10px; color: inherit; text-decoration: none; position: relative; }
.qline ul a::before { content: ''; position: absolute; left: 13px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.qline ul a:hover { background: color-mix(in srgb, var(--paper) 5%, transparent); }
.qline ul b { display: block; font-size: 14.5px; }
.qline ul span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* v15: reading toolbar */
.chsel { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); max-width: 240px; }
.chsel select { appearance: none; border: 0; background: none; color: var(--paper); font: inherit; font-size: 13.5px; font-weight: 600; padding: 0 18px 0 0; max-width: 200px; text-overflow: ellipsis; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 6px center, right 2px center; background-size: 4px 4px; background-repeat: no-repeat; }
.chsel select option, .chsel select optgroup { background: var(--panel); color: var(--paper); }
.ibtn.wide { width: auto; white-space: nowrap; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font: inherit; font-size: 13.5px; font-weight: 600; }
.ibtn.wide[aria-pressed="true"] { color: var(--ink); background: var(--signal); border-color: var(--signal); }
.atabs .acts { display: flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .chsel { display: none; } .ibtn.wide span { display: none; } .ibtn.wide { padding: 0; width: 36px; justify-content: center; } }
body.reading .top, body.reading .side, body.reading footer, body.reading .atabs nav, body.reading .crumbs, body.reading .herocard, body.reading .tldr, body.reading .readtime { display: none !important; }
body.reading .atabs { top: 0; }
body.reading .layout { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }
body.reading .prose { font-size: 19px; line-height: 1.8; }
body.reading .qep p { font-size: 16px; }
.rprog { margin: 4px 0 18px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); font-size: 14.5px; color: var(--muted); }
.rprog b { color: var(--paper); }
.rprog .bar { margin-top: 10px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--paper) 8%, transparent); overflow: hidden; }
.rprog .bar span { display: block; height: 100%; background: var(--signal); border-radius: inherit; }
.badge.readb { display: inline-flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--signal) 18%, transparent); color: var(--signal); }
.badge.readb .icon { width: 13px; height: 13px; }
.chapter.isread .art { filter: saturate(.55) brightness(.8); }

/* v16: lore start path */
.lpath { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; counter-reset: none; }
.lpath a { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); color: inherit; text-decoration: none; height: 100%; }
.lpath a:hover { border-color: var(--line-2); }
.lpath a:hover b { color: var(--signal); }
.lpath .ln { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 17px; background: color-mix(in srgb, var(--signal) 16%, transparent); color: var(--signal); }
.lpath b { display: block; font-size: 16px; margin-bottom: 3px; }
.lpath small { display: block; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.lturns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lturn { display: block; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--signal) 10%, var(--panel)), var(--panel) 60%); color: inherit; text-decoration: none; }
.lturn small { font-size: 12.5px; font-weight: 700; color: var(--signal); }
.lturn b { display: block; font-size: 19px; margin: 6px 0; }
.lturn p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.lterms { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: inherit; text-decoration: none; }
.lterms span { flex: 1; } .lterms b { display: block; } .lterms small { color: var(--muted); font-size: 13.5px; }

/* v17: recap */
.rcnav { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 24px; }
.rcnav a { display: grid; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: inherit; text-decoration: none; }
.rcnav small { color: var(--signal); font-weight: 650; }
.recap { max-width: 70ch; }
.recap section { scroll-margin-top: calc(var(--header) + 20px); margin-bottom: 30px; }
.recap h2 small { font-family: var(--sans, inherit); font-size: 13px; color: var(--dim); font-weight: 600; margin-left: 8px; }

/* v18: correction box */
.fixbox { margin: 36px 0 10px; display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); }
.fixbox b { display: block; margin-bottom: 3px; }
.fixbox span { font-size: 14px; color: var(--muted); line-height: 1.5; }
.fixbox .btn { flex: none; display: inline-flex; gap: 8px; align-items: center; }
@media (max-width: 600px) { .fixbox { flex-direction: column; align-items: flex-start; } }
sup.cite { font-size: 11px; margin-left: 2px; vertical-align: super; line-height: 0; }
sup.cite a { text-decoration: none; color: var(--signal); font-weight: 700; padding: 0 2px; }
sup.cite + sup.cite { margin-left: 0; }
.sources li:target { background: color-mix(in srgb, var(--signal) 12%, transparent); border-radius: 6px; }
.sources li { scroll-margin-top: calc(var(--header) + 90px); }

/* v19: dialogue stats */
.spk { list-style: none; margin: 0 0 8px; padding: 14px; display: grid; gap: 8px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); }
.spk li { display: grid; grid-template-columns: 170px 1fr 44px; gap: 12px; align-items: center; }
.spk li > a, .spk li > span:first-child { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.spk img, .spk .av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; background: var(--ink-2); }
.spk b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spk a:hover b { color: var(--signal); }
.spk .bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--paper) 7%, transparent); overflow: hidden; }
.spk .bar span { display: block; height: 100%; border-radius: inherit; background: var(--signal); }
.spk em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); text-align: right; }
.qcast em i { font-style: normal; font-size: 11px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: color-mix(in srgb, var(--paper) 10%, transparent); color: var(--muted); font-variant-numeric: tabular-nums; }
.qline .lc { font-style: normal; font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 6px; }
@media (max-width: 600px) { .spk li { grid-template-columns: 120px 1fr 36px; } }
.atabs .acts .ibtn.wide { width: auto; padding: 0 12px; display: inline-flex; gap: 6px; border-color: var(--line); color: var(--muted); }
.atabs .acts .ibtn.wide[aria-pressed="true"] { color: var(--signal-ink, #111); background: var(--signal); border-color: var(--signal); }
.atabs .acts .ibtn.wide[aria-pressed="true"] .icon { fill: none; }
@media (max-width: 900px) { .atabs .acts .ibtn.wide { width: 36px; padding: 0; justify-content: center; } }
body.gmode { overflow: hidden; }
body.gmode footer, body.gmode .foot, body.gmode .site-foot { display: none; }
/* no footer jump while the first page renders */
#app { min-height: calc(100vh - var(--header)); }
/* the header's own backdrop-filter stops the menu's blur from working, so give the menu a near-solid background */
.dd-menu { background: var(--panel) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
@media (max-width: 980px) { .dd-menu { background: none !important; } }
.openq { padding-left: 20px; } .openq li { margin: 6px 0; color: var(--muted); } .openq li::marker { color: var(--signal); }

/* light theme: accent-coloured text needs a darker yellow to stay readable on white */
body.light { --signal-text: #8a6400; }
body.light sup.cite a, body.light .rcnav small, body.light .lpath .ln, body.light .lturn small, body.light .badge.readb, body.light .qline .lc,
body.light .shelf-peek small, body.light .dd-menu .icon, body.light .tlchips .n { color: var(--signal-text); }
body.light .lpath .ln { background: color-mix(in srgb, var(--signal) 22%, transparent); }
body.light .shelf { background: linear-gradient(180deg, #e2dfe8, #f4f3f7); }
body.light .shelf-board { background: linear-gradient(180deg, #b9a48f, #8f7a66); box-shadow: 0 8px 18px #0002; }
body.light .spk .bar span, body.light .rprog .bar span { background: #d9a400; }
body.light .glayers .layers button { background: rgba(255,255,255,.9); color: var(--paper); text-shadow: none; box-shadow: 0 0 0 1px rgba(22,20,27,.08), 0 4px 12px rgba(30,20,50,.12); }
body.light .glayers .layers button:hover { background: #fff; }
body.light .glayers .layers button .n { color: var(--muted); }
body.light .glayers h2 { background: rgba(255,255,255,.9); text-shadow: none; color: var(--muted); }
/* phone: group headings wrap their note under the title; logo/tape art sits behind the title instead of colliding with it */
.group { flex-wrap: wrap; row-gap: 2px; }
.group h2 { flex: none; }
@media (max-width: 640px) {
  .group span { flex-basis: 100%; font-size: 13.5px; }
  .herocard.npc.logo .fig { height: 62%; max-width: 40%; top: 8%; bottom: auto; right: 5%; opacity: .55; }
  .herocard.npc.logo h1 { position: relative; z-index: 1; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
}
/* grid columns must be allowed to shrink below their content's width (wide scrollers like the comic rail otherwise stretch the column) */
.layout > div, .layout > aside { min-width: 0; }

/* ============ v20: React Bits ports (js/fx/bits.js) ============ */
/* Counter: rolling digits */
.rc { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.rc-d { display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; }
.rc-s { display: flex; flex-direction: column; transform: translateY(calc(var(--d) * -1.25em)); transition: transform .65s cubic-bezier(.22,1,.36,1); }
.rc-s span { display: block; height: 1.25em; text-align: center; }
.rc-instant .rc-s { transition: none; }

/* AnimatedList */
.al { opacity: 0; transform: translateY(14px) scale(.985); }
.al.al-in { opacity: 1; transform: none; transition: opacity .45s ease var(--al-d, 0ms), transform .55s cubic-bezier(.22,1,.36,1) var(--al-d, 0ms); }
#searchRes a.al { transform: translateX(-8px); }
#searchRes a.al.al-in { transform: none; }
@media print { .al { opacity: 1 !important; transform: none !important; } }

/* GlareHover */
.glare { position: relative; overflow: hidden; }
.glare::before { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background: linear-gradient(-45deg, transparent 42%, rgba(255,255,255,.42) 50%, transparent 58%); background-size: 260% 260%; background-position: 110% 110%; transition: background-position .8s cubic-bezier(.22,1,.36,1); }
.glare:hover::before, .glare:focus-visible::before { background-position: -10% -10%; }
.vcase .vbox.glare { overflow: visible; }
.vcase .vbox.glare::before { transform: translateZ(calc(var(--s) + 1px)); }
body.reduce .glare::before { display: none; }

/* Stack */
#stk { max-width: 400px; margin: 14px auto 8px; user-select: none; -webkit-user-select: none; }
.stk-deck { position: relative; aspect-ratio: 3 / 4; }
.stk-card { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); touch-action: none;
  background: radial-gradient(80% 70% at 50% 40%, color-mix(in srgb, var(--signal) 12%, var(--panel-2)), var(--panel)); box-shadow: 0 22px 44px -20px rgba(0,0,0,.75);
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .3s; }
.stk-card.stk-top { cursor: grab; } .stk-card.stk-top:active { cursor: grabbing; }
.stk-card:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.stk-card img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.stk-foot { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.stk-foot .ibtn { font-size: 20px; line-height: 1; }
.stk-cap { font-size: 14px; color: var(--muted); min-width: 0; max-width: 260px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.galall { font-size: 18px; margin: 30px 0 12px; }

/* ProfileCard hero */
.pchero { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 30px; align-items: end; margin: 4px 0 14px; }
.pcard { --px: 50%; --py: 50%; position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; perspective: 900px; color: #fff; text-align: left; }
.pcard::before { content: ''; position: absolute; inset: 6% 4%; border-radius: 30px; background: radial-gradient(circle at var(--px) var(--py), var(--ac), transparent 70%); filter: blur(42px); opacity: .4; transition: opacity .45s; }
.pcard.pc-on::before { opacity: .85; }
.pc-inner { position: relative; display: block; aspect-ratio: .72; border-radius: 26px; overflow: hidden; transition: transform .6s cubic-bezier(.22,1,.36,1);
  background: radial-gradient(90% 70% at 50% 25%, color-mix(in srgb, var(--ac) 35%, #241c2e), #0e0c13); box-shadow: 0 30px 60px -24px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.1); }
.pc-bg { position: absolute; inset: 0; background: center 25%/cover; opacity: .38; mix-blend-mode: luminosity; }
.pc-fig { position: absolute; left: 50%; bottom: 0; height: 94%; width: auto; max-width: none; transform: translateX(-50%); filter: drop-shadow(0 14px 30px rgba(0,0,0,.6)); }
.pc-shine { position: absolute; inset: 0; opacity: 0; mix-blend-mode: color-dodge; transition: opacity .45s;
  background:
    repeating-linear-gradient(0deg, hsl(2,100%,73%) 5%, hsl(53,100%,69%) 10%, hsl(93,100%,69%) 15%, hsl(176,100%,76%) 20%, hsl(228,100%,74%) 25%, hsl(283,100%,73%) 30%, hsl(2,100%,73%) 35%) 0 var(--py) / 200% 700%,
    repeating-linear-gradient(-45deg, #0e152e 0%, hsl(180,10%,60%) 3.8%, hsl(180,29%,66%) 4.5%, hsl(180,10%,60%) 5.2%, #0e152e 10%, #0e152e 12%) var(--px) var(--py) / 300%;
  background-blend-mode: color, hard-light; filter: brightness(.7) contrast(1.4) saturate(.6); }
.pcard.pc-on .pc-shine { opacity: .45; }
.pc-glare { position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .55; background: radial-gradient(farthest-corner circle at var(--px) var(--py), rgba(255,255,255,.6) 8%, rgba(140,140,160,.18) 40%, transparent 85%); }
.pc-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 9px; border-radius: 16px;
  background: rgba(14,12,20,.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.12); }
.pc-bar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.pc-bar b { display: block; font-size: 14px; } .pc-bar small { display: block; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.pc-btn { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.22); }
.pcard:focus-visible .pc-inner { outline: 2px solid var(--signal); outline-offset: 4px; }
.pc-side { padding-bottom: 10px; min-width: 0; }
.pc-side .kick { display: flex; gap: 6px; margin-bottom: 6px; }
.pc-side h1 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 5.2vw, 72px); line-height: 1; margin: 0; overflow-wrap: break-word; text-wrap: balance; }
.pc-side .full { margin-top: 10px; color: var(--muted); font-size: 17px; }
.pc-side .marks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pc-side .marks > * { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; color: var(--paper); text-decoration: none; }
.pc-side .marks a:hover { border-color: var(--signal); }
.pc-side .marks .glyph, .pc-side .marks svg, .pc-side .marks img { width: 20px; height: 20px; }
@media (max-width: 760px) { .pchero { grid-template-columns: 1fr; gap: 18px; } .pcard { max-width: 300px; margin: 0 auto; } .pc-side { text-align: center; } .pc-side .kick, .pc-side .marks { justify-content: center; } }

/* v21: VHS cassette (timeline deck) */
.deck .cassette { display: block; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.deck .cassette .window { display: none; }
.vhs { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(0,0,0,.55)); overflow: visible; }
.vhs .reel { width: auto; height: auto; }
.vhs .reel .tape-wind { fill: #2a1f17; stroke: #3a2b20; stroke-width: 1; transition: r .6s cubic-bezier(.22,1,.36,1); }
.vhs .reel .hub { transform-box: fill-box; transform-origin: center; transform: rotate(var(--rot)); transition: transform .9s cubic-bezier(.22,1,.36,1); }
.vhs .reel .hub circle:first-child { fill: #ece6d8; }
.vhs .reel .hub rect { fill: #0c0b10; }
.vhs .reel .axle { fill: var(--signal); }
.vhs-tape { stroke: #2a1f17; stroke-width: 3; fill: none; }
.vhs-roller { fill: #2a2732; stroke: #4a4656; stroke-width: 1.2; }
.vhs-screw circle { fill: #34303e; stroke: #121016; stroke-width: 1; }
.vhs-screw path { stroke: #121016; stroke-width: 1.1; }
.vhs-brand { font-family: var(--display); font-size: 11px; fill: #1a1820; letter-spacing: .02em; }
.vhs-spec { font: 700 8.5px var(--body, sans-serif); fill: #7a7384; letter-spacing: .06em; }
.vhs-title { font-family: var(--display); font-size: 14.5px; fill: #26222e; }
.vhs-arrows { font-size: 7px; fill: #4a4656; letter-spacing: 2px; }
.deck-top { gap: 14px; }
@media (max-width: 960px) { .deck .cassette { padding: 0; } .deck-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 600px) { .deck-top { grid-template-columns: 1fr; } .deck .cassette { max-width: 320px; margin: 0 auto; width: 100%; } }
/* row art fills the row instead of sizing it (tall tape covers made rows huge) */
.chapter .art { min-height: 190px; overflow: hidden; }
.chapter .art img { position: absolute; inset: 0; object-position: center 30%; }
@media (max-width: 720px) { .chapter .art { min-height: 0; } }
.modelnote { font-size: 12.5px; margin: 8px 0 0; max-width: 320px; }
.dbitem-side { position: sticky; top: calc(var(--header) + 20px); align-self: start; }
.dbitem-side .dbitem-art { position: static; width: 100%; }
@media (max-width: 800px) { .dbitem-side { position: static; max-width: 320px; } }

/* v22: live next-patch pill on the home hero (data from GachaStatus) */
.next-patch { display: inline-flex; align-items: center; gap: 9px; margin-top: 12px; padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--paper); background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid color-mix(in srgb, #ffd21f 45%, var(--line)); text-decoration: none; backdrop-filter: blur(6px); transition: border-color .2s; }
.next-patch[hidden] { display: none; }
.next-patch:hover { border-color: #ffd21f; }
.next-patch .np-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd21f; box-shadow: 0 0 0 4px rgba(255,210,31,.18); }
.next-patch .np-src { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* v23: upcoming agents */
.upbadge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--signal-ink); background: var(--signal); }
.acard .upcard { position: absolute; left: 10px; top: 10px; z-index: 3; box-shadow: 0 4px 14px -6px #000a; }
.pc-side .kick .upbadge { margin-left: 8px; }
.prose .inline-art { float: right; width: min(220px, 40%); margin: 4px 0 14px 22px; }
.prose .inline-art img { width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
.prose .inline-art figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
@media (max-width: 640px) { .prose .inline-art { float: none; width: 60%; margin: 8px auto 16px; } }
/* v24: TV screens show the agent's portrait over a blurred, dimmed scene so nobody gets cropped badly */
.tv .screen img.bg { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(14px) saturate(1.15) brightness(.55); transform: scale(1.04); animation: none; }
.tv .screen img.fg { position: relative; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.tv:not([data-tv="0"]) .screen img.fg { object-position: center 8%; }

/* v25: design pass */
/* 1. agent hero: attribute-coloured glow behind the card and a slight parallax on the art */
.pchero { position: relative; isolation: isolate; }
.pchero::before { content: ""; position: absolute; z-index: -1; left: -6%; top: -10%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ac, var(--signal)) 38%, transparent), transparent); filter: blur(30px); opacity: .85; pointer-events: none; }
.pcard .pc-fig { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.pcard.pc-on .pc-fig { transform: translate(calc((50% - var(--px, 50%)) * .06), calc((50% - var(--py, 50%)) * .04)) scale(1.03); }
@media (prefers-reduced-motion: reduce) { .pcard.pc-on .pc-fig { transform: none; } }

/* 4. search: grouped results with a preview panel on wide screens */
.sdlg.has-pv { width: min(980px, 96vw); }
.sdlg.has-pv[open] { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "box box" "res pv" "foot foot"; }
.sdlg.has-pv .sbox { grid-area: box; } .sdlg.has-pv .sres { grid-area: res; } .sdlg.has-pv .sfoot { grid-area: foot; }
.spv { grid-area: pv; border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: min(60vh, 520px); overflow: hidden; }
.spv:empty { display: none; }
.spv-art { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.spv-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.spv-g { font-size: 12px; font-weight: 700; color: var(--signal); }
.spv b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.spv p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 760px) { .sdlg.has-pv[open] { display: block; } .spv { display: none; } }

/* 6. channel-change flicker between pages */
body.chswap::after { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 1px, transparent 1px 3px), linear-gradient(rgba(22,20,27,.0), rgba(22,20,27,.0));
  animation: chswap .32s steps(4, end) both; }
@keyframes chswap { 0% { opacity: .9; transform: translateY(-2px); background-color: rgba(22,20,27,.55); } 40% { opacity: .55; transform: translateY(1px); } 100% { opacity: 0; transform: none; background-color: transparent; } }
@media (prefers-reduced-motion: reduce) { body.chswap::after { display: none; } }

/* 7. CRT "no signal" while art loads */
.tv .screen img.fg:not(.ld), .acard .art:not(.ld), .poster > img:not(.ld), .pc-fig:not(.ld), .dbitem-art img:not(.ld), .chapter .art img:not(.ld) {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='40'%3E%3Ctext x='80' y='26' font-family='monospace' font-size='15' font-weight='700' letter-spacing='3' fill='%23746e80' text-anchor='middle'%3ENO SIGNAL%3C/text%3E%3C/svg%3E") center / 140px no-repeat, repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px), #15131a; }
