:root {
  --bg: #12141c;
  --panel: #1b1e2a;
  --text: #e8ecf4;
  --muted: #8b93a9;
  --accent: #4fd6ff;
  --accent-dim: #1d5c73;
  --star: #ffd166;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#app {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hud {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
}

#hud-center {
  flex: 1;
  text-align: center;
}

#hud-level {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#hud-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.hud-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.hud-btn:hover {
  background: #262b3c;
}

.hud-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

#board {
  flex: 1;
  width: 100%;
  display: block;
  touch-action: none;
}

#help {
  padding: 10px 16px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.2s;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay-card {
  background: var(--panel);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.25s;
}

#overlay.hidden #overlay-card {
  transform: translateY(14px);
}

#overlay-stars {
  font-size: 2rem;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
}

#overlay-stars .earned {
  color: var(--star);
}

#overlay-stars .missed {
  color: #3a3f52;
}

#overlay-title {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

#overlay-detail {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

#overlay-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#overlay-actions button {
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #262b3c;
  color: var(--text);
}

#overlay-actions button.primary {
  background: var(--accent);
  color: #0b2530;
}
