/* VibraTribe — Urban Tribe System */

#vibratribe-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0a12;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

#vibratribe-panel.active {
  display: flex;
}

/* Header */
.vt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(10,10,20,0.95);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.vt-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vt-logo {
  font-size: 22px;
}

.vt-title-block h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.3px;
}

.vt-title-block p {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

.vt-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.vt-close:hover { background: rgba(255,255,255,0.12); }

/* Live bar */
.vt-live-bar {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.vt-live-bar::-webkit-scrollbar { display: none; }

.vt-live-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}

.vt-live-stat .val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.vt-live-stat .lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.vt-live-stat .val.pulse {
  animation: vtPulseVal 1.5s ease-in-out infinite;
}

@keyframes vtPulseVal {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Tabs */
.vt-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.vt-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.vt-tab.active {
  color: #fff;
  border-bottom-color: #a78bfa;
}

/* Body */
.vt-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(167,139,250,0.3) transparent;
}

/* Sections */
.vt-section {
  display: none;
  padding: 16px;
  gap: 14px;
  flex-direction: column;
}
.vt-section.active { display: flex; }

/* My tribe banner */
.vt-my-tribe-banner {
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vt-my-tribe-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background: radial-gradient(circle at 80% 20%, #fff 0%, transparent 60%);
  pointer-events: none;
}

.vt-my-tribe-banner.no-tribe {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  align-items: center;
  text-align: center;
  padding: 28px 18px;
}

.vt-no-tribe-icon { font-size: 40px; margin-bottom: 6px; }
.vt-no-tribe-title { font-size: 15px; font-weight: 700; color: #fff; }
.vt-no-tribe-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; }

.vt-tribe-banner-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vt-tribe-banner-emoji { font-size: 36px; }

.vt-tribe-banner-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.vt-tribe-banner-info p {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin: 2px 0 0;
}

.vt-tribe-banner-badge {
  margin-left: auto;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* Tribe stats row */
.vt-tribe-stats-row {
  display: flex;
  gap: 8px;
}

.vt-tribe-stat {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.vt-tribe-stat .ts-val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.vt-tribe-stat .ts-lbl {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Progress bar */
.vt-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vt-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.55);
}

.vt-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  overflow: hidden;
}

.vt-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

/* Weekly challenge card */
.vt-challenge-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vt-challenge-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vt-challenge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.vt-challenge-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.vt-challenge-info p {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin: 2px 0 0;
}

.vt-challenge-reward {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.vt-challenge-reward .rew-vbc {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
}

.vt-challenge-reward .rew-time {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
}

/* All tribes grid */
.vt-tribes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vt-tribe-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vt-tribe-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

.vt-tribe-card.joined {
  border-color: rgba(167,139,250,0.5);
  box-shadow: 0 0 0 1px rgba(167,139,250,0.2);
}

.vt-tribe-card.joined::before {
  content: '✓ MIEMBRO';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8px;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.5px;
}

.vt-tribe-card-emoji { font-size: 28px; }

.vt-tribe-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.vt-tribe-card-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

.vt-tribe-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.vt-tribe-members {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

.vt-tribe-energy {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.vt-join-btn {
  margin-top: 6px;
  padding: 7px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

/* Leaderboard */
.vt-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vt-leader-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s;
}

.vt-leader-item:hover {
  background: rgba(255,255,255,0.05);
}

.vt-leader-item.top1 {
  background: rgba(251,191,36,0.07);
  border-color: rgba(251,191,36,0.25);
}
.vt-leader-item.top2 {
  background: rgba(148,163,184,0.06);
  border-color: rgba(148,163,184,0.2);
}
.vt-leader-item.top3 {
  background: rgba(180,100,60,0.06);
  border-color: rgba(180,100,60,0.2);
}

.vt-rank {
  font-size: 16px;
  font-weight: 900;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.vt-leader-emoji { font-size: 24px; flex-shrink: 0; }

.vt-leader-info {
  flex: 1;
}

.vt-leader-info .ln { font-size: 13px; font-weight: 700; color: #fff; }
.vt-leader-info .ls { font-size: 10px; color: rgba(255,255,255,0.4); }

.vt-leader-right {
  text-align: right;
}

.vt-leader-vbc {
  font-size: 14px;
  font-weight: 800;
  color: #fbbf24;
}

.vt-leader-members {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
}

.vt-leader-bar {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
  margin-left: auto;
}

.vt-leader-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* Activity feed */
.vt-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vt-activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid transparent;
  animation: vtSlideIn 0.4s ease;
}

@keyframes vtSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.vt-activity-icon { font-size: 18px; flex-shrink: 0; }

.vt-activity-text { flex: 1; }
.vt-activity-text .at { font-size: 11px; color: rgba(255,255,255,0.75); line-height: 1.4; }
.vt-activity-text .at strong { color: #fff; }
.vt-activity-time { font-size: 9px; color: rgba(255,255,255,0.3); margin-top: 2px; }

.vt-activity-vbc {
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  flex-shrink: 0;
}

/* NERHIA box */
.vt-nerhia-box {
  background: rgba(167,139,250,0.07);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.vt-nerhia-icon { font-size: 20px; flex-shrink: 0; }
.vt-nerhia-text { font-size: 11px; color: rgba(255,255,255,0.7); line-height: 1.5; }
.vt-nerhia-text strong { color: #a78bfa; }

/* Section title */
.vt-section-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Toast */
.vt-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,35,0.95);
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

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