* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #555;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-image: url('../assets/imgs/mainBannerImg.png');
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(10px);
}

.page-title{
  color: white;
  font-family: "Chewy", system-ui;
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 15px;
}


.game-container {
  position: relative;
  width: 90vw;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #3f4553;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  border: 3px solid white;
}


.grass {
  flex: 0 0 10%;
  background-color: #9acd32;
}
.grass.top{
    background-repeat: repeat-x;
    background-position: right;
    background-image: url('./trees-top.png');
}


.road {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #3f4553;
}


.lane {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
  gap: 5px;
}


.track {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
}


.lane-divider {
  height: 3px;
  background: repeating-linear-gradient(
    to right,
    white 0,
    white 25px,
    transparent 25px,
    transparent 50px
  );
  opacity: 0.5;
  margin: 6px 0;
  border-radius: 1px;
}

.center-lane {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3f4553;
}


.traffic-island {
  width: 100%;
  height: 14px;
  background: repeating-linear-gradient(
    45deg,
    #703a2e 0,
    #703a2e 10px,
    #8b3f2d 10px,
    #8b3f2d 20px
  );
  border-radius: 3px;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.3);
}


.car {
  width: 70px;
  height: 40px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}
#car1 { background-image: url('./car-1.png'); margin-left: 5%; }
#car2 { background-image: url('./car-2.png'); margin-left: 45%; }
#car3 { background-image: url('./car-3.png'); margin-left: 20%; }
#car4 { background-image: url('./car-4.png'); margin-left: 70%; }

#car5 { background-image: url('./car-5.png'); margin-left: 10%; }
#car6 { background-image: url('./car-6.png'); margin-left: 60%; }
#car7 { background-image: url('./car-7.png'); margin-left: 25%; }
#car8 { background-image: url('./car-8.png'); margin-left: 75%; }

#chicken {
  position: absolute;
  bottom: 4%;     
  left: 50%;       
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background-image: url('./chicken.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  z-index: 5;
}

.footer-text{
  max-width: 75%;
  margin: 0 auto;
  text-align: center;
  color: white;
  font-family: "Handlee", cursive;
  margin-top: 15px;
  font-weight: 700
}
.controls {
  position: absolute;
  bottom: 5%;
  right: 5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 6;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  width: 130px;
  height: 130px;
  border-radius: 50%;
}

.middle-row {
  display: flex;
  gap: 40px;
}

.arrow {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: white;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  outline: none;
}
.arrow img{
  width: 20px;
}
.heart {
  display: inline-block;
  animation: beat 1.2s infinite ease-in-out;
}

@keyframes beat {
  0%, 40%, 80%, 100% { transform: scale(1); }
  20%, 60% { transform: scale(1.3); }
}


@media (max-width: 768px) {
  .game-container {
    width: 95vw;
    aspect-ratio: 9 / 16;
  }

  .car {
    width: 50px;
    height: 30px;
  }

 #chicken {
    width: 30px;
    height: 30px;
    bottom: 3%;
  }

  .center-lane {
    height: 30px;
  }

  .traffic-island {
    height: 10px;
  }

  .lane {
    padding: 5px 0;
  }

  .arrow {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .controls {
    bottom: 3%;
    right: 3%;
  }
}

.floating-buy {
    position: fixed;
    right: 22px;
    bottom: 22px;
    padding: 12px 26px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd86b, #ff9a3d);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    border: none;
    font-size: 1.3rem;
    font-family: "Chewy", system-ui;
    text-decoration: none;
}