/* styles.css — naval theme for the Battleship game. */
:root {
  --n: 10;
  --cell: 34px;
  --lbl: 22px;
  --bg: #07131f;
  --panel: #0e2236;
  --panel-2: #143049;
  --ink: #e6eef7;
  --dim: #8aa3ba;
  --accent: #4db6e6;
  --water: #0d2a43;
  --water-line: #16466b;
  --ship: #6b7a89;
  --hit: #c0392b;
  --sunk: #7a1f16;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #123049, var(--bg));
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  padding: 18px;
}

.frame { width: 920px; max-width: 100%; }

.titlebar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.titlebar h1 {
  margin: 0; font-size: 30px; letter-spacing: 7px; color: var(--accent);
  text-shadow: 0 0 18px rgba(77, 182, 230, 0.4);
}
.mute {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid #1d4666; font-size: 18px; border-radius: 8px; padding: 6px 10px; cursor: pointer;
}

.screen {
  background: var(--panel);
  border: 1px solid #1b3a57;
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

h2 { margin: 0 0 16px; color: var(--accent); letter-spacing: 1px; }
h3 { margin: 0 0 8px; font-size: 15px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }

.dim { color: var(--dim); }
.msg { font-weight: 600; min-height: 1.2em; }
.msg.turn { font-size: 18px; margin: 0 0 16px; }

/* Buttons */
.btn {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid #1f466a; border-radius: 9px; padding: 9px 16px; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: filter .1s, transform .06s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #04243a; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.big { font-size: 17px; padding: 16px 22px; }

/* Menu */
.menu .mode-buttons { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.menu .mode-buttons .btn {
  flex: 1; min-width: 240px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
}
.menu .mode-buttons strong { font-size: 18px; }
.menu .mode-buttons em { font-style: normal; font-size: 13px; color: var(--dim); }

/* Board layout */
.board-wrap { display: inline-block; user-select: none; }
.col-head { display: grid; grid-template-columns: var(--lbl) repeat(var(--n), var(--cell)); }
.board-body { display: grid; grid-template-columns: var(--lbl) auto; }
.row-head { display: grid; grid-template-rows: repeat(var(--n), var(--cell)); }
.lbl, .corner { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; font-weight: 600; }

.board {
  display: grid;
  grid-template-columns: repeat(var(--n), var(--cell));
  grid-template-rows: repeat(var(--n), var(--cell));
  border: 2px solid var(--water-line);
  border-radius: 6px;
  overflow: hidden;
}

.cell {
  width: var(--cell); height: var(--cell);
  background: var(--water);
  border: 1px solid #103a5c;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; position: relative;
}

/* Ships on an own board */
.cell.ship { background: var(--ship); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }

/* Shot markers */
.cell.miss::after { content: "•"; color: #8fb6d8; font-size: 20px; line-height: 0; }
.cell.hit { background: var(--hit); }
.cell.hit::after { content: "✕"; color: #fff; }
.cell.sunk { background: var(--sunk); }
.cell.sunk::after { content: "✕"; color: #ffd2c2; }

/* Target board interactivity */
.cell.fireable { cursor: crosshair; }
.cell.fireable:hover { background: #14507c; box-shadow: inset 0 0 0 2px var(--accent); }

/* Placement */
.place-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.cell.preview-ok { background: #2f7a4a; }
.cell.preview-bad { background: #8a3030; }
.side { flex: 1; min-width: 240px; }
.palette { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ship-btn {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--panel-2); border: 1px solid #1f466a; border-radius: 9px;
  padding: 10px 12px; color: var(--ink); cursor: pointer; font-size: 15px;
}
.ship-btn.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(77,182,230,.35); }
.ship-btn.placed { opacity: .5; cursor: default; }
.ship-pips { letter-spacing: 2px; color: var(--accent); }
.ship-name { font-weight: 600; }
.tick { color: #4dd07a; font-weight: 700; }
.controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

/* Battle */
.battle-boards { display: flex; gap: 28px; flex-wrap: wrap; }
.board-col { display: flex; flex-direction: column; gap: 8px; }
.fleet-status { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.fs-label { color: var(--dim); font-weight: 600; }
.fs-ship { background: var(--panel-2); border-radius: 6px; padding: 4px 8px; font-size: 13px; color: var(--accent); }
.fs-ship.down { color: #d98; text-decoration: line-through; opacity: .7; }

/* Handoff + over */
.handoff, .over { text-align: center; }
.handoff .lock, .over .trophy { font-size: 52px; margin-bottom: 8px; }
.handoff p { color: var(--dim); margin-bottom: 20px; }
.over .trophy { filter: drop-shadow(0 0 14px rgba(255,210,80,.5)); }

.foot { margin-top: 14px; text-align: center; color: var(--dim); font-size: 12px; }
