/* Mobile-Friendly Enhancements */

/* Base responsive layout */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
}

/* Mobile touch areas */
.control-area {
  position: absolute;
  width: 100%;
  height: 50%;
  z-index: 5;
}

#jump-area {
  top: 0;
}

#crouch-area {
  bottom: 0;
}

/* Touch indicators (optional - shows where to tap) */
.control-hint {
  position: absolute;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s;
  z-index: 6;
}

.jump-hint {
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
}

.crouch-hint {
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
}

/* Media queries for different screen sizes */
@media (max-width: 768px) {
  /* Adjust rabbit position */
  #rabbit {
    left: 70px !important;
  }
  
  /* Adjust UI positioning and sizes */
  #score-container {
    font-size: 18px;
    top: 10px;
    right: 10px;
  }
  
  #ui-container {
    top: 10px;
    left: 10px;
    gap: 5px;
  }
  
  .ui-element {
    font-size: 14px;
  }
  
  #boost-meter {
    width: 80px;
  }
  
  #daily-challenge {
    bottom: 20px;
    right: 10px;
    font-size: 12px;
    padding: 5px;
  }
  
  /* Adjust game elements */
  .hurdle {
    transform: scale(0.9);
  }
  
  .cloud {
    opacity: 0.6; /* Reduce cloud visibility to improve performance */
  }
  
  /* Game over and tutorial elements */
  #game-over {
    font-size: 32px;
  }
  
  #restart-button {
    font-size: 18px;
    padding: 10px 20px;
  }
  
  #tutorial {
    padding: 10px;
  }
  
  .tutorial-step {
    font-size: 18px;
    margin: 5px 0;
  }
  
  #tutorial-continue {
    font-size: 16px;
    padding: 8px 16px;
    margin-top: 20px;
  }
  
  /* Leaderboard adjustments */
  #leaderboard {
    width: 80%;
    max-width: 300px;
  }
  
  .leaderboard-entry {
    font-size: 14px;
  }
  
  /* Achievement notifications */
  .achievement {
    font-size: 14px;
    padding: 8px 15px;
    max-width: 80%;
  }
  
  .achievement-icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
}

/* Small phones */
@media (max-width: 375px) {
  #score-container {
    font-size: 16px;
  }
  
  .ui-element {
    font-size: 12px;
  }
  
  #boost-meter {
    width: 60px;
  }
  
  .tutorial-step {
    font-size: 16px;
  }
  
  #game-over {
    font-size: 28px;
  }
}

/* Landscape orientation */
@media (max-height: 450px) and (orientation: landscape) {
  #ui-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    top: 5px;
  }
  
  #daily-challenge {
    bottom: 5px;
    right: 5px;
  }
  
  #score-container {
    top: 5px;
  }
  
  .tutorial-step {
    font-size: 14px;
    margin: 3px 0;
  }
  
  #tutorial-continue {
    margin-top: 10px;
  }
}

/* Controls visibility */
.show-controls .control-hint {
  opacity: 1;
}

.hide-controls .control-hint {
  opacity: 0;
}

/* Adjust touch targets to be more forgiving */
.carrot, .coin, .powerup {
  transform: scale(1.2);
}

/* Better touch feedback - optional */
.control-area:active::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: touch-feedback 0.5s ease-out;
}

@keyframes touch-feedback {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

/* For devices that don't support hover */
@media (hover: none) {
  #restart-button:active {
    background-color: #45a049;
    transform: translate(-50%, -50%) scale(0.95);
  }
  
  #tutorial-continue:active {
    background-color: #45a049;
  }
}
