:root {
  --accent: #cfd0d2;
  --text: #f8f8f8;
  --muted: #aaa7b4;
  --panel: rgba(12, 12, 13, .82);
  --line: rgba(255, 255, 255, .105);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "IBM Plex Sans Arabic", "Bodoni Moda", Georgia, serif;
  color: var(--text);
  background: #0a0a0b;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  direction: ltr;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  background: rgba(8, 8, 8, .72);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.brand-symbol {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #babbbe, #84868d);
  box-shadow: 0 8px 24px rgba(166, 167, 172, .23);
  transform: rotate(-7deg);
}
.brand-symbol span {
  width: 18px;
  height: 18px;
  border: 5px solid #fff;
  border-right-width: 2px;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(38deg);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.language-choice { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.language-choice select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 7px;
  color: var(--text);
  background: #181819;
}
.account-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.account-avatar { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; }
.top-button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  font-weight: 700;
  transition: .18s ease;
}
.top-button.accent {
  border: 0;
  background: linear-gradient(135deg, #afb1b5, #8a8c92);
  box-shadow: 0 10px 28px rgba(145, 147, 152, .2);
}
.top-button.discord-button { border-color: rgba(88, 101, 242, .42); background: rgba(88, 101, 242, .16); }
.top-button:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .22); }

#app { min-height: 100vh; }
.loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}
.loader {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, .08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.directory {
  min-height: 100vh;
  direction: ltr;
  padding: 130px 24px 70px;
  background:
    radial-gradient(circle at 50% 15%, rgba(166, 167, 172, .13), transparent 29rem),
    #0a0a0b;
}
.directory-head { max-width: 740px; margin: 0 auto 40px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.directory-head h1 { margin: 0; font-size: clamp(38px, 7vw, 68px); line-height: 1.05; letter-spacing: -.055em; }
.directory-head p:last-child { color: var(--muted); }
.profile-grid {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.profile-tile {
  --tile-accent: #cfd0d2;
  min-height: 290px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  background: #161718 center/cover no-repeat;
  transition: .28s ease;
}
.profile-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(7, 7, 7, .94));
}
.profile-tile:hover {
  transform: translateY(-7px);
  border-color: color-mix(in srgb, var(--tile-accent) 58%, white);
  box-shadow: 0 24px 65px -25px color-mix(in srgb, var(--tile-accent) 35%, transparent);
}
.tile-avatar {
  position: relative;
  width: 74px;
  height: 74px;
  margin-bottom: auto;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
.profile-tile h2, .profile-tile p { position: relative; }
.profile-tile h2 { margin: 10px 0 0; font-size: 20px; }
.profile-tile p { margin: 2px 0 0; color: #cfccd5; direction: ltr; }

.profile-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  direction: ltr;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 96px 18px 56px;
  background: #0a0a0b center/cover fixed no-repeat;
}
body.profile-mode .topbar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}
body.profile-mode .profile-page {
  padding: 30px 12px 70px;
}
.profile-back-button {
  position: fixed;
  z-index: 30;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  min-width: 64px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9px;
  color: #f4f4f4;
  background: rgba(14, 14, 15, .72);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.profile-back-button:hover { border-color: rgba(255, 255, 255, .48); background: rgba(255, 255, 255, .12); }
.profile-edit-button {
  position: fixed;
  z-index: 30;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 40px;
  padding: 0 12px;
  transform: none;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9px;
  color: #f4f4f4;
  background: rgba(14, 14, 15, .72);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font: 700 13px "IBM Plex Sans Arabic", "Bodoni Moda", serif;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.profile-edit-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .48);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}
.profile-wallpaper-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.profile-page::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 6, 6, .18), rgba(6, 6, 6, .62)),
    radial-gradient(circle at 50% 48%, transparent 0 18%, rgba(6, 6, 6, .25) 52%, rgba(6, 6, 6, .58) 100%);
  backdrop-filter: blur(2px);
}
.profile-card {
  position: relative;
  z-index: 3;
  width: min(620px, calc(100vw - 28px));
  min-height: 0;
  direction: ltr;
  padding: 22px 12px;
  border: 0;
  border-radius: 0;
  text-align: center;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  animation: cardIn .72s cubic-bezier(.2, .8, .2, 1);
}
.profile-card.is-locked {
  opacity: 0;
  transform: translateY(20px) scale(.98);
  pointer-events: none;
}
.profile-card.is-open {
  opacity: 1;
  transition: opacity .55s ease, transform .15s ease-out;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.975); } }

.profile-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.profile-avatar-wrap { position: relative; margin-bottom: 12px; }
.profile-avatar {
  display: block;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
}
.profile-status {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  border: 4px solid #171819;
  border-radius: 50%;
  background: #49db85;
  box-shadow: 0 0 12px rgba(73, 219, 133, .65);
}
.profile-identity { min-width: 0; width: 100%; }
.profile-name-row { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; }
.profile-card h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.profile-flair {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #9b9ca1;
  font-size: 11px;
  box-shadow: 0 0 12px rgba(155, 156, 161, .3);
}
.profile-handle { margin: 5px 0 9px; color: var(--muted); font-size: 14px; }
.profile-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 7px;
  padding: 3px 7px;
  color: #d4d1da;
  background: rgba(255, 255, 255, .045);
  font-size: 11px;
  font-weight: 700;
}
.discord-presence-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(390px, 100%);
  min-height: 78px;
  margin: 15px auto 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 17px;
  text-align: left;
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .14);
  backdrop-filter: blur(16px);
}
.discord-presence-avatar-wrap { position: relative; flex: 0 0 54px; }
.discord-presence-avatar { display: block; width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.discord-presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border: 3px solid #22212a;
  border-radius: 50%;
  background: #85838d;
}
.discord-presence-dot[data-status="online"] { background: #38c978; }
.discord-presence-dot[data-status="idle"] { background: #e6b94f; }
.discord-presence-dot[data-status="dnd"] { background: #ed5963; }
.discord-presence-copy { min-width: 0; flex: 1; }
.discord-presence-status { display: block; margin: 0 0 3px; color: #f6f6f7; font-size: 12px; font-weight: 800; }
.discord-presence-activities { display: grid; gap: 2px; color: #d4d5d7; font-size: 11px; line-height: 1.4; }
.discord-presence-activity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-presence-last-seen { display: block; margin-top: 3px; color: #a7a4b2; font-size: 10px; }
.profile-bio {
  margin: 14px auto 14px;
  max-width: 520px;
  min-height: 24px;
  color: #cbc8d2;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  direction: ltr;
}
.profile-link {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, .075);
  font-size: 12px;
  font-weight: 800;
  transition: .19s ease;
}
.profile-link span { max-width: 1px; overflow: hidden; color: transparent; }
.social-icon { display: block; width: 19px; height: 19px; }
.profile-link:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, .04));
  box-shadow: 0 12px 24px -14px var(--accent);
}
.profile-link[data-tooltip] { position: relative; }
.profile-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 5px);
  max-width: 180px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #fff;
  background: rgba(9, 9, 9, .95);
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 10px;
  transition: opacity .16s ease, transform .16s ease;
}
.profile-link[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.profile-card h1 {
  animation: nameFloat 4s ease-in-out infinite;
}
@keyframes nameFloat {
  50% { transform: translateY(-2px); letter-spacing: -.02em; }
}
.profile-footer {
  position: absolute;
  right: 0;
  bottom: -42px;
  left: 0;
  margin-top: 0;
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 0;
  color: #9c98a5;
  font-size: 11px;
}
.profile-footer span:last-child { direction: ltr; }
.create-account-button { margin-top: 20px; padding: 0 20px; }

.editor {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  direction: ltr;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--text);
  background: #111112;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
}
.auth-choice { width: min(390px, calc(100vw - 28px)); }
.auth-choice > div { display: grid; gap: 12px; padding: 22px; }
.auth-choice h2, .auth-choice p { margin: 0; }
.auth-choice-description { color: var(--muted); font-size: 13px; }
.auth-choice-actions { display: flex; gap: 8px; }
.auth-choice-actions button { flex: 1; }
.profile-setup form { gap: 12px; }
.profile-setup h2, .profile-setup p { margin: 0; }
.profile-setup .primary-button, .profile-setup .glass-button { width: 100%; }
.language-prompt { width: min(390px, calc(100vw - 28px)); }
.language-prompt > div { display: grid; gap: 12px; padding: 22px; }
.language-prompt h2, .language-prompt p { margin: 0; }
.language-prompt > div > p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.language-prompt-actions { display: flex; gap: 8px; }
.language-prompt-actions button { flex: 1; }
.editor::backdrop { background: rgba(0, 0, 0, .76); backdrop-filter: blur(10px); }
.editor form { display: grid; gap: 12px; padding: 20px; }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; }
.editor h2 { margin: 0; }
.editor label, fieldset { display: grid; gap: 6px; color: #dcdcde; font-size: 12px; }
.editor .presence-consent {
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  color: #dcdcde;
  line-height: 1.5;
}
.editor input, .editor textarea, .editor select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--text);
  background: #1b1c1d;
  outline: none;
}
.editor .presence-consent input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}
.editor input:focus, .editor textarea:focus, .editor select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.editor textarea { min-height: 82px; resize: vertical; }
.editor input[type="color"] { padding: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.link-editor { display: grid; gap: 7px; }
.link-row { display: grid; grid-template-columns: 115px 1fr 1.35fr 40px; gap: 7px; }
.remove-link { border: 1px solid var(--line); border-radius: 8px; color: #fff; background: #24151b; cursor: pointer; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: #fff; background: rgba(255,255,255,.06); font-size: 22px; cursor: pointer; }
.glass-button { height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; color: #fff; background: rgba(255,255,255,.055); cursor: pointer; }
.primary-button { height: 44px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--accent), #82848b); font-weight: 800; cursor: pointer; }
.danger-button { min-height: 42px; border: 1px solid rgba(255, 103, 128, .35); border-radius: 9px; color: #ffb7c3; background: rgba(110, 22, 42, .2); font-weight: 700; cursor: pointer; }
.danger-button:hover { border-color: rgba(255, 103, 128, .7); background: rgba(110, 22, 42, .35); }
.save-button { width: 100%; }
.editor-status { min-height: 18px; margin: 0; color: #ffadb9; font-size: 12px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 130px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f8f8;
  color: #121314;
  font-weight: 800;
  text-align: center;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.toast.show { transform: translate(-50%, 0); }

#particles { position: fixed; z-index: 1; inset: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  from { transform: translateY(110vh); opacity: 0; }
  15% { opacity: .75; }
  to { transform: translateY(-10vh) translateX(20px); opacity: 0; }
}
.cursor-dot {
  position: fixed;
  z-index: 100;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--accent);
  box-shadow: 0 0 13px var(--accent);
  transform: translate(-50%, -50%);
}
.effect-grid::after {
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black);
}
.effect-aurora::after {
  background:
    linear-gradient(180deg, rgba(6, 6, 6,.18), rgba(6, 6, 6,.62)),
    radial-gradient(ellipse at 18% 15%, color-mix(in srgb, var(--accent) 23%, transparent), transparent 36%),
    radial-gradient(ellipse at 82% 35%, rgba(148, 150, 156,.12), transparent 38%);
  animation: aurora 9s ease-in-out infinite alternate;
}
@keyframes aurora { to { filter: hue-rotate(24deg); transform: scale(1.08); } }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .topbar { height: 64px; padding: 9px 12px; }
  .brand { font-size: 16px; }
  .brand-symbol { width: 34px; height: 34px; }
  .account-name { display: none; }
  .account-avatar { width: 30px; height: 30px; }
  .top-button { height: 38px; padding: 0 10px; font-size: 12px; }
  .language-choice { gap: 4px; font-size: 10px; }
  .language-choice select { min-height: 32px; }
  .directory { padding: 96px 12px 40px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-tile { min-height: 230px; }
  .profile-page { min-height: 100svh; padding: max(82px, env(safe-area-inset-top)) 10px max(76px, env(safe-area-inset-bottom)); }
  .profile-card { width: 100%; min-height: 0; padding: 14px; }
  .profile-card-head { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; min-height: 82px; }
  .profile-avatar { width: 82px; height: 82px; }
  .profile-card h1 { font-size: 23px; }
  .profile-handle { margin: 3px 0 7px; }
  .profile-meta span { min-height: 22px; }
  .profile-bio { margin: 14px 0 12px; }
  .profile-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-back-button { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); height: 38px; }
  .profile-edit-button { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); height: 38px; }
  .form-row { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr 1fr 38px; }
  .link-row .link-platform { grid-column: 1 / -1; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .profile-page { padding-top: 56px; padding-bottom: 60px; }
  .profile-card { padding-top: 8px; padding-bottom: 8px; }
  .profile-avatar { width: 64px; height: 64px; }
  .profile-avatar-wrap { margin-bottom: 6px; }
  .profile-bio { margin-top: 8px; margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

:root {
  --accent: #cfd0d2;
  --accent-strong: #b1b2b6;
  --cyan: #babbbe;
  --text: #f7f7f8;
  --muted: #9c9baa;
  --panel: rgba(19, 20, 21, .76);
  --line: rgba(242, 242, 242, .12);
}

body {
  background:
    radial-gradient(ellipse at 12% 0%, rgba(118, 120, 126, .12), transparent 40rem),
    #0c0c0c;
}

.topbar {
  height: 74px;
  padding-inline: clamp(16px, 4vw, 56px);
  border-bottom-color: rgba(238, 238, 239, .08);
  background: rgba(12, 12, 12, .7);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .12);
}

.brand { gap: 12px; font-size: 18px; letter-spacing: .02em; }
.brand-symbol {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(236, 236, 237, .35);
  border-radius: 13px;
  background: linear-gradient(145deg, #c3c4c7, #707279 75%);
  box-shadow: 0 8px 26px rgba(171, 172, 176, .28);
  transform: rotate(-6deg);
}
.brand-symbol span {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  color: #fff;
  font: 700 20px/1 "Bodoni Moda", Georgia, serif;
  transform: rotate(6deg);
}
.top-button {
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.top-button.accent {
  background: linear-gradient(120deg, #b7b8bb, #8d8f95);
  box-shadow: 0 9px 24px rgba(143, 145, 150, .24);
}

.directory {
  position: relative;
  min-height: 100vh;
  padding: 140px clamp(18px, 4vw, 64px) 28px;
  direction: rtl;
  background:
    radial-gradient(ellipse at 72% 4%, rgba(146, 148, 153, .18), transparent 30rem),
    radial-gradient(ellipse at 15% 34%, rgba(106, 108, 113, .075), transparent 26rem),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.016) 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(255,255,255,.016) 48px),
    #0c0c0c;
}
.directory-shell { width: min(1240px, 100%); margin: 0 auto; }
.directory-head {
  max-width: 820px;
  margin: 0 auto 100px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  border: 1px solid rgba(209, 210, 213, .2);
  border-radius: 999px;
  padding: 8px 13px;
  color: #d9d9db;
  background: rgba(161, 162, 167, .075);
  font-size: 10px;
  letter-spacing: .13em;
}
.eyebrow-spark { color: var(--cyan); font-size: 13px; }
.directory-head h1 {
  margin: 0;
  font-size: clamp(42px, 7.2vw, 82px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.055em;
}
#directoryTitleAccent {
  color: transparent;
  background: linear-gradient(100deg, #e6e6e7 10%, #c3c4c8 55%, #b8b9bd 100%);
  background-clip: text;
  -webkit-background-clip: text;
}
.directory-head > p:not(.eyebrow) {
  max-width: 590px;
  margin: 20px auto 0;
  color: #aaa9b8;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.9;
}
.directory-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 30px;
}
.create-account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 50px;
  margin: 0;
  border-radius: 14px;
  padding: 0 22px;
  font-size: 14px;
  box-shadow: 0 12px 34px rgba(146, 148, 153, .22);
}
.create-account-button span { font-size: 18px; transition: transform .2s ease; }
.create-account-button:hover span { transform: translate(2px, -2px); }
.directory-note { color: #8e8d9b; font-size: 12px; }
.directory-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 40px;
}
.directory-stat { display: grid; gap: 3px; text-align: right; }
.directory-stat strong { color: #f8f8f9; font: 600 21px/1 "Bodoni Moda", Georgia, serif; }
.directory-stat span { color: #878695; font-size: 9px; letter-spacing: .11em; }
.stat-divider { width: 1px; height: 30px; background: var(--line); }
.directory-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 20px;
  text-align: right;
}
.section-kicker { margin: 0 0 5px; color: #b0b2b6; font-size: 10px; letter-spacing: .14em; }
.directory-section-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.profile-search {
  width: min(300px, 100%);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  color: #a7a5b5;
  background: rgba(255, 255, 255, .035);
  transition: border-color .2s ease, background .2s ease;
}
.profile-search:focus-within { border-color: rgba(207, 208, 210, .55); background: rgba(255,255,255,.055); }
.profile-search > span { font-size: 23px; line-height: 1; }
.profile-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
}
.profile-search input::placeholder { color: #797987; }
.profile-grid {
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.profile-tile {
  min-height: 300px;
  border-color: rgba(241, 241, 241, .11);
  border-radius: 20px;
  padding: 18px;
  background-color: #151516;
  text-align: right;
}
.profile-tile::before {
  background:
    linear-gradient(180deg, rgba(12, 12, 12,.22), rgba(12, 12, 12,.16) 32%, rgba(12, 12, 12,.94)),
    radial-gradient(ellipse at 50% 25%, color-mix(in srgb, var(--tile-accent) 20%, transparent), transparent 72%);
}
.profile-tile:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--tile-accent) 55%, white);
  box-shadow: 0 22px 55px -28px color-mix(in srgb, var(--tile-accent) 45%, transparent);
}
.tile-topline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  color: rgba(248, 248, 248, .62);
  font-size: 9px;
  letter-spacing: .11em;
}
.tile-arrow {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: white;
  background: rgba(12, 12, 12,.38);
  font-size: 14px;
}
.tile-avatar {
  width: 72px;
  height: 72px;
  margin-top: auto;
  margin-bottom: 11px;
  border: 2px solid rgba(244, 244, 244, .82);
}
.profile-tile h2 { margin-top: 0; font-size: 20px; }
.profile-tile p { color: #b5b2c1; font-size: 12px; }
.empty-profiles {
  margin: 30px auto;
  color: var(--muted);
  text-align: center;
}
.directory-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 64px;
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 18px 0 6px;
  color: #777684;
  font-size: 10px;
  letter-spacing: .08em;
}

.profile-page {
  isolation: isolate;
  background-color: #0c0c0c;
  background-attachment: scroll;
}
body.profile-mode .profile-page { padding: 30px 16px 54px; }
.profile-wallpaper-video { z-index: -2; }
.profile-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 22%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 33%),
    radial-gradient(ellipse at 84% 78%, rgba(142, 144, 150, .11), transparent 34%);
  filter: blur(12px);
}
.profile-page::after {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, .38), rgba(8, 8, 8, .7)),
    radial-gradient(ellipse at 50% 45%, transparent 0, rgba(8, 8, 8, .32) 70%);
  backdrop-filter: blur(1px);
}
.profile-back-button, .profile-edit-button {
  top: max(18px, env(safe-area-inset-top));
  min-width: 78px;
  height: 42px;
  border-color: rgba(243, 243, 243, .16);
  border-radius: 13px;
  background: rgba(17, 18, 19, .62);
}
.profile-back-button::before { content: "↶"; margin-inline-end: 7px; color: #dbdcde; }
.profile-edit-button { min-width: 70px; }
.profile-back-button:hover, .profile-edit-button:hover {
  border-color: rgba(207, 208, 210, .48);
  background: rgba(28, 28, 30, .88);
}
.profile-card {
  width: min(560px, calc(100vw - 32px));
  padding: 44px 30px 25px;
  border: 1px solid rgba(242, 242, 242, .13);
  border-radius: 27px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(172, 174, 178, .12), transparent 58%),
    rgba(17, 18, 19, .76);
  box-shadow:
    0 35px 100px rgba(0, 0, 0, .46),
    inset 0 1px rgba(255, 255, 255, .055);
  backdrop-filter: blur(26px);
}
.profile-card::before {
  content: "VESPER  /  DIGITAL IDENTITY";
  position: absolute;
  top: 17px;
  left: 0;
  right: 0;
  color: rgba(206, 207, 210, .55);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .22em;
}
.profile-card-head { min-height: 0; }
.profile-avatar-wrap {
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid rgba(220, 221, 223, .42);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(220, 221, 223, .25), rgba(113, 115, 122, .04));
  box-shadow: 0 0 0 7px rgba(202, 203, 205, .045), 0 15px 44px rgba(0, 0, 0, .34);
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border: 2px solid rgba(12, 12, 13, .9);
  box-shadow: none;
}
.profile-card h1 {
  font-size: clamp(28px, 7vw, 36px);
  letter-spacing: -.04em;
  animation: none;
}
.profile-flair {
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #c2c3c7, #909297);
  box-shadow: 0 0 17px rgba(177, 178, 182, .42);
}
.profile-handle { margin: 7px 0 14px; color: #aaa8b8; font-size: 13px; }
.profile-meta { gap: 8px; }
.profile-meta span {
  min-height: 30px;
  border-color: rgba(239, 239, 240, .12);
  border-radius: 999px;
  padding: 4px 11px;
  color: #d1d2d5;
  background: rgba(255, 255, 255, .045);
  font-size: 10px;
}
.profile-bio {
  max-width: 420px;
  margin: 20px auto;
  color: #c8c9cb;
  font-size: 14px;
  line-height: 1.85;
}
.profile-links { gap: 9px; }
.profile-link {
  width: auto;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: rgba(241, 241, 242, .13);
  border-radius: 13px;
  padding: 0 12px;
  color: #f8f8f8;
  background: rgba(255, 255, 255, .055);
}
.profile-link span {
  max-width: 130px;
  overflow: hidden;
  color: #eaebec;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-icon { width: 17px; height: 17px; }
.profile-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 60%, white);
  background: color-mix(in srgb, var(--accent) 13%, rgba(255, 255, 255, .05));
  box-shadow: 0 12px 28px -17px var(--accent);
}
.profile-link[data-tooltip]::after { display: none; }
.profile-footer {
  position: static;
  justify-content: space-between;
  margin-top: 25px;
  border-top: 1px solid rgba(241, 241, 242, .1);
  padding-top: 17px;
  color: #a8a5b4;
}
.profile-number-wrap { display: grid; gap: 2px; text-align: left; }
.profile-number-wrap #profileNumber { color: #f0f0f1; font-size: 12px; }
.profile-number-wrap span:last-child { color: #858393; font-size: 8px; letter-spacing: .12em; }
.share-profile-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  border: 1px solid rgba(241, 241, 242, .13);
  border-radius: 11px;
  padding: 0 11px;
  color: #e3e4e5;
  background: rgba(255,255,255,.045);
  cursor: pointer;
  font-size: 10px;
  transition: .2s ease;
}
.share-profile-button:hover { border-color: rgba(207, 208, 210, .45); background: rgba(183, 184, 188, .12); }
.share-profile-button > span:first-child { color: #dbdbdd; font-size: 14px; }
.directory-footer, .profile-footer, .profile-card { direction: ltr; }

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-head { margin-bottom: 76px; }
}
@media (max-width: 600px) {
  .topbar { height: 64px; padding: 8px 12px; }
  .brand { gap: 8px; font-size: 15px; }
  .brand-symbol { width: 34px; height: 34px; }
  .top-actions { gap: 5px; }
  .language-choice > span { display: none; }
  .directory { padding: 108px 16px 22px; }
  .directory-head { margin-bottom: 62px; }
  .directory-head h1 { font-size: clamp(40px, 12vw, 58px); }
  .directory-head > p:not(.eyebrow) { max-width: 400px; margin-top: 14px; font-size: 13px; }
  .directory-actions { flex-direction: column; gap: 12px; margin-top: 23px; }
  .directory-stats { gap: 22px; margin-top: 29px; }
  .directory-section-head { align-items: stretch; flex-direction: column; gap: 13px; }
  .directory-section-head h2 { font-size: 20px; }
  .profile-search { width: 100%; }
  .profile-grid { grid-template-columns: 1fr; gap: 12px; }
  .profile-tile { min-height: 235px; }
  .directory-footer { flex-direction: column; align-items: center; margin-top: 42px; }
  body.profile-mode .profile-page { padding: max(74px, env(safe-area-inset-top)) 12px max(82px, env(safe-area-inset-bottom)); }
  .profile-card { width: 100%; padding: 43px 20px 20px; border-radius: 23px; }
  .profile-avatar-wrap { margin-bottom: 17px; }
  .profile-avatar { width: 84px; height: 84px; }
  .profile-card h1 { font-size: 28px; }
  .profile-bio { margin: 16px auto; font-size: 13px; }
  .profile-links { gap: 7px; }
  .profile-link { min-height: 40px; padding-inline: 10px; }
  .profile-link span { max-width: 108px; }
  .profile-back-button, .profile-edit-button { top: max(12px, env(safe-area-inset-top)); height: 38px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .profile-card { padding-top: 38px; }
  .profile-avatar-wrap { margin-bottom: 10px; }
  .profile-avatar { width: 66px; height: 66px; }
}

.directory-section-head {
  align-items: flex-start;
  flex-direction: column;
}
.profile-search { width: min(420px, 100%); }
.profile-grid {
  max-width: 1200px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 280px));
  justify-content: center;
}
.profile-number-wrap { direction: ltr; unicode-bidi: isolate; }
.profile-number-wrap #profileNumber { font-variant-numeric: tabular-nums; }

#editor.editor {
  width: min(760px, calc(100vw - 28px));
  max-height: min(92dvh, 880px);
  overflow: auto;
  border-color: rgba(242, 242, 242, .16);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 92% 0%, rgba(153, 155, 160, .12), transparent 34%),
    #141516;
}
#editorForm {
  gap: 16px;
  padding: 26px;
  direction: rtl;
}
#editorForm .editor-head {
  align-items: center;
  direction: ltr;
  margin-bottom: 3px;
}
#editorForm .editor-head > div { direction: rtl; text-align: right; }
#editorForm .editor-head .eyebrow { margin-bottom: 10px; }
#editorForm .editor-head h2 { font-size: clamp(23px, 4vw, 29px); letter-spacing: -.035em; }
#editorForm .editor-head .icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #f1f1f1;
  background: rgba(255,255,255,.055);
}
#editorForm label, #editorForm fieldset {
  gap: 8px;
  color: #a9a7b6;
  font-size: 12px;
  font-weight: 500;
}
#editorForm .field-label { color: #e9eaeb; font-size: 12px; font-weight: 700; }
#editorForm input:not([type="color"], [type="file"]),
#editorForm textarea,
#editorForm select {
  min-height: 48px;
  border-color: rgba(237, 237, 238, .12);
  border-radius: 12px;
  padding: 11px 13px;
  background: rgba(255,255,255,.045);
  text-align: right;
}
#editorForm textarea { min-height: 98px; line-height: 1.7; }
#editorForm #username,
#editorForm #songUrl,
#editorForm #spotifyUrl,
#editorForm .link-url { direction: ltr; text-align: left; }
#editorForm #accentColor {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(237, 237, 238, .12);
  border-radius: 12px;
  padding: 5px;
  background: rgba(255,255,255,.045);
}
#editorForm .form-row { grid-template-columns: minmax(0, 1.25fr) minmax(150px, .75fr); gap: 14px; }
#editorForm .file-control {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(237, 237, 238, .12);
  border-radius: 13px;
  padding: 8px 10px;
  background: rgba(255,255,255,.035);
  transition: border-color .2s ease, background .2s ease;
}
#editorForm .file-control:hover,
#editorForm .file-control:focus-within {
  border-color: rgba(207, 208, 210, .48);
  background: rgba(207, 208, 210, .06);
}
#editorForm .file-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}
#editorForm .file-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(207, 208, 210, .28);
  border-radius: 10px;
  padding: 0 13px;
  color: #f2f2f2;
  background: rgba(177, 178, 182, .12);
  font-size: 11px;
  font-weight: 700;
}
#editorForm .file-name {
  min-width: 0;
  overflow: hidden;
  color: #92909f;
  direction: ltr;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
#editorForm fieldset {
  gap: 12px;
  border-color: rgba(237, 237, 238, .12);
  border-radius: 15px;
  padding: 15px;
}
#editorForm legend { padding: 0 8px; color: #ebeced; font-size: 12px; font-weight: 700; }
#editorForm .link-editor { gap: 9px; }
#editorForm .link-row {
  grid-template-columns: minmax(100px, .8fr) minmax(120px, 1fr) minmax(150px, 1.3fr) 42px;
  gap: 8px;
  direction: rtl;
}
#editorForm .link-row input,
#editorForm .link-row select { min-width: 0; min-height: 44px; padding-inline: 10px; font-size: 11px; }
#editorForm .remove-link {
  min-height: 44px;
  border-color: rgba(255, 131, 153, .17);
  border-radius: 11px;
  color: #ffb6c4;
  background: rgba(255, 93, 125, .07);
  font-size: 18px;
}
#editorForm .remove-link:hover { border-color: rgba(255, 131, 153, .48); background: rgba(255, 93, 125, .15); }
#editorForm .glass-button { min-height: 44px; border-radius: 11px; }
#editorForm .editor-status { min-height: 0; }
#editorForm .editor-actions {
  position: sticky;
  z-index: 5;
  bottom: -1px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 -26px -26px;
  border-top: 1px solid rgba(237, 237, 238, .1);
  padding: 12px 26px 18px;
  background: rgba(20, 21, 22, .92);
  backdrop-filter: blur(18px);
}
#editorForm .save-button { min-height: 48px; border-radius: 13px; }
#editorForm .danger-button { min-width: 145px; min-height: 48px; border-radius: 13px; }

html[dir="ltr"] #editorForm { direction: ltr; }
html[dir="ltr"] #editorForm .editor-head > div { direction: ltr; text-align: left; }
html[dir="ltr"] #editorForm fieldset,
html[dir="ltr"] #editorForm .file-control,
html[dir="ltr"] #editorForm .link-row { direction: ltr; }
html[dir="ltr"] #editorForm legend { text-align: left; }

@media (max-width: 600px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  #editor.editor { width: calc(100vw - 20px); max-height: 94dvh; border-radius: 18px; }
  #editorForm { gap: 14px; padding: 18px; }
  #editorForm .form-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #editorForm .link-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 42px; }
  #editorForm .link-platform { grid-column: 1 / -1; }
  #editorForm .editor-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
    margin: 0 -18px -18px;
    padding: 10px 18px 14px;
  }
  #editorForm .danger-button { min-width: 0; }
}


/* ===== Vesper look options (layout, fonts, backgrounds, snow, music controls) ===== */
.profile-bg-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: center / cover no-repeat;
  pointer-events: none;
}
.profile-page[data-bg-filter="grayscale"] .profile-bg-image,
.profile-page[data-bg-filter="grayscale"] .profile-wallpaper-video { filter: grayscale(1) contrast(1.08); }
.profile-page[data-bg-filter="dim"] .profile-bg-image,
.profile-page[data-bg-filter="dim"] .profile-wallpaper-video { filter: brightness(.48) saturate(.85); }

.profile-page[data-layout="centered"] .profile-card {
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 16px 8px 0;
}
.profile-page[data-layout="centered"] .profile-card::before { content: none; }
.profile-page[data-layout="centered"] .profile-avatar-wrap { box-shadow: none; }
.profile-page[data-layout="centered"] .profile-footer { border-top: 0; }

.profile-page[data-font="sans"] .profile-card h1 {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
}
.profile-page[data-font="pixel"] .profile-card h1 {
  font-family: "Press Start 2P", "IBM Plex Sans Arabic", monospace;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0;
}
.profile-page[data-font="pixel"] .profile-bio,
.profile-page[data-font="pixel"] .profile-meta span,
.profile-page[data-font="pixel"] .profile-link span,
.profile-page[data-font="pixel"] .profile-big-number { font-family: "Press Start 2P", "IBM Plex Sans Arabic", monospace; }
.profile-page[data-font="pixel"] .profile-bio { font-size: 9px; line-height: 1.8; }
.profile-page[data-font="pixel"] .profile-meta span { font-size: 7px; }
.profile-page[data-font="pixel"] .profile-big-number { font-size: 30px; }

.profile-big-number {
  margin: 4px 0 6px;
  color: #f5f5f5;
  font: 600 clamp(44px, 12vw, 66px)/1 "Bodoni Moda", Georgia, serif;
  letter-spacing: -.03em;
  text-align: center;
  direction: ltr;
  text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 45%, transparent);
}
.profile-page[data-font="sans"] .profile-big-number { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 700; }

.snowflake {
  position: absolute;
  top: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, .7);
  animation: snowFall linear infinite;
}
@keyframes snowFall {
  from { transform: translate3d(0, -10vh, 0); }
  to { transform: translate3d(18px, 110vh, 0); }
}

.look-fieldset .toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.look-fieldset .toggle-grid .presence-consent { padding: 9px; font-size: 12px; }
.look-fieldset .show-legend { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .look-fieldset .toggle-grid { grid-template-columns: 1fr; }
}

/* Presence card: friendly fallback when nothing is being played, and a soft online pulse */
.discord-presence-empty { color: #8f8c9b; font-size: 11px; font-style: italic; }
.discord-presence-dot[data-status="online"] { animation: presencePulse 2.6s ease-out infinite; }
@keyframes presencePulse {
  0% { box-shadow: 0 0 0 0 rgba(67, 214, 129, .55); }
  70% { box-shadow: 0 0 0 7px rgba(67, 214, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(67, 214, 129, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .discord-presence-dot[data-status="online"] { animation: none; }
}

/* ===== Entry screen (before a profile is opened) ===== */
.entry-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 24px;
  border: 0;
  overflow: hidden;
  color: #f6f6f6;
  background:
    radial-gradient(ellipse 60% 45% at 50% 38%, rgba(146, 148, 154, .22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(93, 94, 99, .14), transparent 70%),
    linear-gradient(180deg, #0d0d0e 0%, #090909 100%);
  cursor: pointer;
  transition: opacity .8s ease, visibility .8s ease;
}
.entry-overlay.entered { opacity: 0; visibility: hidden; pointer-events: none; }

.entry-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(195, 196, 200, .18), transparent 65%);
  filter: blur(18px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: entryDrift 9s ease-in-out infinite alternate;
}
@keyframes entryDrift { to { transform: translate(-50%, -54%) scale(1.08); } }

.entry-stage {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
}
.entry-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(220, 221, 223, .28);
  animation: entryOrbit 12s linear infinite;
}
.entry-orbit::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #dadbdd;
  box-shadow: 0 0 12px #dadbdd;
}
@keyframes entryOrbit { to { transform: rotate(360deg); } }

.entry-emblem {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(220, 221, 223, .42);
  background: radial-gradient(circle at 50% 30%, rgba(209, 210, 212, .34), rgba(47, 48, 51, .55) 70%);
  box-shadow: 0 0 0 10px rgba(202, 203, 205, .04), 0 0 46px rgba(177, 179, 183, .35), inset 0 1px rgba(255, 255, 255, .12);
  font: 500 46px/1 "Bodoni Moda", Georgia, serif;
  color: #fcfcfd;
  text-shadow: 0 0 24px rgba(220, 221, 223, .6);
  animation: entryBreath 3s ease-in-out infinite;
}
@keyframes entryBreath {
  50% { box-shadow: 0 0 0 14px rgba(202, 203, 205, .02), 0 0 64px rgba(177, 179, 183, .45), inset 0 1px rgba(255, 255, 255, .12); }
}

.entry-wordmark {
  font: 500 clamp(18px, 3.6vw, 22px)/1 "Bodoni Moda", Georgia, serif;
  letter-spacing: .46em;
  padding-left: .46em;
  color: transparent;
  background: linear-gradient(100deg, #dbdcde 0%, #dbdcde 40%, #ffffff 50%, #dbdcde 60%, #dbdcde 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: entryShimmer 4.2s linear infinite;
}
@keyframes entryShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.entry-rule {
  display: block;
  width: 56px;
  height: 1px;
  margin: 16px 0 18px;
  background: linear-gradient(90deg, transparent, #cfd0d2, transparent);
}
.entry-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(220, 221, 223, .26);
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.entry-overlay:hover .entry-cta,
.entry-overlay:focus-visible .entry-cta {
  border-color: rgba(220, 221, 223, .6);
  background: rgba(207, 208, 210, .1);
  box-shadow: 0 0 28px rgba(177, 179, 183, .25);
}
.entry-overlay:focus-visible { outline: 2px solid rgba(220, 221, 223, .6); outline-offset: -6px; }
.entry-instruction {
  font: 500 12px/1 "IBM Plex Sans Arabic", system-ui, sans-serif;
  letter-spacing: .06em;
  color: #cccdcf;
}
.entry-spark {
  color: #dadbdd;
  font-size: 11px;
  line-height: 1;
  animation: entrySpark 2.6s ease-in-out infinite;
}
@keyframes entrySpark { 50% { opacity: .35; transform: scale(.8); } }

@media (prefers-reduced-motion: reduce) {
  .entry-glow, .entry-orbit, .entry-emblem, .entry-spark, .entry-wordmark { animation: none; }
}

/* ===== Song bar: bottom, text-first, Spotify button ===== */
.music-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0), rgba(8, 8, 10, .92) 45%);
}
.music-bar[hidden] { display: none !important; }
.music-bar-inner {
  pointer-events: auto;
  width: min(1000px, 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(16, 16, 19, .88);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color: #f2f2f4;
}
.music-cover-wrap { position: relative; flex: 0 0 auto; width: 44px; height: 44px; }
.music-cover,
.music-cover-fallback {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}
.music-cover-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2b2c31, #111113);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #d6d8de;
  font-size: 18px;
}
.music-meta { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.music-title {
  font: 600 14px/1.25 "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #f4f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-artist {
  font: 400 12px/1.25 "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #9b9ea8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: #0b0b0c;
  font-size: 13px;
  cursor: pointer;
}
.music-timeline { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; }
.music-time { min-width: 34px; color: #9b9ea8; font-size: 11px; font-variant-numeric: tabular-nums; }
.music-seek { flex: 1; min-width: 80px; accent-color: #e6e7eb; cursor: pointer; }
.spotify-play-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .04);
  color: #f4f4f6;
  text-decoration: none;
  font: 600 12px/1 "IBM Plex Sans Arabic", system-ui, sans-serif;
  transition: background .25s ease, border-color .25s ease;
}
.spotify-play-link {
  background: #1DB954;
  border-color: #1DB954;
  color: #000;
  font-weight: 700;
}
.spotify-play-link:hover,
.spotify-play-link:focus-visible { background: #1ed760; border-color: #1ed760; box-shadow: 0 0 22px rgba(29, 185, 84, .35); }
.spotify-mark { flex: 0 0 auto; display: block; }
.music-cover[hidden],
.music-cover-fallback[hidden],
.music-artist[hidden],
.music-timeline[hidden],
.music-toggle[hidden],
.spotify-play-link[hidden] { display: none !important; }
@media (max-width: 640px) {
  .music-bar-inner { flex-wrap: wrap; gap: 10px; }
  .music-meta { flex: 1 1 calc(100% - 110px); }
  .music-timeline { order: 5; flex: 1 1 100%; }
  .spotify-play-link { margin-inline-start: auto; }
}

/* ===== Discord: invite link and editor hint ===== */
.discord-invite-link {
  display: inline-flex;
  margin-top: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  color: #e8e9ee;
  font: 600 11px/1 "IBM Plex Sans Arabic", system-ui, sans-serif;
  text-decoration: none;
}
.discord-invite-link:hover { border-color: #ffffff; }
.discord-invite-hint {
  margin: 6px 0 0;
  color: #9b9ea8;
  font: 400 12px/1.6 "IBM Plex Sans Arabic", system-ui, sans-serif;
}
.discord-invite-hint a { margin-inline-start: 6px; color: #f2f2f4; text-decoration: underline; text-underline-offset: 3px; }

/* ===== Song cover preview in the editor ===== */
.song-cover-preview-row { margin: 6px 0 10px; }
.song-cover-preview {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  object-fit: cover;
}
.song-cover-fallback { display: grid; place-items: center; background: linear-gradient(135deg, #2b2c31, #111113); color: #d6d8de; font-size: 22px; }
.song-cover-preview[hidden] { display: none !important; }

/* ===== Monochrome luxury finish ===== */
.primary-button,
.save-button,
.create-account-button {
  background: linear-gradient(135deg, #ffffff 0%, #d7d9df 55%, #aeb2bb 100%);
  color: #0b0b0c;
  border: 0;
  box-shadow: 0 10px 30px rgba(255, 255, 255, .10);
}
.primary-button:hover,
.save-button:hover,
.create-account-button:hover { filter: brightness(1.04); }

/* ===== Entry medallion: smoother, GPU-friendly halo (no box-shadow animation) ===== */
.entry-emblem { position: relative; isolation: isolate; animation: none; }
.entry-emblem::before {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 231, 236, .22), transparent 68%);
  opacity: .55;
  pointer-events: none;
  animation: entryHalo 3s ease-in-out infinite;
}
@keyframes entryHalo { 50% { opacity: 1; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .entry-emblem::before { animation: none; } }

/* ===== Small helper text under fields ===== */
.field-hint {
  margin: 6px 2px 12px;
  color: #8f929b;
  font: 400 12px/1.6 "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* ===== Customization options (all optional; defaults match the current design) ===== */
.look-group-title { margin: 14px 0 6px; color: #d6d8de; font: 600 12px/1.4 "IBM Plex Sans Arabic", system-ui, sans-serif; letter-spacing: .04em; }
.look-fieldset input[type="file"] { color: #b9bcc4; font-size: 11px; margin-top: 6px; }
.look-fieldset .inline-color { display: flex; align-items: center; gap: 8px; color: #b9bcc4; font-size: 12px; min-height: 42px; }
.look-fieldset .inline-color > span { white-space: nowrap; }
.look-fieldset .inline-color input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #e6e7eb; flex: 0 0 auto; }
.look-fieldset .inline-color input[type="color"] { width: 40px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.dim-range { width: 100%; accent-color: #e6e7eb; }
.song-fields { display: block; }
.song-fields[hidden] { display: none !important; }

.profile-page[data-radius="sharp"] { --r-card: 6px; --r-btn: 4px; }
.profile-page[data-radius="soft"] { --r-card: 24px; --r-btn: 12px; }
.profile-page[data-radius="round"] { --r-card: 36px; --r-btn: 18px; }
.profile-page[data-radius="pill"] { --r-card: 44px; --r-btn: 999px; }
.profile-page[data-radius] .profile-card { border-radius: var(--r-card); }
.profile-page[data-radius] .profile-link,
.profile-page[data-radius] .share-profile-button { border-radius: var(--r-btn); }

.profile-page[data-card="solid"] .profile-card { background: #101012; border-color: rgba(255, 255, 255, .14); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); backdrop-filter: none; }
.profile-page[data-card="outline"] .profile-card { background: transparent; border: 1px solid rgba(255, 255, 255, .5); box-shadow: none; backdrop-filter: none; }

.profile-page[data-avatar="rounded"] .profile-avatar { border-radius: 20px; }
.profile-page[data-avatar="square"] .profile-avatar { border-radius: 4px; }

.profile-page[data-buttons="outline"] .profile-link { background: transparent; border: 1px solid rgba(255, 255, 255, .55); }
.profile-page[data-buttons="ghost"] .profile-link { background: transparent; border-color: transparent; }

.profile-page[data-name-size="s"] .profile-card h1 { font-size: 22px; }
.profile-page[data-name-size="l"] .profile-card h1 { font-size: clamp(38px, 9vw, 52px); }

.profile-page[data-dim] .profile-bg-image,
.profile-page[data-dim] .profile-wallpaper-video { opacity: calc(1 - var(--page-dim, 0)); }

.profile-page[data-text-custom] .profile-card h1,
.profile-page[data-text-custom] .profile-bio,
.profile-page[data-text-custom] .profile-meta span,
.profile-page[data-text-custom] .profile-handle,
.profile-page[data-text-custom] .profile-link span,
.profile-page[data-text-custom] .profile-big-number { color: var(--text-color); }

.profile-page[data-display-custom] .profile-card h1,
.profile-page[data-display-custom] .profile-big-number { font-family: var(--font-display); }
.profile-page[data-body-custom] .profile-bio,
.profile-page[data-body-custom] .profile-meta span,
.profile-page[data-body-custom] .profile-link span,
.profile-page[data-body-custom] .music-title,
.profile-page[data-body-custom] .music-artist { font-family: var(--font-body); }

/* ===== Discord presence card: name, server tag, custom status, game and Spotify artwork ===== */
.discord-presence-card { display: grid; gap: 12px; width: min(100%, 360px); margin: 16px auto 0; padding: 14px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(14, 14, 16, .72); backdrop-filter: blur(14px); color: #f2f2f4; text-align: start; }
.discord-presence-card[hidden] { display: none !important; }
.dpc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.discord-presence-avatar-wrap { position: relative; flex: 0 0 auto; width: 52px; height: 52px; }
.discord-presence-avatar { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .14); background: #1a1a1d; }
.discord-presence-dot { position: absolute; inset-inline-end: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid #111113; background: #6b6e77; }
.discord-presence-dot[data-status="online"] { background: #43d681; }
.discord-presence-dot[data-status="idle"] { background: #f0b232; }
.discord-presence-dot[data-status="dnd"] { background: #f23f43; }
.dpc-id { display: grid; gap: 3px; min-width: 0; }
.dpc-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dpc-name { font: 600 15px/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #f4f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpc-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); font: 600 11px/1.4 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #e6e7eb; }
.dpc-tag[hidden] { display: none !important; }
.dpc-tag-badge { width: 14px; height: 14px; border-radius: 4px; }
.discord-presence-status { font: 400 12px/1.4 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #9b9ea8; }
.dpc-body { display: grid; gap: 8px; }
.dpc-body[hidden] { display: none !important; }
.dpc-custom { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/1.5 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #d6d8de; }
.dpc-custom[hidden] { display: none !important; }
.discord-presence-activities { display: grid; gap: 8px; }
.discord-presence-empty { color: #8f8c9b; font: italic 400 12px/1.5 "IBM Plex Sans Arabic", system-ui, sans-serif; }
.dpc-activity { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.dpc-activity-art { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 9px; object-fit: cover; }
.dpc-activity-copy { display: grid; gap: 2px; min-width: 0; }
.dpc-activity-label { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1.2 "IBM Plex Sans Arabic", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #9b9ea8; }
.dpc-activity-copy strong { font: 600 13px/1.3 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #f4f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpc-activity-copy span:not(.dpc-activity-label) { font: 400 12px/1.4 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #9b9ea8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpc-spotify { border-color: rgba(29, 185, 84, .35); }
.dpc-spotify .dpc-activity-label { color: #1ed760; }
.dpc-notfound { display: flex; align-items: flex-start; gap: 12px; }
.dpc-notfound[hidden] { display: none !important; }
.dpc-x { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #f2f2f4; font-size: 13px; }
.dpc-notfound-copy { display: grid; gap: 4px; min-width: 0; }
.dpc-notfound-copy strong { font: 600 14px/1.3 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #f4f4f6; }
.dpc-notfound-copy p { margin: 0; font: 400 12px/1.5 "IBM Plex Sans Arabic", system-ui, sans-serif; color: #9b9ea8; }
.discord-invite-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); color: #f2f2f4; text-decoration: none; font: 600 12px/1 "IBM Plex Sans Arabic", system-ui, sans-serif; }
.discord-invite-link:hover { background: rgba(255, 255, 255, .08); }
.discord-glyph { flex: 0 0 auto; fill: currentColor; }
.discord-join-row { display: flex; justify-content: center; margin-top: 14px; }
.discord-join-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05); color: #f2f2f4; text-decoration: none; font: 600 12px/1 "IBM Plex Sans Arabic", system-ui, sans-serif; }
.discord-join-link:hover { background: rgba(255, 255, 255, .1); }

/* ===== Link style: icons only (like a social row) ===== */
.profile-links[data-style="icons"] { gap: 14px; }
.profile-links[data-style="icons"] .profile-link { width: 42px; height: 42px; padding: 0; justify-content: center; background: transparent; border: 0; box-shadow: none; }
.profile-links[data-style="icons"] .profile-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.profile-links[data-style="icons"] .profile-link svg { width: 26px; height: 26px; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .55)); }

/* ===== Music: skip buttons ===== */
.music-skip { flex: 0 0 auto; height: 30px; min-width: 38px; padding: 0 8px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: #c9cbd2; font: 600 11px/1 "IBM Plex Sans Arabic", system-ui, sans-serif; cursor: pointer; }
.music-skip[hidden] { display: none !important; }

/* keep the last lines clear of the bottom music bar */
.profile-page { padding-bottom: 120px; }

/* let the profile grow and scroll instead of being clipped */
.profile-page { overflow-x: clip; overflow-y: visible; }

/* ===== Header: Discord server button (replaces the signed-in email) ===== */
.discord-header-link { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.discord-header-link .discord-glyph { width: 15px; height: 15px; }

