/* ── Social icon column (top-right of profile card) ── */

.profile-social-column {
  position: absolute;
  top: 56px;
  right: 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.profile-social-column[hidden] {
  display: none !important;
}

.profile-social-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  overflow: hidden;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.profile-social-icon-btn__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  line-height: 1;
}

.profile-social-icon-btn__glyph svg {
  width: 1rem;
  height: 1rem;
}

.profile-social-icon-x {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.profile-social-icon-btn--x {
  --platform-r: 29;
  --platform-g: 155;
  --platform-b: 240;
}

.profile-social-icon-btn--youtube {
  --platform-r: 255;
  --platform-g: 0;
  --platform-b: 0;
}

.profile-social-icon-btn--instagram {
  --platform-r: 193;
  --platform-g: 53;
  --platform-b: 132;
}

.profile-social-icon-btn--tiktok {
  --platform-r: 37;
  --platform-g: 244;
  --platform-b: 238;
}

.profile-social-icon-btn--discord {
  --platform-r: 88;
  --platform-g: 101;
  --platform-b: 242;
}

.profile-social-icon-btn--spotify {
  --platform-r: 30;
  --platform-g: 215;
  --platform-b: 96;
}

.profile-social-icon-btn--soundcloud {
  --platform-r: 255;
  --platform-g: 85;
  --platform-b: 0;
}

.profile-social-icon-btn--github {
  --platform-r: 240;
  --platform-g: 240;
  --platform-b: 240;
}

.profile-social-icon-btn--twitch {
  --platform-r: 145;
  --platform-g: 70;
  --platform-b: 255;
}

.profile-social-icon-btn:hover,
.profile-social-icon-btn:focus-visible {
  background: rgba(var(--platform-r), var(--platform-g), var(--platform-b), 0.14);
  border-color: rgba(var(--platform-r), var(--platform-g), var(--platform-b), 0.45);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--platform-r), var(--platform-g), var(--platform-b), 0.2);
  outline: none;
}

.profile-social-icon-btn--website:hover,
.profile-social-icon-btn--website:focus-visible {
  background: rgba(var(--accent-r), 0.12);
  border-color: rgba(var(--accent-r), 0.45);
  box-shadow: 0 6px 16px var(--accent-glow-soft);
}

/* ── Custom links grid ── */

.profile-links-section {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: 4px;
}

.profile-links-layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-r), 0.22);
  background: rgba(var(--accent-r), 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.profile-links-layout-btn[hidden] {
  display: none !important;
}

.profile-links-add-btn,
.profile-identities-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(var(--accent-r), 0.45);
  background: rgba(var(--accent-r), 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.profile-links-add-btn[hidden],
.profile-identities-add-btn[hidden] {
  display: none !important;
}

.profile-links-add-btn:hover,
.profile-links-add-btn:focus-visible,
.profile-identities-add-btn:hover,
.profile-identities-add-btn:focus-visible {
  background: rgba(var(--accent-r), 0.16);
  border-color: rgba(var(--accent-r), 0.62);
  transform: translateY(-1px);
  outline: none;
}

.profile-links-layout-btn:hover,
.profile-links-layout-btn:focus-visible {
  background: rgba(var(--accent-r), 0.16);
  border-color: rgba(var(--accent-r), 0.38);
  transform: translateY(-1px);
  outline: none;
}

.profile-custom-links {
  display: grid;
  gap: 10px;
  width: 100%;
}

.profile-custom-links[hidden] {
  display: none !important;
}

.profile-custom-links[data-count="1"] {
  grid-template-columns: 1fr;
}

.profile-custom-links[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.profile-custom-links[data-count="3"] {
  grid-template-columns: 1fr 1fr;
}

.profile-custom-links[data-count="3"] .custom-link-pill:nth-child(3) {
  grid-column: 1 / -1;
}

.profile-custom-links[data-count="4"] {
  grid-template-columns: 1fr 1fr;
}

.custom-link-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
  color: #fff;
  border: 1.5px solid rgba(var(--accent-r), 0.72);
  background: rgba(var(--accent-r), 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 16px var(--accent-glow-soft),
    0 4px 14px rgba(var(--accent-r), 0.24);
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition),
    filter var(--transition);
}

.custom-link-pill__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
}

.custom-link-pill__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px 10px 2px;
  margin: 0 -8px -10px -2px;
}

.custom-link-pill__title-label {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 1),
    0 2px 8px rgba(0, 0, 0, 0.95);
}

.custom-link-pill__arrow {
  flex-shrink: 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.custom-link-pill--filled {
  background: rgba(var(--accent-r), 0.58);
  border-color: rgba(var(--accent-r), 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 20px var(--accent-glow-soft),
    0 4px 18px rgba(var(--accent-r), 0.34);
}

.custom-link-pill--outline {
  background: rgba(var(--accent-r), 0.14);
  border: 2px solid rgba(var(--accent-r), 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-r), 0.16),
    0 0 18px var(--accent-glow-soft),
    0 4px 14px rgba(var(--accent-r), 0.2);
}

.custom-link-pill--glass {
  background: rgba(var(--accent-r), 0.2);
  border-color: rgba(var(--accent-r), 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px var(--accent-glow-soft),
    0 4px 16px rgba(var(--accent-r), 0.22);
}

.custom-link-pill--filled:hover,
.custom-link-pill--filled:focus-visible,
.custom-link-pill--outline:hover,
.custom-link-pill--outline:focus-visible,
.custom-link-pill--glass:hover,
.custom-link-pill--glass:focus-visible {
  transform: translateY(-1px) scale(1.01);
  border-color: rgba(var(--accent-r), 0.95);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 24px var(--accent-glow),
    0 6px 20px rgba(var(--accent-r), 0.36);
  outline: none;
}

.custom-link-pill--filled:hover,
.custom-link-pill--filled:focus-visible {
  background: rgba(var(--accent-r), 0.68);
}

.custom-link-pill--outline:hover,
.custom-link-pill--outline:focus-visible {
  background: rgba(var(--accent-r), 0.2);
}

.custom-link-pill--glass:hover,
.custom-link-pill--glass:focus-visible {
  background: rgba(var(--accent-r), 0.28);
}

/* ── Edit Profile: Socials + Links ── */

.profile-socials-accordion,
.profile-custom-links-accordion {
  margin-top: 0;
}

.edit-section-hint {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.edit-socials-list,
.edit-custom-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edit-social-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.edit-custom-link-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.edit-custom-link-row[data-expanded="true"] {
  border-color: rgba(var(--accent-r), 0.22);
  background: rgba(var(--accent-r), 0.05);
}

.edit-custom-link-row__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.edit-custom-link-row__toggle:hover,
.edit-custom-link-row__toggle:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.edit-custom-link-row__chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: transform var(--transition);
}

.edit-custom-link-row[data-expanded="true"] .edit-custom-link-row__chevron {
  transform: rotate(90deg);
}

.edit-custom-link-row__toggle-label {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-custom-link-row__panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

.edit-custom-link-row[data-expanded="true"] .edit-custom-link-row__panel {
  display: flex;
}

.edit-social-row__header,
.edit-custom-link-row__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-social-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.edit-social-row__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.edit-social-row__name,
.edit-custom-link-row__label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.edit-social-row__actions,
.edit-custom-link-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.edit-reorder-btn,
.edit-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.edit-reorder-btn:hover:not(:disabled),
.edit-reorder-btn:focus-visible:not(:disabled),
.edit-remove-btn:hover,
.edit-remove-btn:focus-visible {
  background: rgba(var(--accent-r), 0.12);
  border-color: rgba(var(--accent-r), 0.28);
  color: var(--text-primary);
  outline: none;
}

.edit-reorder-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.edit-section-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(var(--accent-r), 0.35);
  background: rgba(var(--accent-r), 0.06);
  color: var(--accent);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.edit-section-add-btn[hidden] {
  display: none !important;
}

.edit-section-add-btn:hover,
.edit-section-add-btn:focus-visible {
  background: rgba(var(--accent-r), 0.14);
  border-color: rgba(var(--accent-r), 0.5);
  outline: none;
}

.edit-socials-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.edit-socials-picker[hidden] {
  display: none !important;
}

.edit-social-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.edit-social-picker-btn__icon {
  display: flex;
  width: 1rem;
  height: 1rem;
}

.edit-social-picker-btn__icon svg {
  width: 1rem;
  height: 1rem;
}

.edit-social-picker-btn:hover,
.edit-social-picker-btn:focus-visible {
  background: rgba(var(--accent-r), 0.12);
  border-color: rgba(var(--accent-r), 0.32);
  outline: none;
}

.edit-custom-link-row__icon-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-custom-link-row__icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-custom-link-row__icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.62rem;
  overflow: hidden;
  flex-shrink: 0;
}

.edit-custom-link-row__icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-profile-form__file-label {
  cursor: pointer;
}

.edit-custom-link-row__icon-remove {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.edit-custom-link-row__icon-remove:hover,
.edit-custom-link-row__icon-remove:focus-visible {
  color: var(--accent);
  outline: none;
}

/* ── Discard unsaved changes dialog ── */

.edit-profile-discard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.edit-profile-discard-overlay[hidden] {
  display: none !important;
}

.edit-profile-discard-dialog {
  width: min(100%, 320px);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 22, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.edit-profile-discard-dialog__title {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.edit-profile-discard-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-profile-discard-dialog__btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.edit-profile-discard-dialog__btn--primary {
  border-color: rgba(var(--accent-r), 0.35);
  background: rgba(var(--accent-r), 0.14);
  color: var(--accent);
}

.edit-profile-discard-dialog__btn:hover,
.edit-profile-discard-dialog__btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.edit-profile-discard-dialog__btn--primary:hover,
.edit-profile-discard-dialog__btn--primary:focus-visible {
  background: rgba(var(--accent-r), 0.22);
}

@media (max-width: 480px) {
  .profile-social-column {
    top: 44px;
    right: 14px;
    gap: 5px;
  }

  .profile-social-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .profile-custom-links[data-count="2"],
  .profile-custom-links[data-count="3"],
  .profile-custom-links[data-count="4"] {
    gap: 8px;
  }

  .custom-link-pill {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.72rem;
  }
}
