#app > .apex-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  height: 78px;
  padding: 9px clamp(14px, 2vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: visible;
  border-bottom: 1px solid #33404a;
  background:
    linear-gradient(90deg, #070a0df7, #0c1115f5 55%, #070a0df8),
    repeating-linear-gradient(110deg, transparent 0 42px, #fff 43px 44px);
  box-shadow: 0 13px 40px #0009, inset 0 -1px #ec3a2c22;
  backdrop-filter: blur(18px) saturate(1.3);
}

#app > .apex-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent 1%, #ef3c2c 17%, #ff9a31 31%, transparent 58%);
  opacity: .75;
  pointer-events: none;
}

.apex-brand {
  min-width: 245px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.apex-brand-mark {
  position: relative;
  width: 176px;
  height: 50px;
  display: grid;
  place-items: center;
}

.apex-brand-mark::before {
  content: "";
  position: absolute;
  inset: 7px 2px;
  border-radius: 50%;
  background: #ec3528;
  filter: blur(20px);
  opacity: .2;
  animation: topbarBrandGlow 3.2s ease-in-out infinite alternate;
}

#app > .apex-topbar .apex-brand-mark img {
  position: relative;
  width: 100%;
  max-height: 50px;
  filter: drop-shadow(0 6px 9px #000) drop-shadow(0 0 8px #e83a282d);
}

.apex-brand-copy {
  padding-left: 12px;
  display: grid;
  gap: 2px;
  border-left: 1px solid #39434a;
  white-space: nowrap;
}

.apex-brand-copy b {
  font-size: 12px;
  font-style: italic;
  letter-spacing: .16em;
}

.apex-brand-copy small {
  color: #75818a;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .13em;
}

#app > .apex-topbar .resources {
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
}

.resource-card {
  position: relative;
  min-width: 118px;
  height: 52px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  border: 1px solid #303a42;
  border-radius: 13px;
  background: linear-gradient(135deg, #151c21e8, #090d10e8);
  box-shadow: inset 0 1px #ffffff0a, 0 8px 18px #0005;
}

.resource-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -70% 25%;
  height: 54px;
  border-radius: 50%;
  background: var(--resource-glow, #fff);
  filter: blur(22px);
  opacity: .16;
}

.resource-card > i {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 9px;
  background: #080c0f99;
  color: var(--resource-color);
  font-size: 15px;
  font-style: normal;
  box-shadow: 0 0 14px color-mix(in srgb, var(--resource-color) 28%, transparent);
}

.resource-card > span {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  line-height: 1.05;
}

.resource-card small {
  margin-bottom: 4px;
  color: #6f7b84;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .15em;
}

.resource-card b {
  color: #f5f7f8;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.cash-card { --resource-color: #ff9a38; --resource-glow: #ff7c25; }
.credit-card { --resource-color: #51b8ff; --resource-glow: #278cff; }
.energy-card { --resource-color: #ffd84b; --resource-glow: #ffe337; min-width: 104px; }

.topup-quick {
  position: relative;
  min-width: 142px;
  height: 52px;
  padding: 4px 13px 4px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border: 1px solid #378bd5aa;
  border-radius: 13px;
  background: linear-gradient(120deg, #0a263b, #10274a 48%, #341513);
  box-shadow: inset 0 1px #ffffff19, 0 0 24px #237bd329;
  text-align: left;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}

.topup-quick::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 130%;
  left: -50px;
  top: -15%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, #fff7, transparent);
  animation: topbarShine 4.5s ease-in-out infinite;
}

.topup-quick:hover {
  transform: translateY(-2px);
  border-color: #69c9ff;
  box-shadow: inset 0 1px #ffffff22, 0 8px 28px #218ee54d;
}

.topup-quick img {
  position: relative;
  z-index: 1;
  width: 47px !important;
  height: 47px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px #1ca5ff88);
  animation: topbarCrystal 2.4s ease-in-out infinite alternate;
}

.topup-quick span {
  position: relative;
  z-index: 1;
  display: grid;
  line-height: 1.08;
}

.topup-quick small {
  color: #86cfff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .12em;
}

.topup-quick b { margin-top: 3px; font-size: 11px; letter-spacing: .08em; }

#app > .apex-topbar .notification-bell {
  order: -1;
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(145deg, #171e23, #0a0e11);
  box-shadow: inset 0 1px #ffffff0b, 0 8px 18px #0005;
}

@keyframes topbarBrandGlow { to { opacity: .38; transform: scale(1.08); } }
@keyframes topbarCrystal { to { transform: translateY(-2px) rotate(2deg); filter: drop-shadow(0 0 13px #2eb6ffbb); } }
@keyframes topbarShine { 0%, 70% { left: -50px; } 90%, 100% { left: 125%; } }

@media (max-width: 900px) {
  #app > .apex-topbar { gap: 10px; }
  .apex-brand { min-width: auto; }
  .apex-brand-copy { display: none; }
  .apex-brand-mark { width: 142px; }
  .resource-card { min-width: 92px; padding: 7px 9px; }
  .resource-card > i { display: none; }
  .topup-quick { min-width: 52px; width: 52px; padding: 2px; justify-content: center; }
  .topup-quick span { display: none; }
}

@media (max-width: 620px) {
  #app > .apex-topbar {
    height: 70px;
    padding: 8px 9px;
    gap: 5px;
  }
  .apex-brand-mark { width: 112px; height: 44px; }
  #app > .apex-topbar .resources { gap: 4px; flex: 1; }
  .resource-card { min-width: 0; height: 46px; flex: 1 1 0; padding: 6px 5px; justify-content: center; border-radius: 11px; }
  .resource-card > i { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 7px; font-size: 12px; }
  .resource-card small { display: none; }
  .resource-card b { font-size: 12px; }
  .energy-card { min-width: 43px; max-width: 58px; }
  .topup-quick { min-width: 45px; width: 45px; height: 46px; border-radius: 11px; }
  .topup-quick img { width: 43px !important; height: 43px; }
  #app > .apex-topbar .notification-bell { width: 45px; min-width: 45px; height: 46px; min-height: 46px; border-radius: 11px; }
}

@media (max-width: 520px) {
  .apex-brand-mark { width: 76px; }
  .topup-quick { display: none; }
}

@media (max-width: 410px) {
  .apex-brand-mark { width: 62px; }
  #app > .apex-topbar .resources { gap: 3px; }
  .resource-card { display: flex; min-width: 0; padding: 4px 3px; gap: 3px; }
  .resource-card > i { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border-radius: 7px; font-size: 11px; }
  .resource-card b { font-size: 10px; }
  .credit-card { display: flex; }
  .topup-quick { display: none; }
  #app > .apex-topbar .notification-bell { width: 39px; min-width: 39px; }
}

@media (prefers-reduced-motion: reduce) {
  .apex-brand-mark::before,
  .topup-quick::after,
  .topup-quick img { animation: none !important; }
}
