.topbar {
  gap: 18px;
}

.brand-kicker {
  color: rgba(150, 207, 221, 0.68);
  letter-spacing: 0.16em;
}

.topbar-actions {
  margin-left: auto;
}

.hud {
  position: relative;
  z-index: 8;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(111, 224, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(4, 14, 21, 0.96), rgba(3, 10, 16, 0.84)),
    radial-gradient(circle at 50% 0, rgba(102, 231, 255, 0.07), transparent 48%);
}

.hud-item {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 11px;
  overflow: hidden;
  border: 1px solid rgba(111, 224, 255, 0.11);
  border-radius: 12px;
  background: rgba(8, 24, 34, 0.56);
}

.hud-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(102, 231, 255, 0.52);
  opacity: 0.72;
}

.hud-item--center {
  text-align: center;
  border-color: rgba(102, 231, 255, 0.22);
  background: linear-gradient(180deg, rgba(12, 36, 48, 0.82), rgba(6, 20, 29, 0.72));
  box-shadow: inset 0 0 26px rgba(102, 231, 255, 0.035);
}

.hud-item--center::before {
  left: 50%;
  top: 0;
  bottom: auto;
  width: 46%;
  height: 2px;
  transform: translateX(-50%);
}

.hud-item--right {
  text-align: right;
}

.hud-item--right::before {
  left: auto;
  right: 0;
  background: rgba(255, 201, 103, 0.72);
}

.hud-label {
  color: #829aa8;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hud-item strong {
  color: #eafcff;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.05;
  letter-spacing: 0.025em;
}

.hud-item--core strong {
  color: #d9fbff;
}

.hud-item--coins strong {
  color: #ffe0a0;
}

.hud-item__signal {
  color: rgba(160, 190, 201, 0.62);
  font-size: 0.46rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-item--core[data-hud-state="damaged"] {
  border-color: rgba(255, 201, 103, 0.28);
}

.hud-item--core[data-hud-state="damaged"]::before {
  background: #ffc967;
}

.hud-item--core[data-hud-state="damaged"] strong {
  color: #ffe1a1;
}

.hud-item--core[data-hud-state="critical"],
.hud-item--core[data-hud-state="destroyed"] {
  border-color: rgba(255, 101, 133, 0.38);
  background: rgba(48, 13, 24, 0.48);
}

.hud-item--core[data-hud-state="critical"]::before,
.hud-item--core[data-hud-state="destroyed"]::before {
  background: #ff6585;
}

.hud-item--core[data-hud-state="critical"] strong,
.hud-item--core[data-hud-state="destroyed"] strong {
  color: #ffd2dc;
}

.environment-status {
  align-items: center;
  gap: 7px;
  color: rgba(142, 168, 180, 0.72);
}

.environment-status__item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid rgba(111, 224, 255, 0.08);
  border-radius: 8px;
  background: rgba(3, 12, 18, 0.34);
}

.environment-status__item strong {
  color: #c9e8ee;
}

.environment-status__item--deploy {
  border-color: rgba(255, 201, 103, 0.15);
  color: rgba(223, 191, 128, 0.72);
}

.environment-status__item--deploy strong {
  color: #ffe0a0;
}

.deploy-action {
  position: relative;
  overflow: hidden;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease, box-shadow 130ms ease, opacity 130ms ease;
}

.deploy-action[data-action-state="ready"] {
  border-color: rgba(255, 201, 103, 0.58);
  background: linear-gradient(180deg, rgba(148, 100, 30, 0.5), rgba(81, 51, 14, 0.48));
  box-shadow: inset 0 0 20px rgba(255, 201, 103, 0.06), 0 0 16px rgba(255, 201, 103, 0.08);
}

.deploy-action[data-action-state="insufficient"] {
  opacity: 1;
  border-color: rgba(255, 101, 133, 0.26);
  background: rgba(60, 22, 31, 0.52);
  color: #e7a8b5;
}

.deploy-action[data-action-state="insufficient"] span {
  color: #ff93a9;
}

.deploy-action[data-action-state="board-full"] {
  opacity: 1;
  border-color: rgba(143, 169, 255, 0.24);
  background: rgba(26, 31, 58, 0.5);
  color: #bdc9ef;
}

.deploy-action[data-action-state="locked"] {
  opacity: 0.38;
  filter: saturate(0.55);
}

.primary-action,
.pause-action {
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease, opacity 130ms ease, transform 100ms ease;
}

.primary-action:not(:disabled):active,
.deploy-action:not(:disabled):active,
.pause-action:not(:disabled):active {
  transform: translateY(1px) scale(0.992);
}

.primary-action:disabled,
.pause-action:disabled {
  opacity: 0.42;
  filter: saturate(0.62);
  cursor: default;
}

@media (max-width: 720px) {
  .topbar {
    min-height: 48px;
  }

  .brand-kicker {
    font-size: 0.48rem;
  }

  .hud {
    gap: 6px;
    padding: 7px 8px;
  }

  .hud-item {
    min-height: 48px;
    padding: 6px 7px;
    border-radius: 9px;
  }

  .hud-label {
    font-size: 0.44rem;
    letter-spacing: 0.1em;
  }

  .hud-item strong {
    font-size: clamp(0.86rem, 4vw, 1rem);
  }

  .hud-item__signal {
    display: none;
  }

  .environment-status {
    min-height: 0;
    justify-content: center;
    padding: 0;
  }

  .environment-status__item--placed,
  .environment-status__item--kills,
  .environment-status__item--leaks {
    display: none;
  }

  .environment-status__item--deploy {
    padding: 3px 8px;
    font-size: 0.5rem;
  }
}

@media (max-width: 370px) {
  .hud {
    grid-template-columns: 0.95fr 1.1fr 0.95fr;
  }

  .hud-item {
    padding-inline: 5px;
  }

  .hud-label {
    font-size: 0.4rem;
  }

  .hud-item strong {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deploy-action,
  .primary-action,
  .pause-action {
    transition: none;
  }
}
