:root {
  color-scheme: dark;
  --baseW:240px; /* updated at runtime */
}

html,
body {
  height: 100%;
  margin: 0;
  background: #0b1020;
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

#app {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(1200px 800px at 50% 40%, #121b33, #070a14 70%);
}

#hud {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.9);
  font-family: "Teko", system-ui, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 22px;
  line-height: 1.35;
  user-select: none;
  pointer-events: none;
  min-width: calc((var(--baseW) + 24px) * 0.78125);
  width: calc((var(--baseW) + 24px) * 0.78125);
}

.hudTitle {
  font-size: 18px;
}

.hudMuted {
  opacity: 0.75;
}

.hudSpacer {
  height: 8px;
}

.hudHint {
  margin-top: 6px;
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
}

.hudRow {
  margin-top: 10px;
}

/* split row: Ammo (left) + Fire mode (right) */
.hudRowSplit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.hudCol {
  flex: 1 1 0;
  min-width: 0;
}

.hudLabel {
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.hudValue {
  font-size: 16px;
}

.bar {
  position: relative;
  height: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.barFill {
  height: 100%;
  width: 0%;
  background: rgba(120, 255, 160, 0.85);
}

.barFillReload {
  background: rgba(255, 220, 140, 0.85);
}

.barFillRun {
  background: rgba(140, 170, 255, 0.85);
}

.barFillSlowmo {
  background: rgba(200, 160, 255, 0.85);
}

.barText {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hudModes {
  display: flex;
  gap: 6px;
}

.chip {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 20px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.chipActive {
  background: rgba(140, 170, 255, 0.22);
  border-color: rgba(140, 170, 255, 0.65);
  color: rgba(255, 255, 255, 0.95);
}
