/* Pet Food Catcher Game Styles */

.game-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #E0F6FF 0%, #FFE4EC 100%);
}

.game-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.game-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #40E0D0;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.game-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2rem;
}

#gameCanvas {
  border: 4px solid #40E0D0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  background: white;
  display: block;
  margin: 0 auto 2rem auto;
  max-width: 100%;
  height: auto;
  touch-action: none; /* Prevenir scroll durante o jogo */
}

/* Mobile: Canvas vertical */
@media (max-width: 768px) {
  #gameCanvas {
    max-width: 360px;
    width: 100%;
    margin: 0 auto 3rem auto;
  }
  
  .game-section {
    padding: 3rem 1rem;
  }
  
  .game-container {
    padding: 0 1rem;
  }
  
  .game-title {
    font-size: 2rem;
  }
  
  .game-subtitle {
    font-size: 1rem;
  }
}

/* Game Over Screen */
#gameOverScreen {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 1000;
  text-align: center;
  min-width: 400px;
}

#gameOverScreen h2 {
  color: #40E0D0;
  margin-bottom: 1rem;
  font-size: 2rem;
}

#gameOverScreen .score-display {
  font-size: 3rem;
  font-weight: bold;
  color: #FFD700;
  margin: 1rem 0;
}

#gameOverScreen input {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  border: 2px solid #40E0D0;
  border-radius: 8px;
  margin: 1rem 0;
  text-align: center;
}

#gameOverScreen button {
  background: linear-gradient(135deg, #40E0D0, #20B2AA);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#gameOverScreen button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(64, 224, 208, 0.4);
}

/* Ranking Screen */
#rankingScreen {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 1000;
  min-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

#rankingScreen h2 {
  color: #40E0D0;
  margin-bottom: 2rem;
  font-size: 2rem;
  text-align: center;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #f8f9fa;
  border-radius: 8px;
  transition: transform 0.2s;
}

.ranking-item:hover {
  transform: translateX(5px);
}

.ranking-item.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  font-weight: bold;
}

.ranking-item.silver {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: white;
  font-weight: bold;
}

.ranking-item.bronze {
  background: linear-gradient(135deg, #CD7F32, #B87333);
  color: white;
  font-weight: bold;
}

.ranking-item .rank {
  font-size: 1.5rem;
  font-weight: bold;
  min-width: 50px;
}

.ranking-item .name {
  flex: 1;
  text-align: left;
  padding: 0 1rem;
  font-size: 1.2rem;
}

.ranking-item .score {
  font-size: 1.2rem;
  font-weight: bold;
}

#rankingScreen button {
  background: linear-gradient(135deg, #FF69B4, #FF1493);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 2rem;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

#rankingScreen button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 105, 180, 0.4);
}

/* Overlay */
.game-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  pointer-events: none;
}

/* O overlay será controlado pelo JavaScript via display: block/none */

/* Responsivo */
@media (max-width: 900px) {
  #gameCanvas {
    width: 100%;
    height: auto;
  }
  
  #gameOverScreen,
  #rankingScreen {
    min-width: 90%;
    max-width: 90%;
    padding: 2rem;
  }
  
  .game-title {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .game-title {
    font-size: 1.5rem;
  }
  
  .game-subtitle {
    font-size: 1rem;
  }
  
  #gameOverScreen h2,
  #rankingScreen h2 {
    font-size: 1.5rem;
  }
  
  .ranking-item .rank,
  .ranking-item .name,
  .ranking-item .score {
    font-size: 1rem;
  }
}
