/* APEIRON: basic grønnskjerm. Flat svart og grønt, ingen effekter. */
:root {
  --bg: #000;
  --g: #33ff66;
  --w: #ffffff;
  --t: #40e0d0;
  --b: #6aa8ff;
  --y: #ffff55;
  --r: #ff5555;
  --p: #ff79c6;
  --fs: 16px;
  --lh: 1.3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#crt {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--fs);
  line-height: var(--lh);
  color: var(--g);
  background: var(--bg);
  padding: 0.5em 1ch 0.2em;
}

.row {
  white-space: pre;
  height: calc(var(--lh) * 1em);
  overflow: hidden;
}

.g { color: var(--g); }
.w { color: var(--w); }
.t { color: var(--t); }
.b { color: var(--b); }
.y { color: var(--y); }
.r { color: var(--r); }
.p { color: var(--p); }
.rv { background: var(--g); color: var(--bg); }

.click { cursor: pointer; }

/* Markørlinje: valgt menylinje, og raden der valgfeltet står i en liste */
.item:focus { background: var(--g); color: var(--bg); outline: none; text-decoration: none; }
.row:has(input.opt:focus) .click { background: var(--g); color: var(--bg); }
.click:hover { text-decoration: underline; text-underline-offset: 3px; }

input.fld, textarea.fld {
  font: inherit;
  color: var(--g);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--g);
  outline: none;
  padding: 0;
  margin: 0;
  height: calc(var(--lh) * 1em);
  caret-color: var(--w);
  vertical-align: top;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

input.fld:focus { color: var(--w); border-bottom-color: var(--w); }
input.fld.w { color: var(--w); }

input.fld.err {
  background: var(--r);
  color: var(--bg);
  border-bottom-color: var(--r);
  caret-color: var(--bg);
}

textarea.fld {
  resize: none;
  white-space: pre;
  overflow: auto;
  border: 1px solid var(--g);
}
textarea.fld:focus { border-color: var(--w); color: var(--w); }

/* Handlingslinja: koden og navnet, trykk eller skriv koden på kommandolinja */
#actions {
  display: flex;
  flex-wrap: wrap;
  column-gap: 2ch;
  align-content: flex-start;
  height: calc(var(--lh) * 2em);
  overflow: hidden;
  white-space: pre;
}

button.act {
  font: inherit;
  line-height: inherit;
  color: var(--t);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 0;
}
button.act:hover, button.act:focus-visible { color: var(--w); text-decoration: underline; text-underline-offset: 3px; outline: none; }

#oia {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--g);
  padding-top: 0.1em;
  white-space: pre;
  font-size: 0.85em;
}

#oia .busy { color: var(--y); }

#file { display: none; }

/* ---------------------------------------------------------------- mobil */
body.compact { align-items: stretch; justify-content: flex-start; }
body.compact #crt { width: 100vw; height: 100dvh; padding: 6px 6px 0; display: flex; flex-direction: column; }
body.compact #actions {
  flex-wrap: nowrap;
  overflow-x: auto;
  height: auto;
  gap: 6px;
  padding: 6px 0;
  scrollbar-width: none;
}
body.compact #actions::-webkit-scrollbar { display: none; }
body.compact button.act {
  color: var(--g);
  border: 1px solid var(--g);
  padding: 9px 14px;
  white-space: nowrap;
  flex: 0 0 auto;
}
body.compact button.act:active { background: var(--g); color: var(--bg); }
body.compact .row .click { text-decoration: none; }
