.weapon-rack {
  position: absolute;
  z-index: 4;
  left: var(--rack-x, 39%);
  bottom: max(clamp(17px, 4dvh, 43px), env(safe-area-inset-bottom));
  width: var(--rack-width, 145px);
  container-type: inline-size;
  display: grid;
  gap: 6px;
  padding: 7px 8px 8px;
  border: 1px solid #96d66b67;
  border-radius: 12px;
  background: linear-gradient(155deg, #1e3821dd, #07150eea 69%);
  box-shadow: 0 4px 18px #030805ad, inset 0 1px 1px #bfff7b33;
  color: #d5ffb3;
}

.rack-label {
  margin: 0;
  text-align: center;
  font: 800 8px / 1.1 var(--mono);
  letter-spacing: .19em;
}

.weapon-options {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.weapon-option {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #75ad61;
  border-radius: 50%;
  color: #caff9b;
  background: radial-gradient(ellipse at 35% 15%, #c7ff9752, transparent 50%), #152b1b;
  box-shadow: inset 0 0 5px #9eff5a2e, 0 2px 4px #030b07;
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}

.weapon-option svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.weapon-option:hover,
.weapon-option[aria-pressed="true"] {
  color: #eeffd7;
  border-color: #c7ff80;
  background-color: #31552b;
  box-shadow: inset 0 0 6px #a7ff585e, 0 0 9px #a6ff565b;
}

.weapon-option[aria-pressed="true"]::after {
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d7ff9c;
  box-shadow: 0 0 4px #baff65;
  content: '';
}

.rack-stacked .weapon-rack {
  left: 50%;
  bottom: var(--dock-clearance, 82px);
  width: min(calc(100% - var(--edge) * 2), 340px);
  transform: translateX(-50%);
}

.rack-stacked :is(.dock-zoey, .score-rise) {
  bottom: calc(100% + var(--rack-height, 70px) + 6px);
}

@container (max-width: 120px) {
  .player-health { grid-template-columns: minmax(18px, 1fr) auto; gap: 4px; }
  .player-health-label { grid-column: 1 / -1; text-align: center; }
  .player-health-value { min-width: 0; font-size: 8px; }
}

@media (max-width: 650px) and (orientation: portrait) {
  .weapon-rack { gap: 5px; padding: 6px 8px 7px; }
  .weapon-option { width: 29px; height: 29px; }
  .rack-stacked .weapon-callout { bottom: calc(100% + var(--rack-height, 70px) + 82px); }
}
