:root {
  --bg: #0b0e13;
  --panel: #141922;
  --line: #232b38;
  --text: #e8edf5;
  --dim: #8d9aad;
  --accent: #7ee081;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.head {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 20px 8px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3.1vw, 31px);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.sub {
  margin: 0 0 20px;
  max-width: 74ch;
  color: var(--dim);
}
.sub b { color: var(--text); font-weight: 600; }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.spacer { flex: 1 1 12px; }

button {
  appearance: none;
  border: 1px solid var(--line);
  background: #1c2431;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
button:hover { background: #26303f; border-color: #33405280; }
button:active { transform: translateY(1px); }
button.primary { background: #22381f; border-color: #35502f; }
button.primary:hover { background: #2b4627; }

kbd {
  font: 600 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--dim);
  background: #0d1219;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 3px 4px;
}

a.link {
  color: var(--dim);
  font-size: 13px;
  text-decoration: none;
  padding: 0 6px;
  border-bottom: 1px solid transparent;
}
a.link:hover { color: var(--text); border-bottom-color: var(--line); }

.slider, .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dim);
  padding: 0 4px;
}
.slider input[type=range] { width: 118px; accent-color: var(--accent); }
.check input { accent-color: var(--accent); }
output {
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  min-width: 42px;
}

.stage {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

.panel {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  line-height: 0;
}

canvas.view {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.parent { margin-bottom: 14px; }

.kids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.kids .panel { cursor: pointer; }
.kids .panel:hover { border-color: #46586f; }

.panel.flash { animation: flash 0.32s ease-out; }
@keyframes flash {
  from { box-shadow: 0 0 0 3px var(--accent); }
  to   { box-shadow: 0 0 0 0 transparent; }
}

/* Chunky in-image label, the way the reference sheets do it. */
.tag {
  position: absolute;
  top: 6px;
  left: 12px;
  font: 800 clamp(20px, 3.4vw, 38px)/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  -webkit-text-stroke: 1px rgba(255,255,255,0.5);
  paint-order: stroke fill;
  pointer-events: none;
  user-select: none;
}
.parent .tag { font-size: clamp(24px, 4vw, 44px); }

.badge {
  position: absolute;
  top: 10px;
  right: 12px;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #dfe7f2;
  background: rgba(6, 9, 14, 0.62);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 5px 8px;
  border-radius: 999px;
}
.badge b { color: var(--accent); }

.promote {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 12px;
  padding: 5px 8px;
  background: rgba(9, 13, 19, 0.78);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.12s;
}
.kids .panel:hover .promote { opacity: 1; }

canvas.dna {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12px;
  background: rgba(6, 9, 14, 0.55);
  image-rendering: pixelated;
}
body.no-dna canvas.dna { display: none; }

.foot {
  margin: 18px 2px 0;
  color: var(--dim);
  font-size: 13px;
}
body.no-dna .foot { opacity: 0.35; }

@media (max-width: 720px) {
  .kids { grid-template-columns: 1fr; }
  .bar { gap: 6px; }
}
