* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #02040a;
  color: #dfe8ff;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.wrap {
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* The canvas fills the screen and keeps its wide shape inside that box. */
#game {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* The buttons sit over the game, in the corners. */
.pause,
.move {
  position: fixed;
  border: 1px solid rgba(223, 232, 255, 0.45);
  border-radius: 999px;
  background: rgba(4, 10, 24, 0.6);
  color: #dfe8ff;
  font: inherit;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pause {
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  min-width: 96px;
  min-height: 44px;
  padding: 8px 18px;
  font-size: 18px;
  font-style: italic;
}

.pause:hover,
.pause[aria-pressed="true"] {
  background: rgba(40, 70, 120, 0.8);
}

.pause:focus-visible,
.move:focus-visible {
  outline: 2px solid #ffe9a8;
  outline-offset: 2px;
}

/* The arrows that move the toad. Only touch screens get them. */
.move {
  display: none;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.move-left {
  left: calc(14px + env(safe-area-inset-left));
}

.move-right {
  right: calc(14px + env(safe-area-inset-right));
}

@media (pointer: coarse) {
  .move {
    display: block;
  }
}

.turn {
  display: none;
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 24px;
  place-items: center;
  text-align: center;
  font-size: 22px;
  font-style: italic;
  background: #02040a;
}

/* A phone held upright: hide the game and ask the player to turn it. */
@media (orientation: portrait) and (pointer: coarse) {
  .turn {
    display: grid;
  }
}

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