* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #14181f;
  color: #e8eef7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.game {
  width: min(92vw, 420px);
  text-align: center;
  padding: 16px 0;
}

.title {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: 1px;
  color: #6ee7a0;
}

.scores {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
}

.score-box {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  background: #1f2632;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.score-box--enemy {
  color: #b48cff;
}

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 3px #2b3444;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 13, 18, 0.72);
  pointer-events: none;
}

.overlay.hidden {
  display: none;
}

.overlay-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}

.overlay-text {
  margin: 0;
  font-size: 15px;
  color: #b8c3d4;
}

.controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.controls button {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #2f8f5b;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.controls button:hover {
  background: #37a669;
}

.controls button:active {
  transform: translateY(1px);
}

.hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #7f8b9e;
}

.hint--enemy {
  margin-top: 6px;
  color: #9b84c9;
}

.noscript {
  margin: 12px 0 0;
  color: #ff5d6c;
}