/* ==========================================================================
   SKYWATCH -- style.css

   There is almost nothing here on purpose: the entire interface is drawn
   into the 320x200 framebuffer, so this file only has to build the dark room
   the picture hangs in, and turn that picture ninety degrees when a phone is
   held in portrait.
   ========================================================================== */

:root {
  --room: #07090b;
  --bezel: #131a16;
  --ink: #c0d4a4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--room);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  font-family: ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

/* The UA rule [hidden]{display:none} loses to any author rule that sets
   display, which is how a "reconnecting" banner ships visible for a week.
   Nothing here uses [hidden] yet -- this is here so that the day something
   does, it works. */
[hidden] { display: none !important; }

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  /* a phone's notch is not part of the picture */
  padding-top: max(3px, env(safe-area-inset-top));
  padding-bottom: max(3px, env(safe-area-inset-bottom));
  padding-left: max(3px, env(safe-area-inset-left));
  padding-right: max(3px, env(safe-area-inset-right));
}

#game {
  display: block;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 0 2px var(--bezel), 0 0 26px rgba(0, 0, 0, 0.9);
}

/* FILL mode runs the picture edge to edge; the bezel would just be a frame
   around nothing. vga.js sets data-dmode on the body. */
body[data-dmode="fill"] #stage { padding: 0; }
body[data-dmode="fill"] #game { box-shadow: none; }

/* Portrait: turn the board rather than shrink it. vga.js decides (it compares
   the flat scale against the turned one) and toggles .rot, and its toVGA()
   inverts this transform by hand -- getBoundingClientRect reports the
   axis-aligned box of a rotated element and would put every tap a tile out. */
body.rot #game {
  transform: rotate(90deg);
  transform-origin: center center;
}

.fallback {
  padding: 2rem;
  font-size: 14px;
  line-height: 1.5;
}
