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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0b0f14;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #e2e8f0;
  -webkit-tap-highlight-color: transparent;
}

#board {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block;
  touch-action: none;
}

#hud {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 14px;
  z-index: 2;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: rgba(18, 24, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  min-width: 74px;
}

.hud-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #64748b;
}

.hud-value {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
}

#hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(148, 163, 184, 0.55);
  letter-spacing: 0.02em;
  z-index: 2;
}

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 13, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.25s ease;
  z-index: 3;
}

#overlay.visible {
  opacity: 1;
  background: rgba(6, 9, 13, 0.55);
}

#overlay-card {
  text-align: center;
  padding: 28px 40px;
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: 10px;
  background: rgba(15, 20, 27, 0.85);
  backdrop-filter: blur(8px);
}

#overlay-title {
  font-size: 20px;
  font-weight: 600;
  color: #fb7185;
  margin-bottom: 10px;
}

#overlay-score {
  font-size: 15px;
  color: #e2e8f0;
  margin-bottom: 6px;
}

#overlay-sub {
  font-size: 12px;
  color: #64748b;
}

@media (prefers-reduced-motion: reduce) {
  #overlay {
    transition: none;
  }
}

@media (max-width: 520px) {
  #hud {
    top: 12px;
    left: 12px;
    gap: 8px;
  }
  .hud-item {
    padding: 6px 10px;
    min-width: 60px;
  }
  .hud-value {
    font-size: 15px;
  }
  #hint {
    display: none;
  }
}
