:root {
  --bs-water: #1A3A5C;
  --bs-water-hit: #0F2842;
  --bs-ship: #4A4A5A;
  --bs-hit-p1: #FF4D4D;
  --bs-hit-p2: #4D79FF;
  --bs-miss-p1: #FF9E6D;
  --bs-miss-p2: #6DC1FF;
  --bs-board-bg: #0D1B2A;
  --bs-cell-border: rgba(255, 255, 255, 0.12);
}

.battleship-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100vh;
}

.battleship-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.battleship-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 1px;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 214, 0, 0.4);
}

.battleship-status {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.battleship-player-badge {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.battleship-player-badge.active-p1 {
  border-color: var(--bs-hit-p1);
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.35);
}

.battleship-player-badge.active-p2 {
  border-color: var(--bs-hit-p2);
  box-shadow: 0 0 12px rgba(77, 121, 255, 0.35);
}

.battleship-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: var(--text);
}

.battleship-score-sep {
  color: rgba(240, 240, 255, 0.3);
  margin: 0 0.4rem;
  font-weight: 400;
}

.battleship-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .battleship-main {
    grid-template-columns: auto minmax(320px, 420px);
    gap: 2rem;
    align-items: start;
    justify-content: center;
  }
}

.battleship-board-wrap {
  background: var(--bs-board-bg);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--bs-cell-border);
}

.battleship-coords-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(240, 240, 255, 0.6);
  padding: 0 0 0.4rem 1.6rem;
}

.battleship-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
}

.battleship-cell {
  background: var(--bs-water);
  border: 1px solid var(--bs-cell-border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.1s ease, background 0.2s ease;
  aspect-ratio: 1;
  padding: 0;
  color: var(--text);
}

.battleship-cell:hover:not(:disabled) {
  transform: scale(1.08);
  background: #255079;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.battleship-cell:disabled {
  cursor: default;
}

.battleship-cell.miss-p1 {
  background: var(--bs-miss-p1);
  color: #2a1a10;
}

.battleship-cell.miss-p2 {
  background: var(--bs-miss-p2);
  color: #0f1f2e;
}

.battleship-cell.hit-p1 {
  background: var(--bs-hit-p1);
  color: #fff;
  animation: bs-hit-pulse 0.4s ease-out;
}

.battleship-cell.hit-p2 {
  background: var(--bs-hit-p2);
  color: #fff;
  animation: bs-hit-pulse 0.4s ease-out;
}

.battleship-cell.sunk {
  background: var(--bs-ship);
  color: rgba(240, 240, 255, 0.7);
}

@keyframes bs-hit-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.battleship-side-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.battleship-question-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  border: 1px solid var(--bs-cell-border);
  min-height: 220px;
}

.battleship-question-card .eq-type-badge {
  display: inline-block;
  background: var(--yellow);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.8rem;
}

.battleship-question-text {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.battleship-hint {
  font-size: 0.9rem;
  color: rgba(240, 240, 255, 0.75);
  margin-bottom: 1rem;
  min-height: 1.4rem;
}

.battleship-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.battleship-answer-btn {
  background: var(--dark3);
  border: 2px solid var(--bs-cell-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.5rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.battleship-answer-btn:hover:not(:disabled) {
  border-color: var(--electric-blue);
  background: #252538;
}

.battleship-answer-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.battleship-answer-btn.correct {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
}

.battleship-answer-btn.wrong {
  background: rgba(255, 45, 120, 0.2);
  border-color: var(--hot-pink);
}

.battleship-message {
  min-height: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.battleship-ships-left {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--bs-cell-border);
}

.battleship-ships-left h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: rgba(240, 240, 255, 0.85);
}

.battleship-ship-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bs-cell-border);
  font-size: 0.95rem;
}

.battleship-ship-row.sunk {
  opacity: 0.45;
  text-decoration: line-through;
}

.battleship-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.battleship-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.battleship-legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--bs-cell-border);
}

.battleship-turn-indicator {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.battleship-turn-indicator.p1 {
  border: 2px solid var(--bs-hit-p1);
  color: var(--bs-hit-p1);
}

.battleship-turn-indicator.p2 {
  border: 2px solid var(--bs-hit-p2);
  color: var(--bs-hit-p2);
}

/* ============================================================
   TABLETS AND SMALL LAPTOPS
   ============================================================ */
@media (min-width: 1200px) {
  .battleship-container {
    max-width: 95vw;
    padding: 1.5rem 2rem;
  }

  .battleship-main {
    gap: 2.5rem;
  }

  .battleship-board {
    max-width: min(580px, 58vh);
  }

  .battleship-board-wrap {
    padding: 1.2rem;
  }
}

/* ============================================================
   FULL HD PROJECTION (1920×1080) — PRIMARY TARGET
   ============================================================ */
@media (min-width: 1600px) {
  .battleship-container {
    max-width: 96vw;
    padding: 1.2rem 2.5rem;
    gap: 0.9rem;
  }

  .battleship-top-bar {
    gap: 1.5rem;
  }

  .battleship-title {
    font-size: 2.8rem;
  }

  .battleship-status {
    gap: 1.5rem;
  }

  .battleship-player-badge {
    padding: 0.85rem 1.4rem;
    font-size: 1.15rem;
    gap: 0.6rem;
  }

  .battleship-score {
    font-size: 1.8rem;
  }

  .battleship-turn-indicator {
    font-size: 1.4rem;
    padding: 0.9rem 1.2rem;
  }

  .battleship-main {
    grid-template-columns: auto minmax(360px, 450px);
    gap: 3rem;
    align-items: center;
    justify-content: center;
  }

  .battleship-board-wrap {
    padding: 1.4rem;
  }

  .battleship-board {
    max-width: min(680px, 62vh);
    gap: 6px;
  }

  .battleship-cell {
    font-size: 1.5rem;
    border-radius: 8px;
    border-width: 2px;
  }

  .battleship-coords-label {
    font-size: 1rem;
    padding: 0 0 0.5rem 1.8rem;
  }

  .battleship-question-card {
    padding: 1.5rem;
    min-height: auto;
  }

  .battleship-question-card .eq-type-badge {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }

  .battleship-question-text {
    font-size: 1.4rem;
  }

  .battleship-hint {
    font-size: 1.05rem;
  }

  .battleship-answers {
    gap: 0.9rem;
  }

  .battleship-answer-btn {
    font-size: 1.25rem;
    padding: 1rem 0.5rem;
  }

  .battleship-message {
    font-size: 1.15rem;
  }

  .battleship-ships-left {
    padding: 1.2rem;
  }

  .battleship-ships-left h3 {
    font-size: 1.15rem;
  }

  .battleship-ship-row {
    font-size: 1.1rem;
    padding: 0.5rem 0;
  }

  .battleship-legend {
    font-size: 1rem;
    gap: 1rem;
  }

  .battleship-legend-dot {
    width: 18px;
    height: 18px;
  }
}

/* ============================================================
   4K SCREENS (3840×2160)
   ============================================================ */
@media (min-width: 2560px) {
  .battleship-board {
    max-width: min(780px, 58vh);
  }

  .battleship-title {
    font-size: 3.2rem;
  }

  .battleship-turn-indicator {
    font-size: 1.6rem;
  }

  .battleship-question-text {
    font-size: 1.6rem;
  }

  .battleship-answer-btn {
    font-size: 1.4rem;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 600px) {
  .battleship-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .battleship-board {
    max-width: 100%;
    gap: 2px;
  }

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

  .battleship-title {
    font-size: 1.6rem;
  }

  .battleship-answers {
    grid-template-columns: 1fr;
  }

  .battleship-question-card {
    padding: 1rem;
  }

  .battleship-question-text {
    font-size: 1rem;
  }

  .battleship-ship-row {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .battleship-cell,
  .battleship-answer-btn {
    transition: none;
  }

  .battleship-cell.hit-p1,
  .battleship-cell.hit-p2 {
    animation: none;
  }
}
