:root {
  --bnb-bg: rgba(5, 6, 4, 0.82);
  --bnb-border: rgba(240, 185, 11, 0.26);
  --bnb-gold: #f0b90b;
  --bnb-gold-hi: #ffe16a;
  --bnb-green: #60d394;
  --bnb-cyan: #57d7ff;
  --bnb-text: #f7f1d3;
  --bnb-muted: #9d987c;
  --bnb-panel-radius: 8px;
}

.bnbcity-command-strip {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 142px;
  z-index: 55;
  display: grid;
  grid-template-columns: minmax(180px, 1.18fr) repeat(4, minmax(106px, .72fr));
  gap: 8px;
  max-width: 820px;
  padding: 8px;
  border: 1px solid rgba(240, 185, 11, 0.24);
  border-radius: var(--bnb-panel-radius);
  background:
    linear-gradient(90deg, rgba(240, 185, 11, 0.12), transparent 30%),
    rgba(5, 6, 4, 0.74);
  color: var(--bnb-text);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
  pointer-events: none;
  overflow: hidden;
}

.bnbcity-command-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,225,106,.18) 45%, transparent 62%);
  transform: translateX(-100%);
  animation: bnbcity-scan 4.8s cubic-bezier(.2,.8,.2,1) infinite;
}

.bnbcity-command-brand,
.bnbcity-command-stat {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
}

.bnbcity-command-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
}

.bnbcity-command-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.bnbcity-command-brand strong,
.bnbcity-command-brand span,
.bnbcity-command-stat span,
.bnbcity-command-stat b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-command-brand strong {
  font-size: 15px;
  line-height: 1;
}

.bnbcity-command-brand span,
.bnbcity-command-stat span {
  margin-top: 4px;
  color: var(--bnb-muted);
  font: 700 10px/1 Consolas, "IBM Plex Mono", monospace;
}

.bnbcity-command-stat {
  padding: 8px 9px;
}

.bnbcity-command-stat b {
  margin-top: 6px;
  color: var(--bnb-gold-hi);
  font: 800 13px/1 Consolas, "IBM Plex Mono", monospace;
}

.bnbcity-panel {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  width: min(356px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--bnb-border);
  border-radius: var(--bnb-panel-radius);
  background:
    linear-gradient(180deg, rgba(24, 24, 16, 0.88), var(--bnb-bg)),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(240,185,11,.03) 16px 17px);
  color: var(--bnb-text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  font-family: "Segoe UI", system-ui, sans-serif;
  max-height: calc(100vh - 28px);
  overflow: auto;
  user-select: none;
  transition: width 180ms ease-out, box-shadow 180ms ease-out, background 180ms ease-out, transform 180ms ease-out;
}

.bnbcity-panel.is-dragging {
  cursor: grabbing;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56), 0 0 0 1px rgba(240, 185, 11, 0.18);
}

.bnbcity-panel.is-collapsed {
  width: min(330px, calc(100vw - 28px));
  overflow: hidden;
}

.bnbcity-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  cursor: grab;
  touch-action: none;
}

.bnbcity-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.bnbcity-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 0 26px rgba(240, 185, 11, 0.16);
}

.bnbcity-brand strong,
.bnbcity-brand span {
  display: block;
}

.bnbcity-brand strong {
  font-size: 16px;
  line-height: 1;
}

.bnbcity-brand div {
  min-width: 0;
}

.bnbcity-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-brand span,
.bnbcity-grid span,
.bnbcity-actions span {
  color: var(--bnb-muted);
  font-family: Consolas, "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bnbcity-panel-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.bnbcity-panel-tools button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(240, 185, 11, 0.24);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--bnb-gold-hi);
  cursor: pointer;
  font: 800 16px/1 Consolas, monospace;
}

.bnbcity-panel-tools button:hover,
.bnbcity-panel-tools button:focus-visible {
  border-color: rgba(240, 185, 11, 0.54);
  background: rgba(240, 185, 11, 0.12);
  outline: 0;
}

.bnbcity-mini {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.bnbcity-mini span {
  overflow: hidden;
  border: 1px solid rgba(240, 185, 11, 0.16);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--bnb-gold-hi);
  font: 700 11px/1 Consolas, "IBM Plex Mono", monospace;
  padding: 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-panel-body {
  margin-top: 10px;
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.bnbcity-panel.is-collapsed .bnbcity-panel-body {
  display: none;
}

.bnbcity-panel.is-collapsed .bnbcity-mini {
  display: grid;
}

.bnbcity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bnbcity-grid div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.bnbcity-grid div:nth-child(7) {
  grid-column: 1 / -1;
  border-color: rgba(96, 211, 148, 0.2);
  background: linear-gradient(90deg, rgba(96, 211, 148, 0.08), rgba(0,0,0,.22));
}

.bnbcity-grid b {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--bnb-gold-hi);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-vault {
  margin-top: 10px;
  border: 1px solid rgba(96, 211, 148, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.bnbcity-districts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.bnbcity-districts div {
  min-width: 0;
  border: 1px solid rgba(87, 215, 255, 0.16);
  border-radius: 8px;
  padding: 8px;
  background: rgba(2, 12, 16, 0.26);
}

.bnbcity-districts b,
.bnbcity-districts span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-districts b {
  color: var(--bnb-cyan);
  font-size: 12px;
}

.bnbcity-districts span {
  margin-top: 4px;
  color: var(--bnb-muted);
  font: 700 10px/1.2 Consolas, "IBM Plex Mono", monospace;
}

.bnbcity-vault-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.bnbcity-vault-head span {
  color: var(--bnb-green);
  font-family: Consolas, "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bnbcity-vault-head b {
  color: var(--bnb-gold-hi);
  font-size: 13px;
}

.bnbcity-vault-bars {
  display: grid;
  gap: 7px;
}

.bnbcity-vault-bars label {
  display: grid;
  grid-template-columns: 72px 1fr 38px;
  gap: 8px;
  align-items: center;
}

.bnbcity-vault-bars span,
.bnbcity-vault-bars b {
  color: var(--bnb-muted);
  font-family: Consolas, "IBM Plex Mono", monospace;
  font-size: 10px;
}

.bnbcity-vault-bars b {
  color: var(--bnb-text);
  text-align: right;
}

.bnbcity-vault-bars i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bnb-gold) var(--w), rgba(255,255,255,.08) var(--w));
  box-shadow: 0 0 14px rgba(240, 185, 11, 0.16);
}

.bnbcity-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bnbcity-actions label {
  display: grid;
  gap: 5px;
}

.bnbcity-actions input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--bnb-text);
  padding: 9px 10px;
  outline: 0;
}

.bnbcity-actions input:focus {
  border-color: var(--bnb-gold);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.12);
}

.bnbcity-actions button {
  border: 1px solid rgba(240, 185, 11, 0.38);
  border-radius: 8px;
  background: rgba(240, 185, 11, 0.12);
  color: var(--bnb-gold-hi);
  padding: 10px 11px;
  font-weight: 800;
  cursor: pointer;
}

.bnbcity-actions button:first-child {
  background: var(--bnb-gold);
  color: #151004;
}

.bnbcity-actions button:last-child {
  border-color: rgba(96, 211, 148, 0.42);
  color: #d7ffe4;
}

.bnbcity-actions button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.bnbcity-actions button:active {
  transform: translateY(0);
}

.bnbcity-feed {
  display: grid;
  gap: 6px;
  max-height: 82px;
  overflow: auto;
  margin-top: 10px;
  color: var(--bnb-muted);
  font-family: Consolas, "IBM Plex Mono", monospace;
  font-size: 11px;
}

.bnbcity-feed div {
  border-left: 2px solid var(--bnb-gold);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
}

.bnbcity-feed .success {
  border-left-color: var(--bnb-green);
  color: #d7ffe4;
}

.bnbcity-feed .fail {
  border-left-color: #ff5d5d;
  color: #ffd4d4;
}

.hub-statusbar {
  background: rgba(5, 6, 4, 0.62) !important;
  border-color: rgba(240, 185, 11, 0.42) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
}

.hub-stat-label {
  color: rgba(240, 185, 11, 0.68) !important;
  font-family: Consolas, "IBM Plex Mono", monospace !important;
  letter-spacing: .04em !important;
}

.hub-stat-value,
.hub-stat-message {
  color: var(--bnb-text) !important;
}

.hub-topmenu .hub-btn,
.hub-btn,
.hub-btn-select {
  border-color: rgba(240, 185, 11, 0.26) !important;
  border-radius: 6px !important;
  background: rgba(5, 6, 4, 0.52) !important;
  color: var(--bnb-text) !important;
}

.hub-topmenu .hub-btn:hover,
.hub-btn:hover,
.hub-btn-select,
.hub-option-btn.selected {
  border-color: rgba(240, 185, 11, 0.58) !important;
  background: rgba(240, 185, 11, 0.16) !important;
  color: var(--bnb-gold-hi) !important;
}

.hub-toolinfo {
  color: var(--bnb-gold-hi) !important;
}

.bnbcity-build-console {
  border-color: rgba(240, 185, 11, 0.36) !important;
  border-radius: 14px 14px 0 0 !important;
  background:
    linear-gradient(180deg, rgba(18, 20, 12, 0.94), rgba(5, 6, 4, 0.92)) !important;
  box-shadow: 0 -10px 42px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06) !important;
  overflow: hidden;
}

.bnbcity-build-console::before {
  content: "BNB CITY BUILD TERMINAL";
  position: absolute;
  left: 18px;
  top: 8px;
  z-index: 3;
  color: rgba(240, 185, 11, .64);
  font: 800 12px/1 Consolas, "IBM Plex Mono", monospace;
  letter-spacing: .06em;
}

.bnbcity-build-tab {
  color: var(--bnb-gold-hi) !important;
  font-size: 16px !important;
  border: 1px solid rgba(240, 185, 11, 0.22);
  border-radius: 7px;
  background: rgba(240, 185, 11, 0.08);
}

.bnbcity-tool-button {
  border-color: rgba(240, 185, 11, 0.2) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.12));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
  transition: border-color 150ms ease, filter 150ms ease, transform 150ms ease;
}

.bnbcity-tool-button:hover {
  border-color: rgba(240, 185, 11, 0.58) !important;
  filter: brightness(1.18);
  transform: translateY(-1px);
}

.bnbcity-tool-info {
  justify-content: flex-start !important;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: 7px;
  background: rgba(0,0,0,.2);
  font-size: 13px !important;
  text-align: left;
}

.bnbcity-tool-name,
.bnbcity-tool-role,
.bnbcity-tool-price {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bnbcity-tool-name {
  max-width: 88px;
  color: var(--bnb-text);
}

.bnbcity-tool-role {
  max-width: 118px;
  color: var(--bnb-cyan);
  font: 800 11px/1 Consolas, "IBM Plex Mono", monospace;
}

.bnbcity-tool-price {
  color: var(--bnb-gold-hi);
  font: 900 12px/1 Consolas, "IBM Plex Mono", monospace;
}

@keyframes bnbcity-scan {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 760px) {
  .bnbcity-command-strip {
    left: 8px;
    right: 8px;
    bottom: 98px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
  .bnbcity-command-brand {
    grid-column: 1 / -1;
  }
  .bnbcity-panel {
    top: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    max-height: 64vh;
    overflow: auto;
  }
  .bnbcity-vault-bars label {
    grid-template-columns: 68px 1fr 34px;
  }
  .bnbcity-districts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bnbcity-panel,
  .bnbcity-panel-body,
  .bnbcity-command-strip::after {
    animation: none;
    transition: none;
  }
}
