* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

/* the game fills the screen; the canvas is a hair larger than the viewport
   (whole game pixels) and centred, so any overhang is clipped evenly */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#scene {
  flex: none;
  display: block;
  image-rendering: pixelated;
}

/* the DS message window over the bottom of the screen, like in the game */
#msgbox {
  position: fixed;
  left: 50%;
  bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%);
  display: block;
  image-rendering: pixelated;
  cursor: pointer;
}

.sound {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: calc(env(safe-area-inset-right) + 10px);
  margin: 0;
  padding: 7px 13px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 28, 22, 0.42);
  font: italic 15px/1 "Instrument Serif", Georgia, serif;
  letter-spacing: 0.02em;
  color: #fbf7ee;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sound:hover,
.sound:focus-visible { background: rgba(20, 28, 22, 0.6); }

/* the password gate: an invisible text field laid exactly over the message
   window, so tapping the window brings up the phone's keyboard; what's typed
   is drawn in the window itself, in the game font */
.gate {
  position: fixed;
  left: 50%;
  bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%);
  margin: 0;
}

.gate[hidden] { display: none; }

.gate input {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  font-size: 16px; /* iOS zooms into inputs under 16px */
  cursor: pointer;
}

.gate input::selection { background: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
