.game-page {
  min-height: calc(100vh - 80px);
  color: #111;
  background: #fff;
}

.game-intro {
  padding: 3rem 0 2rem;
  text-align: center;
}

.game-intro h1 {
  margin-bottom: 0.5rem;
  color: #111;
}

.game-intro p:last-child {
  max-width: 680px;
  margin-inline: auto;
}

.game-section {
  width: min(100% - 1rem, 1040px);
  margin-inline: auto;
  padding-bottom: 4rem;
}

.game-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.game-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 3px solid #111;
  border-radius: 4px;
  color: #111;
  background: #fff;
  font: 800 0.9rem/1 var(--font-body);
  cursor: pointer;
}

.game-icon-button:hover,
.game-icon-button[aria-pressed="true"] {
  color: #fff;
  background: #111;
}

.game-icon-button span:first-child {
  font-size: 1.25rem;
}

.game-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 4px solid #111;
  border-radius: 4px;
  background: #fff;
  box-shadow: 10px 10px 0 #111;
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  background: #fff;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.touch-controls {
  display: none;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 3px solid #111;
  background: #fff;
}

.game-control {
  display: grid;
  min-height: 68px;
  flex: 1;
  place-content: center;
  border: 3px solid #111;
  border-radius: 4px;
  color: #111;
  background: #fff;
  font: 800 1.35rem/1 var(--font-body);
  touch-action: none;
}

.game-control span {
  font-size: 1.8rem;
}

.game-control small {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.game-control-primary,
.game-control:active {
  color: #fff;
  background: #111;
}

.game-help {
  display: flex;
  justify-content: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  font-weight: 700;
}

.game-switcher {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.game-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border: 3px solid #111;
  border-radius: 4px;
  color: #111;
  background: #fff;
  font-weight: 800;
  box-shadow: 4px 4px 0 #111;
}

.game-switcher a[aria-current="page"],
.game-switcher a:hover {
  color: #fff;
  background: #111;
}

.swim-page {
  background: linear-gradient(180deg, #e9fbff 0%, #f7fdff 44%, #ffffff 100%);
}

.swim-shell {
  border-color: #063344;
  background: #c8f4ff;
  box-shadow: 10px 10px 0 #063344;
}

#swim-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 45 / 28;
  background: #c8f4ff;
  touch-action: none;
}

.swim-help kbd {
  border-color: #063344;
  color: #063344;
}

.swim-shell:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  place-content: center;
  box-shadow: none;
  background: #c8f4ff;
}

.swim-shell:fullscreen #swim-canvas {
  width: min(100vw, calc(100vh * 45 / 28));
}

.parkour-page {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 52%, #f4f8fc 100%);
}

.parkour-shell {
  border-color: #111;
  background: #f8fbff;
}

#parkour-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  background: #f8fbff;
  touch-action: none;
}

.parkour-touch-controls {
  border-top-color: #111;
}

.parkour-shell:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  grid-template-rows: 1fr auto;
  box-shadow: none;
  background: #f8fbff;
}

.parkour-shell:fullscreen #parkour-canvas {
  width: min(100vw, calc(100vh * 16 / 7));
  align-self: center;
}

.maze-page {
  background: linear-gradient(180deg, #eafbff 0%, #ffffff 52%, #f4fbff 100%);
}

.maze-shell {
  border-color: #083344;
  background: #eafbff;
  box-shadow: 10px 10px 0 #083344;
}

#maze-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  background: #eafbff;
  touch-action: none;
}

.maze-touch-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  border-top-color: #083344;
}

.maze-touch-controls .game-control {
  border-color: #083344;
  color: #083344;
}

.maze-touch-controls .game-control:active {
  color: #fff;
  background: #083344;
}

.maze-up {
  grid-area: up;
}

.maze-left {
  grid-area: left;
}

.maze-right {
  grid-area: right;
}

.maze-down {
  grid-area: down;
}

.maze-shell:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  grid-template-rows: 1fr auto;
  box-shadow: none;
  background: #eafbff;
}

.maze-shell:fullscreen #maze-canvas {
  width: min(100vw, calc(100vh * 8 / 5));
  align-self: center;
}

.clone-page {
  background: linear-gradient(180deg, #eafbff 0%, #ffffff 48%, #f4fbff 100%);
}

.clone-shell {
  border-color: #083344;
  background: #dff8ff;
  box-shadow: 10px 10px 0 #083344;
}

#clone-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  background: #dff8ff;
  touch-action: none;
}

.clone-touch-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left action right"
    ". down .";
  border-top-color: #083344;
}

.clone-touch-controls .game-control {
  border-color: #083344;
  color: #083344;
}

.clone-touch-controls .game-control:active,
.clone-touch-controls .game-control-primary {
  color: #fff;
  background: #083344;
}

.clone-up {
  grid-area: up;
}

.clone-left {
  grid-area: left;
}

.clone-right {
  grid-area: right;
}

.clone-down {
  grid-area: down;
}

.clone-action {
  grid-area: action;
}

.clone-shell:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  grid-template-rows: 1fr auto;
  box-shadow: none;
  background: #dff8ff;
}

.clone-shell:fullscreen #clone-canvas {
  width: min(100vw, calc(100vh * 8 / 5));
  align-self: center;
}

kbd {
  padding: 0.15rem 0.45rem;
  border: 2px solid #111;
  border-bottom-width: 4px;
  border-radius: 3px;
  color: #111;
  background: #fff;
  font: inherit;
}

.game-shell:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  place-content: center;
  box-shadow: none;
  background: #fff;
}

.game-shell:fullscreen #game-canvas {
  width: min(100vw, calc(100vh * 8 / 3));
}

@media (hover: none), (pointer: coarse), (max-width: 700px) {
  .game-intro {
    padding: 2rem 0 1.25rem;
  }

  .game-section {
    width: min(100% - 0.75rem, 1040px);
  }

  .game-toolbar {
    margin-right: 0.25rem;
  }

  .game-shell {
    border-width: 3px;
    box-shadow: 5px 5px 0 #111;
  }

  .touch-controls {
    display: flex;
  }

  .game-help {
    display: none;
  }

  .game-switcher {
    justify-content: stretch;
  }

  .game-switcher a {
    flex: 1 1 180px;
    justify-content: center;
  }

  .game-shell:fullscreen {
    grid-template-rows: 1fr auto;
  }

  .game-shell:fullscreen #game-canvas {
    align-self: center;
  }

  .swim-shell {
    box-shadow: 5px 5px 0 #063344;
  }

  .parkour-shell {
    box-shadow: 5px 5px 0 #111;
  }

  .maze-shell {
    box-shadow: 5px 5px 0 #083344;
  }

  .clone-shell {
    box-shadow: 5px 5px 0 #083344;
  }

  .maze-touch-controls {
    display: grid;
  }

  .clone-touch-controls {
    display: grid;
  }
}
