* {
  box-sizing: border-box;
}

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

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(11, 15, 20, 0.55);
  font-size: 14px;
  pointer-events: none;
}

.hud b,
.hud em {
  color: #facc15;
  font-style: normal;
}

.hud-goal {
  color: #bae6fd;
  font-weight: 700;
}

.buffs {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: min(92vw, 520px);
  pointer-events: none;
  z-index: 3;
}

.buff {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(11, 15, 20, 0.62);
  border: 2px solid currentColor;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(11, 15, 20, 0.72);
  color: #facc15;
  font-size: 16px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 4;
}

.toast.show {
  opacity: 1;
}

.mute {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(11, 15, 20, 0.55);
  font-size: 18px;
  cursor: pointer;
}

.banner {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translate(-50%, 0) scale(0.6);
  width: min(92vw, 640px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 3px 0 #000,
    0 0 18px rgba(0, 0, 0, 0.5);
}

.banner.show {
  animation: pop 2.4s ease-out forwards;
}

.banner-title {
  font-size: clamp(34px, 9vw, 72px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  color: #facc15;
  -webkit-text-stroke: 2px #7c2d12;
}

.banner-detail {
  margin-top: 4px;
  font-size: clamp(18px, 4.5vw, 30px);
  font-weight: 800;
}

.banner-where {
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: 600;
  color: #bae6fd;
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.4) rotate(-6deg);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.15) rotate(2deg);
  }
  18% {
    transform: translate(-50%, 0) scale(1) rotate(0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -20px) scale(1);
  }
}

.charge {
  position: fixed;
  left: 50%;
  bottom: 13%;
  width: 180px;
  height: 12px;
  margin-left: -90px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: rgba(11, 15, 20, 0.5);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.charge.show {
  opacity: 1;
}

#charge-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #facc15, #f97316, #ef4444);
}

.hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

.stick,
.yeet-btn,
.weapon-btn {
  display: none;
}

body.touch .stick {
  display: block;
  position: fixed;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
}

body.touch .stick.active {
  opacity: 1;
}

.knob {
  position: absolute;
  left: 35px;
  top: 35px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

body.touch .yeet-btn {
  display: block;
  position: fixed;
  right: 22px;
  bottom: 40px;
  width: 104px;
  height: 104px;
  border: 4px solid #7c2d12;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde047, #f97316);
  color: #431407;
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  touch-action: none;
}

body.touch .yeet-btn.down {
  transform: scale(0.92);
}

body.touch .weapon-btn {
  display: block;
  position: fixed;
  right: 34px;
  bottom: 158px;
  width: 80px;
  height: 42px;
  border: 3px solid #7c2d12;
  border-radius: 999px;
  background: #fde68a;
  color: #431407;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  touch-action: none;
  z-index: 3;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: rgba(11, 15, 20, 0.72);
}

.overlay.hidden {
  display: none;
}

.overlay h1,
.overlay h2 {
  margin: 0;
  font-size: clamp(44px, 13vw, 96px);
  font-weight: 900;
  font-style: italic;
  color: #facc15;
  -webkit-text-stroke: 3px #7c2d12;
  text-shadow: 0 6px 0 #000;
}

.overlay h2 {
  font-size: clamp(36px, 10vw, 72px);
}

.save-line,
.unlock {
  max-width: 38rem;
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.45;
  color: #e2e8f0;
}

.tagline {
  margin: 8px 0 16px;
  font-size: 17px;
  color: #bae6fd;
}

.how {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  line-height: 1.7;
  font-size: 15px;
}

.how b {
  color: #facc15;
}

.touch-only,
body.touch .desktop-only {
  display: none;
}

body.touch .touch-only {
  display: block;
}

#start,
#level-next {
  padding: 12px 28px;
  border: 3px solid #7c2d12;
  border-radius: 12px;
  background: #facc15;
  color: #431407;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.replay {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #bae6fd;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 720px) {
  .hud {
    max-width: calc(100% - 58px);
    font-size: 12px;
    gap: 4px 8px;
  }

  .buffs {
    bottom: 28px;
  }
}
