.settings-page {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
}

.settings-heading {
  margin-bottom: 26px;
}

.settings-eyebrow {
  margin-bottom: 8px;
  color: #a7eaff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.settings-heading h1 {
  color: var(--text-dark);
  font-size: clamp(28px, 4vw, 38px);
}

.settings-heading > p:last-child,
.settings-section-heading p {
  margin-top: 6px;
  color: var(--text-muted);
}

.settings-card {
  margin-bottom: 20px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid rgba(164, 129, 255, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(0, 195, 255, 0.08), transparent 42%),
    linear-gradient(145deg, rgba(26, 20, 45, 0.98), rgba(17, 16, 33, 0.98));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22), 0 0 26px rgba(164, 83, 255, 0.08);
}

.settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-section-heading h2 {
  color: var(--text-dark);
  font-size: 20px;
}

.settings-section-heading p {
  font-size: 13px;
}

.profile-photo-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(189, 130, 255, 0.17);
}

.profile-photo-preview,
.profile-photo-fallback {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  overflow: hidden;
  border: 2px solid rgba(103, 233, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(103, 233, 255, 0.18), 0 0 34px rgba(197, 79, 255, 0.16);
}

.profile-photo-preview {
  object-fit: cover;
}

.profile-photo-button {
  position: relative;
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.profile-photo-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.profile-photo-button .profile-photo-preview,
.profile-photo-button .profile-photo-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-photo-button .profile-photo-preview[hidden],
.profile-photo-button .profile-photo-fallback[hidden] {
  display: none;
}

.profile-photo-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  transition: opacity 0.15s;
}

.profile-photo-button:hover .profile-photo-overlay,
.profile-photo-button:focus-visible .profile-photo-overlay {
  opacity: 1;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(189, 130, 255, 0.25);
  border-radius: 10px;
}

.profile-stat strong {
  font-size: 22px;
}

.profile-stat span {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-vynzo-id {
  width: 100%;
  max-width: 340px;
  padding: 8px 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(189, 130, 255, 0.25);
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
}

.profile-photo-preview[hidden],
.profile-photo-fallback[hidden] {
  display: none;
}

.profile-photo-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #ff3caa, #885cff 62%, #4b9dff);
  font-size: 36px;
  font-weight: 700;
}

.profile-photo-controls {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.profile-photo-controls label,
.settings-field > span:first-child {
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 650;
}

.profile-photo-controls input {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 13px;
}

.profile-photo-controls small,
.settings-field small {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-settings-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.username-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(189, 130, 255, 0.34);
  border-radius: 12px;
  background: rgba(8, 8, 20, 0.58);
  color: #a7eaff;
}

.username-input-wrap:focus-within,
.settings-field textarea:focus {
  border-color: rgba(103, 233, 255, 0.76);
  box-shadow: 0 0 20px rgba(103, 233, 255, 0.12);
}

.username-input-wrap input,
.settings-field textarea {
  width: 100%;
  border: 1px solid rgba(189, 130, 255, 0.34);
  border-radius: 12px;
  outline: none;
  background: rgba(8, 8, 20, 0.58);
  color: var(--text-dark);
}

.username-input-wrap input {
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
}

.settings-field textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
}

.settings-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-status {
  min-height: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.settings-status.is-success {
  color: #8af0bf;
}

.settings-status.is-error {
  color: #ff91ae;
}

.settings-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(110deg, #ff3caa, #8b5cff 58%, #4b9dff);
  box-shadow: 0 0 18px rgba(197, 79, 255, 0.18);
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.settings-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(197, 79, 255, 0.32);
}

.settings-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.settings-button-secondary {
  border-color: rgba(189, 130, 255, 0.38);
  background: rgba(189, 130, 255, 0.11);
  box-shadow: none;
}

.session-settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.session-settings-card .settings-section-heading {
  margin: 0;
}

@media (max-width: 560px) {
  .settings-page {
    padding: 24px 16px 36px;
  }

  .profile-photo-section {
    align-items: flex-start;
    gap: 14px;
  }

  .profile-photo-preview,
  .profile-photo-fallback {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
  }

  .profile-photo-controls input {
    width: 100%;
  }

  .session-settings-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

.privacy-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(164, 129, 255, 0.28);
  border-radius: 14px;
  cursor: pointer;
}

.privacy-toggle-text strong {
  display: block;
  color: var(--text-dark);
}

.privacy-toggle-text small {
  color: var(--text-muted);
}

.privacy-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.privacy-switch {
  flex: none;
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s;
}

.privacy-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.privacy-toggle input:checked ~ .privacy-switch {
  background: linear-gradient(90deg, #a453ff, #00c3ff);
}

.privacy-toggle input:checked ~ .privacy-switch::after {
  transform: translateX(22px);
}

.privacy-toggle input:focus-visible ~ .privacy-switch {
  outline: 2px solid #ffd76a;
  outline-offset: 2px;
}

.privacy-toggle input:disabled ~ .privacy-switch {
  opacity: 0.5;
}
.message-privacy {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.message-privacy-label {
  color: var(--text-dark);
  font-weight: 700;
}

.message-privacy-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(164, 129, 255, 0.4);
  border-radius: 12px;
  background: rgba(17, 16, 33, 0.9);
  color: var(--text-dark);
  font: inherit;
  cursor: pointer;
}

.message-privacy-select:focus-visible {
  outline: 2px solid #ffd76a;
  outline-offset: 2px;
}

.message-privacy-select:disabled {
  opacity: 0.6;
}

.message-privacy small {
  color: var(--text-muted);
}
/* Colorful glow theme with golden motion */
.settings-page {
  position: relative;
  isolation: isolate;
}

.settings-page::before,
.settings-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  animation: settings-drift 16s ease-in-out infinite alternate;
}

.settings-page::before {
  top: -12vmax;
  right: -10vmax;
  background: radial-gradient(circle, #ffd54a, #ff8a00 45%, transparent 70%);
}

.settings-page::after {
  bottom: -14vmax;
  left: 5vmax;
  background: radial-gradient(circle, #ff2bd6, #3a7bff 50%, transparent 70%);
  animation-duration: 20s;
  animation-direction: alternate-reverse;
}

@keyframes settings-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-8vmax, 6vmax) scale(1.2); }
}

@keyframes settings-gold-flow {
  to { background-position: 300% 0; }
}

@keyframes settings-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 213, 74, 0.45), 0 0 34px rgba(255, 43, 214, 0.3); }
  50% { box-shadow: 0 0 24px rgba(255, 213, 74, 0.8), 0 0 54px rgba(0, 229, 255, 0.45); }
}

.settings-eyebrow {
  background: linear-gradient(90deg, #ffd54a, #fff3b0, #ff8a00, #ffd54a);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: settings-gold-flow 6s linear infinite;
}

.settings-heading h1 {
  background: linear-gradient(90deg, #00e5ff, #b46bff, #ff2bd6, #ffd54a, #00e5ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(180, 107, 255, 0.55));
  animation: settings-gold-flow 10s linear infinite;
}

.settings-card {
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(145deg, rgba(30, 18, 58, 0.96), rgba(14, 14, 40, 0.97)) padding-box,
    linear-gradient(120deg, #00e5ff, #b46bff, #ff2bd6, #ffd54a, #fff3b0, #ffd54a, #00e5ff) border-box;
  background-size: 100% 100%, 300% 100%;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.3), 0 0 30px rgba(180, 107, 255, 0.28), 0 0 60px rgba(255, 213, 74, 0.1);
  animation: settings-gold-flow 12s linear infinite;
}

.settings-section-heading h2 {
  color: #fff3b0;
  text-shadow: 0 0 14px rgba(255, 213, 74, 0.6);
}

.profile-photo-button,
.profile-photo-section > .profile-photo-preview,
.profile-photo-section > .profile-photo-fallback {
  animation: settings-pulse 3.6s ease-in-out infinite;
}

.profile-photo-preview,
.profile-photo-fallback {
  border-color: #ffd54a;
}

.profile-photo-fallback {
  background: linear-gradient(135deg, #ff2bd6, #7b5cff, #00e5ff);
}

.profile-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 43, 214, 0.16), rgba(0, 229, 255, 0.14));
  border-color: rgba(255, 213, 74, 0.55);
  box-shadow: 0 0 18px rgba(255, 213, 74, 0.2);
}

.profile-stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 224, 120, 0.35) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: settings-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes settings-shimmer {
  to { background-position: -150% 0; }
}

.profile-stat strong {
  background: linear-gradient(90deg, #ffd54a, #fff3b0, #ff8a00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 213, 74, 0.6));
}

.profile-stat span {
  color: #d9ccff;
}

.profile-vynzo-id {
  color: #ffe58a;
  border-color: rgba(255, 213, 74, 0.55);
  box-shadow: inset 0 0 12px rgba(255, 213, 74, 0.12);
}

.settings-button {
  background: linear-gradient(90deg, #ff2bd6, #7b5cff, #00e5ff);
  box-shadow: 0 0 18px rgba(123, 92, 255, 0.55);
}

.settings-button:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(255, 213, 74, 0.75);
}

.settings-field input:focus,
.settings-field textarea:focus,
.username-input-wrap:focus-within {
  border-color: #ffd54a;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, 0.25), 0 0 16px rgba(255, 213, 74, 0.35);
}

.privacy-toggle input:checked ~ .privacy-switch {
  background: linear-gradient(90deg, #ffd54a, #ff8a00);
  box-shadow: 0 0 14px rgba(255, 213, 74, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .settings-page::before,
  .settings-page::after,
  .settings-card,
  .settings-eyebrow,
  .settings-heading h1,
  .profile-stat::after,
  .profile-photo-button {
    animation: none;
  }
}
/* Compact stats beside the photo */
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

.profile-stat {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 6px 10px;
  gap: 1px;
  border-radius: 8px;
}

.profile-stat strong {
  font-size: 16px;
}

.profile-stat span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Equal-size stat boxes that fit up to 5 characters */
.profile-stat {
  flex: 0 0 82px;
  width: 82px;
  min-width: 0;
  align-items: center;
  text-align: center;
}

.profile-stat strong {
  max-width: 100%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}