/* =========================================================
   DAT SIU — DIGITAL IDENTITY  (Cyber City Edition)
   ---------------------------------------------------------
   Background : #05050F  (near-black navy)
   Card       : rgba(18,17,36,.55)
   Violet     : #8B5CF6   (identity color 1)
   Pink       : #FF4FD8   (identity color 2 — avatar ring)
   Blue       : #3EC1FF   (identity color 3 — avatar ring)
   Gold       : #FFD76E   (achievements / collector)
   Donate     : #FF3B6E   (reserved ONLY for the donate action)
   Text hi    : #F5F4FF
   Text lo    : #A8A3C4
   Display/Body: "Plus Jakarta Sans"
   Mono/label : "JetBrains Mono"
   ========================================================= */

* { box-sizing: border-box; }

:root{
  --bg: #05050f;
  --bg-deep: #030309;
  --card: rgba(19,17,38,0.6);
  --card-soft: rgba(19,17,38,0.4);
  --card-alt: #14132a;
  --border: rgba(160,140,255,0.16);
  --border-soft: rgba(160,140,255,0.09);

  --violet: #8B5CF6;
  --violet-soft: rgba(139,92,246,0.35);
  --pink: #FF4FD8;
  --blue: #3EC1FF;
  --blue-soft: rgba(62,193,255,0.35);
  --gold: #FFD76E;

  --donate: #FF3B6E;
  --donate-soft: rgba(255,59,110,0.35);

  --online: #3DD68C;
  --idle: #F5A623;
  --dnd: #ED4245;
  --offline: #6b6b74;

  --text-hi: #F5F4FF;
  --text-lo: #A8A3C4;
  --text-faint: #57536E;

  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-full: 999px;

  --ease: cubic-bezier(.16,.84,.44,1);
  --ease-reveal: cubic-bezier(.22,1,.36,1);
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-hi);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  scroll-behavior: smooth;
}
body{ position: relative; }
::selection{ background: var(--violet-soft); color: #fff; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img{ max-width: 100%; display: block; }

a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

/* =========================================================
   AMBIENT BACKGROUND — starfield + cyber city skyline
   ========================================================= */
#bg-layer{
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(139,92,246,0.20), transparent 60%),
    radial-gradient(ellipse 90% 50% at 15% 30%, rgba(255,79,216,0.10), transparent 60%),
    radial-gradient(ellipse 90% 50% at 85% 20%, rgba(62,193,255,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 55%, var(--bg-deep) 100%);
}
.star{
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: .5;
  animation: twinkle linear infinite;
}
@keyframes twinkle{
  0%, 100%{ opacity: .15; }
  50%{ opacity: .9; }
}
.city-layer{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  height: 34vh;
  min-height: 220px;
  max-height: 380px;
  filter: blur(0px);
}
.city-layer--back{ opacity: .5; height: 28vh; min-height: 180px; }
.city-layer--back .bldg{ background: linear-gradient(180deg, rgba(90,70,160,0.35), rgba(30,22,60,0.55)); }
.city-layer--front .bldg{ background: linear-gradient(180deg, rgba(30,20,55,0.9), rgba(10,8,22,0.98)); }
.bldg{
  position: relative;
  flex: 0 0 auto;
  border-top: 1px solid rgba(160,140,255,0.12);
}
.bldg .win{
  position: absolute;
  width: 3px;
  height: 5px;
  background: var(--blue);
  opacity: .55;
  box-shadow: 0 0 4px var(--blue);
  animation: winBlink 4.5s ease-in-out infinite;
}
.bldg .win.pink{ background: var(--pink); box-shadow: 0 0 4px var(--pink); }
.bldg .win.gold{ background: var(--gold); box-shadow: 0 0 4px var(--gold); }
@keyframes winBlink{
  0%, 100%{ opacity: .15; }
  50%{ opacity: .8; }
}
.city-fade{
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 40vh;
  background: linear-gradient(180deg, transparent, var(--bg) 85%);
}

/* =========================================================
   LOADING SCREEN
   ========================================================= */
#loading-screen{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #030308;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
#loading-screen.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- ambient fx layer (đen chủ đạo, điểm nhấn tím rất nhẹ) ---- */
.loading-bg-fx{ position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.loading-glow-bg{
  position: absolute; inset: -20%;
  background: radial-gradient(ellipse 42% 36% at 50% 46%, rgba(139,92,246,0.16), transparent 68%);
  animation: bgDrift 10s ease-in-out infinite alternate;
}
@keyframes bgDrift{ from{ transform: scale(1); opacity: .7; } to{ transform: scale(1.12); opacity: 1; } }
.loading-grid{
  position: absolute; inset: -10%;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 46%, #000 15%, transparent 68%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 46%, #000 15%, transparent 68%);
  animation: gridDrift 22s linear infinite;
}
@keyframes gridDrift{ from{ transform: translate(0,0); } to{ transform: translate(42px,42px); } }
.loading-vignette{
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 62% 55% at 50% 46%, transparent 35%, #030308 100%);
}

.loading-inner{ position: relative; z-index: 1; text-align: center; }

/* ---- title / sub / bar (tông trắng, điểm nhấn tím) ---- */
.loading-title{
  font-family: var(--font-display); font-weight: 800; font-size: 23px;
  letter-spacing: .16em; word-spacing: -.22em; margin-bottom: 13px;
  background: linear-gradient(90deg, var(--text-lo) 0%, #fff 38%, var(--violet) 50%, #fff 62%, var(--text-lo) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0;
  animation: loadInUp .6s var(--ease-reveal) forwards .12s, titleShimmer 3.6s linear infinite .5s;
}
.loading-title span{ display: inline-block; margin-right: -.14em; }
@keyframes titleShimmer{ from{ background-position: 0% 0%; } to{ background-position: 260% 0%; } }
.loading-sub{
  font-family: var(--font-mono); font-size: 10px; color: var(--text-lo); margin-bottom: 24px; text-align: center;
  opacity: 0;
  animation: loadInUp .6s var(--ease-reveal) forwards .2s;
}
.loading-sub-text{ position: relative; display: inline-block; }
.dots{ position: absolute; left: 100%; top: 0; margin-left: 2px; white-space: nowrap; }
.dots span{ animation: dotBlink 1.4s infinite; opacity: 0; }
.dots span:nth-child(2){ animation-delay: .2s; }
.dots span:nth-child(3){ animation-delay: .4s; }
@keyframes dotBlink{ 0%,100%{opacity:0;} 50%{opacity:1;} }
.loading-bar-wrap{
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  opacity: 0;
  animation: loadInUp .6s var(--ease-reveal) forwards .28s;
}
.loading-bar{
  position: relative; width: 172px; height: 3px;
  background: rgba(255,255,255,0.08); border-radius: var(--radius-full); overflow: hidden;
}
.loading-bar-fill{
  position: relative; height: 100%; width: 0%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(139,92,246,0.5), var(--violet), #fff);
  box-shadow: 0 0 10px 1px var(--violet-soft);
  animation: barFill 10s linear forwards;
}
.loading-bar-fill::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  background-size: 60px 100%;
  animation: barShimmer 1s linear infinite;
}
@keyframes barFill{ to{ width: 100%; } }
@keyframes barShimmer{ from{ background-position: -60px 0; } to{ background-position: 220px 0; } }
.loading-percent{
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--text-faint);
  min-width: 32px;
}
@keyframes loadInUp{ from{ opacity: 0; transform: translateY(10px); } to{ opacity: 1; transform: translateY(0); } }

/* =========================================================
   PROFILE LAYOUT
   ========================================================= */
.profile{
  position: relative;
  z-index: 2;
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 18px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
}
.profile.reveal{ opacity: 1; }

/* ---------- Hero card: wraps status bar + avatar + name + quote + badges ---------- */
.hero-card{
  position: relative;
  width: 100%;
  padding: 16px 18px 22px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.06), 0 30px 60px -30px rgba(139,92,246,0.35);
}

/* ---------- Top status bar ---------- */
.status-bar{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(-6px);
}
.reveal .status-bar{ animation: fadeSlide .7s var(--ease-reveal) forwards; }
.greet-pill{
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px 6px 8px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  text-align: left;
}
.greet-wave{
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--violet-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  animation: wave 2.6s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes wave{ 0%,100%{ transform: rotate(0deg); } 15%{ transform: rotate(14deg); } 30%{ transform: rotate(-8deg); } 45%{ transform: rotate(14deg); } 60%{ transform: rotate(0deg); } }
.greet-text{ font-size: 8px; color: var(--text-lo); line-height: 1.25; }
.greet-text b{ display: block; font-size: 9.5px; color: var(--blue); font-weight: 700; }

.status-pill{
  position: relative;
  display: flex; align-items: center; gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 7px;
  cursor: default;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.status-dot{
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--offline);
  box-shadow: none;
  transition: background .3s, box-shadow .3s;
}
.status-dot[data-status="online"]{ background: var(--online); box-shadow: 0 0 6px var(--online); animation: dotPulse 1.8s ease-in-out infinite; }
.status-dot[data-status="idle"]{ background: var(--idle); box-shadow: 0 0 6px var(--idle); }
.status-dot[data-status="dnd"]{ background: var(--dnd); box-shadow: 0 0 6px var(--dnd); }
@keyframes dotPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }
.status-label{ font-family: var(--font-mono); font-size: 7px; letter-spacing: .05em; color: var(--text-hi); }

/* ---------- Discord activity card (separate) ---------- */
.activity-card{
  display: none;
  width: 100%;
  align-items: center; gap: 13px;
  padding: 13px 16px;
  margin-bottom: 22px;
  background: linear-gradient(160deg, rgba(139,92,246,0.10), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(10px);
}
.activity-card.show{ display: flex; }
.reveal .activity-card.show{ animation: cardIn .7s var(--ease-reveal) forwards; }
.activity-icon{
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--violet); background: var(--violet-soft);
}
.activity-art{
  display: none;
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.activity-card.is-media .activity-icon{ display: none; }
.activity-card.is-media .activity-art{ display: block; }
.activity-info{ flex: 1 1 auto; min-width: 0; text-align: left; }
.activity-eyebrow{ font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--text-lo); margin-bottom: 3px; }
.activity-text{ font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-sub{
  font-family: var(--font-body); font-size: 12.5px; color: var(--text-lo);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px; display: none;
}
.activity-card.is-media .activity-sub{ display: block; }
.activity-progress{ display: none; margin-top: 7px; }
.activity-card.is-media .activity-progress{ display: block; }
.activity-progress-track{
  width: 100%; height: 3px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12); overflow: hidden;
}
.activity-progress-fill{
  height: 100%; width: 0%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--blue));
  transition: width .4s linear;
}
.activity-progress-time{
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint);
  margin-top: 4px;
}


/* ---------- Avatar ---------- */
.signal-ring{
  position: relative;
  width: 140px; height: 140px;
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.92);
}
.reveal .signal-ring{ animation: avatarIn .85s var(--ease-reveal) forwards; animation-delay: .06s; }
@keyframes avatarIn{ to{ opacity: 1; transform: scale(1); } }

.avatar-wrap{ position: relative; width: 140px; height: 140px; border-radius: 50%; transition: transform .35s var(--ease); }
.avatar-wrap:hover{ transform: scale(1.05); }
.avatar-glow{
  position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, var(--violet-soft), transparent 70%);
  filter: blur(6px);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse{ 0%,100%{ opacity:.6; } 50%{ opacity:1; } }
.avatar{
  position: relative; width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.1); z-index: 1; display: none;
}
.avatar-fallback{
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  background: linear-gradient(160deg, var(--card-alt), var(--bg-deep));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 42px; font-weight: 700; color: var(--violet); z-index: 1;
}
/* Khung hiệu ứng avatar (Discord Avatar Decoration) — ảnh PNG/GIF thật do
   Lanyard trả về (discord_user.avatar_decoration_data.asset). Canvas gốc
   của Discord là 4096px với vòng avatar an toàn ở giữa chiếm ~3520px, nên
   khung cần phóng to hơn avatar khoảng 1.1636 lần và canh đúng tâm để
   viền khung nằm sát mép avatar thay vì đè lên mặt. */
.avatar-decoration{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.1636);
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  display: none;
}

.name-row{ position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 0px; }
.name-row-spacer{ width: 16px; height: 16px; flex: 0 0 auto; visibility: hidden; }
.name{
  font-family: var(--font-display); font-weight: 700; font-size: 27px; letter-spacing: .04em;
  background: linear-gradient(120deg, #fff 25%, var(--blue) 75%, var(--pink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(7px);
}
.reveal .name{ animation: fadeSlide .75s var(--ease-reveal) forwards; animation-delay: .15s; }
.copy-link-btn{
  flex: 0 0 auto;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--blue); border: none;
  font-size: 9px;
  box-shadow: 0 0 8px var(--blue-soft);
  transition: transform .2s;
  opacity: 0;
}
.reveal .copy-link-btn{ animation: fadeSlideBtn .75s var(--ease-reveal) forwards; animation-delay: .18s; }
@keyframes fadeSlideBtn{ to{ opacity: 1; } }
.copy-link-btn:hover{ transform: scale(1.12); }
.copy-link-btn.copied{ transform: scale(1.2); }

.handle{ font-family: var(--font-mono); font-size: 13px; color: var(--text-lo); margin: -4px 0 8px; opacity: 0; transform: translateY(7px); }
.reveal .handle{ animation: fadeSlide .75s var(--ease-reveal) forwards; animation-delay: .22s; }

.quote{
  display: flex; align-items: flex-start; gap: 7px;
  max-width: 340px;
  font-size: 13px; font-style: italic; line-height: 1.5;
  color: var(--text-lo);
  margin-bottom: 16px;
  opacity: 0; transform: translateY(7px);
}
.reveal .quote{ animation: fadeSlide .75s var(--ease-reveal) forwards; animation-delay: .28s; }
.quote i{ font-size: 10px; color: var(--violet); margin-top: 3px; flex: 0 0 auto; }
.quote i:last-child{ margin-top: auto; align-self: flex-end; }
.quote span{ border-right: 2px solid transparent; }
.quote span.typing{ border-right-color: var(--blue); }

/* ---------- Identity badges (kiểu thanh badge Discord) ---------- */
.badges{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 6px 8px;
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
}
.badge{
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--badge-color, var(--violet)) 22%, transparent);
  opacity: 0; transform: translateY(7px) scale(0.85);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.badge--rainbow{
  background: linear-gradient(135deg, #FF6257, #FFD76E, #3ADA8E, #5865F2, #FF73FA);
}
.badge--rainbow .badge-icon{ color: #fff; }
.reveal .badge{ animation: fadeSlide .65s var(--ease-reveal) forwards; }
.reveal .badge:nth-child(1){ animation-delay: .32s; }
.reveal .badge:nth-child(2){ animation-delay: .355s; }
.reveal .badge:nth-child(3){ animation-delay: .39s; }
.reveal .badge:nth-child(4){ animation-delay: .425s; }
.reveal .badge:nth-child(5){ animation-delay: .46s; }
.reveal .badge:nth-child(6){ animation-delay: .495s; }
.reveal .badge:nth-child(7){ animation-delay: .53s; }
.reveal .badge:nth-child(8){ animation-delay: .565s; }
.badge:hover{ transform: translateY(-3px) scale(1.08); background: color-mix(in srgb, var(--badge-color, var(--violet)) 34%, transparent); }
.badge-icon{
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--badge-color, var(--violet));
}
.badge-title, .badge-sub{ display: none; }

.scroll-hint{
  position: absolute;
  left: 0; right: 0; margin: 0 auto; bottom: -17px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--card-alt);
  color: var(--text-lo);
  font-size: 12px;
  animation: bounceHint 1.8s ease-in-out infinite;
  opacity: 0;
  z-index: 2;
}
.reveal .scroll-hint{ animation: fadeSlide .65s var(--ease-reveal) forwards .62s, bounceHint 1.8s ease-in-out infinite 1.2s; }
@keyframes bounceHint{ 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(4px); } }

/* =========================================================
   LINK CARDS
   ========================================================= */
.links{ width: 100%; display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.links--grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.links--grid .link-card--donate{ grid-column: 1 / -1; }
.link-text{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; overflow: hidden; }
.link-card{
  position: relative;
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  text-align: left;
  overflow: hidden;
  opacity: 0; transform: translateY(10px);
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.reveal .link-card{ animation: cardIn .7s var(--ease-reveal) forwards; }
.reveal .link-card:nth-child(1){ animation-delay: .66s; }
.reveal .link-card:nth-child(2){ animation-delay: .69s; }
.reveal .link-card:nth-child(3){ animation-delay: .72s; }
.reveal .link-card:nth-child(4){ animation-delay: .75s; }
.reveal .link-card:nth-child(5){ animation-delay: .78s; }
.reveal .link-card:nth-child(6){ animation-delay: .81s; }
.reveal .link-card:nth-child(7){ animation-delay: .84s; }
@keyframes cardIn{ to{ opacity: 1; transform: translateY(0); } }
.link-card::before{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s ease;
}
.link-card:hover{ transform: translateX(4px); box-shadow: 0 8px 28px -12px var(--violet-soft); }
.links--grid .link-card:hover{ transform: translateY(-3px); }
.links--grid .link-card--donate:hover{ transform: translateY(-2px); }
.link-card:hover::before{ transform: translateX(100%); }
.link-card:active{ transform: translateX(2px) scale(0.99); }

.link-icon{
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-hi); background: var(--card-alt);
  transition: transform .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.link-card:hover .link-icon{ transform: scale(1.1); }

.link-card[data-key="facebook"]{ border-color: rgba(24,119,242,0.28); }
.link-card[data-key="facebook"] .link-icon{ color: #1877F2; background: rgba(24,119,242,0.14); }
.link-card[data-key="facebook"]:hover{ border-color: #1877F2; box-shadow: 0 8px 28px -12px rgba(24,119,242,0.5); }
.link-card[data-key="facebook"]:hover .link-icon{ box-shadow: 0 0 16px rgba(24,119,242,0.5); }

.link-card[data-key="youtube"]{ border-color: rgba(255,0,0,0.28); }
.link-card[data-key="youtube"] .link-icon{ color: #FF0000; background: rgba(255,0,0,0.14); }
.link-card[data-key="youtube"]:hover{ border-color: #FF0000; box-shadow: 0 8px 28px -12px rgba(255,0,0,0.45); }
.link-card[data-key="youtube"]:hover .link-icon{ box-shadow: 0 0 16px rgba(255,0,0,0.45); }

.link-card[data-key="tiktok"]{ border-color: rgba(255,255,255,0.16); }
.link-card[data-key="tiktok"] .link-icon{ color: #fff; background: #010101; }
.link-card[data-key="tiktok"] .link-icon i{ text-shadow: -2px 0 0 #25F4EE, 2px 0 0 #FE2C55; }
.link-card[data-key="tiktok"]:hover{ box-shadow: 0 8px 28px -12px rgba(254,44,85,0.4); }
.link-card[data-key="tiktok"]:hover .link-icon{ box-shadow: 0 0 16px rgba(254,44,85,0.4), 0 0 16px rgba(37,244,238,0.25); }

.link-card[data-key="zalo"]{ border-color: rgba(0,104,255,0.28); }
.link-card[data-key="zalo"] .link-icon{ color: #fff; background: #0068FF; }
.link-icon--zalo{ font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: -0.02em; }
.link-card[data-key="zalo"]:hover{ border-color: #0068FF; box-shadow: 0 8px 28px -12px rgba(0,104,255,0.5); }
.link-card[data-key="zalo"]:hover .link-icon{ box-shadow: 0 0 16px rgba(0,104,255,0.5); }

.link-card[data-key="discord"]{ border-color: rgba(88,101,242,0.28); }
.link-card[data-key="discord"] .link-icon{ color: #fff; background: #5865F2; }
.link-card[data-key="discord"]:hover{ border-color: #5865F2; box-shadow: 0 8px 28px -12px rgba(88,101,242,0.5); }
.link-card[data-key="discord"]:hover .link-icon{ box-shadow: 0 0 16px rgba(88,101,242,0.5); }

.link-card[data-key="telegram"]{ border-color: rgba(38,165,228,0.28); }
.link-card[data-key="telegram"] .link-icon{ color: #fff; background: #26A5E4; }
.link-card[data-key="telegram"]:hover{ border-color: #26A5E4; box-shadow: 0 8px 28px -12px rgba(38,165,228,0.5); }
.link-card[data-key="telegram"]:hover .link-icon{ box-shadow: 0 0 16px rgba(38,165,228,0.5); }

.link-title{ font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.link-sub{ font-size: 11px; color: var(--text-lo); margin-top: 1px; }
.links--grid .link-title{ font-size: 13.5px; }
.link-arrow{ flex: 0 0 auto; font-size: 12px; color: var(--text-faint); transition: transform .3s var(--ease), color .3s var(--ease); margin-left: auto; }
.link-card:hover .link-arrow{ transform: translateX(3px); color: var(--text-hi); }

.link-card--donate{ border-color: rgba(255,59,110,0.22); background: linear-gradient(135deg, rgba(255,59,110,0.1), var(--card)); }
.link-card--donate .link-icon{ color: var(--donate); background: rgba(255,59,110,0.14); }
.link-card--donate:hover{ border-color: var(--donate); box-shadow: 0 8px 28px -12px var(--donate-soft); }
.link-card--donate:hover .link-icon{ box-shadow: 0 0 16px var(--donate-soft); }
.link-card--donate:hover .link-arrow{ color: var(--donate); }
.link-card--donate .link-icon i{ animation: heartbeat 1.8s ease-in-out infinite; }
@keyframes heartbeat{ 0%,100%{transform:scale(1);} 10%{transform:scale(1.15);} 20%{transform:scale(1);} 30%{transform:scale(1.1);} 40%{transform:scale(1);} }

/* =========================================================
   NOW PLAYING CARD
   ========================================================= */
.music-card{
  position: relative;
  width: 100%;
  display: flex; align-items: stretch; gap: 14px;
  padding: 18px 16px;
  margin-bottom: 22px;
  background: linear-gradient(160deg, rgba(139,92,246,0.10), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(10px);
  transition: border-color .3s var(--ease);
}
.reveal .music-card{ animation: cardIn .7s var(--ease-reveal) forwards; animation-delay: .58s; }
.music-card.is-playing{ border-color: var(--violet-soft); }
.music-main{ flex: 1 1 auto; min-width: 0; }
.music-card-eyebrow{ display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--text-lo); margin-bottom: 12px; }
.music-card-body{ display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.music-cover-wrap{
  position: relative; flex: 0 0 auto; width: 60px; height: 60px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--card-alt), var(--bg-deep));
}
.music-cover{ width: 100%; height: 100%; object-fit: cover; }
.music-info{ flex: 1 1 auto; min-width: 0; }
.music-title{ font-family: var(--font-display); font-weight: 700; font-size: 15.5px; color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.music-artist{ font-size: 12px; color: var(--text-lo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-fav{
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); border: 1px solid var(--border);
  transition: color .2s, border-color .2s, transform .2s;
}
.music-fav:hover{ transform: scale(1.08); }
.music-fav.liked{ color: var(--donate); border-color: var(--donate-soft); }
.music-fav.liked i{ animation: heartbeat 1s ease-in-out; }

.music-progress-row{ display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.music-time{ font-family: var(--font-mono); font-size: 10.5px; color: var(--text-lo); flex: 0 0 auto; width: 32px; }
.music-time#music-time-duration{ text-align: right; }
.music-progress{ position: relative; flex: 1 1 auto; height: 4px; border-radius: var(--radius-full); background: var(--border); cursor: pointer; }
.music-progress-fill{ position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--violet), var(--blue)); }

.music-controls{ display: flex; align-items: center; justify-content: center; gap: 14px; }
.music-btn{ display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: var(--text-lo); font-size: 12px; transition: transform .25s var(--ease), color .25s var(--ease); }
.music-btn:hover{ color: var(--blue); transform: scale(1.1); }
.music-btn.is-on{ color: var(--violet); }
.music-btn--play{ width: 42px; height: 42px; font-size: 14px; background: linear-gradient(135deg, var(--violet), var(--blue)); color: #050505; }
.music-btn--play:hover{ color: #050505; transform: scale(1.08); }

#music-audio{ display: none; }
.music-eq-side{
  position: absolute; right: 16px; top: 19px;
  width: 18px; height: 11px;
  display: flex; align-items: flex-end; justify-content: center; gap: 2px;
  opacity: .3;
  pointer-events: none;
}
.music-card.is-playing .music-eq-side{ opacity: 1; }
.music-eq-side span{
  width: 3px; border-radius: 2px; background: linear-gradient(180deg, var(--pink), var(--blue));
  animation: eqTall 1.1s ease-in-out infinite;
  animation-play-state: paused;
  height: 20%;
}
.music-card.is-playing .music-eq-side span{ animation-play-state: running; }
.music-eq-side span:nth-child(1){ animation-delay: .0s; }
.music-eq-side span:nth-child(2){ animation-delay: .1s; }
.music-eq-side span:nth-child(3){ animation-delay: .2s; }
.music-eq-side span:nth-child(4){ animation-delay: .3s; }
.music-eq-side span:nth-child(5){ animation-delay: .4s; }
.music-eq-side span:nth-child(6){ animation-delay: .5s; }
.music-eq-side span:nth-child(7){ animation-delay: .35s; }
@keyframes eqTall{ 0%,100%{ height: 18%; } 50%{ height: 100%; } }
@media (max-width: 400px){ .music-eq-side{ display: none; } }

/* =========================================================
   TIME & WEATHER CARD
   ========================================================= */
.info-card{
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 16px 6px;
  margin-bottom: 22px;
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  opacity: 0; transform: translateY(10px);
}
.reveal .info-card{ animation: cardIn .7s var(--ease-reveal) forwards; animation-delay: .9s; }
.info-time, .info-weather{ flex: 1 1 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 0 10px; }
.info-divider{ width: 1px; background: var(--border-soft); margin: 2px 0; flex: 0 0 auto; }
.info-time-value{ font-family: var(--font-mono); font-size: 19px; font-weight: 600; color: var(--text-hi); letter-spacing: .02em; }
.info-time-date{ font-size: 10.5px; color: var(--text-faint); }
.info-weather{ flex-direction: row; gap: 10px; }
.weather-icon{
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 16%, transparent);
}
.weather-info{ text-align: left; }
.weather-temp{ font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--text-hi); }
.weather-loc{ font-size: 9.5px; color: var(--text-faint); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer{ opacity: 0; color: var(--text-faint); font-size: 12px; line-height: 1.7; width: 100%; }
.reveal .footer{ animation: fadeSlide .75s var(--ease-reveal) forwards; animation-delay: 1.0s; }
.footer-line{ display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.pulse-svg{ width: 46px; height: 16px; opacity: .5; }
.pulse-svg path{ stroke: var(--donate); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.footer p{ margin: 0; }
.footer-heart{ color: var(--donate); }
.footer-sub{ font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--text-faint); margin-top: 4px !important; }

/* =========================================================
   DONATE MODAL
   ========================================================= */
.modal-overlay{
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,0.6);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), backdrop-filter .35s var(--ease), visibility .35s var(--ease);
}
.modal-overlay.open{ opacity: 1; visibility: visible; backdrop-filter: blur(8px); }
.modal{
  position: relative; width: 100%; max-width: 360px;
  background: linear-gradient(160deg, rgba(24,20,44,0.94), rgba(10,9,20,0.97));
  border: 1px solid rgba(255,59,110,0.2);
  border-radius: var(--radius-lg);
  padding: 34px 26px 26px;
  text-align: center;
  transform: scale(0.85) translateY(10px);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.modal-overlay.open .modal{ transform: scale(1) translateY(0); opacity: 1; }
.modal-close{ position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-lo); background: rgba(255,255,255,0.05); transition: color .25s, background .25s; }
.modal-close:hover{ color: #fff; background: rgba(255,255,255,0.1); }
.modal-heart{ width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255,59,110,0.12); color: var(--donate); display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 0 24px var(--donate-soft); }
.modal-title{ font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .12em; margin: 0 0 4px; }
.modal-sub{ font-size: 13px; color: var(--text-lo); margin: 0 0 22px; }
.qr-frame{
  position: relative; width: 180px; height: 180px; margin: 0 auto 22px; border-radius: var(--radius-md);
  background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,59,110,0.15), 0 0 30px var(--donate-soft);
  clip-path: inset(100% 0 0 0 round var(--radius-md));
  transform: translateY(10px); opacity: 0;
  transition: clip-path .85s cubic-bezier(.22,.9,.24,1) .18s, transform .7s var(--ease) .18s, opacity .5s var(--ease) .18s;
}
.modal-overlay.open .qr-frame{ clip-path: inset(0% 0 0 0 round var(--radius-md)); transform: translateY(0); opacity: 1; }
.qr-frame::after{
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--donate), var(--blue), transparent);
  box-shadow: 0 0 10px var(--donate-soft); opacity: 0; pointer-events: none;
}
.modal-overlay.open .qr-frame::after{ animation: qrScanLine 1.05s cubic-bezier(.4,0,.2,1) .18s 1; }
@keyframes qrScanLine{ 0%{top:0%;opacity:0;} 8%{opacity:1;} 92%{opacity:1;} 100%{top:100%;opacity:0;} }
.qr-img{ width: 100%; height: 100%; object-fit: contain; }
.qr-fallback{ display: none; flex-direction: column; align-items: center; gap: 8px; color: #111; font-size: 11px; text-align: center; padding: 10px; font-family: var(--font-mono); }
.qr-fallback i{ font-size: 30px; color: var(--donate); }
.qr-fallback code{ background: rgba(0,0,0,0.06); padding: 2px 5px; border-radius: 4px; }
.bank-info{ background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 18px; text-align: left; }
.bank-row{ display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12.5px; }
.bank-label{ color: var(--text-lo); }
.bank-value{ font-family: var(--font-mono); color: var(--text-hi); font-weight: 500; }
.bank-value--copy{ cursor: pointer; border-bottom: 1px dashed var(--text-faint); transition: color .2s; }
.bank-value--copy:hover{ color: var(--blue); }
.modal-thanks{ font-size: 12.5px; color: var(--text-lo); margin: 0 0 20px; }
.modal-close-btn{ width: 100%; padding: 12px; border-radius: var(--radius-md); background: rgba(255,255,255,0.05); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; color: var(--text-lo); transition: color .25s, border-color .25s, background .25s; }
.modal-close-btn:hover{ color: var(--text-hi); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }

/* =========================================================
   CONNECT TRANSITION OVERLAY
   ========================================================= */
.connect-overlay{
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.connect-overlay.show{ opacity: 1; visibility: visible; }
.connect-inner{ text-align: center; transform: translateY(10px) scale(0.96); opacity: 0; transition: transform .5s var(--ease), opacity .5s var(--ease); }
.connect-overlay.show .connect-inner{ transform: translateY(0) scale(1); opacity: 1; }
.connect-icon{ width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: var(--violet); box-shadow: 0 0 32px var(--violet-soft); animation: connectPulse 1.4s ease-in-out infinite; }
@keyframes connectPulse{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.08); } }
.connect-text{ font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--text-lo); letter-spacing: .01em; }
.connect-platform{ display: block; margin-top: 4px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text-hi); }
.connect-dots{ display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.connect-dots span{ width: 6px; height: 6px; border-radius: 50%; background: var(--text-lo); animation: connectDot 1.2s ease-in-out infinite; }
.connect-dots span:nth-child(2){ animation-delay: .15s; }
.connect-dots span:nth-child(3){ animation-delay: .3s; }
@keyframes connectDot{ 0%,80%,100%{ opacity:.25; transform: translateY(0); } 40%{ opacity:1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce){ .connect-icon, .connect-dots span{ animation: none !important; } }

@keyframes fadeSlide{ to{ opacity: 1; transform: translateY(0); } }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 640px){ .profile{ padding-top: 34px; } }
@media (max-width: 380px){
  .profile{ padding: 16px 14px 26px; }
  .name{ font-size: 23px; }
  .link-card{ padding: 13px 15px; }
  .greet-text{ font-size: 8.5px; }
}

/* =========================================================
   PERFORMANCE / RESPONSIVE OPTIMIZATIONS
   (added: giảm tải cho mobile Android/iOS, tối ưu mượt mà)
   ========================================================= */

/* Hỗ trợ safe-area cho iPhone có notch / Dynamic Island */
body{
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Giảm độ blur nặng trên điện thoại / thiết bị cảm ứng để cuộn mượt hơn,
   tránh giật lag do backdrop-filter rất tốn GPU trên máy tầm trung */
@media (pointer: coarse), (max-width: 480px){
  .hero-card, .activity-card, .music-card, .link-card, .info-card, .modal{
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
  }
}

/* Giới hạn hiệu ứng nền thành phố trên màn rất nhỏ để tiết kiệm pin/CPU */
@media (max-width: 380px){
  .city-layer{ height: 24vh; min-height: 160px; }
  .city-layer--back{ display: none; }
}

/* Tối ưu vùng cuộn trên iOS (bounce mượt) + chạm mượt trên Android */
html{
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* Tránh hover "dính" trên thiết bị cảm ứng (mobile bấm 1 lần bị giữ trạng thái hover) */
@media (hover: none){
  .link-card:hover, .badge:hover, .avatar-wrap:hover, .music-btn:hover,
  .copy-link-btn:hover, .music-fav:hover{
    transform: none;
  }
}

/* Màn hình lớn (desktop / laptop rộng): giới hạn chiều rộng nội dung để không bị kéo giãn quá mức */
@media (min-width: 900px){
  .profile{ max-width: 560px; margin-left: auto; margin-right: auto; }
}
