:root { --bob-bar-h: 48px; }

#bob-balance-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  min-height: var(--bob-bar-h);
  background: #000;
  border-bottom: 3px solid #ffd700;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

#bob-balance-bar .bob-balances {
  flex: 0 1 auto;
  white-space: nowrap;
  color: #fff;
}

#bob-balance-bar .bob-real-label { color: #ffd700; }
#bob-balance-bar .bob-play-label { color: #00d4ff; }

#bob-balance-bar .bob-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  flex: 0 1 auto;
}

#bob-balance-bar .bob-nav a {
  color: #fff !important;
  margin: 0;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

#bob-balance-bar .bob-nav a:hover { color: #ffd700 !important; }

#bob-balance-bar .bob-nav a.bob-active,
#bob-balance-bar .bob-nav a[aria-current="page"] {
  color: #ffd700 !important;
}

body {
  padding-top: var(--bob-bar-h) !important;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  #bob-balance-bar {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
  /* Keep the nav on one swipeable row so the bar stays two lines tall. */
  #bob-balance-bar .bob-nav {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #bob-balance-bar .bob-nav::-webkit-scrollbar { display: none; }
}


#bob-balance-bar .bob-topup-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  vertical-align: middle;
}

#bob-balance-bar .bob-topup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 3px 10px;
  border: 1px solid #ffd700;
  border-radius: 999px;
  background: linear-gradient(#2a2200, #1a1400);
  color: #ffd700;
  font: 600 0.78rem "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

#bob-balance-bar .bob-topup:hover:not(:disabled) {
  background: #ffd700;
  color: #111;
}

#bob-balance-bar .bob-topup:focus-visible {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

#bob-balance-bar .bob-topup:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #1a1a1a;
  color: #888;
  border-color: #555;
}

#bob-balance-bar .bob-topup-short { display: none; }

/* Native title is unreliable on disabled buttons; show a CSS tip on the wrap. */
#bob-balance-bar .bob-topup-wrap[data-tip]:hover::after,
#bob-balance-bar .bob-topup-wrap[data-tip]:focus-within::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10060;
  width: max-content;
  max-width: min(240px, 80vw);
  padding: 6px 10px;
  background: #111;
  color: #fff;
  border: 1px solid #ffd700;
  border-radius: 6px;
  font: 600 0.75rem "Segoe UI", Arial, sans-serif;
  line-height: 1.3;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  pointer-events: none;
}

#bob-toast {
  position: fixed;
  top: calc(var(--bob-bar-h, 48px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 10060;
  background: #111;
  color: #fff;
  border: 1px solid #ffd700;
  border-radius: 8px;
  padding: 8px 16px;
  font: 600 0.9rem "Segoe UI", Arial, sans-serif;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

#bob-toast.bob-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  #bob-balance-bar .bob-topup {
    margin-left: 0;
    padding: 2px 8px;
    font-size: 0.75rem;
  }
  #bob-balance-bar .bob-topup-wrap { margin-left: 8px; }
  #bob-balance-bar .bob-topup-full { display: none; }
  #bob-balance-bar .bob-topup-short { display: inline; }
  #bob-toast { font-size: 0.82rem; padding: 7px 12px; }
}
