/* V1.62Beta: visible, persistent VFX quality control with immediate low-cost layers. */
html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle {
  --vfx-control-rgb: 91, 215, 230;
  --vfx-control-size: 64px;
  position: fixed !important;
  left: auto !important;
  right: 150px !important;
  top: auto !important;
  bottom: 12px !important;
  z-index: 1405 !important;
  width: var(--vfx-control-size) !important;
  height: var(--vfx-control-size) !important;
  min-width: var(--vfx-control-size) !important;
  min-height: var(--vfx-control-size) !important;
  max-width: var(--vfx-control-size) !important;
  max-height: var(--vfx-control-size) !important;
  padding: 5px 4px 4px !important;
  display: grid !important;
  grid-template-rows: 1fr auto !important;
  place-items: center !important;
  gap: 0 !important;
  overflow: hidden !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 1px solid rgba(var(--vfx-control-rgb), 0.62) !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 50% 35%, rgba(var(--vfx-control-rgb), 0.2), transparent 52%),
    linear-gradient(155deg, rgba(253, 255, 255, 0.94), rgba(218, 235, 237, 0.88)) !important;
  box-shadow:
    0 6px 16px rgba(14, 32, 36, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset,
    0 0 12px rgba(var(--vfx-control-rgb), 0.14) !important;
  color: rgb(25, 58, 63) !important;
  -webkit-text-fill-color: rgb(25, 58, 63) !important;
  cursor: pointer !important;
  isolation: isolate !important;
  transform: none !important;
  transition: filter 160ms ease, box-shadow 160ms ease !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle[data-vfx-preference="high"] {
  --vfx-control-rgb: 218, 161, 53;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle[data-vfx-preference="medium"] {
  --vfx-control-rgb: 58, 176, 191;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle[data-vfx-preference="low"] {
  --vfx-control-rgb: 105, 128, 143;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle::before,
html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle::after {
  content: "" !important;
  position: absolute !important;
  pointer-events: none !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle::before {
  inset: 3px !important;
  z-index: -1 !important;
  border: 1px solid rgba(var(--vfx-control-rgb), 0.24) !important;
  border-radius: inherit !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle::after {
  inset: -28% !important;
  z-index: 4 !important;
  opacity: 0 !important;
  background: conic-gradient(from 0deg, transparent 0 35%, rgba(255, 255, 255, 0.88) 43%, transparent 51% 100%) !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle:hover {
  filter: brightness(1.08) saturate(1.08) !important;
  box-shadow:
    0 7px 18px rgba(14, 32, 36, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.68) inset,
    0 0 16px rgba(var(--vfx-control-rgb), 0.26) !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle:focus-visible {
  outline: 3px solid rgba(var(--vfx-control-rgb), 0.52) !important;
  outline-offset: 3px !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle.is-switching::after {
  animation: vfx-quality-control-confirm 460ms cubic-bezier(0.16, 0.84, 0.24, 1) both !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph {
  position: relative !important;
  display: block !important;
  width: 27px !important;
  height: 25px !important;
  margin-top: 1px !important;
  border: 2px solid rgba(var(--vfx-control-rgb), 0.86) !important;
  border-top-color: transparent !important;
  border-radius: 50% !important;
  transform: rotate(-12deg) !important;
  box-shadow: 0 0 7px rgba(var(--vfx-control-rgb), 0.24) !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph::before,
html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph::after,
html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph i {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  border-radius: 50% !important;
  background: rgb(var(--vfx-control-rgb)) !important;
  transform: translate(-50%, -50%) !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph::before {
  width: 12px !important;
  height: 12px !important;
  opacity: 0.38 !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph::after {
  width: 5px !important;
  height: 5px !important;
  box-shadow:
    -10px -7px 0 -1px rgba(var(--vfx-control-rgb), 0.88),
    11px -4px 0 -1px rgba(var(--vfx-control-rgb), 0.72),
    8px 9px 0 -1px rgba(var(--vfx-control-rgb), 0.78) !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph i {
  width: 2px !important;
  height: 2px !important;
}

html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-code {
  position: relative !important;
  z-index: 2 !important;
  display: block !important;
  max-width: 100% !important;
  margin: -1px 0 1px !important;
  padding: 0 !important;
  color: rgb(24, 54, 59) !important;
  -webkit-text-fill-color: rgb(24, 54, 59) !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0.045em !important;
  text-shadow: 0 1px rgba(255, 255, 255, 0.78) !important;
}

html body:not(.maintenance-mode).battle-controls-active > #vfxQualityToggle.vfx-quality-toggle {
  --vfx-control-size: clamp(50px, 4.2vw, 58px);
  --vfx-control-gap: 8px;
  right: calc(max(12px, env(safe-area-inset-right)) + (var(--vfx-control-size) + var(--vfx-control-gap)) * 3) !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
}

html body[data-vfx-quality="medium"]:not(.maintenance-mode) .settlement-manifest-item::after,
html body[data-vfx-quality="medium"]:not(.maintenance-mode) .round-ready-ribbon::before,
html body[data-vfx-quality="medium"]:not(.maintenance-mode) #fxLayer .settlement-reveal[data-settlement-focus="hero"]::after {
  opacity: 0.54 !important;
}

html body[data-vfx-quality="low"]:not(.maintenance-mode) .opponent-commitment.action-committed::before,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest::before,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest-item::after,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .round-ready-ribbon::before,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .round-ready-ribbon::after,
html body[data-vfx-quality="low"]:not(.maintenance-mode) #fxLayer .settlement-reveal[data-settlement-focus="hero"]::after,
html body[data-vfx-quality="low"]:not(.maintenance-mode) #fxLayer .settlement-outcome {
  animation: none !important;
}

html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest::before,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest-item::after,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .round-ready-ribbon::before,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .round-ready-ribbon::after,
html body[data-vfx-quality="low"]:not(.maintenance-mode) #fxLayer .settlement-reveal[data-settlement-focus="hero"]::after {
  display: none !important;
  content: none !important;
}

html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest-stage,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .settlement-manifest-item,
html body[data-vfx-quality="low"]:not(.maintenance-mode) .round-ready-ribbon,
html body[data-vfx-quality="low"]:not(.maintenance-mode) #fxLayer .settlement-reveal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation-duration: 240ms !important;
}

@keyframes vfx-quality-control-confirm {
  0% { opacity: 0; transform: rotate(-30deg) scale(0.76); }
  34% { opacity: 0.82; }
  100% { opacity: 0; transform: rotate(74deg) scale(1.06); }
}

@media (max-width: 720px) {
  html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle {
    --vfx-control-size: 50px;
    right: 116px !important;
    bottom: 8px !important;
    padding: 4px 3px 3px !important;
  }

  html body:not(.maintenance-mode).battle-controls-active > #vfxQualityToggle.vfx-quality-toggle {
    --vfx-control-size: clamp(40px, 10.6vw, 44px);
    --vfx-control-gap: 6px;
    right: calc(var(--duel-mobile-edge-r, max(8px, env(safe-area-inset-right))) + (var(--vfx-control-size) + var(--vfx-control-gap)) * 3) !important;
    bottom: var(--duel-mobile-bottom, max(8px, env(safe-area-inset-bottom))) !important;
  }

  html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-glyph {
    width: 22px !important;
    height: 20px !important;
    border-width: 1.5px !important;
  }

  html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle .vfx-quality-code {
    font-size: 6.5px !important;
  }
}

@media (max-width: 390px) {
  html body:not(.maintenance-mode).battle-controls-active > #vfxQualityToggle.vfx-quality-toggle {
    --vfx-control-size: 40px;
    --vfx-control-gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle,
  html body:not(.maintenance-mode) > #vfxQualityToggle.vfx-quality-toggle::after {
    animation: none !important;
    transition: none !important;
  }
}
