*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0f0f17;
  color: #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  user-select: none;
}

.wrapper {
  position: relative;
}

.game-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 10px;
  color: #7aa2f7;
  text-align: center;
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(122, 162, 247, 0.5);
}

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

#board {
  display: block;
  border: 1px solid #2a2a3a;
  background: #1a1a25;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* ---- Panel lateral ---- */
.panel {
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 4px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #555570;
  font-weight: 600;
}

.value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 26px;
  font-weight: 700;
  color: #7aa2f7;
  letter-spacing: 1px;
}

#next-canvas {
  display: block;
  border: 1px solid #2a2a3a;
  background: #1a1a25;
  border-radius: 4px;
}

/* ---- Controles ---- */
.controls ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controls li {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  background: #22223a;
  border: 1px solid #3a3a5a;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  color: #aaa;
}

/* ---- Overlay ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.75);
  backdrop-filter: blur(4px);
  border-radius: 4px;
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#overlay-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #e57373;
}

#overlay-score {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #7aa2f7;
}

#restart-btn {
  margin-top: 8px;
  background: #7aa2f7;
  color: #0f0f17;
  border: none;
  border-radius: 6px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s;
}

#restart-btn:hover {
  background: #9bbdff;
}
