:root {
  --bg: #050505;
  --surface: rgba(17, 17, 17, 0.72);
  --surface-strong: rgba(27, 27, 27, 0.9);
  --text-primary: #f7f4ff;
  --text-secondary: #a7a4b4;
  --accent: #ddb7ff;
  --accent-2: #4cd7f6;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --font-display: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-size-display: clamp(1.7rem, 3vw, 2.25rem);
  --font-size-title: clamp(0.95rem, 1.2vw, 1.02rem);
  --font-size-body: clamp(0.95rem, 1.15vw, 1rem);
  --font-size-label: 0.76rem;
  --font-size-sub: clamp(0.8rem, 1vw, 0.9rem);
  --line-height-base: 1.6;
  --space-sm: 0.8rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

.reveal-item {
  opacity: 0;
  animation-fill-mode: both;
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-item[data-effect="fade-up"] { animation-name: revealFadeUp; }
.reveal-item[data-effect="slide-left"] { animation-name: revealSlideLeft; }
.reveal-item[data-effect="zoom-in"] { animation-name: revealZoomIn; }
.reveal-item[data-effect="glow-in"] { animation-name: revealGlowIn; }

@keyframes revealFadeUp {
  0% { opacity: 0; transform: translateY(24px) scale(0.985); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes revealSlideLeft {
  0% { opacity: 0; transform: translateX(-26px); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes revealZoomIn {
  0% { opacity: 0; transform: scale(0.95); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes revealGlowIn {
  0% { opacity: 0; transform: translateY(14px); box-shadow: 0 0 0 rgba(221,183,255,0); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); box-shadow: 0 0 24px rgba(221,183,255,0.18); }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background: radial-gradient(circle at top left, rgba(221,183,255,0.14), transparent 28%),
              radial-gradient(circle at bottom right, rgba(76,215,246,0.14), transparent 26%),
              var(--bg);
  overflow-x: hidden;
  padding-bottom: 6rem;
  position: relative;
}
body::before, body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
  animation: drift 10s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  inset: auto 1rem 5rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  border: 1px solid rgba(221,183,255,0.25);
  box-shadow: 0 0 30px rgba(221,183,255,0.15);
  pointer-events: none;
  z-index: 0;
}
body::before {
  background: var(--accent);
  top: -4rem;
  left: -4rem;
}
body::after {
  background: var(--accent-2);
  bottom: -3rem;
  right: -3rem;
  animation-delay: 4s;
}
@keyframes drift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(20px,-20px,0) scale(1.08); }
}

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.95;
}
.ambient-layer--foreground {
  z-index: 9999;
}
.ambient-layer .rain-drop {
  position: absolute;
  top: -20px;
  left: 0;
  width: 1px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(76,215,246,0.95));
  animation: rainFall linear infinite;
}
@keyframes rainFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate3d(0, 130vh, 0) rotate(14deg); opacity: 0; }
}
.ambient-layer .snow-flake {
  position: absolute;
  top: -12px;
  left: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  animation: snowDrift linear infinite;
}
@keyframes snowDrift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate3d(36px, 130vh, 0) rotate(360deg); opacity: 0; }
}
.ambient-layer .sparkle {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(221,183,255,0.75) 45%, transparent 100%);
  animation: sparkleFade linear infinite;
}
@keyframes sparkleFade {
  0%, 100% { transform: scale(0.25); opacity: 0; }
  25%, 75% { transform: scale(1); opacity: 0.95; }
}
.ambient-layer .petal {
  position: absolute;
  top: -8px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, rgba(255,193,204,0.95), rgba(255,118,142,0.8));
  transform: rotate(45deg);
  animation: petalFall linear infinite;
  filter: drop-shadow(0 0 4px rgba(255,118,142,0.2));
}
@keyframes petalFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate3d(30px, 130vh, 0) rotate(520deg); opacity: 0; }
}
.ambient-layer .cloud {
  position: absolute;
  top: 0;
  left: -140px;
  width: 120px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  animation: cloudDrift linear infinite;
}
.ambient-layer .cloud::before, .ambient-layer .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.ambient-layer .cloud::before {
  width: 44px;
  height: 44px;
  left: 20px;
  top: -10px;
}
.ambient-layer .cloud::after {
  width: 60px;
  height: 60px;
  right: 16px;
  top: -18px;
}
@keyframes cloudDrift {
  from { transform: translateX(-140px); }
  to { transform: translateX(110vw); }
}

body.background-video-mode::before,
body.background-video-mode::after {
  display: none;
}
body.background-video-mode .ambient-layer {
  background: transparent;
}
body.background-video-mode .video-backdrop {
  opacity: 1;
}
.video-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 320ms ease;
  overflow: hidden;
}
.video-backdrop video,
.video-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) brightness(0.6);
}
.video-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(5,5,5,0.75), rgba(5,5,5,0.35));
}
body.background-gif-mode .video-backdrop {
  opacity: 1;
}
body.background-gif-mode .video-backdrop video {
  display: none;
}
body.background-gif-mode .video-backdrop img {
  display: block;
}
body.background-mood-mode .video-backdrop {
  opacity: 1;
}
main, header, nav { position: relative; z-index: 1; }

.topbar {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
}
.topbar .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(9, 9, 9, 0.55);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 1vw, 0.92rem);
}
.brand .avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; overflow: hidden; border: 2px solid transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)) border-box; }
.brand img { width: 100%; height: 100%; object-fit: cover; }
.badge { color: var(--accent-2); }

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.glass-card {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  border-radius: 1.3rem;
}
.profile-card { padding: 1.3rem; text-align: center; }
.avatar-glow {
  width: 7rem; height: 7rem;
  border-radius: 50%;
  padding: 0.3rem;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 35px rgba(221,183,255,0.4);
}
.icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  color: currentColor;
  flex-shrink: 0;
}
.icon-svg svg {
  width: 100%;
  height: 100%;
}
.album-art .icon-svg {
  width: 2.3rem;
  height: 2.3rem;
}
.music-mini-btn .icon-svg {
  width: 1.2rem;
  height: 1.2rem;
}
.bottom-nav a .icon-svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0;
}
.avatar-glow img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.verified-badge-avatar {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.verified-badge-avatar:hover {
  transform: scale(1.18);
}
.profile-card h1 { font-family: var(--font-display); font-size: var(--font-size-display); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 0.35rem; }
.profile-card p { color: var(--text-secondary); font-size: var(--font-size-body); margin: 0 0 1rem; }
.social-row { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.social-badge {
  display: inline-flex;
  width: 2.9rem;
  height: 2.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  text-decoration: none;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  padding: 0.38rem;
}
.social-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.16));
}
.social-badge:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(221,183,255,0.6);
  box-shadow: 0 0 18px rgba(221,183,255,0.16);
  background: rgba(255,255,255,0.12);
}
.social-discord { background: linear-gradient(135deg, rgba(88,101,242,0.24), rgba(114,137,218,0.16)); }
.social-instagram { background: linear-gradient(135deg, rgba(225,48,108,0.24), rgba(253,29,29,0.16)); }
.social-x { background: linear-gradient(135deg, rgba(15,20,25,0.28), rgba(255,255,255,0.08)); }
.social-github { background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(120,120,120,0.18)); }
.link-list { display: flex; flex-direction: column; gap: 0.8rem; }
.link-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.95rem 3.5rem;
  border-radius: 999px;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), 
              border-color 260ms ease, 
              box-shadow 260ms ease, 
              background 260ms ease;
  text-align: center;
}
.link-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.12),
    transparent
  );
  transition: 550ms ease;
}
.link-pill:hover::before {
  left: 100%;
}
.link-pill:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--brand-color, rgba(221,183,255,0.65));
  box-shadow: 0 0 25px var(--brand-glow, rgba(221,183,255,0.18));
  background: rgba(255,255,255,0.12);
}
.link-pill:active { transform: scale(0.985); }
.link-pill .brand-icon-wrap {
  position: absolute;
  left: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  flex-shrink: 0;
}
.link-pill .brand-icon-wrap svg {
  width: 100%;
  height: 100%;
}
.link-pill .meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
}
.link-pill .meta strong {
  display: block;
  font-size: var(--font-size-title);
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.link-pill .meta small {
  display: block;
  color: var(--text-secondary);
  font-size: var(--font-size-sub);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: 0.85;
}
.link-pill .action-icon-wrap {
  position: absolute;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  color: var(--text-secondary);
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.link-pill:hover .action-icon-wrap {
  opacity: 1;
}
.link-pill .action-icon-wrap svg {
  width: 100%;
  height: 100%;
}

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.stat-card { padding: 1rem; text-align: center; }
.stat-card strong { display: block; font-size: clamp(1.35rem, 2.3vw, 1.65rem); font-family: var(--font-display); line-height: 1.1; margin-top: 0.25rem; }
.stat-card small { display: block; color: var(--text-secondary); margin-top: 0.3rem; font-size: var(--font-size-label); text-transform: uppercase; letter-spacing: 0.2em; }
.section-title { padding: 0.2rem 0.2rem 0.4rem; font-size: var(--font-size-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }

.form-grid { display: flex; flex-direction: column; gap: 0.85rem; padding: 1rem; }
.label { font-size: var(--font-size-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.input, select, button { font: inherit; }
.input, select {
  width: 100%; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 0.85rem 0.95rem; background: rgba(7,7,7,0.65); color: var(--text-primary); outline: none; font-size: var(--font-size-body);
}
.input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(76,215,246,0.15); }
.icon-picker, .theme-picker { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.icon-picker button, .theme-picker button { border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: var(--text-primary); padding: 0.7rem 0.8rem; border-radius: 999px; cursor: pointer; }
.icon-picker button.active, .theme-picker button.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(221,183,255,0.15); }
.preview-card { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
.preview-card .preview-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: min(100%, 24rem); padding: 0.95rem 1rem; border-radius: 999px; text-decoration: none; color: var(--text-primary); border: 1px solid rgba(255,255,255,0.13); background: rgba(255,255,255,0.06);
}
.primary-btn { border: none; padding: 0.95rem 1rem; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #050505; font-weight: 800; cursor: pointer; transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease; }
.primary-btn:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 0 24px rgba(76,215,246,0.22); }
.secondary-btn { border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: var(--text-primary); padding: 0.95rem 1rem; border-radius: 999px; cursor: pointer; transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease; }
.secondary-btn:hover { transform: translateY(-2px); border-color: rgba(221,183,255,0.5); }

.music-panel { display: flex; flex-direction: column; gap: 0.8rem; padding: 1rem; }
.music-panel .music-dropzone { border: 1px dashed rgba(255,255,255,0.16); border-radius: 1rem; padding: 0.85rem; background: rgba(0,0,0,0.2); color: var(--text-secondary); text-align: center; cursor: pointer; transition: border-color 180ms ease, transform 180ms ease, background 180ms ease; }
.music-panel .music-dropzone.dragging { border-color: var(--accent); transform: scale(1.01); box-shadow: 0 0 20px rgba(221,183,255,0.14); background: rgba(221,183,255,0.08); }
.music-panel input[type="file"] { display: none; }
.music-search { width: 100%; border-radius: 999px; padding: 0.75rem 0.95rem; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.22); color: var(--text-primary); }
.music-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 220px; overflow: auto; padding-right: 0.2rem; }
.music-item { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.7rem 0.8rem; border-radius: 0.95rem; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); }
.music-item.active { border-color: rgba(76,215,246,0.4); box-shadow: 0 0 16px rgba(76,215,246,0.14); }
.music-item strong { display: block; font-size: 0.92rem; }
.music-item small { color: var(--text-secondary); font-size: 0.76rem; }
.music-item-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.music-action-btn { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.music-player-row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; flex-wrap: wrap; }
.music-player-row .music-meta { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.music-player-row .music-meta strong { display: block; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-player-row .music-meta small { color: var(--text-secondary); display: block; font-size: 0.78rem; }
.music-mini-btn { padding: 0.6rem; min-width: 2.6rem; display: inline-flex; align-items: center; justify-content: center; }
.music-progress-wrap { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--text-secondary); }
.music-progress-wrap input[type="range"] { flex: 1; accent-color: var(--accent-2); }
.music-toggle-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.volume-wrap { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; }
.volume-wrap input[type="range"] { width: 90px; accent-color: var(--accent-2); }
.playlist-group { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.playlist-group button { padding: 0.55rem 0.75rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: var(--text-primary); cursor: pointer; }
.playlist-group button.active { border-color: var(--accent); box-shadow: 0 0 16px rgba(221,183,255,0.16); }
.template-picker { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.template-picker button { padding: 0.6rem 0.8rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: var(--text-primary); cursor: pointer; }
.template-picker button.active { border-color: var(--accent); box-shadow: 0 0 16px rgba(221,183,255,0.16); }
.preview-surface { position: relative; overflow: hidden; border-radius: 1.2rem; min-height: 5rem; padding: 0.75rem; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1); background: linear-gradient(135deg, rgba(221,183,255,0.18), rgba(76,215,246,0.12)); }
.preview-surface::before, .preview-surface::after { content:''; position:absolute; inset:auto; width: 10rem; height: 10rem; border-radius:50%; filter:blur(70px); opacity:0.6; }
.preview-surface::before { background: var(--accent); left:-2rem; top:-2rem; }
.preview-surface::after { background: var(--accent-2); right:-2rem; bottom:-2rem; }
.preview-surface span { position: relative; z-index: 1; color: var(--text-primary); font-weight: 700; }
.music-player-shell { padding: 1rem; border-radius: 1.2rem; background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04)); border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
.music-player-shell .album-art { width: 3rem; height: 3rem; border-radius: 0.9rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(221,183,255,0.18); }
.music-player-shell .album-art .material-symbols-outlined { font-size: 1.4rem; color: #060606; }

.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; width: min(92vw, 460px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; padding: 0.45rem; border-radius: 999px; background: rgba(7,7,7,0.78); backdrop-filter: blur(24px); border: 1px solid var(--border);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.18rem; padding: 0.5rem 0.25rem; color: var(--text-secondary); text-decoration: none; border-radius: 999px; font-size: 0.75rem;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

@media (max-width: 560px) {
  .app-shell { padding-inline: 0.9rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
