.placement-screen,
.game-screen {
  width: 100%;
  align-self: stretch;
}

.game-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px !important;
  border-bottom: 1px solid var(--line);
}

.brand--compact .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.game-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.icon-button:hover { color: var(--blue); border-color: var(--blue); background: var(--color-secondary-soft); transform: translateY(-1px); }
.icon-button svg { width: 20px; height: 20px; }

.placement-layout {
  min-height: calc(100dvh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: center;
  gap: clamp(24px, 5vw, 62px);
  padding-top: 14px;
}

.placement-main { width: min(650px, 100%); justify-self: end; }

.screen-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.screen-heading .eyebrow { margin: 0 0 3px; }
.screen-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; letter-spacing: -0.045em; }

.fleet-progress {
  min-width: 72px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.placement-panel {
  padding: 18px;
  border-radius: 23px;
}

.ship-dock { display: grid; gap: 7px; }

.ship-choice {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  text-align: left;
}

.ship-choice.is-selected { border-color: var(--blue); background: var(--color-secondary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 35%, transparent); }
.ship-choice:disabled { opacity: 0.42; }

.ship-choice__shape { display: inline-flex; }
.ship-choice__shape i { width: 23px; height: 17px; border: 1px solid var(--ink); border-left: 0; background: var(--lime); }
.ship-choice__shape i:first-child { border-left: 1px solid var(--ink); border-radius: 10px 0 0 10px; }
.ship-choice__shape i:last-child { border-radius: 0 5px 5px 0; }
.ship-choice b { min-width: 26px; font-size: 0.72rem; text-align: right; }

.placement-tip { min-height: 34px; margin: 12px 0 8px; color: var(--ink-muted); font-size: 0.68rem; line-height: 1.45; }
.placement-tip.is-error { color: color-mix(in srgb, var(--coral) 82%, var(--ink)); font-weight: 750; }
.placement-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.utility-button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper);
  font-size: 0.67rem;
  font-weight: 800;
}

.utility-button:first-child { grid-column: 1 / -1; }
.utility-button:hover { color: var(--blue); border-color: var(--blue); }
.utility-button svg { width: 17px; height: 17px; }
.utility-button kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-muted); background: transparent; font-size: 0.54rem; }
.placement-panel .primary-button { margin-top: 11px; }

.board-stage {
  width: 100%;
  padding: 8px 10px 10px 7px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper-raised) 87%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.board-stage--placement { max-width: 600px; }
.board-row { display: grid; grid-template-columns: 19px minmax(0, 1fr); gap: 3px; }
.board-coordinates { color: var(--ink-muted); font-family: Georgia, "Times New Roman", serif; font-size: 0.52rem; font-weight: 700; }
.board-coordinates--top { display: grid; grid-template-columns: repeat(10, 1fr); margin: 0 0 3px 22px; text-align: center; }
.board-coordinates--side { display: grid; grid-template-rows: repeat(10, 1fr); align-items: center; text-align: center; }

.ocean-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 11%, var(--color-canvas)), color-mix(in srgb, var(--blue) 20%, white));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--ink) 15%, transparent);
  touch-action: manipulation;
}

.ocean-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}

.ocean-cell:nth-child(10n) { border-right: 0; }
.ocean-cell:nth-last-child(-n + 10) { border-bottom: 0; }
.ocean-cell:not(:disabled) { cursor: crosshair; }
.ocean-cell:not(:disabled):hover { background: color-mix(in srgb, white 36%, transparent); }
.ocean-cell:focus-visible { z-index: 4; outline: 3px solid var(--blue); outline-offset: -3px; }

.ocean-cell.has-ship,
.ocean-cell.is-preview {
  background: var(--lime);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 68%, transparent);
}

.ocean-cell.has-ship::before,
.ocean-cell.is-preview::before {
  content: "";
  width: 68%;
  height: 42%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}

.ocean-cell.is-preview { opacity: 0.68; }
.ocean-cell.is-preview-invalid { background: var(--color-attention-soft); box-shadow: inset 0 0 0 2px var(--coral); }
.ocean-cell.is-preview-invalid::before { content: "×"; color: var(--coral); font-weight: 900; }

.shot-marker { position: relative; z-index: 2; display: block; }
.shot-marker--miss { width: 18%; aspect-ratio: 1; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, white 55%, transparent); }
.shot-marker--hit { color: color-mix(in srgb, var(--coral) 78%, var(--ink)); font-family: Georgia, serif; font-size: clamp(1rem, 2.3vw, 1.7rem); font-weight: 900; line-height: 1; }
.ocean-cell.is-hit { background: color-mix(in srgb, var(--coral) 18%, var(--lime)); }
.ocean-cell.is-sunk { background: color-mix(in srgb, var(--coral) 38%, var(--color-canvas)); box-shadow: inset 0 0 0 2px var(--coral); }
.ocean-cell.is-last::after { content: ""; position: absolute; inset: 7%; border: 2px solid var(--blue); border-radius: 50%; animation: target-pulse 560ms ease-out both; }

.match-bar {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(160px, auto) minmax(170px, 1fr);
  align-items: stretch;
  gap: 10px;
  margin: 12px auto 10px;
}

.player-card,
.turn-status { min-height: 58px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--paper) 82%, transparent); }
.player-card { gap: 10px; padding: 7px 10px; opacity: 0.58; transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.player-card--two { justify-content: flex-end; text-align: right; }
.player-card.is-active { opacity: 1; border-color: color-mix(in srgb, var(--lime) 72%, var(--ink)); background: color-mix(in srgb, var(--lime) 12%, var(--paper)); transform: translateY(-1px); }
.player-emblem { width: 27px; aspect-ratio: 1; display: grid; place-items: center; flex: none; border-radius: 9px; color: var(--color-canvas); background: var(--ink); font-size: 0.68rem; font-weight: 900; }
.player-emblem--two { color: white; background: var(--blue); }
.player-card span, .player-card small, .player-card strong { display: block; }
.player-card small { color: var(--ink-muted); font-size: 0.54rem; font-weight: 850; letter-spacing: 0.11em; }
.player-card strong { margin-top: 1px; font-size: 0.72rem; }
.player-card b { margin-left: auto; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.player-card--two b { margin-right: auto; margin-left: 0; }

.turn-status { min-width: 160px; flex-direction: column; justify-content: center; position: relative; padding: 7px 14px; text-align: center; }
.turn-status__reticle { position: absolute; top: 7px; left: 8px; width: 8px; aspect-ratio: 1; border: 2px solid var(--coral); border-radius: 50%; }
.turn-status.is-thinking .turn-status__reticle { animation: thinking 900ms ease-in-out infinite; }
.turn-status strong { font-size: 0.72rem; }
.turn-status small { margin-top: 3px; color: var(--ink-muted); font-size: 0.56rem; }

.battle-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(18px, 3vw, 34px); }
.battle-board { min-width: 0; }
.board-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 5px 7px; }
.board-caption > div { display: flex; align-items: center; gap: 8px; }
.board-caption h2 { margin: 0; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.board-caption small { color: var(--ink-muted); font-size: 0.6rem; }
.caption-mark { width: 10px; aspect-ratio: 1; display: block; }
.caption-mark--target { border: 2px solid var(--coral); border-radius: 50%; }
.caption-mark--fleet { border-radius: 3px; background: var(--lime); box-shadow: inset 0 0 0 1px var(--ink); }
.board-tabs { display: none; }

.game-footer { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 5px; }
.game-footer p { margin: 0; color: var(--ink-muted); font-size: 0.67rem; }
.text-button { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 8px; border: 0; color: var(--ink-muted); background: transparent; font-size: 0.7rem; font-weight: 800; }
.text-button:hover { color: var(--coral); }
.text-button svg { width: 17px; height: 17px; }

@keyframes target-pulse { from { opacity: 1; transform: scale(0.4); } to { opacity: 0.2; transform: scale(1); } }
@keyframes thinking { 0%, 100% { opacity: 0.35; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.2); } }
