:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #eef2ff;
  background: #0b1120;
}
* {
  box-sizing: border-box;
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, #20365c 0, transparent 34rem), #0b1120;
}
button {
  font: inherit;
}
.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 24px;
}
.intro {
  max-width: 680px;
  margin-bottom: clamp(22px, 4vw, 36px);
}
.eyebrow,
.panel-label {
  margin: 0;
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}
h1 {
  margin: 7px 0 10px;
  font-size: clamp(2.15rem, 5vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1;
}
.intro p:not(.eyebrow) {
  margin: 0;
  color: #bdc9de;
  line-height: 1.55;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
}
.board-wrap {
  width: min(100%, 720px);
}
.board {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  padding: 7px;
  overflow: hidden;
  border-radius: 12px;
  background: #263853;
  box-shadow: 0 22px 65px #0009;
}
.square {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  color: #121826;
  font-size: clamp(1.65rem, 7.2vw, 4.8rem);
  line-height: 1;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.square:hover {
  filter: brightness(1.08);
}
.square:focus-visible {
  z-index: 2;
  outline: 3px solid #fff;
  outline-offset: -3px;
}
.light {
  background: #ecd5a6;
}
.dark {
  background: #9b704d;
}
.selected {
  box-shadow: inset 0 0 0 5px #fbbf24;
}
.engine-last {
  box-shadow: inset 0 0 0 5px #34d399;
}
.legal-target::after {
  content: "";
  position: absolute;
  width: 23%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1c8f69d9;
  box-shadow: 0 0 0 3px #d2fae5a8;
}
.capture-target::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 4px solid #e34c4c;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #40141566;
}
.panel {
  min-width: 0;
  padding: 23px;
  border: 1px solid #ffffff1a;
  border-radius: 16px;
  background: #152137e8;
  box-shadow: 0 20px 50px #0004;
}
.panel-heading,
.log-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.panel-heading {
  align-items: start;
}
.panel h2 {
  margin: 3px 0 0;
  font-size: 1.35rem;
}
.status {
  min-height: 3em;
  margin: 19px 0 8px;
  color: #d8e1f1;
  line-height: 1.5;
}
.evaluation {
  min-height: 24px;
  margin: 0;
  color: #fbbf24;
  font-weight: 750;
}
button#new-game {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: #fbbf24;
  color: #152137;
  font-weight: 800;
  cursor: pointer;
}
.move-log-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #ffffff1c;
}
.log-title-row {
  align-items: baseline;
}
.log-title-row h3 {
  margin: 0;
  font-size: 0.94rem;
}
.move-count {
  color: #8fa1be;
  font-size: 0.77rem;
}
.move-log {
  max-height: 220px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  border-radius: 9px;
  background: #0c1628;
}
.move-log li {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  gap: 8px;
  padding: 9px 11px;
  color: #d9e3f4;
  font:
    600 0.86rem ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.move-log li:nth-child(even) {
  background: #ffffff08;
}
.move-log .turn-number {
  color: #91a3c0;
}
.move-log .empty-log {
  display: block;
  color: #93a3bd;
  font:
    0.82rem/1.45 Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
}
.hint {
  margin: 20px 0 0;
  color: #9eacc2;
  font-size: 0.82rem;
  line-height: 1.5;
}
@media (max-width: 840px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 22px;
  }
  .panel {
    padding: 18px;
  }
}
@media (max-width: 680px) {
  .app-shell {
    padding: 28px 14px 36px;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .board-wrap {
    width: 100%;
  }
  .panel {
    padding: 19px;
  }
  .move-log {
    max-height: 180px;
  }
  .square {
    font-size: clamp(1.55rem, 11vw, 4rem);
  }
}
