:root {
  color-scheme: dark;
  --bg: #14161a;
  --panel: #1d2026;
  --line: #2e333c;
  --text: #e8e8e6;
  --muted: #9aa0aa;
  --accent: #ffb000;
}

* { box-sizing: border-box; }

/* Author display rules below would otherwise beat the UA stylesheet's [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, sans-serif;
}

main {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

#preview {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12100c;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

textarea, input[type="text"], select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
}

textarea { resize: vertical; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.row > div { flex: 1 1 10rem; }
.row > .grow { flex: 3 1 14rem; }

.displays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.displays label {
  flex: 1 1 6rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.displays label:has(:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.checkbox {
  display: flex;
  align-items: flex-end;
}

.checkbox label {
  margin: 0 0 0.55rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--text);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

button {
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--accent);
  color: #1a1204;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

button:hover { filter: brightness(1.1); }

#status { font-size: 0.9rem; color: var(--muted); }
#status.ok { color: #6ede8a; }
#status.warn { color: var(--accent); }
#status.error { color: #ff7a6b; }

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modes label {
  flex: 1 1 8rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.modes label:has(:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

section > button { align-self: flex-start; }

.caption {
  margin: 0;
  font-size: 1.05rem;
}

.credit {
  margin: -0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.credit a { color: inherit; }

.note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
