/* Adaptive effects for low-power hardware and iOS WebKit 27+. */

.nv-performance-suggestion {
  position: fixed;
  z-index: 2147483000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  width: min(380px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(14, 116, 144, .24);
  border-radius: 18px;
  background: rgba(248, 252, 255, .98);
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
  color: #0f172a;
  font-family: inherit;
}

.dark .nv-performance-suggestion {
  border-color: rgba(103, 232, 249, .25);
  background: rgba(8, 24, 38, .98);
  color: #f8fafc;
}

.nv-performance-suggestion__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #cffafe;
  font-size: 18px;
}

.dark .nv-performance-suggestion__icon {
  background: rgba(8, 145, 178, .24);
}

.nv-performance-suggestion__copy {
  min-width: 0;
}

.nv-performance-suggestion__title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.nv-performance-suggestion__description {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.dark .nv-performance-suggestion__description {
  color: #94a3b8;
}

.nv-performance-suggestion__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.nv-performance-suggestion__button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.nv-performance-suggestion__button:focus-visible {
  outline: 3px solid rgba(6, 182, 212, .35);
  outline-offset: 2px;
}

.nv-performance-suggestion__button--primary {
  background: #0891b2;
  color: #fff;
}

.nv-performance-suggestion__button--secondary {
  background: #e2e8f0;
  color: #334155;
}

.dark .nv-performance-suggestion__button--secondary {
  background: #1e293b;
  color: #e2e8f0;
}

@media (max-width: 639px) {
  .nv-performance-suggestion {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(360px, calc(100vw - 24px));
  }
}

/* Keep decorative loops off the compositor when users cannot see them. */
html.nv-document-hidden .nv-motion-managed,
html.nv-document-hidden .nv-motion-managed::before,
html.nv-document-hidden .nv-motion-managed::after,
.nv-motion-managed.nv-motion-offscreen,
.nv-motion-managed.nv-motion-offscreen::before,
.nv-motion-managed.nv-motion-offscreen::after {
  animation-play-state: paused !important;
}

.nv-motion-managed.nv-motion-offscreen {
  will-change: auto !important;
}

html.nv-document-hidden progress.nv-motion-managed.nv-progress::-webkit-progress-value,
progress.nv-motion-managed.nv-motion-offscreen.nv-progress::-webkit-progress-value {
  animation-play-state: paused !important;
}

html.nv-document-hidden progress.nv-motion-managed.nv-progress::-moz-progress-bar,
progress.nv-motion-managed.nv-motion-offscreen.nv-progress::-moz-progress-bar {
  animation-play-state: paused !important;
}

html.nv-performance-lite body [class*="backdrop-blur"],
html.nv-performance-lite body.nv-app-ui .nv-topbar-surface,
html.nv-performance-lite body.nv-modern-ui :is(
  .nv-liquid-glass,
  .nv-settings-shell,
  .nv-settings-body,
  .nv-streak-card,
  .nv-matchmaking-arena,
  .nv-import-action-card
) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html.nv-performance-lite :is(
  .nv-topbar-wordmark-glow,
  .nv-auth-wordmark-glow,
  .nv-auth-watcher-body,
  .nv-user-status-badge
) {
  filter: none !important;
  will-change: auto !important;
}

/* Lite Mode must remove the painted halo, not only its blur filter. */
html.nv-performance-lite :is(.nv-topbar-halo, .nv-topbar-wordmark-glow) {
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}

html.nv-performance-lite .nv-topbar-wordmark-text {
  text-shadow: none !important;
}

html.nv-performance-lite :is(
  .nv-topbar-wordmark-glow,
  .nv-user-status-badge,
  .nv-golden-pulse,
  .nv-battle-glow,
  .nv-radar-ping,
  .nv-ready-panel,
  .nv-ready-signal.is-active,
  .nv-ready-bar-fill::after,
  .nv-ice-glow,
  .nv-dot-pulse,
  .nv-shared-flame,
  .nv-arena-scanner,
  .nv-arena-versus__ring,
  .nv-arena-versus__signal i,
  .nv-auth-wordmark-glow,
  .nv-auth-watcher-body,
  .nv-auth-watcher-shadow,
  .nv-auth-watcher-orbit
) {
  animation: none !important;
}

html.nv-performance-lite .nv-user-status-badge-shell::after {
  animation: none !important;
}

html.nv-performance-lite .nv-user-status-badge-shell::after,
html.nv-performance-lite .nv-auth-watcher-orbit {
  display: none !important;
}

html.nv-performance-lite :is(.nv-card-glow, .nv-hover-lift, .nv-podium-card):hover {
  transform: none !important;
  box-shadow: none !important;
}

@keyframes nv-flashcard-mobile-flip-lite-forward {
  from { transform: rotateY(-72deg); }
  to { transform: rotateY(0deg); }
}

@keyframes nv-flashcard-mobile-flip-lite-backward {
  from { transform: rotateY(72deg); }
  to { transform: rotateY(0deg); }
}

@media (max-width: 639px) {
  html.nv-performance-lite .nv-flashcard-shell .nv-flashcard-front {
    animation: nv-flashcard-mobile-flip-lite-backward 480ms cubic-bezier(.22, .61, .36, 1) !important;
  }

  html.nv-performance-lite .nv-flashcard-shell .nv-flashcard-back {
    animation: nv-flashcard-mobile-flip-lite-forward 480ms cubic-bezier(.22, .61, .36, 1) !important;
  }
}
