/* ==============================
   VibraPassport — ADN Urbano
   El pasaporte ciudadano de VibraWorld
   Construido sobre VK tokens
   ============================== */

/* ── Panel ── */
#vibra-passport-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0a0f;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#vibra-passport-panel.vp-open {
  display: flex;
  flex-direction: column;
  animation: vpSlideUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes vpSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ── */
.vp-header {
  position: relative;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.vp-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.vp-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2) 0%,
    transparent 40%,
    rgba(10,10,15,0.95) 100%
  );
}

.vp-cover-map {
  width: 100%;
  height: 220px;
  background: radial-gradient(ellipse at 30% 60%, #1a0a3a 0%, #0a0a0f 70%);
  position: relative;
  overflow: hidden;
}

/* Animated city grid on cover */
.vp-city-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,92,246,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: vpGridPan 8s linear infinite;
}

@keyframes vpGridPan {
  from { transform: translate(0,0); }
  to   { transform: translate(40px,40px); }
}

.vp-city-dots {
  position: absolute;
  inset: 0;
}

.vp-city-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--vk-purple, #8b5cf6);
  animation: vpDotPulse 2s ease-in-out infinite;
}

.vp-city-dot.green  { background: var(--vk-green, #10b981); }
.vp-city-dot.cyan   { background: var(--vk-cyan, #06b6d4); }
.vp-city-dot.orange { background: #f59e0b; }

@keyframes vpDotPulse {
  0%,100% { opacity: 0.3; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.8); }
}

.vp-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: background 0.2s;
}
.vp-back-btn:hover { background: rgba(139,92,246,0.4); }

.vp-share-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: background 0.2s;
}
.vp-share-btn:hover { background: rgba(16,185,129,0.4); }

/* ── Identity card ── */
.vp-identity {
  position: relative;
  margin-top: -60px;
  padding: 0 20px 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  z-index: 2;
}

.vp-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.vp-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--vk-purple, #8b5cf6);
  object-fit: cover;
  background: #1a0a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}

.vp-avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #8b5cf6, #10b981, #06b6d4) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: vpRingRotate 4s linear infinite;
}

@keyframes vpRingRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.vp-level-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0a0a0f;
}

.vp-identity-info {
  flex: 1;
  padding-bottom: 4px;
}

.vp-username {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2px;
  letter-spacing: -0.5px;
}

.vp-handle {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 6px;
}

.vp-zone-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139,92,246,0.2);
  border: 1px solid rgba(139,92,246,0.4);
  color: #a78bfa;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}

/* ── DNA Score ring ── */
.vp-dna-section {
  padding: 0 20px 24px;
}

.vp-dna-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(6,182,212,0.1));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.vp-dna-ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 90px;
  height: 90px;
}

.vp-dna-svg {
  width: 90px;
  height: 90px;
  transform: rotate(-90deg);
}

.vp-dna-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 6;
}

.vp-dna-fill {
  fill: none;
  stroke: url(#vpDnaGradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.22,1,0.36,1);
}

.vp-dna-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vp-dna-score {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.vp-dna-label {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vp-dna-info { flex: 1; }
.vp-dna-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.vp-dna-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 12px;
  line-height: 1.4;
}

.vp-dna-bars { display: flex; flex-direction: column; gap: 6px; }
.vp-dna-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vp-dna-bar-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  width: 56px;
  flex-shrink: 0;
}
.vp-dna-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.vp-dna-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.22,1,0.36,1);
  width: 0;
}
.vp-dna-bar-fill.social   { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.vp-dna-bar-fill.urban    { background: linear-gradient(90deg, #10b981, #34d399); }
.vp-dna-bar-fill.explorer { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.vp-dna-bar-fill.creator  { background: linear-gradient(90deg, #f59e0b, #fcd34d); }

/* ── VBC Wallet ── */
.vp-wallet-section { padding: 0 20px 24px; }

.vp-wallet-card {
  background: linear-gradient(135deg, #1a0a3a, #0d1a2e);
  border: 1px solid rgba(139,92,246,0.4);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.vp-wallet-bg {
  position: absolute;
  right: -20px;
  top: -20px;
  font-size: 100px;
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
}

.vp-wallet-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 4px;
}

.vp-wallet-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 16px;
}

.vp-wallet-number {
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.vp-wallet-unit {
  font-size: 16px;
  font-weight: 700;
  color: #a78bfa;
}

.vp-wallet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.vp-wallet-stat {
  text-align: center;
}

.vp-wallet-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.vp-wallet-stat-key {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-top: 2px;
}

.vp-wallet-divider {
  width: 1px;
  background: rgba(255,255,255,0.1);
  height: 36px;
  margin: auto;
}

/* ── Stats grid ── */
.vp-stats-section { padding: 0 20px 24px; }

.vp-section-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
}

.vp-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vp-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.vp-stat-card:hover {
  border-color: rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.05);
}

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

.vp-stat-icon.purple { background: rgba(139,92,246,0.2); }
.vp-stat-icon.green  { background: rgba(16,185,129,0.2); }
.vp-stat-icon.cyan   { background: rgba(6,182,212,0.2); }
.vp-stat-icon.orange { background: rgba(245,158,11,0.2); }
.vp-stat-icon.red    { background: rgba(239,68,68,0.2); }
.vp-stat-icon.pink   { background: rgba(236,72,153,0.2); }

.vp-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1.1;
}

.vp-stat-key {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  display: block;
}

/* ── Urban Heatmap ── */
.vp-heatmap-section { padding: 0 20px 24px; }

.vp-heatmap-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px;
  overflow: hidden;
}

.vp-heatmap-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.vp-heatmap-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 0 0 16px;
}

.vp-activity-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 3px;
}

.vp-activity-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  transition: transform 0.15s;
  cursor: pointer;
}

.vp-activity-cell:hover { transform: scale(1.5); }
.vp-activity-cell.level-1 { background: rgba(139,92,246,0.25); }
.vp-activity-cell.level-2 { background: rgba(139,92,246,0.5); }
.vp-activity-cell.level-3 { background: rgba(139,92,246,0.75); }
.vp-activity-cell.level-4 { background: rgba(139,92,246,1); }

.vp-heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}

.vp-heatmap-legend span {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}

.vp-legend-cells {
  display: flex;
  gap: 3px;
}

.vp-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ── Zones visited ── */
.vp-zones-section { padding: 0 20px 24px; }

.vp-zones-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vp-zone-row {
  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: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.vp-zone-row:hover {
  border-color: rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.06);
}

.vp-zone-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(139,92,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.vp-zone-info { flex: 1; }

.vp-zone-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: block;
}

.vp-zone-visits {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  display: block;
}

.vp-zone-bar-wrap {
  width: 60px;
}

.vp-zone-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.vp-zone-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #10b981);
  border-radius: 2px;
  transition: width 1s ease;
  width: 0;
}

/* ── Missions / Achievements ── */
.vp-achievements-section { padding: 0 20px 24px; }

.vp-achievements-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.vp-achievements-scroll::-webkit-scrollbar { display: none; }

.vp-achievement {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vp-achievement-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
}

.vp-achievement-icon.gold   { background: linear-gradient(135deg, #f59e0b33, #fcd34d22); border: 1.5px solid #f59e0b66; }
.vp-achievement-icon.silver { background: linear-gradient(135deg, #9ca3af33, #e5e7eb22); border: 1.5px solid #9ca3af66; }
.vp-achievement-icon.purple { background: linear-gradient(135deg, #8b5cf633, #a78bfa22); border: 1.5px solid #8b5cf666; }
.vp-achievement-icon.locked { background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.1); filter: grayscale(1); opacity: 0.4; }

.vp-achievement-name {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  line-height: 1.3;
}

/* ── Tribe card ── */
.vp-tribe-section { padding: 0 20px 24px; }

.vp-tribe-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.vp-tribe-card:hover {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.06);
}

.vp-tribe-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(16,185,129,0.2));
  border: 1.5px solid rgba(139,92,246,0.4);
  flex-shrink: 0;
}

.vp-tribe-info { flex: 1; }

.vp-tribe-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: block;
  margin-bottom: 3px;
}

.vp-tribe-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-bottom: 8px;
}

.vp-tribe-rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Bottom padding ── */
.vp-bottom-pad { height: 80px; }
