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

html, body {
  width: 100%;
  height: 100%;
  background: #111;
  overflow: hidden;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#game-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  cursor: pointer;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

#attempts {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

#progress-bar {
  position: relative;
  width: min(60%, 420px);
  height: 18px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00e5ff, #00ff9d);
  transition: width 0.1s linear;
}

#progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

/* Overlay menu */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(10, 10, 25, 0.85);
  color: #fff;
  text-align: center;
  z-index: 10;
  transition: opacity 0.25s ease;
}

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

.overlay h1 {
  font-size: clamp(32px, 7vw, 64px);
  letter-spacing: 3px;
  background: linear-gradient(90deg, #00e5ff, #00ff9d, #ffea00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
}

.overlay .sub {
  font-size: clamp(16px, 3vw, 24px);
  opacity: 0.7;
  letter-spacing: 6px;
  margin-top: -8px;
}

.overlay .hint {
  margin-top: 16px;
  opacity: 0.85;
  font-size: 15px;
}

.overlay .best {
  margin-top: 12px;
  opacity: 0.7;
  font-size: 14px;
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: monospace;
}

#start-btn {
  margin-top: 18px;
  padding: 14px 48px;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #0a0a19;
  background: linear-gradient(90deg, #00e5ff, #00ff9d);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 229, 255, 0.55);
}

#start-btn:active {
  transform: translateY(1px);
}
