* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --panel: #07130b;
  --canvas: #021407;

  --primary: #00ff5a;
  --secondary: #5bff8a;

  --food: #ff4040;

  --border: rgba(0, 255, 90, 0.45);
  --grid: rgba(0, 255, 90, 0.05);
}

body,
button {
  font-family: "Press Start 2P", "VT323", monospace;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;

  min-height: 100dvh;

  background: var(--bg);

  gap: 16px;

  padding: 20px;

  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;

  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.015) 4px
  );

  opacity: 0.35;
}

/* .game-container-wrapper{
  height: 70%;

} */

.game-container {
  width: min(1100px, 95vw);

  /* height: 70dvh; */

  padding: 20px;

  display: flex;
  flex-direction: column;

  gap: 12px;

  background: var(--panel);

  border: 3px solid var(--primary);

  border-radius: 18px;

  box-shadow:
    0 0 12px rgba(0, 255, 90, 0.35),
    inset 0 0 20px rgba(0, 255, 90, 0.08);
}

.title {
  color: var(--primary);

  text-align: center;

  font-size: 42px;

  letter-spacing: 8px;

  font-weight: 400;

  text-shadow:
    0 0 5px #00ff5a,
    0 0 10px #00ff5a,
    0 0 20px #00ff5a;
}

.scores {
  display: flex;
  /* flex-wrap: wrap; */
  /* row-gap: 8px; */
  justify-content: space-between;

  /* align-items: center; */

  color: var(--primary);

  padding: 6px 0 12px;
  text-shadow: 0 0 6px rgba(0, 255, 90, 0.5);
}

.scores span {
  /* font-size: 14px; */

  font-weight: bold;

  font-size: 14px;

  letter-spacing: 1px;
}

.scores p {
  font-size: 14px;
  display: inline;
  font-weight: bold;
}
hr {
  border: none;

  height: 1px;

  background: rgba(0, 255, 90, 0.18);

  margin-bottom: 4px;
}
/* .scores div {
  display: flex;
  gap: 5px;
  font-size: 13px;
} */

.canvas-wrapper {
  /* flex: 1; */
  justify-content: center;
  align-items: center;
  display: flex;
}
.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 5/3;
  max-height: 520px;
}

.canvas-container canvas {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
}
#GridCanvas {
  background: #021407;
  z-index: 0;
  /* border: 3px solid var(--primary); */
  /* aspect-ratio: 5/3; */
}

#Canvas {
  /* width: 100%; */

  /* display: block; */

  /* width: 100%;
  height: 100%; */
  z-index: 1;

  /* max-height: 520px; */

  display: block;
  width: 100%;
  /* height: auto; */
  aspect-ratio: 5/3;

  display: block;

  background: transparent;

  border: 3px solid var(--primary);

  border-radius: 4px;

  /* max-height: 60vh; */

  touch-action: none;

  box-shadow: 0 0 18px rgba(0, 255, 90, 0.12);
}

.buttons {
  display: flex;

  justify-content: center;

  gap: 30px;

  margin-top: 6px;
}

/* .Scores {
  display: flex;
  justify-content: space-around;
  /* align-items: center; */
/* gap: 10px; */
/* } */

#Game-Button,
#Stop-Game-Button {
  width: 170px;

  height: 52px;
  border-radius: 10px;

  border: 2px solid var(--primary);

  background: #08150d;

  color: var(--primary);

  /* font-size: 20px; */

  font-weight: bold;

  font-size: 14px;

  letter-spacing: 2px;

  cursor: pointer;

  transition: 0.2s;

  text-shadow: 0 0 6px rgba(0, 255, 90, 0.4);

  box-shadow:
    0 0 10px rgba(0, 255, 90, 0.2),
    inset 0 0 10px rgba(0, 255, 90, 0.05);
}

/* #Stop-Game-Button {
  width: 120px;
  height: 40px;
  border-radius: 5px;
  border: 2px solid;
  background-color: #f46036;
  color: #171123;
  font-weight: bold;
  cursor: pointer;
} */

#Game-Button:hover,
#Stop-Game-Button:hover {
  background: var(--primary);

  color: #000;
}

#d-pad {
  display: none;
}

/* #d-pad {
  display: flex;

  flex-direction: column;
  flex-shrink: 0;

  align-items: center;

  gap: 12px;

  margin-top: 6px;
  /* height: 25dvh; */
/* } */

/*
.middle {
  display: flex;

  gap: 38px;
}

#up,
#down,
#left,
#right {
  width: 62px;

  height: 62px;

  background: #08150d;

  border: 2px solid var(--primary);

  color: var(--primary);

  font-size: 28px;

  cursor: pointer;

  transition: 0.2s;

  box-shadow: 0 0 10px rgba(0, 255, 90, 0.2);
}

.hidden {
  display: none;
}

#up:hover,
#down:hover,
#left:hover,
#right:hover {
  background: var(--primary);

  color: #000;
}

#up:active,
#down:active,
#left:active,
#right:active {
  transform: scale(0.95);
} */

.coin-text {
  color: var(--primary);

  font-size: 14px;

  height: 5vh;

  letter-spacing: 3px;

  opacity: 0.75;

  margin-top: 8px;
}

@media (max-width: 600px) {
  body {
    padding: 10px 20px;
    justify-content: flex-start;
    overflow-y: auto;

    gap: 20px;
  }

  .game-container {
    padding: 12px;
    gap: 10px;

    border-radius: 14px;
  }

  .title {
    font-size: 32px;

    letter-spacing: 6px;
  }

  .scores span {
    font-size: 12px;
  }

  .scores p {
    font-size: 12px;
  }

  .buttons {
    gap: 16px;
  }

  #Canvas {
    height: auto;
    aspect-ratio: 5/3;
    max-height: 50vh;
  }

  #Game-Button,
  #Stop-Game-Button {
    width: 100px;

    height: 30px;

    font-size: 12px;
  }

  #d-pad {
    display: flex;

    flex-direction: column;
    flex-shrink: 0;

    align-items: center;

    gap: 12px;

    margin-top: 6px;
    /* height: 25dvh; */
  }

  .middle {
    display: flex;

    gap: 30px;
  }

  #up,
  #down,
  #left,
  #right {
    width: 50px;

    height: 50px;

    background: #08150d;

    border: 2px solid var(--primary);

    color: var(--primary);

    font-size: 24px;

    cursor: pointer;

    transition: 0.2s;

    box-shadow: 0 0 10px rgba(0, 255, 90, 0.2);
  }

  .hidden {
    display: none;
  }

  #up:hover,
  #down:hover,
  #left:hover,
  #right:hover {
    background: var(--primary);

    color: #000;
  }

  #up:active,
  #down:active,
  #left:active,
  #right:active {
    transform: scale(0.95);
  }

  .coin-text {
    font-size: 12px;

    letter-spacing: 2px;
  }
}
