.battle-page {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 224, 137, 0.58), transparent 22rem),
    radial-gradient(circle at 82% 10%, rgba(185, 229, 255, 0.82), transparent 24rem),
    radial-gradient(circle at 70% 88%, rgba(188, 232, 214, 0.62), transparent 24rem);
}

.battle-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
}

.battle-board-panel,
.status-card,
.own-map-card,
.log-card {
  padding: 18px;
}

.battle-board-panel {
  background:
    linear-gradient(160deg, rgba(185, 229, 255, 0.92), rgba(255, 253, 245, 0.82)),
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.95), transparent 8rem);
}

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

.turn-banner,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.turn-banner h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.05;
}

.round-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #405363;
  font-weight: 950;
  white-space: nowrap;
}

.board-wrap {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: 32px minmax(0, 1fr);
  gap: 6px;
  max-width: min(82vh, 760px);
  margin: 0 auto;
}

.axis-corner {
  grid-column: 1;
  grid-row: 1;
}

.column-axis,
.row-axis {
  display: grid;
  color: #587084;
  font-size: 0.82rem;
  font-weight: 950;
}

.column-axis {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: center;
  text-align: center;
}

.row-axis {
  grid-column: 1;
  grid-row: 2;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  align-items: center;
  text-align: center;
}

.target-board,
.own-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.36) 1px, transparent 1px) 0 0 / 10% 10%,
    linear-gradient(90deg, rgba(255, 255, 255, 0.36) 1px, transparent 1px) 0 0 / 10% 10%,
    linear-gradient(145deg, #9eddf8, #dff6ff 55%, #f5fbff);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 199, 0.18), 0 18px 34px rgba(71, 85, 105, 0.16);
}

.target-board {
  grid-column: 2;
  grid-row: 2;
  aspect-ratio: 1;
}

.own-board {
  aspect-ratio: 1;
  border-radius: 20px;
}

.sky-cell,
.own-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 950;
}

.sky-cell {
  cursor: pointer;
}

.sky-cell:disabled {
  cursor: default;
}

.sky-cell:not(:disabled):active {
  background: rgba(255, 224, 137, 0.45);
}

.sky-cell.is-miss::before {
  content: "";
  width: 38%;
  height: 38%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 3px rgba(77, 163, 199, 0.42);
}

.sky-cell.is-wound::before {
  content: "✹";
  color: #f47b4f;
  font-size: clamp(1rem, 3vw, 1.9rem);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.sky-cell.is-crash::before {
  content: "✦";
  color: #263238;
  font-size: clamp(1rem, 3vw, 1.8rem);
}

.sky-cell.is-revealed-plane {
  background: rgba(255, 224, 137, 0.58);
}

.sky-cell.is-revealed-head {
  background: rgba(255, 128, 112, 0.72);
}

.own-cell.is-plane {
  background: rgba(255, 224, 137, 0.78);
}

.own-cell.is-head {
  background: rgba(255, 128, 112, 0.74);
}

.own-cell.is-hit {
  box-shadow: inset 0 0 0 4px rgba(38, 50, 56, 0.24);
}

.plane-dot {
  width: 44%;
  height: 44%;
  border-radius: 999px;
  background: #405363;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.48);
}

.plane-head {
  width: 56%;
  height: 56%;
  border-radius: 999px 999px 60% 60%;
  background: #ef6f5e;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.48);
}

.battle-hint {
  min-height: 54px;
  margin: 14px 0 0;
  padding: 13px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #405363;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.45;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.score-grid div {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.score-grid span {
  display: block;
  color: #607282;
  font-size: 0.9rem;
  font-weight: 900;
}

.score-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.65rem;
  line-height: 1;
}

.status-card .secondary-button {
  width: 100%;
}

.battle-log {
  display: grid;
  gap: 8px;
  max-height: 170px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.battle-log li {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: #405363;
  font-weight: 850;
  line-height: 1.35;
}

.handoff-dialog {
  width: min(92vw, 560px);
  padding: 0;
  border: 0;
  border-radius: 32px;
  background: transparent;
}

.handoff-dialog::backdrop {
  background:
    radial-gradient(circle at 30% 20%, rgba(185, 229, 255, 0.28), transparent 22rem),
    rgba(38, 50, 56, 0.42);
  backdrop-filter: blur(5px);
}

.handoff-panel {
  padding: 26px;
  border-radius: 32px;
  background: linear-gradient(160deg, #fffdf5, #dff6ff);
  text-align: center;
  box-shadow: var(--shadow);
}

.handoff-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.05;
}

.handoff-panel p {
  color: #405363;
  font-weight: 850;
  line-height: 1.5;
}

.handoff-panel .primary-button {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 980px) {
  .battle-shell {
    grid-template-columns: 1fr;
  }

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

  .log-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .battle-board-panel,
  .status-card,
  .own-map-card,
  .log-card {
    padding: 14px;
  }

  .battle-side,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .board-wrap {
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-rows: 26px minmax(0, 1fr);
    gap: 4px;
  }

  .target-board,
  .own-board {
    border-radius: 18px;
  }

  .turn-banner,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
