:root {
  --ink: #0b0c10;
  --paper: #f4f0e8;
  --gold: #e8c547;
  --light: #e8d5b0;
  --dark: #3b2a1c;
  --play: #6b4a2e;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
}
.atmosphere {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(232, 197, 71, 0.14), transparent 55%),
    linear-gradient(180deg, #0a0c10, #141218);
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
}
.back { color: rgba(244,240,232,.55); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--gold); }
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.08em;
  font-weight: 400;
}
.ghost {
  appearance: none; border: 1px solid rgba(244,240,232,.25); background: transparent;
  color: var(--paper); font: inherit; padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

main { padding: 0 1rem 2rem; }
.status {
  text-align: center; margin: 0 0 0.8rem;
  color: var(--gold); min-height: 1.4em; font-weight: 600;
}
.hint {
  text-align: center; margin-top: 0.85rem;
  font-size: 0.82rem; color: rgba(244,240,232,.45);
}
.board-wrap {
  width: min(92vw, 92vh, 640px);
  margin: 0 auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  border: 10px solid #5a3a1c;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  user-select: none;
}
.sq {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  cursor: pointer;
  font: inherit;
  line-height: 0;
  background: none;
  color: inherit;
}
.sq.light { background: var(--light); cursor: default; }
.sq.dark { background: var(--play); }
.sq.sel { outline: 3px solid var(--gold); outline-offset: -3px; z-index: 1; }
.sq.can .piece { box-shadow: 0 0 0 2px rgba(232, 197, 71, .55), 0 3px 0 rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.25); }
.sq.dest::after,
.sq.cap::after {
  content: "";
  position: absolute; inset: 32%;
  border-radius: 50%;
  background: rgba(232, 197, 71, .75);
  pointer-events: none;
  z-index: 2;
}
.sq.cap::after {
  background: rgba(255, 77, 46, .85);
  inset: 28%;
}
.piece {
  position: absolute; inset: 12%;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.25);
}
.piece.w { background: radial-gradient(circle at 35% 30%, #fff, #d8d4cc 55%, #9a968c); }
.piece.b { background: radial-gradient(circle at 35% 30%, #5a5a5a, #1a1a1a 60%, #050505); }
.piece.king::before {
  content: "♛";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(0.7rem, 3.2vw, 1.15rem);
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.piece.b.king::before { color: #f0d060; }

@media (max-width: 520px) {
  .board { border-width: 6px; }
  .piece { inset: 10%; }
}
:root {
  --ink: #0b0c10;
  --paper: #f4f0e8;
  --gold: #e8c547;
  --light: #e8d5b0;
  --dark: #3b2a1c;
  --play: #6b4a2e;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
}
.atmosphere {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(232, 197, 71, 0.14), transparent 55%),
    linear-gradient(180deg, #0a0c10, #141218);
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
}
.back { color: rgba(244,240,232,.55); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--gold); }
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.08em;
  font-weight: 400;
}
.ghost {
  appearance: none; border: 1px solid rgba(244,240,232,.25); background: transparent;
  color: var(--paper); font: inherit; padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

main { padding: 0 1rem 2rem; }
.status {
  text-align: center; margin: 0 0 0.8rem;
  color: var(--gold); min-height: 1.4em; font-weight: 600;
}
.hint {
  text-align: center; margin-top: 0.85rem;
  font-size: 0.82rem; color: rgba(244,240,232,.45);
}
.board-wrap {
  width: min(92vw, 92vh, 640px);
  margin: 0 auto;
}
.board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: 100%;
  aspect-ratio: 1;
  border: 10px solid #5a3a1c;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  user-select: none;
}
.sq {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  cursor: pointer;
  font: inherit;
  line-height: 0;
  background: none;
  color: inherit;
}
.sq.light { background: var(--light); cursor: default; }
.sq.dark { background: var(--play); }
.sq.sel { outline: 3px solid var(--gold); outline-offset: -3px; z-index: 1; }
.sq.can .piece { box-shadow: 0 0 0 2px rgba(232, 197, 71, .55), 0 3px 0 rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.25); }
.sq.dest::after,
.sq.cap::after {
  content: "";
  position: absolute; inset: 32%;
  border-radius: 50%;
  background: rgba(232, 197, 71, .75);
  pointer-events: none;
  z-index: 2;
}
.sq.cap::after {
  background: rgba(255, 77, 46, .85);
  inset: 28%;
}
.piece {
  position: absolute; inset: 12%;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 3px 6px rgba(255,255,255,.25);
}
.piece.w { background: radial-gradient(circle at 35% 30%, #fff, #d8d4cc 55%, #9a968c); }
.piece.b { background: radial-gradient(circle at 35% 30%, #5a5a5a, #1a1a1a 60%, #050505); }
.piece.king::before {
  content: "♛";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(0.7rem, 3.2vw, 1.15rem);
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.piece.b.king::before { color: #f0d060; }

@media (max-width: 520px) {
  .board { border-width: 6px; }
  .piece { inset: 10%; }
}
