@media only screen and (max-width: 768px) {
  * {
    box-sizing: border-box;
  }

  body {
    background-color: #fff4ea;
    margin: 0%;
    padding: 0%;
  }
  html,
  body {
    overflow: hidden;
    height: 100%;
    position: relative;
  }

  .bottom-left-img {
    position: absolute;
    top: 45%;
    left: -45%;
    width: 98%;
    height: auto;
  }

  .Intro {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 45%;
    bottom: 0%;
    transform: translate(-50%, -50%);
  }
  h1 {
    font-size: clamp(28px, 6vw, 48px);
    letter-spacing: 0.01rem;
    font-family: var(--font-family-fk-raster-grotesk-trial-blended);
    font-weight: normal;
    margin: 0;
    padding: 0;
    color: rgba(0, 0, 0, 1);
  }

  p {
    font-size: 1rem;
    font-family: var(--font-family-maison-neue-mono-trial-bold);
    font-weight: normal;
    color: rgba(0, 0, 0, 1);
  }
  .start-button {
    position: center;
    width: 7em;
    font-size: 16px;
    font-weight: bold;
    font-family: var(--font-family-maison-neue-mono-trial-bold);
    color: white;
    background-color: #a7cee3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    padding: 5px;
  }

  .obstacle1 {
    position: absolute;
    top: 73%;
    left: 0;
    width: 30%;
    height: auto;
  }
  .platform_coin {
    position: absolute;
    top: 54%;
    right: 10%;
    width: 30%;
    height: auto;
  }
  .obstacle3 {
    position: absolute;
    top: 2%;
    left: -10%;
    width: 30%;
    height: auto;
  }

  .obstacle5 {
    position: absolute;
    left: 0;
    top: 12%;
    width: 30%;
    height: auto;
  }

  .obstacble_6 {
    position: absolute;
    bottom: 23%;
    right: 6%;
    width: 30%;
    height: auto;
  }
  .flower_red1 {
    position: absolute;
    top: 36%;
    left: 7%;
    width: 6%;
    height: auto;
    animation: rotateel 3s linear infinite;
  }
  .flower_red2 {
    position: absolute;
    top: 4%;
    right: 46%;
    width: 6%;
    height: auto;
  }

  .flower_yellow1 {
    position: absolute;
    top: 63%;
    left: 68%;
    width: auto;
    height: auto;
  }

  .flower_yellow2 {
    position: absolute;
    top: 17%;
    right: 15%;
    width: 3%;
    height: auto;
  }

  .flower_green1 {
    position: absolute;
    bottom: 24%;
    left: 72%;
    width: 6%;
    height: auto;
  }

  .flower_green2 {
    position: absolute;
    top: 20%;
    right: 2%;
    width: 10%;
    height: auto;
  }
  footer {
    position: fixed;
    bottom: 0;
    margin-bottom: 10px;
  }

  .copyrights p {
    margin: 0;
  }

  .copyrights {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin: 0;
  }
  .copyrights span {
    padding-right: 5px; /* Adds space to the right of the link */
    align-items: center;
    font-size: 1rem;
  }

  .socials {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
  }
  .socials a {
    padding-right: 5px; /* Adds space to the right of the link */
    align-items: center;
    margin: 0;
  }
  .socials a img {
    margin: 0;
  }
  .icon {
    width: 1.1em; /* Adjust size as needed */
    height: 1.1em;
    vertical-align: middle; /* Align with text */
  }

  .overlay a {
    font-size: 38px;
    padding: 20px;
  }
  .overlay a span {
    transition: none;
  }

  #scoreContainer div {
    font-size: 16px;
    color: rgb(0, 0, 0);
    pointer-events: none;
    z-index: 0;
  }
  #platforms {
    width: 80;
    height: 10;
  }
  #soundToggle {
    position: fixed;
    top: 27px;
    right: 80px;
    cursor: pointer;
  }
  #gameOverPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ee274a; /* red background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 97;
  }

  .popup-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    background: #5a3eaf; /* purple border */
    padding: 15px;
    border-radius: 20px;
  }

  .character-box {
    background: #9ad5f1;
    padding: 50px;
    border-radius: 15px;
    width: 60vw;
    height: 30vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
  }
  .score-box {
    background: #9ad5f1;
    padding: 20px;
    border-radius: 15px;
    width: 60vw;
    height: auto;
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center;
  }

  .character-box img {
    width: 70%;
    image-rendering: pixelated;
  }

  .score-box p {
    color: white;
    font-family: var(--font-family-fk-raster-grotesk-trial-blended);
    font-weight: normal;
    letter-spacing: 0.07rem;
    font-size: 14px;
    margin: 10px 0;
  }

  #gameOverPopup h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    font-weight: bold;
  }

  .restart-text {
    color: #ffd458;
    font-size: 1.4rem;
    margin-top: 15px;
    font-weight: bold;
  }

  .hidden {
    display: none;
    pointer-events: none; /* <- this is critical */
    opacity: 0;
  }
}
@media only screen and (min-width: 820px) and (max-width: 1120px) {
  /* Your CSS rules here */
  * {
    box-sizing: border-box;
  }
  html,
  body {
    overflow: hidden;
    height: 100%;
    position: relative;
  }
  #gameOverPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ee274a; /* red background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 97;
  }

  .popup-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    background: #5a3eaf; /* purple border */
    padding: 15px;
    border-radius: 20px;
  }

  .character-box {
    background: #9ad5f1;
    padding: 50px;
    border-radius: 15px;
    width: 60vw;
    height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
  }
  .score-box {
    background: #9ad5f1;
    padding: 20px;
    border-radius: 15px;
    width: 60vw;
    height: auto;
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center;
  }

  .character-box img {
    width: 50%;
    image-rendering: pixelated;
  }

  .score-box p {
    color: white;
    font-family: var(--font-family-fk-raster-grotesk-trial-blended);
    font-weight: normal;
    letter-spacing: 0.07rem;
    font-size: 38px;
    margin: 25px 0;
  }

  #gameOverPopup h2 {
    font-size: 2.4rem;
    margin-bottom: 15px;
    font-weight: bold;
  }

  .restart-text {
    color: #ffd458;
    font-size: 2.4rem;
    margin-top: 15px;
    font-weight: bold;
  }
  .overlay a span {
    transition: none;
  }
}
