:root {
  --bg: #0e0d11;
  --panel: #15141a;
  --panel-2: #1c1b22;
  --line: #2a2832;
  --line-2: #36333f;
  --text: #f2eff4;
  --muted: #a39dac;
  --dim: #6f6979;
  --accent: #ff4f7b;
  --accent-2: #ff8aa6;
  --accent-ink: #22060f;
  --good: #73d99f;
  --warn: #ffb35c;
  --display: "Dela Gothic One", "Arial Black", sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 8px;
  --bar-h: 56px;
  font-family: var(--body);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ───────────── Watch page ───────────── */

body.watch {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.primary, .ghost, .link-btn {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}
.primary {
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
}
.primary:hover:not(:disabled) { background: var(--accent-2); }
.primary:disabled { opacity: 0.45; cursor: default; }
.ghost {
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.ghost:hover { background: var(--panel-2); }
.small { padding: 6px 10px; font-size: 12px; }
.link-btn { background: none; padding: 4px 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.link-btn:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow, .rail-head h2, .cast-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint { font-size: 12px; color: var(--dim); }

/* top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--bar-h);
  padding: 0 16px;
  background: rgba(14, 13, 17, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.mark {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.mark b { font-weight: 400; color: var(--accent); }
.onair { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.ep { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.watching { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.watching::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--good); vertical-align: 1px; }
.me { position: relative; }
.who-am-i {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  font-weight: 700;
}
.who-am-i .dot, .chat-name .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.menu-wallet { margin: 0 0 10px; color: var(--dim); font-size: 12px; font-family: ui-monospace, monospace; word-break: break-all; }
.rename label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.rename .row { display: flex; gap: 6px; }
.rename input { flex: 1; min-width: 0; }
.menu-item { display: block; width: 100%; margin-top: 10px; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--muted); cursor: pointer; }
.menu-item:hover { color: var(--text); }

input, select {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
input:focus, select:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
input:disabled { opacity: 0.6; }

/* layout: the picture first, the audience on the right */
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: calc(100vh - var(--bar-h));
}
.screen { min-width: 0; padding: 16px 20px 28px; }
.screen .theater {
  width: min(100%, calc((100vh - var(--bar-h) - 150px) * 16 / 9));
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}
body.theater-mode .stage-grid { grid-template-columns: minmax(0, 1fr); }
body.theater-mode .rail { display: none; }
body.theater-mode .screen .theater { width: min(100%, calc((100vh - var(--bar-h) - 110px) * 16 / 9)); }

.scene-bar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: min(100%, calc((100vh - var(--bar-h) - 150px) * 16 / 9));
  margin: 14px auto 0;
}
body.theater-mode .scene-bar { max-width: min(100%, calc((100vh - var(--bar-h) - 110px) * 16 / 9)); }
.now { min-width: 0; flex: 1; }
.now h1 { margin: 2px 0 2px; font-size: 20px; font-weight: 900; line-height: 1.25; letter-spacing: 0.01em; }
.now .sub { margin: 0; color: var(--muted); font-size: 13px; }
.now .sub:empty { display: none; }
.screen-tools { display: flex; gap: 6px; flex: none; }

/* cast strip */
.cast { max-width: min(100%, calc((100vh - var(--bar-h) - 150px) * 16 / 9)); margin: 22px auto 0; }
body.theater-mode .cast { max-width: min(100%, calc((100vh - var(--bar-h) - 110px) * 16 / 9)); }
.cast-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.person {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}
.person.speaking { box-shadow: inset 0 0 0 1px var(--c, var(--accent)); }
.face {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--panel-2);
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px var(--c, var(--line-2));
}
.face.made {
  background: radial-gradient(circle at 50% 120%, var(--skin) 0 46%, transparent 47%), var(--hair);
}
.face.made::before, .face.made::after {
  content: "";
  position: absolute;
  top: 56%;
  width: 7px;
  height: 9px;
  border-radius: 50%;
  background: var(--eyes);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
}
.face.made::before { left: 18px; }
.face.made::after { right: 18px; }
.face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.person-info { min-width: 0; }
.person-name { display: flex; align-items: baseline; gap: 6px; margin: 0; font-weight: 900; font-size: 15px; }
.person-name small { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c, var(--accent)); }
.person-meta { margin: 1px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tie { margin: 3px 0 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tie-love { color: var(--accent-2); }
.tie-hate { color: var(--warn); }
.mood { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; background: var(--dim); }
.mood.happy { background: var(--good); }
.mood.angry { background: #ff6b5a; }
.mood.sad { background: #6aa8ff; }
.mood.nervous { background: var(--warn); }
.mood.smug { background: #c58cff; }
.mood.surprised { background: #ffe066; }
.add-person {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.add-person:hover { color: var(--text); border-color: var(--accent); }
.add-person .plus { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%; border: 1px dashed var(--line-2); font-size: 26px; color: var(--accent); }
.add-person strong { display: block; color: var(--text); }

/* right rail */
.rail {
  position: sticky;
  top: var(--bar-h);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bar-h));
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ballot { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 0; list-style: none; }
.option {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
}
.option:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.option .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 79, 123, 0.14); transition: width 0.4s ease; }
.option.lead .fill { background: rgba(255, 79, 123, 0.28); }
.option .label { position: relative; display: block; font-weight: 700; font-size: 13px; line-height: 1.2; }
.option .count { position: relative; display: block; margin-top: 2px; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.option.mine { box-shadow: inset 0 0 0 1px var(--accent); }
.option.mine .count::after { content: " · your vote"; color: var(--accent-2); }
.options .extra { display: none; }
.options.all .extra { display: block; }

.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 14px 16px 12px; }
.feed { flex: 1; min-height: 0; margin: 0; padding: 0 2px 0 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.feed li { padding: 5px 0; overflow-wrap: anywhere; }
.chat-name { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; font-weight: 900; }
.chat-name .dot { width: 8px; height: 8px; }
.feed .sys { color: var(--dim); font-size: 12px; }
.feed .sys::before { content: "— "; }
.feed .scene-line { color: var(--muted); font-size: 12px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.feed .scene-line b { color: var(--text); }
.composer { margin-top: 10px; }
.compose-row { display: flex; gap: 6px; }
.compose-row input { flex: 1; min-width: 0; }
.cooldown { height: 2px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cooldown i { display: block; height: 100%; width: 0; background: var(--accent); }

/* drop overlay, dialogs, toasts */
.dropzone {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(14, 13, 17, 0.82);
  pointer-events: none;
}
.dropzone div {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 48px 64px;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  text-align: center;
}
.dropzone strong { font-size: 22px; font-weight: 900; }
.dropzone span { color: var(--muted); }

.sheet {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, 0.6);
}
.sheet.narrow { width: min(440px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgba(5, 4, 8, 0.7); }
.sheet form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.sheet header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet h2 { margin: 0; font-size: 16px; font-weight: 900; }
.x { width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.x:hover { background: var(--panel-2); color: var(--text); }
.sheet footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.lede { margin: 16px 18px 0; color: var(--muted); }
.status { margin: 0; color: var(--muted); font-size: 13px; }
.status.error { color: #ff8a7a; }
.status.ok { color: var(--good); }
.sheet .status:not(:empty) { margin: 0 18px 16px; }
.sheet footer .status:not(:empty) { margin: 0; }

.cast-body { display: grid; grid-template-columns: 240px 1fr; gap: 18px; padding: 18px; overflow-y: auto; }
.art-drop {
  position: relative;
  display: grid;
  place-items: center;
  height: 300px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg) repeating-conic-gradient(#17161c 0 25%, #121116 0 50%) 50% / 20px 20px;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}
.art-drop img { max-height: 100%; object-fit: contain; }
.art-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.swatches span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.swatches i { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.fields { display: grid; gap: 12px; align-content: start; }
.fields > label, .pair label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.fields input, .fields select { color: var(--text); font-size: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; gap: 6px; margin: 0; padding: 0; border: 0; }
.seg legend { margin-bottom: 4px; padding: 0; font-size: 12px; color: var(--muted); }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; font-size: 13px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fine { margin: 0; color: var(--dim); font-size: 12px; }

.wallets { display: grid; gap: 8px; margin: 16px 18px; padding: 0; list-style: none; }
.wallet-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}
.wallet-btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.wallet-btn small { color: var(--dim); font-weight: 500; }
.about { display: grid; gap: 12px; margin: 16px 18px 20px; padding-left: 18px; color: var(--muted); }
.about b { color: var(--text); }

.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 10px 14px; border-radius: var(--radius); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 12px 30px rgba(0, 0, 0, 0.5); animation: toast-in 0.25s ease both; }
.toast.error { box-shadow: inset 0 0 0 1px #8a3a34, 0 12px 30px rgba(0, 0, 0, 0.5); }
.toast.ok { box-shadow: inset 0 0 0 1px #2f6a4a, 0 12px 30px rgba(0, 0, 0, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1000px) {
  /* On phones the audience controls sit right under the picture; the cast scrolls sideways below. */
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .screen { display: contents; }
  .screen .theater { order: 1; width: 100%; }
  .scene-bar { order: 2; max-width: none; margin: 12px 0 14px; padding: 0 16px; }
  .rail { order: 3; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
  .cast { order: 4; max-width: none; margin: 0; padding: 16px 16px 28px; border-top: 1px solid var(--line); }
  .cast-list { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(210px, 70vw); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .cast-list > li { scroll-snap-align: start; }
  .chat { height: 60vh; }
  .ep { display: none; }
  #about-open { display: none; }
  .cast-body { grid-template-columns: 1fr; }
  .art-drop { height: 220px; }
}
@media (max-width: 560px) {
  .bar { gap: 10px; padding: 0 12px; }
  .cast-head .hint { display: none; }
  .watching { display: none; }
  .screen-tools { display: none; }
  .pair { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .live i, .toast, .card { animation: none; }
  .option .fill { transition: none; }
}

/* ───────────── Stage overlay (watch page and broadcast feed) ───────────── */

.theater {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  container-type: size;
  color: #fff;
}

.stage-stack {
  position: relative;
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
  container-type: size;
  background: #09080b;
  border-radius: 10px;
  overflow: hidden;
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #09080b;
}

.town-load {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: #09080b;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b9b2c4;
}

.stage-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 62%, rgba(0, 0, 0, 0.38) 100%);
}

.bug, .place, .next, .hud-clock, .card, .subtitle, .sound {
  position: absolute;
  z-index: 2;
}

.place {
  top: 2.6cqi;
  left: 2.6cqi;
  padding: 0.5cqi 1.1cqi;
  border-radius: 0.5cqi;
  background: rgba(10, 9, 13, 0.62);
  font-family: var(--body);
  font-size: max(11px, 1.15cqi);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bug {
  top: 2.6cqi;
  right: 2.6cqi;
  display: flex;
  align-items: center;
  gap: 0.6cqi;
  padding: 0.4cqi 1cqi;
  border-radius: 0.5cqi;
  background: #ff4f7b;
  color: #22060f;
  font-family: var(--body);
  font-size: max(11px, 1.1cqi);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.rec {
  width: max(6px, 0.55cqi);
  height: max(6px, 0.55cqi);
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

.hud-clock {
  top: calc(2.6cqi + max(26px, 2.8cqi));
  right: 2.6cqi;
  padding: 0.25cqi 0.8cqi;
  border-radius: 0.4cqi;
  background: rgba(10, 9, 13, 0.62);
  font-family: var(--body);
  font-size: max(10px, 1cqi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hud-clock:empty { display: none; }

.theater .next {
  top: calc(2.6cqi + max(52px, 5.4cqi));
  right: 2.6cqi;
  max-width: 34%;
  padding: 0.4cqi 0.9cqi;
  border-radius: 0.4cqi;
  text-align: right;
  background: rgba(10, 9, 13, 0.62);
  font-family: var(--body);
  font-size: max(11px, 1.1cqi);
  font-weight: 700;
}

.card {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  padding: 1.2cqi 3.2cqi 1.4cqi;
  border-radius: 0.8cqi;
  text-align: center;
  background: rgba(10, 9, 13, 0.72);
  font-family: var(--display);
  font-size: max(18px, 3.4cqi);
  line-height: 1.15;
  animation: card-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card::before {
  content: "Now playing";
  display: block;
  margin-bottom: 0.5cqi;
  font-family: var(--body);
  font-size: max(9px, 0.95cqi);
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #ff8aa6;
}
@keyframes card-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.subtitle {
  left: 50%;
  bottom: 4.5cqi;
  transform: translateX(-50%);
  width: min(78%, 1500px);
  text-align: center;
}
.who {
  display: inline-block;
  margin-bottom: 0.5cqi;
  padding: 0.15cqi 0.8cqi;
  border-radius: 0.4cqi;
  background: rgba(10, 9, 13, 0.78);
  font-family: var(--body);
  font-size: max(11px, 1.15cqi);
  font-weight: 900;
  letter-spacing: 0.06em;
}
.subtitle p {
  margin: 0;
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(15px, 2.6cqi, 48px);
  line-height: 1.3;
  color: #fff;
  -webkit-text-stroke: 0.14cqi #0b0a0e;
  paint-order: stroke fill;
  text-shadow: 0 0.2cqi 0.6cqi rgba(0, 0, 0, 0.6);
}

.sound {
  left: 2.6cqi;
  bottom: 2.6cqi;
  border: 0;
  border-radius: 0.5cqi;
  background: #fff;
  color: #0e0d11;
  padding: 0.6cqi 1.2cqi;
  font: 700 max(12px, 1.1cqi) var(--body);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .rec { animation: none; }
}

/* ───────────── Broadcast output (streamed to Twitch) ───────────── */

body.broadcast {
  background: #000;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: var(--body);
}

body.broadcast .theater {
  margin: 0;
  width: 100vw;
  height: 100vh;
}

body.broadcast .stage-stack {
  border-radius: 0;
}

body.broadcast #link {
  position: absolute;
  right: 1.6vw;
  bottom: 1.2vh;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* ---- stream player controls (watch page): pause, mute, volume. Shown on hover / focus and
   always while paused, like a Twitch player. */
.player-bar {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: max(6px, 0.8cqi);
  padding: max(16px, 2.4cqi) max(8px, 1.4cqi) max(6px, 0.9cqi);
  background: linear-gradient(to top, rgba(8, 7, 10, 0.78), rgba(8, 7, 10, 0));
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.stage-stack:hover .player-bar,
.stage-stack:focus-within .player-bar,
.stage-stack.paused .player-bar {
  opacity: 1;
}
/* subtitles step up out of the way while the bar is showing */
.stage-stack:hover .subtitle,
.stage-stack:focus-within .subtitle,
.stage-stack.paused .subtitle {
  transform: translate(-50%, max(-36px, -4cqi));
}
.subtitle {
  transition: transform 0.2s ease;
}
.pb-btn {
  display: grid;
  place-items: center;
  width: max(32px, 3.2cqi);
  height: max(32px, 3.2cqi);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.pb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.pb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pb-btn svg {
  width: 62%;
  height: 62%;
  fill: currentColor;
}
.pb-btn .i-play, .pb-btn.is-paused .i-pause { display: none; }
.pb-btn.is-paused .i-play { display: block; }
.pb-btn .i-muted, .pb-btn.is-muted .i-sound { display: none; }
.pb-btn.is-muted .i-muted { display: block; }
.pb-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pb-vol {
  --fill: 80%;
  width: max(70px, 8cqi);
  height: 4px;
  appearance: none;
  border-radius: 2px;
  background: linear-gradient(to right, #fff var(--fill), rgba(255, 255, 255, 0.3) var(--fill));
  cursor: pointer;
}
.pb-vol::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}
.pb-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
.pb-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: max(4px, 0.6cqi);
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 700 max(11px, 1cqi) var(--body);
  letter-spacing: 0.06em;
  cursor: default;
}
.pb-live.away { cursor: pointer; background: rgba(255, 255, 255, 0.14); }
.pb-live.away .pb-dot { background: var(--dim); }
.pb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.stage-stack.paused .pb-dot { background: var(--dim); }
.paused-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(8, 7, 10, 0.35);
  cursor: pointer;
}
.paused-overlay[hidden] { display: none; }
.paused-overlay svg {
  width: max(56px, 7cqi);
  height: max(56px, 7cqi);
  padding: max(12px, 1.4cqi);
  border-radius: 50%;
  background: rgba(8, 7, 10, 0.6);
  fill: #fff;
}
/* the old "Tap for sound" pill sits above the bar */
.sound { bottom: max(52px, 6cqi); }
@media (hover: none) {
  .player-bar { opacity: 1; }
}

/* casting: the name is the only field besides the picture */
.cast-form .optional {
  color: var(--dim);
  font-weight: 400;
}

/* character coins */
.coin-body {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 20px 4px;
}
.coin-portrait {
  width: 160px;
  height: 160px;
  flex: none;
  border-radius: 12px;
  background: var(--panel-2);
  object-fit: cover;
}
.coin-portrait:not([src]) { visibility: hidden; }
.coin-body .fields { flex: 1; display: grid; gap: 12px; }
.coin-form > .fine { padding: 8px 20px 0; }
.coin-tag {
  color: var(--good);
  font-weight: 700;
  text-decoration: none;
}
.coin-tag:hover { text-decoration: underline; }
.coin-launch {
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-2);
  font: 600 11px var(--body);
  cursor: pointer;
}
.coin-launch:hover { border-color: var(--accent); }
@media (max-width: 520px) {
  .coin-body { flex-direction: column; align-items: stretch; }
  .coin-portrait { align-self: center; }
}

/* camera menu, free roam hint, character card (watch page) */
.pb-cam {
  width: auto;
  margin-left: auto;
  padding: 0 10px;
  gap: 6px;
  display: inline-flex;
  font: 600 max(12px, 1.05cqi) var(--body);
}
.pb-cam svg { width: 18px; height: 18px; }
.cam-menu {
  position: absolute;
  z-index: 4;
  right: max(8px, 1.4cqi);
  bottom: max(52px, 6cqi);
  width: min(260px, 70%);
  max-height: 70%;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(14, 13, 17, 0.94);
  color: var(--text);
}
.cam-menu[hidden] { display: none; }
.cam-menu h3 {
  margin: 8px 8px 4px;
  color: var(--muted);
  font: 700 11px var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cam-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 500 13px var(--body);
  text-align: left;
  cursor: pointer;
}
.cam-menu button:hover, .cam-menu button:focus-visible { background: rgba(255, 255, 255, 0.08); outline: none; }
.cam-menu button[aria-checked="true"] { color: var(--accent-2); }
.cam-menu .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.cam-menu .none { margin: 4px 10px 8px; color: var(--dim); font-size: 12px; }
.roam-hint {
  position: absolute;
  z-index: 3;
  top: max(10px, 2.6cqi);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 9, 13, 0.72);
  color: #fff;
  font: 600 max(11px, 1cqi) var(--body);
  white-space: nowrap;
  pointer-events: none;
}
.roam-hint[hidden] { display: none; }
.char-card {
  position: absolute;
  z-index: 4;
  top: max(44px, 6cqi);
  left: max(10px, 2.6cqi);
  width: min(280px, 60%);
  padding: 14px;
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--c, var(--accent));
  border-radius: 10px;
  background: rgba(14, 13, 17, 0.94);
  color: var(--text);
}
.char-card[hidden] { display: none; }
.char-card h3 { margin: 0 0 2px; font: 800 18px var(--body); }
.char-card .role { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.char-card .meta { margin: 0 0 8px; font-size: 13px; }
.char-card ul { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.char-card li { display: flex; justify-content: space-between; gap: 8px; }
.char-card .love { color: #ff8aa6; }
.char-card .hate { color: #8fb6ff; }
.char-card .actions { display: flex; gap: 8px; }
.char-card .x { position: absolute; top: 6px; right: 6px; }
@media (max-width: 600px) {
  .roam-hint { white-space: normal; width: 90%; text-align: center; }
}
.roam-hint:not([hidden]) ~ .char-card { top: max(48px, 6.4cqi); }

/* always-visible camera rail on the video (watch page) */
.cam-rail {
  position: absolute;
  z-index: 3;
  top: max(10px, 2.6cqi);
  right: max(10px, 2.6cqi);
  display: grid;
  gap: 6px;
  width: max(128px, 13cqi);
}
.cam-rail button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(6px, 0.6cqi) max(10px, 0.9cqi);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 9, 13, 0.62);
  color: #fff;
  font: 600 max(11px, 1cqi) var(--body);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.cam-rail button:hover { background: rgba(10, 9, 13, 0.82); border-color: rgba(255, 255, 255, 0.32); }
.cam-rail button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cam-rail .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.cam-rail svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.cam-tip {
  position: absolute;
  z-index: 5;
  top: max(10px, 2.6cqi);
  right: calc(max(128px, 13cqi) + max(20px, 3.6cqi));
  width: min(260px, 45%);
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 13px var(--body);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.cam-tip[hidden] { display: none; }
.cam-tip p { margin: 0 0 10px; }
.cam-tip::after {
  content: "";
  position: absolute;
  top: 16px;
  right: -7px;
  border: 7px solid transparent;
  border-right: 0;
  border-left-color: var(--accent);
}
.cam-tip .primary { background: var(--accent-ink); color: #fff; }
@media (max-width: 700px) {
  .cam-rail { width: auto; grid-auto-flow: column; top: auto; bottom: max(52px, 6cqi); right: 8px; left: 8px; overflow-x: auto; }
  .cam-tip { right: 8px; left: 8px; width: auto; top: auto; bottom: max(96px, 12cqi); }
  .cam-tip::after { display: none; }
}

/* ───────────── Hub layout (watch page): video + panels on the left, the town on the right ───────────── */
.nav-tabs { display: flex; align-items: center; gap: 4px; }
.nav-tabs a, .nav-tabs .soon {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-tabs a:hover { color: var(--text); background: var(--panel-2); }
.nav-tabs a.on { color: var(--accent-2); background: rgba(255, 79, 123, 0.12); }
.nav-tabs .soon { color: var(--dim); cursor: default; }
.nav-tabs .soon::after { content: " · soon"; text-transform: none; letter-spacing: 0; font-weight: 500; }
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 260px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.search svg { width: 16px; height: 16px; fill: var(--dim); flex: none; }
.search input { flex: 1; min-width: 0; padding: 7px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; }
.search input:focus { box-shadow: none; }
.search:focus-within { border-color: var(--accent); }
.bar .bar-end { margin-left: 0; }

.hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px;
}
.hub-main, .hub-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.hub-main .theater { width: 100%; aspect-ratio: 16 / 9; }
body.theater-mode .hub { grid-template-columns: minmax(0, 1fr); }
body.theater-mode .hub-side { display: none; }
body.theater-mode .hub-main .theater { width: min(100%, calc((100vh - var(--bar-h) - 40px) * 16 / 9)); margin: 0 auto; }

.panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2, .panel h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.panel h3 { margin-bottom: 8px; font-size: 11px; }
.sub-head { margin-bottom: 8px; }
.panel .soon { padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--dim); font-size: 11px; font-weight: 700; }
.seg-tabs { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--panel-2); }
.seg-tabs button {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: 700 12px var(--body);
  cursor: pointer;
}
.seg-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* the episode chip on the picture (top left), the place under it */
.ep-chip {
  position: absolute;
  z-index: 2;
  top: 2.6cqi;
  left: 2.6cqi;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 60%;
  padding: 6px 10px 6px 6px;
  border-radius: 8px;
  background: rgba(10, 9, 13, 0.62);
  backdrop-filter: blur(4px);
}
.ep-chip .ep-title { display: grid; min-width: 0; }
.ep-chip .ep { color: #fff; font-size: max(12px, 1.15cqi); font-weight: 900; }
.ep-chip .watching { font-size: max(11px, 0.95cqi); color: rgba(255, 255, 255, 0.75); }
.stage-stack .place { top: calc(2.6cqi + max(46px, 5.4cqi)); }
.stage-stack .char-card { top: calc(2.6cqi + max(80px, 9.4cqi)); }

/* current scene + live events */
.hub-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.scene-now { margin: -4px 0 10px; font-size: 14px; }
.scene-now .sub { color: var(--muted); font-size: 12px; }
.scene-now .sub:empty { display: none; }
.scene-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.scene-strip li {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.scene-strip li.now { box-shadow: 0 0 0 2px var(--accent); }
.scene-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-strip span {
  position: absolute;
  inset: auto 0 0;
  padding: 14px 6px 4px;
  background: linear-gradient(to top, rgba(8, 7, 10, 0.85), transparent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scene-strip .empty { display: grid; place-items: center; color: var(--dim); font-size: 11px; }
.event-feed { display: grid; gap: 6px; max-height: 190px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.event-feed li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.event-feed .ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--panel-2); font-size: 12px; }
.event-feed .when { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.event-feed .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-feed .none { display: block; color: var(--dim); font-size: 12px; }

/* interact */
.interact-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.2fr); gap: 14px; }
.pick { display: grid; gap: 8px; align-content: start; }
.pick label { display: grid; gap: 3px; color: var(--dim); font-size: 11px; font-weight: 700; }
.pick select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.quick-grid button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: 700 12px var(--body);
  cursor: pointer;
}
.quick-grid button span { font-size: 18px; line-height: 1; }
.quick-grid button:hover { border-color: var(--accent); }
.quick-grid button:disabled { opacity: 0.45; cursor: default; }
.quick .hint { margin: 8px 0 0; min-height: 1.4em; }
.write { display: grid; gap: 6px; align-content: start; }
.write textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.write textarea:focus { outline: none; border-color: var(--accent); }
.write-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.write p.hint { margin: 0; }
.mine-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mine-list li { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.mine-list .pic { width: 44px; height: 44px; flex: none; border-radius: 8px; background: var(--c, var(--accent)) center / cover no-repeat; }
.mine-list .who { flex: 1; min-width: 0; }
.mine-list .who b { display: block; }
.mine-list .who span { color: var(--muted); font-size: 12px; }
.mine-list .empty { display: block; padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* the live map */
.world-map {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2) center / cover no-repeat;
}
.map-load { display: grid; place-items: center; height: 100%; color: var(--dim); font-size: 12px; }
.map-place {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(10, 9, 13, 0.72);
  color: #fff;
  font: 700 11px var(--body);
  white-space: nowrap;
  cursor: pointer;
}
.map-place:hover { background: rgba(10, 9, 13, 0.9); }
.map-place.live { background: var(--accent); color: var(--accent-ink); }
.map-pin {
  position: absolute;
  z-index: 2;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  padding: 0;
  border: 2px solid var(--c, var(--accent));
  border-radius: 50%;
  background: var(--panel) center / cover no-repeat;
  color: #fff;
  font: 900 12px var(--body);
  cursor: pointer;
  transition: left 0.6s ease, top 0.6s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.map-pin.here { box-shadow: 0 0 0 3px rgba(115, 217, 159, 0.6), 0 2px 8px rgba(0, 0, 0, 0.45); }
.world-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.world-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font-size: 13px; cursor: pointer; }
.world-list li.live { box-shadow: inset 0 0 0 1px var(--accent); }
.world-list .who { color: var(--muted); font-size: 12px; text-align: right; }

/* character grid */
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.pcard {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 6px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
}
.pcard:hover { border-color: var(--line-2); }
.pcard.speaking { border-color: var(--c, var(--accent)); }
.pcard .pic {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--c, var(--accent)) center / cover no-repeat;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font: 400 26px var(--display);
}
.pcard .on {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 2px var(--panel-2);
}
.pcard b { font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .tag { color: var(--c, var(--accent)); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pcard .where { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .heart { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); }
.pcard .heart i { height: 4px; border-radius: 2px; background: var(--panel); overflow: hidden; }
.pcard .heart i::before { content: ""; display: block; height: 100%; width: var(--v, 0%); background: #ff8aa6; }
.pcard .heart.hate i::before { background: #8fb6ff; }
.pcard .act { margin-top: 2px; padding: 4px 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; color: var(--text); font: 700 11px var(--body); cursor: pointer; }
.pcard .act:hover { border-color: var(--accent); }
.pcard .coin-tag, .pcard .coin-launch { justify-self: start; font-size: 11px; }
.pcard.add { place-content: center; justify-items: center; min-height: 160px; text-align: center; color: var(--muted); border-style: dashed; font-size: 12px; }
.pcard.add .plus { font-size: 26px; color: var(--accent); line-height: 1; }

/* chat panel */
.hub-side .chat { display: flex; flex-direction: column; padding: 14px; }
.hub-side .chat .feed { height: 340px; flex: none; }
.hub-side .chat .slowmode { margin: -4px 0 6px; }
.feed.chat-only li:not(.chat-line) { display: none; }
.missions .hint { margin: 0; }

@media (max-width: 1150px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .interact-grid { grid-template-columns: 1fr 1fr; }
  .write { grid-column: 1 / -1; }
  .people-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav-tabs, .search { display: none; }
  .hub { padding: 10px; gap: 10px; }
  .hub-row { grid-template-columns: 1fr; }
  .interact-grid { grid-template-columns: 1fr; }
  .scene-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ep-chip { max-width: 75%; }
}

.world-list[hidden], .world-map[hidden] { display: none; }
.hub, .panel { scroll-margin-top: calc(var(--bar-h) + 12px); }
html { scroll-behavior: smooth; }

.map-place.r { transform: translate(0, -50%); }
.map-place.l { transform: translate(-100%, -50%); }

/* ───────────── Premium pass: one icon set, calmer colour, glass panels ───────────── */
:root {
  --bg: #09080d;
  --panel: #121118;
  --panel-2: #18171f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --text: #f4f2f7;
  --muted: #a9a3b3;
  --dim: #6e6878;
  --accent: #ff5c8a;
  --accent-2: #ff9bb5;
  --violet: #8b6cff;
  --grad: linear-gradient(135deg, #ff5c8a 0%, #b45cff 60%, #7b6cff 100%);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  --body: "Inter", "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
}
body.watch {
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(255, 92, 138, 0.10), transparent 62%),
    radial-gradient(900px 520px at 100% -4%, rgba(139, 108, 255, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.005em;
}
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent; }

/* buttons: the gradient is for the one thing that matters on each panel */
.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(255, 92, 138, 0.7); border: 0; }
.primary:hover { filter: brightness(1.08); }
.ghost { border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--text); }
.ghost:hover { background: rgba(255, 255, 255, 0.07); }

/* top bar */
.bar { background: rgba(9, 8, 13, 0.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px) saturate(140%); }
.mark b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-tabs a, .nav-tabs .soon { position: relative; padding: 8px 12px; border-radius: 0; background: none !important; font-size: 12px; letter-spacing: 0.08em; }
.nav-tabs a:hover { color: var(--text); }
.nav-tabs a.on { color: var(--text); }
.nav-tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav-tabs .soon::after { content: "Soon"; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 9px; letter-spacing: 0.08em; vertical-align: 1px; }
.search { border-color: var(--line); background: rgba(255, 255, 255, 0.04); border-radius: 10px; }

/* panels */
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -32px rgba(0, 0, 0, 0.8);
  padding: 16px;
}
.panel-head { margin-bottom: 12px; }
.panel-head h2, .panel h3 { color: rgba(255, 255, 255, 0.55); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
.panel .soon { border: 1px solid var(--line-2); background: none; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.seg-tabs { padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.seg-tabs button { padding: 5px 11px; border-radius: 7px; font-weight: 600; letter-spacing: 0.01em; transition: background 0.15s ease, color 0.15s ease; }
.seg-tabs button:hover { color: var(--text); }
.seg-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.10); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }

/* the picture */
.hub-main .theater .stage-stack { border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.live { background: var(--grad); color: #fff; border-radius: 6px; }
.ep-chip { padding: 7px 12px 7px 7px; border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 12px; background: rgba(12, 11, 17, 0.55); backdrop-filter: blur(10px) saturate(140%); }
.ep-chip .ep { letter-spacing: -0.01em; }
.stage-stack .place { border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 8px; background: rgba(12, 11, 17, 0.55); backdrop-filter: blur(10px); }
.cam-rail button { border-radius: 10px; border-color: rgba(255, 255, 255, 0.10); background: rgba(12, 11, 17, 0.55); backdrop-filter: blur(10px) saturate(140%); font-weight: 600; }
.cam-rail button[aria-pressed="true"] { border-color: transparent; background: linear-gradient(rgba(18, 16, 26, 0.85), rgba(18, 16, 26, 0.85)) padding-box, var(--grad) border-box; border: 1px solid transparent; box-shadow: none; }
.cam-tip {
  border: 1px solid transparent;
  background: linear-gradient(rgba(16, 14, 23, 0.94), rgba(16, 14, 23, 0.94)) padding-box, var(--grad) border-box;
  color: var(--text);
  backdrop-filter: blur(12px);
}
.cam-tip::after { border-left-color: #b45cff; }
.cam-tip .primary { background: var(--grad); color: #fff; }
.char-card, .cam-menu { border-color: rgba(255, 255, 255, 0.10); background: rgba(14, 13, 20, 0.86); backdrop-filter: blur(14px) saturate(140%); border-radius: 14px; }
.char-card { border-top: 1px solid rgba(255, 255, 255, 0.10); box-shadow: inset 0 2px 0 var(--c, var(--accent)); }
.char-card .love svg.i, .char-card .hate svg.i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.player-bar { background: linear-gradient(to top, rgba(6, 5, 9, 0.85), rgba(6, 5, 9, 0)); }

/* current scene + events */
.scene-now b { font-weight: 700; letter-spacing: -0.01em; }
.scene-strip li { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.scene-strip li.now { box-shadow: 0 0 0 1px transparent; outline: 2px solid transparent; background: var(--grad); padding: 2px; }
.scene-strip li.now img { border-radius: 8px; }
.event-feed { gap: 4px; max-height: 210px; }
.event-feed li { padding: 6px 8px; border-radius: 10px; transition: background 0.15s ease; }
.event-feed li:hover { background: rgba(255, 255, 255, 0.04); }
.event-feed .ico { width: 28px; height: 28px; border-radius: 8px; color: var(--accent-2); background: rgba(255, 92, 138, 0.12); }
.event-feed .ico svg.i { width: 15px; height: 15px; }
.event-feed li[data-kind="pin"] .ico { color: #7fd8ff; background: rgba(127, 216, 255, 0.12); }
.event-feed li[data-kind="star"] .ico { color: #ffd479; background: rgba(255, 212, 121, 0.12); }
.event-feed li[data-kind="spark"] .ico { color: #c7a6ff; background: rgba(139, 108, 255, 0.16); }
.event-feed li[data-kind="coin"] .ico { color: #73d99f; background: rgba(115, 217, 159, 0.12); }
.event-feed li[data-kind="ban"] .ico, .event-feed li[data-kind="exit"] .ico { color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.feed .scene-line svg.i { width: 13px; height: 13px; vertical-align: -2px; color: var(--accent-2); }

/* interact */
.pick select, .write textarea { border-color: var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.pick select:focus, .write textarea:focus { border-color: rgba(255, 92, 138, 0.6); box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.12); }
.quick-grid { gap: 8px; }
.quick-grid button {
  gap: 8px;
  padding: 12px 6px 10px;
  border-color: var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.quick-grid button:hover:not(:disabled) { border-color: rgba(255, 92, 138, 0.45); background: rgba(255, 92, 138, 0.06); transform: translateY(-1px); }
.quick-grid .qi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); color: var(--accent-2); font-size: 0; }
.quick-grid button:nth-child(2) .qi, .quick-grid button:nth-child(3) .qi { color: #ff9bb5; background: rgba(255, 92, 138, 0.12); }
.quick-grid button:nth-child(4) .qi { color: #ffd479; background: rgba(255, 212, 121, 0.10); }
.quick-grid button:nth-child(5) .qi { color: #73d99f; background: rgba(115, 217, 159, 0.10); }
.quick-grid button:nth-child(1) .qi, .quick-grid button:nth-child(6) .qi { color: #a99bff; background: rgba(139, 108, 255, 0.14); }
.mine-list li { border-color: var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }

/* the map */
.world-map { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.map-place { border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 7px; background: rgba(12, 11, 17, 0.72); backdrop-filter: blur(6px); font-weight: 600; letter-spacing: 0.01em; }
.map-place.live { border-color: transparent; background: var(--grad); color: #fff; }
.map-pin { width: 32px; height: 32px; margin: -16px 0 0 -16px; border-width: 2px; box-shadow: 0 0 0 2px rgba(9, 8, 13, 0.7), 0 6px 14px rgba(0, 0, 0, 0.5); }
.map-pin.here { box-shadow: 0 0 0 2px rgba(9, 8, 13, 0.7), 0 0 0 5px rgba(115, 217, 159, 0.45), 0 6px 14px rgba(0, 0, 0, 0.5); }
.world-list li { border-radius: 10px; background: rgba(255, 255, 255, 0.03); }

/* character cards: the portrait leads, the name sits on it */
.people-grid { gap: 10px; }
.pcard {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.pcard.speaking { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.pcard .pic { border-radius: 0; position: relative; }
.pcard .pic::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(to top, rgba(9, 8, 13, 0.85), transparent); }
.pcard > b { margin: -30px 10px 0; position: relative; z-index: 1; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.pcard .tag, .pcard .where, .pcard .heart, .pcard .coin-tag, .pcard .coin-launch { margin: 0 10px; }
.pcard .tag { margin-top: 6px; }
.pcard .where { margin-top: 8px; font-size: 11px; }
.pcard .heart { margin-top: 6px; }
.pcard .heart svg.i { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; color: #ff9bb5; }
.pcard .heart.hate svg.i { color: #8fb6ff; }
.pcard .heart i { height: 3px; background: rgba(255, 255, 255, 0.08); }
.pcard .heart i::before { background: linear-gradient(90deg, #ff9bb5, #ff5c8a); }
.pcard .heart.hate i::before { background: linear-gradient(90deg, #8fb6ff, #6a8cff); }
.pcard .act { margin: 8px 10px 10px; padding: 6px 0; border-color: var(--line-2); border-radius: 8px; font-weight: 600; transition: background 0.15s ease, border-color 0.15s ease; }
.pcard .act:hover { border-color: rgba(255, 92, 138, 0.55); background: rgba(255, 92, 138, 0.08); }
.pcard .on { top: 8px; right: 8px; z-index: 1; box-shadow: 0 0 0 2px rgba(9, 8, 13, 0.75), 0 0 10px rgba(115, 217, 159, 0.8); }
.pcard.add { padding: 12px; border-style: dashed; border-color: var(--line-2); background: none; }
.pcard.add .plus { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 22px; }

/* chat */
.feed li { border-bottom: 0; padding: 6px 2px; }
.composer input { border-radius: 10px; border-color: var(--line); background: rgba(0, 0, 0, 0.25); }
.toast { border-radius: 12px; backdrop-filter: blur(10px); }

/* ───────────── Anime theme: the page looks like the show — sakura daytime, cel-shaded ink outlines ─────────────
   Panels, buttons and cards wear the same ink outline as the characters; the picture's overlays are
   paper stickers. Sky to cream, sakura pink, sky blue and sunny yellow. */
:root {
  --ink: #2a2438;
  --bg: #fff8f3;
  --panel: #ffffff;
  --panel-2: #fff3f6;
  --line: rgba(42, 36, 56, 0.14);
  --line-2: rgba(42, 36, 56, 0.28);
  --text: #2a2438;
  --muted: #5e5670;
  --dim: #847c93;
  --accent: #ff5c8a;
  --accent-2: #e33f74;
  --accent-ink: #ffffff;
  --sky: #4fb3ff;
  --sun: #ffc93c;
  --mint: #2fb57a;
  --good: #2fb57a;
  --grad: linear-gradient(135deg, #ff7fa6, #ff5c8a);
  --pop: 0 4px 0 var(--ink);
}
body.watch {
  background: linear-gradient(180deg, #cfeaff 0, #e9f5ff 200px, #fff1f6 560px, #fff8f3 1000px) fixed;
  color: var(--text);
}
/* manga halftone in two corners */
body.watch::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 92, 138, 0.22) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(520px 380px at 100% 100%, #000, transparent 70%), radial-gradient(420px 300px at 0% 30%, #000, transparent 70%);
  mask-image: radial-gradient(520px 380px at 100% 100%, #000, transparent 70%), radial-gradient(420px 300px at 0% 30%, #000, transparent 70%);
}
.hub { position: relative; z-index: 1; }
* { scrollbar-color: rgba(42, 36, 56, 0.25) transparent; }

/* drifting sakura petals (a handful, compositor-only, off with reduced motion) */
.petals { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.petals i {
  position: absolute;
  top: -4vh;
  left: var(--x);
  width: calc(11px * var(--s));
  height: calc(8px * var(--s));
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #ffe0ea, #ff8fb1);
  opacity: 0.75;
  will-change: transform;
  animation: petal-fall var(--d) linear var(--delay) infinite;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, -4vh, 0) rotate(0deg); }
  50% { transform: translate3d(var(--sway), 52vh, 0) rotate(220deg); }
  100% { transform: translate3d(calc(var(--sway) * -0.5), 108vh, 0) rotate(460deg); }
}

/* ink-outlined, pressable buttons */
.primary {
  border: 2px solid var(--ink);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--ink);
  filter: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.primary:hover { filter: none; background: #ff6f98; }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.primary:disabled { background: #ffb3c7; }
.ghost { border: 2px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 0 var(--ink); }
.ghost:hover { background: var(--panel-2); }

/* top bar */
.bar { background: rgba(255, 255, 255, 0.92); border-bottom: 2px solid var(--ink); backdrop-filter: blur(8px); }
.mark { display: grid; line-height: 1; color: var(--ink); }
.mark span { font-size: 21px; }
.mark b { background: none; color: var(--accent); -webkit-background-clip: border-box; background-clip: border-box; }
.mark small { margin-top: 3px; color: var(--accent-2); font: 700 9px "Zen Kaku Gothic New", sans-serif; letter-spacing: 0.32em; }
.nav-tabs a, .nav-tabs .soon { color: var(--muted); font-weight: 800; }
.nav-tabs a:hover, .nav-tabs a.on { color: var(--ink); }
.nav-tabs a.on::after { height: 4px; bottom: -13px; background: var(--accent); border-radius: 4px 4px 0 0; }
.nav-tabs .soon { color: var(--dim); }
.nav-tabs .soon::after { border-color: var(--line-2); color: var(--dim); }
.search { border: 2px solid var(--ink); background: #fff; border-radius: 999px; }
.search svg { fill: var(--ink); }
.who-am-i { border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* the news ticker */
.ticker {
  position: sticky;
  top: var(--bar-h);
  z-index: 19;
  display: flex;
  height: 32px;
  background: var(--accent);
  border-bottom: 2px solid var(--ink);
  color: #fff;
  overflow: hidden;
}
.ticker-tag {
  display: grid;
  place-items: center;
  flex: none;
  padding: 0 14px;
  background: var(--sun);
  border-right: 2px solid var(--ink);
  color: var(--ink);
  font: 900 14px "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.12em;
}
.ticker-window { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.ticker-track {
  display: flex;
  gap: 44px;
  padding-left: 24px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  will-change: transform;
  animation: ticker var(--dur, 60s) linear infinite;
}
.ticker-track span { display: inline-flex; align-items: center; gap: 8px; }
.ticker-track span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: 0.85; }
.ticker-track b { color: var(--ink); background: #fff; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
@keyframes ticker { to { transform: translateX(-50%); } }
.hub, .panel { scroll-margin-top: calc(var(--bar-h) + 46px); }

/* panels: white paper with an ink outline */
.panel {
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--pop);
}
.panel-head h2 {
  display: grid;
  gap: 2px;
  padding-left: 26px;
  background: no-repeat left center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23ff8fb1' stroke='%232a2438' stroke-width='1.2'%3E%3Cellipse cx='12' cy='6.6' rx='3.3' ry='5'/%3E%3Cellipse cx='12' cy='6.6' rx='3.3' ry='5' transform='rotate(72 12 12)'/%3E%3Cellipse cx='12' cy='6.6' rx='3.3' ry='5' transform='rotate(144 12 12)'/%3E%3Cellipse cx='12' cy='6.6' rx='3.3' ry='5' transform='rotate(216 12 12)'/%3E%3Cellipse cx='12' cy='6.6' rx='3.3' ry='5' transform='rotate(288 12 12)'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='2.2' fill='%23ffd23f' stroke='%232a2438' stroke-width='1'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 16px var(--display);
  letter-spacing: 0.01em;
  text-transform: none;
}
.panel-head h2::before {
  content: attr(data-jp);
  color: var(--accent-2);
  font: 700 10px "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.24em;
}
.panel h3 { color: var(--muted); font-weight: 800; letter-spacing: 0.1em; }
.panel .soon { border: 2px solid var(--ink); background: var(--sun); color: var(--ink); font-weight: 800; }
.seg-tabs { padding: 3px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; }
.seg-tabs button { border-radius: 999px; color: var(--muted); font-weight: 700; }
.seg-tabs button:hover { color: var(--ink); }
.seg-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.hint { color: var(--dim); }

/* the picture: an ink frame; its overlays are paper stickers */
.hub-main .theater .stage-stack { border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.live { border: 2px solid var(--ink); background: var(--accent); color: #fff; border-radius: 6px; box-shadow: 0 2px 0 var(--ink); animation: live-glow 2s ease-in-out infinite; }
@keyframes live-glow { 50% { box-shadow: 0 2px 0 var(--ink), 0 0 0 4px rgba(255, 92, 138, 0.35); } }
.ep-chip {
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  backdrop-filter: none;
}
.ep-chip .ep-no { color: var(--accent); font: 400 max(16px, 1.6cqi) var(--display); line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
.ep-chip .ep { color: var(--ink); font-weight: 800; }
.ep-chip .watching { color: var(--muted); }
.ep-chip .watching::before { background: var(--good); }
.stage-stack .place {
  display: grid;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  backdrop-filter: none;
}
.stage-stack .place small { color: var(--accent-2); font: 700 max(10px, 0.9cqi) "Zen Kaku Gothic New", sans-serif; letter-spacing: 0.18em; }
.cam-rail button {
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  backdrop-filter: none;
  font-weight: 700;
}
.cam-rail button:hover { background: var(--panel-2); border-color: var(--ink); }
.cam-rail button[aria-pressed="true"] { border: 2px solid var(--ink); background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--ink); }
.cam-rail button[aria-pressed="true"] .swatch { box-shadow: 0 0 0 2px #fff; }
.cam-tip { border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--ink); backdrop-filter: none; }
.cam-tip::after { border-left-color: var(--ink); }
.cam-tip .primary { background: var(--accent); }
.char-card, .cam-menu { border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--ink); backdrop-filter: none; }
.char-card { box-shadow: 0 4px 0 var(--ink), inset 0 4px 0 var(--c, var(--accent)); }
.char-card .x { color: var(--muted); }
.cam-menu h3 { color: var(--muted); }
.cam-menu button:hover, .cam-menu button:focus-visible { background: var(--panel-2); }
.cam-menu button[aria-checked="true"] { color: var(--accent-2); }
.roam-hint { background: var(--ink); border: 2px solid #fff; }

/* current scene */
.scene-now { color: var(--ink); }
.scene-strip li { border: 2px solid var(--ink); border-radius: 12px; box-shadow: none; background: var(--panel-2); }
.scene-strip li.now { padding: 0; background: var(--panel-2); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.scene-strip li.now img { border-radius: 0; }
.scene-strip .onair {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  padding: 1px 8px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: 900 11px "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.1em;
  transform: rotate(-6deg);
  box-shadow: 0 2px 0 var(--ink);
}
.scene-strip .empty { color: var(--dim); font-weight: 700; }

/* live events: pastel badges, new ones slide in */
.event-feed li { border-radius: 12px; }
.event-feed li:hover { background: var(--panel-2); }
.event-feed .what { color: var(--ink); font-weight: 500; }
.event-feed .ico { border: 2px solid var(--ink); color: var(--ink); background: #ffd6e3; }
.event-feed li[data-kind="pin"] .ico { color: var(--ink); background: #cfeaff; }
.event-feed li[data-kind="star"] .ico { color: var(--ink); background: #ffe7a3; }
.event-feed li[data-kind="spark"] .ico { color: var(--ink); background: #e6dcff; }
.event-feed li[data-kind="coin"] .ico { color: var(--ink); background: #c8f2dd; }
.event-feed li[data-kind="ban"] .ico, .event-feed li[data-kind="exit"] .ico { color: var(--ink); background: #ececf2; }
.event-feed li.fresh { animation: ev-in 0.7s ease-out both; }
@keyframes ev-in { from { opacity: 0; transform: translateX(-14px); background: #ffd6e3; } 60% { background: #ffe9f0; } }

/* interact */
.pick label { color: var(--muted); }
.pick select, .write textarea {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.pick select:focus, .write textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.2); }
.quick-grid button {
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--ink);
}
.quick-grid button:hover:not(:disabled) { border-color: var(--ink); background: #fff7fa; transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.quick-grid button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.quick-grid .qi { width: 38px; height: 38px; border: 2px solid var(--ink); color: var(--ink); }
.quick-grid button:nth-child(1) .qi, .quick-grid button:nth-child(6) .qi { color: var(--ink); background: #cfeaff; }
.quick-grid button:nth-child(2) .qi, .quick-grid button:nth-child(3) .qi { color: var(--ink); background: #ffd6e3; }
.quick-grid button:nth-child(4) .qi { color: var(--ink); background: #ffe7a3; }
.quick-grid button:nth-child(5) .qi { color: var(--ink); background: #c8f2dd; }
.quick-grid button:hover:not(:disabled) .qi { animation: qi-pop 0.35s ease; }
@keyframes qi-pop { 50% { transform: scale(1.15) rotate(-6deg); } }
.mine-list li { border: 2px solid var(--ink); background: #fff; border-radius: 14px; }

/* ships and rivalries */
.ships-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ship-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ship-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) 70px 34px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: var(--panel-2); }
#ships-hate li { background: #eef6ff; }
.ship-list .duo { display: flex; }
.ship-list .duo i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--c) center / cover no-repeat;
  color: #fff;
  font: 400 14px var(--display);
  font-style: normal;
}
.ship-list .duo i + i { margin-left: -10px; }
.ship-list .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ship-list .nm em { color: var(--accent); font-style: normal; font-weight: 900; }
#ships-hate .nm em { color: var(--sky); }
.ship-list .meter { height: 8px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.ship-list .meter i { display: block; height: 100%; width: var(--v); background: var(--accent); }
#ships-hate .meter i { background: var(--sky); }
.ship-list b { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.ship-list .none { display: block; padding: 10px; background: none; color: var(--dim); font-size: 13px; }

/* the map: paper stickers on the town */
.world-map { border: 2px solid var(--ink); border-radius: 14px; box-shadow: none; }
.map-place { border: 2px solid var(--ink); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 800; backdrop-filter: none; box-shadow: 0 2px 0 var(--ink); }
.map-place:hover { background: var(--panel-2); }
.map-place.live { border-color: var(--ink); background: var(--accent); color: #fff; }
.map-pin { border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ink), 0 3px 0 2px var(--ink); }
.map-pin.here { box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px rgba(47, 181, 122, 0.55); animation: pin-bob 1.8s ease-in-out infinite; }
@keyframes pin-bob { 50% { transform: translateY(-3px); } }
.world-list li { border: 2px solid var(--ink); background: #fff; color: var(--ink); }
.world-list li.live { background: #fff0f5; box-shadow: none; border-color: var(--accent); }

/* character cards: trading-card style, the name under the portrait */
.people-grid { gap: 10px; }
.pcard {
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
}
.pcard:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 6px 0 var(--ink); }
.pcard.speaking { border: 2px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink), 0 0 0 4px rgba(255, 92, 138, 0.45); animation: speak-glow 1.2s ease-in-out infinite; }
@keyframes speak-glow { 50% { box-shadow: 0 3px 0 var(--ink), 0 0 0 7px rgba(255, 92, 138, 0.25); } }
.pcard .pic { position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); background-color: var(--c); }
.pcard .pic::after { content: none; }
/* a shine sweeps the portrait on hover */
.pcard .pic::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); transform: translateX(-110%); transition: transform 0.6s ease; }
.pcard:hover .pic::before { transform: translateX(110%); }
.pcard .ini { color: #fff; font: 400 28px var(--display); text-shadow: 0 2px 0 var(--ink); }
.pcard .nm { display: grid; margin: 8px 10px 0; }
.pcard .nm b { color: var(--ink); font: 400 15px var(--display); letter-spacing: 0.01em; text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .nm small { color: var(--accent-2); font: 700 10px "Zen Kaku Gothic New", sans-serif; letter-spacing: 0.2em; }
.pcard > b { display: none; }
.pcard .tag { margin-top: 4px; color: var(--accent-2); }
.pcard .where { margin-top: 4px; color: var(--muted); font-weight: 600; }
.pcard .heart { color: var(--muted); }
.pcard .heart svg.i { color: var(--accent); }
.pcard .heart.hate svg.i { color: var(--sky); }
.pcard .heart i { height: 6px; border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; }
.pcard .heart i::before { background: var(--accent); }
.pcard .heart.hate i::before { background: var(--sky); }
.pcard .act { border: 2px solid var(--ink); background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 2px 0 var(--ink); }
.pcard .act:hover { border-color: var(--ink); background: var(--accent); color: #fff; }
.pcard .on { width: 12px; height: 12px; border: 2px solid var(--ink); box-shadow: none; animation: on-pulse 1.6s ease-in-out infinite; }
@keyframes on-pulse { 50% { box-shadow: 0 0 0 4px rgba(47, 181, 122, 0.35); } }
.pcard.add { border: 2px dashed var(--ink); background: rgba(255, 255, 255, 0.6); box-shadow: none; color: var(--muted); font-weight: 700; }
.pcard.add .plus { border: 2px solid var(--ink); background: var(--accent); box-shadow: 0 2px 0 var(--ink); }
.coin-tag { color: var(--mint); font-weight: 800; }
.coin-launch { border: 2px solid var(--ink); color: var(--ink); background: var(--sun); font-weight: 800; }

/* chat */
.feed .scene-line { color: var(--muted); }
.feed .scene-line b { color: var(--ink); }
.feed .scene-line svg.i { color: var(--accent); }
.feed .sys { color: var(--muted); }
.composer input { border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); }
.cooldown { background: var(--line); }

/* the options ballot, dialogs, toasts */
.option { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); border-radius: 12px; }
.option:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.option .fill { background: rgba(255, 92, 138, 0.18); }
.option.lead .fill { background: rgba(255, 92, 138, 0.32); }
.sheet { border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.sheet::backdrop { background: rgba(42, 36, 56, 0.45); }
.toast { border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink); backdrop-filter: none; }
.toast.ok { box-shadow: 0 3px 0 var(--ink), inset 4px 0 0 var(--good); }
.toast.error { box-shadow: 0 3px 0 var(--ink), inset 4px 0 0 #e5484d; }
.status.error { color: #d6313b; }
.menu { border: 2px solid var(--ink); background: #fff; box-shadow: 0 4px 0 var(--ink); }
.wallet-btn { border: 2px solid var(--ink); background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

@media (max-width: 760px) {
  .ships-grid { grid-template-columns: 1fr; }
  .ticker-tag { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .petals { display: none; }
  .ticker-track, .live, .pcard.speaking, .pcard .on, .map-pin.here, .event-feed li.fresh { animation: none; }
}

/* the page's cream base runs all the way down; the sky sits at the top */
html { background: #fff8f3; }
body.watch { background: linear-gradient(180deg, #cfeaff 0, #e9f5ff 200px, #fff1f6 560px, #fff8f3 1000px) no-repeat, #fff8f3; min-height: 100vh; }
.map-place { transform: none; }
.panel-head h2 { white-space: nowrap; }

/* shown on the picture while the scene's characters are still loading */
.cast-load {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--ink);
}
.cast-load[hidden] { display: none; }
.cast-load i { width: 14px; height: 14px; border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── episodes on demand: the list, and the bar over a replay ───────────── */
.episodes .panel-head .hint { white-space: nowrap; }
.episode-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 12px; margin: 0; padding: 2px 2px 10px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scrollbar-width: thin; }
.episode-list li { scroll-snap-align: start; }
.episode-list .none { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.ep-card { display: grid; gap: 6px; align-content: start; width: 100%; height: 100%; padding: 12px 12px 10px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform 0.1s ease; }
.ep-card:hover { transform: translateY(-2px); }
.ep-card.playing { background: #fff3f6; box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--accent); }
.ep-num { justify-self: start; padding: 1px 8px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--sun); font-size: 11px; font-weight: 900; }
.ep-title { font: 400 17px var(--display); line-height: 1.2; }
.ep-premise { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.ep-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 11.5px; font-weight: 700; }
.ep-meta .faces { display: flex; }
.ep-meta .faces i { display: grid; place-items: center; width: 24px; height: 24px; margin-right: -6px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--c) center / cover no-repeat; color: #fff; font-size: 10px; font-style: normal; font-weight: 900; }
.ep-play { display: inline-flex; align-items: center; justify-self: start; gap: 4px; margin-top: 2px; padding: 4px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.ep-play svg.i { width: 13px; height: 13px; fill: currentColor; stroke: none; }

/* "Watch" scrolls the stage into view below the sticky header, so the replay bar is never under it */
.theater, .replay-bar { scroll-margin-top: calc(var(--bar-h, 64px) + 40px); }
/* a strip over the picture while a replay plays: it never covers the show */
.replay-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 8px 6px 6px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.replay-bar .what { flex: 1; }
.replay-bar[hidden] { display: none; }
.replay-bar .tag { padding: 3px 9px; border-radius: 999px; background: var(--sky); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.replay-bar .what { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ep-chip.replay .live { background: var(--sky); }
@media (max-width: 760px) {
  .replay-bar { flex-wrap: wrap; justify-content: center; }
}

/* ───────────── Anime Slop: the TV mascot and the wordmark ───────────── */
.mark { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mark img { flex: none; width: 44px; height: 44px; transform-origin: 50% 85%; transition: transform 0.18s ease; }
.mark:hover img { transform: rotate(-9deg) scale(1.07); }
.mark .word { display: grid; line-height: 1; }
.mark .word > span { font-size: 21px; white-space: nowrap; }
.mark .word b { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  /* the TV does a little hop now and then */
  .mark img { animation: tv-hop 6s ease-in-out infinite; }
  .mark:hover img { animation: none; }
}
@keyframes tv-hop {
  0%, 86%, 100% { transform: none; }
  90% { transform: translateY(-4px) rotate(-6deg); }
  94% { transform: translateY(0) rotate(4deg); }
}

/* ───────────── the docs (/docs.html): a plain, readable reference ───────────── */
body.docs-site { margin: 0; background: #fff; color: #23202b; font: 400 16px/1.65 Inter, system-ui, sans-serif; }
.dx-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 20px; border-bottom: 1px solid #ece8f0; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); }
.dx-bar .mark img { width: 40px; height: 40px; }
.dx-bar .mark .word > span { font-size: 19px; }
.dx-bar .mark small { color: var(--muted); letter-spacing: 0.2em; }
.dx-bar-end { display: flex; align-items: center; gap: 10px; }
.dx-watch { padding: 8px 16px; border-radius: 999px; text-decoration: none; font-size: 14px; }
.dx-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.dx-nav { position: sticky; top: 64px; align-self: start; display: grid; gap: 2px; max-height: calc(100vh - 64px); overflow-y: auto; padding: 28px 0; }
.dx-nav p { margin: 16px 0 6px; color: #8a8494; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.dx-nav p:first-child { margin-top: 0; }
.dx-nav a { padding: 5px 10px; border-left: 2px solid transparent; color: #4b4657; font-size: 14px; text-decoration: none; }
.dx-nav a:hover { color: #23202b; }
.dx-nav a.on { border-left-color: var(--accent); color: #23202b; font-weight: 600; }
.dx-main { min-width: 0; max-width: 760px; padding: 32px 0 24px; }
.dx-main section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid #f0ecf3; scroll-margin-top: 84px; }
.dx-main section:last-of-type { border-bottom: 0; }
.dx-kicker { margin: 0 0 6px; color: var(--accent-2); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.dx-main h1 { margin: 0 0 16px; font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.dx-main h2 { margin: 0 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.dx-main h3 { margin: 22px 0 6px; font-size: 17px; font-weight: 700; }
.dx-main p { margin: 0 0 12px; }
.dx-main ul, .dx-main ol { margin: 0 0 12px; padding-left: 22px; }
.dx-main li { margin: 4px 0; }
.dx-main a { color: var(--accent-2); font-weight: 600; }
.dx-main code { padding: 1px 6px; border: 1px solid #ebe6ef; border-radius: 6px; background: #f8f6fa; font: 500 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dx-code { margin: 0 0 14px; padding: 14px 16px; border-radius: 10px; background: #1f1b2a; color: #f4f1f8; overflow-x: auto; font: 500 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dx-code code { padding: 0; border: 0; background: none; color: inherit; font: inherit; white-space: pre; }
.dx-table { width: 100%; margin: 0 0 14px; border-collapse: collapse; font-size: 14.5px; }
.dx-table th, .dx-table td { padding: 9px 12px; border-bottom: 1px solid #ece8f0; text-align: left; vertical-align: top; }
.dx-table thead th { border-bottom: 2px solid #e2dde8; color: #6b6576; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.dx-table tbody th { width: 34%; color: #4b4657; font-weight: 600; }
.dx-table .dx-total td { background: #faf8fc; font-weight: 700; }
.dx-tools td:first-child { white-space: nowrap; }
.dx-callout { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: #fff4f7; }
.dx-note { padding: 10px 14px; border-radius: 8px; background: #f8f6fa; color: #5e5869; font-size: 14.5px; }
.dx-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 40px; border-top: 1px solid #f0ecf3; }
.dx-foot .foot-mark { font-size: 16px; }
.dx-foot .foot-mark img { width: 30px; height: 30px; }
@media (max-width: 900px) {
  .dx-layout { grid-template-columns: 1fr; gap: 0; }
  .dx-nav { position: static; display: flex; flex-wrap: nowrap; gap: 4px; max-height: none; overflow-x: auto; padding: 12px 0; border-bottom: 1px solid #ece8f0; }
  .dx-nav p { display: none; }
  .dx-nav a { flex: none; padding: 6px 12px; border: 1px solid #ece8f0; border-radius: 999px; }
  .dx-nav a.on { border-color: var(--accent); }
  .dx-main h1 { font-size: 30px; }
  .dx-main h2 { font-size: 22px; }
  .dx-table { font-size: 13.5px; }
  .dx-table th, .dx-table td { padding: 8px; }
  .dx-table tbody th { width: 40%; }
}
@media (max-width: 520px) {
  .dx-bar { padding: 0 12px; }
  .dx-bar .wide { display: none; }
  .dx-layout { padding: 0 14px; }
  .dx-tools td:first-child { white-space: normal; }
}
/* the top bar never pushes Sign in and the X icon off screen: the nav gives way first */
.bar .nav-tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.bar .nav-tabs::-webkit-scrollbar { display: none; }
.bar .bar-end { flex: none; }
@media (max-width: 1700px) {
  .bar .search { display: none; }
  .bar .bar-end { margin-left: auto; }
}
@media (max-width: 1380px) {
  .bar .nav-tabs a { padding: 8px 8px; font-size: 11px; letter-spacing: 0.04em; }
  .bar #about-open { display: none; }
}

/* the X icon: always in the top bar */
.x-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: var(--ink); color: #fff; box-shadow: 0 2px 0 var(--accent); transition: transform 0.08s ease; }
.x-icon svg { width: 16px; height: 16px; fill: currentColor; }
.x-icon:hover { background: #3a3150; }
.x-icon:active { transform: translateY(2px); box-shadow: none; }
.foot-links { display: flex; align-items: center; gap: 14px; }
.foot-links .docs-link { color: var(--ink); font-weight: 800; font-size: 14px; }

/* footer: the show's mark and its X account */
.site-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1640px; margin: 8px auto 0; padding: 18px 16px 28px; border-top: 2px dashed var(--line-2); }
.foot-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font: 400 18px var(--display); }
.foot-mark img { width: 34px; height: 34px; }
.foot-mark b { color: var(--accent); font-weight: 400; }
.foot-mark small { margin-left: 6px; color: var(--muted); font: 700 11px var(--body, Inter, sans-serif); letter-spacing: 0.12em; }
.x-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 3px 0 var(--accent); transition: transform 0.08s ease, box-shadow 0.08s ease; }
.x-btn svg { width: 16px; height: 16px; fill: currentColor; }
.x-btn:hover { background: #3a3150; }
.x-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent); }
.x-btn[hidden] { display: none; }

/* the chat sits beside the scene strip, where the live events were */
.hub-row .chat { display: flex; flex-direction: column; min-width: 0; padding: 14px; }
.hub-row .chat .feed { height: 214px; flex: none; }
.hub-row .chat .slowmode { margin: -4px 0 6px; }

/* ───────────── AI agents: the character designer, the connect page, and agent badges ───────────── */
.nav-tabs a, .nav-tabs .soon { white-space: nowrap; }
.nav-tabs .new { margin-left: 4px; padding: 1px 6px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--sun); color: var(--ink); font-size: 9px; letter-spacing: 0.06em; vertical-align: 1px; }

.sheet.designer { width: min(1100px, calc(100vw - 32px)); }
.sheet.designer header { align-items: flex-start; gap: 12px; }
.sheet.designer header .sub { margin: 4px 0 0; max-width: 64ch; color: var(--muted); font-size: 13px; }
.dz-body { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; padding: 18px; overflow-y: auto; }
.dz-stage {
  --c: #ff5c8a;
  position: sticky;
  top: 0;
  align-self: start;
  height: min(560px, calc(100vh - 220px));
  min-height: 380px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  overflow: hidden;
  background:
    radial-gradient(rgba(255, 255, 255, 0.55) 1.3px, transparent 1.7px) 0 0 / 14px 14px,
    radial-gradient(120% 80% at 50% 30%, #fff 0, color-mix(in srgb, var(--c) 22%, #fff) 55%, color-mix(in srgb, var(--c) 48%, #fff) 100%);
}
.dz-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.dz-stage canvas:active { cursor: grabbing; }
.dz-load { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 9px 15px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
.dz-load[hidden] { display: none; }
.dz-load i { width: 14px; height: 14px; border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.dz-name { position: absolute; left: 0; right: 0; bottom: 52px; margin: 0; text-align: center; color: #fff; font: 400 28px var(--display); letter-spacing: 0.02em; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; pointer-events: none; }
.dz-tools { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dz-tools span { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.8); color: var(--muted); font-size: 11px; font-weight: 700; }

.dz-controls { display: grid; gap: 14px; align-content: start; min-width: 0; }
.dz-step { padding: 12px 14px 14px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.dz-step h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 400 15px var(--display); }
.dz-step h3 b { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; background: var(--accent); color: #fff; font: 800 12px/1 Inter, sans-serif; }

.dz-bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dz-base { display: grid; gap: 4px; padding: 4px 4px 6px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--panel-2); color: var(--ink); text-align: center; cursor: pointer; transition: transform 0.1s ease; }
.dz-base img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; object-fit: cover; background: #ffd6e4; }
.dz-base span { font-size: 12px; font-weight: 800; line-height: 1.2; }
.dz-base small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.dz-base:hover { transform: translateY(-2px); border-color: var(--ink); }
.dz-base[aria-checked="true"] { border-color: var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--accent); }

.dz-palettes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dz-palette { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px 4px 6px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.dz-palette i { width: 12px; height: 12px; border: 1.5px solid var(--ink); border-radius: 50%; }
.dz-palette span { margin-left: 4px; }
.dz-palette:active { transform: translateY(2px); box-shadow: none; }
.dz-colors { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dz-color { position: relative; display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.dz-color::before { content: ""; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--c, #fff); box-shadow: 0 2px 0 var(--ink); }
.dz-color input { position: absolute; top: 0; width: 34px; height: 34px; opacity: 0; cursor: pointer; }
.dz-skin { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dz-skins { display: flex; flex-wrap: wrap; gap: 6px; }
.dz-skin-dot { position: relative; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--c); cursor: pointer; }
.dz-skin-dot[aria-checked="true"] { box-shadow: 0 0 0 3px var(--accent); }
.dz-skin-dot.custom { background: conic-gradient(#fbe6da, #c99a7a, #6e4a36, #fbe6da); color: #fff; font-weight: 900; text-shadow: 0 1px 0 var(--ink); }
.dz-skin-dot.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.dz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dz-patterns { display: grid; gap: 8px; margin-bottom: 12px; }
.dz-pattern-row { display: flex; align-items: center; gap: 10px; }
.dz-pattern-row > span { min-width: 96px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dz-pattern-row[hidden], .dz-color[hidden] { display: none; }
.dz-twin { margin: 12px 0 0; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #fff3c4; color: var(--ink); font-size: 13px; font-weight: 700; }
.dz-twin[hidden] { display: none; }
.dz-base { position: relative; }
.dz-lead { position: absolute; top: 6px; left: 6px; padding: 1px 6px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 9.5px; font-style: normal; font-weight: 800; }
.dz-chip { padding: 5px 11px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.dz-chip[aria-checked="true"] { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--ink); }
.dz-height { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dz-height output { min-width: 52px; color: var(--ink); font-weight: 800; }
.dz-height input { flex: 1; accent-color: var(--accent); }

.dz-voices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dz-voice { display: grid; gap: 2px; padding: 7px 6px; border: 2px solid var(--line-2); border-radius: 10px; background: var(--panel-2); color: var(--ink); text-align: center; cursor: pointer; }
.dz-voice b { font-size: 13px; }
.dz-voice small { color: var(--muted); font-size: 10.5px; line-height: 1.25; }
.dz-voice[aria-checked="true"] { border-color: var(--ink); background: #fff; box-shadow: 0 2px 0 var(--ink), 0 0 0 3px var(--accent); }
.dz-step .fields input { padding: 8px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.dz-step .optional { color: var(--dim); font-weight: 500; }

.agent-connect header { align-items: flex-start; gap: 12px; }
.agent-connect header .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.ac-body { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 18px; overflow-y: auto; max-height: calc(100vh - 220px); }
.ac-pic { width: 180px; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); background: #ffd6e4; }
.ac-main { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ac-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.ac-field em { margin-left: 6px; color: #d6313b; font-style: normal; }
.copyrow { display: flex; align-items: stretch; gap: 8px; }
.copyrow code, .copyrow pre { flex: 1; min-width: 0; margin: 0; padding: 9px 11px; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel-2); color: var(--ink); font: 600 12.5px/1.45 ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.copyrow.snippet pre { background: var(--ink); color: #fff3f6; }
.ac-tabs { justify-self: start; border: 2px solid var(--ink); background: #fff; }
.ac-tabs button { color: var(--ink); font-weight: 800; }
.ac-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.ac-tools { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; }
.ac-tools code { padding: 1px 6px; border-radius: 6px; background: var(--panel-2); color: var(--ink); font-weight: 700; }

/* agents in the cast */
.pcard.add.agent .plus { background: var(--sky); font-size: 12px; font-weight: 900; color: #fff; }
.pcard.is-agent .tag { color: var(--sky); }
.agent-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 1.5px solid var(--ink); border-radius: 50%; background: #c9c3d3; }
.agent-dot.on { background: var(--good); animation: on-pulse 1.6s ease-in-out infinite; }
.char-card .agent-meta { font-weight: 700; }
/* .who is also the subtitles' speaker plate; not here */
.mine-list .who { display: block; margin: 0; padding: 0; border-radius: 0; background: none; font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.mine-list .agent-line { display: block; margin-top: 2px; color: var(--ink) !important; font-weight: 700; }
.mine-list .agent-line b { display: inline; }
.mine-list li.earned { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; border: 2px solid var(--ink); background: #fff8d6; box-shadow: 0 2px 0 var(--ink); }
.mine-list li.earned span { color: var(--muted); font-size: 12px; font-weight: 700; }
.mine-list li.earned b { font: 400 22px var(--display); color: var(--ink); }
.mine-list li.earned small { grid-column: 1 / -1; color: var(--dim); font-size: 11px; }
.mine-list li.empty { display: flex; justify-content: center; gap: 8px; }

@media (max-width: 820px) {
  .dz-body { grid-template-columns: 1fr; }
  .dz-stage { position: relative; height: 360px; min-height: 0; }
  .dz-bases { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .dz-base small { display: none; }
  .dz-colors { grid-template-columns: repeat(4, 1fr); }
  .dz-voices { grid-template-columns: repeat(3, 1fr); }
  .ac-body { grid-template-columns: 1fr; }
  .ac-pic { width: 140px; }
}
