/* phase-3 scaffold — minimal styling, expressive defaults so panels are
   legible without aspiring to be the final look. */

:root {
  --bg:        #0c0d10;
  --bg-panel:  #15171c;
  --fg:        #e7e9ed;
  --fg-dim:    #8a8e97;
  --accent:    #6cd6ff;
  --warn:      #ffb86c;
  --mono:      "JetBrains Mono", "Fira Code", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, sans-serif;
  padding: 16px;
}

header { margin-bottom: 14px; }
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header .meta { margin: 4px 0 0; font-size: 12px; color: var(--fg-dim); }
header .meta a { color: var(--fg-dim); }

#controls {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
  padding: 8px; background: var(--bg-panel); border-radius: 6px;
}
#controls button {
  background: #222630; color: var(--fg); border: 1px solid #2c313d;
  padding: 6px 10px; border-radius: 4px; cursor: pointer;
  font: inherit; font-size: 13px;
}
#controls button:hover { background: #2a2f3b; border-color: var(--accent); }
#controls button:active { transform: translateY(1px); }
#controls .status { margin-left: auto; color: var(--fg-dim); font-family: var(--mono); font-size: 12px; }
#controls .status.err { color: var(--warn); }
#controls .speed {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg-dim); font-family: var(--mono);
  margin-left: 12px;
}
#controls .speed input[type="range"] { width: 120px; }
#controls .speed #speed-display { min-width: 3em; text-align: right; color: var(--fg); }
#controls button.running { background: #3a4055; border-color: var(--accent); }

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "editor    registers  die"
    "memory    narration  die";
  gap: 12px;
  height: calc(100vh - 130px);
}
#panel-editor    { grid-area: editor; }
#panel-registers { grid-area: registers; }
#panel-memory    { grid-area: memory; }
#panel-narration { grid-area: narration; }
#panel-die       { grid-area: die; }
.canvas-wrap {
  flex: 1; min-height: 0;
  position: relative;
  border: 1px solid #1f232b;
  border-radius: 4px;
  overflow: hidden;
}
#die-canvas {
  display: block;
  width: 100%; height: 100%;
  background: #000;
}
.panel {
  background: var(--bg-panel);
  border: 1px solid #1f232b;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.panel h2 {
  margin: 0 0 8px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-dim);
}

.editor-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.editor-header h2 { margin: 0; }
#lesson-picker {
  background: #0a0b0e; color: var(--fg); border: 1px solid #1f232b;
  font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 3px;
  cursor: pointer;
}
#lesson-picker:focus { outline: none; border-color: var(--accent); }
.lesson-blurb {
  margin: 0 0 6px; font-size: 12px; color: var(--fg-dim);
  font-style: italic; min-height: 1.4em;
}

#src {
  flex: 1; resize: none; min-height: 0;
  background: #0a0b0e; color: var(--fg);
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  border: 1px solid #1f232b; border-radius: 4px;
  padding: 8px; outline: none;
}
#src:focus { border-color: var(--accent); }

#regs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-family: var(--mono); }
#regs > div { display: flex; align-items: baseline; gap: 8px; }
#regs .rname { color: var(--fg-dim); font-size: 11px; min-width: 32px; text-transform: uppercase; }
#regs .rval { color: var(--fg); font-size: 14px; }
#regs .flags-row { grid-column: 1 / -1; }
#regs .rval.changed { color: var(--accent); }

#mem-dump, #events {
  flex: 1; overflow: auto; min-height: 0;
  margin: 0; padding: 8px;
  background: #0a0b0e;
  border: 1px solid #1f232b; border-radius: 4px;
  font-family: var(--mono); font-size: 12px; line-height: 1.4;
  color: var(--fg);
  white-space: pre;
}

.mem-row { margin-bottom: 6px; font-size: 12px; color: var(--fg-dim); }
.mem-row input {
  background: #0a0b0e; color: var(--fg); border: 1px solid #1f232b;
  font-family: var(--mono); font-size: 12px;
  padding: 2px 6px; width: 50px; border-radius: 3px;
}
