
:root {
  --navy-dark: #001f3f;
  --navy-light: #003366;
  --ocean-blue: #4682b4;
  --wave-blue: #00bfff;
  --fire-orange: #ff4500;
  --gold-glow: #ffd700;
  --shadow-color: rgba(0, 0, 0, 0.6);
  --glow-color: rgba(255, 255, 255, 0.4);
  --transition-time: 0.3s; 
}

body {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(135deg, #001f3f 0%, #004080 25%, #00b7eb 50%, #004080 75%, #001f3f 100%) fixed;
  background-size: 150% 150%; 
  animation: gradient-shift 10s ease-in-out infinite; 
  color: #fff;
  margin: 0;
  padding: 0;
  text-align: center;
  position: relative;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.7); 
  z-index: -1;
}


#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}


.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  z-index: 1;
  padding: 10px; 
  animation: fade-in 1s ease-out;
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(50px); }
  100% { opacity: 1; transform: translateY(0); }
}

.title {
  font-size: 3.5rem; 
  color: var(--gold-glow);
  text-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--gold-glow), 0 0 60px var(--fire-orange); 
  animation: glow-pulse 1.5s infinite alternate, float-wave 3s infinite ease-in-out; 
  margin-bottom: 30px;
  letter-spacing: 1.5px;
}

@keyframes glow-pulse {
  0% { text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--gold-glow); }
  100% { text-shadow: 0 0 30px var(--glow-color), 0 0 50px var(--gold-glow), 0 0 70px var(--fire-orange); }
}

@keyframes float-wave {
  0% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-20px) rotate(2deg); } 
  100% { transform: translateY(0) rotate(0); }
}


.button-group {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}


.modern-button {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem; 
  padding: 10px 30px;
  background: linear-gradient(45deg, var(--navy-dark), var(--navy-light));
  border: none;
  border-radius: 50px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 5px 20px var(--shadow-color), inset 0 0 10px var(--glow-color); 
  transition: transform var(--transition-time), box-shadow var(--transition-time), filter var(--transition-time);
  position: relative;
  overflow: hidden;
  animation: button-pulse 2s infinite;
}

@keyframes button-pulse {
  0% { transform: scale(1); box-shadow: 0 5px 20px var(--shadow-color); }
  50% { transform: scale(1.1); box-shadow: 0 10px 25px var(--shadow-color), 0 0 20px var(--glow-color); }
  100% { transform: scale(1); box-shadow: 0 5px 20px var(--shadow-color); }
}

.modern-button:hover {
  transform: perspective(500px) rotateX(10deg) scale(1.15);
  filter: brightness(1.5);
  box-shadow: 0 10px 30px var(--shadow-color), 0 0 25px var(--wave-blue);
}

.modern-button:active {
  transform: scale(0.9);
}

.modern-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.6), transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modern-button:active::before {
  width: 300px;
  height: 300px;
}


.board {
  display: grid;
  grid-template-columns: repeat(10, 40px); 
  grid-template-rows: repeat(10, 40px);
  gap: 3px;
  margin: 20px auto;
  background: rgba(0, 31, 63, 0.7);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 20px var(--shadow-color);
  width: max-content;
}

.modern-board {
  display: grid;
  grid-template-columns: repeat(10, 30px);
  grid-template-rows: repeat(10, 30px);
  gap: 2px;
  margin: 15px auto;
  background: linear-gradient(135deg, var(--navy-dark), var(--ocean-blue));
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 5px 15px var(--shadow-color);
  width: max-content;
  animation: board-pulse 2s infinite alternate;
}

@keyframes board-pulse {
  0% { box-shadow: 0 5px 15px var(--shadow-color), inset 0 0 5px var(--glow-color); }
  100% { box-shadow: 0 10px 20px rgba(0, 191, 255, 0.5), inset 0 0 10px var(--wave-blue); }
}

.modern-board .cell {
  background: linear-gradient(to bottom, #87ceeb, var(--ocean-blue));
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modern-board .cell:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 0 10px var(--glow-color), inset 0 0 8px var(--wave-blue);
  background: linear-gradient(to bottom, var(--wave-blue), #00ffff);
}

.modern-board .cell.ship-placed {
  background: linear-gradient(to bottom, var(--gold-glow), #ffcc00);
  animation: ship-place 0.4s ease-out;
}

@keyframes ship-place {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ship-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.ship-btn:disabled {
  background: linear-gradient(45deg, gray, #666);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  animation: none;
}

.board .cell {
  background: linear-gradient(to bottom, var(--ocean-blue), #87ceeb);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: transform var(--transition-time), background var(--transition-time);
}

.board .cell:hover {
  transform: scale(1.1);
  background: linear-gradient(to bottom, #87ceeb, var(--wave-blue));
}

.hit {
  background: linear-gradient(to bottom, var(--fire-orange), #8b0000);
  animation: explosion-advanced 0.5s forwards;
}

@keyframes explosion-advanced {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); box-shadow: 0 0 15px var(--gold-glow); }
  100% { transform: scale(1); }
}

.miss {
  background: linear-gradient(to bottom, var(--wave-blue), #00ffff);
  animation: ripple-advanced 0.8s forwards;
}

@keyframes ripple-advanced {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.sunk {
  background: linear-gradient(to bottom, #8b0000, #000);
  animation: sink-advanced 1s forwards;
}

@keyframes sink-advanced {
  0% { transform: translateY(0); }
  100% { transform: translateY(20px); opacity: 0; }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#turn-message {
  font-size: 20px;
  margin: 15px;
  display: none;
  text-shadow: 0 0 5px var(--glow-color);
}





#scoreboard-1 {
  background: linear-gradient(45deg, var(--navy-dark), var(--navy-light));
  padding: 15px;
  margin: 15px;
  width: 250px;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow-color), inset 0 0 8px var(--glow-color);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  text-align: left;
  animation: scoreboard-pulse 2s infinite alternate;
   margin-top:120px;
   height:260px;
  }

@keyframes scoreboard-pulse {
  0% { box-shadow: 0 5px 15px var(--shadow-color), inset 0 0 8px var(--glow-color); }
  100% { box-shadow: 0 8px 20px var(--shadow-color), inset 0 0 12px var(--wave-blue); }
}

#scoreboard-1 p {
  font-size: 1rem;
  margin: 8px 0;
  text-shadow: 0 0 5px var(--glow-color);
  transition: transform var(--transition-time), color var(--transition-time);
}

#scoreboard-1 p:hover {
  transform: scale(1.05);
  color: var(--gold-glow);
 
}

#current-turn, #hits, #ships-remaining {
  font-weight: 700;
  color: var(--gold-glow);
  text-shadow: 0 0 8px var(--glow-color), 0 0 12px var(--fire-orange);
  animation: value-glow 1.5s infinite alternate;
}

@keyframes value-glow {
  0% { text-shadow: 0 0 8px var(--glow-color), 0 0 12px var(--fire-orange); }
  100% { text-shadow: 0 0 12px var(--glow-color), 0 0 18px var(--fire-orange); }
}

.card-new {
  background: rgba(0, 31, 63, 0.7);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 5px 20px var(--shadow-color);
  margin-top: 0.5rem;
  gap:20px;
}

.d-flex.flex-row.justify-content-center {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}

@media (max-width: 600px) {
  .title { font-size: 2.5rem; }
  .modern-button { padding: 8px 20px; font-size: 0.9rem; }
  .board { grid-template-columns: repeat(10, 30px); grid-template-rows: repeat(10, 30px); }
  .board .cell { font-size: 16px; }
  .modern-board { grid-template-columns: repeat(10, 25px); grid-template-rows: repeat(10, 25px); }
  #scoreboard-1 {
    width: 200px;
    padding: 10px;
  }
  #scoreboard-1 p {
    font-size: 0.9rem;
  }
  .card-new {
    padding: 8px;
    margin-top: 0.25rem;
  }
  .d-flex.flex-row.justify-content-center {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .rules-content { font-size: 1rem; max-width: 100%; padding: 0 10px; }
  .rules-content h2 { font-size: 1.2rem; }
  .card-new-1{ padding: 15px; }
  
}

.rules-content {
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 0 5px var(--glow-color);
  margin: 20px 0;
  line-height: 1.6;
  max-width: 600px;
  text-align: left;
  padding: 0 20px;
}

.rules-content h2 {
  font-size: 1.5rem;
  color: var(--gold-glow);
  text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--fire-orange);
  margin-top: 15px;
  margin-bottom: 10px;
  animation: text-pulse 2s infinite alternate;
}

.rules-content p {
  margin: 10px 0;
  transition: transform var(--transition-time), color var(--transition-time);
}

.rules-content p:hover {
  transform: scale(1.02);
  color: var(--gold-glow);
}

.rules-content ul {
  list-style-type: none;
  padding-left: 20px;
}

.rules-content ul li {
  position: relative;
  margin: 5px 0;
}

.rules-content ul li::before {
  content: "•";
  color: var(--wave-blue);
  font-weight: bold;
  position: absolute;
  left: -15px;
  animation: bullet-glow 1.5s infinite alternate;
}

@keyframes bullet-glow {
  0% { color: var(--wave-blue); }
  100% { color: var(--gold-glow); text-shadow: 0 0 10px var(--glow-color); }
}

.card-new-1 {
  background: rgba(0, 31, 63, 0.7);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px var(--shadow-color), inset 0 0 15px var(--glow-color);
  margin-top: 1rem;
  text-align: center;
}


