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

body {
  margin: 5px;
  padding-top: 20px;
  text-align: center;
  background-color: red;
  background-image: linear-gradient(
      135deg,
      rgba(130, 0, 0, 0.35) 25%,
      transparent 25%
    ),
    linear-gradient(225deg, rgba(130, 0, 0, 0.35) 25%, transparent 25%),
    linear-gradient(45deg, rgba(130, 0, 0, 0.35) 25%, transparent 25%),
    linear-gradient(315deg, rgba(130, 0, 0, 0.35) 25%, transparent 25%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 0, 10px -10px, 0 10px;

  animation: skinMove 6s linear infinite;
}

@keyframes skinMove {
  0% {
    background-position: 0 0, 10px 0, 10px -10px, 0 10px;
  }
  100% {
    background-position: 20px 20px, 30px 20px, 30px 10px, 20px 30px;
  }
}

#gameCanvas {
  border: 2px solid aliceblue;
  border-radius: 5px;
}

/* Main Container */
#snk-container {
  text-align: center;
}

/* Two Side Boxes */
#snk-container .snk {
  text-align: center;
  align-items: center;
  display: inline-block;
  vertical-align: top;
  gap: 5px;
  width: 520px;
  border-radius: 10px;
}

/* Image */
.imgh {
  display: inline-block;
  vertical-align: top;
  width: 170px;
}

#snake-img {
  text-align: right;
  width: 170px;
  margin-bottom: 10px;
  animation: slideInUp 2s ease forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.imgh h3 {
  text-align: left;
  margin-top: 20px;
  font-size: 60px;
  animation: slideInRight 2s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Start Button */
.strtbt1 {
  font-size: 18px;
  background: white;
  color: black;
  /* border: none; */
  border-radius: 5px;
  cursor: pointer;
  margin: 20px 0;
  width: 150px;
  height: 35px;
  transition: 1s;
}

#speedControl button:hover,
.strtbt1:hover {
  color: white;
  background: darkgreen;
  font-size: 15px;
  border: 2px solid white;
  box-shadow: 2px 2px 20px gold;
}

.strtpara p {
  font-size: 25px;
  letter-spacing: 2px;
  word-spacing: 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  margin-top: 10px;
}
#pauseBtn {
  font-size: 18px;
  background: #e04141;
  border: 2px solid black;
  /* color: white; */
  cursor: pointer;
  padding: 15px 0;
  width: 55px;
  border-radius: 100%;
  transition: 1s;
}

#pauseBtn:hover {
  font-size: 18px;
  color: white;
  background: rgb(211, 1, 1);
  border: 2px solid white;
  box-shadow: 2px 2px 20px gold;
}

/* Direction Buttons ------------------------- */
#controls {
  margin-top: 30px;
  text-align: center;
}

#controls .sCtrl {
  text-align: center;
  display: inline-block;
  vertical-align: top;
}

.sCtrl .ctrl-btn {
  margin-left: 36px;
  margin-right: 155px;
}

/* Score Box */
.sCtrl h2 {
  color: #000000;
  font-size: 22px;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

.sCtrl input {
  width: 40px;
  font-size: 22px;
  font-weight: bold;
  color: white;
  background: transparent;
  border: none;
  user-select: none;
}

.sCtrl input::placeholder {
  color: white;
}

.ctrl-btn {
  width: 70px;
  height: 70px;
  font-size: 35px;
  margin: 10px;
  /* margin-top: 2px; */
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid #333;
  background: antiquewhite;
  transition: 1s;
}

.ctrl-btn:hover {
  color: aliceblue;
  border: 2px solid white;
  background-color: green;
  box-shadow: 2px 2px 20px gold;
}

#speedControl {
  margin: 32px;
}

#speedControl button {
  font-size: 18px;
  background: orange;
  color: black;
  border-radius: 8px;
  cursor: pointer;
  margin: 30px 20px;
  width: 80px;
  height: 40px;
  transition: 1s;
}

#speedControl .rangeslide {
  background-color: #42cc48;
  border-radius: 5px;
  width: 360px;
  margin: 0px 40px;
  box-shadow: 2px 2px 10px rgb(44, 136, 1);
}
#speedSlider {
  width: 300px;
  margin: 8px;
}

#speedLabel {
  font-size: 20px;
  font-weight: bold;
  color: white;
  word-spacing: 6px;
  letter-spacing: 1px;
  margin-top: 40px;
}

/* Popup Background */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
}

/* Popup Box */
.popup-box {
  background: white;
  border: 2px solid black;
  width: 300px;
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s;
}

.popup-box h2 {
  color: #28a745;
  font-weight: bold;
  margin-bottom: 15px;
}

.popup-box p {
  font-size: 20px;
  font-weight: bold;
  word-spacing: 5px;
  margin-top: 5px;
}

.popup-box button {
  padding: 10px 25px;
  border: none;
  background: #28a745;
  color: white;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
}

.popup-box button:hover {
  background: #218838;
}

h5 {
  margin-top: 20px;
  text-align: right;
  font-size: 16px;
  font-family: math;
  font-weight: 500;
  font-style: italic;
}
