:root {
  --bg: #ffffff;
  --board: #ffffff;
  --ink: #111111;
  --muted: #9a9aa2;
  --hairline: #e3e3e6;
  font-family: "Libre Baskerville", ui-serif, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px;
}

/* Level title ------------------------------------------------------------- */
.level-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #555555;
}

/* Board ------------------------------------------------------------------- */
canvas {
  background: var(--board);
}

/* Keybind help ------------------------------------------------------------ */
.help {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
  margin: 0;
}
kbd {
  background: var(--board);
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1.5px 6px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
}

/* Nav link ---------------------------------------------------------------- */
.nav-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.nav-link:hover { color: var(--ink); }

/* Editor ------------------------------------------------------------------ */
#editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px;
  width: min(560px, 92vw);
}

.bar {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}
.bar .spacer { flex: 1; }
.bar label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

.text-in, .num-in {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--board);
  border: 1.5px solid var(--hairline);
  border-radius: 8px;
  padding: 7px 10px;
}
.text-in { flex: 1; min-width: 120px; }
.num-in { width: 56px; }

#palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.tool {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--board);
  border: 1.5px solid var(--hairline);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.tool:hover { border-color: var(--ink); }
.tool.active {
  background: var(--ink);
  color: var(--board);
  border-color: var(--ink);
}
.tool .swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

#json {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink);
  background: #fafafa;
  border: 1.5px solid var(--hairline);
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
}

/* Hide editing chrome while play-testing. */
body.testing #palette,
body.testing #edit-bar,
body.testing #io-bar,
body.testing #json,
body.testing #edit-help { display: none; }
#test-help { display: none; }
body.testing #test-help { display: block; }
