:root {
  --bg: #0b0a16;
  --panel: rgba(16, 14, 34, 0.84);
  --panel-solid: #14122a;
  --panel-2: rgba(32, 28, 62, 0.85);
  --line: rgba(92, 84, 150, 0.35);
  --text: #ebe8f7;
  --muted: #a39dc4;
  --dim: #736d98;
  --up: #34d399;
  --down: #fb7185;
  --flat: #cbd5e1;
  --gold: #fbbf24;
  --warn: #fbbf24;
  --bad: #fb7185;
  --ok: #34d399;
  --font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: "Silkscreen", "IBM Plex Mono", monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 var(--font);
}

a {
  color: #a5b4fc;
}

button {
  font: inherit;
  color: inherit;
}

h2,
h3,
h4 {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

/* ── top bar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 8px 16px;
  background: #0b0a18;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo {
  image-rendering: pixelated;
}

.brand-name {
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1;
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  font-family: var(--pixel);
  font-size: 11px;
  color: #1a1300;
  background: var(--gold);
  padding: 2px 6px;
  border-radius: 3px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  flex: 1;
  min-width: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat .k {
  color: var(--dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .v {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--dim);
  vertical-align: 1px;
}

.pill.ok {
  color: var(--text);
}
.pill.ok::before {
  background: var(--ok);
}
.pill.warn::before {
  background: var(--warn);
}
.pill.bad {
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.5);
}
.pill.bad::before {
  background: var(--bad);
}

/* ── the 3D world fills the rest ─────────────────────────────────── */
.world {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #0c0a1d;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  cursor: grab;
  touch-action: none;
}

#scene:active {
  cursor: grabbing;
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.overlay > * {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.tag {
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px 4px;
  border: 1px solid var(--c);
  border-radius: 3px;
  color: var(--c);
  background: rgba(10, 8, 22, 0.82);
  white-space: nowrap;
  z-index: 2;
}

.tag.selected {
  background: var(--c);
  color: #0b0a16;
}

.bubble {
  max-width: 250px;
  width: max-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fbfaff;
  color: #17142b;
  font-size: 11.5px;
  line-height: 1.35;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.bubble.tmpl {
  background: #e7e3f5;
  outline: 1px dashed #8b86a8;
  outline-offset: -3px;
}

.bubble.diary {
  background: #2a1438;
  color: #f5e8ff;
  border: 1px solid #a855f7;
}

.bubble .rec {
  display: inline-block;
  margin-right: 6px;
  padding: 0 4px;
  font-family: var(--pixel);
  font-size: 8px;
  color: #fff;
  background: #dc2626;
  border-radius: 2px;
  vertical-align: 1px;
}

.room-label {
  font-family: var(--pixel);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.floor-badge {
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(165, 180, 252, 0.5);
  background: rgba(10, 8, 22, 0.7);
  color: #c7d2fe;
}

.floor-badge.on {
  background: #a5b4fc;
  color: #0b0a16;
}

.place-hover {
  font-family: var(--pixel);
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 4px;
  color: #1a1300;
  background: #fbbf24;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  z-index: 6;
}

.toast {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  max-width: min(640px, calc(100% - 32px));
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(16, 14, 34, 0.9);
  border: 1px solid var(--line);
  z-index: 7;
}

.place-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.place-head h3 {
  font-size: 15px;
  color: var(--gold);
  margin-top: 2px;
}

.place-type {
  font-family: var(--pixel);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1300;
  background: var(--gold);
  padding: 1px 5px;
  border-radius: 3px;
}

.place-stats {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin: 10px 0;
  font-size: 12px;
}

.place-stats dt {
  color: var(--dim);
}

.place-stats dd {
  margin: 0;
  text-align: right;
}

.guests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── floating docks ──────────────────────────────────────────────── */
.dock {
  position: absolute;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}

.dock > * {
  pointer-events: auto;
}

.dock.left {
  left: 12px;
  width: 316px;
  max-height: calc(100% - 80px);
}

.dock.right {
  right: 12px;
  width: 350px;
  bottom: 64px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-head h2 {
  font-size: 13px;
}

.dock-close {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  color: var(--muted);
}

.hint {
  color: var(--dim);
  font-size: 11px;
  margin: 8px 2px 0;
}

.mates {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.mate {
  display: grid;
  grid-template-columns: 14px 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--panel-2);
  border-left: 3px solid var(--c);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  cursor: pointer;
}

.mate:hover,
.mate:focus-visible,
.mate.selected {
  background: rgba(60, 52, 110, 0.9);
  outline: none;
}

.mate .rank {
  color: var(--dim);
  font-family: var(--pixel);
  font-size: 11px;
}

.portrait {
  image-rendering: pixelated;
  display: block;
}

.mate .portrait {
  width: 24px;
  height: 30px;
}

.who {
  min-width: 0;
}

.mate .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mate .role {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mate .bags {
  font-size: 11px;
  color: var(--gold);
}

.nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}

.nums .equity,
.nums .record {
  color: var(--muted);
  font-size: 11px;
}

.pnl {
  font-weight: 600;
}

.up {
  color: var(--up);
}
.down {
  color: var(--down);
}
.flat {
  color: var(--flat);
}

/* ── live feed ───────────────────────────────────────────────────── */
.feed-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tabs button {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
}

.tabs button.on {
  color: var(--text);
  background: var(--panel-2);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 1;
}

.feed[data-filter="trades"] > li:not([data-kind="trades"]),
.feed[data-filter="talk"] > li:not([data-kind="talk"]),
.feed[data-filter="diary"] > li:not([data-kind="diary"]) {
  display: none;
}

.ev {
  position: relative;
  padding: 7px 42px 7px 9px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid transparent;
}

.ev time {
  position: absolute;
  top: 7px;
  right: 9px;
  color: var(--dim);
  font-size: 10.5px;
}

.ev.closed.win {
  border-color: rgba(52, 211, 153, 0.4);
}
.ev.closed.loss {
  border-color: rgba(251, 113, 133, 0.35);
}
.ev.diary {
  background: rgba(46, 20, 62, 0.9);
  border-color: rgba(168, 85, 247, 0.4);
}
.ev.system {
  background: transparent;
  border: 1px dashed var(--line);
}

.ev-sub,
.ev-topic,
.ev-links {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.ev-thesis {
  color: #c7c2e4;
  font-size: 11.5px;
  margin-top: 4px;
  font-style: italic;
}

.ev-quote {
  margin: 4px 0 0;
  color: #eadcff;
}

.token-name {
  color: var(--text);
}

.lines {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.who-link {
  font-weight: 600;
  color: var(--c);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.who-link:hover {
  text-decoration: underline;
}

.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.tmpl {
  margin-left: 6px;
  font-size: 9.5px;
  color: var(--dim);
  border: 1px dashed var(--dim);
  border-radius: 3px;
  padding: 0 3px;
  vertical-align: 1px;
}

/* ── agent panel ─────────────────────────────────────────────────── */
.agent {
  max-height: 58%;
  overflow: auto;
  border-top: 3px solid var(--c, var(--line));
}

.agent-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.agent-head .portrait {
  width: 48px;
  height: 60px;
  background: var(--panel-2);
  border-radius: 6px;
  padding: 3px;
}

.agent-head h3 {
  font-size: 15px;
  color: var(--c);
}

.agent-head .role {
  color: var(--muted);
  font-size: 11.5px;
}

.agent-actions {
  display: flex;
  gap: 6px;
}

.agent-actions button {
  cursor: pointer;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 4px 8px;
}

.agent-actions button.on {
  background: var(--c);
  color: #0b0a16;
  border-color: var(--c);
}

.tagline {
  margin: 2px 0 0;
  font-style: italic;
  font-size: 11.5px;
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.agent-stats .stat {
  background: var(--panel-2);
  border-radius: 6px;
  padding: 4px 6px;
}

.agent section {
  margin-top: 10px;
}

.agent h4 {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.agent p {
  margin: 3px 0;
  font-size: 12px;
}

.agent ul {
  margin: 3px 0;
  padding-left: 16px;
  font-size: 12px;
}

.agent details {
  color: var(--muted);
  font-size: 12px;
}

.bags-list,
.notebook {
  list-style: none;
  padding-left: 0 !important;
}

.trades {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.trades th {
  text-align: left;
  color: var(--dim);
  font-weight: 500;
  padding: 3px 4px;
  border-bottom: 1px solid var(--line);
}

.trades td {
  padding: 3px 4px;
  border-bottom: 1px solid rgba(42, 38, 72, 0.5);
}

/* ── bottom controls ─────────────────────────────────────────────── */
.floorbar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  z-index: 6;
}

.floorbar button {
  font-family: var(--pixel);
  font-size: 11px;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.floorbar button.on {
  background: #a5b4fc;
  color: #0b0a16;
}

.floorbar .sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
}

.note {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: min(420px, calc(50% - 170px));
  font-size: 11px;
  color: var(--muted);
  z-index: 4;
  text-shadow: 0 1px 0 #000;
}

.note .meta {
  display: block;
  color: var(--dim);
  margin-top: 2px;
}

.hints {
  position: absolute;
  right: 14px;
  bottom: 18px;
  max-width: calc(50% - 170px);
  text-align: right;
  font-size: 10.5px;
  color: var(--dim);
  z-index: 4;
  text-shadow: 0 1px 0 #000;
}

.mobile-tabs {
  display: none;
}

/* ── left dock tabs: housemates · new coins · radar ──────────────── */
.mates {
  overflow: hidden;
}

.dock-tabs {
  flex-wrap: wrap;
}

.dock-tabs button {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.unread {
  font-family: var(--font);
  font-size: 9px;
  line-height: 1;
  color: #0b0a16;
  background: #a3e635;
  border-radius: 8px;
  padding: 2px 4px;
}

.pane {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.pane[hidden] {
  display: none;
}

.pane-note {
  color: var(--dim);
  font-size: 11px;
  margin: 0 2px 6px;
}

.coin-img {
  display: block;
  flex: none;
  border-radius: 5px;
  image-rendering: pixelated;
  background: #1c1936;
  object-fit: cover;
}

.coins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.coin {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 7px 7px;
  border-radius: 7px;
  background: var(--panel-2);
  cursor: pointer;
  overflow: hidden;
  animation: coin-in 0.5s ease-out;
}

.coin:hover,
.coin:focus-visible,
.radar-row:hover,
.radar-row:focus-visible,
.call:hover {
  outline: 1px solid rgba(163, 230, 53, 0.5);
}

@keyframes coin-in {
  from {
    background: rgba(163, 230, 53, 0.28);
    transform: translateY(-4px);
  }
}

.coin-main {
  min-width: 0;
}

.coin-name,
.coin-sub,
.radar-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin-name b {
  color: #d9f99d;
}

.coin-full {
  color: var(--muted);
}

.coin-sub {
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.coin-mc {
  color: var(--text);
}

.coin-tags {
  color: #93c5fd;
  margin-left: 4px;
}

.coin-flag {
  color: var(--warn);
  margin-left: 6px;
}

.coin-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.coin-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  transition: width 0.6s;
}

.coins-more {
  position: sticky;
  bottom: 0;
  width: 100%;
  margin-top: 6px;
  font-family: var(--pixel);
  font-size: 11px;
  color: #0b0a16;
  background: #a3e635;
  border: 0;
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
}

/* ── radar ───────────────────────────────────────────────────────── */
.radar {
  display: grid;
  gap: 10px;
}

.radar-board h4 {
  font-size: 12px;
}

.radar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
  margin-bottom: 5px;
  border-left: 3px solid var(--c, var(--line));
}

.radar-who .portrait {
  width: 24px;
  height: 30px;
}

.radar-status {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 2px 6px;
}

.radar-list,
.calls-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.radar-row {
  display: grid;
  grid-template-columns: 12px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 7px;
  background: var(--panel-2);
  cursor: pointer;
}

.radar-row .rank {
  color: var(--dim);
  font-size: 11px;
  text-align: right;
}

.radar-row.skip {
  opacity: 0.5;
}

.radar-main {
  min-width: 0;
}

.radar-line b {
  color: #d9f99d;
}

.radar-metric {
  color: var(--muted);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.radar-reason {
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.radar-row .chip {
  color: #0b0a16;
  background: #a3e635;
}

.radar-row.skip .chip {
  background: var(--dim);
}

.call {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  padding: 4px 6px;
  border-radius: 7px;
  background: var(--panel-2);
  font-size: 11px;
  cursor: pointer;
}

.call-thesis {
  color: var(--muted);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── coin panel ──────────────────────────────────────────────────── */
.coin-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.coin-head h3 {
  font-size: 15px;
  color: #d9f99d;
  overflow-wrap: anywhere;
}

.coin-head .role {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.coin-desc {
  color: var(--muted);
  font-size: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 7.5em;
  overflow-y: auto;
}

.coin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── floating trade text: pops out, rises, fades (MMO damage numbers) ── */
.floater {
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  color: #4ade80;
  --o: #03170b;
  text-shadow: 2px 0 0 var(--o), -2px 0 0 var(--o), 0 2px 0 var(--o), 0 -2px 0 var(--o), 2px 2px 0 var(--o), -2px 2px 0 var(--o), 2px -2px 0 var(--o), -2px -2px 0 var(--o), 0 4px 0 rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transform-origin: 50% 100%;
  z-index: 5;
}

.floater .sub {
  display: block;
  margin-top: 3px;
  font-size: 0.62em;
  color: #f8fafc;
}

.floater.buy {
  color: #4ade80;
}

.floater.sell,
.floater.down {
  color: #fb7185;
  --o: #2a0509;
}

.floater.up {
  color: #86efac;
}

.floater.s {
  font-size: 12px;
}

.floater.l {
  font-size: 19px;
}

.floater.xl {
  font-size: 25px;
  color: #fde047;
  --o: #3b2102;
}

.floater.xl.sell {
  color: #f97316;
}

.floater.fee {
  color: #fde047;
  --o: #3b2102;
}

.floater.grad {
  color: #c4b5fd;
  --o: #1e1b4b;
}

.floater.transfer {
  color: #7dd3fc;
  --o: #082f49;
}

.floater.burn {
  color: #fb923c;
  --o: #431407;
}

.floater.emote {
  font-size: 22px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

/* ── KOL Tower: name tags, feed, panel ──────────────────────────── */
.kol-tag {
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px 3px;
  border: 1px solid var(--c);
  border-radius: 3px;
  color: #fef3c7;
  background: rgba(10, 8, 22, 0.78);
  white-space: nowrap;
  z-index: 2;
}

.feed[hidden] {
  display: none;
}

.ev.kol.win {
  border-color: rgba(34, 197, 94, 0.35);
}

.ev.kol.loss {
  border-color: rgba(244, 63, 94, 0.3);
}

.ev time {
  font-variant-numeric: tabular-nums;
}

.coin-link {
  font: inherit;
  font-weight: 600;
  color: #d9f99d;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.coin-link:hover {
  text-decoration: underline;
}

.kol-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  max-height: 260px;
  overflow-y: auto;
}

.kol-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--panel-2);
  border-left: 3px solid var(--c);
  cursor: pointer;
}

.kol-list li:hover {
  outline: 1px solid rgba(251, 191, 36, 0.5);
}

.kol-list .rank {
  color: var(--dim);
}

.kol-trades {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  font-size: 12px;
}

/* ── house token: status card and the waterfall of on-chain operations ── */
.token-card {
  margin-bottom: 8px;
}

.token-card h4 {
  font-size: 12px;
  margin-bottom: 4px;
}

.token-top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.token-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 4px;
}

.ops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}

.op {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  border-left: 3px solid var(--dim);
  font-size: 11.5px;
  animation: op-in 0.45s ease-out;
}

.op.buy {
  border-left-color: #22c55e;
}

.op.sell {
  border-left-color: #f43f5e;
}

.op.payout {
  border-left-color: #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.op.grad {
  border-left-color: #a78bfa;
}

.op.transfer {
  border-left-color: #38bdf8;
}

.op.burn {
  border-left-color: #fb923c;
}

.op.big {
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.op-main {
  min-width: 0;
}

.op-head {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.op.buy .op-head {
  color: #86efac;
}

.op.sell .op-head {
  color: #fda4af;
}

.op.payout .op-head {
  color: #fde047;
}

.op-sub {
  color: var(--dim);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op time,
.op-tx {
  color: var(--dim);
  font-size: 10px;
}

@keyframes op-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
    background: rgba(163, 230, 53, 0.25);
  }
}

.ev.fee {
  border-color: rgba(250, 204, 21, 0.35);
}

/* ── phones and narrow windows: docks become bottom sheets ───────── */
@media (max-width: 900px) {
  .topbar {
    padding: 6px 12px;
    gap: 6px 14px;
  }
  .stats {
    order: 3;
    flex-basis: 100%;
    gap: 2px 14px;
  }
  .stat .k {
    font-size: 9px;
  }
  .dock {
    display: none;
    left: 8px !important;
    right: 8px !important;
    top: auto;
    bottom: 58px;
    width: auto !important;
    max-height: 62%;
  }
  .dock.open {
    display: flex;
  }
  .dock.right .feed-panel {
    max-height: 100%;
  }
  .dock-close {
    display: block;
  }
  .floorbar {
    top: 10px;
    bottom: auto;
  }
  .world:has(.dock.open) .floorbar {
    display: none;
  }
  .note,
  .hints {
    display: none;
  }
  .mobile-tabs {
    display: flex;
    gap: 6px;
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 6;
  }
  .mobile-tabs button {
    font-family: var(--pixel);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--panel);
  }
  .agent-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── holder agents ─────────────────────────────────────────────────── */
.cta,
.cta-inline {
  font-family: var(--pixel);
  font-size: 11px;
  color: #1a2e05;
  background: #a3e635;
  border: 0;
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.cta:hover,
.cta-inline:hover {
  background: #bef264;
}
.cta:disabled,
.cta-inline:disabled {
  opacity: 0.6;
  cursor: wait;
}
.topbar .cta {
  margin-left: auto;
  margin-right: 10px;
}
.holder-rules p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.holder-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.holder-stats b {
  color: var(--text);
}
.holder-mine {
  margin: 10px 0;
}
.holder-me {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}
.holders {
  list-style: none;
  margin: 0;
  padding: 0;
}
.holders .mate.inactive {
  opacity: 0.55;
}
.holders .empty {
  font-size: 12px;
  padding: 8px 2px;
}
.kol-tag.holder-tag {
  font-size: 9px;
  opacity: 0.9;
}
dialog.join {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
dialog.join::backdrop {
  background: rgba(5, 4, 12, 0.65);
}
dialog.join header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
dialog.join header button {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.join-body p {
  font-size: 12px;
  line-height: 1.5;
}
.wallets {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.wallet-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.wallet-btn:hover {
  border-color: #a3e635;
}
.join-form {
  display: grid;
  gap: 8px;
}
.join-form label,
.join-form .label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.join-form input[type="text"],
.join-form input:not([type]) {
  font: inherit;
  color: var(--text);
  background: #0e0c1f;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
}
.join-form .styles {
  display: grid;
  gap: 6px;
}
.join-form label.style {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  color: var(--text);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
}
.join-form label.style span {
  grid-column: 2;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  cursor: pointer;
}
.swatch.on {
  border-color: #f8fafc;
}
.join-form .error a {
  color: #bef264;
}
@media (max-width: 900px) {
  .topbar .cta {
    font-size: 10px;
    padding: 6px 8px;
  }
}
.join-form .error,
.join-body .error {
  color: #fb7185;
  font-size: 12px;
  min-height: 1em;
  margin: 4px 0 0;
}

.ev.city .ev-sub {
  color: #fcd34d;
}

.ev.tweet .ev-quote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ev.chat .ev-quote {
  margin: 4px 0 0;
}

/* ── X feed: the running strip under the top bar ─────────────────── */
.xticker {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 26px;
  padding: 0 0 0 12px;
  background: #07060f;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  overflow: hidden;
  z-index: 9;
}
.xticker[hidden] {
  display: none;
}
.xticker-label {
  flex: none;
  font-family: var(--pixel);
  font-size: 10px;
  color: #0b0a18;
  background: #e5e7eb;
  border-radius: 4px;
  padding: 2px 6px;
}
.xticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.xticker-run {
  display: inline-block;
  animation: xticker var(--dur, 90s) linear infinite;
}
.xticker:hover .xticker-run {
  animation-play-state: paused;
}
.xticker-item {
  display: inline-block;
  margin-right: 40px;
  color: var(--text);
  text-decoration: none;
}
.xticker-item b {
  color: #93c5fd;
}
a.xticker-item:hover {
  text-decoration: underline;
}
@keyframes xticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .xticker-run {
    animation: none;
  }
  .xticker-track {
    overflow-x: auto;
  }
}

/* ── movable windows (windows.js) ──────────────────────────────────── */
.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}
.float-layer > .panel.floating {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  max-height: none;
  min-width: 240px;
  min-height: 140px;
  resize: both;
  overflow: hidden;
  background: var(--panel-solid, var(--panel));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.float-layer > .panel.floating[hidden] {
  display: none;
}
.panel.floating .panel-head,
.panel.floating .win-tools {
  cursor: move;
  user-select: none;
}
.panel.floating .pane,
.panel.floating .feed,
.panel.floating .panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.panel.floating .kol-feed,
.panel.floating .x-feed {
  flex: 1;
}
.win-btn {
  flex: none;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 5px;
  cursor: pointer;
}
.win-btn:hover {
  color: var(--text);
  border-color: #a3e635;
}
.win-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 6px;
}
.win-title {
  font-size: 10px;
  color: var(--dim, var(--muted));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.agent > .panel-body {
  min-width: 0;
}
.pill.reset-ui {
  cursor: pointer;
  background: transparent;
  font: inherit;
  font-size: 11px;
}
.pill.reset-ui::before {
  display: none;
}
@media (max-width: 900px) {
  .win-btn,
  .win-tools {
    display: none;
  }
}

.xticker.breaking {
  background: #450a0a;
  border-bottom-color: #ef4444;
}
.xticker.breaking .xticker-label {
  background: #ef4444;
  color: #fff;
  animation: blinkLabel 0.8s steps(2) infinite;
}
@keyframes blinkLabel {
  50% {
    opacity: 0.4;
  }
}
.ev.breaking {
  border-left: 3px solid #ef4444;
}

/* ── TV mode, moments, holder play ─────────────────────────────────── */
.tv-caption {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  max-width: min(640px, 90%);
  padding: 7px 14px;
  font-size: 14px;
  color: #fff;
  background: rgba(8, 6, 20, 0.82);
  border: 1px solid var(--line);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-caption b {
  color: #fca5a5;
  font-family: var(--pixel);
  font-size: 11px;
  margin-right: 6px;
}
.floorbar button.on {
  color: var(--text);
  background: var(--panel-2);
}
#momentsBtn.new {
  border-color: #a3e635;
  color: #bef264;
}
body.tv-clean .dock,
body.tv-clean .floorbar,
body.tv-clean .note,
body.tv-clean .hints,
body.tv-clean .mobile-tabs,
body.tv-clean .kol-tag,
body.tv-clean .tag {
  display: none !important;
}
dialog.moments {
  width: min(760px, calc(100vw - 32px));
}
.clips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.clip {
  margin: 0;
  display: grid;
  gap: 6px;
}
.clip video {
  width: 100%;
  border-radius: 6px;
  background: #000;
  image-rendering: pixelated;
}
.clip figcaption {
  font-size: 12px;
}
.clip-actions {
  display: flex;
  gap: 12px;
  font-size: 12px;
}
.clip-actions a {
  color: #bef264;
}
.holder-play {
  margin: 8px 0;
}
.holder-play:empty {
  display: none;
}
.holder-play h4 {
  font-size: 11px;
  margin: 10px 0 4px;
  color: var(--muted);
}
.play-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.play-row select {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: #0e0c1f;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
}
.play-row button {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.play-row button:hover {
  border-color: #a3e635;
}
/* Phantom is always offered; when the extension is not in the page it says so */
.wallet-ico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 13px;
}
.phantom-ico {
  background: #ab9ff2;
}
.wallet-btn.phantom {
  border-color: rgba(171, 159, 242, 0.55);
}
.wallet-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.phantom-help ol {
  margin: 6px 0 6px 18px;
  display: grid;
  gap: 3px;
}

/* Housemates pane: name search and the holder agents under the housemates */
.find-agent {
  width: 100%;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  margin-bottom: 8px;
}
.find-agent:focus-visible {
  outline: 2px solid #a3e635;
  outline-offset: 1px;
}
.board-head {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 12px 0 6px;
}
.board li[hidden] {
  display: none;
}

/* people in the city: name tags of the nearest ones, and what they shout about our coin */
.citizen-tag {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1;
  padding: 1px 3px 2px;
  border-radius: 3px;
  color: #e5e7eb;
  background: rgba(10, 8, 22, 0.55);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}
.floater.shout {
  font-size: 10px;
  line-height: 1.25;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  color: #fef08a;
  --o: #1c1917;
}
body.tv-clean .citizen-tag {
  display: none;
}
