/* ============================================
   Fishing Game - Styles
   ============================================ */

:root {
  --primary-color: #2196F3;
  --secondary-color: #4CAF50;
  --background-color: #E3F2FD;
  --surface-color: #FFFFFF;
  --text-color: #1A237E;
  --text-muted: #5C6BC0;
  --water-color: #1565C0;
  --water-light: #42A5F5;
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --gold-color: #FFD700;
  --rare-color: #9C27B0;
  --legendary-color: #FF5722;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow: hidden;
  touch-action: manipulation;
}

#game-container {
  width: 100%;
  height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  background: linear-gradient(180deg, #87CEEB 0%, #E3F2FD 100%);
}

/* ============================================
   Loading
   ============================================ */

#loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader {
  text-align: center;
}

.fish-loader {
  font-size: 3rem;
  animation: swim 1s ease-in-out infinite;
}

@keyframes swim {
  0%, 100% { transform: translateX(-10px) rotate(-5deg); }
  50% { transform: translateX(10px) rotate(5deg); }
}

/* ============================================
   Screens
   ============================================ */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ============================================
   Title Screen
   ============================================ */

#title-screen {
  background: linear-gradient(180deg, #87CEEB 0%, #1565C0 100%);
  padding: 2rem 1.5rem;
  justify-content: center;
  align-items: center;
}

.title-content {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.title-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.title-content h1 {
  font-size: 2.5rem;
  color: white;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 0.5rem;
}

.title-content p {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.game-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.info-item {
  background: rgba(255,255,255,0.2);
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-select {
  margin-bottom: 2rem;
}

.select-label {
  color: rgba(255,255,255,0.9);
  margin-bottom: 1rem;
}

.location-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.location-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid transparent;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.location-btn:hover {
  background: rgba(255,255,255,0.3);
}

.location-btn.active {
  background: rgba(255,255,255,0.3);
  border-color: white;
}

.play-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.play-btn:active {
  transform: translateY(0);
}

/* ============================================
   Game Screen
   ============================================ */

#game-screen {
  background: linear-gradient(180deg, #87CEEB 0%, #1565C0 60%, #0D47A1 100%);
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.score-display, .catch-display, .streak-display {
  background: rgba(0,0,0,0.4);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.score-label, .catch-label, .streak-label {
  opacity: 0.8;
  font-size: 0.9rem;
}

.hud-center {
  flex: 1;
  max-width: 200px;
  margin: 0 1rem;
}

.timer-container {
  background: rgba(0,0,0,0.4);
  border-radius: 1rem;
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
}

.timer-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 1rem;
  transition: width 0.1s linear;
}

.timer-bar.warning {
  background: var(--warning-color);
}

#timer-text {
  position: relative;
  display: block;
  text-align: center;
  color: white;
  font-weight: 600;
  z-index: 1;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.instructions-overlay {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 1rem;
  transition: opacity 0.3s;
}

.instructions-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.instruction-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Catch Popup */
.catch-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.catch-popup.show {
  transform: translate(-50%, -50%) scale(1);
}

.catch-popup.hidden {
  display: none;
}

.catch-fish-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: catchBounce 0.5s ease-out;
}

@keyframes catchBounce {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.catch-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.catch-points {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.catch-popup.rare .catch-name { color: var(--rare-color); }
.catch-popup.legendary .catch-name { color: var(--legendary-color); }

/* ============================================
   Result Screen
   ============================================ */

#result-screen {
  background: linear-gradient(180deg, #87CEEB 0%, #E3F2FD 100%);
  padding: 1.5rem;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.result-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.result-header {
  margin-bottom: 1.5rem;
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.result-header h2 {
  font-size: 2rem;
  color: var(--text-color);
}

.catch-summary {
  background: var(--surface-color);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.catch-summary h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.catch-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.catch-item {
  background: var(--background-color);
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.catch-item-icon {
  font-size: 1.5rem;
}

.catch-item-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.catch-item.rare { border: 2px solid var(--rare-color); }
.catch-item.legendary { border: 2px solid var(--legendary-color); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 1rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.prize-section {
  background: linear-gradient(135deg, var(--gold-color), #FFA000);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  color: white;
}

.prize-badge {
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 2rem;
}

.prize-section h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.prize-section p {
  opacity: 0.9;
  margin-bottom: 1rem;
}

.discount-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.2);
  padding: 0.75rem;
  border-radius: 0.5rem;
}

#discount-code {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.copy-btn {
  background: white;
  color: var(--text-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.copy-btn:hover {
  transform: scale(1.05);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
  .title-content h1 {
    font-size: 2rem;
  }
  
  .game-info {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}
