/* 88x31.css: the button maker in acme's colours. Tag bars are pale cyan
   over cream bodies; selection is acme's dark yellow, and scrollbars are
   its khaki trough with a cream thumb. */

@font-face {
  font-family: "Go Mono";
  src: url(/fonts/mono/go-mono/GoMono-Regular.subset.woff2) format("woff2");
  font-display: swap;
}

:root {
  --body: #ffffea;
  --tag: #eaffff;
  --hi: #eeee9e;
  --box: #8888cc;
  --scroll: #99994c;
  --ink: #000000;
  --grey: #444444;
  --blue: #000099;
  --teal: #008888;
  --red: #aa0000;
  --green: #006600;
  --palegreen: #aaffaa;
  --paleteal: #aaffff;
  color-scheme: light;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scrollbar-color: var(--body) var(--scroll); }

body {
  margin: 0;
  background: var(--body);
  color: var(--ink);
  font: 13px/1.4 "Go Mono", ui-monospace, monospace;
}

a { color: var(--blue); }

h2 {
  margin: 0;
  font-size: inherit;
  font-weight: normal;
}

/* tag bars: the line of words above every window, as in acme */

.tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  padding: 3px 6px;
  background: var(--tag);
  border-bottom: 1px solid var(--box);
}

.box {
  width: 11px;
  height: 11px;
  flex: none;
  background: var(--box);
}

.tag button {
  padding: 0 3px;
  border: 0;
  background: none;
}

.tag button:hover { background: var(--hi); }

.tag form { margin-left: auto; }

.top { border-bottom: 1px solid var(--ink); }

.where {
  color: var(--ink);
  font-weight: bold;
  text-decoration: none;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}

.credits {
  margin-top: 0;
  border-top: 1px solid var(--box);
  border-bottom: 0;
  color: var(--grey);
  font-size: 12px;
}

.credits p { margin: 2px 0; }

.nojs {
  margin: 12px;
  padding: 8px;
  background: var(--hi);
}

/* windows */

.cols {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 270px;
  min-height: calc(100vh - 60px);
}

.win {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--ink);
}

.win:last-child { border-right: 0; }

.body {
  flex: 1;
  padding: 8px;
  overflow: auto;
}

/* controls */

button {
  padding: 2px 7px;
  border: 1px solid var(--scroll);
  border-radius: 0;
  background: var(--tag);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

button:hover { background: var(--hi); }

button[aria-pressed="true"] {
  background: var(--hi);
  box-shadow: inset 0 0 0 1px var(--ink);
}

button.b2 { color: var(--red); }

button.b3 {
  background: var(--palegreen);
  border-color: var(--green);
  color: var(--green);
}

button.b3:hover { background: var(--hi); }

input, select, textarea {
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid var(--scroll);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input[type="number"] { width: 6em; }

input[type="color"] {
  width: 34px;
  height: 22px;
  padding: 1px;
}

input[type="checkbox"] { accent-color: var(--blue); }

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

fieldset {
  margin: 0 0 8px;
  padding: 6px 0 0;
  border: 0;
  border-top: 1px solid var(--hi);
}

fieldset:first-child { border-top: 0; }

legend {
  padding: 0 4px 0 0;
  color: var(--grey);
}

label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
  color: var(--grey);
}

label input, label select, label textarea { color: var(--ink); }

label.check {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

label.bare { justify-content: flex-end; }

textarea { resize: vertical; }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 8px;
  margin-bottom: 6px;
}

.row label { margin-bottom: 0; }

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 8px;
}

.brushes { align-items: center; }

.brushes span { color: var(--grey); }

.brushes input { width: 4em; }

.pad, .align {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
}

.pad { grid-template-columns: repeat(4, 2.2em); }

.align { grid-template-columns: repeat(3, 1fr); }

.hint {
  margin: 4px 0 0;
  color: var(--grey);
  font-size: 12px;
}

/* preview */

#view .tag input[type="range"] {
  width: 90px;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--box);
}

.stage-wrap {
  overflow: auto;
  padding: 12px 0;
  text-align: center;
}

#stage {
  max-width: none;
  border: 1px solid var(--ink);
  image-rendering: pixelated;
  cursor: crosshair;
  touch-action: none;
}

.out {
  padding-top: 8px;
  border-top: 1px solid var(--hi);
}

.actual {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--grey);
}

#actual {
  border: 1px solid var(--scroll);
  background: #ffffff;
}

#stats, #note {
  min-height: 1.4em;
  margin: 6px 0;
  color: var(--grey);
}

#note { color: var(--green); }

#animation {
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hi);
}

#frames {
  display: flex;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 0 4px;
  overflow-x: auto;
  list-style: none;
}

#frames li {
  flex: none;
  text-align: center;
  color: var(--grey);
  cursor: pointer;
}

#frames canvas {
  display: block;
  border: 1px solid var(--scroll);
  background: #ffffff;
  image-rendering: pixelated;
}

#frames li.on canvas { outline: 2px solid var(--blue); }

/* layers */

.adds {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 6px;
}

#layer-list {
  margin: 0 0 6px;
  padding: 0;
  border-top: 1px solid var(--hi);
  list-style: none;
}

#layer-list li {
  display: grid;
  grid-template-columns: auto auto 66px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 4px;
  padding: 3px 3px 3px 6px;
  border-bottom: 1px solid var(--hi);
  cursor: default;
}

#layer-list li.on { background: var(--hi); }

#layer-list li.active { box-shadow: inset 3px 0 var(--blue); }

#layer-list .flag {
  grid-row: span 2;
  width: 20px;
  padding: 0;
  color: var(--scroll);
}

#layer-list .flag[aria-pressed="true"] {
  background: var(--paleteal);
  box-shadow: none;
  color: var(--ink);
}

#layer-list .thumb {
  grid-row: span 2;
  width: 66px;
  height: 23px;
  border: 1px solid var(--scroll);
  background: #ffffff;
  image-rendering: pixelated;
}

#layer-list .name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#layer-list .type {
  color: var(--grey);
  font-size: 11px;
}

/* dialogs */

dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--body);
  color: var(--ink);
}

dialog::backdrop { background: rgba(119, 119, 119, 0.6); }

#help { width: min(560px, calc(100vw - 32px)); }

#help table { border-collapse: collapse; }

#help td {
  padding: 2px 12px 2px 0;
  vertical-align: top;
}

#help td:first-child { white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}

.grid button {
  padding: 3px;
  background: #ffffff;
}

.grid img {
  display: block;
  margin: auto;
  image-rendering: pixelated;
}

/* narrow screens: the preview first, then properties and layers */

@media (max-width: 960px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .win { border-right: 0; border-bottom: 1px solid var(--ink); }
  #view { order: -1; }
}
