/* =========================================================
   ZOR — Performance mode toggle + light CSS helpers
   ========================================================= */

.perf-mode-btn {
  position: relative;
  gap: 0;
  min-width: 40px;
  padding: 0 6px;
  flex-direction: column;
  justify-content: center;
}

.perf-mode-btn__icon {
  display: none;
  flex-shrink: 0;
}

.perf-mode-btn.is-max .perf-mode-btn__icon--max {
  display: block;
}

.perf-mode-btn.is-performance .perf-mode-btn__icon--perf {
  display: block;
}

.perf-mode-btn__label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 1px;
  opacity: 0.85;
  color: inherit;
}

.perf-mode-btn.is-max {
  color: #3fe0d0;
  border-color: rgba(63, 224, 208, 0.35);
}

.perf-mode-btn.is-performance {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

/* Soft CSS relief in Performance mode (JS still cuts canvas work) */
html.perf-mode-performance .fx-particles {
  opacity: 0.55;
}

html.perf-mode-performance .zbg-char {
  will-change: transform, opacity;
}

html.perf-mode-performance .zbg-fx {
  opacity: 0.7;
}

@media (max-width: 860px) {
  .perf-mode-btn {
    min-width: 36px;
  }
  .perf-mode-btn__label {
    font-size: 7px;
  }
  /* Mobile background: subtle blur in both MAX and Performance modes */
  .zbg-stage,
  html.perf-mode-max .zbg-stage,
  html.perf-mode-performance .zbg-stage {
    filter: blur(2px) !important;
    -webkit-filter: blur(2px) !important;
  }
}

/* Celestial stars/meteors & 3D glyphs: disabled in Performance mode */
html.perf-mode-performance :is(.bar-celestial-particles, .profile-header__particles, .ph-glyph, .ph-meteor, .ph-star, .ph-particles-nebula),
html[data-perf-mode="performance"] :is(.bar-celestial-particles, .profile-header__particles, .ph-glyph, .ph-meteor, .ph-star, .ph-particles-nebula),
html.perf-mode-performance .bar-celestial-particles,
html[data-perf-mode="performance"] .bar-celestial-particles,
html.perf-mode-performance .profile-header__particles,
html[data-perf-mode="performance"] .profile-header__particles,
html.perf-mode-performance .ph-glyph,
html[data-perf-mode="performance"] .ph-glyph {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
}

/* ---------- Mobile App Install Button (Mobile Only) ---------- */
.app-install-btn {
  display: none !important;
  position: relative;
  gap: 0;
  min-width: 38px;
  height: 38px;
  padding: 0 4px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: var(--panel-raised, rgba(18, 22, 31, 0.85));
  border-radius: var(--radius-clip, 4px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-install-btn:hover,
.app-install-btn:active {
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  color: #ffffff;
}

.app-install-btn svg {
  pointer-events: none;
}

.app-install-btn__icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
}

.app-install-btn__label {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-top: 1px;
  opacity: 0.95;
  color: inherit;
  pointer-events: none;
}

/* Strictly mobile only (screen width <= 860px) */
@media (max-width: 860px) {
  .app-install-btn {
    display: inline-flex !important;
    min-width: 34px;
    height: 34px;
  }
  .app-install-btn__icon {
    width: 15px;
    height: 15px;
  }
  .app-install-btn__label {
    font-size: 6.5px;
  }
}

/* Hide when already running as installed standalone mobile app */
@media (display-mode: standalone) {
  .app-install-btn {
    display: none !important;
  }
}

/* Mobile App Install Modal / Sheet */
.app-install-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.app-install-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.app-install-modal {
  width: 100%;
  max-width: 440px;
  background: rgba(14, 18, 25, 0.98);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 240, 255, 0.2);
  padding: 22px 20px 24px;
  color: #fff;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-install-modal-backdrop.is-open .app-install-modal {
  transform: translateY(0);
}
.app-install-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.app-install-modal__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}
.app-install-modal__title {
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0;
}
.app-install-modal__sub {
  font-size: 12px;
  color: #8da4be;
  margin: 2px 0 0;
}
.app-install-modal__close {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #8da4be;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-install-modal__steps {
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-install-modal__step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #c4d7ec;
  line-height: 1.4;
}
.app-install-modal__step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-install-modal__action-btn {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #050a12;
  font-family: var(--font-display, "Chakra Petch", sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-install-modal__action-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}



