/*// BASE STYLES //*/

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
}

.grass,
.sky,
.road {
  position: relative;
}

.sky-wrapper {
  position: relative;
  overflow: hidden; /* Ensure the animated background stays within bounds */
  height: 30%;
}

.sky {
  height: 100%;
}

.grass {
  height: 40%;
  width: 100%;
}

.road {
  height: 30%;
  background: dimgrey;
  box-sizing: border-box;
  border-top: 10px solid grey;
  border-bottom: 10px solid grey;
  width: 100%;
}

.lines {
  box-sizing: border-box;
  border: 5px dashed #fff;
  height: 0px;
  width: 100%;
  position: absolute;
  top: 45%;
}

/*/
/ ELEMENTS TO ANIMATE //*/

.Mario-Kart {
  position: fixed;
  z-index: 2;
  top: 25%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
  font-size: 5.5rem;
  p {
    color: red;
  }
  animation: zoomInOut 4s ease-in-out forwards;
}

.mario {
  position: absolute;
  top: -30px;
  left: 0px;
  animation: drive 4s both infinite linear, jump 0.55s 2.3s ease;
}

.luigi {
  position: absolute;
  bottom: 10px;
  left: 0px;
  animation-name: drive;
  animation-duration: 4.2s;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.boo {
  position: absolute;
  width: 120px;
  opacity: 0.5;
  animation: drive 6s forwards reverse ease-in-out;
}

.cloud {
  position: absolute;
  z-index: 2;
}
.cloud:nth-child(1) {
  width: 200px;
  top: 120px;
  opacity: 0.5;
  animation: wind 35s both infinite linear reverse;
}
.cloud:nth-child(2) {
  width: 300px;
  top: 0;
  animation: wind 25s both linear infinite reverse;
}

.bg {
  position: absolute;
  opacity: 0.5;
  height: 200%;
  width: 200%;
  bottom: 10px;
  animation: scrollBackground 5s linear both infinite reverse;
}
.SNES {
  position: absolute;
  height: 180%;
  width: 200%;
  bottom: 0px;
  animation: scrollBackground 5s linear both infinite reverse;
}

/*// KEYFRAMES //*/

@keyframes drive {
  from {
    transform: translateX(-200px);
  }
  to {
    transform: translateX(2000px);
  }
}

@keyframes wind {
  from {
    left: -200px;
  }
  to {
    left: 100%;
  }
}

@keyframes jump {
  0% {
    top: -30px;
  }
  50% {
    top: -200px;
  }
  100% {
    top: -30px;
  }
}
@keyframes scrollBackground {
  from {
    left: -500px;
  }
  to {
    left: 0;
  }
}

@keyframes zoomInOut {
  0% {
    transform: scale(0); /* Start with no scale */
    opacity: 0; /* Start invisible */
  }
  50% {
    transform: scale(1.5); /* Zoom in */
    opacity: 1; /* Fade in */
  }
  100% {
    transform: scale(0.8); /* Back to normal size */
    opacity: 1; /* Maintain visibility */
  }
}

/* MODAL CSS START ---------------------- */
.modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100vw;
  height: 100vh;
}

.modal-content {
  position: relative;
  background-color: #070141;
  color: white;
  top: 15vh;
  padding: 2em;
  margin: auto;
  width: 50vw;
  height: auto;
  border-radius: 10px;
  z-index: 1000;
  animation: animatetop 0.6s;
}

.modal-content h2 {
  padding: 0;
  margin: 0;
  color:rgb(192, 123, 33)
}

.modal-content p {
  text-align: left;
  font-size: 1.3rem;
  padding: 0;
  margin: 0;
}

.close-btn {
  position: absolute;
  top: -0.5em; /* Align the close button to the top */
  right: 0.3em; /* Adjust the position from the right side */
  margin-right: 0; /* Remove margin-right */
  margin-top: 0.5em;
  color: rgb(212, 8, 8);
  font-size: 2.5rem;
  font-weight: bold;
}

.close-btn:hover {
  cursor: pointer;
  color: rgb(32, 230, 230, 0.8);
  animation: close-btn-change 0.5s linear both;
}

@keyframes animatetop {
  from {
    top: -300px;
    opacity: 0;
  }
  to {
    top: 0;
    opacity: 1;
  }
}
@keyframes close-btn-change {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

/* MODAL CSS FINISH  ------------------------*/

/* BREAKPOINTS */
@media (max-width: 500px) {
  .Mario-Kart {
    font-size: 2.5rem;
  }
}
/* BREAKPOINT MODAL */
@media (max-width: 500px) {
  .modal-content {
    width: 90vw;
    max-width: 80%;
  }
}
