.score-hud {
  position: absolute;
  z-index: 6;
  top: clamp(13px, 3.6dvh, 36px);
  right: max(var(--edge), env(safe-area-inset-right));
  display: grid;
  min-width: clamp(86px, 10.5vw, 149px);
  justify-items: center;
  gap: 6px;
  padding: 9px 15px 11px;
  border: 1px solid #a5ef6478;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 104%, #78ff5242, transparent 62%),
    linear-gradient(152deg, #4a7828ab, #0b210edd 57%, #071508ec);
  box-shadow: inset 0 1px 2px #d1ffa628, 0 3px 14px #040a06b3;
  pointer-events: none;
}

.score-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e0ffb9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .19em;
}

.score-label::before {
  width: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ceff80;
  box-shadow: 0 0 6px #9aff54;
  content: '';
}

.score-hud output {
  display: flex;
  align-items: center;
  min-height: .99em;
  color: #aeff58;
  font: 900 clamp(34px, 4.3vw, 61px) / 1 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.065em;
}

.score-digit {
  display: inline-block;
  padding: 0 .06em .03em;
  color: transparent;
  background: linear-gradient(180deg, #f7ffe4 11%, #c6ff91 27%, #79e734 47%, #39a721 64%, #86ed3a 89%);
  background-clip: text;
  -webkit-text-stroke: .55px #e5ffb4;
  filter: drop-shadow(0 2px 0 #2c5f12) drop-shadow(0 0 8px #9aff58a3);
}

.score-rise {
  position: absolute;
  z-index: -2;
  bottom: calc(100% - 10px);
  left: 50%;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.score-burst,
.score-gain,
.score-bit {
  position: absolute;
  top: 0;
  left: 0;
}

.score-gain {
  color: #e1ff9e;
  font: 900 clamp(20px, 2.9vw, 36px) / 1 var(--mono);
  letter-spacing: .05em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #182e0d, 0 0 8px #7eff44, 0 0 19px #adff638a;
  -webkit-text-stroke: 2px #17310e;
  paint-order: stroke fill;
}

.score-gain::before,
.score-gain::after {
  position: absolute;
  color: #acf86ca6;
  font-size: .28em;
  letter-spacing: .18em;
  -webkit-text-stroke: 0;
}

.score-gain::before { top: -.6em; left: -.94em; content: '01'; }
.score-gain::after { right: -1.13em; bottom: -.15em; content: '10'; }
.score-burst-strong .score-gain { color: #f3ffd1; text-shadow: 0 1px 0 #17350d, 0 0 9px #9aff59, 0 0 28px #caff63bb; }

.score-bit {
  color: #cdff81;
  font: 700 clamp(8px, 1vw, 12px) / 1 var(--mono);
  text-shadow: 0 0 3px #eaffad, 0 0 7px #81ff4c;
}

.score-bit:nth-of-type(3n) {
  border-radius: 1px;
  width: 3px;
  height: 3px;
  background: #d1ffa0;
  color: transparent;
  box-shadow: 0 0 5px #a1ff5d;
}

.score-impacts {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}

.score-impact {
  position: absolute;
  width: 22px;
  aspect-ratio: 1;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m16 1 1 10 7-4-4 7 11 2-11 2 4 7-7-4-1 10-2-10-6 4 4-7-11-2 11-2-4-7 6 4z' fill='%23b7ff68'/%3E%3Ccircle cx='16' cy='16' r='4' fill='%23f0ffdc'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 5px #a9ff5d);
  transform: translate(-50%, -50%);
}

.score-impact-strong { width: 29px; filter: drop-shadow(0 0 7px #dcff81); }
.score-impact-miss {
  width: 14px;
  border: 1px solid #b2ec7466;
  border-radius: 50%;
  background: radial-gradient(circle, #c3f29470 1px, transparent 2px);
  filter: none;
}

@media (max-width: 650px) and (orientation: portrait) {
  .score-hud {
    top: 13px;
    min-width: 74px;
    gap: 4px;
    padding: 7px 10px 8px;
    border-radius: 14px;
  }
  .score-label { font-size: 7px; }
  .score-rise { left: 84%; bottom: calc(100% - 4px); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .score-hud { top: 9px; gap: 3px; padding: 6px 11px 7px; }
  .score-hud output { font-size: clamp(28px, 8dvh, 39px); }
}
