/**
 * Dinosaur Game Styles
 * Chrome Dino Game inspired styling with real-time leaderboard integration
 */

/* Game Container */
.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Game Canvas */
#gameCanvas {
  border: 2px solid #535353;
  background: #f7f7f7;
  display: block;
  margin: 1rem auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.game-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.game-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-btn--secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.game-btn--secondary:hover {
  background: #e5e7eb;
}

/* Game Stats */
.game-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Game Instructions */
.game-instructions {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

.instructions-title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.instructions-text {
  color: #78350f;
  font-size: 0.875rem;
}

/* Game Over Screen */
.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
  min-width: 300px;
  z-index: 1000;
}

.game-over-title {
  font-size: 2rem;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 1rem;
}

.final-score {
  font-size: 3rem;
  font-weight: 700;
  color: #667eea;
  margin: 1rem 0;
}

.new-record {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  margin: 1rem 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Leaderboard Styles */
.leaderboard-section {
  margin: 2rem 0;
}

.leaderboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: #374151;
}

/* Loading States */
.loading {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-container {
    padding: 0.5rem;
  }
  
  #gameCanvas {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
  
  .game-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .game-btn {
    width: 100%;
    max-width: 200px;
  }
  
  .game-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  .game-over {
    margin: 1rem;
    min-width: auto;
    width: calc(100% - 2rem);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  #gameCanvas {
    border-color: #000;
  }
  
  .game-btn--primary {
    background: #000;
    color: #fff;
  }
  
  .game-btn--secondary {
    background: #fff;
    color: #000;
    border-color: #000;
  }
}
