@import url("https://fonts.googleapis.com/css?family=Press+Start+2P");

#intro {
	width: 100%;
	box-sizing: border-box;
	padding: 1.25rem 1rem;
	background-color: black;
	color: white;
	text-align: center;
	font-size: 0.75rem;
	line-height: 1.8;
}

#intro p {
	margin: 0 auto;
	max-width: 45rem;
}

#intro a {
	color: white;
	font-weight: bold;
	text-decoration: underline;
}

#intro a:hover {
	text-decoration: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Press Start 2P", cursive;
}

#game {
  position: relative;
  flex: 1;
  overflow: hidden;
}

canvas.game {
  display: block;
}

#controls {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  min-width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#controls div {
  display: grid;
  grid-template-columns: 50px 50px 50px;
  gap: 10px;
}

#controls button {
  width: 100%;
  height: 40px;
  background-color: white;
  border: 1px solid lightgray;
  box-shadow: 3px 5px 0px 0px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#controls button:first-of-type {
  grid-column: 1/-1;
}

@media (max-width: 768px) {
  #controls {
  bottom: calc(50px + env(safe-area-inset-bottom));
  }
  #controls div {
    grid-template-columns: 64px 64px 64px;
    gap: 12px;
  }

  #controls button {
    height: 52px;
    font-size: 1.25rem;
  }
}

#score {
  position: absolute;
  top: 20px;
  left: 20px;

  font-size: 2em;
  color: white;
}

#best {
  position: absolute;
  top: 20px;
  right: 20px;

  font-size: 2em;
  color: white;
  text-align: right;
}

#result-container {
  position: absolute;
  min-width: 100%;
  min-height: 100%;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;

  #result {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 20px;
  }

  button {
    background-color: red;
    padding: 20px 50px 20px 50px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
  }

  .key-hint {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.15em 0.4em;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-family: system-ui, sans-serif;
    line-height: 1;
  }
}
