* {
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background-color: #000;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

html {
  height: 100%;
}

.arcade-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(600px, 90vh, 90vw);
  max-height: 85vh;
  margin: 0 auto;
  padding: 10px;
  transform-origin: center center;
  position: relative;
  margin-bottom: 60px;
}

@media screen and (max-width: 768px) {
  body {
    align-items: flex-start;
    padding-top: 5vh;
  }

  .arcade-machine {
    transform: scale(1);
    margin-top: 2vh;
  }
}

@media screen and (min-width: 769px) and (max-width: 1366px) {
  body {
    align-items: flex-start;
    padding-top: 5vh;
  }

  .arcade-machine {
    transform: scale(0.85);
    margin-top: 2vh;
  }
}

/* Desktop media query */
@media screen and (min-width: 1367px) {
  body {
    align-items: center;
    padding: 5vh 0;
  }

  .arcade-machine {
    transform: scale(1);
    margin: auto;
  }
}

h1 {
  color: #ffff00;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 0 #000000, 4px 4px 0 #ffff00;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(16px, 3vw, 24px);
  margin: 10px 0;
}

h2 {
  color: #ffff00;
  text-shadow: 1px 1px 0 #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Bangers", system-ui;
  font-size: clamp(14px, 3vw, 24px);
  margin: 10px 0;
}

.UI {
  background-color: #000080;
  display: flex;
  width: min(600px, 90vh, 90vw);
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 8px;
  border: 3px solid #ffff00;
  border-radius: 4%;
  font-family: "Press Start 2P", cursive;
}

#score,
#lives {
  color: #ffff00;
  font-size: clamp(12px, 2.5vw, 18px);
  line-height: 1.2;
}

.game-content {
  display: flex;
  justify-content: center;
  width: min(600px, 90vh, 90vw);
  position: relative;
  height: auto;
}

.game-bio {
  background-color: #000080;
  padding: 1rem;
  width: min(600px, 90vh, 90vw);
  height: min(600px, 90vh, 90vw);
  font-family: "Poppins", sans-serif;
  color: #d1dbe0;
  text-align: justify;
  border: 3px solid #ffff00;
  border-radius: 4%;
  overflow-y: auto;
  font-size: clamp(12px, 3vw, 16px);
}

.special-text {
  font-family: "Bangers", system-ui;
}

#dotman-text {
  color: #ffff00;
}

#chaser-text {
  color: #ff0000;
}

#ambusher-text {
  color: rgb(251, 9, 251);
}

#random-text {
  color: #ffa500;
}

#power-pellet-text {
  color: #00ced1;
}

#start-game {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  background-color: #ffff00;
  color: #000000;
  border: none;
  border-radius: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 1rem;
  cursor: pointer;
}

/* Styles for Maze, characters, and items */
#grid-container {
  width: min(600px, 90vh, 90vw);
  height: min(600px, 90vh, 90vw);
  border: 3px solid #ffff00;
  display: none;
}

#grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
}

.cell {
  flex: 0 0 5%;
  height: 5%;
  position: relative;
  background-color: #000;
}

.pellet {
  width: 25%;
  height: 25%;
  background-color: #f0f7f7;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.power-pellet {
  width: 40%;
  height: 40%;
  background-color: #00ced1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wall {
  background-color: #0000ff;
}

.path {
  background-color: #000;
}

.pacman {
  background-color: #ffff00;
  border-radius: 50%;
}

.pacman-powerup {
  background-color: #00ced1;
  border-radius: 50%;
}

.chaser-ghost {
  background-color: #ff0000;
  border-radius: 50%;
}

.ambusher-ghost {
  background-color: rgb(251, 9, 251);
  border-radius: 50%;
}

.random-ghost {
  background-color: #ffa500;
  border-radius: 50%;
}
