/* Level editor, on top of site.css. */
.editor .top { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.editor .art a { margin-left: 6px; padding: 1px 6px; text-decoration: none; border: 1px solid var(--gray); }
.editor .art a.on { background: var(--panel); border-color: var(--cyan); color: var(--bright); }
.editor h1 {
  color: var(--pink);
  font-weight: normal;
  letter-spacing: 0.08em;
  font-size: clamp(28px, 6vw, 44px);
  margin: 12px 0 16px;
  text-shadow: 3px 3px 0 #550055;
}

.editor button, .editor .file, .editor select, .editor input[type=text] {
  font: inherit;
  font-size: 15px;
  color: var(--bright);
  background: #222;
  border: 2px solid var(--gray);
  padding: 6px 10px;
  min-height: 40px;
}
.editor button, .editor .file { cursor: pointer; }
.editor button:hover:not(:disabled), .editor .file:hover { border-color: var(--cyan); }
.editor button:focus-visible, .editor .file:focus-within, .editor select:focus-visible, .editor input:focus-visible,
.editor .thumb:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; }
.editor button:disabled { opacity: 0.4; cursor: default; }
.editor .file { display: inline-flex; align-items: center; position: relative; }
.editor .file input { position: absolute; width: 1px; height: 1px; opacity: 0; }

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

.editor .thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}
.editor .thumb {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  min-height: 0;
  background: #111;
}
.editor .thumb canvas { width: 76px; height: 36px; image-rendering: pixelated; display: block; }
.editor .thumb span { font-size: 13px; color: var(--text); }
.editor .thumb.on { border-color: var(--yellow); }
.editor .thumb.on span { color: var(--yellow); }
.editor .thumb.bad span::after { content: " !"; color: #ff5555; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 16px;
  align-items: start;
}
.board canvas {
  display: block;
  width: 100%;
  aspect-ratio: 608 / 288;
  image-rendering: pixelated;
  background: #000;
  border: 2px solid #5555ff;
  touch-action: none;
  cursor: crosshair;
}
.where { margin: 4px 0 0; font-size: 14px; color: #888; }

.palette { display: flex; flex-direction: column; gap: 4px; }
.editor .piece {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 2px 2px;
  text-align: left;
  min-height: 0;
}
.editor .piece canvas { width: 32px; height: 32px; image-rendering: pixelated; flex: none; background: #000; }
.editor .piece span { flex: 1; display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.editor .piece kbd { color: #888; font-family: inherit; }
.editor .piece.on { border-color: var(--yellow); background: var(--panel); }

.copy { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hint { display: block; margin: 14px 0 6px; }
.hint input { display: block; width: 100%; margin-top: 4px; }

.checks { list-style: none; padding: 0; margin: 8px 0; font-size: 15px; }
.checks li { padding: 2px 0 2px 28px; position: relative; }
.checks li::before { position: absolute; left: 0; width: 24px; text-align: center; }
.checks .ok { color: #55ff55; }
.checks .ok::before { content: "\2713"; }
.checks .bad { color: #ff5555; }
.checks .bad::before { content: "\2717"; }
.checks .warn { color: var(--yellow); }
.checks .warn::before { content: "!"; }

.actions { margin-top: 16px; }
.play.alt { background: var(--panel); }
.play.alt:hover, .play.alt:focus-visible { color: var(--panel); }
.sharebox input { width: 100%; }
.sharebox p { font-size: 14px; margin: 6px 0; }

.small { font-size: 14px; }
.small li { margin: 4px 0; }
.status {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 14px;
  color: var(--bright);
  background: var(--panel);
  border: 2px solid var(--cyan);
}
.status:empty { display: none; }

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .palette { flex-direction: row; flex-wrap: wrap; }
  .editor .piece { flex: 1 1 140px; }
}
