/* ===== CORE RESET AND VARIABLES ===== */
:root {
  /* Ocean Color Palette */
  --deep-blue: #003d5c;
  --ocean-blue: #0074a6;
  --light-blue: #00a8d6;
  --surface-blue: #87ceeb;
  --foam-white: #f0f8ff;
  --sand-color: #deb887;
  --coral-pink: #ff7f7f;
  --seaweed-green: #228b22;
  --golden-yellow: #ffd700;
  
  /* UI Colors */
  --ui-primary: #1e293b;
  --ui-secondary: #334155;
  --ui-accent: #06b6d4;
  --ui-success: #10b981;
  --ui-warning: #f59e0b;
  --ui-danger: #ef4444;
  --ui-glass: rgba(255, 255, 255, 0.1);
  --ui-dark-glass: rgba(0, 0, 0, 0.3);
  
  /* Animation Timing */
  --wave-speed: 3s;
  --fish-speed: 8s;
  --bubble-speed: 4s;
}

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

body {
  font-family: 'Exo 2', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(to bottom, #87ceeb 0%, var(--surface-blue) 20%, var(--light-blue) 40%, var(--ocean-blue) 70%, var(--deep-blue) 100%);
  cursor: default;
}

/* ===== OCEAN ENVIRONMENT ===== */
.ocean-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sky Layer */
.sky-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(to bottom, #87ceeb 0%, #b0e0e6 100%);
  z-index: 1;
}

.clouds {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(ellipse 200px 50px at 20% 30%, rgba(255,255,255,0.8) 0%, transparent 50%),
    radial-gradient(ellipse 300px 80px at 70% 20%, rgba(255,255,255,0.6) 0%, transparent 50%),
    radial-gradient(ellipse 250px 60px at 90% 40%, rgba(255,255,255,0.7) 0%, transparent 50%);
  animation: drift 30s linear infinite;
}

.sun {
  position: absolute;
  top: 15%;
  right: 20%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--golden-yellow) 0%, #ffea00 70%, transparent 100%);
  border-radius: 50%;
  box-shadow: 0 0 50px var(--golden-yellow);
  animation: sun-glow 4s ease-in-out infinite alternate;
}

/* Water Surface with Animated Waves */
.water-surface {
  position: absolute;
  top: 30%;
  left: 0;
  width: 100%;
  height: 15%;
  overflow: hidden;
  z-index: 2;
}

.wave {
  position: absolute;
  width: 200%;
  height: 100%;
  background: linear-gradient(to bottom, var(--foam-white) 0%, transparent 30%, var(--surface-blue) 70%, var(--light-blue) 100%);
  opacity: 0.7;
}

.wave1 {
  animation: wave-animation 6s ease-in-out infinite;
}

.wave2 {
  animation: wave-animation 8s ease-in-out infinite reverse;
  animation-delay: -2s;
}

.wave3 {
  animation: wave-animation 4s ease-in-out infinite;
  animation-delay: -1s;
  opacity: 0.4;
}

/* Underwater Environment */
.underwater {
  position: absolute;
  top: 45%;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(to bottom, var(--light-blue) 0%, var(--ocean-blue) 50%, var(--deep-blue) 100%);
  z-index: 1;
}

.depth-layer {
  position: absolute;
  width: 100%;
  height: 100%;
}

.layer-1 {
  z-index: 3;
  opacity: 0.9;
}

.layer-2 {
  z-index: 2;
  opacity: 0.7;
  transform: scale(1.1);
}

.layer-3 {
  z-index: 1;
  opacity: 0.5;
  transform: scale(1.2);
}

/* Ocean Floor Elements */
.seaweed {
  position: absolute;
  width: 20px;
  height: 120px;
  background: linear-gradient(to top, var(--seaweed-green) 0%, #32cd32 100%);
  border-radius: 10px 10px 0 0;
  transform-origin: bottom center;
  animation: sway 4s ease-in-out infinite;
}

.seaweed-1 {
  left: 10%;
  bottom: 0;
  animation-delay: 0s;
}

.seaweed-2 {
  left: 60%;
  bottom: 0;
  height: 80px;
  animation-delay: -1s;
}

.seaweed-3 {
  left: 80%;
  bottom: 0;
  height: 100px;
  animation-delay: -2s;
}

.coral {
  position: absolute;
  bottom: 0;
  width: 50px;
  height: 40px;
  background: var(--coral-pink);
  border-radius: 20px 20px 0 0;
}

.coral-1 {
  left: 30%;
  animation: coral-pulse 3s ease-in-out infinite;
}

.coral-2 {
  left: 75%;
  width: 35px;
  height: 30px;
  animation: coral-pulse 3s ease-in-out infinite;
  animation-delay: -1.5s;
}

.rock {
  position: absolute;
  bottom: 0;
  width: 60px;
  height: 30px;
  background: #696969;
  border-radius: 30px 30px 0 0;
}

.rock-1 {
  left: 45%;
}

.ocean-floor {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to bottom, var(--sand-color) 0%, #cd853f 100%);
}

.treasure-chest {
  position: absolute;
  bottom: 20px;
  right: 15%;
  width: 30px;
  height: 20px;
  background: #8b4513;
  border-radius: 5px;
  cursor: pointer;
  animation: treasure-glow 2s ease-in-out infinite;
}

.treasure-chest::before {
  content: '💎';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
}

/* Fish Swimming System */
.fish-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.swimming-fish {
  position: absolute;
  font-size: 24px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

/* Fishing System */
.fishing-system {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.fishing-line {
  width: 2px;
  height: 200px;
  background: linear-gradient(to bottom, #333 0%, transparent 100%);
  margin: 0 auto;
  transform-origin: top center;
  transition: all 0.5s ease;
}

.hook {
  width: 12px;
  height: 16px;
  background: #c0c0c0;
  border-radius: 0 0 50% 50%;
  margin: 0 auto;
  position: relative;
  transform: translateY(-2px);
}

.hook::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 6px;
  width: 4px;
  height: 4px;
  background: #c0c0c0;
  border-radius: 50% 50% 0 50%;
  transform: rotate(45deg);
}

.bait {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
}

/* Particle Effects */
.bubbles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.bubble {
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: bubble-rise 6s linear infinite;
}

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

/* ===== GAME UI ===== */
.game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  font-family: 'Orbitron', monospace;
}

.game-ui > * {
  pointer-events: auto;
}

/* Top HUD */
.top-hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.score-panel {
  display: flex;
  gap: 20px;
  background: var(--ui-dark-glass);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px 25px;
  border: 1px solid var(--ui-glass);
}

.stat {
  text-align: center;
  color: white;
}

.stat-label {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--ui-accent);
}

.time-panel {
  background: var(--ui-dark-glass);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 15px 25px;
  border: 1px solid var(--ui-glass);
  text-align: center;
  color: white;
  position: relative;
}

.time-of-day {
  font-size: 18px;
  font-weight: 700;
  color: var(--golden-yellow);
}

.weather {
  font-size: 14px;
  margin-top: 5px;
  opacity: 0.9;
}

.audio-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.2s ease;
  padding: 5px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.audio-toggle.muted {
  opacity: 0.4;
}

/* Mobile-specific audio toggle improvements */
@media (hover: none) and (pointer: coarse) {
  .audio-toggle {
    width: 40px;
    height: 40px;
    font-size: 20px;
    padding: 8px;
    /* Add visual indicator for touch-friendly interface */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  
  .audio-toggle:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
  }
  
  /* Improve visual feedback for mobile */
  .audio-toggle.loading {
    animation: audio-pulse 1.5s ease-in-out infinite;
  }
}

@keyframes audio-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Fish Radar */
.radar-panel {
  position: absolute;
  top: 120px;
  right: 20px;
  width: 150px;
  height: 150px;
}

.radar-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--deep-blue) 0%, var(--ui-primary) 100%);
  border-radius: 50%;
  border: 3px solid var(--ui-accent);
  overflow: hidden;
}

.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 50%;
  background: linear-gradient(to bottom, var(--ui-accent) 0%, transparent 100%);
  transform-origin: bottom center;
  animation: radar-sweep 3s linear infinite;
}

.radar-dots {
  position: absolute;
  width: 100%;
  height: 100%;
}

.radar-label {
  text-align: center;
  margin-top: 10px;
  color: white;
  font-size: 12px;
  opacity: 0.8;
}

/* Equipment Panel */
.equipment-panel {
  position: absolute;
  bottom: 200px;
  left: 20px;
  width: 250px;
  background: var(--ui-dark-glass);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  border: 1px solid var(--ui-glass);
  color: white;
}

.rod-strength {
  margin-bottom: 20px;
}

.equipment-label {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.strength-bar {
  height: 8px;
  background: var(--ui-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ui-success) 0%, var(--ui-warning) 70%, var(--ui-danger) 100%);
  width: 100%;
  transition: width 0.3s ease;
}

.bait-options {
  display: flex;
  gap: 10px;
}

.bait-option {
  flex: 1;
  padding: 8px 12px;
  background: var(--ui-secondary);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.bait-option:hover {
  background: var(--ui-primary);
}

.bait-option.active {
  border-color: var(--ui-accent);
  background: var(--ui-accent);
  color: white;
}

/* Action Panel */
.action-panel {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.cast-button {
  background: linear-gradient(135deg, var(--ui-success) 0%, #059669 100%);
  border: none;
  border-radius: 50px;
  padding: 20px 40px;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}

.cast-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6);
}

.cast-button:active {
  transform: translateY(0);
}

.cast-button:disabled {
  background: var(--ui-secondary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-icon {
  font-size: 24px;
}

.reel-controls {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.reel-controls.active {
  opacity: 1;
  transform: translateY(0);
}

.reel-progress {
  width: 200px;
  height: 12px;
  background: var(--ui-secondary);
  border-radius: 6px;
  margin: 0 auto 15px;
  overflow: hidden;
}

.reel-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ui-danger) 0%, var(--ui-warning) 50%, var(--ui-success) 100%);
  width: 0%;
  transition: width 0.1s ease;
}

.reel-button {
  background: linear-gradient(135deg, var(--ui-accent) 0%, #0891b2 100%);
  border: none;
  border-radius: 25px;
  padding: 15px 30px;
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reel-button:hover {
  transform: scale(1.05);
}

/* Inventory Panel */
.inventory-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: var(--ui-dark-glass);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid var(--ui-glass);
  color: white;
  max-height: 200px;
  transition: all 0.3s ease;
}

.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--ui-glass);
}

.inventory-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.inventory-toggle:hover {
  transform: scale(1.1);
}

.inventory-grid {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  max-height: 120px;
  overflow-y: auto;
}

.inventory-item {
  aspect-ratio: 1;
  background: var(--ui-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.inventory-item:hover {
  background: var(--ui-primary);
  transform: scale(1.1);
}

.inventory-item .count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
  background: var(--ui-accent);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Achievement Toast */
.achievement-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, var(--golden-yellow) 0%, #f59e0b 100%);
  border-radius: 15px;
  padding: 25px;
  color: white;
  text-align: center;
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 350px;
}

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

.achievement-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.achievement-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.achievement-desc {
  font-size: 14px;
  opacity: 0.9;
}

/* Catch Display */
.catch-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: var(--ui-dark-glass);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 30px;
  color: white;
  text-align: center;
  border: 2px solid var(--ui-accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 400px;
}

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

.caught-fish {
  font-size: 64px;
  margin-bottom: 20px;
  animation: catch-wiggle 0.5s ease-in-out infinite alternate;
}

.fish-name {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ui-accent);
}

.fish-value {
  font-size: 18px;
  color: var(--ui-success);
  margin-bottom: 8px;
}

.fish-rarity {
  font-size: 14px;
  padding: 5px 15px;
  border-radius: 20px;
  display: inline-block;
}

.fish-rarity.common {
  background: var(--ui-secondary);
}

.fish-rarity.uncommon {
  background: var(--ui-success);
}

.fish-rarity.rare {
  background: var(--ui-warning);
}

.fish-rarity.legendary {
  background: linear-gradient(45deg, var(--golden-yellow), var(--coral-pink));
  animation: legendary-glow 1s ease-in-out infinite alternate;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--ocean-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 1s ease, visibility 1s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-fish {
  font-size: 64px;
  margin-bottom: 20px;
  animation: loading-swim 2s ease-in-out infinite;
}

.loading-text {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.loading-bar {
  width: 300px;
  height: 8px;
  background: var(--ui-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--ui-accent) 0%, var(--ui-success) 100%);
  width: 0%;
  transition: width 0.5s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes drift {
  from { transform: translateX(-10%); }
  to { transform: translateX(10%); }
}

@keyframes sun-glow {
  from { 
    box-shadow: 0 0 50px var(--golden-yellow);
    transform: scale(1);
  }
  to { 
    box-shadow: 0 0 80px var(--golden-yellow);
    transform: scale(1.1);
  }
}

@keyframes wave-animation {
  0%, 100% { transform: translateX(-25%); }
  50% { transform: translateX(0%); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes coral-pulse {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.1);
    filter: brightness(1.2);
  }
}

@keyframes treasure-glow {
  0%, 100% { 
    box-shadow: 0 0 10px var(--golden-yellow);
  }
  50% { 
    box-shadow: 0 0 20px var(--golden-yellow);
  }
}

@keyframes bubble-rise {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
    opacity: 0;
  }
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes catch-wiggle {
  from { transform: rotate(-5deg) scale(1); }
  to { transform: rotate(5deg) scale(1.1); }
}

@keyframes legendary-glow {
  from { 
    box-shadow: 0 0 15px var(--golden-yellow);
  }
  to { 
    box-shadow: 0 0 25px var(--coral-pink);
  }
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .top-hud {
    flex-direction: column;
    gap: 8px;
    left: 10px;
    right: 10px;
    top: 10px;
  }
  
  .score-panel {
    gap: 12px;
    padding: 8px 15px;
    font-size: 13px;
  }
  
  .equipment-panel {
    width: 160px; /* Slightly smaller width */
    padding: 8px;
    left: 10px;
    bottom: 140px; /* More space from bottom to avoid action panel overlap */
  }
  
  .inventory-panel {
    width: 160px; /* Smaller width to reduce screen coverage */
    right: 10px;
    bottom: 80px; /* Position above cast button with space */
  }
  
  .cast-button {
    padding: 14px 28px;
    font-size: 16px;
    min-height: 48px; /* Touch-friendly minimum */
  }
  
  .reel-button {
    padding: 12px 24px;
    font-size: 15px;
    min-height: 44px;
  }
  
  .radar-panel {
    width: 85px;
    height: 85px;
    top: 10px;
    right: 10px;
  }
  
  .bait-option {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 40px; /* Touch-friendly */
  }
  
  .inventory-toggle {
    min-width: 40px;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .top-hud {
    left: 8px;
    right: 8px;
    top: 8px;
    gap: 8px;
  }
  
  .score-panel {
    padding: 6px 12px;
    gap: 10px;
  }
  
  .stat {
    font-size: 11px;
  }
  
  .stat-value {
    font-size: 15px !important;
  }
  
  .equipment-panel {
    left: 8px;
    bottom: 140px; /* More space from action panel to avoid overlap */
    width: 140px; /* Smaller width to reduce screen coverage */
    padding: 6px;
    z-index: 125;
  }
  
  .inventory-panel {
    right: 8px;
    bottom: 140px; /* Move up to avoid overlapping cast button */
    width: 140px; /* Smaller width to reduce screen coverage */
    z-index: 120;
  }
  
  .action-panel {
    bottom: 10px; /* Move closer to bottom for more game area visibility */
    left: 50%;
    transform: translateX(-50%);
    z-index: 130; /* Highest for cast button */
  }
  
  .cast-button {
    padding: 12px 24px;
    font-size: 15px;
    min-height: 44px;
  }
  
  .reel-button {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
  }
  
  .radar-panel {
    top: 50px;
    right: 8px;
    width: 70px;
    height: 70px;
  }
  
  .radar-label {
    font-size: 9px;
  }
  
  .bait-option {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 36px;
  }
  
  .equipment-label {
    font-size: 11px;
  }
  
  .inventory-header {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .inventory-grid {
    padding: 8px;
    grid-template-columns: repeat(6, 1fr); /* More columns for smaller space */
  }
  
  .inventory-item {
    font-size: 16px;
  }
  
  /* Touch-friendly welcome modal */
  .welcome-content {
    padding: 20px 15px;
    margin: 12px;
    max-width: calc(100vw - 24px);
  }
  
  .welcome-title {
    font-size: 22px;
    margin-bottom: 18px;
  }
  
  .welcome-instructions li {
    padding: 6px;
    font-size: 13px;
  }
  
  .start-fishing-btn {
    padding: 14px 28px;
    font-size: 15px;
    min-height: 44px;
  }
}

/* Custom cursor for fishing */
body.fishing {
  cursor: crosshair;
}

/* Smooth transitions for all interactive elements */
button, .bait-option, .inventory-item {
  transition: all 0.3s ease;
}

/* Mobile-specific controls visibility */
@media (hover: none) and (pointer: coarse) {
  .desktop-controls {
    display: none !important;
  }
  
  .mobile-controls {
    display: block !important;
  }
  
  /* Add visual indicators for touch elements */
  .cast-button, .reel-button {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  }
  
  .cast-button:active, .reel-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
  }
}

/* Welcome Modal */
.welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: all 0.5s ease;
}

.welcome-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-content {
  background: var(--ui-dark-glass);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  color: white;
  text-align: center;
  border: 2px solid var(--ui-accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
  background: linear-gradient(135deg, var(--ui-accent), var(--golden-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow-pulse 2s ease-in-out infinite alternate;
}

.welcome-instructions {
  text-align: left;
}

.welcome-instructions h3 {
  color: var(--ui-accent);
  margin-bottom: 15px;
  text-align: center;
  font-size: 20px;
}

.welcome-instructions ul {
  list-style: none;
  padding: 0;
  margin-bottom: 25px;
}

.welcome-instructions li {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 4px solid var(--ui-accent);
}

.welcome-instructions strong {
  color: var(--ui-warning);
}

.start-fishing-btn {
  background: linear-gradient(135deg, var(--ui-success) 0%, var(--ui-accent) 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

.start-fishing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

@keyframes glow-pulse {
  0% {
    text-shadow: 0 0 10px var(--ui-accent);
  }
  100% {
    text-shadow: 0 0 20px var(--ui-accent), 0 0 30px var(--ui-accent);
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --ui-glass: rgba(255, 255, 255, 0.3);
    --ui-dark-glass: rgba(0, 0, 0, 0.8);
  }
}

/* Mobile landscape orientation */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .top-hud {
    flex-direction: row;
    gap: 8px; /* Reduced gap to save space */
    left: 8px;
    right: 150px; /* Less space reserved for right panels */
    top: 5px; /* Closer to top edge */
  }
  
  .score-panel {
    padding: 4px 8px; /* Smaller padding */
    gap: 6px; /* Smaller gap */
    font-size: 11px; /* Smaller font */
  }
  
  .equipment-panel {
    right: 8px;
    left: auto;
    bottom: 50px; /* Move up to give action panel space */
    width: 130px; /* Smaller width */
    padding: 6px; /* Smaller padding */
  }
  
  .inventory-panel {
    right: 8px;
    bottom: 120px; /* Stack above equipment panel with space */
    width: 130px; /* Smaller width */
    padding: 6px; /* Smaller padding */
  }
  
  .action-panel {
    bottom: 5px; /* Very close to bottom for maximum game area */
    left: 50%;
    transform: translateX(-50%);
  }
  
  .cast-button {
    padding: 8px 16px; /* Smaller button */
    font-size: 13px;
    min-height: 36px;
  }
  
  .reel-button {
    padding: 6px 12px; /* Smaller button */
    font-size: 12px;
    min-height: 32px;
  }
  
  .radar-panel {
    top: 5px; /* Closer to top */
    right: 8px;
    width: 50px; /* Smaller radar */
    height: 50px;
  }
  
  .radar-label {
    font-size: 8px; /* Smaller label */
  }
  
  .bait-option {
    padding: 4px 6px; /* Much smaller bait options */
    font-size: 10px;
    min-height: 28px;
  }
  
  .equipment-label {
    font-size: 10px; /* Smaller labels */
  }
  
  .inventory-header {
    padding: 4px 6px; /* Smaller header */
    font-size: 11px;
  }
  
  .inventory-grid {
    padding: 4px; /* Smaller padding */
    grid-template-columns: repeat(4, 1fr); /* Fewer columns for smaller space */
  }
  
  .inventory-item {
    font-size: 14px; /* Smaller items */
  }
  
  .welcome-content {
    max-height: 70vh; /* Smaller modal */
    overflow-y: auto;
    padding: 15px;
  }
  
  .welcome-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .welcome-instructions li {
    padding: 4px;
    font-size: 12px;
    margin-bottom: 6px;
  }
}

/* Modern iPhones (iPhone 16 Pro, 15 Pro, etc.) - 390-430px */
@media (max-width: 430px) and (min-width: 390px) {
  .cast-button {
    padding: 10px 20px; /* Reduced from 12px 24px */
    font-size: 14px; /* Reduced from 15px */
    min-height: 42px; /* Slightly smaller than 44px */
    gap: 8px; /* Reduced gap between text and icon */
  }
  
  .reel-button {
    padding: 8px 16px; /* Reduced from 10px 20px */
    font-size: 13px; /* Reduced from 14px */
    min-height: 38px; /* Reduced from 40px */
  }
  
  .bait-option {
    padding: 4px 6px; /* Further reduced for better fit */
    font-size: 10px; /* Smaller font */
    min-height: 30px; /* Smaller height */
    margin: 0 1px; /* Minimal margin for better spacing */
  }
  
  .bait-options {
    gap: 4px; /* Reduced gap between bait options */
    flex-wrap: wrap; /* Allow wrapping if needed */
  }
  
  .equipment-panel {
    width: 120px; /* Smaller width to prevent overlap */
    padding: 4px; /* Reduced padding */
    bottom: 140px; /* Move up to create separation */
    left: 8px; /* Ensure proper left positioning */
    z-index: 125; /* Higher z-index */
  }
  
  .inventory-panel {
    width: 120px; /* Smaller width to prevent overlap */
    bottom: 90px; /* Position higher to avoid overlap with equipment panel */
    right: 8px; /* Ensure proper right positioning */
    z-index: 120; /* Lower z-index than equipment */
    max-height: 140px; /* Limit height to prevent vertical overlap */
  }
  
  .inventory-grid {
    grid-template-columns: repeat(5, 1fr); /* Adjust grid for smaller space */
    gap: 3px; /* Smaller gap */
  }
  
  .action-panel {
    bottom: 12px; /* Leave more space from bottom edge for iOS browser controls */
    z-index: 130; /* Highest priority for interaction */
  }
  
  /* Ensure radar doesn't interfere */
  .radar-panel {
    top: 8px;
    right: 8px;
    width: 65px;
    height: 65px;
  }
  
  /* Adjust top HUD for better spacing */
  .top-hud {
    left: 8px;
    right: 85px; /* Leave space for radar */
    top: 8px;
  }
  
  .score-panel {
    padding: 4px 8px; /* Compact padding */
    gap: 8px;
    font-size: 11px;
  }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 320px) {
  .cast-button {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
  }
  
  .equipment-panel {
    width: 140px;
    padding: 6px;
  }
  
  .inventory-panel {
    width: 150px;
  }
  
  .radar-panel {
    width: 60px;
    height: 60px;
  }
  
  .welcome-content {
    margin: 8px;
    padding: 15px 12px;
  }
  
  .welcome-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .welcome-instructions li {
    padding: 4px;
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .start-fishing-btn {
    padding: 12px 24px;
    font-size: 14px;
    min-height: 40px;
  }
}