/* VibraReferral — Urban Growth Engine v1.0 */

/* ─── Panel ─── */
#vibra-referral-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #06040f;
  flex-direction: column;
  overflow: hidden;
}
#vibra-referral-panel.vr-open {
  display: flex;
}

/* Header */
.vr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  padding-top: calc(1rem + env(safe-area-inset-top));
  border-bottom: 1px solid rgba(138,87,255,.18);
  background: rgba(9,6,22,.95);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.vr-header-left {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.vr-title {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 900;
  background: linear-gradient(135deg, #8a57ff, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.02em;
}
.vr-subtitle {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(138,87,255,.7);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.vr-close {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(240,235,255,.8);
  font-size: 1.1rem;
  transition: background .2s;
}
.vr-close:hover { background: rgba(255,255,255,.12); }

/* ─── Hero VBC Card ─── */
.vr-hero {
  margin: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(138,87,255,.15), rgba(0,229,255,.08));
  border: 1px solid rgba(138,87,255,.3);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.vr-hero-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}
.vr-hero-info {
  flex: 1;
}
.vr-hero-label {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(138,87,255,.7);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .25rem;
}
.vr-hero-amount {
  font-family: var(--sans);
  font-size: 1.8rem;
  font-weight: 900;
  color: #8a57ff;
  line-height: 1;
}
.vr-hero-sub {
  font-family: var(--mono);
  font-size: .6rem;
  color: rgba(240,235,255,.5);
  margin-top: .2rem;
}
.vr-hero-vc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  background: rgba(0,0,0,.3);
  border-radius: 12px;
  padding: .75rem .9rem;
  border: 1px solid rgba(138,87,255,.2);
}
.vr-hero-vc-val {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 900;
  color: #00e5ff;
  line-height: 1;
}
.vr-hero-vc-lbl {
  font-family: var(--mono);
  font-size: .5rem;
  color: rgba(0,229,255,.6);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Viral Coefficient */
.vr-vc-badge {
  margin: 0 1.25rem .75rem;
  background: rgba(0,229,255,.05);
  border: 1px solid rgba(0,229,255,.2);
  border-radius: 10px;
  padding: .5rem .85rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.vr-vc-k {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(0,229,255,.7);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.vr-vc-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  overflow: hidden;
}
.vr-vc-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a57ff, #00e5ff);
  transition: width .8s cubic-bezier(.2,0,.1,1);
}
.vr-vc-val {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 700;
  color: #00e5ff;
}
.vr-vc-status {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(0,229,255,.6);
}

/* ─── Tabs ─── */
.vr-tabs {
  display: flex;
  gap: .5rem;
  padding: 0 1.25rem .75rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.vr-tabs::-webkit-scrollbar { display: none; }
.vr-tab {
  white-space: nowrap;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: .35rem .85rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: rgba(240,235,255,.5);
  cursor: pointer;
  letter-spacing: .06em;
  transition: all .2s;
}
.vr-tab.active {
  background: rgba(138,87,255,.2);
  border-color: rgba(138,87,255,.5);
  color: #8a57ff;
}

/* ─── Scroll body ─── */
.vr-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25rem 6rem;
  scrollbar-width: none;
}
.vr-body::-webkit-scrollbar { display: none; }

/* ─── Tab Sections ─── */
.vr-section {
  display: none;
}
.vr-section.active {
  display: block;
}

/* ─── SHARE SECTION ─── */
.vr-share-card {
  background: rgba(138,87,255,.08);
  border: 1px solid rgba(138,87,255,.25);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.vr-share-label {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(138,87,255,.7);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .5rem;
}
.vr-share-link-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.vr-share-link {
  flex: 1;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(138,87,255,.2);
  border-radius: 8px;
  padding: .6rem .75rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: rgba(240,235,255,.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vr-copy-btn {
  background: rgba(138,87,255,.25);
  border: 1px solid rgba(138,87,255,.4);
  border-radius: 8px;
  padding: .6rem .9rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: #8a57ff;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.vr-copy-btn:hover { background: rgba(138,87,255,.4); }
.vr-copy-btn.copied {
  background: rgba(0,230,118,.15);
  border-color: rgba(0,230,118,.4);
  color: #00e676;
}

.vr-share-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: .75rem;
}
.vr-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: .65rem .4rem;
  cursor: pointer;
  color: rgba(240,235,255,.7);
  font-family: var(--mono);
  font-size: .5rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: all .2s;
}
.vr-share-btn:hover { background: rgba(255,255,255,.08); }
.vr-share-btn span:first-child { font-size: 1.4rem; }

/* QR Placeholder */
.vr-qr-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: .85rem;
  margin-top: .75rem;
}
.vr-qr-box {
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 2rem;
}
.vr-qr-info {
  flex: 1;
}
.vr-qr-title {
  font-family: var(--mono);
  font-size: .62rem;
  color: rgba(240,235,255,.8);
  margin-bottom: .2rem;
}
.vr-qr-sub {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(240,235,255,.4);
  line-height: 1.5;
}

/* ─── CREW LIST ─── */
.vr-section-title {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(138,87,255,.7);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 1rem 0 .5rem;
}
.vr-crew-empty {
  background: rgba(255,255,255,.02);
  border: 1px dashed rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: rgba(240,235,255,.3);
  font-family: var(--mono);
  font-size: .7rem;
  line-height: 1.8;
}
.vr-crew-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  transition: background .2s;
}
.vr-crew-item:hover { background: rgba(255,255,255,.06); }
.vr-crew-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a57ff44, #00e5ff33);
  border: 1.5px solid rgba(138,87,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.vr-crew-info {
  flex: 1;
  min-width: 0;
}
.vr-crew-name {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  color: rgba(240,235,255,.9);
  truncate;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vr-crew-meta {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(240,235,255,.4);
  margin-top: .1rem;
}
.vr-crew-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
}
.vr-crew-signals {
  font-family: var(--mono);
  font-size: .65rem;
  color: rgba(0,229,255,.7);
}
.vr-crew-status {
  font-size: .7rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.vr-crew-status.active {
  background: rgba(0,230,118,.12);
  color: #00e676;
}
.vr-crew-status.pending {
  background: rgba(255,196,0,.1);
  color: #ffc400;
}
.vr-crew-status.ghost {
  background: rgba(255,255,255,.06);
  color: rgba(240,235,255,.3);
}

/* ─── REWARDS MILESTONES ─── */
.vr-milestone {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: .85rem 1rem;
  margin-bottom: .5rem;
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.vr-milestone.done {
  background: rgba(0,230,118,.05);
  border-color: rgba(0,230,118,.2);
}
.vr-milestone.locked {
  opacity: .5;
}
.vr-milestone-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.vr-milestone-info {
  flex: 1;
  min-width: 0;
}
.vr-milestone-title {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  color: rgba(240,235,255,.9);
  margin-bottom: .2rem;
}
.vr-milestone-desc {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(240,235,255,.4);
  line-height: 1.5;
}
.vr-milestone-progress {
  height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  margin-top: .35rem;
  overflow: hidden;
}
.vr-milestone-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a57ff, #00e5ff);
  transition: width .8s;
}
.vr-milestone-reward {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  flex-shrink: 0;
}
.vr-milestone-vbc {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 800;
  color: #8a57ff;
}
.vr-milestone-vbc-lbl {
  font-family: var(--mono);
  font-size: .48rem;
  color: rgba(138,87,255,.5);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.vr-milestone-done-check {
  font-size: 1.2rem;
  color: #00e676;
}

/* ─── LEADERBOARD ─── */
.vr-lb-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.vr-lb-rank {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 900;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(240,235,255,.3);
}
.vr-lb-rank.gold { color: #ffc400; }
.vr-lb-rank.silver { color: #b0b8c1; }
.vr-lb-rank.bronze { color: #cd7f32; }
.vr-lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a57ff33, #00e5ff22);
  border: 1px solid rgba(138,87,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.vr-lb-info {
  flex: 1;
  min-width: 0;
}
.vr-lb-name {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 700;
  color: rgba(240,235,255,.85);
}
.vr-lb-zone {
  font-family: var(--mono);
  font-size: .55rem;
  color: rgba(240,235,255,.4);
}
.vr-lb-score {
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 800;
  color: #8a57ff;
  flex-shrink: 0;
}
.vr-lb-you {
  background: rgba(138,87,255,.1);
  border-radius: 6px;
  padding: 0 .4rem;
}

/* ─── NERHIA Boost Alert ─── */
.vr-nerhia-boost {
  background: linear-gradient(135deg, rgba(0,229,255,.08), rgba(138,87,255,.08));
  border: 1px solid rgba(0,229,255,.25);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.vr-boost-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.vr-boost-info {
  flex: 1;
}
.vr-boost-title {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 700;
  color: #00e5ff;
  margin-bottom: .25rem;
}
.vr-boost-desc {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(240,235,255,.55);
  line-height: 1.6;
}

/* ─── Stats Bar ─── */
.vr-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.vr-stat-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: .75rem .5rem;
  text-align: center;
}
.vr-stat-val {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 900;
  color: #8a57ff;
  line-height: 1;
}
.vr-stat-lbl {
  font-family: var(--mono);
  font-size: .5rem;
  color: rgba(240,235,255,.4);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: .25rem;
}

/* ─── Zone Impact ─── */
.vr-zone-impact {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .75rem;
}
.vr-zone-impact-title {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(240,235,255,.5);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.vr-zone-bar-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .4rem;
}
.vr-zone-name {
  font-family: var(--mono);
  font-size: .6rem;
  color: rgba(240,235,255,.6);
  width: 80px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vr-zone-fill-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  overflow: hidden;
}
.vr-zone-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a57ff, #00e5ff);
}
.vr-zone-count {
  font-family: var(--mono);
  font-size: .58rem;
  color: rgba(138,87,255,.7);
  width: 24px;
  text-align: right;
}

/* Toast feedback */
.vr-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(138,87,255,.9);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .05em;
  pointer-events: none;
  opacity: 0;
  transition: all .3s;
  z-index: 3000;
  white-space: nowrap;
}
.vr-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
