/* The cabinet the game sits in. Everything inside the frame is drawn on the
   320x200 canvas -- this file only positions and scales that canvas. */

:root {
  --bezel: #14141c;
  --room: #07070c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--room);
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #9aa4b8;
  -webkit-text-size-adjust: 100%;
}

#cabinet {
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(0px, 2vmin, 24px);
}

/* The canvas size is set in JS, not here -- see fit() in engine/screen.js.
 *
 * It has to be, because CSS can only express "fill the space and keep 4:3", and
 * that lands a 320-wide image on a 1792-wide box: a 5.6x scale, where source
 * pixels alternate between 5 and 6 screen pixels wide. On artwork you would
 * never notice. On a font whose stems are one pixel, one stem gets six pixels
 * and the stem beside it gets five, and the letters visibly deform -- "than"
 * renders as "fhom". So JS snaps the canvas to whole-number scale factors and
 * accepts a black border instead. */
#screen {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
  box-shadow: 0 0 0 1px var(--bezel), 0 18px 60px rgba(0, 0, 0, .8);
  cursor: none;          /* the game draws its own Sierra cursor */
  touch-action: manipulation;
}

#screen:focus-visible {
  outline: 2px solid #7ea6ff;
  outline-offset: 3px;
}

/* Touch devices have no hover, so the drawn cursor is useless there --
   fall back to the system pointer. */
@media (hover: none) {
  #screen { cursor: pointer; }
}

#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--room);
  font: 12px/1.6 "Courier New", monospace;
  letter-spacing: .12em;
  transition: opacity .4s ease;
  pointer-events: none;
}
#boot.gone { opacity: 0; }

.fallback {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.6;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
