/* Egg Catcher Game Styles */

/* === Google Fonts Import === */
@import url("https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap");

/* === Global Styles === */
* {
  box-sizing: border-box;
}

body {
  font-family: "Fredoka One", cursive;
  touch-action: none; /* Prevents scrolling on mobile */
  overflow: hidden; /* Hide scrollbars */
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Layout Styles === */
.game-container {
  width: 100%;
  max-width: 42rem; /* 672px - equivalent to Tailwind's max-w-2xl */
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: #374151; /* gray-700 */
  width: 100%;
}

.game-title {
  font-size: 2rem;
  color: #92400e; /* yellow-900 */
}

.game-stats {
  display: flex;
  gap: 1rem;
  font-size: 1.25rem;
}

.score-text {
  font-weight: bold;
  color: #059669; /* green-600 */
}

.lives-text {
  font-weight: bold;
  color: #dc2626; /* red-500 */
}

/* === Canvas Container === */
.canvas-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4/3;
  border-radius: 0.5rem;
}

/* === Canvas Styles === */
#gameCanvas {
  width: 100%;
  height: 100%;
  background-color: #87ceeb; /* Sky Blue */
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: block;
}

/* === Game Overlay === */
#gameOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  color: white;
  border-radius: 0.5rem;
  padding: 1rem;
}

.status-text {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-align: center;
}

.start-button {
  background-color: #10b981; /* green-500 */
  color: white;
  font-weight: bold;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: scale(1);
  transition: all 0.2s ease;
  font-family: "Fredoka One", cursive;
}

.start-button:hover {
  background-color: #059669; /* green-600 */
  transform: scale(1.05);
}

.start-button:active {
  transform: scale(0.95);
}

/* === Grass Floor === */
.grass-floor {
  width: 100%;
  height: 2rem;
  background-color: #10b981; /* green-500 */
  border-radius: 0 0 0.5rem 0.5rem;
  border-top: 4px solid #047857; /* green-700 */
  margin-top: -0.5rem;
}

/* === Responsive Design === */
@media (min-width: 768px) {
  .game-title {
    font-size: 2.25rem;
  }

  .game-stats {
    font-size: 1.5rem;
  }

  .status-text {
    font-size: 3rem;
  }
}

@media (max-width: 640px) {
  .game-container {
    padding: 0 0.5rem;
  }

  .game-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .game-title {
    font-size: 1.75rem;
  }

  .game-stats {
    font-size: 1.125rem;
    gap: 2rem;
  }

  .status-text {
    font-size: 2rem;
  }

  .start-button {
    padding: 0.5rem 1.5rem;
    font-size: 1.125rem;
  }

  .grass-floor {
    height: 1.5rem;
  }
}

/* === Utility Classes === */
.bg-yellow-100 {
  background-color: #fef3c7;
}

.text-center {
  text-align: center;
}

.font-bold {
  font-weight: bold;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.min-h-screen {
  min-height: 100vh;
}

.p-4 {
  padding: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.space-x-4 > * + * {
  margin-left: 1rem;
}

/* === Animation Classes === */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* === Loading Animation === */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
