:root {
  --bsod-blue: #0000aa;
  --desktop-teal: #008080;
  --text-white: #ffffff;
  --label-bg: #aaaaaa;
  --scale: 1;
  --surface-w: 640px;
  --surface-h: 400px;
  --text-scale-x: 1;
  --cell-w: 8px;
  --line-h: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body[data-scene="restart"],
body[data-scene="startingWindows"],
body[data-scene="startupMenu"],
body[data-scene="stepByStep"],
body[data-scene="commandPrompt"],
body[data-scene="invalidSystemDisk"] {
  background: #000000;
}

body[data-scene="safeMode"] {
  background: var(--desktop-teal);
}

body {
  font-family: "NULL95 Fixedsys", Fixedsys, "Fixedsys Excelsior 3.01", "Lucida Console", monospace;
}

.viewport {
  display: grid;
  width: 100vw;
  height: 100vh;
  place-items: center;
  overflow: hidden;
  background: var(--bsod-blue);
}

body[data-scene="restart"] .viewport,
body[data-scene="startingWindows"] .viewport,
body[data-scene="startupMenu"] .viewport,
body[data-scene="stepByStep"] .viewport,
body[data-scene="commandPrompt"] .viewport,
body[data-scene="invalidSystemDisk"] .viewport {
  background: #000000;
}

body[data-scene="safeMode"] .viewport {
  background: var(--desktop-teal);
}

body[data-scene="startingWindows"] .viewport {
  place-items: start;
}

.surface {
  width: var(--surface-w);
  height: var(--surface-h);
  overflow: hidden;
}

.frame {
  position: relative;
  width: 640px;
  height: 400px;
  overflow: hidden;
  transform: scale(var(--scale));
  transform-origin: top left;
  background: var(--bsod-blue);
  color: var(--text-white);
}

body[data-scene="restart"] .frame,
body[data-scene="startingWindows"] .frame,
body[data-scene="startupMenu"] .frame,
body[data-scene="stepByStep"] .frame,
body[data-scene="commandPrompt"] .frame,
body[data-scene="invalidSystemDisk"] .frame {
  background: #000000;
}

body[data-scene="safeMode"] .frame {
  background: var(--desktop-teal);
}

#screen {
  margin: 0;
  width: max-content;
  height: 400px;
  color: var(--text-white);
  font: 13.333px/var(--line-h) "NULL95 Fixedsys", Fixedsys, "Fixedsys Excelsior 3.01", "Lucida Console", monospace;
  font-synthesis: none;
  -webkit-font-smoothing: none;
  white-space: pre;
  letter-spacing: 0;
  transform: scaleX(var(--text-scale-x));
  transform-origin: top left;
  user-select: text;
}

body[data-scene="restart"] #screen,
body[data-scene="restart"] .label,
body[data-scene="restart"] .cursor,
body[data-scene="startingWindows"] .label,
body[data-scene="startingWindows"] .cursor,
body[data-scene="startupMenu"] .label,
body[data-scene="startupMenu"] .cursor,
body[data-scene="stepByStep"] .label,
body[data-scene="stepByStep"] .cursor,
body[data-scene="commandPrompt"] .label,
body[data-scene="invalidSystemDisk"] .label,
body[data-scene="invalidSystemDisk"] .cursor,
body[data-scene="safeMode"] #screen,
body[data-scene="safeMode"] .label,
body[data-scene="safeMode"] .cursor {
  visibility: hidden;
}

.label,
.cursor {
  position: absolute;
  height: var(--line-h);
  font: 13.333px/var(--line-h) "NULL95 Fixedsys", Fixedsys, "Fixedsys Excelsior 3.01", "Lucida Console", monospace;
  font-synthesis: none;
  -webkit-font-smoothing: none;
}

.label {
  left: calc(var(--label-col, 35) * var(--cell-w));
  top: calc(var(--label-row, 7) * var(--line-h));
  color: var(--bsod-blue);
  background: var(--label-bg);
  white-space: pre;
}

.label::after {
  position: absolute;
  top: 0;
  left: 100%;
  width: var(--cell-w);
  height: var(--line-h);
  background: var(--label-bg);
  content: "";
  display: none;
}

.label.is-overrun::after {
  display: block;
}

.cursor {
  left: calc(var(--cursor-col, 25) * var(--cell-w));
  top: calc(var(--cursor-row, 23) * var(--line-h));
  width: var(--cell-w);
  color: var(--text-white);
}

.cursor.is-command {
  left: calc(var(--command-cursor-col, 0) * var(--cell-w));
  top: calc(var(--command-cursor-row, 0) * var(--line-h));
}

.cursor.is-hidden {
  visibility: hidden;
}

::selection {
  color: var(--bsod-blue);
  background: var(--text-white);
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    visibility: visible;
  }
}
