* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  --clr-dirt: #979797;
  --clr-brick: #494949;
  background-color: black;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  image-rendering: pixelated;
  font-family: Arial, sans-serif, Helvetica;
}
body#blue {
  --clr-bird: #1847d1;
  --clr-bird-dark: #1847d180;
  --clr-menu: #1847d140;
}
body#red {
  --clr-bird: #6b0002;
  --clr-bird-dark: #6b000280;
  --clr-menu: #6b000240;
}
body#purple {
  --clr-bird: #6500b3;
  --clr-bird-dark: #6500b380;
  --clr-menu: #6500b340;
}
body#green {
  --clr-bird: #007500;
  --clr-bird-dark: #00750080;
  --clr-menu: #00750040;
}
body#pink {
  --clr-bird: #ff0073;
  --clr-bird-dark: #ff007380;
  --clr-menu: #ff007340;
}
body#grey {
  --clr-bird: #494949;
  --clr-bird-dark: #49494980;
  --clr-menu: #49494940;
}

/* Main ======================================================================================== */
main {
  position: relative;
  background-image: url(./img/background.png);
  background-position: center;
  background-size: cover;
  width: 100vmin;
  height: 100vh;
  color: white;
  overflow: hidden;
}
.world {
  position: relative;
  width: 100%;
  height: 90%;
}
.ground {
  position: absolute;
  display: flex;
  bottom: 0;
  width: calc(200vmin + 20vh);
  height: 10%;
  background-color: var(--clr-dirt);
}
.ground .bricks {
  height: 20%;
  width: 100%;
  background: repeating-linear-gradient(
    to right,
    var(--clr-dirt),
    var(--clr-dirt) 0.1vmin,
    var(--clr-brick) 0.1vmin,
    var(--clr-brick) 9.9vmin,
    var(--clr-dirt) 9.9vmin,
    var(--clr-dirt) 10vmin
  );
}
.city-container,
.bushes-container {
  position: absolute;
  display: flex;
  width: 200%;
  bottom: 0;
}
.city-container.paused,
.bushes-container.paused {
  animation-play-state: paused;
}
.city,
.bushes {
  object-fit: contain;
  width: 50%;
  height: 100%;
}
.city-container {
  animation: 60s linear infinite move;
}
.bushes-container {
  animation: 30s linear infinite move;
}
@keyframes move {
  from {
    transform: none;
  }
  to {
    transform: translateX(-50%);
  }
}
.bird {
  position: absolute;
  left: 25%;
  width: 10vh;
  height: 10vh;
  transform: translate3d(0, 50vh, 0);
  opacity: 0;
  transition: opacity 250ms ease-in-out;
}
.pipe-gap {
  position: absolute;
  right: -10vmin;
  width: 10vmin;
  height: 30vh;
  transition: opacity 250ms ease-in-out;
}
.pipe-gap::before,
.pipe-gap::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 60vh;
  background-color: var(--clr-dirt);
}
.pipe-gap::before {
  bottom: 100%;
  border-bottom: 2vh solid var(--clr-bird);
}
.pipe-gap::after {
  top: 100%;
  border-top: 2vh solid var(--clr-bird);
}
.current-score-text {
  position: absolute;
  top: 1rem;
  width: 100%;
  text-align: center;
  font-size: 6vh;
  color: var(--clr-bird);
  filter: brightness(2) drop-shadow(0 0 0.25rem black);
}
/* Overlay ===================================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}
/* Nav ========================================================================================= */
nav {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background-color: #000000bf;
  color: white;
  font-size: 1.5rem;
  user-select: none;
  transition: opacity 250ms ease-in-out;
}
nav > .inner {
  position: relative;
  width: clamp(18rem, 50%, 24rem);
  height: clamp(18rem, 50%, 24rem);
  border-radius: 1rem;
  background-color: var(--clr-menu);
  overflow: hidden;
}
.start-menu,
.settings-menu {
  transition: transform 250ms ease-in-out;
  padding: 1rem;
}
.start-menu {
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: column;
}
.settings-menu {
  position: relative;
  display: flex;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
}
nav.settings-active .start-menu {
  transform: translateY(-100%);
}
nav.settings-active .settings-menu {
  transform: translateY(-100%);
}

.settings-bird {
  width: 50%;
  height: 100%;
  padding-right: 15%;
  object-fit: contain;
}
.settings-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 50%;
  gap: 0.5rem;
}
.settings-color-grid > .color-btn {
  border: 1px solid white;
  border-radius: 1rem;
  cursor: pointer;
}
.select-blue   { background-color: #1847d1; }
.select-purple { background-color: #6500b3; }
.select-red    { background-color: #6b0002; }
.select-green  { background-color: #007500; }
.select-pink   { background-color: #ff0073; }
.select-grey   { background-color: #494949; }
.back-btn {
  position: absolute;
  bottom: 1rem;
  width: 2rem;
  height: 2rem;
  object-fit: cover;
  cursor: pointer;
}

.game-over-text {
  font-size: 3rem;
}
.starting-menu-text {
  font-size: 2rem;
  color: var(--clr-yellow);
}
.menu-score-grid {
  min-width: max-content;
  font-size: 2rem;
}
.high-score-text,
.end-score-text {
  overflow: hidden;
  display: grid;
  grid-auto-columns: 2fr 1fr;
  grid-auto-flow: column;
}
.high-score-text {
  border-radius: 0 0 1rem 1rem;
}
.end-score-text {
  border-radius: 1rem 1rem 0 0;
}
.menu-score-grid span {
  padding: 0.5rem;
}
.menu-score-grid span:first-of-type {
  background-color: var(--clr-bird);
}
.menu-score-grid span:last-of-type {
  text-align: center;
  background-color: var(--clr-bird-dark);
}
.controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}
.controls > .settings-btn {
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}
.controls > .start-btn {
  width: 5rem;
  height: 5rem;
  cursor: pointer;
}

/* General ===================================================================================== */
.transparent {
  opacity: 0;
}
.hidden {
  position: fixed;
  transform: translate3d(0, 100vh, 0);
}