/* ==========================================================================
   CINDERVAULT -- shell styling only.
   Everything the player actually looks at is drawn inside the 320x240
   indexed framebuffer, so the CSS here has exactly one job: get out of the
   way and put a black room around the screen.
   ========================================================================== */

:root {
  --void: #000;
  --brass: #c8a45c;
  --brass-dim: #5c4526;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 45%, #14100b 0%, #000 72%);
}

#screen {
  display: block;
  /* image-rendering is set per display mode by vga.js resize(): PIXEL wants
     nearest-neighbour to the glass, FIT/FILL want the browser's smooth step
     on an already integer-scaled backing store. */
  /* a faint brass surround so the letterbox reads as a cabinet, not a bug */
  box-shadow:
    0 0 0 1px #2a2016,
    0 0 0 2px #5c4526,
    0 0 34px rgba(0, 0, 0, .9);
}

/* FILL runs the picture edge to edge; a bezel there is just a crop. */
body[data-dmode="fill"] #screen {
  box-shadow: none;
}

/* --- portrait nag ------------------------------------------------------- */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #05040a;
  color: var(--brass);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-align: center;
  align-items: center;
  justify-content: center;
  letter-spacing: .18em;
}

#rotate .big {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: spin 2.4s ease-in-out infinite;
}

#rotate .sm {
  color: var(--brass-dim);
  font-size: .72rem;
  margin-top: .6rem;
  letter-spacing: .08em;
}

@keyframes spin {

  0%,
  60%,
  100% {
    transform: rotate(0)
  }

  30% {
    transform: rotate(90deg)
  }
}

body.needs-rotate #rotate {
  display: flex;
}

body.needs-rotate #stage {
  display: none;
}
