/* Light Newsprint Three.js Swarm Theater matching The Sebeni Chronicle */
.theater-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(330px, 1fr);
  gap: 14px;
  border: 1px solid var(--rule-heavy);
  background: var(--paper-card);
  padding: 12px;
}

.theater-wrap.fullscreen {
  min-height: calc(100vh - 165px);
}

@media (max-width: 980px) {
  .theater-wrap { grid-template-columns: 1fr; }
}

.theater-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--rule-hair);
  background: var(--paper);
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 0.8125rem;
}

.theater-toolbar select,
.theater-toolbar input[type="range"] {
  font-family: var(--sans);
  font-size: 0.8125rem;
  background: var(--paper-card);
  color: var(--ink);
  border: 1px solid var(--rule-heavy);
  padding: 4px 8px;
}

.theater-stage-box {
  position: relative;
  border: 1px solid var(--rule-heavy);
  background: var(--paper);
  min-height: 520px;
  height: 540px;
  overflow: hidden;
}

.theater-wrap.fullscreen .theater-stage-box {
  height: calc(100vh - 220px);
  min-height: 560px;
}

.theater-stage-box canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

.node-pill {
  position: absolute;
  transform: translate(-50%, -120%);
  background: rgba(251, 248, 240, 0.94);
  color: var(--ink);
  border: 1px solid var(--rule-heavy);
  padding: 2px 7px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(24, 22, 19, 0.08);
  pointer-events: auto;
  cursor: pointer;
  transition: background-color 180ms var(--ease-editorial), color 180ms var(--ease-editorial);
}

[data-theme="evening"] .node-pill {
  background: rgba(30, 27, 24, 0.94);
}

.node-pill.coord {
  border-color: var(--ochre);
  color: var(--ochre);
}

.node-pill.selected {
  background: var(--ink);
  color: var(--paper);
}

.node-pill small {
  font-weight: 500;
  opacity: 0.82;
  margin-left: 3px;
}

.stage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 7px 12px;
  border-top: 1px solid var(--rule-hair);
  background: var(--paper-card);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.hud-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.hud-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.hud-kpi {
  border: 1px solid var(--rule-hair);
  background: var(--paper);
  padding: 7px 9px;
}

.hud-kpi .k {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.hud-kpi .v {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-top: 2px;
}

.cluster-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cluster-chip {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 3px 8px;
  border: 1px solid var(--rule-hair);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 180ms var(--ease-editorial), color 180ms var(--ease-editorial);
}

.cluster-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.exchange-feed {
  flex: 1;
  min-height: 310px;
  max-height: 410px;
  overflow-y: auto;
  border: 1px solid var(--rule-hair);
  background: var(--paper);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theater-wrap.fullscreen .exchange-feed {
  max-height: calc(100vh - 400px);
}

.lang-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--rule-hair);
  background: var(--paper-card);
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 0.8125rem;
}

.lang-pill {
  border: 1px solid var(--rule-hair);
  background: var(--paper);
  color: var(--ink-muted);
  padding: 3px 8px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 180ms var(--ease-editorial), color 180ms var(--ease-editorial);
}

.lang-pill.done {
  border-color: var(--forest);
  color: var(--forest);
}

.lang-pill.live {
  border-color: var(--crimson);
  color: var(--crimson);
  font-weight: 700;
}

.lang-pill.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.admin-drawer {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--rule-heavy);
  background: var(--paper-alt);
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 0.8125rem;
}

.admin-drawer.open {
  display: flex;
}

.admin-drawer input {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 4px 8px;
  border: 1px solid var(--rule-heavy);
  background: var(--paper-card);
  color: var(--ink);
}

.ex-card {
  border: 1px solid var(--rule-hair);
  border-left: 3px solid var(--slate);
  background: var(--paper-card);
  padding: 7px 9px;
  font-size: 0.875rem;
}

.ex-card.kind-cluster_spawn { border-left-color: var(--ochre); }
.ex-card.kind-resource_lookup { border-left-color: var(--forest); }
.ex-card.kind-agent_exchange { border-left-color: var(--slate); }
.ex-card.kind-consensus_vote { border-left-color: var(--ochre); }
.ex-card.kind-consensus_reached { border-left-color: var(--forest); background: var(--paper-alt); }
.ex-card.kind-shadow_patch { border-left-color: var(--slate); }
.ex-card.kind-native_command,
.ex-card.kind-native_generation { border-left-color: var(--crimson); }
.ex-card.kind-coordinator_audit,
.ex-card.kind-coordinator_brief,
.ex-card.kind-run_complete { border-left-color: var(--ink); }

.ex-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

.ex-body {
  font-family: var(--serif);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
