* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: #17120b;
  color: #f9edcf;
  font-family: Georgia, serif;
}
body {
  background: radial-gradient(circle at 50% 0, #59401d, #17120b 62%);
  padding: 16px;
}
.app {
  max-width: 1120px;
  margin: auto;
}
.top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.top h1 {
  margin: 0;
  font: 900 clamp(36px, 7vw, 70px) / 0.9 Georgia;
  letter-spacing: 0.08em;
}
.top p {
  margin: 7px 0 0;
  color: #ceb98c;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
button {
  border: 1px solid #d3ad63;
  border-radius: 5px;
  background: linear-gradient(#5a411e, #30220f);
  color: #fff1c9;
  padding: 9px 14px;
  font: bold 14px Georgia;
  cursor: pointer;
}
.layout {
  display: grid;
  grid-template-columns: minmax(520px, 680px) 1fr;
  gap: 16px;
  align-items: start;
}
.board-column {
  display: grid;
  gap: 7px;
}
.goal-score {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  font: 700 12px Arial;
  letter-spacing: 0.06em;
}
.goal-score-track {
  height: 12px;
  border: 1px solid #8d6b37;
  background: #17120b;
  border-radius: 8px;
  overflow: hidden;
}
.goal-score-fill {
  height: 100%;
  width: 0;
  transition: width 0.25s;
  background: linear-gradient(90deg, #8fbd4f, #e8d465);
}
.goal-score.black-score .goal-score-fill {
  background: linear-gradient(90deg, #555, #b79558);
}
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: url("/assets/board.png") center/100% 100% no-repeat;
  box-shadow: 0 20px 70px #000c;
}
.cell {
  position: absolute;
  width: 5.88235%;
  height: 5.88235%;
  cursor: pointer;
}
.cell.selectable:hover {
  background: #ffff8055;
}
.cell.selected {
  background: url("/assets/selection.png") center/contain no-repeat;
}
.cell.valid:after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: #65ff77;
  box-shadow: 0 0 12px #65ff77;
}
.piece {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  padding: 14px;
  border: 1px solid #8d6b37;
  background: #2a1e10e8;
}
.label {
  font: 11px Arial;
  letter-spacing: 0.18em;
  color: #b99c68;
}
.turn {
  font-size: 25px;
  font-weight: bold;
  margin-top: 5px;
}
.white {
  color: #fff;
}
.black {
  color: #aaa;
}
.status {
  min-height: 40px;
  color: #d9c69f;
}
.captured {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  min-height: 36px;
}
.captured img {
  width: 28px;
  height: 28px;
}
.rules {
  font: 13px/1.5 Arial;
  color: #d7c59e;
}
.rules b {
  color: #fff;
}
.log {
  height: 150px;
  overflow: auto;
  font: 12px/1.5 Arial;
  color: #cbb78f;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #080603e8;
}
.overlay[hidden] {
  display: none;
}
.modal {
  position: relative;
  width: min(680px, 100%);
  aspect-ratio: 1;
  background: #dcae62 url("/assets/menu-clean.png") center/cover no-repeat;
  box-shadow: 0 30px 100px #000;
}
.menu-buttons {
  position: absolute;
  left: 29%;
  top: 68%;
  display: grid;
  gap: 8px;
}
.menu-buttons button {
  font-size: 18px;
  min-width: 150px;
}
.help {
  aspect-ratio: auto;
  min-height: 420px;
  background: #dcae62 url("/assets/help.png") top center/100% auto no-repeat;
  color: #201407;
  padding: 190px 55px 35px;
}
.help li {
  margin: 7px 0;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .board {
    max-width: 680px;
    margin: auto;
  }
}
@media (max-width: 560px) {
  body {
    padding: 7px;
  }
  .actions {
    max-width: 180px;
  }
  .side {
    display: block;
  }
  .card {
    margin-top: 8px;
  }
  .menu-buttons {
    top: 65%;
    left: 23%;
  }
}
.fleet-explosion {
  position: absolute;
  inset: -45%;
  z-index: 12;
  pointer-events: none;
  display: grid;
  place-items: center;
  animation: blastFlash 1.1s ease-out forwards;
}
.fleet-explosion b {
  font-size: 70px;
  color: #fff8b0;
  text-shadow:
    0 0 8px #fff,
    0 0 20px #ffb000,
    0 0 38px #f22;
  animation: blastCore 1.1s ease-out forwards;
}
.fleet-explosion i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffcf32;
  box-shadow: 0 0 9px #f40;
  animation: blastParticle 1s ease-out forwards;
}
.fleet-explosion i:nth-child(1) {
  --x: 62px;
  --y: -46px;
}
.fleet-explosion i:nth-child(2) {
  --x: -58px;
  --y: -38px;
}
.fleet-explosion i:nth-child(3) {
  --x: 70px;
  --y: 18px;
}
.fleet-explosion i:nth-child(4) {
  --x: -72px;
  --y: 22px;
}
.fleet-explosion i:nth-child(5) {
  --x: 24px;
  --y: 66px;
}
.fleet-explosion i:nth-child(6) {
  --x: -18px;
  --y: 72px;
}
@keyframes blastCore {
  0% {
    transform: scale(0.1);
    opacity: 0;
  }
  18% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
@keyframes blastParticle {
  0% {
    transform: translate(0, 0) scale(0.2);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0.1);
    opacity: 0;
  }
}
@keyframes blastFlash {
  0%,
  100% {
    filter: none;
  }
  20% {
    filter: brightness(2);
  }
}
