*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;background:#0b1220;overflow:hidden}
canvas#c{width:100%;height:100%;display:block;touch-action:none}
.hint{
  position:fixed;left:8px;bottom:8px;padding:8px 10px;background:rgba(0,0,0,0.45);
  color:#fff;font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:12px;border-radius:6px;
  backdrop-filter:blur(4px);pointer-events:none;
}

/* HUD (top center) */
.hud {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 80;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc(100% - 48px);
  max-width: 520px;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Wave counter */
.waveCounter {
  color: #f7f7f7;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.28);
  padding: 6px 14px;
  border-radius: 10px;
  min-width: 220px;
  text-align: center;
  pointer-events: none;
}

/* HP bar container */
.hpBar {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.45));
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

/* HP label */
.hpLabel {
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 700;
  min-width: 130px;
  text-align: left;
}

/* HP gauge background */
.hpGauge {
  flex: 1;
  height: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

/* HP gauge fill */
.hpFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffb833, #ff5e3a);
  border-radius: 8px;
  transition: width 0.3s ease;
  box-shadow: 0 2px 8px rgba(255,92,36,0.14);
}

/* Main menu */
.menu {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 18px;
  pointer-events: auto;
  -webkit-font-smoothing:antialiased;
}

.menu .title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #f7f7f7;
  text-shadow: 0 4px 18px rgba(0,0,0,0.6);
}

.menu .sub {
  font-size: 13px;
  color: #dbeaf7;
  max-width: 260px;
  line-height: 1.2;
  opacity: 0.95;
}

/* Play button */
.menu .playBtn {
  margin-top: 12px;
  width: 160px;
  height: 48px;
  background: linear-gradient(180deg, #f7b733, #f06c00);
  color: #0b1220;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(240,108,0,0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu .playBtn:active { transform: translateY(1px) scale(0.995); }
.menu .playBtn[disabled] { opacity: 0.6; pointer-events: none; }

/* Fade overlay used for transitions */
.fadeOverlay {
  position: fixed;
  inset: 0;
  background: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 60;
}

/* Mortar button and targeting circle */
#mortarBtn { -webkit-tap-highlight-color: transparent; }
#mortarBtn[disabled] { opacity: 0.6; cursor: not-allowed; }

#mortarTarget {
  pointer-events: none;
  mix-blend-mode: screen;
}