:root {
  --page-bg-1: #fffaf4;
  --page-bg-2: #e9fbff;
  --page-bg-3: #fff1f9;
  --shell-bg: rgba(255, 255, 255, 0.8);
  --shell-border: rgba(126, 209, 241, 0.34);
  --shell-shadow: rgba(110, 193, 231, 0.16);
  --panel-bg: rgba(255, 255, 255, 0.86);
  --panel-border: rgba(151, 219, 246, 0.36);
  --board-panel: rgba(248, 254, 255, 0.94);
  --text-main: #35506b;
  --text-soft: #67839b;
  --accent: #ff8fb3;
  --accent-2: #5fc8f2;
  --accent-3: #ffd67d;
  --accent-4: #9ee4c7;
  --battle-board-zoom: 1;
  --own-ship: #97b7ff;
  --own-ship-edge: #6f96ef;
  --board-ocean-top: #ddf7ff;
  --board-ocean-bottom: #b8ebff;
  --enemy-ocean-top: #d7f4ff;
  --enemy-ocean-bottom: #abddff;
  --miss: #ebfbff;
  --miss-edge: #93cde4;
  --hit: #ff9cae;
  --hit-edge: #f26583;
  --sunk: #ff6f94;
  --sunk-edge: #df436b;
  --preview-valid: rgba(95, 200, 242, 0.24);
  --preview-invalid: rgba(255, 143, 179, 0.22);
  --player-one: #ff8eb6;
  --player-two: #7ec9ff;
  --shadow-soft: 0 26px 80px rgba(102, 182, 223, 0.16);
  --shadow-pop: 0 16px 34px rgba(99, 189, 231, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text-main);
  font-family: "Candara", "Trebuchet MS", "Arial Rounded MT Bold", sans-serif;
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 212, 170, 0.4), transparent 24%),
    radial-gradient(circle at 84% 16%, rgba(157, 233, 255, 0.34), transparent 26%),
    radial-gradient(circle at 82% 82%, rgba(255, 196, 222, 0.3), transparent 24%),
    linear-gradient(150deg, var(--page-bg-1), var(--page-bg-2) 50%, var(--page-bg-3));
  overflow-x: hidden;
  position: relative;
  transition: background 260ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease, background 280ms ease;
  z-index: 0;
}

body[data-turn-theme="player-1"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 159, 196, 0.24), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(255, 190, 216, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 246, 251, 0.22), rgba(255, 255, 255, 0));
}

body[data-turn-theme="player-2"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at 82% 14%, rgba(110, 210, 255, 0.24), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(162, 230, 255, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(244, 252, 255, 0.22), rgba(255, 255, 255, 0));
}

body[data-turn-theme="victory"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at center, rgba(255, 224, 141, 0.26), transparent 32%),
    radial-gradient(circle at 22% 18%, rgba(255, 167, 198, 0.18), transparent 24%),
    radial-gradient(circle at 78% 26%, rgba(124, 225, 210, 0.18), transparent 24%);
}

body[data-turn-theme="defeat"]::before {
  opacity: 1;
  background:
    radial-gradient(circle at center, rgba(121, 184, 231, 0.22), transparent 32%),
    radial-gradient(circle at 18% 18%, rgba(172, 214, 240, 0.18), transparent 24%),
    radial-gradient(circle at 80% 80%, rgba(209, 228, 242, 0.16), transparent 24%);
}

.sea-glow,
.bubble-drift {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.sea-glow {
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.92) 0 5%, transparent 5.5%),
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.84) 0 5.5%, transparent 6%),
    radial-gradient(circle at 70% 74%, rgba(255, 255, 255, 0.8) 0 6%, transparent 6.5%),
    radial-gradient(circle at 24% 78%, rgba(255, 255, 255, 0.76) 0 4.8%, transparent 5.2%);
  opacity: 0.84;
}

.bubble-drift {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(131, 216, 247, 0.35) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(255, 173, 202, 0.3) 0 1.1px, transparent 2px);
  background-position: 0 0, 22px 18px, 10px 36px;
  background-size: 50px 50px, 74px 74px, 90px 90px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 96%);
  opacity: 0.42;
}

.game-shell,
.ad-zone {
  position: relative;
  z-index: 1;
}

.game-shell {
  width: min(96vw, 1380px);
  margin: 20px auto 0;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid var(--shell-border);
  background: var(--shell-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  transition: box-shadow 260ms ease, border-color 260ms ease, background 260ms ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  transition: filter 220ms ease;
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

h1,
.sidebar h2,
.lobby-card h2,
.board-card h2 {
  font-family: "Georgia", "Trebuchet MS", serif;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

h1 span {
  color: var(--accent-2);
  text-shadow: 0 0 18px rgba(95, 200, 242, 0.26);
}

.quick-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-links a {
  padding: 7px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid rgba(147, 216, 244, 0.52);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.quick-links a:hover,
.primary-btn:hover,
.secondary-btn:hover,
.pill-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  flex: 1;
}

.hud-item,
.meta-chip,
.status-card,
.panel-block,
.sidebar,
.lobby-card,
.board-card,
.ad-zone {
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.hud-item {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.hud-item label,
.meta-chip label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--text-soft);
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.hud-item strong {
  font-size: 1.14rem;
}

.lobby-layout,
.battle-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.lobby-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px;
}

.battle-layout {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.boards-column {
  display: grid;
  gap: 18px;
}

.lobby-card,
.board-card,
.sidebar {
  min-width: 0;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 253, 255, 0.88)),
    var(--panel-bg);
}

.lobby-card,
.board-card {
  padding: 14px;
}

.lobby-card h2,
.board-card h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.card-copy,
.sidebar p,
.board-card p {
  margin: 8px 0;
  color: var(--text-soft);
  line-height: 1.54;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main);
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(146, 214, 242, 0.48);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-main);
  outline: none;
}

input:focus,
.pill-button:focus-visible,
.mini-button:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.board-cell:focus-visible,
.fleet-chip:focus-visible {
  box-shadow: 0 0 0 3px rgba(95, 200, 242, 0.24);
}

.primary-btn,
.secondary-btn,
.pill-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-btn,
.secondary-btn {
  padding: 12px 16px;
}

.pill-button,
.mini-button {
  padding: 10px 14px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-4));
  color: #063544;
  box-shadow: 0 12px 30px rgba(95, 200, 242, 0.22);
}

.secondary-btn,
.pill-button.secondary,
.mini-button.secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text-main);
  border: 1px solid rgba(151, 219, 246, 0.52);
}

.pill-button,
.mini-button {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-main);
  border: 1px solid rgba(151, 219, 246, 0.54);
}

.board-toolbar,
.board-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
}

.compact-head {
  gap: 10px;
  align-items: center;
}

.target-board-card {
  padding-top: 12px;
}

.target-board-card .section-kicker {
  margin-bottom: 4px;
}

.target-board-card h2 {
  margin-bottom: 4px;
  font-size: 1.34rem;
}

.target-board-card .hint {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.target-board-card .legend-pill {
  padding: 6px 10px;
  font-size: 0.77rem;
}

.target-board-card .board-shell {
  margin-top: 10px;
}

.board-toolbar {
  margin-bottom: 2px;
}

.status-card {
  flex: 1;
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  transition: box-shadow 260ms ease, border-color 260ms ease, background 260ms ease;
}

.status-line {
  margin: 0;
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.5;
}

.toolbar-actions,
.placement-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sidebar {
  padding: 14px;
}

.panel-block + .panel-block {
  margin-top: 12px;
}

.panel-block {
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
}

.panel-block h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.hint {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.room-side-panel {
  display: grid;
  gap: 14px;
}

.side-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-chip {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.meta-chip strong {
  font-size: 1.08rem;
}

.players-row {
  display: grid;
  gap: 10px;
}

.zoom-panel {
  display: grid;
  gap: 10px;
}

.zoom-panel label {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text-main);
}

.zoom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.zoom-row input[type="range"] {
  width: 100%;
  padding: 0;
  accent-color: var(--accent-2);
  cursor: pointer;
}

.zoom-row strong {
  min-width: 48px;
  text-align: right;
  font-size: 0.94rem;
}

.player-card {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(151, 219, 246, 0.38);
  background: rgba(255, 255, 255, 0.76);
}

.player-card.player-one {
  box-shadow: inset 0 0 0 1px rgba(255, 142, 182, 0.2);
}

.player-card.player-two {
  box-shadow: inset 0 0 0 1px rgba(126, 201, 255, 0.22);
}

.player-card.is-active {
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(95, 200, 242, 0.28),
    0 14px 28px rgba(95, 200, 242, 0.18);
}

body[data-turn-theme="player-1"] .game-shell {
  border-color: rgba(255, 145, 190, 0.55);
  box-shadow:
    0 30px 90px rgba(255, 146, 190, 0.16),
    inset 0 0 0 1px rgba(255, 184, 213, 0.2);
}

body[data-turn-theme="player-1"] .topbar {
  filter: drop-shadow(0 10px 26px rgba(255, 145, 190, 0.14));
}

body[data-turn-theme="player-1"] .status-card {
  border-color: rgba(255, 145, 190, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 26px rgba(255, 145, 190, 0.14);
  background: rgba(255, 247, 251, 0.92);
}

body[data-turn-theme="player-2"] .game-shell {
  border-color: rgba(123, 207, 255, 0.58);
  box-shadow:
    0 30px 90px rgba(123, 207, 255, 0.17),
    inset 0 0 0 1px rgba(173, 232, 255, 0.18);
}

body[data-turn-theme="player-2"] .topbar {
  filter: drop-shadow(0 10px 26px rgba(123, 207, 255, 0.15));
}

body[data-turn-theme="player-2"] .status-card {
  border-color: rgba(123, 207, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 14px 26px rgba(123, 207, 255, 0.15);
  background: rgba(246, 252, 255, 0.94);
}

.player-card.is-winner {
  box-shadow:
    inset 0 0 0 1px rgba(255, 214, 125, 0.45),
    0 16px 34px rgba(255, 214, 125, 0.2);
}

.player-label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.74rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  font-weight: 900;
}

.player-card h3 {
  margin: 6px 0 12px;
  font-size: 1.2rem;
}

.player-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.player-detail span {
  color: var(--text-soft);
}

.legend-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(151, 219, 246, 0.44);
  font-size: 0.84rem;
  font-weight: 800;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.miss {
  background: var(--miss);
  border: 2px solid var(--miss-edge);
}

.legend-dot.hit {
  background: var(--hit);
  border: 2px solid var(--hit-edge);
}

.legend-dot.sunk {
  background: var(--sunk);
  border: 2px solid var(--sunk-edge);
}

.fleet-panel,
.fleet-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.fleet-chip,
.ship-status {
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(151, 219, 246, 0.42);
  background: rgba(255, 255, 255, 0.88);
}

.fleet-chip {
  text-align: left;
  cursor: pointer;
}

.fleet-chip.is-selected {
  box-shadow:
    inset 0 0 0 2px rgba(95, 200, 242, 0.38),
    0 10px 22px rgba(95, 200, 242, 0.18);
}

.fleet-chip.is-placed {
  border-color: rgba(126, 201, 255, 0.58);
}

.fleet-chip.is-sunk,
.ship-status.is-sunk {
  border-color: rgba(255, 111, 148, 0.54);
  background: rgba(255, 240, 245, 0.96);
}

.fleet-chip[disabled] {
  opacity: 0.72;
  cursor: default;
}

.fleet-chip-title,
.ship-status-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 900;
}

.fleet-chip-state,
.ship-status-state {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.fleet-pearl-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fleet-pearl {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(166, 226, 246, 0.82));
  border: 1px solid rgba(111, 150, 239, 0.24);
}

.fleet-pearl.hit {
  background: linear-gradient(180deg, #ffc3cd, #ff90a4);
  border-color: rgba(242, 101, 131, 0.42);
}

.fleet-label {
  margin: 0 0 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.board-shell {
  margin-top: 14px;
  padding: 14px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 251, 255, 0.96)),
    var(--board-panel);
  border: 1px solid rgba(151, 219, 246, 0.42);
}

.battle-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, calc(620px * var(--battle-board-zoom)));
  margin: 0 auto;
  padding: 10px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(233, 249, 255, 0.58)),
    linear-gradient(180deg, var(--board-ocean-top), var(--board-ocean-bottom));
  box-shadow: inset 0 0 0 1px rgba(114, 194, 231, 0.2);
  transition: width 180ms ease, box-shadow 220ms ease;
}

.battle-board.enemy-board {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(228, 245, 255, 0.48)),
    linear-gradient(180deg, var(--enemy-ocean-top), var(--enemy-ocean-bottom));
}

.board-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(116, 191, 229, 0.28);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(240, 252, 255, 0.9), rgba(189, 236, 255, 0.96));
  color: transparent;
  cursor: default;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 12px rgba(97, 176, 214, 0.08);
}

.enemy-board .board-cell {
  background: linear-gradient(180deg, rgba(237, 251, 255, 0.9), rgba(178, 224, 255, 0.96));
}

.board-cell::before,
.board-cell::after {
  content: "";
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.board-cell.has-ship {
  background: linear-gradient(180deg, rgba(216, 228, 255, 0.95), rgba(151, 183, 255, 0.95));
  border-color: rgba(111, 150, 239, 0.42);
}

.board-cell.has-ship::before {
  width: 56%;
  height: 24%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(225, 236, 255, 0.68));
  box-shadow: 0 0 0 1px rgba(92, 129, 214, 0.14);
}

.board-cell.belongs-selected {
  box-shadow:
    inset 0 0 0 2px rgba(95, 200, 242, 0.4),
    0 10px 18px rgba(95, 200, 242, 0.14);
}

.board-cell.miss {
  background: linear-gradient(180deg, rgba(248, 254, 255, 0.96), rgba(235, 251, 255, 0.98));
  border-color: rgba(147, 205, 228, 0.52);
}

.board-cell.miss::before {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--miss-edge);
  background: rgba(255, 255, 255, 0.86);
}

.board-cell.hit {
  background: linear-gradient(180deg, rgba(255, 204, 214, 0.98), rgba(255, 156, 174, 0.98));
  border-color: rgba(242, 101, 131, 0.52);
}

.board-cell.hit::before {
  width: 56%;
  height: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.board-cell.hit::after {
  width: 56%;
  height: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.board-cell.sunk {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 113, 148, 0.96) 0 8px,
      rgba(243, 84, 121, 0.96) 8px 16px
    );
  border-color: rgba(223, 67, 107, 0.62);
}

.board-cell.sunk::before {
  width: 60%;
  height: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.board-cell.sunk::after {
  width: 60%;
  height: 4px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.board-cell.preview-valid {
  box-shadow:
    inset 0 0 0 3px rgba(95, 200, 242, 0.5),
    0 8px 18px rgba(95, 200, 242, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(95, 200, 242, 0.3)),
    linear-gradient(180deg, var(--board-ocean-top), var(--board-ocean-bottom));
}

.board-cell.preview-invalid {
  box-shadow:
    inset 0 0 0 3px rgba(255, 143, 179, 0.5),
    0 8px 18px rgba(255, 143, 179, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 143, 179, 0.28)),
    linear-gradient(180deg, var(--board-ocean-top), var(--board-ocean-bottom));
}

.board-cell.is-targetable,
.board-cell.is-placeable {
  cursor: pointer;
}

.board-cell.is-targetable:hover,
.board-cell.is-targetable:focus-visible,
.board-cell.is-placeable:hover,
.board-cell.is-placeable:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    inset 0 0 0 2px rgba(95, 200, 242, 0.28),
    0 12px 22px rgba(95, 200, 242, 0.16);
}

.move-log {
  display: grid;
  gap: 8px;
}

.move-entry {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(151, 219, 246, 0.36);
  background: rgba(255, 255, 255, 0.88);
  line-height: 1.48;
}

.move-entry.result-hit {
  box-shadow: inset 0 0 0 1px rgba(255, 156, 174, 0.22);
}

.move-entry.result-sunk {
  box-shadow: inset 0 0 0 1px rgba(255, 111, 148, 0.24);
}

.move-entry strong {
  color: var(--text-main);
}

.ad-zone {
  width: min(96vw, 1380px);
  margin: 18px auto 26px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
}

.victory-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.turn-toast {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: start center;
  padding-top: 88px;
  pointer-events: none;
}

.turn-toast-card {
  min-width: min(88vw, 360px);
  max-width: min(90vw, 460px);
  padding: 16px 20px;
  border-radius: 24px;
  border: 1px solid rgba(151, 219, 246, 0.46);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 252, 255, 0.92));
  box-shadow:
    0 18px 42px rgba(89, 165, 204, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  text-align: center;
  transform: translateY(-16px) scale(0.96);
  opacity: 0;
}

.turn-toast.show .turn-toast-card {
  animation: turn-toast-in 1700ms ease forwards;
}

.turn-toast-card.player-1 {
  border-color: rgba(255, 145, 190, 0.5);
  background: linear-gradient(180deg, rgba(255, 251, 253, 0.99), rgba(255, 241, 247, 0.94));
  box-shadow:
    0 18px 42px rgba(255, 145, 190, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.turn-toast-card.player-2 {
  border-color: rgba(123, 207, 255, 0.52);
  background: linear-gradient(180deg, rgba(252, 255, 255, 0.99), rgba(239, 249, 255, 0.94));
  box-shadow:
    0 18px 42px rgba(123, 207, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.turn-toast-kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.turn-toast-title {
  margin: 0 0 6px;
  font-family: "Georgia", "Trebuchet MS", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  color: var(--text-main);
}

.turn-toast-text {
  margin: 0;
  color: var(--text-soft);
  font-weight: 700;
}

.victory-burst {
  position: absolute;
  width: min(82vw, 560px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background:
    conic-gradient(
      from 0deg,
      rgba(255, 215, 124, 0.3),
      rgba(255, 143, 179, 0.22),
      rgba(95, 200, 242, 0.22),
      rgba(158, 228, 199, 0.22),
      rgba(255, 215, 124, 0.3)
    );
  filter: blur(12px);
  opacity: 0.8;
  animation: victory-spin 10s linear infinite;
}

.victory-card {
  position: relative;
  width: min(92vw, 460px);
  padding: 28px 24px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.94));
  border: 1px solid rgba(255, 218, 149, 0.5);
  box-shadow:
    0 26px 70px rgba(83, 141, 182, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: victory-pop 420ms ease;
  pointer-events: auto;
}

.victory-overlay.is-loss .victory-card {
  border-color: rgba(158, 209, 236, 0.56);
}

.victory-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.victory-card h2 {
  margin: 0 0 10px;
  font-family: "Georgia", "Trebuchet MS", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.victory-card p:last-child {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.victory-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.victory-actions .primary-btn,
.victory-actions .secondary-btn {
  min-width: min(100%, 240px);
}

.victory-actions button[disabled] {
  opacity: 0.72;
  cursor: default;
  transform: none;
}

.victory-note {
  margin-top: 12px !important;
  font-size: 0.92rem !important;
}

@keyframes victory-pop {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes victory-spin {
  from {
    transform: rotate(0deg) scale(0.96);
  }

  50% {
    transform: rotate(180deg) scale(1);
  }

  to {
    transform: rotate(360deg) scale(0.96);
  }
}

@keyframes turn-toast-in {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(0.95);
  }

  12%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 1200px) {
  .lobby-layout,
  .battle-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    width: 100%;
  }
}

@media (max-width: 860px) {
  .hud {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    width: 100%;
  }

  .side-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-board {
    gap: 5px;
    padding: 8px;
  }

  .board-cell {
    border-radius: 12px;
  }

  .target-board-card h2 {
    font-size: 1.22rem;
  }
}

@media (max-width: 620px) {
  .game-shell {
    width: 100vw;
    margin-top: 0;
    border-radius: 0;
    padding: 16px;
  }

  .topbar,
  .board-toolbar,
  .board-card-head {
    gap: 12px;
  }

  .toolbar-actions,
  .placement-actions {
    width: 100%;
  }

  .toolbar-actions > *,
  .placement-actions > * {
    flex: 1;
  }

  .fleet-panel,
  .fleet-status-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-meta-grid,
  .hud {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .battle-board {
    gap: 4px;
    padding: 6px;
  }

  .board-cell {
    border-radius: 10px;
  }

  .victory-card {
    padding: 24px 18px;
  }

  .turn-toast {
    padding-top: 76px;
  }

  .turn-toast-card {
    min-width: min(92vw, 340px);
    padding: 14px 16px;
  }
}
