.battle-mode-picker {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.battle-mode-picker label {
  cursor: pointer;
}

.battle-mode-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.battle-mode-picker label > span {
  min-height: 78px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f2f8fa;
  transition: border-color .2s, background .2s, transform .2s;
}

.battle-mode-picker label:hover > span {
  transform: translateY(-2px);
}

.battle-mode-picker b {
  font-size: 12px;
}

.battle-mode-picker small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.battle-mode-picker input:checked + span {
  border-color: var(--blue);
  background: #e5f5fa;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.battle-mode-picker input:focus-visible + span {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.captain-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.captain-fields.single {
  grid-template-columns: 1fr;
}

.captain-fields > [hidden] {
  display: none;
}

html {
  overflow-x: clip;
}

.setup-intro h1 {
  font-size: clamp(48px, 4.2vw, 66px);
  overflow-wrap: anywhere;
}

.handoff-cover {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 20px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 28%, rgba(88,215,236,.18), transparent 28%), rgba(7,27,50,.985);
  color: #fff;
}

.handoff-cover[hidden] {
  display: none;
}

.handoff-card {
  width: min(520px, 100%);
  text-align: center;
}

.handoff-card > span {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.handoff-icon {
  width: 105px;
  height: 105px;
  margin: 25px auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: var(--cyan);
  font: 700 40px Unbounded, sans-serif;
  box-shadow: 0 0 0 22px rgba(88,215,236,.05);
  animation: handoff-pulse 1.8s ease-in-out infinite;
}

.handoff-card h2 {
  margin: 0;
  font: 700 clamp(35px, 7vw, 62px)/1 Unbounded, sans-serif;
  letter-spacing: -.065em;
}

.handoff-card p {
  margin: 18px auto 0;
  max-width: 430px;
  color: #a8bdca;
  line-height: 1.65;
}

.handoff-card .primary-action {
  width: min(390px, 100%);
  margin: 28px auto 0;
}

@keyframes handoff-pulse {
  50% { transform: scale(1.07) rotate(4deg); box-shadow: 0 0 0 32px rgba(88,215,236,.025); }
}

@media (max-width: 570px) {
  .battle-mode-picker,
  .captain-fields { grid-template-columns: 1fr; }
  .battle-mode-picker label > span { min-height: 64px; }
  .setup-intro h1 { font-size: clamp(42px, 12vw, 50px); }
}

@media (prefers-reduced-motion: reduce) {
  .handoff-icon { animation: none; }
}

/* На компьютере оба морских поля ограничены высотой окна. */
@media (min-width: 901px) {
  .battle-shell { padding-top: clamp(16px, 3vh, 40px); }
  .placement-board { width: min(100%, calc(100dvh - 335px)); margin-inline: auto; }
  .battle-fields .sea-board { max-width: calc(100dvh - 335px); margin-inline: auto; }
}
@media (min-width: 571px) and (max-width: 900px) {
  .placement-board, .battle-fields .sea-board { width: min(100%, calc(100dvh - 360px)); margin-inline: auto; }
}
@media (min-width: 800px) and (max-width: 900px) {
  .battle-fields { grid-template-columns: 1fr 1fr; }
  .battle-fields .field-card { width: 100%; }
}
.placement-board .sea-cell.ship { cursor: pointer; }
.placement-board .sea-cell.ship:hover { background: #c6f3f7; box-shadow: inset 0 0 0 3px #fff, 0 0 12px rgba(88,215,236,.7); }
.placement-board .sea-cell.preview-valid { background: #aaf0e4; box-shadow: inset 0 0 0 2px #fff, 0 0 12px rgba(88,215,236,.5); }
.placement-board .sea-cell.preview-invalid { background: #f19691; box-shadow: inset 0 0 0 2px #fff; }
.placement-board .sea-cell.preview-valid::after, .placement-board .sea-cell.preview-invalid::after { content: ""; position: absolute; inset: 20%; border-radius: 3px; background: #174c69; opacity: .8; }
.placement-board .sea-cell.preview-invalid::after { background: #922b35; }
.placement-tip { margin: 8px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
