/* Maritime Color Scheme */
:root {
  --deep-ocean-navy: #001f3f;
  --vibrant-blue: #0074D9;
  --teal: #39CCCC;
  --white: #FFFFFF;
  --light-gray: #F5F5F5;
  --dark-gray: #2C3E50;
  --success-green: #2ECC71;
  --danger-red: #E74C3C;
  --warning-orange: #F39C12;
  
  --border-radius: 8px;
  --shadow: 0 4px 8px rgba(0, 31, 63, 0.2);
  --transition: all 0.3s ease;
  
  --min-touch-target: 44px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', 'Helvetica', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--white);
  background: linear-gradient(135deg, var(--deep-ocean-navy) 0%, var(--vibrant-blue) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--vibrant-blue);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 100;
}

.skip-link:focus {
  top: 6px;
}

/* Header */
.header {
  padding: 1rem;
  background: rgba(0, 31, 63, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--teal);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-ad-space {
  height: 90px;
  background: rgba(57, 204, 204, 0.1);
  border: 2px dashed var(--teal);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 0.9rem;
}

.header-ad-space::before {
  content: "Header Advertisement Space";
}

.game-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  color: var(--teal);
}

.game-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--teal);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(57, 204, 204, 0.1);
  border-color: var(--teal);
  text-decoration: none;
}

/* Language Selector */
.language-selector {
  position: relative;
}

.language-dropdown {
  background: var(--deep-ocean-navy);
  color: var(--teal);
  border: 2px solid var(--teal);
  border-radius: var(--border-radius);
  padding: 0.5rem 2rem 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 100px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2339CCCC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1em;
}

.language-dropdown:hover {
  background-color: rgba(57, 204, 204, 0.1);
  border-color: var(--vibrant-blue);
}

.language-dropdown:focus {
  outline: none;
  border-color: var(--vibrant-blue);
  box-shadow: 0 0 0 2px rgba(0, 116, 217, 0.3);
}

.language-dropdown option {
  background: var(--deep-ocean-navy);
  color: var(--white);
  padding: 0.5rem;
}

.language-dropdown option:hover {
  background: var(--vibrant-blue);
}

@media (max-width: 768px) {
  .language-dropdown {
    padding: 0.4rem 1.5rem 0.4rem 0.8rem;
    font-size: 0.9rem;
    min-width: 80px;
  }
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: var(--min-touch-target);
  min-width: var(--min-touch-target);
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--vibrant-blue);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: #005BB5;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 116, 217, 0.3);
}

.btn-primary:disabled {
  background: var(--dark-gray);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn-secondary:hover {
  background: var(--teal);
  color: var(--deep-ocean-navy);
}

/* Audio Controls */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(57, 204, 204, 0.1);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--teal);
}

#volume-slider {
  width: 80px;
  height: 6px;
  border-radius: 3px;
  background: var(--dark-gray);
  outline: none;
  -webkit-appearance: none;
  transition: var(--transition);
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vibrant-blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--vibrant-blue);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#volume-slider::-webkit-slider-track {
  background: linear-gradient(to right, var(--vibrant-blue) 0%, var(--vibrant-blue) var(--volume-percent, 70%), var(--dark-gray) var(--volume-percent, 70%), var(--dark-gray) 100%);
}

.volume-display {
  font-size: 0.8rem;
  color: var(--teal);
  min-width: 30px;
  text-align: center;
}

@media (max-width: 768px) {
  .audio-controls {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .volume-control {
    padding: 0.25rem;
  }
  
  #volume-slider {
    width: 60px;
  }
}

/* Main content */
.main-content {
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.game-section {
  display: none;
}

.game-section.active {
  display: block;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--teal);
}

/* Setup Phase */
.setup-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  margin-bottom: 2rem;
}

.player-setup h3,
.difficulty-selection h3 {
  margin-bottom: 1rem;
  color: var(--white);
  font-size: 1.2rem;
}

/* Game Board */
.game-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  background: var(--deep-ocean-navy);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 400px;
  aspect-ratio: 1;
  position: relative;
}

.board-cell {
  background: rgba(57, 204, 204, 0.2);
  border: 1px solid var(--teal);
  aspect-ratio: 1;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.board-cell:hover {
  background: rgba(57, 204, 204, 0.4);
  transform: scale(1.05);
}

.board-cell.ship {
  background: var(--vibrant-blue);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--white);
}

.board-cell.ship::before {
  content: "⚓";
  font-size: 1rem;
  color: var(--white);
}

.board-cell.hit {
  background: var(--danger-red);
  color: var(--white);
  animation: hitAnimation 0.6s ease-out;
  box-shadow: 0 0 15px var(--danger-red);
}

.board-cell.hit::after {
  content: "💥";
  font-size: 1.2rem;
  animation: explosionPulse 2s infinite;
}

.board-cell.miss {
  background: rgba(116, 185, 255, 0.3);
  color: var(--teal);
  animation: missAnimation 0.4s ease-out;
}

.board-cell.miss::after {
  content: "○";
  font-size: 1rem;
  opacity: 0.7;
}

.board-cell.sunk {
  background: var(--danger-red);
  color: var(--white);
  box-shadow: 0 0 20px var(--danger-red), inset 0 0 10px rgba(0, 0, 0, 0.5);
  animation: sunkFlash 1s ease-out;
}

.board-cell.sunk::after {
  content: "💣";
  font-size: 1.3rem;
  animation: bombFlash 2s infinite;
}

/* Ship placement preview */
.board-cell.ship-preview {
  background: rgba(0, 116, 217, 0.6);
  border: 2px dashed var(--vibrant-blue);
  animation: previewPulse 1s infinite;
}

.board-cell.ship-preview.valid {
  background: rgba(46, 204, 113, 0.6);
  border-color: var(--success-green);
}

.board-cell.ship-preview.invalid {
  background: rgba(231, 76, 60, 0.6);
  border-color: var(--danger-red);
}

/* Radar sweep effect */
.game-board.radar-sweep::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(57, 204, 204, 0.3), transparent);
  animation: radarSweep 0.8s ease-out;
  pointer-events: none;
  z-index: 1;
}

/* Water ripple effect */
.board-cell.water-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(57, 204, 204, 0.4);
  animation: waterRipple 0.4s ease-out;
  transform: translate(-50%, -50%);
}

/* Hit animation keyframes */
@keyframes hitAnimation {
  0% { 
    background: var(--danger-red);
    transform: scale(1);
  }
  50% { 
    background: #ff6b6b;
    transform: scale(1.2);
  }
  100% { 
    background: var(--danger-red);
    transform: scale(1);
  }
}

@keyframes explosionPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes missAnimation {
  0% { 
    background: rgba(116, 185, 255, 0.8);
    transform: scale(1);
  }
  50% { 
    transform: scale(1.1);
  }
  100% { 
    background: rgba(116, 185, 255, 0.3);
    transform: scale(1);
  }
}

@keyframes sunkFlash {
  0%, 100% { box-shadow: 0 0 20px var(--danger-red); }
  25%, 75% { box-shadow: 0 0 30px #ff4757, 0 0 40px #ff4757; }
  50% { box-shadow: 0 0 40px #ff3838, 0 0 50px #ff3838, 0 0 60px #ff3838; }
}

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

@keyframes previewPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.9; }
}

@keyframes radarSweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes waterRipple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 100%;
    height: 100%;
    opacity: 0;
  }
}

@keyframes sparkFly {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--spark-x, 0px)), calc(-50% + var(--spark-y, 0px))) scale(0);
    opacity: 0;
  }
}

/* Ship dock */
.ship-dock {
  background: rgba(0, 31, 63, 0.7);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--teal);
}

.ships-to-place {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ship-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(57, 204, 204, 0.1);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: grab;
  transition: var(--transition);
  min-height: var(--min-touch-target);
}

.ship-item:hover,
.ship-item:focus {
  border-color: var(--teal);
  background: rgba(57, 204, 204, 0.2);
}

.ship-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.ship-item.placed {
  opacity: 0.3;
  cursor: not-allowed;
}

.ship-visual {
  height: 20px;
  border-radius: 10px;
  border: 2px solid var(--white);
}

.ship-visual.carrier {
  width: 100px;
  background: var(--vibrant-blue);
}

.ship-visual.battleship {
  width: 80px;
  background: var(--success-green);
}

.ship-visual.cruiser {
  width: 60px;
  background: var(--warning-orange);
}

.ship-visual.submarine {
  width: 60px;
  background: var(--danger-red);
}

.ship-visual.destroyer {
  width: 40px;
  background: var(--teal);
}

.setup-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Difficulty selection */
.difficulty-selection {
  background: rgba(0, 31, 63, 0.7);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 2px solid var(--teal);
  min-width: 250px;
}

.difficulty-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.difficulty-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: rgba(57, 204, 204, 0.1);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  min-height: var(--min-touch-target);
}

.difficulty-option:hover {
  border-color: var(--teal);
  background: rgba(57, 204, 204, 0.2);
}

.difficulty-option input[type="radio"] {
  margin-right: 1rem;
  transform: scale(1.2);
}

.difficulty-label {
  font-weight: 600;
  color: var(--white);
  flex: 1;
}

.difficulty-option small {
  color: var(--teal);
  font-size: 0.85rem;
}

/* Gameplay phase */
.game-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(0, 31, 63, 0.7);
  border-radius: var(--border-radius);
  border: 2px solid var(--teal);
}

.turn-indicator {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--teal);
}

.game-stats {
  display: flex;
  gap: 2rem;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.8;
}

.stat-number,
#shot-count,
#hit-count,
#accuracy {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--teal);
}

.game-boards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: start;
}

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

.board-container h3 {
  margin-bottom: 1rem;
  color: var(--white);
}

.sidebar-ad-space {
  width: 160px;
  height: 600px;
  background: rgba(57, 204, 204, 0.1);
  border: 2px dashed var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 0.8rem;
  text-align: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.sidebar-ad-space::before {
  content: "Sidebar Advertisement";
}

/* Fleet status */
.fleet-status {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ship-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: rgba(57, 204, 204, 0.1);
  border-radius: var(--border-radius);
}

.ship-name {
  font-size: 0.9rem;
  color: var(--white);
}

.ship-health {
  display: flex;
  gap: 0.2rem;
}

.health-dot {
  width: 8px;
  height: 8px;
  background: var(--success-green);
  border-radius: 50%;
  transition: var(--transition);
}

.health-dot.hit {
  background: var(--danger-red);
}

/* Targeting info */
.targeting-info {
  margin-top: 1rem;
  text-align: center;
}

.crosshair {
  width: 30px;
  height: 30px;
  border: 2px solid var(--danger-red);
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  position: relative;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: var(--danger-red);
}

.crosshair::before {
  width: 2px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.crosshair::after {
  width: 100%;
  height: 2px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.coordinate-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--teal);
}

/* SEO Content Sections */
.content-section {
  background: rgba(0, 31, 63, 0.8);
  margin: 2rem 0;
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--teal);
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
}

.content-section h2 {
  color: var(--teal);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.content-block {
  background: rgba(57, 204, 204, 0.05);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(57, 204, 204, 0.3);
}

.content-block h3 {
  color: var(--vibrant-blue);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--vibrant-blue);
  padding-bottom: 0.5rem;
}

.content-block p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: var(--light-gray);
}

.content-block ul,
.content-block ol {
  margin-left: 1.5rem;
  line-height: 1.6;
}

.content-block li {
  margin-bottom: 0.5rem;
  color: var(--light-gray);
}

.content-block strong {
  color: var(--teal);
  font-weight: 600;
}

.ship-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 116, 217, 0.1);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--vibrant-blue);
}

.rules-section {
  background: linear-gradient(135deg, rgba(0, 31, 63, 0.9) 0%, rgba(0, 116, 217, 0.8) 100%);
}

.strategy-section {
  background: linear-gradient(135deg, rgba(0, 116, 217, 0.8) 0%, rgba(57, 204, 204, 0.7) 100%);
}

@media (max-width: 768px) {
  .content-section {
    margin: 1rem 0;
    padding: 1rem;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .content-block {
    padding: 1rem;
  }
  
  .content-section h2 {
    font-size: 1.5rem;
  }
  
  .content-block h3 {
    font-size: 1.1rem;
  }
}

/* GDPR Consent Banner */
.gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--deep-ocean-navy);
  border-top: 3px solid var(--teal);
  padding: 1rem;
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.gdpr-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.gdpr-content h3 {
  color: var(--teal);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.gdpr-content p {
  color: var(--light-gray);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.gdpr-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.gdpr-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .gdpr-banner {
    padding: 0.75rem;
  }
  
  .gdpr-content h3 {
    font-size: 1rem;
  }
  
  .gdpr-content p {
    font-size: 0.9rem;
  }
  
  .gdpr-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Ad Space Optimizations */
.header-ad-space {
  display: flex;
  justify-content: center;
  min-height: 90px;
  overflow: hidden;
}

.sidebar-ad-space {
  display: flex;
  justify-content: center;
  min-height: 250px;
  min-width: 300px;
  overflow: hidden;
}

.interstitial-ad-space {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.interstitial-ad-space.show {
  display: block;
}

/* Responsive ad adjustments */
@media (max-width: 768px) {
  .header-ad-space {
    min-height: 50px;
  }
  
  .sidebar-ad-space {
    min-width: 250px;
    min-height: 200px;
  }
  
  .header-ad-space .adsbygoogle {
    width: 320px !important;
    height: 50px !important;
  }
  
  .sidebar-ad-space .adsbygoogle {
    width: 250px !important;
    height: 200px !important;
  }
}

/* Performance optimizations */
.game-board {
  will-change: transform;
  transform: translateZ(0);
}

.board-cell {
  will-change: background-color, transform;
}

/* Reduce motion for performance */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep,
  .water-ripple,
  .explosion-effect {
    animation: none !important;
  }
  
  .board-cell {
    transition: none !important;
  }
}

/* Game over phase */
.game-over-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(0, 31, 63, 0.8);
  border-radius: var(--border-radius);
  border: 2px solid var(--teal);
}

.result-title {
  font-size: 3rem;
  margin-bottom: 2rem;
  color: var(--success-green);
}

.result-title.defeat {
  color: var(--danger-red);
}

.final-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.stat-item .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--white);
  opacity: 0.8;
}

.game-over-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--deep-ocean-navy);
  margin: 1rem;
  padding: 0;
  border: 2px solid var(--teal);
  border-radius: var(--border-radius);
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px solid var(--teal);
}

.modal-header h2 {
  color: var(--teal);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--danger-red);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body h3 {
  color: var(--teal);
  margin: 1.5rem 0 1rem 0;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.5rem;
}

/* Messages */
.messages-container {
  position: fixed;
  top: 100px;
  right: 1rem;
  z-index: 100;
  max-width: 300px;
}

.game-message {
  background: var(--vibrant-blue);
  color: var(--white);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out;
}

.game-message.success {
  background: var(--success-green);
}

.game-message.error {
  background: var(--danger-red);
}

.game-message.warning {
  background: var(--warning-orange);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Interstitial ad */
.interstitial-ad-space {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 999;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 1.2rem;
}

.interstitial-ad-space.active {
  display: flex;
}

.interstitial-ad-space::before {
  content: "Interstitial Advertisement Space";
}

/* Responsive Design */
@container (max-width: 768px) {
  .setup-container {
    grid-template-columns: 1fr;
  }
  
  .game-boards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .sidebar-ad-space {
    width: 100%;
    height: 100px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
  
  .sidebar-ad-space::before {
    content: "Mobile Advertisement";
  }
}

@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }
  
  .setup-container {
    grid-template-columns: 1fr;
  }
  
  .game-boards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .sidebar-ad-space {
    width: 100%;
    height: 100px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
  
  .game-stats {
    gap: 1rem;
  }
  
  .final-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-content {
    margin: 0.5rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem 0.5rem;
  }
  
  .game-board {
    max-width: 300px;
  }
  
  .game-title {
    font-size: 1.5rem;
  }
  
  .setup-controls {
    justify-content: center;
  }
  
  .setup-controls .btn {
    flex: 1;
    min-width: 80px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .board-cell:hover {
    transform: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --deep-ocean-navy: #000000;
    --vibrant-blue: #0000FF;
    --teal: #00FFFF;
    --white: #FFFFFF;
  }
}

/* Focus indicators */
*:focus {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

button:focus,
input:focus,
[tabindex]:focus {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* Enhanced visual effects */

/* Water background effect */
.game-board.ocean-background {
  background: radial-gradient(circle at 20% 30%, rgba(57, 204, 204, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(0, 116, 217, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(57, 204, 204, 0.05) 0%, transparent 50%),
              var(--deep-ocean-navy);
  animation: oceanWaves 8s ease-in-out infinite;
}

@keyframes oceanWaves {
  0%, 100% { 
    background-position: 0% 0%, 100% 100%, 0% 100%; 
  }
  50% { 
    background-position: 100% 50%, 0% 0%, 100% 0%; 
  }
}

/* Enhanced ship visual effects */
.board-cell.ship.carrier::before { content: "🚢"; font-size: 1.1rem; }
.board-cell.ship.battleship::before { content: "⚓"; font-size: 1rem; }
.board-cell.ship.cruiser::before { content: "🛥️"; font-size: 0.9rem; }
.board-cell.ship.submarine::before { content: "🚤"; font-size: 0.9rem; }
.board-cell.ship.destroyer::before { content: "⛵"; font-size: 0.8rem; }

/* Targeting crosshair enhancement */
.crosshair.active {
  animation: crosshairPulse 1s infinite;
  border-color: var(--danger-red);
}

@keyframes crosshairPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* Ship placement dock enhancements */
.ship-item.selected {
  background: rgba(57, 204, 204, 0.3);
  border-color: var(--teal);
  box-shadow: 0 0 15px rgba(57, 204, 204, 0.5);
}

.ship-item:hover .ship-visual {
  animation: shipHover 2s ease-in-out infinite;
}

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

/* Enhanced game board effects */
.target-board .board-cell:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: var(--danger-red);
  cursor: crosshair;
}

.setup-board .board-cell:hover {
  background: rgba(57, 204, 204, 0.4);
  border-color: var(--teal);
}