* {
  -webkit-tap-highlight-color: transparent;
}


body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #2e2e2e;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto; 
}

.container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  text-align: center;
  width: fit-content;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 70px);
  grid-template-rows: repeat(5, 70px);
  gap: 8px;
  padding: 15px;
  backdrop-filter: blur(4px);
  margin: 0 auto;
}

.cell {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.circle {
  width: 75%;
  height: 75%;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.blue {
  background: linear-gradient(145deg, #027495, #01a9c1);
  box-shadow: 0 2px 8px rgba(1, 169, 193, 0.3);
}

.red {
  background: linear-gradient(145deg, #e63946, #ff4d6d);
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.wall {
  position: relative;
  background: #43ad46;
  transform: scale(0.95);
}


.wall::before {
  transform: rotate(45deg);
}

.wall::after {
  transform: rotate(-45deg);
}

.highlight {
  background-color: #e0e0e0;
}

.error-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(220, 53, 69, 0.9);
  color: white;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1.1rem;
  text-align: center;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.error-message.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.container-fish {
  top: 0;
  left: 0; 
  z-index: -1;
}

h1 {
  color: #fff;
  font-family: 'Arial', sans-serif;
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

.status {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.phase-indicator {
  color: #fff;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 2rem;
  border-radius: 25px;
  margin-bottom: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.1);
  /* Add these properties */
  min-height: 1.5rem;
  height: auto;
  max-height: 4rem; 
  width: 100%;
  max-width: 400px;
  white-space: normal;
  overflow: hidden;
}

.winner-message {
  background: #1a1a1aea;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.winner-text {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  display: block;
}

.restart-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.restart-btn:hover {
  background: #4CAF50;
  transform: scale(1.05);
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 480px) {
  .container {
    transform: translate(-50%, -10%) scale(0.65);
    padding: 1rem; 
    padding-top: 0;
  }
}


.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.grid-size-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1aea;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 1000;
  width: min(90%, 500px); 
  box-sizing: border-box; 
  margin: auto; 
}

@media screen and (max-width: 480px) {
  .grid-size-dialog {
    width: min(95%, 500px); 
    padding: 1.5rem;
  }
  .back-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    top: 10px;
    left: 10px;
}
}

.grid-size-dialog h2 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  width: 100%; 
  padding: 0;
}

.size-options button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.size-options button:hover {
  background: #5dd361;
  transform: scale(1.05);
}