:root {
  --bg: #070a12;
  --panel: #121829;
  --border: #252e48;
  --text: #e6e9f2;
  --muted: #8a93a8;
  --accent: #2fd3f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 0%, #17203a, var(--bg) 70%);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, 'Segoe UI', sans-serif;
  user-select: none;
}

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

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 150px;
}

.panel section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.panel canvas {
  display: block;
  width: 100%;
  height: auto;
}

.stats {
  margin: 0;
}

.stats dt {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.stats dd {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stats dd:last-child {
  margin-bottom: 0;
}

.action {
  min-height: 5em;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
}

.playfield {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#board {
  display: block;
  height: min(600px, calc(100vh - 48px));
  width: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 18, 0.75);
  text-align: center;
}

.overlay[hidden] {
  display: none;
}

.overlay h2 {
  color: var(--text);
  font-size: 28px;
  letter-spacing: 0.1em;
}

.overlay p {
  margin: 0;
  color: var(--muted);
}

.controls {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}

.controls li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
}

kbd {
  display: inline-block;
  min-width: 20px;
  margin-right: 3px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #1b2238;
  color: var(--text);
  font: inherit;
  text-align: center;
}
