/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */


 * {
  margin: 0;
  padding: 0;
}

#notice {
  text-align: center;
  color:#0052a3;
  font-weight: bold;
}

.game {
  background: linear-gradient(135deg, #1a4c6e 0%, #3a9bc2 50%, #6fe7ef 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.container {
  width: 90%;
  max-width: 1200px;
  text-align: center;
  padding: 2rem;
}

.logo {
  font-size: 4rem;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .logo {
    font-size: 3rem;
  }
}

.tagline {
  font-size: 1.5rem;
  color: #e6f7ff;
  margin-bottom: 3rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }
}

.play-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a4c6e;
  background-color: white;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.play-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  background-color: #e6f7ff;
}

.play-btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.boat-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin: 3rem 0;
  overflow: hidden;
}

.boat {
  position: absolute;
  width: 120px;
  height: 40px;
  background-color: #333;
  border-radius: 10px 30px 5px 5px;
  animation: float 8s infinite ease-in-out;
}

.boat::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 30px;
  width: 15px;
  height: 25px;
  background-color: #555;
  border-radius: 5px;
}

.boat::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 60px;
  width: 10px;
  height: 20px;
  background-color: #555;
  border-radius: 5px;
}

.boat-1 {
  left: 10%;
  top: 60%;
  animation-delay: 0s;
}

.boat-2 {
  right: 15%;
  top: 30%;
  transform: rotate(5deg);
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

.sea {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  filter: blur(5px);
}

@media (max-width: 576px) {
  .boat-container {
    height: 120px;
    margin: 2rem 0;
  }

  .boat {
    width: 80px;
    height: 25px;
  }

  .boat::before {
    top: -10px;
    left: 20px;
    width: 10px;
    height: 15px;
  }

  .boat::after {
    top: -8px;
    left: 40px;
    width: 8px;
    height: 12px;
  }
}



/* Battleship Game - Scoped CSS */
.battleship-container {
  font-family: Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px;
}

.battleship-title {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 20px;
}

.battleship-info {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.battleship-setup {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.battleship-form {
  max-width: 400px;
  margin: 0 auto;
}

.battleship-form-field {
  margin-bottom: 15px;
}

.battleship-form-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.battleship-form-field input,
.battleship-form-field select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.battleship-form-actions {
  margin-top: 20px;
  text-align: center;
}

.battleship-button {
  background-color: #3498db;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
}

.battleship-button:hover {
  background-color: #2980b9;
}

.battleship-navigation {
  margin-top: 20px;
  text-align: center;
}

/* Game board styling */
.battleship-game-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.battleship-board-container {
  text-align: center;
  flex: 1;
  min-width: 300px;
}

.battleship-board-container h3 {
  margin-bottom: 10px;
}

.battleship-board {
  display: inline-block;
  width: 100%;
  max-width: 450px;
  border: 2px solid #2c3e50;
  background-color: #edf2f7;
}

.battleship-row {
  display: flex;
  width: 100%;
}

.battleship-cell {
  width: calc(10% - 2px);
  aspect-ratio: 1/1;
  border: 1px solid #2c3e50;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  font-size: 0.8rem;
}

/* Cell states */
.battleship-cell.water {
  background-color: #b3e0ff;
}

.battleship-cell.ship {
  background-color: #808080;
}

.battleship-cell.miss,
.battleship-cell.hit {
  text-indent: -9999px;
}

.battleship-cell.miss {
  background-color: #ffffff;
}

.battleship-cell.miss::after {
  content: " ";
  color: black;
  position: absolute;
}

.battleship-cell.hit {
  background-color: #ff6666;
}

.battleship-cell.hit::after {
  content: "X";
  color: black;
  font-size: 1.5em;
  text-indent: 0;
  position: absolute;
}

.battleship-cell > a {
  text-decoration: none;
  font-size: 1em;
  color: #b3e0ff;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.battleship-cell > a:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Media queries for responsive design */
@media (max-width: 992px) {
  .battleship-game-container {
    flex-direction: column;
    align-items: center;
  }

  .battleship-board-container {
    width: 100%;
    max-width: 500px;
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .battleship-board {
    max-width: 100%;
  }

  .battleship-cell {
    font-size: 0.7rem;
  }

  .battleship-cell.hit::after {
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .battleship-cell {
    font-size: 0.6rem;
  }

  .battleship-cell.hit::after {
    font-size: 1em;
  }

  .battleship-form-field {
    margin-bottom: 10px;
  }

  .battleship-button {
    padding: 8px 12px;
    font-size: 14px;
  }
}




/* Battleship Games specific styles */
.battleship-games-container {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.battleship-games-container h1 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

/* Table styles */
.battleship-games-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.battleship-games-container th,
.battleship-games-container td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.battleship-games-container th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.battleship-games-container tbody tr:hover {
  background-color: #f5f5f5;
}

/* Links styling */
.battleship-games-container a {
  color: #0066cc;
  text-decoration: none;
}

.battleship-games-container a:hover {
  text-decoration: underline;
}

/* Make "New Game" link a button */
.battleship-games-container .new-game-btn {
  display: inline-block;
  background-color: #28a745;
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  text-decoration: none;
}

.battleship-games-container .new-game-btn:hover {
  background-color: #218838;
  text-decoration: none;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  /* Adjust table for tablets */
  .battleship-games-container th,
  .battleship-games-container td {
    padding: 8px;
  }
}

@media screen and (max-width: 600px) {
  /* Convert table to cards for mobile */
  .battleship-games-container table,
  .battleship-games-container thead,
  .battleship-games-container tbody,
  .battleship-games-container th,
  .battleship-games-container td,
  .battleship-games-container tr {
    display: block;
  }

  /* Hide table headers */
  .battleship-games-container thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .battleship-games-container tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
  }

  .battleship-games-container td {
    /* Behave like a "row" */
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
  }

  .battleship-games-container td:before {
    /* Add labels for mobile view */
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
  }

  /* Add labels for each cell */
  .battleship-games-container td:nth-of-type(1):before { content: "Game ID:"; }
  .battleship-games-container td:nth-of-type(2):before { content: "Status:"; }
  .battleship-games-container td:nth-of-type(3):before { content: "Current Player:"; }
  .battleship-games-container td:nth-of-type(4):before { content: "Winner:"; }
  .battleship-games-container td:nth-of-type(5):before { content: "Actions:"; }

  /* Make links more tappable on mobile */
  .battleship-games-container a {
    padding: 8px 0;
    display: inline-block;
  }

  /* Center the new game button */
  .battleship-games-container .new-game-btn {
    display: block;
    text-align: center;
    margin-top: 20px;
  }
}

/* New Battleship Game specific styles */
.new-battleship-game-container {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.new-battleship-game-container h1 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  font-size: 28px;
}

/* Game rules styles */
.game-rules {
  background-color: #e7f3ff;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 25px;
  border-left: 4px solid #0066cc;
}

.game-rules h2 {
  color: #0066cc;
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 10px;
}

.game-rules ul {
  margin: 0;
  padding-left: 20px;
}

.game-rules li {
  margin-bottom: 8px;
}

.game-rules li:last-child {
  margin-bottom: 0;
}

/* Form styles */
.new-battleship-game-container form {
  margin-bottom: 20px;
}

/* Error styles */
.new-battleship-game-container #error_explanation {
  background-color: #ffebee;
  color: #c62828;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #c62828;
}

.new-battleship-game-container #error_explanation h2 {
  color: #c62828;
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 10px;
}

.new-battleship-game-container #error_explanation ul {
  margin: 0;
  padding-left: 20px;
}

/* Button styles */
.new-battleship-game-container .actions {
  margin: 20px 0;
}

.new-battleship-game-container input[type="submit"] {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  transition: background-color 0.3s;
}

.new-battleship-game-container input[type="submit"]:hover {
  background-color: #218838;
}

/* Back link */
.new-battleship-game-container .back-link {
  display: inline-block;
  color: #0066cc;
  text-decoration: none;
  margin-top: 10px;
  font-size: 16px;
}

.new-battleship-game-container .back-link:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
  .new-battleship-game-container {
    padding: 15px;
    box-shadow: none;
    border-radius: 0;
  }

  .new-battleship-game-container h1 {
    font-size: 24px;
  }

  .game-rules {
    padding: 12px;
  }

  .game-rules h2 {
    font-size: 18px;
  }

  .game-rules li {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .new-battleship-game-container input[type="submit"] {
    padding: 10px 20px;
    font-size: 14px;
  }

  .new-battleship-game-container #error_explanation {
    padding: 10px;
  }

  .new-battleship-game-container #error_explanation h2 {
    font-size: 16px;
  }

  /* Make the back link more tappable on mobile */
  .new-battleship-game-container .back-link {
    display: block;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 20px;
  }
}

/* Battleship Game Show Page specific styles */
.battleship-game-show-container {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.battleship-game-show-container h1 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  font-size: 28px;
}

.battleship-game-show-container h2 {
  color: #444;
  margin: 25px 0 15px;
  font-size: 22px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

/* Game info styles */
.battleship-game-show-container .game-info {
  background-color: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.battleship-game-show-container .game-info p {
  margin: 10px 0;
}

.battleship-game-show-container .game-info strong {
  color: #555;
  min-width: 130px;
  display: inline-block;
}

/* Notice styling */
.battleship-game-show-container #notice {
  background-color: #d4edda;
  color: #155724;
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  border-left: 4px solid #28a745;
}

/* Ship placement form */
.battleship-game-show-container .place-ship-form {
  background-color: #fff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

.battleship-game-show-container .field {
  margin-bottom: 15px;
}

.battleship-game-show-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.battleship-game-show-container input[type="number"],
.battleship-game-show-container select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.battleship-game-show-container .actions {
  margin-top: 20px;
}

.battleship-game-show-container input[type="submit"] {
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.battleship-game-show-container input[type="submit"]:hover {
  background-color: #0052a3;
}

/* Status message */
.battleship-game-show-container .status-message {
  background-color: #e8f4fd;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  font-style: italic;
  color: #0066cc;
  text-align: center;
}

/* Back link */
.battleship-game-show-container .back-link {
  display: inline-block;
  color: #0066cc;
  text-decoration: none;
  margin-top: 20px;
  font-size: 16px;
}

.battleship-game-show-container .back-link:hover {
  text-decoration: underline;
}

/* Winner highlight */
.battleship-game-show-container .winner-info {
  background-color: #fff8e1;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #ffc107;
  margin: 15px 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .battleship-game-show-container {
    padding: 15px;
  }

  .battleship-game-show-container h1 {
    font-size: 24px;
  }

  .battleship-game-show-container h2 {
    font-size: 20px;
  }
}

@media screen and (max-width: 600px) {
  .battleship-game-show-container {
    padding: 10px;
    box-shadow: none;
    border-radius: 0;
  }

  .battleship-game-show-container .game-info {
    padding: 10px;
  }

  .battleship-game-show-container .game-info strong {
    display: block;
    margin-bottom: 3px;
  }

  .battleship-game-show-container .place-ship-form {
    padding: 15px;
  }

  /* Convert ship placement form to a cleaner mobile layout */
  .battleship-game-show-container .field {
    margin-bottom: 12px;
  }

  /* Make the back link more tappable on mobile */
  .battleship-game-show-container .back-link {
    display: block;
    text-align: center;
    padding: 12px;
    background-color: #f2f2f2;
    border-radius: 4px;
    margin-top: 20px;
  }
}
