/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  font-family: 'Georgia', 'Garamond', serif;
  overflow-x: hidden;
  background: #d0f4f7;
  text-align: center;
}

/* Home Screen */
#homeScreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100dvh; /* dynamic viewport height for mobile */
  padding: 20px;
  background: linear-gradient(#f9d976, #f39f86);
}

#homeScreen h1 {
  font-size: 50px;
  color: #444;
  margin-bottom: 20px;
}

#themes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

#themes button {
  padding: 14px 24px;
  font-size: 22px;
  border: none;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

#themes button:hover {
  background: #ffe0b2;
}

/* Selected Theme Highlight */
#themes button.selected {
  background-color: #34a853;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

#startGameButton {
  margin-top: 10px;
  padding: 14px 40px;
  font-size: 26px;
  border: none;
  background-color: #34a853;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#startGameButton:hover:enabled {
  background-color: #2e7d32;
  transform: scale(1.05);
}

#startGameButton:disabled {
  background-color: gray;
  cursor: not-allowed;
}

/* Game Screen */
#gameScreen {
  position: relative;
  width: 100vw;
  height: 90dvh;
  overflow: hidden;
}

#gameArea {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.fruit {
  position: absolute;
  width: 70px;
  height: 70px;
  font-size: 50px;
  text-align: center;
  line-height: 70px;
  cursor: pointer;
  user-select: none;
}

/* Scoreboard */
#scoreBoard {
  position: fixed;
  top: 10px;
  left: 10px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.8);
  padding: 6px 12px;
  border-radius: 8px;
  z-index: 10;
}

/* Game Over Screen */
#gameOverScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding: 20px;
  background: linear-gradient(to bottom, #ffecd2, #fcb69f);
  color: #333;
  animation: fadeIn 1s ease-in;
}

#gameOverScreen h1 {
  font-size: 80px;
  margin-bottom: 20px;
  color: #ff6f61;
  text-shadow: 
    2px 2px 0px #fff,
    4px 4px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 4px;
  animation: floatText 3s infinite alternate ease-in-out;
}

#gameOverScreen p {
  font-size: 26px;
  color: #555;
  margin-bottom: 30px;
}

#gameOverScreen button {
  padding: 14px 30px;
  font-size: 22px;
  background-color: #34a853;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

#gameOverScreen button:hover {
  background-color: #2e7d32;
  transform: scale(1.05);
}

/* Ad Banner */
#ad-banner {
  width: 100%;
  height: 80px;
  background: #ddd;
  text-align: center;
  line-height: 80px;
  font-size: 18px;
  position: fixed;
  bottom: 0;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes floatText {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-10px); }
}

/* 📱 Mobile Responsive */
@media (max-width: 600px) {
  #homeScreen h1 {
    font-size: 36px;
  }

  #themes button {
    font-size: 18px;
    padding: 10px 20px;
  }

  #startGameButton {
    font-size: 20px;
    padding: 12px 30px;
  }

  #scoreBoard {
    font-size: 18px;
  }

  .fruit {
    width: 50px;
    height: 50px;
    font-size: 36px;
    line-height: 50px;
  }

  #gameOverScreen h1 {
    font-size: 60px;
  }

  #gameOverScreen p {
    font-size: 22px;
  }

  #gameOverScreen button {
    font-size: 20px;
    padding: 10px 25px;
  }
}
