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

body {
  background: #14161f;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #e6e8f0;
}

#hud {
  flex-shrink: 0;
  background: #1b1e2b;
  border-bottom: 2px solid #3a4060;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  z-index: 10;
}

#hud-title {
  color: #ffcf6b;
  font-weight: bold;
  letter-spacing: 0.12em;
  font-size: clamp(0.85rem, 2.2vw, 1.2rem);
}

.hud-stat { color: #aab0c8; }
.hud-stat span { color: #8fd6ff; font-weight: bold; }

#game-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

canvas { display: block; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(15, 17, 26, 0.86);
  z-index: 20;
  padding: 1rem;
}

.overlay.hidden { display: none; }

.overlay h1 {
  color: #ffcf6b;
  font-size: clamp(1.6rem, 5vw, 3rem);
  margin-bottom: 0.4rem;
  text-shadow: 0 0 24px rgba(255, 207, 107, 0.35);
}

.overlay h2 {
  color: #cfd4e8;
  font-size: clamp(1rem, 2.6vw, 1.7rem);
  margin-bottom: 1rem;
  font-weight: 500;
}

.overlay p {
  color: #9aa0bc;
  font-size: clamp(0.78rem, 1.7vw, 1rem);
  margin: 0.25rem 0;
  max-width: 32rem;
}

.btn {
  background: rgba(143, 214, 255, 0.16);
  border: 2px solid #8fd6ff;
  color: #8fd6ff;
  font-family: inherit;
  font-size: clamp(0.85rem, 2vw, 1.15rem);
  font-weight: bold;
  padding: 0.6rem 2.2rem;
  cursor: pointer;
  border-radius: 8px;
  margin-top: 1.2rem;
  letter-spacing: 0.1em;
  transition: all 0.15s;
}
.btn:hover { background: rgba(143, 214, 255, 0.32); }
.btn:active { transform: translateY(1px); }
