* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --card: #141414;
  --card-hover: #1c1c1c;
  --yellow: #f5c518;
  --yellow-dark: #d4a017;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --border: #2a2a2a;
  --blue: #3b82f6;
  --green: #22c55e;
  --wa: #25d366;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ========== LOADING ========== */
#loading {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #111 0%, #0a0a0a 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo .logo-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 30px rgba(245, 197, 24, 0.5), 0 0 60px rgba(245, 197, 24, 0.2);
  animation: logoPulse 2s ease-in-out infinite;
  z-index: 2;
  position: relative;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--yellow);
  border-right-color: rgba(245, 197, 24, 0.3);
  animation: spin 1.5s linear infinite;
}

.logo-ring.ring2 {
  inset: -10px;
  border-top-color: transparent;
  border-bottom-color: var(--yellow);
  border-left-color: rgba(245, 197, 24, 0.2);
  animation: spin 2.2s linear infinite reverse;
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(245, 197, 24, 0.5), 0 0 60px rgba(245, 197, 24, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(245, 197, 24, 0.7), 0 0 80px rgba(245, 197, 24, 0.3); }
}

.loading-text {
  margin-top: 28px;
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--yellow);
  font-weight: 700;
  animation: fadeBlink 1.5s ease-in-out infinite;
}

@keyframes fadeBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.loading-title {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  animation: slideUp 0.8s ease 0.3s both;
}

.loading-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  animation: slideUp 0.8s ease 0.5s both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dots {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: bounceDot 1.4s infinite ease-in-out;
}

.dots span:nth-child(2) { animation-delay: 0.16s; }
.dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
  40% { transform: scale(1.2); opacity: 1; }
}

.progress-bar {
  width: 180px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 4px;
  margin-top: 26px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--yellow-dark), var(--yellow), #ffe066);
  border-radius: 4px;
  animation: progressFill 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.6);
}

@keyframes progressFill {
  0% { width: 0; }
  100% { width: 100%; }
}

/* ========== APP ========== */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#app.show {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.avatar {
  position: relative;
  margin-bottom: 18px;
  display: inline-block;
}

.main-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--yellow);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 25px rgba(245, 197, 24, 0.45);
  animation: logoFloat 4s ease-in-out infinite;
}

.logo-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 197, 24, 0.25) 0%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: fadeIn 0.8s ease 0.2s both;
}

.brand .verified {
  color: var(--yellow);
  font-size: 15px;
  animation: verifiedPop 2s ease-in-out infinite;
}

@keyframes verifiedPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.tagline {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  animation: fadeIn 0.8s ease 0.35s both;
}

.tagline span {
  color: var(--yellow);
  font-weight: 600;
}

.desc {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
  animation: fadeIn 0.8s ease 0.5s both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.tab-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 11px;
  font-weight: 600;
}

.tab-btn .icon {
  font-size: 16px;
  margin-bottom: 2px;
  transition: transform 0.3s ease;
}

.tab-btn .count {
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
  transition: color 0.3s ease;
}

.tab-btn.active {
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.35);
  transform: translateY(-2px);
}

.tab-btn.active .count {
  color: #111;
}

.tab-btn.active .icon {
  transform: scale(1.15);
}

.tab-btn:not(.active):hover {
  background: var(--card-hover);
  border-color: #3a3a3a;
  color: var(--text);
  transform: translateY(-1px);
}

/* Sections */
.section {
  display: none;
  animation: sectionIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.active {
  display: block;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.section-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.section-title i {
  color: var(--yellow);
}

/* Link Cards */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardIn 0.5s ease both;
}

.link-card:nth-child(1) { animation-delay: 0.05s; }
.link-card:nth-child(2) { animation-delay: 0.1s; }
.link-card:nth-child(3) { animation-delay: 0.15s; }
.link-card:nth-child(4) { animation-delay: 0.2s; }

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

.link-card:hover {
  background: var(--card-hover);
  border-color: rgba(245, 197, 24, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 20px rgba(245, 197, 24, 0.08);
}

/* Profile Photo */
.profile-pic {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
}

.pic-img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--yellow);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.pic-inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1f1f1f, #121212);
  border: 2.5px solid var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.25);
}

/* Info */
.link-info {
  flex: 1;
  min-width: 0;
}

.link-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-role {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.link-number {
  font-size: 12.5px;
  color: var(--yellow);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--yellow);
  color: #111;
  letter-spacing: 0.3px;
}

.badge.blue {
  background: var(--blue);
  color: #fff;
}

/* Action button */
.link-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--wa);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.link-action i {
  font-size: 22px;
  transition: transform 0.3s ease;
}

.link-card:hover .link-action {
  color: #1ebe57;
}

.link-card:hover .link-action i {
  transform: scale(1.2);
}

/* Footer */
.footer {
  margin-top: 36px;
  text-align: center;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  margin-bottom: 14px;
  animation: fadeIn 0.8s ease 0.6s both;
}

.copyright {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 380px) {
  .tabs {
    gap: 6px;
  }
  .tab-btn {
    padding: 10px 4px;
    font-size: 10px;
  }
  .brand {
    font-size: 16px;
  }
  .main-logo {
    width: 88px;
    height: 88px;
  }
  .profile-pic, .pic-img, .pic-inner {
    width: 48px;
    height: 48px;
  }
  .link-name {
    font-size: 14px;
  }
}
