* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0e0e1c;
  color: #c8c8d0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: #b8b8d0;
  margin-bottom: 2px;
}

.subtitle {
  font-size: 11px;
  color: #666;
  margin-bottom: 14px;
  font-style: italic;
}

.controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.controls button {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 11px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 4px;
}

.controls button:hover {
  border-color: #666;
  color: #ddd;
  background: #222244;
}

.mode-toggle {
  display: flex;
  gap: 0;
  margin-right: 8px;
}

.mode-toggle button {
  border-radius: 4px 0 0 4px;
}

.mode-toggle button:last-child {
  border-radius: 0 4px 4px 0;
  border-left: none;
}

.mode-toggle button.active {
  background: #2a2a52;
  border-color: #5568aa;
  color: #dde;
}

/* Arena controls */
.arena-controls {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 620px;
}

.arena-controls.hidden {
  display: none;
}

.arena-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.arena-stat {
  font-size: 11px;
  color: #99a;
  background: #181830;
  padding: 3px 10px;
  border: 1px solid #2a2a42;
  border-radius: 4px;
}

.arena-row.sliders {
  gap: 14px;
}

.arena-row label {
  font-size: 10px;
  color: #889;
  display: flex;
  align-items: center;
  gap: 5px;
}

.arena-row input[type="range"] {
  width: 60px;
  height: 14px;
  -webkit-appearance: none;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 7px;
  outline: none;
}

.arena-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #7788bb;
  border-radius: 50%;
  cursor: pointer;
}

.arena-row span {
  min-width: 20px;
  text-align: right;
  color: #aab;
}

.arena-row button,
.arena-row select {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 10px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.arena-row button:hover {
  border-color: #666;
  color: #ddd;
  background: #222244;
}

.arena-row select {
  max-width: 180px;
  border-radius: 4px;
}

.toggle-btn {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 10px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.toggle-btn:hover {
  border-color: #666;
  color: #ddd;
  background: #222244;
}

.toggle-btn.active {
  background: #2a2a52;
  border-color: #d4a446;
  color: #d4a446;
}

/* Narrative panel */
.narrative-panel {
  max-width: 620px;
  margin-bottom: 12px;
  width: 100%;
}

.narrative-panel.hidden {
  display: none;
}

.narrative-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.narrative-label {
  font-size: 10px;
  color: #556;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.narrative-text {
  font-size: 11px;
  font-family: inherit;
  color: #99a;
  background: #141422;
  border: 1px solid #2a2a42;
  border-radius: 4px;
  padding: 8px 12px;
  line-height: 1.5;
  min-height: 36px;
}

.narrative-text.llm-narration {
  color: #b8a8d0;
  border-color: #3a2a52;
}

canvas {
  border: 1px solid #2a2a3e;
  border-radius: 6px;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 10px;
  color: #667;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
