:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070912;
  color: #e8eaf6;
  font-family: system-ui, -apple-system, sans-serif;
}

.layout {
  padding: 24px;
}

h1 {
  margin: 0 0 16px;
  text-align: center;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.4em;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(80, 120, 255, 0.55);
}

.game {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.board-wrap {
  position: relative;
}

canvas {
  display: block;
  background: #0d1021;
  border: 1px solid #2a2f55;
  border-radius: 6px;
}

#board {
  box-shadow: 0 0 40px rgba(70, 90, 200, 0.25);
}

.panel {
  width: 190px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8a90c4;
}

.stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: #12162c;
  border: 1px solid #262b52;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

.stats h2 {
  margin: 0;
}

.stats span {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.help ul {
  margin: 0;
  padding-left: 4px;
  list-style: none;
  font-size: 12px;
  color: #a8aecf;
  line-height: 1.9;
}

kbd {
  background: #1a1f3d;
  border: 1px solid #333a6b;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: inherit;
  margin-right: 2px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(5, 7, 18, 0.8);
  border-radius: 6px;
}

.overlay strong {
  font-size: 28px;
  letter-spacing: 0.2em;
  color: #ff5470;
}

.overlay span {
  color: #a8aecf;
  font-size: 13px;
}

.label {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.15em;
  font-size: 15px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(120, 140, 255, 0.9);
  pointer-events: none;
}

.hidden {
  display: none !important;
}
