/* ==========================================================================
   LUCIMAR.SPACE - Games Stage & Canvas Styling
   ========================================================================== */

.game-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  user-select: none;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan-glow);
}

.game-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 520px;
  background: #04060d;
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

/* Game Overlay (Start / Game Over / Paused) */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 18, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 20;
  padding: 2rem;
  text-align: center;
}

.game-overlay-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-overlay-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
}

.game-overlay-stats {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-game-action {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--neon-cyan), #38bdf8);
  color: #070913;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 25px var(--neon-cyan-glow);
  transition: var(--transition-smooth);
}

.btn-game-action:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px var(--neon-cyan);
}

/* On-Screen Touch D-Pad for Mobile */
.touch-controls {
  display: none;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 8px;
  margin-top: 1rem;
}

@media (pointer: coarse), (max-width: 820px) {
  .touch-controls {
    display: grid;
  }
}

.touch-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glow);
  color: var(--neon-cyan);
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
  background: var(--neon-cyan);
  color: #070913;
}

.touch-btn.btn-up { grid-column: 2; grid-row: 1; }
.touch-btn.btn-left { grid-column: 1; grid-row: 2; }
.touch-btn.btn-action { grid-column: 2; grid-row: 2; background: rgba(168, 85, 247, 0.3); color: #c084fc; }
.touch-btn.btn-right { grid-column: 3; grid-row: 2; }
.touch-btn.btn-down { grid-column: 2; grid-row: 3; }

/* 2048 Game Board Styling */
.q2048-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.q2048-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 10px;
  background: rgba(15, 23, 42, 0.8);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  width: 360px;
  max-width: calc(100vw - 48px);
  aspect-ratio: 1 / 1;
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.15);
}

.q2048-cell {
  background: rgba(30, 41, 59, 0.5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  transition: all 0.12s ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.q2048-tile-2 { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.q2048-tile-4 { background: rgba(56, 189, 248, 0.3); color: #7dd3fc; }
.q2048-tile-8 { background: rgba(168, 85, 247, 0.35); color: #d8b4fe; box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); }
.q2048-tile-16 { background: rgba(168, 85, 247, 0.6); color: #ffffff; box-shadow: 0 0 15px rgba(168, 85, 247, 0.5); }
.q2048-tile-32 { background: rgba(236, 72, 153, 0.5); color: #ffffff; box-shadow: 0 0 15px rgba(236, 72, 153, 0.5); }
.q2048-tile-64 { background: rgba(236, 72, 153, 0.8); color: #ffffff; box-shadow: 0 0 20px rgba(236, 72, 153, 0.7); }
.q2048-tile-128 { background: rgba(245, 158, 11, 0.7); color: #ffffff; font-size: 1.4rem; box-shadow: 0 0 20px rgba(245, 158, 11, 0.7); }
.q2048-tile-256 { background: rgba(245, 158, 11, 0.9); color: #ffffff; font-size: 1.4rem; box-shadow: 0 0 25px rgba(245, 158, 11, 0.9); }
.q2048-tile-512 { background: rgba(16, 185, 129, 0.8); color: #ffffff; font-size: 1.3rem; box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
.q2048-tile-1024 { background: rgba(0, 245, 255, 0.8); color: #070913; font-size: 1.1rem; box-shadow: 0 0 30px var(--neon-cyan); }
.q2048-tile-2048 { background: linear-gradient(135deg, #00f5ff, #ec4899); color: #fff; font-size: 1.1rem; box-shadow: 0 0 40px #ec4899; }

/* Minesweeper (Astro Sweep) Styling */
.mines-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mines-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mines-grid {
  display: grid;
  gap: 4px;
  background: rgba(15, 23, 42, 0.9);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.1);
}

.mines-cell {
  width: 36px;
  height: 36px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s;
}

.mines-cell:hover:not(.revealed) {
  background: rgba(56, 189, 248, 0.3);
  border-color: var(--neon-cyan);
}

.mines-cell.revealed {
  background: rgba(10, 15, 28, 0.9);
  border-color: rgba(255, 255, 255, 0.04);
  cursor: default;
}

.mines-cell.mine {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.mines-cell.flagged {
  color: #f59e0b;
}

.c-1 { color: #38bdf8; }
.c-2 { color: #34d399; }
.c-3 { color: #f87171; }
.c-4 { color: #c084fc; }
.c-5 { color: #f59e0b; }
.c-6 { color: #22d3ee; }
.c-7 { color: #f43f5e; }
.c-8 { color: #fbbf24; }

/* Quantum Tic-Tac-Toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 25px rgba(0, 245, 255, 0.15);
  width: 320px;
  max-width: calc(100vw - 48px);
  aspect-ratio: 1 / 1;
  height: auto;
}

.ttt-cell {
  background: rgba(30, 41, 59, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.ttt-cell:hover:not(.occupied) {
  background: rgba(0, 245, 255, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.ttt-cell.occupied.x {
  color: var(--neon-cyan);
  text-shadow: 0 0 15px var(--neon-cyan-glow);
  cursor: default;
}

.ttt-cell.occupied.o {
  color: var(--neon-pink);
  text-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
  cursor: default;
}

.ttt-cell.winning-cell {
  background: rgba(0, 245, 255, 0.25);
  border-color: #fff;
  animation: winPulse 1s infinite alternate;
}

@keyframes winPulse {
  from { transform: scale(0.98); box-shadow: 0 0 15px var(--neon-cyan); }
  to { transform: scale(1.04); box-shadow: 0 0 25px #fff; }
}

/* 15 Board Puzzle */
.b15-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-violet);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.2);
  width: 340px;
  max-width: calc(100vw - 48px);
  aspect-ratio: 1 / 1;
  height: auto;
}

.b15-tile {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.b15-tile:hover:not(.empty) {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(0, 245, 255, 0.2));
  border-color: var(--neon-cyan);
  transform: scale(1.03);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.b15-tile.empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  cursor: default;
  box-shadow: none;
}

/* ==========================================================================
   Cyber Maze Styling & Countdown Timer
   ========================================================================== */
.maze-stage-container {
  max-width: 580px;
}

.maze-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.maze-timer-stat {
  min-width: 140px;
}

.maze-timer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

#maze-timer-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan-glow);
  letter-spacing: 0.05em;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

#maze-timer-val.warn {
  color: #fbbf24;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
}

#maze-timer-val.danger {
  color: #f43f5e;
  text-shadow: 0 0 18px rgba(244, 63, 94, 0.8);
  animation: timerDangerPulse 0.6s infinite alternate;
}

@keyframes timerDangerPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  100% {
    transform: scale(1.08);
    filter: brightness(1.3);
  }
}

.maze-timer-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.maze-timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: width 0.1s linear, background 0.4s ease;
}

.maze-timer-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}

.maze-timer-bar-fill.danger {
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.9);
}

.maze-canvas-wrapper {
  aspect-ratio: 1 / 1;
  max-height: 560px;
  border-color: var(--border-glow);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 50px rgba(0, 0, 0, 0.9);
}

.maze-touch-controls {
  margin-top: 1.25rem;
}

#maze-touch-center {
  background: rgba(56, 189, 248, 0.2);
  color: var(--neon-cyan);
  font-size: 1.4rem;
}

@media (max-width: 600px) {
  .maze-stage-container {
    max-width: 100%;
  }

  .hud-stat-optional {
    display: none;
  }

  .maze-hud {
    padding: 0.5rem 0.75rem;
  }

  #maze-timer-val {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   CAMPO MINADO (Deluxe Classic Minesweeper)
   ========================================================================== */
.cm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 720px;
  gap: 0.75rem;
}

.cm-preset-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cm-preset-btn {
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cm-preset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cm-preset-btn.active {
  background: linear-gradient(135deg, var(--neon-cyan), #38bdf8);
  color: #070913;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.cm-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0.6rem 1.25rem;
}

.cm-led-display {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  background: #070a14;
  color: #ef4444;
  border: 2px inset rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  user-select: none;
}

.cm-face-btn {
  font-size: 1.8rem;
  background: #facc15;
  border: 3px outset #fef08a;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.4);
  line-height: 1;
}

.cm-face-btn:active {
  border-style: inset;
  transform: scale(0.92);
}

.cm-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
  padding: 0.2rem 0.5rem;
  flex-wrap: wrap;
}

.cm-flag-toggle {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cm-flag-toggle.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  font-weight: 700;
}

.cm-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.cm-board-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  background: #090e1f;
  border: 2px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: center;
}

.cm-grid {
  display: grid;
  gap: 2px;
  user-select: none;
}

.cm-cell {
  background: rgba(30, 41, 59, 0.9);
  border: 2px outset rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.cm-cell:hover:not(.revealed) {
  background: rgba(51, 65, 85, 0.95);
}

.cm-cell:active:not(.revealed) {
  border-style: inset;
  background: rgba(15, 23, 42, 0.95);
}

.cm-cell.revealed {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1120;
  cursor: default;
}

.cm-cell.mine {
  background: #dc2626 !important;
}

.cm-cell.exploded {
  background: #991b1b !important;
  box-shadow: 0 0 15px #ef4444;
}

.cm-cell.c-1 { color: #38bdf8; text-shadow: 0 0 8px rgba(56, 189, 248, 0.6); }
.cm-cell.c-2 { color: #4ade80; text-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.cm-cell.c-3 { color: #f87171; text-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.cm-cell.c-4 { color: #818cf8; text-shadow: 0 0 8px rgba(129, 140, 248, 0.6); }
.cm-cell.c-5 { color: #fb923c; }
.cm-cell.c-6 { color: #2dd4bf; }
.cm-cell.c-7 { color: #e879f9; }
.cm-cell.c-8 { color: #cbd5e1; }

/* ==========================================================================
   CYBER PONG
   ========================================================================== */
.pong-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.pong-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pong-control-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pong-cfg-btn {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pong-cfg-btn.active {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 700;
}

.pong-touch-zones {
  display: flex;
  width: 100%;
  height: 52px;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pong-touch-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.75rem;
  user-select: none;
  touch-action: none;
}

/* ==========================================================================
   BATALHA NAVAL (Cosmic Battleship)
   ========================================================================== */
.bn-stage {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bn-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.6rem 1.25rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.bn-turn-indicator {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--neon-cyan);
  text-align: center;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.bn-placement-dock {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
}

.bn-ship-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.bn-ship-dock-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.bn-ship-dock-item.selected {
  border-color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.2);
  color: #fff;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.bn-ship-dock-item.placed {
  opacity: 0.4;
  cursor: default;
}

.bn-ship-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.bn-ship-size {
  font-size: 0.7rem;
  color: var(--neon-cyan);
}

.bn-ship-check {
  color: #4ade80;
  font-weight: bold;
}

.bn-placement-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.bn-battlefield {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
  padding: 1rem;
  background: #040816;
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.bn-board-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.bn-board-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #f8fafc;
}

.bn-board-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.bn-grid-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid rgba(56, 189, 248, 0.3);
  background: #060b1e;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8);
}

.bn-radar-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius-md);
  background: conic-gradient(from 0deg at 50% 50%, rgba(6, 182, 212, 0.18) 0deg, transparent 60deg, transparent 360deg);
  animation: radarSweep 3.5s linear infinite;
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bn-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  width: 100%;
  height: 100%;
}

.bn-cell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.bn-cell.preview-valid {
  background: rgba(34, 197, 94, 0.35) !important;
}

.bn-cell.preview-invalid {
  background: rgba(239, 68, 68, 0.35) !important;
}

.bn-cell.ship {
  background: rgba(6, 182, 212, 0.35);
  border-color: rgba(6, 182, 212, 0.6);
}

.bn-cell.hit {
  background: rgba(239, 68, 68, 0.45) !important;
  color: #f87171;
}

.bn-cell.miss {
  background: rgba(30, 41, 59, 0.7);
  color: #38bdf8;
}

.bn-cell.sunk {
  background: rgba(185, 28, 28, 0.7) !important;
  border-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.bn-cell.revealed-enemy {
  background: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.bn-cell.ai-cell:hover:not(.hit):not(.miss) {
  background: rgba(56, 189, 248, 0.25);
}

.bn-combat-log {
  width: 100%;
  max-height: 90px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bn-log-entry.hit {
  color: #fca5a5;
  font-weight: 600;
}

.bn-log-entry.enemy-hit {
  color: #f87171;
  font-weight: 600;
}

.bn-log-entry.win {
  color: #86efac;
  font-weight: 700;
}

.bn-log-entry.loss {
  color: #f87171;
  font-weight: 700;
}

@media (max-width: 768px) {
  .bn-battlefield {
    grid-template-columns: 1fr;
  }
}



