body {
  font-family: 'Almarai', Tahoma, sans-serif;
  direction: rtl;
  background: url('images/desert-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* ✅ يمنع التمرير */
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

header {
  text-align: center;
  padding-top: 18px;
  color: #000;
}

h1, h2 {
  font-size: 21px;
  margin-bottom: 10px;
}

.hedgehog.small {
  transform: translateX(-50%) scale(0.85); /* ✅ تقليل الحجم بنسبة 15% */
}


.info-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px;
  font-size: 18px;
  color: #000;
  margin-top: 10px;
}

#level,
#score {
  background: #fff;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 5px;
}

#game {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-grow: 1;
  padding-top: 18vh;
  padding-bottom: 2vh; 
  box-sizing: border-box;
  overflow: hidden;
  max-height: 70vh;
}

.holes {
 display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6vh 30px;  /* ✅ مسافة رأسية وأفقية أكبر */
  max-width: 95vw;
  margin: 0 auto;
}

.hole {
  position: relative;
  width: 16vw;
  height: 16vw;
  min-width: 70px;
  min-height: 70px;
  max-width: 120px;
  max-height: 120px;
  background: url('images/hole.png') no-repeat center center;
  background-size: contain;
  overflow: visible;
}

.hedgehog {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12vw;
  height: 14vw;
  min-width: 50px;
  min-height: 60px;
  max-width: 100px;
  max-height: 110px;
  
  background-size: contain;
  cursor: pointer;
  transition: bottom 0.5s ease-in-out;
  z-index: 2;
}

.hedgehog.show {
  bottom: 40px;
}

.word-label {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 8px 15px;
  border-radius: 6px;
  font-size: 22px;
  font-weight: bold;
  color: #000;
  border: 2px solid #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.feedback-icon {
  position: absolute;
  bottom: calc(100% + 80px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #000;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  z-index: 9;
}

.feedback-icon.show {
  opacity: 1;
}

#end-screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.end-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 15px;
  text-align: center;
  font-size: 22px;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.end-content h2 {
  margin-bottom: 20px;
  color: #333;
}

.end-content button {
  font-size: 18px;
  padding: 10px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.end-content button:hover {
  background-color: #218838;
}

.hidden {
  display: none !important;
}

#name-input-container {
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#name-input-container label {
  font-size: 22px;
  font-weight: bold;
  margin: 0 5px;
}

#name-input-container input {
  padding: 8px 12px;
  font-size: 22px;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 200px;
}

#start-btn,
#speed-select {
  padding: 8px 16px;
  font-size: 22px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#start-btn {
  background-color: #28a745;
  color: white;
}

#start-btn:hover {
  background-color: #218838;
}

/* ✅ MEDIA QUERIES - استجابة الهواتف */
@media (max-width: 480px) {
	
	header {
    padding-top: 0;
  margin-top: 0;
  }
  
 #game {
   
	  padding-top: 13vh; /* ✅ بدل 2vh لإبعاد الصف الأول عن الأعلى */
  max-height: none;
  height: auto;
  overflow: visible;
	
	
	
  }

  .holes {
    gap: 12vh 10px;        /* ✅ مسافة أكبر بين الصفوف */
  }

  .hole {
   width: 22vw;
    height: 22vw;
  }

  .hedgehog {
    width: 18vw;
    height: 20vw;
  }

  .hedgehog.show {
        bottom: 35px;

  }

  .word-label {
   font-size: 20px;
    top: -70px;  /* ✅ رفع الكلمة أكثر */
  }

  .feedback-icon {
    font-size: 16px;
    bottom: calc(100% + 70px);
  }

  #name-input-container {
    flex-direction: column;
    gap: 5px;
  }

  #name-input-container input {
    font-size: 18px;
    max-width: 180px;
  }

  #start-btn, #speed-select {
    font-size: 18px;
    padding: 6px 10px;
  }

  .info-bar {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    margin: 10px 0;
  }

  h1, h2 {
    font-size: 14px;
    padding: 0 10px;
  }

  .end-content {
    width: 90%;
    font-size: 18px;
  }
}
@media (min-width: 768px) {
  .holes {
    gap: 10vh 40px;  /* ✅ فراغ أكبر بين الحفر */
    max-width: 700px;  /* ✅ منع صف طويل جدًا */
  }

  .hole {
    width: 120px;
    height: 120px;
  }

  .hedgehog {
    width: 100px;
    height: 110px;
  }

  .word-label {
    font-size: 26px;
    top: -80px;
  }

  .hedgehog.show {
    bottom: 50px;
  }
}
