/* The boot screen (parts/bios.js), drawn in text mode (parts/textmode.js):
   a screen of parchment over the whole page with no pointer, the grid of
   cells in the middle, and on a touch screen a row of keys under it. The
   cells take the archive's colours in place of the PC's (at the end). */
#bios-screen {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #f6f4ee;
  display: flex;
  flex-direction: column;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  outline: none;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}
#bios-screen * { cursor: none; }
#bios-screen.bios-off { opacity: 0; }

.bios-host {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* what a screen reader is told; not drawn */
.bios-said {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* a key per thing the keyboard does here, for a screen with no keyboard */
.bios-keys {
  display: flex;
  gap: 6px;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: #efece1;
  border-top: 1px solid #aca699;
}
.bios-keys button {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  font: 700 13px 'JetBrains Mono', 'Courier New', monospace;
  color: #17150f;
  background: #f6f4ee;
  border: 2px solid #17150f;
  border-radius: 0;
  box-shadow: 2px 2px 0 #17150f;
}

/* ---- text mode: the grid, one face, the PC's sixteen colours ---- */
.tm-grid {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  white-space: pre;
  overflow: hidden;
}
.tm-row { overflow: hidden; }
/* a run is a box as tall as the cell, so its paper fills the cell with no seam between rows */
.tm-row > span { display: inline-block; vertical-align: top; height: 100%; }
/* the ink as a colour and as --ink, which a drawn character's strokes are painted in */
.tm-i0 { color: #000000; --ink: #000000; }   .tm-p0 { background-color: #000000; }
.tm-i1 { color: #0000aa; --ink: #0000aa; }   .tm-p1 { background-color: #0000aa; }
.tm-i2 { color: #00aa00; --ink: #00aa00; }   .tm-p2 { background-color: #00aa00; }
.tm-i3 { color: #00aaaa; --ink: #00aaaa; }   .tm-p3 { background-color: #00aaaa; }
.tm-i4 { color: #aa0000; --ink: #aa0000; }   .tm-p4 { background-color: #aa0000; }
.tm-i5 { color: #aa00aa; --ink: #aa00aa; }   .tm-p5 { background-color: #aa00aa; }
.tm-i6 { color: #aa5500; --ink: #aa5500; }   .tm-p6 { background-color: #aa5500; }
.tm-i7 { color: #aaaaaa; --ink: #aaaaaa; }   .tm-p7 { background-color: #aaaaaa; }
.tm-i8 { color: #555555; --ink: #555555; }   .tm-p8 { background-color: #555555; }
.tm-i9 { color: #5555ff; --ink: #5555ff; }   .tm-p9 { background-color: #5555ff; }
.tm-i10 { color: #55ff55; --ink: #55ff55; }  .tm-p10 { background-color: #55ff55; }
.tm-i11 { color: #55ffff; --ink: #55ffff; }  .tm-p11 { background-color: #55ffff; }
.tm-i12 { color: #ff5555; --ink: #ff5555; }  .tm-p12 { background-color: #ff5555; }
.tm-i13 { color: #ff55ff; --ink: #ff55ff; }  .tm-p13 { background-color: #ff55ff; }
.tm-i14 { color: #ffff55; --ink: #ffff55; }  .tm-p14 { background-color: #ffff55; }
.tm-i15 { color: #ffffff; --ink: #ffffff; }  .tm-p15 { background-color: #ffffff; }
/* a character the face may lack, in a box one cell wide (--tm-w); a drawn one shows its strokes, not its glyph */
.tm-cell { width: var(--tm-w); overflow: hidden; text-align: center; }
.tm-drawn { color: transparent; background-repeat: no-repeat; }

/* The boot's own colours: the PC's sixteen given the archive's, parchment and charcoal (the Alto's, Smalltalk-80's,
   Ergodic.look's). The index keeps its role, not its hue: 0 is the ink, 15 the paper's cream, 7 graphite. */
#bios-screen .tm-i0 { color: #17150f; --ink: #17150f; }   #bios-screen .tm-p0 { background-color: #f6f4ee; }   /* charcoal ink, cream paper */
#bios-screen .tm-i1 { color: #2b4bd7; --ink: #2b4bd7; }   #bios-screen .tm-p1 { background-color: #2b4bd7; }   /* the door's blue */
#bios-screen .tm-i2 { color: #1e6b3a; --ink: #1e6b3a; }   #bios-screen .tm-p2 { background-color: #1e6b3a; }   /* archival green */
#bios-screen .tm-i3 { color: #5a554c; --ink: #5a554c; }   #bios-screen .tm-p3 { background-color: #e2ddd0; }   /* the flash's paper */
#bios-screen .tm-i4 { color: #b82020; --ink: #b82020; }   #bios-screen .tm-p4 { background-color: #b82020; }   /* the compiler's red */
#bios-screen .tm-i6 { color: #7a4e1d; --ink: #7a4e1d; }   #bios-screen .tm-p6 { background-color: #7a4e1d; }   /* ochre */
#bios-screen .tm-i7 { color: #3f3b33; --ink: #3f3b33; }   #bios-screen .tm-p7 { background-color: #efece1; }   /* graphite, the panel's beige */
#bios-screen .tm-i8 { color: #aca699; --ink: #aca699; }   #bios-screen .tm-p8 { background-color: #17150f; }   /* a rule's grey, an inverted bar */
#bios-screen .tm-i15 { color: #fdfbf7; --ink: #fdfbf7; }  #bios-screen .tm-p15 { background-color: #fdfbf7; }  /* cream */
