@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #061321;
  --panel: rgba(8, 31, 52, .92);
  --panel-2: rgba(12, 44, 70, .9);
  --line: rgba(168, 220, 244, .18);
  --text: #f4fbff;
  --muted: #9db9c9;
  --cyan: #45caef;
  --cyan-2: #1599c8;
  --blue: #0b6fa7;
  --green: #39d98a;
  --yellow: #ffca61;
  --red: #ff667c;
  --deep-red: #a72842;
  --shadow: 0 22px 70px rgba(0, 0, 0, .35);
  --radius: 22px;
  --cell-gap: 3px;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(21, 153, 200, .18), transparent 32%),
    radial-gradient(circle at 90% 75%, rgba(15, 85, 135, .22), transparent 30%),
    linear-gradient(160deg, #061321 0%, #071a2e 56%, #04101d 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.sea-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(ellipse at center, rgba(90, 196, 233, .08), transparent 68%);
  background-size: auto;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(69, 202, 239, .1);
  font-size: 22px;
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { color: var(--muted); margin-top: 2px; }

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
}
.icon-button:hover { background: rgba(255, 255, 255, .1); }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 52px;
  position: relative;
  z-index: 1;
}

.card, .loading-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(12, 44, 70, .95), rgba(6, 25, 43, .96));
  box-shadow: var(--shadow);
}

.loading-card {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,.14);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  padding: clamp(28px, 5vw, 58px);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 42px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -130px;
  bottom: -180px;
  border: 1px solid rgba(69, 202, 239, .17);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(69, 202, 239, .025), 0 0 0 96px rgba(69, 202, 239, .02);
}
.hero-copy, .home-actions { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: .83rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.3rem);
  line-height: .94;
  letter-spacing: -.06em;
  max-width: 760px;
}
.hero-copy > p:not(.eyebrow) {
  color: var(--muted);
  max-width: 600px;
  font-size: 1.08rem;
  line-height: 1.65;
  margin: 24px 0 0;
}
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #c7e5f1;
  background: rgba(255,255,255,.035);
  font-size: .88rem;
}

.home-actions {
  align-self: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(3, 18, 31, .48);
  backdrop-filter: blur(14px);
}
.home-actions h2 { margin: 0 0 18px; font-size: 1.22rem; }

.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field label { font-size: .88rem; color: #c7e1ec; font-weight: 700; }
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, .22);
  outline: none;
}
.input:focus { border-color: var(--cyan-2); box-shadow: 0 0 0 3px rgba(69, 202, 239, .11); }
.input.code { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }

.action-stack { display: grid; gap: 10px; }
.inline-action { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: #6f92a6; margin: 17px 0; font-size: .78rem; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.button {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  padding: 11px 17px;
  font-weight: 800;
  color: #03131f;
  background: linear-gradient(135deg, #5ee2ff, #26abd7);
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .46; cursor: not-allowed; transform: none; }
.button.secondary { color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.button.ghost { color: var(--cyan); background: transparent; border: 1px solid rgba(69, 202, 239, .28); }
.button.danger { color: #fff; background: linear-gradient(135deg, #e44d66, #a72842); }
.button.success { color: #062116; background: linear-gradient(135deg, #52e6a0, #2fbf7a); }
.button.small { min-height: 38px; padding: 8px 12px; font-size: .88rem; }
.button.full { width: 100%; }

.resume-box {
  margin-top: 16px;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid rgba(255, 202, 97, .25);
  background: rgba(255, 202, 97, .06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.resume-box small { display: block; color: var(--muted); margin-top: 2px; }

.room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.room-header h1 { margin: 4px 0 6px; letter-spacing: -.04em; font-size: clamp(1.7rem, 4vw, 2.8rem); }
.room-header p { margin: 0; color: var(--muted); }
.room-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}
.room-code-box span { font-size: .75rem; color: var(--muted); display: block; }
.room-code-box strong { letter-spacing: .14em; font-size: 1.05rem; }

.status-strip {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
}
.player-card {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.player-card.me { border-color: rgba(69, 202, 239, .32); }
.player-card.active { box-shadow: inset 0 0 0 1px var(--yellow); }
.player-card .name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 850; }
.player-card small { display: block; color: var(--muted); margin-top: 5px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #597486; display: inline-block; box-shadow: 0 0 0 4px rgba(89,116,134,.12); }
.status-dot.ready { background: var(--green); box-shadow: 0 0 0 4px rgba(57,217,138,.12); }
.vs { display: grid; place-items: center; color: #678ba0; font-size: .75rem; font-weight: 900; }

.game-card { padding: clamp(16px, 3vw, 28px); }
.game-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.16);
  margin-bottom: 20px;
}
.game-message strong { display: block; }
.game-message span { color: var(--muted); font-size: .9rem; }
.turn-badge { white-space: nowrap; padding: 7px 10px; border-radius: 999px; font-size: .78rem; font-weight: 850; color: #062216; background: var(--green); }
.turn-badge.waiting { color: #2c2105; background: var(--yellow); }
.turn-badge.finished { color: #fff; background: var(--deep-red); }

.waiting-screen { min-height: 420px; display: grid; place-items: center; text-align: center; padding: 38px 20px; }
.waiting-radar {
  width: 168px;
  height: 168px;
  border: 1px solid rgba(69, 202, 239, .28);
  border-radius: 50%;
  position: relative;
  margin: 0 auto 24px;
  background: repeating-radial-gradient(circle, rgba(69,202,239,.09) 0 1px, transparent 1px 34px);
  overflow: hidden;
}
.waiting-radar::before, .waiting-radar::after { content: ""; position: absolute; background: rgba(69,202,239,.18); }
.waiting-radar::before { width: 1px; height: 100%; left: 50%; }
.waiting-radar::after { height: 1px; width: 100%; top: 50%; }
.radar-sweep {
  position: absolute;
  inset: 50% 50% 0 0;
  transform-origin: right top;
  background: linear-gradient(35deg, transparent 43%, rgba(69,202,239,.36));
  animation: sweep 2s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.waiting-screen h2 { margin: 0 0 10px; }
.waiting-screen p { color: var(--muted); max-width: 520px; line-height: 1.6; margin: 0; }
.waiting-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

.placement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}
.board-wrap { min-width: 0; }
.board-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.board-title h2 { margin: 0; font-size: 1.15rem; }
.board-title p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }

.board-shell {
  width: min(100%, 660px);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: 22px minmax(0, 1fr);
  gap: 5px;
}
.board-corner { grid-column: 1; grid-row: 1; }
.column-labels { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: var(--cell-gap); }
.row-labels { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(10, 1fr); gap: var(--cell-gap); }
.column-labels span, .row-labels span { display: grid; place-items: center; color: #7798aa; font-size: clamp(.55rem, 1.5vw, .72rem); font-weight: 800; }
.board {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: var(--cell-gap);
  border-radius: 12px;
  overflow: hidden;
  padding: 3px;
  background: rgba(69, 202, 239, .06);
  border: 1px solid rgba(69, 202, 239, .13);
}
.cell {
  position: relative;
  border: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(circle at 28% 28%, rgba(112, 214, 255, .14), transparent 38%),
    linear-gradient(145deg, rgba(18, 111, 159, .72), rgba(8, 61, 99, .88));
  cursor: pointer;
  transition: filter .12s ease, transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.cell::before,
.cell::after {
  content: "";
  position: absolute;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease, inset .16s ease, background .16s ease, box-shadow .16s ease;
}
.cell::before {
  inset: 14%;
  transform: scale(.98);
}
.cell:hover { filter: brightness(1.16); }
.cell:active { transform: scale(.94); }

.cell.ship::before,
.cell.preview-valid::before,
.cell.preview-invalid::before {
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(228, 242, 248, .14), inset 0 -2px 7px rgba(0,0,0,.18);
  background-repeat: no-repeat;
}

.cell.ship::before {
  background: linear-gradient(180deg, #b7c4cc 0%, #8394a0 54%, #5e727e 100%);
}
.cell.preview-valid::before {
  background: linear-gradient(180deg, rgba(121, 235, 182, .95) 0%, rgba(56, 174, 122, .98) 100%);
}
.cell.preview-invalid::before {
  background: linear-gradient(180deg, rgba(255, 135, 154, .95) 0%, rgba(179, 53, 77, .98) 100%);
}

/* Forma-base por segmento */
.cell[data-segment="solo"]::before {
  inset: 18%;
  border-radius: 50% 46% 42% 46% / 54% 46% 48% 46%;
}
.cell[data-orientation="horizontal"][data-segment="bow"]::before {
  inset: 18% 10% 18% 14%;
  border-radius: 66% 26% 26% 66% / 52% 18% 18% 52%;
}
.cell[data-orientation="horizontal"][data-segment="mid"]::before {
  inset: 18% 4% 18% 4%;
  border-radius: 22% / 42%;
}
.cell[data-orientation="horizontal"][data-segment="stern"]::before {
  inset: 18% 14% 18% 10%;
  border-radius: 24% 58% 58% 24% / 18% 48% 48% 18%;
}
.cell[data-orientation="vertical"][data-segment="bow"]::before {
  inset: 14% 18% 10% 18%;
  border-radius: 60% 60% 24% 24% / 66% 66% 24% 24%;
}
.cell[data-orientation="vertical"][data-segment="mid"]::before {
  inset: 4% 18% 4% 18%;
  border-radius: 42% / 22%;
}
.cell[data-orientation="vertical"][data-segment="stern"]::before {
  inset: 10% 18% 14% 18%;
  border-radius: 24% 24% 58% 58% / 24% 24% 60% 60%;
}

/* Porta-aviões: mais largo, convés reto e "ilha" */
.cell.ship-kind-carrier::before,
.cell.preview-valid.ship-kind-carrier::before,
.cell.preview-invalid.ship-kind-carrier::before {
  box-shadow: inset 0 0 0 1px rgba(228,242,248,.14), inset 0 -2px 7px rgba(0,0,0,.18), inset 0 0 0 999px transparent;
}
.cell[data-orientation="horizontal"].ship-kind-carrier[data-segment="bow"]::before { inset: 16% 8% 16% 14%; border-radius: 68% 18% 18% 68% / 50% 12% 12% 50%; }
.cell[data-orientation="horizontal"].ship-kind-carrier[data-segment="mid"]::before { inset: 16% 2% 16% 2%; border-radius: 10% / 20%; background-image: linear-gradient(180deg, #c0c9cf 0%, #8e9ca6 58%, #687883 100%), linear-gradient(90deg, transparent 0 68%, rgba(55,68,77,.42) 69% 80%, transparent 81% 100%); }
.cell[data-orientation="horizontal"].ship-kind-carrier[data-segment="stern"]::before { inset: 16% 14% 16% 8%; border-radius: 18% 40% 40% 18% / 12% 42% 42% 12%; }
.cell[data-orientation="vertical"].ship-kind-carrier[data-segment="bow"]::before { inset: 14% 16% 8% 16%; border-radius: 66% 66% 18% 18% / 68% 68% 18% 18%; }
.cell[data-orientation="vertical"].ship-kind-carrier[data-segment="mid"]::before { inset: 2% 16% 2% 16%; border-radius: 20% / 10%; background-image: linear-gradient(180deg, #c0c9cf 0%, #8e9ca6 58%, #687883 100%), linear-gradient(180deg, transparent 0 68%, rgba(55,68,77,.42) 69% 80%, transparent 81% 100%); }
.cell[data-orientation="vertical"].ship-kind-carrier[data-segment="stern"]::before { inset: 8% 16% 14% 16%; border-radius: 18% 18% 40% 40% / 18% 18% 42% 42%; }

/* Encouraçado: casco robusto com pequenas torres */
.cell[data-orientation="horizontal"].ship-kind-battleship[data-segment="mid"]::before,
.cell[data-orientation="horizontal"].ship-kind-cruiser[data-segment="mid"]::before,
.cell[data-orientation="horizontal"].ship-kind-destroyer-1[data-segment="mid"]::before,
.cell[data-orientation="horizontal"].ship-kind-destroyer-2[data-segment="mid"]::before {
  background-image:
    radial-gradient(circle at 34% 42%, rgba(72,84,92,.5) 0 12%, transparent 13%),
    radial-gradient(circle at 62% 42%, rgba(72,84,92,.46) 0 10%, transparent 11%),
    linear-gradient(180deg, #b7c4cc 0%, #8394a0 54%, #5e727e 100%);
}
.cell[data-orientation="vertical"].ship-kind-battleship[data-segment="mid"]::before,
.cell[data-orientation="vertical"].ship-kind-cruiser[data-segment="mid"]::before,
.cell[data-orientation="vertical"].ship-kind-destroyer-1[data-segment="mid"]::before,
.cell[data-orientation="vertical"].ship-kind-destroyer-2[data-segment="mid"]::before {
  background-image:
    radial-gradient(circle at 42% 34%, rgba(72,84,92,.5) 0 12%, transparent 13%),
    radial-gradient(circle at 42% 62%, rgba(72,84,92,.46) 0 10%, transparent 11%),
    linear-gradient(180deg, #b7c4cc 0%, #8394a0 54%, #5e727e 100%);
}
.cell[data-orientation="horizontal"].ship-kind-battleship[data-segment="bow"]::before { inset: 17% 8% 17% 12%; }
.cell[data-orientation="horizontal"].ship-kind-battleship[data-segment="mid"]::before { inset: 17% 4% 17% 4%; }
.cell[data-orientation="horizontal"].ship-kind-battleship[data-segment="stern"]::before { inset: 17% 12% 17% 8%; }
.cell[data-orientation="vertical"].ship-kind-battleship[data-segment="bow"]::before { inset: 12% 17% 8% 17%; }
.cell[data-orientation="vertical"].ship-kind-battleship[data-segment="mid"]::before { inset: 4% 17% 4% 17%; }
.cell[data-orientation="vertical"].ship-kind-battleship[data-segment="stern"]::before { inset: 8% 17% 12% 17%; }

/* Cruzador: mais fino */
.cell[data-orientation="horizontal"].ship-kind-cruiser[data-segment="bow"]::before { inset: 19% 10% 19% 18%; }
.cell[data-orientation="horizontal"].ship-kind-cruiser[data-segment="mid"]::before { inset: 19% 9% 19% 9%; }
.cell[data-orientation="horizontal"].ship-kind-cruiser[data-segment="stern"]::before { inset: 19% 18% 19% 10%; }
.cell[data-orientation="vertical"].ship-kind-cruiser[data-segment="bow"]::before { inset: 18% 19% 10% 19%; }
.cell[data-orientation="vertical"].ship-kind-cruiser[data-segment="mid"]::before { inset: 9% 19% 9% 19%; }
.cell[data-orientation="vertical"].ship-kind-cruiser[data-segment="stern"]::before { inset: 10% 19% 18% 19%; }

/* Contratorpedeiros: finos e ágeis */
.cell[data-orientation="horizontal"].ship-kind-destroyer-1[data-segment="bow"]::before,
.cell[data-orientation="horizontal"].ship-kind-destroyer-2[data-segment="bow"]::before { inset: 20% 12% 20% 20%; }
.cell[data-orientation="horizontal"].ship-kind-destroyer-1[data-segment="stern"]::before,
.cell[data-orientation="horizontal"].ship-kind-destroyer-2[data-segment="stern"]::before { inset: 20% 20% 20% 12%; }
.cell[data-orientation="vertical"].ship-kind-destroyer-1[data-segment="bow"]::before,
.cell[data-orientation="vertical"].ship-kind-destroyer-2[data-segment="bow"]::before { inset: 20% 20% 12% 20%; }
.cell[data-orientation="vertical"].ship-kind-destroyer-1[data-segment="stern"]::before,
.cell[data-orientation="vertical"].ship-kind-destroyer-2[data-segment="stern"]::before { inset: 12% 20% 20% 20%; }

/* Submarinos: cápsula arredondada */
.cell.ship-kind-submarine-1::before,
.cell.ship-kind-submarine-2::before,
.cell.preview-valid.ship-kind-submarine-1::before,
.cell.preview-valid.ship-kind-submarine-2::before,
.cell.preview-invalid.ship-kind-submarine-1::before,
.cell.preview-invalid.ship-kind-submarine-2::before {
  inset: 22%;
  border-radius: 999px;
  background-image:
    radial-gradient(circle at 50% 28%, rgba(233,241,246,.25) 0 8%, transparent 9%),
    linear-gradient(180deg, #b7c4cc 0%, #8394a0 54%, #5e727e 100%);
}
.cell.miss::after,
.cell.hit::after,
.cell.sunk::after,
.cell.pending::after {
  opacity: 1;
  transform: scale(1);
}
.cell.miss::after {
  inset: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 247, 252, .95) 0 30%, rgba(255,255,255,0) 32% 100%);
  box-shadow:
    0 0 0 1.5px rgba(219, 240, 249, .92),
    0 0 0 7px rgba(219, 240, 249, .15),
    0 0 0 12px rgba(219, 240, 249, .08);
}

.cell.hit:not(.ship),
.cell.sunk:not(.ship) {
  background: linear-gradient(145deg, rgba(46, 73, 92, .9), rgba(25, 43, 57, .95));
}
.cell.hit.ship::before,
.cell.sunk.ship::before {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 205, 117, .95) 0 20%, rgba(232, 96, 67, .9) 21% 36%, rgba(71, 19, 23, .98) 37% 54%, rgba(29, 9, 14, 1) 55% 100%),
    linear-gradient(180deg, #8f969d 0%, #596670 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 150, .22), inset 0 -2px 6px rgba(0,0,0,.28);
}
.cell.hit::after,
.cell.sunk::after {
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 243, 205, .98) 0 20%, rgba(255, 195, 109, .95) 21% 44%, rgba(255, 115, 84, .52) 45% 58%, rgba(255, 115, 84, 0) 59% 100%);
  box-shadow: 0 0 14px rgba(255, 180, 78, .35);
}
.cell.sunk::after {
  inset: 14%;
  background:
    radial-gradient(circle, rgba(255,255,255,.98) 0 10%, rgba(255, 214, 129, .95) 11% 34%, rgba(255, 115, 84, .68) 35% 52%, rgba(255, 115, 84, 0) 53% 100%);
}
.cell.pending::after {
  inset: 25%;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  background: transparent;
  animation: ping 1s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.45); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.cell:disabled { cursor: default; }
.cell:disabled:hover { filter: none; }
.board.disabled { opacity: .74; }
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending) { box-shadow: inset 0 0 0 1px rgba(94,226,255,.08); }
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover { background: linear-gradient(145deg, #1b91c6, #0a659a); box-shadow: inset 0 0 0 2px rgba(94,226,255,.45); }

.fleet-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.14);
  position: sticky;
  top: 16px;
}
.fleet-panel h2 { margin: 0; font-size: 1.08rem; }
.fleet-panel > p { color: var(--muted); line-height: 1.45; font-size: .88rem; margin: 8px 0 15px; }
.fleet-list { display: grid; gap: 8px; max-height: 405px; overflow: auto; padding-right: 2px; }
.ship-option {
  width: 100%;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ship-option:hover { background: rgba(255,255,255,.07); }
.ship-option.selected { border-color: var(--cyan); background: rgba(69,202,239,.09); }
.ship-option.placed { opacity: .58; }
.ship-option strong { display: block; font-size: .9rem; }
.ship-option small { color: var(--muted); }
.ship-mini { display: flex; align-items: center; gap: 3px; }
.ship-mini i { display: block; width: 11px; height: 7px; border-radius: 999px; background: linear-gradient(180deg, #b8c5cd 0%, #8596a2 50%, #5f7482 100%); }
.ship-mini i:first-child:not(:last-child) { border-radius: 999px 3px 3px 999px; }
.ship-mini i:last-child:not(:first-child) { border-radius: 3px 999px 999px 3px; }
.ship-option.placed .ship-mini i { background: linear-gradient(180deg, #76efb5 0%, #39c27f 100%); }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.panel-actions .full-row { grid-column: 1 / -1; }

.battle-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.battle-board-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.12); }
.battle-board-card .board-shell { width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 12px; color: var(--muted); font-size: .77rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend .water { background: #dcecf3; }
.legend .hit { background: var(--yellow); }
.legend .ship { background: #7994a2; }

.history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.history h3 { margin: 0 0 11px; font-size: .98rem; }
.history-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.history-group h4 { margin: 0 0 10px; font-size: .9rem; color: #cfe8f3; }
.history-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.028); font-size: .8rem; color: var(--muted); }
.history-item strong { color: var(--text); }
.history-item span { text-transform: capitalize; }
.empty-note.compact { padding: 12px; font-size: .84rem; }

.result-card { text-align: center; padding: clamp(30px, 6vw, 64px); }
.result-icon { width: 90px; height: 90px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 20px; font-size: 40px; background: rgba(57,217,138,.11); border: 1px solid rgba(57,217,138,.26); }
.result-card.lost .result-icon { background: rgba(255,102,124,.1); border-color: rgba(255,102,124,.25); }
.result-card h2 { margin: 0 0 8px; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.05em; }
.result-card p { color: var(--muted); margin: 0 auto; max-width: 550px; line-height: 1.6; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.rematch-status { margin-top: 16px; color: var(--yellow); font-size: .9rem; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 18px);
  max-width: min(520px, calc(100% - 28px));
  padding: 12px 16px;
  color: #fff;
  background: rgba(2, 15, 26, .96);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,102,124,.45); }
.toast.success { border-color: rgba(57,217,138,.45); }

.dialog {
  width: min(430px, calc(100% - 30px));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0a2137;
  box-shadow: var(--shadow);
  padding: 0;
}
.dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(5px); }
.dialog form { padding: 24px; }
.dialog h2 { margin: 0 0 9px; }
.dialog p { color: var(--muted); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.empty-note { padding: 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.error-card { padding: 34px; }
.error-card h1 { margin: 0 0 10px; }
.error-card p { color: var(--muted); line-height: 1.6; }
.error-code { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.24); color: #ffd2da; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; overflow-wrap: anywhere; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .placement-layout { grid-template-columns: 1fr; }
  .fleet-panel { position: static; }
  .battle-layout { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; }
  .vs { min-height: 16px; }
  .history-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root { --cell-gap: 2px; }
  .topbar, .app-shell { width: min(100% - 20px, 1180px); }
  .topbar { min-height: 72px; }
  .brand small { display: none; }
  .hero { padding: 24px 18px; gap: 28px; }
  .hero h1 { font-size: clamp(2.45rem, 15vw, 4.2rem); }
  .home-actions { padding: 17px; }
  .inline-action { grid-template-columns: 1fr; }
  .room-header { display: grid; }
  .room-code-box { width: fit-content; }
  .game-card { padding: 12px; }
  .game-message { align-items: flex-start; flex-direction: column; }
  .board-shell { grid-template-columns: 17px minmax(0, 1fr); grid-template-rows: 17px minmax(0, 1fr); gap: 3px; }
  .cell { border-radius: 2px; }
  .battle-board-card { padding: 10px; }
  .history-columns { grid-template-columns: 1fr; }
  .resume-box { align-items: flex-start; flex-direction: column; }
}

/* ==========================================================================
   PRE-DAWN COMMAND BRIDGE — premium tactical layer
   ========================================================================== */

:root {
  --bg: #02070d;
  --panel: #09131d;
  --panel-2: #0d1b28;
  --panel-raised: #122434;
  --line: rgba(162, 205, 226, .17);
  --line-strong: rgba(164, 219, 244, .34);
  --text: #f4f9fb;
  --muted: #a8bec9;
  --cyan: #79ddff;
  --cyan-2: #23a9df;
  --blue: #176ea8;
  --green: #65d6a0;
  --yellow: #f4b85b;
  --red: #ff6d72;
  --deep-red: #a72f3b;
  --shadow: 0 28px 72px rgba(0, 0, 0, .48);
  --radius: 14px;
  --cell-gap: 2px;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html { background: #02070d; scroll-behavior: smooth; }

body {
  min-height: 100svh;
  background:
    linear-gradient(180deg,
      #010408 0,
      #030b14 18%,
      #09243b 37%,
      #0d4770 45%,
      #071621 54%,
      #03090f 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: min(48vh, 470px);
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(242, 171, 108, .13), transparent 41%),
    linear-gradient(180deg, transparent 66%, rgba(87, 179, 222, .09));
  animation: horizon-rise 1.1s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes horizon-rise {
  from { opacity: .35; clip-path: inset(0 0 48% 0); filter: blur(12px); }
  to { opacity: 1; clip-path: inset(0); filter: blur(0); }
}

.sea-bg {
  opacity: .42;
  background-image:
    radial-gradient(ellipse at 50% 44%, transparent 0 47%, rgba(4, 10, 15, .8) 100%),
    linear-gradient(180deg, transparent 0 43%, rgba(112, 204, 239, .13) 43.2%, transparent 43.6%);
  background-size: auto;
  mask-image: none;
}

.topbar {
  width: min(1240px, calc(100% - 48px));
  min-height: 92px;
  border-bottom: 1px solid rgba(178, 220, 239, .12);
}

.brand { gap: 13px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(121, 221, 255, .3);
  background:
    linear-gradient(145deg, rgba(121, 221, 255, .16), rgba(17, 60, 85, .14));
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 9px 24px rgba(0,0,0,.22);
  font-size: 0;
}
.brand-mark::before {
  content: "";
  width: 21px;
  height: 24px;
  background: var(--cyan);
  clip-path: polygon(44% 0, 56% 0, 56% 35%, 78% 35%, 78% 45%, 57% 45%, 57% 73%, 80% 58%, 100% 58%, 88% 80%, 50% 100%, 12% 80%, 0 58%, 20% 58%, 43% 73%, 43% 45%, 22% 45%, 22% 35%, 44% 35%);
  filter: drop-shadow(0 3px 6px rgba(67, 197, 240, .35));
}
.brand strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.brand small {
  margin-top: 0;
  color: #adc4cf;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border-color: var(--line);
  background: linear-gradient(180deg, #132532, #09141d);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 5px 13px rgba(0,0,0,.26);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, background .18s;
}
.icon-button:hover { background: linear-gradient(180deg, #193244, #0d1d29); border-color: var(--line-strong); }
.icon-button:active { transform: translateY(2px); box-shadow: inset 0 2px 6px rgba(0,0,0,.4); }

.app-shell {
  width: min(1240px, calc(100% - 48px));
  padding: 28px 0 64px;
}

.card, .loading-card {
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(19, 38, 52, .97), rgba(5, 14, 22, .98));
  box-shadow: var(--shadow), inset 0 1px rgba(210, 236, 247, .1);
}

.hero {
  min-height: min(720px, calc(100svh - 150px));
  padding: clamp(34px, 6vw, 76px);
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .72fr);
  gap: clamp(44px, 7vw, 92px);
  align-items: center;
  background:
    linear-gradient(90deg, rgba(3, 10, 16, .93) 0 52%, rgba(8, 25, 36, .82)),
    radial-gradient(circle at 20% 20%, rgba(69, 168, 211, .2), transparent 38%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto 0 22%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(121,221,255,.38), rgba(239,169,92,.3), transparent);
  box-shadow: 0 -20px 80px rgba(44, 156, 213, .2);
}
.hero::after {
  width: 580px;
  height: 580px;
  right: auto;
  left: -290px;
  bottom: -390px;
  border-color: rgba(121, 221, 255, .12);
  box-shadow: 0 0 0 72px rgba(121,221,255,.02), 0 0 0 144px rgba(121,221,255,.015);
}
.hero-copy { align-self: center; }
.signal-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: #99dffc;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.signal-label::before {
  content: "";
  width: 19px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(121,221,255,.6);
}
.hero h1, .room-header h1, .result-card h2, .error-card h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-wrap: balance;
}
.hero h1 {
  max-width: 700px;
  font-size: clamp(3.35rem, 7vw, 5.9rem);
  line-height: .88;
  letter-spacing: -.025em;
  text-transform: uppercase;
}
.hero-copy > p:not(.signal-label) {
  max-width: 55ch;
  margin-top: 28px;
  color: #c0d2da;
  font-size: 1.02rem;
  line-height: 1.7;
}
.feature-pills { gap: 8px; margin-top: 32px; }
.pill {
  padding: 8px 11px;
  border-radius: 6px;
  border-color: rgba(181, 221, 239, .14);
  color: #bcd3de;
  background: rgba(144, 202, 227, .045);
  font-family: "Barlow Condensed", sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-actions {
  padding: clamp(22px, 3vw, 32px);
  border: 0;
  border-top: 1px solid rgba(193, 229, 243, .18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(20, 39, 52, .96), rgba(5, 14, 22, .98));
  box-shadow: 0 24px 55px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: none;
}
.home-actions h2, .fleet-panel h2, .board-title h2, .waiting-screen h2, .history h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.home-actions h2 { margin-bottom: 24px; font-size: 1.45rem; }

.field { gap: 9px; margin-bottom: 16px; }
.field label {
  color: #c6d8e0;
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.input {
  min-height: 54px;
  border: 1px solid rgba(160, 207, 228, .24);
  border-radius: 9px;
  padding: 14px 15px;
  background: #040b11;
  box-shadow: inset 0 2px 7px rgba(0,0,0,.48);
  caret-color: var(--cyan);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder { color: #718b98; opacity: 1; }
.input:hover { border-color: rgba(160, 218, 242, .38); }
.input:focus {
  border-color: #70d7fb;
  background: #07121a;
  box-shadow: 0 0 0 3px rgba(81, 190, 233, .17), inset 0 2px 7px rgba(0,0,0,.48);
}
.input.code {
  font-variant-numeric: tabular-nums;
  letter-spacing: .16em;
}

.button {
  min-height: 50px;
  border: 1px solid rgba(170, 229, 249, .42);
  border-radius: 9px;
  padding: 12px 19px;
  color: #02121b;
  background: linear-gradient(180deg, #9be9ff, #38b8e5);
  box-shadow: inset 0 1px rgba(255,255,255,.65), 0 7px 16px rgba(0,0,0,.25);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .015em;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), filter .16s, box-shadow .16s, border-color .16s;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.button:active { transform: translateY(1px); box-shadow: inset 0 3px 8px rgba(0,0,0,.25); }
.button:disabled { opacity: .42; filter: saturate(.35); }
.button.secondary {
  color: #eaf5f8;
  border-color: rgba(180, 218, 235, .23);
  background: linear-gradient(180deg, #1d3342, #0d1c27);
  box-shadow: inset 0 1px rgba(255,255,255,.09), 0 6px 15px rgba(0,0,0,.22);
}
.button.ghost {
  color: #a9e5fa;
  border-color: rgba(121, 221, 255, .28);
  background: rgba(27, 78, 103, .08);
  box-shadow: none;
}
.button.danger {
  color: #fff;
  border-color: rgba(255,131,135,.35);
  background: linear-gradient(180deg, #c94b54, #862b35);
}
.button.success {
  color: #041811;
  border-color: rgba(149,239,193,.38);
  background: linear-gradient(180deg, #91ebbb, #45bd82);
}
.button.small { min-height: 44px; padding: 10px 14px; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #fff1bd;
  outline-offset: 3px;
}

.divider { color: #829daa; margin: 21px 0; }
.resume-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 9px;
  border-color: rgba(244, 184, 91, .24);
  background: rgba(244,184,91,.065);
}

.room-header {
  align-items: center;
  margin: 8px 0 22px;
}
.room-header h1 {
  margin: 2px 0 5px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: .95;
  letter-spacing: -.015em;
  text-transform: uppercase;
}
.room-header p:not(.signal-label) { color: #b5cad4; }
.room-code-box {
  min-height: 62px;
  padding: 8px 9px 8px 15px;
  border-color: rgba(157, 211, 235, .2);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(23,46,62,.9), rgba(7,18,27,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 8px 22px rgba(0,0,0,.2);
}
.room-code-box span {
  color: #91aab6;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.room-code-box strong {
  color: #f7c679;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .16em;
}

.status-strip { gap: 10px; margin-bottom: 14px; }
.player-card {
  padding: 14px 16px;
  border-color: transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18,37,51,.9), rgba(7,18,27,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.05);
}
.player-card.me { border-color: rgba(121,221,255,.27); }
.player-card.active {
  border-color: rgba(244,184,91,.58);
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 8px 24px rgba(244,184,91,.08);
}
.player-card .name { font-size: .9rem; }
.player-card small { color: #9eb5c0; font-size: .76rem; }
.status-dot {
  width: 8px;
  height: 8px;
  background: #58717e;
  box-shadow: 0 0 0 4px rgba(88,113,126,.11);
}
.status-dot.ready { box-shadow: 0 0 0 4px rgba(101,214,160,.12), 0 0 12px rgba(101,214,160,.3); }
.vs {
  color: #8fa8b4;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .7rem;
  letter-spacing: .12em;
}

.game-card { padding: clamp(14px, 2.5vw, 28px); }
.game-message {
  min-height: 68px;
  margin-bottom: 24px;
  padding: 14px 16px 14px 18px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(19,49,67,.96), rgba(9,24,35,.85));
  box-shadow: inset 0 1px rgba(255,255,255,.055);
}
.game-message strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.08rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.game-message span:not(.turn-badge) { color: #a9bec8; line-height: 1.45; }
.turn-badge {
  border-radius: 6px;
  padding: 8px 11px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.waiting-screen { min-height: 480px; }
.waiting-radar {
  width: 190px;
  height: 190px;
  margin-bottom: 30px;
  border-color: rgba(121,221,255,.38);
  background:
    radial-gradient(circle at center, rgba(121,221,255,.12) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 31px, rgba(121,221,255,.14) 32px 33px),
    conic-gradient(from 0deg, rgba(121,221,255,.06), transparent 25% 100%);
  box-shadow: inset 0 0 42px rgba(29,143,188,.1), 0 14px 40px rgba(0,0,0,.28);
}
.radar-sweep {
  background: linear-gradient(35deg, transparent 43%, rgba(121,221,255,.5));
  animation-duration: 3s;
}
.waiting-screen h2 { font-size: 1.65rem; }
.waiting-screen p { color: #afc4ce; }

.placement-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; }
.board-title { margin-bottom: 14px; }
.board-title h2 { font-size: 1.22rem; }
.board-title p { color: #93abb7; }

.board-shell {
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: 24px minmax(0, 1fr);
  gap: 6px;
}
.column-labels span, .row-labels span {
  color: #a1bac6;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(.62rem, 1.5vw, .75rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}
.board {
  padding: 5px;
  gap: var(--cell-gap);
  border: 0;
  border-radius: 9px;
  background: #06131d;
  box-shadow:
    0 24px 45px rgba(0,0,0,.34),
    0 0 0 1px rgba(147,214,240,.18),
    inset 0 0 28px rgba(41,142,182,.08);
}
.cell {
  border-radius: 2px;
  background:
    radial-gradient(circle at 35% 25%, rgba(135, 218, 248, .12), transparent 35%),
    linear-gradient(145deg, #0f658e, #073a59);
  box-shadow: inset 0 0 0 1px rgba(135,211,241,.055);
  transition: filter .13s, transform .1s, background .17s, box-shadow .17s;
}
.cell:hover { filter: brightness(1.25); z-index: 1; }
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover {
  background: linear-gradient(145deg, #29a9dc, #096995);
  box-shadow: inset 0 0 0 2px rgba(213,246,255,.7), 0 0 14px rgba(60,192,238,.24);
}
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):focus-visible {
  z-index: 3;
  outline-offset: -3px;
}
.cell.ship::before {
  background: linear-gradient(180deg, #d2dbe0, #81939d 52%, #4d616d);
  box-shadow: inset 0 1px rgba(255,255,255,.3), inset 0 -2px 6px rgba(0,0,0,.25), 0 3px 5px rgba(0,0,0,.18);
}
.cell.hit::after, .cell.sunk::after { animation: impact-in .42s cubic-bezier(.16,1,.3,1) both; }
@keyframes impact-in {
  from { opacity: 0; transform: scale(.25); filter: blur(5px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.fleet-panel {
  top: 16px;
  padding: 20px;
  border: 0;
  border-top: 1px solid rgba(182,223,241,.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #122532, #08141d);
  box-shadow: 0 18px 40px rgba(0,0,0,.26);
}
.fleet-panel > p { color: #a8bec8; margin: 9px 0 18px; }
.fleet-list { gap: 7px; scrollbar-color: #3d6579 transparent; }
.ship-option {
  min-height: 51px;
  padding: 10px 12px;
  border-color: rgba(156,201,222,.12);
  border-radius: 8px;
  background: rgba(1,9,14,.25);
  transition: background .16s, border-color .16s, transform .16s;
}
.ship-option:hover { background: rgba(87,168,204,.1); transform: translateX(2px); }
.ship-option.selected {
  border-color: rgba(121,221,255,.55);
  background: rgba(54,158,201,.16);
  box-shadow: inset 3px 0 #79ddff;
}
.ship-option.placed { opacity: .68; }
.ship-option strong { font-size: .84rem; }
.ship-option small { color: #98b0bb; font-size: .72rem; }
.panel-actions { gap: 9px; margin-top: 18px; }

.battle-layout { gap: 18px; }
.battle-board-card {
  padding: clamp(12px, 2vw, 18px);
  border: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(13,32,45,.88), rgba(4,13,20,.7));
  box-shadow: inset 0 1px rgba(199,230,243,.07);
}
.battle-board-card:first-child {
  background: linear-gradient(180deg, rgba(16,48,65,.94), rgba(4,15,23,.78));
}
.legend { color: #a7bdc7; }
.legend i { width: 8px; height: 8px; }

.history {
  margin-top: 28px;
  border-top-color: rgba(169,210,229,.14);
  padding-top: 22px;
}
.history h3 { font-size: 1.05rem; }
.history-group h4 { color: #c8dbe3; }
.history-list { gap: 6px; }
.history-item {
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: rgba(154,207,231,.055);
  color: #9fb6c0;
}
.history-item strong {
  color: #f4c276;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.empty-note {
  border-color: rgba(161,205,225,.18);
  border-radius: 9px;
  color: #9db5bf;
}

.result-card { overflow: hidden; position: relative; }
.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 28%, rgba(101,214,160,.14), transparent 32%);
}
.result-card.lost::before { background: radial-gradient(circle at 50% 28%, rgba(255,109,114,.1), transparent 32%); }
.result-icon {
  position: relative;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(101,214,160,.17), rgba(101,214,160,.06));
}
.result-card h2 { position: relative; letter-spacing: -.02em; text-transform: uppercase; }
.result-card p, .result-actions, .rematch-status { position: relative; }

.toast {
  bottom: max(18px, env(safe-area-inset-bottom));
  padding: 14px 17px;
  border: 0;
  border-radius: 10px;
  background: #101f2a;
  box-shadow: 0 18px 40px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.07);
  color: #f5fafc;
}
.toast.error { box-shadow: inset 0 0 0 1px rgba(255,109,114,.55), 0 18px 40px rgba(0,0,0,.42); }
.toast.success { box-shadow: inset 0 0 0 1px rgba(101,214,160,.5), 0 18px 40px rgba(0,0,0,.42); }

.dialog {
  border: 0;
  border-top: 1px solid rgba(180,221,239,.2);
  border-radius: 13px;
  background: linear-gradient(180deg, #142a39, #07131c);
}
.dialog::backdrop { background: rgba(0,4,8,.78); backdrop-filter: blur(7px); }
.dialog h2 { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; }
.dialog p { color: #b3c8d1; }

@media (max-width: 880px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 48px;
  }
  .hero-copy { max-width: 700px; }
  .placement-layout { grid-template-columns: 1fr; }
  .fleet-panel { position: static; }
  .battle-layout { grid-template-columns: 1fr; }
  .battle-board-card { max-width: 680px; width: 100%; margin-inline: auto; }
  .status-strip { grid-template-columns: 1fr auto 1fr; }
  .vs { min-width: 30px; }
}

@media (max-width: 560px) {
  :root { --cell-gap: 1.5px; }
  body {
    background:
      linear-gradient(180deg, #010408 0, #061526 24%, #0b3b5c 34%, #061520 44%, #03090f 100%);
  }
  .topbar, .app-shell { width: min(100% - 24px, 1240px); }
  .topbar {
    min-height: 72px;
    padding-top: env(safe-area-inset-top);
  }
  .app-shell { padding-top: 18px; padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  .brand-mark { width: 42px; height: 42px; }
  .brand strong { font-size: 1.08rem; }
  .icon-button { width: 44px; height: 44px; }
  .hero {
    padding: 34px 18px 20px;
    gap: 36px;
    border-radius: 12px;
  }
  .hero h1 { font-size: clamp(3.1rem, 16vw, 4.55rem); line-height: .87; }
  .hero-copy > p:not(.signal-label) { margin-top: 22px; font-size: .93rem; }
  .feature-pills { margin-top: 24px; }
  .home-actions {
    margin-inline: -6px;
    padding: 20px 16px;
    border-radius: 10px;
  }
  .input { min-height: 56px; font-size: 16px; }
  .button { min-height: 52px; }
  .inline-action { grid-template-columns: 1fr; }
  .room-header { display: grid; gap: 16px; margin-top: 2px; }
  .room-code-box { width: 100%; justify-content: space-between; }
  .room-header h1 { font-size: 2.45rem; }
  .status-strip {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .vs { min-height: 10px; }
  .game-card { padding: 10px; }
  .game-message { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .turn-badge { align-self: flex-start; }
  .board-shell {
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: 18px minmax(0, 1fr);
    gap: 3px;
  }
  .board { padding: 3px; }
  .cell { border-radius: 1px; }
  .battle-board-card { padding: 9px; }
  .fleet-panel { padding: 16px; }
  .panel-actions { grid-template-columns: 1fr; }
  .panel-actions .full-row { grid-column: auto; }
  .panel-actions .button { min-height: 48px; }
  .history-columns { grid-template-columns: 1fr; }
  .waiting-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .waiting-actions .button { width: 100%; }
  .resume-box { align-items: stretch; flex-direction: column; }
  .result-actions { display: grid; }
  .result-actions .button { width: 100%; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* PASS 1 — premium tactical board
   Board-scoped visual treatment only; interaction and game state remain unchanged. */
.board-shell {
  position: relative;
  isolation: isolate;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(211, 231, 239, .16), transparent 18% 76%, rgba(0, 0, 0, .42)),
    linear-gradient(155deg, #263946 0%, #101d26 42%, #071017 100%);
  box-shadow:
    0 28px 54px rgba(0, 0, 0, .42),
    0 8px 16px rgba(0, 0, 0, .3),
    inset 0 1px rgba(234, 247, 252, .24),
    inset 0 -2px 3px rgba(0, 0, 0, .55);
}
.board-shell::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 12px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(173, 215, 232, .12),
    inset 0 0 18px rgba(0, 0, 0, .55);
}
.board-corner,
.column-labels,
.row-labels { position: relative; z-index: 3; }
.column-labels span,
.row-labels span {
  color: #b4cbd5;
  text-shadow: 0 1px 2px #000, 0 0 9px rgba(102, 204, 237, .18);
}

.board {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 4px;
  gap: 1px;
  border-radius: 6px;
  background: #020b12;
  box-shadow:
    0 0 0 1px rgba(171, 222, 241, .2),
    0 2px 4px rgba(0, 0, 0, .75),
    inset 0 0 30px rgba(0, 0, 0, .85);
}
.board::before,
.board::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 2;
  border-radius: 3px;
  pointer-events: none;
}
.board::before {
  opacity: .52;
  background:
    radial-gradient(ellipse at 18% 26%, rgba(151, 223, 245, .13), transparent 27%),
    radial-gradient(ellipse at 78% 72%, rgba(89, 183, 218, .12), transparent 31%);
  mix-blend-mode: screen;
  animation: water-caustics 12s ease-in-out infinite alternate;
}
.board::after {
  opacity: .32;
  background: linear-gradient(118deg, transparent 15%, rgba(137, 224, 250, .13) 34%, transparent 52%);
  transform: translateX(-75%);
  animation: water-glint 9s ease-in-out infinite;
}
.board.attack-ready::after {
  opacity: .46;
  background: conic-gradient(from 225deg at 0 100%, transparent 0deg, rgba(94, 219, 255, .22) 16deg, transparent 34deg);
  transform: none;
  transform-origin: 0 100%;
  animation: radar-board-sweep 4.8s linear infinite;
}

.cell {
  z-index: 1;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(167, 231, 250, .13), transparent 42%),
    linear-gradient(150deg, rgba(12, 102, 139, .96), rgba(4, 47, 73, .98));
  box-shadow:
    inset 1px 1px rgba(176, 229, 247, .075),
    inset -1px -1px rgba(0, 8, 15, .2);
  transition:
    filter .16s ease,
    transform .12s cubic-bezier(.2, .8, .2, 1),
    background .2s ease,
    box-shadow .2s ease;
}
.cell:nth-child(4n + 1) {
  background:
    radial-gradient(ellipse at 68% 72%, rgba(93, 190, 223, .1), transparent 44%),
    linear-gradient(145deg, #0c6288, #043047);
}
.cell:nth-child(5n + 2) {
  background:
    radial-gradient(ellipse at 24% 30%, rgba(158, 226, 247, .1), transparent 40%),
    linear-gradient(155deg, #0d6a91, #04344e);
}
.cell:hover { filter: brightness(1.13) saturate(1.08); }
.cell:active { transform: scale(.91); filter: brightness(1.32); }
.cell:focus-visible {
  outline: 2px solid #ddf8ff;
  outline-offset: -3px;
}

.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending) {
  cursor: crosshair;
  box-shadow:
    inset 1px 1px rgba(188, 235, 249, .09),
    inset -1px -1px rgba(0, 8, 15, .24);
}
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover {
  z-index: 4;
  filter: brightness(1.18) saturate(1.12);
  background:
    radial-gradient(circle at center, rgba(197, 243, 255, .18), transparent 42%),
    linear-gradient(145deg, #1684ae, #074760);
  box-shadow:
    inset 0 0 0 2px rgba(219, 248, 255, .82),
    0 3px 12px rgba(0, 0, 0, .36),
    0 0 18px rgba(63, 192, 229, .22);
}
.board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover::after {
  opacity: 1;
  inset: 30%;
  border: 1px solid rgba(235, 252, 255, .9);
  border-radius: 50%;
  background:
    linear-gradient(#dff9ff, #dff9ff) 50% 0 / 1px 24% no-repeat,
    linear-gradient(#dff9ff, #dff9ff) 50% 100% / 1px 24% no-repeat,
    linear-gradient(90deg, #dff9ff, #dff9ff) 0 50% / 24% 1px no-repeat,
    linear-gradient(90deg, #dff9ff, #dff9ff) 100% 50% / 24% 1px no-repeat;
  box-shadow: 0 0 9px rgba(126, 225, 252, .42);
  animation: target-lock .7s cubic-bezier(.16, 1, .3, 1) both;
}

.cell.ship::before,
.cell.preview-valid::before,
.cell.preview-invalid::before {
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .48));
}
.cell.ship::before {
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(230, 240, 243, .18) 8% 10%, transparent 11% 100%),
    linear-gradient(180deg, #d7e0e3 0%, #95a4aa 18%, #657780 51%, #344750 82%, #1e3039 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .48),
    inset 0 -2px 4px rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(9, 24, 31, .42);
}
.cell.ship[data-orientation="horizontal"]::before {
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(20, 34, 40, .32) 13% 15%, transparent 16% 100%),
    linear-gradient(180deg, #d7e0e3, #91a0a7 18%, #5d7079 52%, #2a3e48 84%, #182932);
}
.cell.ship[data-orientation="vertical"]::before {
  background:
    linear-gradient(180deg, transparent 0 12%, rgba(20, 34, 40, .32) 13% 15%, transparent 16% 100%),
    linear-gradient(90deg, #263a44, #809198 45%, #c8d3d7 58%, #5a6d76 100%);
}
.cell.preview-valid::before {
  background: linear-gradient(180deg, #bcefd9, #4ca981 55%, #245e4b);
  box-shadow: inset 0 1px rgba(255, 255, 255, .38), 0 0 12px rgba(80, 213, 157, .3);
}
.cell.preview-invalid::before {
  background: linear-gradient(180deg, #e9a0a8, #a54250 55%, #57232c);
  box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 0 11px rgba(220, 76, 94, .28);
}

.cell.miss::after {
  inset: 17%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(240, 252, 255, .98) 0 7%, transparent 9%),
    radial-gradient(circle, transparent 0 31%, rgba(202, 240, 251, .82) 33% 37%, transparent 39%),
    conic-gradient(from 8deg, transparent 0 8%, rgba(224, 247, 253, .72) 9% 11%, transparent 12% 24%, rgba(224, 247, 253, .64) 25% 28%, transparent 29% 100%);
  box-shadow: none;
  animation: splash-settle .62s cubic-bezier(.16, 1, .3, 1) both;
}
.cell.hit:not(.ship),
.cell.sunk:not(.ship) {
  background:
    radial-gradient(circle at center, rgba(125, 43, 29, .7), transparent 58%),
    linear-gradient(145deg, #263d48, #101e26);
}
.cell.hit.ship::before,
.cell.sunk.ship::before {
  filter: saturate(.55) brightness(.68) drop-shadow(0 4px 3px rgba(0, 0, 0, .58));
  background:
    radial-gradient(circle at 50% 50%, #170d0c 0 22%, #54251d 23% 36%, transparent 38%),
    linear-gradient(180deg, #8d9291, #4d595c 48%, #242f32);
}
.cell.hit::after,
.cell.sunk::after {
  inset: 7%;
  background:
    radial-gradient(circle, #fff6d5 0 6%, #ffc76b 7% 17%, #d55e32 18% 29%, rgba(83, 27, 20, .75) 30% 42%, transparent 58%),
    conic-gradient(from 12deg, transparent 0 10%, rgba(255, 194, 102, .85) 11% 13%, transparent 14% 31%, rgba(255, 128, 70, .68) 32% 35%, transparent 36% 100%);
  box-shadow: 0 2px 9px rgba(255, 139, 64, .22);
  animation: impact-bloom .55s cubic-bezier(.16, 1, .3, 1) both;
}
.cell.sunk {
  filter: saturate(.6) brightness(.72);
}
.cell.sunk::after {
  inset: 4%;
  background:
    radial-gradient(circle, #fff5ce 0 5%, #e99449 6% 15%, #7f3328 16% 31%, rgba(20, 20, 18, .82) 32% 46%, transparent 59%),
    conic-gradient(from 20deg, transparent 0 13%, rgba(205, 212, 207, .32) 14% 20%, transparent 21% 49%, rgba(178, 190, 187, .22) 50% 59%, transparent 60%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, .42);
}
.cell.pending::after {
  inset: 22%;
  border: 1px solid rgba(255, 217, 143, .92);
  background:
    radial-gradient(circle, rgba(255, 227, 165, .8) 0 7%, transparent 9%),
    conic-gradient(from 0deg, rgba(255, 213, 126, .62), transparent 18% 100%);
  box-shadow: 0 0 10px rgba(255, 193, 91, .26);
  animation: targeting-pulse 1.4s ease-in-out infinite;
}
.board.disabled { opacity: .82; filter: saturate(.78); }

@keyframes water-caustics {
  0% { transform: translate3d(-1.5%, -1%, 0) scale(1.02); opacity: .42; }
  100% { transform: translate3d(1.5%, 1%, 0) scale(1.07); opacity: .62; }
}
@keyframes water-glint {
  0%, 22% { transform: translateX(-85%); opacity: 0; }
  45% { opacity: .34; }
  72%, 100% { transform: translateX(85%); opacity: 0; }
}
@keyframes radar-board-sweep {
  to { transform: rotate(360deg); }
}
@keyframes target-lock {
  from { transform: scale(1.65) rotate(18deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes splash-settle {
  from { transform: scale(.28); opacity: 0; filter: blur(3px); }
  55% { opacity: 1; }
  to { transform: scale(1); opacity: .92; filter: blur(0); }
}
@keyframes impact-bloom {
  from { transform: scale(.18); opacity: 0; filter: blur(4px) brightness(1.8); }
  46% { transform: scale(1.22); opacity: 1; }
  to { transform: scale(1); opacity: 1; filter: blur(0) brightness(1); }
}
@keyframes targeting-pulse {
  0%, 100% { transform: scale(.72) rotate(0); opacity: .6; }
  50% { transform: scale(1.04) rotate(90deg); opacity: 1; }
}

@media (max-width: 560px) {
  .board-shell {
    padding: 7px;
    border-radius: 11px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .4), inset 0 1px rgba(234, 247, 252, .2);
  }
  .board { padding: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(214, 239, 249, .4);
    --muted: #c8dae2;
  }
  .cell { box-shadow: inset 0 0 0 1px rgba(220,245,255,.2); }
  .button, .input { border-width: 2px; }
}

/* ==========================================================================
   TACTICAL NAVAL DISPLAY — board visual replacement
   ========================================================================== */

.tactical-board {
  --display-cyan: #79e7ff;
  --display-cyan-hot: #c9f8ff;
  --display-amber: #ffbd59;
  --display-red: #ff684d;
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 9px;
  color: #c9e7ef;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent 12% 86%, rgba(0,0,0,.42)),
    linear-gradient(180deg, #1a2b34, #09141b 42%, #050b10);
  border-radius: 7px;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, .48),
    0 5px 14px rgba(0, 0, 0, .45),
    inset 0 1px rgba(224, 246, 252, .18),
    inset 0 -1px 2px rgba(0, 0, 0, .85);
}

.tactical-board::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border: 1px solid rgba(155, 203, 216, .14);
  border-radius: 4px;
  pointer-events: none;
}

.tactical-board__rail {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 9px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .15em;
  line-height: 1;
  color: #79939d;
  text-transform: uppercase;
  user-select: none;
}

.tactical-board__rail--top {
  border-bottom: 1px solid rgba(139, 195, 210, .12);
}

.tactical-board__rail--bottom {
  border-top: 1px solid rgba(139, 195, 210, .1);
}

.tactical-board__mode {
  color: #b9d3da;
}

.tactical-board__signal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #73d6b0;
}

.tactical-board__signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #64e7ae;
  box-shadow: 0 1px 6px rgba(69, 216, 151, .72);
}

.tactical-board__bearing {
  color: var(--display-cyan);
  font-variant-numeric: tabular-nums;
}

.tactical-board__viewport {
  position: relative;
  padding: 9px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(18, 92, 112, .24), transparent 65%),
    linear-gradient(155deg, #07161d, #02080c);
  box-shadow:
    inset 0 4px 14px rgba(0,0,0,.72),
    inset 0 0 0 1px rgba(112, 190, 211, .13);
}

.tactical-board__bracket {
  position: absolute;
  z-index: 8;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: .72;
}

.tactical-board__bracket--tl { top: 4px; left: 4px; border-top: 1px solid var(--display-cyan); border-left: 1px solid var(--display-cyan); }
.tactical-board__bracket--tr { top: 4px; right: 4px; border-top: 1px solid var(--display-cyan); border-right: 1px solid var(--display-cyan); }
.tactical-board__bracket--bl { bottom: 4px; left: 4px; border-bottom: 1px solid var(--display-cyan); border-left: 1px solid var(--display-cyan); }
.tactical-board__bracket--br { right: 4px; bottom: 4px; border-right: 1px solid var(--display-cyan); border-bottom: 1px solid var(--display-cyan); }

.tactical-board .board-shell {
  position: relative;
  isolation: isolate;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tactical-board .board-shell::before {
  display: none;
}

.tactical-board .board-corner::after {
  content: "+";
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(121, 231, 255, .48);
  font: 600 .65rem/1 ui-monospace, monospace;
}

.tactical-board .column-labels,
.tactical-board .row-labels {
  color: #91b7c2;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.tactical-board .column-labels span,
.tactical-board .row-labels span {
  color: #91b7c2;
  text-shadow: 0 1px 2px #000;
}

.tactical-board .board {
  position: relative;
  isolation: isolate;
  padding: 1px;
  gap: 1px;
  overflow: hidden;
  border-radius: 0;
  background: rgba(123, 201, 221, .14);
  box-shadow:
    0 4px 14px rgba(0,0,0,.52),
    inset 0 0 0 1px rgba(150, 222, 239, .14);
}

.tactical-board .board::before {
  inset: 0;
  z-index: 2;
  border-radius: 0;
  opacity: .65;
  background:
    radial-gradient(ellipse at 30% 18%, rgba(137, 231, 244, .15), transparent 28%),
    radial-gradient(ellipse at 75% 74%, rgba(64, 171, 192, .14), transparent 34%);
  mix-blend-mode: screen;
  animation: tactical-water 9s ease-in-out infinite alternate;
}

.tactical-board .board::after {
  inset: -45%;
  z-index: 3;
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(from 0deg, transparent 0 331deg, rgba(111, 227, 255, .18) 346deg, transparent 360deg);
  transform: rotate(0deg);
}

.tactical-board[data-tactical-mode="attack"] .board.attack-ready::after {
  opacity: .75;
  animation: tactical-sweep 5.6s linear infinite;
}

.tactical-board .cell,
.tactical-board .cell:nth-child(4n + 1),
.tactical-board .cell:nth-child(5n + 2) {
  position: relative;
  z-index: 1;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 38% 22%, rgba(157, 232, 242, .09), transparent 47%),
    linear-gradient(145deg, #0b4d5d, #07323e 58%, #062832);
  box-shadow:
    inset 0 0 0 1px rgba(127, 213, 230, .055),
    inset 1px 1px rgba(181, 239, 248, .045);
}

.tactical-board .cell:nth-child(3n + 1) {
  background:
    radial-gradient(ellipse at 66% 72%, rgba(127, 219, 232, .07), transparent 42%),
    linear-gradient(145deg, #0c5262, #073541 62%, #062b34);
}

.tactical-board .cell:focus-visible {
  z-index: 7;
  outline: 2px solid #e6fbff;
  outline-offset: -3px;
}

.tactical-board .board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover {
  z-index: 6;
  filter: brightness(1.14) saturate(1.1);
  background:
    radial-gradient(circle, rgba(198, 248, 255, .18), transparent 45%),
    linear-gradient(145deg, #147a8f, #0a4e60);
  box-shadow:
    inset 0 0 0 1px var(--display-cyan-hot),
    0 3px 12px rgba(0,0,0,.38);
}

.tactical-board .board.attack-ready .cell:not(.miss):not(.hit):not(.sunk):not(.pending):hover::after {
  inset: 27%;
  border: 1px solid rgba(225, 251, 255, .95);
  border-radius: 50%;
  opacity: 1;
  background:
    linear-gradient(#e8fcff, #e8fcff) 50% 0 / 1px 25% no-repeat,
    linear-gradient(#e8fcff, #e8fcff) 50% 100% / 1px 25% no-repeat,
    linear-gradient(90deg, #e8fcff, #e8fcff) 0 50% / 25% 1px no-repeat,
    linear-gradient(90deg, #e8fcff, #e8fcff) 100% 50% / 25% 1px no-repeat;
  box-shadow: none;
  animation: tactical-lock .32s cubic-bezier(.16,1,.3,1) both;
}

.tactical-board .cell.miss::after {
  inset: 22%;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, #effdff 0 7%, transparent 9%),
    radial-gradient(circle, transparent 0 30%, rgba(209, 246, 250, .9) 32% 36%, transparent 38%),
    conic-gradient(transparent 0 10%, rgba(208,244,249,.78) 11% 13%, transparent 14% 28%, rgba(208,244,249,.64) 29% 31%, transparent 32%);
  box-shadow: none;
}

.tactical-board .cell.hit::after,
.tactical-board .cell.sunk::after {
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff8d6 0 6%, #ffc15b 7% 17%, #f0613f 18% 30%, rgba(79,20,17,.82) 31% 44%, transparent 58%),
    conic-gradient(from 16deg, transparent 0 12%, rgba(255,187,85,.86) 13% 15%, transparent 16% 42%, rgba(255,106,61,.72) 43% 46%, transparent 47%);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}

.tactical-board .cell.pending::after {
  inset: 22%;
  border: 1px solid var(--display-amber);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,189,89,.72), transparent 22% 100%);
  box-shadow: 0 2px 9px rgba(0,0,0,.3);
  animation: tactical-pending 1.35s linear infinite;
}

.tactical-board .board.disabled {
  opacity: .78;
  filter: saturate(.76) brightness(.86);
}

@keyframes tactical-sweep { to { transform: rotate(360deg); } }
@keyframes tactical-water {
  from { transform: translate3d(-1%, -.6%, 0) scale(1.015); }
  to { transform: translate3d(1%, .6%, 0) scale(1.045); }
}
@keyframes tactical-lock {
  from { transform: scale(1.55) rotate(12deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes tactical-pending { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .tactical-board { padding: 6px; }
  .tactical-board__rail { min-height: 24px; padding-inline: 5px; font-size: .54rem; letter-spacing: .1em; }
  .tactical-board__viewport { padding: 6px; }
  .tactical-board__bearing { display: none; }
  .tactical-board .board-shell { grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: 16px minmax(0, 1fr); gap: 2px; }
}
