* { box-sizing: border-box; }

:root {
  --bg1: #07120d;
  --bg2: #0f241b;
  --bg3: #153527;
  --silver-1: #f8fbff;
  --silver-2: #b7c2cf;
  --silver-3: #6a7583;
  --silver-4: #eef2f7;
  --green-1: #8ef0b5;
  --green-2: #1fc56d;
  --green-3: #0d733d;
  --green-4: #042915;
  --dark: #030607;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: #eff7f1;
  background:
    linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.55)),
    radial-gradient(circle at top, rgba(61, 155, 92, 0.16), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(20, 116, 68, 0.14), transparent 24%),
    url("assets/background.png") center center / cover no-repeat fixed,
    linear-gradient(180deg, #0d140f 0%, #060807 48%, #020302 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.05), transparent 25%, transparent 75%, rgba(255,255,255,.04)),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  mix-blend-mode: screen;
}

.wrap {
  width: min(96vw, 980px);
  margin: 0 auto;
  padding: 24px 12px 40px;
  position: relative;
  z-index: 1;
}

.hero,
.panel,
.board-shell {
  border: 1px solid rgba(225, 245, 233, .28);
  background:
    linear-gradient(145deg, rgba(255,255,255,.15), transparent 18%),
    linear-gradient(180deg, rgba(12, 18, 14, .82), rgba(5, 9, 7, .86));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.88),
    0 18px 40px rgba(0,0,0,.52),
    0 0 26px rgba(63, 177, 106, .12);
  backdrop-filter: blur(8px);
}

.hero {
  border-radius: 26px;
  text-align: center;
  padding: 24px 16px 20px;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  letter-spacing: .06em;
  line-height: 1;
  background: linear-gradient(180deg, var(--silver-1), var(--silver-2) 42%, white 58%, var(--silver-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 2px 2px rgba(0,0,0,.85),
    0 0 14px rgba(255,255,255,.08);
}

.hero p {
  margin: 10px 0 0;
  color: #d9f5e2;
}

.panel {
  border-radius: 18px;
  padding: 14px 16px;
}

.top-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

#status {
  font-weight: 700;
  color: #edfff2;
  letter-spacing: .02em;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid rgba(225,245,233,.34);
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  color: #f6fff8;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.03) 38%, rgba(44,136,77,.24)),
    linear-gradient(180deg, #1a3427, #08120d);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.85),
    0 8px 16px rgba(0,0,0,.35);
}

button:hover {
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.26),
    0 0 18px rgba(56, 189, 108, .26);
}

.hidden { display: none; }

.help {
  margin-top: 16px;
}

.help h2 {
  margin: 0 0 10px;
  color: #f1fff4;
}

.help ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.stat-box {
  text-align: center;
}

.label {
  font-size: .95rem;
  color: #d0ead8;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.value {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-top: 4px;
  background: linear-gradient(180deg, var(--silver-1), var(--silver-2) 42%, white 58%, var(--silver-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin-top: 2px;
  color: #c1dac8;
  font-size: .92rem;
}

.board-shell {
  border-radius: 28px;
  padding: 18px;
  display: flex;
  justify-content: center;
}

.board {
  position: relative;
  width: min(92vw, 720px);
  height: min(92vw, 720px);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(145deg, #fefefe, #c8d2dd 12%, #7b8592 24%, #eff3f8 35%, #555f6c 48%, #f9fbff 61%, #8b96a3 79%, #e9eef5 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.85),
    inset 0 0 0 10px rgba(255,255,255,.06),
    0 24px 56px rgba(0,0,0,.58),
    0 0 22px rgba(255,255,255,.08);
}

.board::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.26),
    inset 0 -1px 0 rgba(0,0,0,.65);
  pointer-events: none;
}

.board-svg {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  overflow: visible;
}

.board-svg rect,
.board-svg line {
  fill: none;
  stroke: url(#lineGlow);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 2px rgba(255,255,255,.35));
}

.point {
  position: absolute;
  width: 8.4%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(180,190,200,.75) 45%, rgba(30,40,48,.95));
  border: 2px solid rgba(255,255,255,.35);
  box-shadow:
    0 0 0 2px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.42),
    0 4px 12px rgba(0,0,0,.36);
  cursor: pointer;
}

.point.available {
  box-shadow:
    0 0 0 2px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.42),
    0 0 12px rgba(62, 199, 116, .75),
    0 4px 12px rgba(0,0,0,.36);
}

.point.selected {
  box-shadow:
    0 0 0 3px rgba(255,255,255,.75),
    0 0 18px rgba(65, 207, 122, .95),
    0 4px 12px rgba(0,0,0,.38);
}

.piece {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  box-shadow:
    inset 0 -10px 12px rgba(0,0,0,.35),
    inset 0 8px 10px rgba(255,255,255,.32),
    0 5px 8px rgba(0,0,0,.4);
}

.piece::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.28);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.24),
    inset 0 -3px 5px rgba(0,0,0,.22);
}

.piece.green {
  background:
    radial-gradient(circle at 35% 25%, var(--green-1), var(--green-2) 34%, var(--green-3) 62%, var(--green-4) 100%);
}

.piece.silver {
  background:
    radial-gradient(circle at 35% 25%, #8e959d, #3d434b 30%, #13181d 58%, #020405 100%);
}

.footer {
  margin-top: 14px;
  text-align: center;
  color: #c9dfcf;
}

code {
  color: #edfff2;
}

@media (max-width: 760px) {
  .hud-grid { grid-template-columns: 1fr; }
  .top-panel { flex-direction: column; align-items: stretch; }
  #status { text-align: center; }
  .actions { justify-content: center; flex-wrap: wrap; }
}
