/* ── HUD bar — pixel art style ─────────────────────────── */

#layer-hud {
  padding: calc(0.5rem + env(safe-area-inset-top)) calc(0.625rem + env(safe-area-inset-right)) 0.5rem calc(0.625rem + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  pointer-events: none;
  font-family: var(--font-pixel);
}

#layer-hud > * { pointer-events: auto; }

/* ── Icon images (SVG from pixelarticons) ────────────── */

.hud-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

/* ── Bars container — both bars stacked, perfectly aligned ── */

#hud-bars {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

/* ── Health bar ──────────────────────────────────────── */

#hud-healthbar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
}

#hud-healthbar .hud-icon {
  filter: brightness(0) saturate(100%) invert(30%) sepia(100%) saturate(600%) hue-rotate(-10deg);
}

#hud-healthbar-track {
  flex: 1;
  height: 1rem;
  background: #1a1028;
  border: 2px solid var(--color-border);
  overflow: hidden;
}

#hud-healthbar-fill {
  height: 100%;
  width: 100%;
  background: var(--health-green);
  transition: width 0.2s linear, background-color 0.3s;
}

/* ── Progress bar ────────────────────────────────────── */

#hud-progress {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
}

#hud-progress .hud-icon {
  filter: brightness(0) saturate(100%) invert(55%) sepia(80%) saturate(500%) hue-rotate(200deg);
}

#hud-progress-track {
  flex: 1;
  height: 1rem;
  background: #1a1028;
  border: 2px solid var(--color-border);
  overflow: hidden;
}

#hud-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-btn-primary);
  transition: width 0.3s ease;
}

/* ── Stats row (score, coins, pause) ─────────────────── */

#hud-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ── Score ────────────────────────────────────────────── */

#hud-score {
  text-align: left;
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
  min-width: 5rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

#hud-multiplier {
  display: block;
  font-size: 0.9375rem;
  color: var(--color-fruit);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

/* ── Coins ───────────────────────────────────────────── */

#hud-coins {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  color: var(--color-coin);
  font-size: 1.125rem;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

#hud-coins .hud-icon {
  filter: brightness(0) saturate(100%) invert(75%) sepia(60%) saturate(500%) hue-rotate(10deg);
}

/* ── Pause button ────────────────────────────────────── */

#hud-pause {
  padding: 0.25rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-panel);
  border: 2px solid var(--color-border);
  cursor: pointer;
  touch-action: manipulation;
}
#hud-pause:active { background: var(--color-btn-secondary); }

#hud-pause .hud-icon {
  width: 1.625rem;
  height: 1.625rem;
}
