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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070904;
  font-family: 'Special Elite', 'Courier New', monospace;
  color: #cfd4c0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game {
  position: fixed;
  inset: 0;
  touch-action: none;
  display: block;
  cursor: crosshair;
}

#hud {
  position: fixed;
  inset: 0;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
}

#hud.visible {
  opacity: 1;
}

#hearts {
  font-size: 26px;
  line-height: 1;
  color: #5a1620;
  letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(150, 30, 40, 0.6);
}

#hearts .full {
  color: #c1272d;
  text-shadow: 0 0 10px rgba(193, 39, 45, 0.9);
}

#powerups {
  margin-top: 8px;
  font-size: 18px;
  color: #3c4146;
  display: flex;
  gap: 8px;
}

#powerups .pup-icon {
  opacity: 0.25;
  transition: opacity 0.25s ease, text-shadow 0.25s ease;
}

#powerups .pup-icon.on {
  opacity: 1;
}

#powerups .pup-icon.on-shield {
  color: #4db8ff;
  text-shadow: 0 0 12px rgba(77, 184, 255, 0.9);
}

#powerups .pup-icon.on-speed {
  color: #ff9f2e;
  text-shadow: 0 0 12px rgba(255, 159, 46, 0.9);
}

#hud-center {
  text-align: center;
  min-width: 180px;
}

#wave-label {
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b98a4a;
  margin-bottom: 6px;
}

#enemies {
  font-size: 14px;
  color: #9aa08a;
  letter-spacing: 0.5px;
}

#enemies span {
  color: #e8dcc0;
  font-weight: 700;
}

#hud-right {
  text-align: right;
}

#ammo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 24px;
  color: #e8dcc0;
  line-height: 1;
  padding: 5px 11px 5px 9px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(200, 150, 70, 0.35);
  border-radius: 14px;
}

.bullet-ico {
  width: 9px;
  height: 17px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd76a, #b57b1e);
  box-shadow: 0 0 8px rgba(255, 215, 106, 0.7);
  transform: rotate(22deg);
}

#ammo-count {
  min-width: 22px;
  text-align: left;
}

#ammo-count.empty {
  color: #ff5a4a;
  animation: pulse 0.6s ease-in-out infinite;
}

#score {
  font-size: 26px;
  color: #e8dcc0;
  text-align: right;
  line-height: 1;
  margin-top: 6px;
}

#best {
  font-size: 13px;
  color: #8a8f7a;
  text-align: right;
  margin-top: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10, 12, 7, 0.35) 0%, rgba(5, 7, 3, 0.92) 100%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.screen.visible {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(160deg, rgba(22, 25, 17, 0.92), rgba(10, 12, 7, 0.94));
  border: 1px solid rgba(150, 80, 40, 0.35);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(0, 0, 0, 0.6);
  padding: 32px 28px;
  text-align: center;
  border-radius: 6px;
}

.title {
  font-family: 'Creepster', 'Special Elite', cursive;
  font-size: 54px;
  letter-spacing: 3px;
  color: #d8d2b8;
  text-shadow: 0 0 18px rgba(193, 39, 45, 0.55), 3px 3px 0 #1a0406;
  line-height: 1;
}

.title span {
  color: #c1272d;
  text-shadow: 0 0 22px rgba(193, 39, 45, 0.9), 3px 3px 0 #1a0406;
}

.tagline {
  margin-top: 10px;
  font-size: 15px;
  color: #a8ad96;
  letter-spacing: 1px;
}

.controls {
  list-style: none;
  margin: 22px 0 24px;
  font-size: 14px;
  color: #9aa08a;
  text-align: left;
  padding: 0 14px;
}

.controls li {
  padding: 5px 0;
  border-bottom: 1px dashed rgba(150, 120, 70, 0.2);
}

.controls b {
  color: #d8d2b8;
}

.btn {
  font-family: 'Special Elite', monospace;
  font-size: 18px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #141007;
  background: linear-gradient(180deg, #c9a15a, #8a5a1e);
  border: 1px solid #e8c78a;
  padding: 13px 34px;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 120, 40, 0.35);
}

.btn:active {
  transform: translateY(1px);
}

.bestline {
  margin-top: 16px;
  font-size: 13px;
  color: #7d826c;
}

.cleared {
  font-family: 'Creepster', cursive;
  font-size: 40px;
  letter-spacing: 2px;
  color: #cfe8c0;
  text-shadow: 0 0 18px rgba(90, 200, 90, 0.4);
}

.bonus {
  margin: 10px 0 22px;
  font-size: 16px;
  color: #ffd27a;
}

.autohint {
  margin-top: 14px;
  font-size: 13px;
  color: #7d826c;
}

.die {
  font-family: 'Creepster', cursive;
  font-size: 52px;
  letter-spacing: 3px;
  color: #c1272d;
  text-shadow: 0 0 22px rgba(193, 39, 45, 0.8);
}

.reached {
  margin-top: 10px;
  font-size: 15px;
  color: #a8ad96;
}

.reached b {
  color: #d8d2b8;
}

.go-score {
  margin-top: 14px;
  font-size: 30px;
  color: #e8dcc0;
}

.go-best {
  margin-top: 4px;
  font-size: 14px;
  color: #8a8f7a;
}

.newbest {
  margin-top: 10px;
  font-size: 15px;
  color: #ffd27a;
  text-shadow: 0 0 12px rgba(255, 180, 60, 0.6);
  display: none;
  letter-spacing: 1px;
}

.newbest.show {
  display: block;
  animation: pulse 1s ease-in-out infinite;
}

#btn-shoot {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 2px solid rgba(255, 190, 130, 0.8);
  background: radial-gradient(circle at 32% 28%, #d9553f, #8a1c22 72%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.65), 0 0 18px rgba(200, 60, 40, 0.4), inset 0 -4px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
  z-index: 8;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#btn-shoot svg {
  width: 42px;
  height: 42px;
  stroke: #ffe6c8;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 200, 140, 0.7));
  pointer-events: none;
}

#btn-shoot:active {
  transform: scale(0.9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 120, 70, 0.7), inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

@media (pointer: coarse) {
  #btn-shoot {
    display: flex;
  }
}

#touch-hint {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(220, 220, 200, 0.6);
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(150, 120, 70, 0.3);
  z-index: 6;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}

#touch-hint.show {
  opacity: 1;
}

#credit {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: auto;
}

#credit a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 7px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(28, 18, 38, 0.85), rgba(18, 13, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eaeaf2;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.6px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#credit a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 120, 190, 0.55);
  box-shadow: 0 5px 20px rgba(221, 42, 123, 0.4);
}

#credit a:focus-visible {
  outline: 2px solid #dd2a7b;
  outline-offset: 2px;
}

#credit .ig-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

#credit .madeby {
  color: rgba(234, 234, 242, 0.62);
}

#credit .handle {
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #f58529, #dd2a7b 50%, #8134af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 520px) {
  .title { font-size: 40px; }
  .die { font-size: 40px; }
  .panel { padding: 26px 20px; }
  #credit a { padding: 6px 14px 6px 10px; }
  #credit .madeby { display: none; }
  #btn-shoot { right: 16px; bottom: 18px; width: 66px; height: 66px; }
}
