:root {
  --void: #0A0A0F;
  --maroon: #8B0000;
  --red: #E10600;
  --panic: #FF3B3B;
  --bone: #F5E9D8;
  --bone-dim: #9d948a;
  --panel: #111118;
  --line: #26202a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--maroon);
}
.logo { font-weight: 700; letter-spacing: .18em; font-size: 18px; }
.logo .corp { color: var(--red); margin-left: 6px; }
.tag { color: var(--bone-dim); font-size: 11px; margin-left: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .08em;
  white-space: nowrap;
}
.chip.clock { color: var(--panic); border-color: var(--maroon); }
.chip.vault { color: var(--bone); }
.chip.mood.EUPHORIA { color: #ffd87a; }
.chip.mood.CALM { color: var(--bone); }
.chip.mood.NERVOUS { color: var(--panic); }
.chip.mood.MELTDOWN { color: #fff; background: var(--red); border-color: var(--red); }

.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 0;
}
.badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  padding: 3px 10px;
}
.badge-sub { color: var(--bone-dim); font-size: 11px; letter-spacing: .12em; }

.stage { padding: 12px 16px 4px; }
.canvas-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--void);
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  cursor: default;
}
canvas.point { cursor: pointer; }

#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--bone);
  color: #17120c;
  font-size: 11px;
  line-height: 1.35;
  padding: 5px 8px;
  max-width: 170px;
  border: 2px solid #17120c;
  box-shadow: 2px 2px 0 rgba(0,0,0,.6);
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -7px;
  border: 5px solid transparent;
  border-top-color: #17120c;
  transform: translateX(-50%);
}
.bubble .who { color: var(--red); font-weight: 700; margin-right: 4px; }

.modal-back[hidden] { display: none; }
.modal-back {
  position: fixed; inset: 0;
  background: rgba(5,5,8,.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal {
  width: min(720px, 94vw);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--maroon);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--maroon);
  letter-spacing: .15em; font-size: 13px;
}
.modal-head button {
  background: none; border: 1px solid var(--line); color: var(--bone);
  cursor: pointer; font: inherit; padding: 2px 8px;
}
.modal-head button:hover { border-color: var(--panic); color: var(--panic); }
.modal-body { padding: 12px 14px; overflow-y: auto; }
.modal-foot {
  padding: 8px 14px; border-top: 1px solid var(--line);
  color: var(--bone-dim); font-size: 10.5px;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--bone-dim); font-weight: 400; font-size: 10px; letter-spacing: .12em; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
.score { font-weight: 700; }
.score.hi { color: #ffd87a; }
.score.mid { color: var(--bone); }
.score.lo { color: var(--panic); }
.sec { font-size: 10.5px; }
.sec.ok { color: var(--bone-dim); }
.sec.bad { color: var(--panic); font-weight: 700; }
.sec.unk { color: #777; }
.pos { color: #ffd87a; }
.neg { color: var(--panic); }
.mini-cols { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.mini-cols > div { flex: 1; min-width: 220px; }
.mini-cols h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .15em; color: var(--bone-dim); }
a { color: var(--panic); }

.foot {
  color: var(--bone-dim);
  font-size: 11px;
  padding: 10px 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.5;
}
