body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: rgb(19, 84, 34);
  font-family: 'Press Start 2P', monospace;
  margin: 0;
  flex-direction: column;
}

header {
  text-align: center;
  margin-bottom: 50px;
}

header h1 {
  font-size: 2.5rem;
  color: #00FF00;
  text-shadow: 2px 2px #000;
}

.wrapper-div {
  height: 75vmin;
  width: 80vmin;
  background: #235789;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 20px solid rgb(150, 250, 80);
  box-shadow: 0 0 20px rgb(150, 250, 80);
}

.g-details {
  color: beige;
  font-size: 14px;
  font-weight: 500;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #444;
}

.g-board {
  height: 100%;
  width: 100%;
  background: #121111;
  display: grid;
  grid-template: repeat(30, 1fr) / repeat(30, 1fr);
}

.g-board .food {
  background: red;
  border-radius: 50%;
}

.g-board .headOfSnake {
  background: rgba(20, 250, 5, 0.8);
  border-radius: 100%;
  outline-style: solid;
}


#welcome-screen {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,255,0,0.3);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  animation: fadeIn 0.6s ease;
}

#welcome-screen h1 {
  font-size: 1,2rem;
  margin-bottom: 15px;
  color: #00FF00;
}

#welcome-screen input {
  padding: 10px;
  font-size: 14px;
  margin-bottom: 10px;
  border: 2px solid #00FF00;
  border-radius: 5px;
  background: #111;
  color: #00FF00;
  text-align: center;
  width: 80%;
}

#welcome-screen button {
  padding: 10px 20px;
  font-size: 12px;
  cursor: pointer;
  background: #00FF00;
  border: none;
  border-radius: 5px;
  color: black;
  font-family: 'Press Start 2P', monospace;
  transition: all 0.2s ease;
}

#welcome-screen button:hover {
  background: #00cc00;
  transform: scale(1.05);
}


#game-over-screen {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 25px 30px;
  border-radius: 12px;
  text-align: center;
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(255,0,0,0.3);
  animation: fadeIn 0.6s ease;
}

#game-over-screen h1 {
  color: #ff4042;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

#game-over-screen p {
  font-size: 0.8rem;
  margin: 10px 0 20px;
}

.hidden {
  display: none;
}

button {
  font-family: 'Press Start 2P', monospace;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  background: #00FF00;
  border: none;
  border-radius: 5px;
  color: black;
  transition: background 0.2s ease;
}

button:hover {
  background: #05a305;
}

#player-name.error {
  border: 2px solid red;
}

.player-name {
  color: white;
  font-weight: bold;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}


@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }

  .wrapper-div {
    width: 90vmin;
    height: 90vmin;
    border-width: 10px;
  }

  .g-details {
    font-size: 10px;
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  #welcome-screen, #game-over-screen {
    max-width: 300px;
    padding: 20px;
  }

  #welcome-screen h1, #game-over-screen h1 {
    font-size: 0.9rem;
  }

  #welcome-screen input, #welcome-screen button {
    font-size: 12px;
    width: 90%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 2rem;
  }

  .wrapper-div {
    width: 95vmin;
    height: 95vmin;
    border-width: 8px;
  }

  .g-details {
    font-size: 11px;
  }

  #welcome-screen h1, #game-over-screen h1 {
    font-size: 1rem;
    
  }
}

