/* Served as written. iOS 12: no inset, no gap between flex items. */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #3b2f7a;
  background-image: radial-gradient(circle at 20% 15%, #6a4fc4 0, transparent 45%),
    radial-gradient(circle at 85% 90%, #c2477f 0, transparent 50%);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
}

#tiles {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  padding: 40px 60px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tile {
  display: block;
  width: 23vh;
  margin: 2.5vh 3vh;
  text-align: center;
  text-decoration: none;
  color: #fff;
  -webkit-transition: -webkit-transform 0.12s;
  transition: transform 0.12s;
}

.tile img {
  display: block;
  width: 23vh;
  height: 23vh;
  border-radius: 22%;
  box-shadow: 0 1.2vh 0 rgba(0, 0, 0, 0.25), 0 0 0 0.6vh rgba(255, 255, 255, 0.85);
}

.tile:active {
  -webkit-transform: scale(0.9) rotate(-3deg);
  transform: scale(0.9) rotate(-3deg);
}

/* The name is for the grown-up; the picture is enough to play. */
.tile span {
  display: block;
  margin-top: 2.2vh;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

#reload {
  position: absolute;
  top: 18px;
  top: calc(18px + env(safe-area-inset-top));
  right: 22px;
  right: calc(22px + env(safe-area-inset-right));
  min-width: 64px;
  min-height: 56px;
  padding: 6px 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 12px;
  -webkit-appearance: none;
}

#reload .symbol {
  display: block;
  font-size: 24px;
  line-height: 28px;
}

#version {
  position: absolute;
  right: 24px;
  right: calc(24px + env(safe-area-inset-right));
  bottom: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  font-size: 11px;
  opacity: 0.55;
}

/* Held upright (an iPhone, or an iPad turned), the tiles go two to a row, sized by the
   width, from the top down below the Reload button, and scroll if they run long. */
@media (orientation: portrait) {
  #tiles {
    align-content: flex-start;
    padding: 90px 4vw 40px;
    padding-top: calc(90px + env(safe-area-inset-top));
  }

  .tile {
    width: 28vw;
    margin: 2.5vw 4vw;
  }

  .tile img {
    width: 28vw;
    height: 28vw;
    box-shadow: 0 1.2vw 0 rgba(0, 0, 0, 0.25), 0 0 0 0.6vw rgba(255, 255, 255, 0.85);
  }

  .tile span {
    margin-top: 2.2vw;
  }
}
