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

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

#app {
  height: 100%;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
  background: #0a1a0a;
}

#hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-shrink: 0;
}

.hp-block {
  flex: 1;
  min-width: 0;
}
.hp-block.right { text-align: right; }
.hp-block .label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #7cb86a;
  margin-bottom: 3px;
  font-weight: 700;
}
.hp-block.right .label { text-align: right; }
.bar {
  height: 10px;
  background: #1a2e1a;
  border: 1px solid #2d4a2d;
  border-radius: 2px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(1);
  transform-origin: left center;
  background: #5dbb2b;
  transition: transform 0.12s linear;
}
.hp-block.right .bar i {
  background: #c45c26;
  transform-origin: right center;
}

#score {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 18px;
  color: #f0d060;
  min-width: 48px;
  text-align: center;
}

#game {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: block;
  background: #163018;
  touch-action: none;
}

#banner {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 6, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  padding: 24px;
}
#banner.hidden { display: none; }
#banner-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #f0d060;
  text-align: center;
  text-shadow: 0 2px 0 #3a2a00;
  line-height: 1.35;
}
#btn-start {
  appearance: none;
  border: 2px solid #5dbb2b;
  background: #1a3a12;
  color: #d8f5d0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 14px 36px;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}
#btn-start:active { background: #2a5a1a; }

#controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0));
  gap: 16px;
  background: #0a1a0a;
}

#stick {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #142814;
  border: 2px solid #2d4a2d;
  position: relative;
  touch-action: none;
}
#knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #5dbb2b;
  border: 2px solid #8fd65a;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#btn-fire {
  appearance: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #c9a227;
  background: radial-gradient(circle at 35% 30%, #f0d060, #a67c00);
  color: #1a1200;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 0 #5a4200;
  touch-action: manipulation;
}
#btn-fire:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #5a4200;
}

@media (min-width: 600px) {
  #controls { display: none; }
  #app {
    max-width: 420px;
    border-left: 1px solid #1a2e1a;
    border-right: 1px solid #1a2e1a;
  }
}

