/* Shared motion layers keep the original title and badge artwork intact. */
:is(.profile-design-title, .profile-equipped-title, .store-profile-badge) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  animation: avlu-title-aura 7s ease-in-out infinite;
}
:is(.profile-design-title, .profile-equipped-title, .store-profile-badge)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, #fff0d331 48%, transparent 65%);
  transform: translateX(-140%);
  pointer-events: none;
  animation: avlu-title-sheen 8s ease-in-out infinite;
}
:is(.profile-design-title, .profile-equipped-title, .store-profile-badge) img,
.profile-design-option[data-item-slot="title"] > img,
[data-store-slot="title"] .store-product-art > img,
.store-inventory-item-title .store-inventory-art > img {
  transform-origin: center;
  animation: avlu-title-emblem 7s ease-in-out infinite;
}
.profile-design-badges > img,
.profile-equipped-badges > span > img,
.profile-badge-choice > img,
[data-store-slot="badge"] .store-product-art > img,
.store-inventory-item-badge .store-inventory-art > img {
  transform-origin: center;
  animation: avlu-badge-drift 6s ease-in-out infinite;
}
.profile-design-badges > img:nth-child(2),
.profile-equipped-badges > span:nth-child(2) > img,
.profile-badge-choice:nth-child(2n) > img { animation-delay: -1.2s; }
.profile-design-badges > img:nth-child(3),
.profile-equipped-badges > span:nth-child(3) > img,
.profile-badge-choice:nth-child(3n) > img { animation-delay: -2.4s; }
.profile-design-badges > img:nth-child(4),
.profile-equipped-badges > span:nth-child(4) > img { animation-delay: -3.6s; }
.profile-design-badges > img:nth-child(5),
.profile-equipped-badges > span:nth-child(5) > img { animation-delay: -4.8s; }
.profile-equipped-badges > span,
:is([data-store-slot="badge"], [data-store-slot="title"]) .store-product-art,
:is(.store-inventory-item-badge, .store-inventory-item-title) .store-inventory-art {
  position: relative;
  isolation: isolate;
}
.profile-equipped-badges > span::after,
:is([data-store-slot="badge"], [data-store-slot="title"]) .store-product-art::after,
:is(.store-inventory-item-badge, .store-inventory-item-title) .store-inventory-art::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 25% 25%, #e8d1ff 0 1px, transparent 2px),
    radial-gradient(circle at 82% 68%, #ffd993 0 1px, transparent 2px);
  pointer-events: none;
  animation: avlu-badge-stardust 9s ease-in-out infinite;
}
.profile-equipped-badges > span::after { inset: -3px; }
.profile-equipped-badges > span:nth-child(even)::after { animation-delay: -4.5s; }
.profile-badge-choice.is-selected > img { animation-duration: 5s; }
.collection-motion-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid #9bcbb43d;
  border-radius: 6px;
  color: #afdcc7;
  background: #23403326;
  font-size: 9px !important;
}
@keyframes avlu-title-aura {
  0%, 100% { box-shadow: inset 0 0 10px #e7c57406, 0 0 8px #e7c57406; }
  50% { box-shadow: inset 0 0 14px #e7c57418, 0 0 13px #e7c57414; }
}
@keyframes avlu-title-sheen {
  0%, 40% { transform: translateX(-140%); }
  65%, 100% { transform: translateX(140%); }
}
@keyframes avlu-title-emblem {
  0%, 100% { transform: translateY(0) rotate(-2deg); filter: drop-shadow(0 0 2px #e1b76b26); }
  50% { transform: translateY(-1.5px) rotate(2deg); filter: drop-shadow(0 0 6px #e1b76b70); }
}
@keyframes avlu-badge-drift {
  0%, 100% { transform: translateY(0) rotate(-2deg); filter: drop-shadow(0 0 2px #c8a3f02a); }
  50% { transform: translateY(-1.8px) rotate(2deg); filter: drop-shadow(0 0 5px #c8a3f080); }
}
@keyframes avlu-badge-stardust {
  0%, 100% { opacity: .3; transform: rotate(-12deg) scale(.96); }
  50% { opacity: .85; transform: rotate(12deg) scale(1.04); }
}

html[data-cosmetic-motion="off"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge),
html[data-cosmetic-motion="off"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge) img,
html[data-cosmetic-motion="off"] .profile-design-option[data-item-slot="title"] > img,
html[data-cosmetic-motion="off"] .profile-design-badges > img,
html[data-cosmetic-motion="off"] .profile-equipped-badges > span > img,
html[data-cosmetic-motion="off"] .profile-badge-choice > img,
html[data-cosmetic-motion="off"] :is([data-store-slot="badge"],[data-store-slot="title"]) .store-product-art > img,
html[data-cosmetic-motion="off"] :is(.store-inventory-item-badge,.store-inventory-item-title) .store-inventory-art > img { animation:none!important;transform:none!important;filter:none; }
html[data-cosmetic-motion="off"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge)::after,
html[data-cosmetic-motion="off"] .profile-equipped-badges > span::after,
html[data-cosmetic-motion="off"] :is([data-store-slot="badge"],[data-store-slot="title"]) .store-product-art::after,
html[data-cosmetic-motion="off"] :is(.store-inventory-item-badge,.store-inventory-item-title) .store-inventory-art::after { animation:none!important;display:none; }
.atelier-motion-controls { padding:12px 13px 0; }
.atelier-motion-controls > div { display:flex;flex-wrap:wrap;justify-content:center;gap:7px; }
.atelier-motion-controls button { padding:6px 9px;border:1px solid #70538655;border-radius:8px;background:#201828;color:#bba6cd;font:inherit;font-size:10px;cursor:pointer; }
.atelier-motion-controls button[aria-pressed="true"] { border-color:#b99acf;background:#392748;color:#ead9f7; }
.atelier-motion-controls small { display:block;margin:7px 0 0;font-size:9px;color:#ad99bc;text-align:center;line-height:1.6; }
@media(max-width:1200px) { .profile-atelier-preview.is-docked:not([data-expanded=true]) .atelier-motion-controls { display:none; } }
@media (prefers-reduced-motion: reduce) {
  html:not([data-cosmetic-motion="on"]) :is(.profile-design-title, .profile-equipped-title, .store-profile-badge),
  html:not([data-cosmetic-motion="on"]) :is(.profile-design-title, .profile-equipped-title, .store-profile-badge) img,
  html:not([data-cosmetic-motion="on"]) .profile-design-option[data-item-slot="title"] > img,
  html:not([data-cosmetic-motion="on"]) .profile-design-badges > img,
  html:not([data-cosmetic-motion="on"]) .profile-equipped-badges > span > img,
  html:not([data-cosmetic-motion="on"]) .profile-badge-choice > img,
  html:not([data-cosmetic-motion="on"]) :is([data-store-slot="badge"], [data-store-slot="title"]) .store-product-art > img,
  html:not([data-cosmetic-motion="on"]) :is(.store-inventory-item-badge, .store-inventory-item-title) .store-inventory-art > img {
    animation: none !important;
    transform: none !important;
    filter: none;
  }
  html:not([data-cosmetic-motion="on"]) :is(.profile-design-title, .profile-equipped-title, .store-profile-badge)::after,
  html:not([data-cosmetic-motion="on"]) .profile-equipped-badges > span::after,
  html:not([data-cosmetic-motion="on"]) :is([data-store-slot="badge"], [data-store-slot="title"]) .store-product-art::after,
  html:not([data-cosmetic-motion="on"]) :is(.store-inventory-item-badge, .store-inventory-item-title) .store-inventory-art::after {
    animation: none !important;
    display: none;
  }
}

html[data-cosmetic-motion="on"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge) { animation:avlu-title-aura 7s ease-in-out infinite!important; }
html[data-cosmetic-motion="on"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge)::after { animation:avlu-title-sheen 8s ease-in-out infinite!important; }
html[data-cosmetic-motion="on"] :is(.profile-design-title,.profile-equipped-title,.store-profile-badge) img,
html[data-cosmetic-motion="on"] .profile-design-option[data-item-slot="title"] > img,
html[data-cosmetic-motion="on"] [data-store-slot="title"] .store-product-art > img,
html[data-cosmetic-motion="on"] .store-inventory-item-title .store-inventory-art > img { animation:avlu-title-emblem 7s ease-in-out infinite!important; }
html[data-cosmetic-motion="on"] .profile-design-badges > img,
html[data-cosmetic-motion="on"] .profile-equipped-badges > span > img,
html[data-cosmetic-motion="on"] .profile-badge-choice > img,
html[data-cosmetic-motion="on"] [data-store-slot="badge"] .store-product-art > img,
html[data-cosmetic-motion="on"] .store-inventory-item-badge .store-inventory-art > img { animation:avlu-badge-drift 6s ease-in-out infinite!important; }
html[data-cosmetic-motion="on"] .profile-equipped-badges > span::after,
html[data-cosmetic-motion="on"] :is([data-store-slot="badge"],[data-store-slot="title"]) .store-product-art::after,
html[data-cosmetic-motion="on"] :is(.store-inventory-item-badge,.store-inventory-item-title) .store-inventory-art::after { animation:avlu-badge-stardust 9s ease-in-out infinite!important; }

/* Cinematic server photos keep their motion separate from readable card content.
   SVG decorations already animate themselves; custom shop photos stay still. */
.slot-background .server-store-art { overflow: hidden; }
@keyframes avlu-server-scene-drift {
  from { transform: scale(1.025) translateX(-.3%); }
  to { transform: scale(1.06) translateX(.3%); }
}
@keyframes avlu-server-hero-pan {
  from { background-position: 48% 46%; }
  to { background-position: 52% 54%; }
}
@media (prefers-reduced-motion: no-preference) {
  html:not([data-cosmetic-motion="off"]) :is(
    .slot-background:is(:hover,:focus-within) .server-store-art:not(.has-custom-photo) > img[src$=".webp"],
    .store-preview-dialog[data-store-scope="server"][open] .store-preview-bg[src$=".webp"]:not([hidden]),
    .server-editor-mock-bg[data-scenic-motion="true"]
  ) {
    transform-origin: center;
    animation: avlu-server-scene-drift 32s ease-in-out infinite alternate;
  }
  html:not([data-cosmetic-motion="off"]) .server-profile-hero.has-custom-background[data-scenic-motion="true"] {
    animation: avlu-server-hero-pan 32s ease-in-out infinite alternate;
  }
}
/* An explicit choice matches the existing personal cosmetic motion control. */
html[data-cosmetic-motion="on"] :is(
  .slot-background:is(:hover,:focus-within) .server-store-art:not(.has-custom-photo) > img[src$=".webp"],
  .store-preview-dialog[data-store-scope="server"][open] .store-preview-bg[src$=".webp"]:not([hidden]),
  .server-editor-mock-bg[data-scenic-motion="true"]
) {
  transform-origin: center;
  animation: avlu-server-scene-drift 32s ease-in-out infinite alternate !important;
}
html[data-cosmetic-motion="on"] .server-profile-hero.has-custom-background[data-scenic-motion="true"] {
  animation: avlu-server-hero-pan 32s ease-in-out infinite alternate !important;
}
html[data-cosmetic-motion="off"] :is(
  .slot-background .server-store-art > img,
  .store-preview-dialog[data-store-scope="server"] .store-preview-bg,
  .server-editor-mock-bg[data-scenic-motion="true"],
  .server-profile-hero[data-scenic-motion="true"]
) { animation: none !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-cosmetic-motion="on"]) :is(
    .slot-background .server-store-art > img,
    .store-preview-dialog[data-store-scope="server"] .store-preview-bg,
    .server-editor-mock-bg[data-scenic-motion="true"],
    .server-profile-hero[data-scenic-motion="true"]
  ) { animation: none !important; transform: none !important; }
}
html[data-cosmetic-motion="on"] .profile-design-badges > img:nth-child(2),html[data-cosmetic-motion="on"] .profile-equipped-badges > span:nth-child(2) > img,html[data-cosmetic-motion="on"] .profile-badge-choice:nth-child(2n) > img { animation-delay:-1.2s!important; }
html[data-cosmetic-motion="on"] .profile-design-badges > img:nth-child(3),html[data-cosmetic-motion="on"] .profile-equipped-badges > span:nth-child(3) > img,html[data-cosmetic-motion="on"] .profile-badge-choice:nth-child(3n) > img { animation-delay:-2.4s!important; }
html[data-cosmetic-motion="on"] .profile-design-badges > img:nth-child(4),html[data-cosmetic-motion="on"] .profile-equipped-badges > span:nth-child(4) > img { animation-delay:-3.6s!important; }
html[data-cosmetic-motion="on"] .profile-design-badges > img:nth-child(5),html[data-cosmetic-motion="on"] .profile-equipped-badges > span:nth-child(5) > img { animation-delay:-4.8s!important; }
