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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1c2733;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  pointer-events: none;
  z-index: 10;
}

#level-label {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.92;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

#timer {
  min-width: 58px;
  text-align: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 6px 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

#timer.low {
  color: #ff6b6b;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(18, 26, 34, 0.72);
  z-index: 20;
}

#overlay.hidden {
  display: none;
}

#overlay-title {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#overlay-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  text-align: center;
  padding: 0 32px;
  min-height: 22px;
}

#overlay-btn {
  min-width: 190px;
  padding: 15px 28px;
  border: none;
  border-radius: 999px;
  background: #4cc07a;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(76, 192, 122, 0.42);
}

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

#boosters {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 15;
}

.booster {
  min-width: 118px;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #25313c;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.booster .count {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #25313c;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.booster:disabled {
  opacity: 0.45;
  cursor: default;
}

.booster.armed {
  background: #f0c04a;
  box-shadow: 0 6px 18px rgba(240, 192, 74, 0.5);
}
