/* ------------------------------------------------------------------
   HUD bar above the playfield
   ------------------------------------------------------------------ */

.hud {
  height: var(--hud-h);
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 14px;
  background: linear-gradient(#3a2670, #2a1a55);
  box-shadow: 0 0 0 3px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.15), 0 6px 0 #150b2e;
  font-family: var(--font-display);
  font-size: calc(var(--hud-h) * 0.36);
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hud.visible {
  opacity: 1;
  transform: none;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hud-right {
  justify-content: flex-end;
}

.hud-center {
  justify-content: center;
}

.hud img {
  display: block;
}

.hud-lives {
  display: flex;
  align-items: center;
  gap: 2px;
}

.hud-lives img {
  width: calc(var(--hud-h) * 0.7);
  height: calc(var(--hud-h) * 0.7);
}

.hud-stage {
  color: var(--yellow);
  white-space: nowrap;
}

.hud-time {
  min-width: 4.2em;
  text-align: center;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--ink);
  font-size: 1.15em;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

.hud-time.hurry {
  color: #ff6b7a;
  animation: hud-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes hud-pulse {
  to {
    transform: scale(1.12);
  }
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-stat {
  display: flex;
  align-items: center;
  gap: 1px;
}

.hud-stat img {
  width: calc(var(--hud-h) * 0.46);
  height: calc(var(--hud-h) * 0.46);
}

.hud-extra {
  width: calc(var(--hud-h) * 0.42);
  height: calc(var(--hud-h) * 0.42);
  opacity: 0.18;
  filter: grayscale(1);
  transition: opacity 0.2s, filter 0.2s, transform 0.2s;
}

.hud-extra.on {
  opacity: 1;
  filter: none;
  transform: scale(1.1);
}

.hud-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}

.hud-score small {
  font-size: 0.45em;
  color: var(--muted);
  letter-spacing: 2px;
}

.hud-score b {
  font-weight: normal;
  color: #fff;
}

.hud-score b.bump {
  animation: bump 0.25s ease;
}

@keyframes bump {
  50% {
    transform: scale(1.18);
    color: var(--yellow);
  }
}

/* Battle cards */
.hud-player {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pc) 35%, #1b1330);
  box-shadow: inset 0 0 0 2px var(--pc);
  transition: filter 0.3s, opacity 0.3s;
}

.hud-player.empty {
  display: none;
}

.hud-player.dead {
  filter: grayscale(1);
  opacity: 0.45;
}

.hud-player img {
  width: calc(var(--hud-h) * 0.72);
  height: calc(var(--hud-h) * 0.72);
}

.hud-player-info {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hud-player-name {
  font-size: 0.8em;
}

.hud-trophies {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}

.hud-trophies i,
.board-stars i {
  width: 11px;
  height: 11px;
  background: #1b1330;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.hud-trophies i.won,
.board-stars i.won {
  background: var(--yellow);
}

@media (max-width: 700px) {
  .hud {
    padding: 0 6px;
    gap: 4px;
  }
  .hud-group {
    gap: 6px;
  }
  .hud-stats,
  .hud-stage,
  .hud-score small {
    display: none;
  }
  .hud-player-name {
    display: none;
  }
  .hud-player {
    padding-right: 6px;
  }
}
