:root {
  --bg: #0a0e13;
  --panel: #10161d;
  --line: #1d2732;
  --green: #8bc63f;
  --green-light: #c6f24e;
  --green-dark: #4c8a1e;
  --white: #f5f8f3;
  --muted: #7c8b95;
  --danger: #ff5c5c;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, #121a22 0%, var(--bg) 55%);
  font-family: var(--font-body);
  color: var(--white);
  padding: 24px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.frame {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1.5px solid var(--green);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(139, 198, 63, 0.15),
    0 30px 70px -25px rgba(139, 198, 63, 0.25);
  padding: 32px 36px 30px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ---------- title ---------- */

.title-block {
  text-align: center;
  margin-bottom: 22px;
}

.game-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  letter-spacing: 0.03em;
  line-height: 0.92;
  margin: 0;
}
.game-title .line {
  display: block;
}
.game-title .white {
  color: var(--white);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.game-title .green {
  color: var(--green-light);
  text-shadow:
    0 0 18px rgba(198, 242, 78, 0.45),
    0 3px 0 rgba(0, 0, 0, 0.35);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 8px;
}
.rule::before {
  content: "";
  width: 90px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}
.rule .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.tagline {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--white);
}
.tagline .accent {
  color: var(--green-light);
}

/* ---------- stat chips ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

@media (max-width: 560px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139, 198, 63, 0.06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.stat-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-light);
  background: rgba(139, 198, 63, 0.12);
}
.stat-icon svg {
  width: 17px;
  height: 17px;
}

.stat-card div {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--green-light);
  letter-spacing: 0.02em;
}
.stat-value.small {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
}

/* ---------- board ---------- */

.board-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

#board {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  background: #0e141b;
  border: 2px solid var(--green-dark);
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(139, 198, 63, 0.08),
    0 0 30px -6px rgba(139, 198, 63, 0.25);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(8, 12, 16, 0.82);
  backdrop-filter: blur(3px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 10px;
}
.overlay.visible {
  display: flex;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.03em;
  margin: 0;
  color: var(--green-light);
}
.overlay-title.danger {
  color: var(--danger);
}

.overlay-sub {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.overlay-sub span {
  color: var(--white);
  font-weight: 700;
}

.overlay-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #10161d;
  background: var(--green-light);
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
  box-shadow: 0 10px 24px -10px rgba(198, 242, 78, 0.6);
}
.overlay-btn:hover {
  transform: translateY(-1px);
}
.overlay-btn:active {
  transform: translateY(0);
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 16px 0 0;
}
