/* Spaceball HUD — matches reference scoreboard (Aetherion / Drakaris / Elyndra + timer) */
#spaceball-hud {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: none;
  display: none;
  width: min(620px, 96vw);
  font-family: "Rajdhani", "Orbitron", "Segoe UI", sans-serif;
  text-align: center;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}
#game.is-on #spaceball-hud.is-visible {
  display: block;
}

#spaceball-hud .sb-announce {
  margin: 0 auto 6px;
  padding: 5px 14px 6px;
  max-width: 92%;
  border-radius: 4px;
  border: 1px solid rgba(255, 200, 90, 0.45);
  background: linear-gradient(180deg, rgba(70, 50, 10, 0.92), rgba(20, 14, 4, 0.9));
  color: #ffe7a0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(255, 200, 80, 0.45);
  box-shadow: 0 0 12px rgba(255, 180, 40, 0.2);
}
#spaceball-hud.is-announce .sb-board {
  opacity: 0.55;
}
#spaceball-hud.is-announce .sb-timer {
  color: #ffe7a0;
  text-shadow: 0 0 10px rgba(255, 200, 80, 0.65);
}

/* ── Victory / reward modal ── */
#spaceball-reward-modal {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(8, 20, 40, 0.55) 0%, rgba(0, 0, 0, 0.72) 100%);
  font-family: "Rajdhani", "Orbitron", "Segoe UI", sans-serif;
}
#game.is-on #spaceball-reward-modal.is-open {
  display: flex;
  pointer-events: auto;
}
#spaceball-reward-modal .sbr-card {
  width: min(420px, 92vw);
  border-radius: 8px;
  border: 1px solid rgba(140, 200, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(28, 48, 78, 0.96), rgba(8, 14, 28, 0.97));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(80, 180, 255, 0.18);
  padding: 18px 20px 16px;
  text-align: center;
  animation: sbr-pop 0.28s ease-out;
}
@keyframes sbr-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
#spaceball-reward-modal .sbr-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #7ecbff;
  text-shadow: 0 0 8px rgba(80, 200, 255, 0.5);
  margin-bottom: 4px;
}
#spaceball-reward-modal .sbr-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f2f8ff;
  text-shadow: 0 0 14px rgba(120, 210, 255, 0.55);
}
#spaceball-reward-modal .sbr-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: #9eb6d4;
}
#spaceball-reward-modal .sbr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(110, 180, 255, 0.22);
  background: rgba(4, 10, 22, 0.72);
  text-align: left;
}
#spaceball-reward-modal .sbr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.3;
}
#spaceball-reward-modal .sbr-row .sbr-label {
  color: #8aa4c4;
  font-weight: 600;
}
#spaceball-reward-modal .sbr-row .sbr-val {
  color: #eaf8ff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(100, 200, 255, 0.25);
}
#spaceball-reward-modal .sbr-row.is-btc .sbr-val { color: #f5d060; }
#spaceball-reward-modal .sbr-row.is-plt .sbr-val { color: #7ecbff; }
#spaceball-reward-modal .sbr-row.is-key .sbr-val { color: #ff8a8a; }
#spaceball-reward-modal .sbr-row.is-ammo .sbr-val { color: #8dff9e; }
#spaceball-reward-modal .sbr-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 8px 22px;
  border-radius: 4px;
  border: 1px solid rgba(140, 200, 255, 0.55);
  background: linear-gradient(180deg, rgba(50, 90, 140, 0.95), rgba(20, 40, 70, 0.95));
  color: #eaf4ff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(80, 180, 255, 0.25);
}
#spaceball-reward-modal .sbr-close:hover {
  border-color: rgba(180, 230, 255, 0.8);
  background: linear-gradient(180deg, rgba(70, 120, 180, 0.98), rgba(30, 55, 95, 0.98));
}

#spaceball-hud .sb-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 4px;
  padding: 3px 18px 4px;
  min-width: 140px;
  border-radius: 4px;
  border: 1px solid rgba(120, 190, 255, 0.55);
  background:
    linear-gradient(180deg, rgba(40, 70, 110, 0.95), rgba(12, 22, 40, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(180, 220, 255, 0.12),
    0 0 12px rgba(80, 180, 255, 0.25);
}
#spaceball-hud .sb-title::before,
#spaceball-hud .sb-title::after {
  content: "";
  width: 14px;
  height: 10px;
  background: linear-gradient(90deg, transparent, #6ecbff, transparent);
  clip-path: polygon(0 50%, 40% 0, 100% 50%, 40% 100%);
  opacity: 0.9;
  filter: drop-shadow(0 0 4px #50d6ff);
}
#spaceball-hud .sb-title::after {
  transform: scaleX(-1);
}
#spaceball-hud .sb-title span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #f2f7ff;
  text-shadow: 0 0 8px rgba(140, 210, 255, 0.65);
}

#spaceball-hud .sb-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-radius: 6px;
  border: 1px solid rgba(140, 190, 230, 0.45);
  background:
    linear-gradient(180deg, rgba(28, 40, 58, 0.92), rgba(8, 14, 26, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 12px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

#spaceball-hud .sb-team {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px 10px;
  min-height: 54px;
  position: relative;
}
#spaceball-hud .sb-team + .sb-team {
  border-left: 1px solid rgba(120, 160, 200, 0.28);
}
#spaceball-hud .sb-team::before,
#spaceball-hud .sb-team::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(180, 210, 240, 0.15), rgba(90, 120, 160, 0.45), rgba(180, 210, 240, 0.15));
  opacity: 0.7;
}
#spaceball-hud .sb-team::before { left: 0; }
#spaceball-hud .sb-team::after { right: 0; }
#spaceball-hud .sb-team.vega::before,
#spaceball-hud .sb-team.solar::after {
  display: none;
}

#spaceball-hud .sb-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.65));
  flex: 0 0 auto;
}
#spaceball-hud .sb-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  min-width: 72px;
}
#spaceball-hud .sb-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#spaceball-hud .sb-score {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Aetherion fire / Drakaris ice / Elyndra venom */
#spaceball-hud .sb-team.vega { color: #ff7a1a; }
#spaceball-hud .sb-team.vega .sb-name,
#spaceball-hud .sb-team.vega .sb-score {
  color: #ffb06a;
  text-shadow: 0 0 10px rgba(255, 122, 26, 0.75);
}
#spaceball-hud .sb-team.orion { color: #3aa0ff; }
#spaceball-hud .sb-team.orion .sb-name,
#spaceball-hud .sb-team.orion .sb-score {
  color: #7ec4ff;
  text-shadow: 0 0 10px rgba(58, 160, 255, 0.7);
}
#spaceball-hud .sb-team.solar { color: #3dff8a; }
#spaceball-hud .sb-team.solar .sb-name,
#spaceball-hud .sb-team.solar .sb-score {
  color: #8dffb0;
  text-shadow: 0 0 10px rgba(61, 255, 138, 0.75);
}

#spaceball-hud .sb-timer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
#spaceball-hud .sb-timer-wrap::before,
#spaceball-hud .sb-timer-wrap::after {
  content: "";
  height: 1px;
  width: 52px;
  background: linear-gradient(90deg, transparent, rgba(140, 200, 255, 0.75));
  box-shadow: 0 0 6px rgba(100, 180, 255, 0.45);
  position: relative;
}
#spaceball-hud .sb-timer-wrap::after {
  background: linear-gradient(90deg, rgba(140, 200, 255, 0.75), transparent);
}
#spaceball-hud .sb-timer-wrap::before {
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
}
#spaceball-hud .sb-timer-wrap::after {
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 50%);
}
#spaceball-hud .sb-timer {
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #eaf4ff;
  text-shadow: 0 0 8px rgba(150, 210, 255, 0.55);
  min-width: 64px;
}

/* WarUniverse compact HUD score icons */
#spaceball-hud .spaceball-hud-scores span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px;
}
#spaceball-hud .spaceball-hud-scores .sb-mini {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}
