/* the dark forest green around the sketch when the screen's shape doesn't
   match the sketch's exactly */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* canopy green above the sketch and grass green below it, so on a phone
     held upright the space around the forest looks like more forest */
  background: linear-gradient(to bottom, #1e3724 50%, #263e20 50%);
  overflow: hidden;
  touch-action: none; /* no pinch-zooming or scrolling the page */
}

/* the area the sketch can use: the whole screen, minus any notch or rounded
   corners. sketch.js sizes and places the canvas inside it (see fitToScreen) */
main {
  position: fixed;
  top: env(safe-area-inset-top);
  bottom: env(safe-area-inset-bottom);
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  overflow: hidden;
}

canvas {
  position: absolute;
  display: block;

  /* stop the browser from scrolling, zooming, or popping up a menu
     while you're poking and dragging */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* small round buttons in the top-right corner (zoom, full screen) */
#corner-buttons {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: calc(env(safe-area-inset-right) + 10px);
  z-index: 5;
  display: flex;
  gap: 8px;
}

.corner-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #f3ead2;
  cursor: pointer;
}

.corner-btn[hidden],
.tip[hidden] {
  display: none;
}

/* when zoomed in, the zoom button shows a minus instead of a plus */
#zoom-btn.zoomed .plus-bar {
  display: none;
}

/* tips: small pills, the iPhone one along the bottom of the screen and the
   "turn sideways" one along the top */
.tip {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: rgba(20, 30, 22, 0.85);
  color: #f3ead2;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  white-space: nowrap;
}

#home-screen-tip {
  bottom: calc(env(safe-area-inset-bottom) + 10px);
}

#rotate-tip {
  top: calc(env(safe-area-inset-top) + 60px);   /* below the corner buttons */
  transition: opacity 0.6s;
}

#rotate-tip.fading {
  opacity: 0;
}

#home-screen-tip svg {
  vertical-align: -3px;
}

.tip-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  font-size: 13px;
}

