.cosmetics-section {
  width: min(1180px, calc(100vw - 56px));
  margin: 10px auto 28px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(250px, 1fr) minmax(300px, 1.25fr);
  gap: 24px;
  align-items: center;
  border-color: rgba(85, 230, 255, .34);
  background: rgba(9, 12, 16, .93);
}

.cosmetics-heading h2 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
}

.cosmetics-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.cosmetics-chest-summary {
  min-height: 96px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .035);
}

.cosmetics-chest-summary div {
  display: flex;
  flex-direction: column;
}

.cosmetics-chest-summary strong {
  font-size: 34px;
  line-height: 1;
}

.cosmetics-chest-summary small,
.chant-picker label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.cosmetics-chest-summary button {
  min-height: 50px;
  padding: 0 21px;
  font-size: 14px;
}

.mini-chest {
  width: 52px;
  aspect-ratio: 1;
  position: relative;
  display: block;
  border: 2px solid rgba(85, 230, 255, .8);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #65727c 0 8%, #28343c 34%, #0d1216 72%);
  box-shadow: inset -8px -10px 15px rgba(0, 0, 0, .55), 0 0 18px rgba(85, 230, 255, .18);
}

.mini-chest::before,
.mini-chest::after,
.mini-chest i,
.mini-chest b {
  content: "";
  position: absolute;
  background: rgba(85, 230, 255, .62);
}

.mini-chest::before { width: 100%; height: 2px; left: 0; top: 50%; }
.mini-chest::after { width: 2px; height: 100%; left: 50%; top: 0; }
.mini-chest i { width: 70%; height: 2px; left: 15%; top: 24%; transform: rotate(28deg); }
.mini-chest b { width: 70%; height: 2px; left: 15%; bottom: 24%; transform: rotate(-28deg); }

.cosmetics-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.cosmetics-progress div {
  min-width: 0;
  padding: 9px;
  border-left: 2px solid rgba(215, 177, 95, .72);
  background: rgba(255, 255, 255, .035);
}

.cosmetics-progress span,
.cosmetics-progress b {
  display: block;
  white-space: nowrap;
}

.cosmetics-progress span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cosmetics-progress b { margin-top: 4px; font-size: 14px; }

.chant-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(300px, .75fr) 1fr;
  gap: 5px 12px;
  align-items: center;
}

.chant-picker label { grid-column: 1 / -1; }
.chant-picker select {
  width: 100%;
  min-height: 56px;
  padding: 0 15px;
  font-size: 15px;
  font-weight: 800;
}
.chant-rarity { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.chant-rarity[data-rarity="common"] { color: #f6f1e7; }
.chant-rarity[data-rarity="rare"] { color: #55e6ff; }
.chant-rarity[data-rarity="legendary"] { color: #f3c64f; }

.cosmetics-section.chest-earned { animation: cosmetic-earned 1.2s ease; }
@keyframes cosmetic-earned {
  0%, 100% { box-shadow: var(--shadow); }
  35% { box-shadow: 0 0 0 2px #f3c64f, 0 0 42px rgba(243, 198, 79, .52); }
}

.cosmetic-chest-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05070a;
  cursor: default;
}

.chest-vault-backdrop,
.chest-vault-backdrop > * {
  position: absolute;
  pointer-events: none;
}

.chest-vault-backdrop {
  inset: 0;
  overflow: hidden;
  background: #02040a;
}

.vault-stars {
  inset: 0;
  opacity: .8;
  background-image:
    radial-gradient(circle, #fff 0 1px, transparent 1.6px),
    radial-gradient(circle, #55e6ff 0 1.2px, transparent 1.8px),
    radial-gradient(circle, #f3c64f 0 1px, transparent 1.7px);
  background-position: 8px 14px, 47px 35px, 88px 9px;
  background-size: 96px 82px, 137px 103px, 173px 127px;
  animation: vault-stars-twinkle 2.4s steps(2, end) infinite;
}

.vault-platform {
  left: 50%;
  top: calc(50% + 122px);
  width: min(470px, 78vw);
  aspect-ratio: 3.25;
  transform: translateX(-50%);
  border: 4px solid #d7b15f;
  border-radius: 50%;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 31px, rgba(85, 230, 255, .3) 32px 34px),
    #111820;
  box-shadow: inset 0 12px 34px rgba(0, 0, 0, .76), 0 0 28px rgba(85, 230, 255, .42), 0 0 90px rgba(85, 230, 255, .15);
}

.vault-platform::after {
  content: "";
  position: absolute;
  inset: 18% 10%;
  border: 2px solid rgba(243, 198, 79, .7);
  border-radius: 50%;
}

@keyframes vault-stars-twinkle {
  0%, 100% { opacity: .62; }
  50% { opacity: .92; }
}

.chest-stage {
  width: 100vw;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.spherical-chest {
  width: 230px;
  aspect-ratio: 1;
  position: relative;
  display: block;
  perspective: 1000px;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .72));
  transform-origin: 50% 100%;
  will-change: transform;
}

.chest-hover-wrap {
  width: 230px;
  aspect-ratio: 1;
  position: relative;
  display: block;
  animation: chest-hover 2.2s ease-in-out infinite;
}

.chest-hover-shadow {
  position: absolute;
  left: 50%;
  top: calc(100% + 50px);
  width: 145px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .76);
  box-shadow: 0 0 25px rgba(85, 230, 255, .42);
  transform: translateX(-50%);
  animation: chest-shadow-hover 2.2s ease-in-out infinite;
}

@keyframes chest-hover {
  0%, 100% { transform: translateY(-12px); }
  50% { transform: translateY(-23px); }
}

@keyframes chest-shadow-hover {
  0%, 100% { opacity: .72; transform: translateX(-50%) scaleX(1); }
  50% { opacity: .45; transform: translateX(-50%) scaleX(.82); }
}

.chest-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  border: 4px solid #d7b15f;
  background: radial-gradient(circle at 32% 24%, #71808b 0 5%, #34434d 23%, #151d23 62%, #07090c 100%);
  box-shadow: inset -30px -26px 42px rgba(0, 0, 0, .68), inset 10px 10px 20px rgba(255, 255, 255, .07);
  backface-visibility: hidden;
}

.chest-half-top {
  top: 0;
  border-bottom-width: 3px;
  border-radius: 120px 120px 12px 12px;
  transform-origin: 96% 98%;
}

.chest-half-bottom {
  bottom: 0;
  border-top-width: 3px;
  border-radius: 12px 12px 120px 120px;
  transform-origin: 50% 0;
}

.chest-half b {
  position: absolute;
  left: 12%;
  width: 76%;
  height: 76%;
  border: 4px solid rgba(215, 177, 95, .7);
  border-radius: 50%;
}

.chest-half::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 4%;
  width: 92%;
  height: 22px;
  border: 3px solid #d7b15f;
  border-radius: 50%;
  background: #080d12;
  box-shadow: inset 0 0 13px rgba(85, 230, 255, .48);
}

.chest-half-top::after { bottom: -11px; }
.chest-half-bottom::after { top: -11px; }

.chest-half-top b { top: 22%; }
.chest-half-bottom b { bottom: 22%; }

.chest-seam {
  position: absolute;
  z-index: 5;
  left: -3%;
  top: calc(50% - 5px);
  width: 106%;
  height: 10px;
  border: 2px solid #f3c64f;
  border-radius: 50%;
  background: #121820;
  box-shadow: 0 0 15px rgba(243, 198, 79, .56);
}

.chest-lock {
  position: absolute;
  z-index: 8;
  left: calc(50% - 17px);
  top: calc(50% - 17px);
  width: 34px;
  aspect-ratio: 1;
  border: 4px solid #d7b15f;
  border-radius: 50%;
  background: #111a20;
  box-shadow: inset 0 0 10px rgba(85, 230, 255, .34), 0 0 15px rgba(243, 198, 79, .5);
}

.chest-core {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 82px;
  aspect-ratio: 1;
  opacity: 0;
  border-radius: 50%;
  background: #efffff;
  box-shadow: 0 0 22px #fff, 0 0 62px #55e6ff, 0 0 120px rgba(85, 230, 255, .72);
  transform: translate(-50%, -15%) scale(.2);
}

.chest-shine {
  position: absolute;
  z-index: 12;
  inset: -20%;
  overflow: hidden;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 45% 42%, rgba(255, 255, 255, .9), rgba(85, 230, 255, .32) 34%, transparent 70%);
  mix-blend-mode: screen;
}

.chest-shine::before {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -38%;
  width: 22%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .96), transparent);
  filter: blur(4px);
}

.is-opening .spherical-chest { animation: chest-charge-glow 5s ease-in forwards; }
.is-opening .chest-half-top { animation: chest-lid-release 5s cubic-bezier(.2, .85, .25, 1) forwards; }
.is-opening .chest-half-bottom { animation: chest-base-settle 5s ease forwards; }
.is-opening .chest-seam { animation: chest-seam-charge 5s ease forwards; }
.is-opening .chest-lock { animation: chest-lock-release 5s ease forwards; }
.is-opening .chest-core { animation: chest-core-rise 5s cubic-bezier(.12, .76, .16, 1) forwards; }
.is-opening .chest-shine { animation: chest-shine-build 5s ease-in forwards; }
.is-opening .chest-shine::before { animation: chest-shine-sweep 1.05s linear 4 forwards; }

@keyframes chest-charge-glow {
  0% { filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .72)) brightness(.9); }
  38% { filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .72)) drop-shadow(0 0 16px rgba(85, 230, 255, .24)) brightness(1.08); }
  68% { filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .72)) drop-shadow(0 0 38px rgba(85, 230, 255, .52)) brightness(1.35); }
  82% { filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .58)) drop-shadow(0 0 70px rgba(255, 255, 255, .86)) brightness(1.8); }
  100% { filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .72)) brightness(1); }
}

@keyframes chest-lid-release {
  0%, 78% { transform: rotateZ(0deg); filter: brightness(1); }
  90%, 100% { transform: rotateZ(48deg); filter: brightness(1.08); }
}

@keyframes chest-base-settle {
  0%, 78% { transform: translateY(0); }
  86% { transform: translateY(4px); }
  100% { transform: translateY(2px); }
}

@keyframes chest-seam-charge {
  0% { filter: brightness(.7); box-shadow: 0 0 8px rgba(243, 198, 79, .28); opacity: .75; }
  52% { filter: brightness(1.5); box-shadow: 0 0 25px rgba(243, 198, 79, .78); opacity: 1; }
  78% { filter: brightness(3.5); box-shadow: 0 0 52px #55e6ff, 0 0 110px rgba(85, 230, 255, .72); opacity: 1; }
  84%, 100% { filter: brightness(4); opacity: 0; }
}

@keyframes chest-lock-release {
  0% { filter: brightness(.8); transform: scale(1); opacity: 1; }
  66% { filter: brightness(2.1); transform: scale(1.08); box-shadow: 0 0 28px #55e6ff; }
  78% { filter: brightness(3.2); transform: scale(1.18); opacity: 1; }
  84%, 100% { transform: scale(.35); opacity: 0; }
}

@keyframes chest-core-rise {
  0%, 80% { opacity: 0; transform: translate(-50%, -15%) scale(.2); }
  86% { opacity: 1; transform: translate(-50%, -68%) scale(.62); }
  94% { opacity: 1; transform: translate(-50%, -145%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -205%) scale(1.42); }
}

@keyframes chest-shine-build {
  0% { opacity: .03; transform: scale(.88); }
  40% { opacity: .24; transform: scale(.95); }
  68% { opacity: .52; transform: scale(1.02); }
  80% { opacity: .96; transform: scale(1.12); }
  88%, 100% { opacity: 0; transform: scale(1.22); }
}

@keyframes chest-shine-sweep {
  from { transform: translateX(0) rotate(20deg); opacity: .18; }
  70% { opacity: .9; }
  to { transform: translateX(750%) rotate(20deg); opacity: 0; }
}

.chest-particles i {
  width: 10px;
  height: 10px;
  position: absolute;
  left: 50%;
  top: 48%;
  border-radius: 50%;
  opacity: 0;
  background: #55e6ff;
}

.is-opening .chest-particles i { animation: none; }
.chest-particles i:nth-child(2n) { background: #f3c64f; }
.chest-particles i:nth-child(1) { --tx: -190px; --ty: -120px; }
.chest-particles i:nth-child(2) { --tx: -125px; --ty: 145px; }
.chest-particles i:nth-child(3) { --tx: 175px; --ty: -145px; }
.chest-particles i:nth-child(4) { --tx: 205px; --ty: 70px; }
.chest-particles i:nth-child(5) { --tx: -220px; --ty: 25px; }
.chest-particles i:nth-child(6) { --tx: 85px; --ty: 180px; }
.chest-particles i:nth-child(7) { --tx: 20px; --ty: -205px; }
.chest-particles i:nth-child(8) { --tx: 155px; --ty: 140px; }
@keyframes chest-particle {
  0% { opacity: 1; transform: translate(0, 0) scale(.5); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.6); }
}

#chest-opening-label {
  position: absolute;
  top: calc(50% - 320px);
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.chest-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.chest-reward-constellation {
  width: min(300px, 72vw);
  height: 245px;
  overflow: visible;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--constellation-color, #f6f1e7) 72%, transparent));
}

.constellation-reward-line {
  stroke: var(--constellation-color, #f6f1e7);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 230;
  stroke-dashoffset: 230;
  opacity: .88;
}

.constellation-reward-star {
  fill: #fff;
  stroke: var(--constellation-color, #f6f1e7);
  stroke-width: 3;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.is-complete .chest-reward { animation: constellation-reward-rise .72s cubic-bezier(.18, .82, .22, 1) both; }
.is-complete .constellation-reward-line {
  animation: constellation-line-draw .72s calc(var(--edge-index) * 55ms) ease-out forwards;
}
.is-complete .constellation-reward-star {
  animation: constellation-star-pop .42s calc(.12s + var(--star-index) * 65ms) cubic-bezier(.2, 1.6, .35, 1) forwards;
}

@keyframes constellation-line-draw {
  from { stroke-dashoffset: 230; opacity: .1; }
  to { stroke-dashoffset: 0; opacity: .92; }
}

@keyframes constellation-star-pop {
  0% { opacity: 0; transform: scale(.1); }
  70% { opacity: 1; transform: scale(1.55); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes constellation-reward-rise {
  0% { opacity: 0; transform: translateY(76px) scale(.54); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chest-reward span { font-size: 12px; font-weight: 900; text-transform: uppercase; }
.chest-reward span[data-rarity="common"] { color: #f6f1e7; }
.chest-reward span[data-rarity="rare"] { color: #55e6ff; }
.chest-reward span[data-rarity="legendary"] { color: #f3c64f; }
.chest-reward strong { font-size: 36px; text-align: center; text-transform: uppercase; }
.chest-reward button { min-width: 220px; min-height: 50px; }
.is-complete .chest-hover-wrap {
  animation: opened-chest-yield .72s .12s ease-out forwards;
}
.is-complete .chest-half-top {
  transform: rotateZ(48deg);
}
.is-complete .chest-half-bottom { transform: translateY(2px); }
.is-complete .chest-seam,
.is-complete .chest-lock,
.is-complete .chest-core,
.is-complete .chest-shine { opacity: 0; }

@keyframes opened-chest-yield {
  0% { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(48px) scale(.7); }
}

.legendary-reveal-rays {
  inset: -12vmax;
  opacity: 0;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(243, 198, 79, .24) 0deg 2deg,
    transparent 2deg 11deg
  );
  -webkit-mask-image: radial-gradient(circle at center, transparent 0 9%, #000 28% 68%, transparent 90%);
  mask-image: radial-gradient(circle at center, transparent 0 9%, #000 28% 68%, transparent 90%);
  transform-origin: center;
  backface-visibility: hidden;
  contain: paint;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-opening .vault-stars {
  animation: legendary-stars-awaken 1.1s ease-in-out infinite;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-opening .spherical-chest {
  animation: legendary-chest-charge 5s cubic-bezier(.2, .7, .18, 1) forwards;
  will-change: transform;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-opening .chest-shine {
  background: radial-gradient(circle at 45% 42%, #fff 0 5%, rgba(243, 198, 79, .82) 20%, rgba(255, 224, 119, .28) 48%, transparent 74%);
  animation: legendary-shine-build 5s ease-in forwards;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-opening .chest-seam {
  box-shadow: 0 0 18px rgba(243, 198, 79, .7), 0 0 52px rgba(243, 198, 79, .28);
}

.cosmetic-chest-modal[data-rarity="legendary"] #chest-opening-label {
  color: #f3c64f;
  font-size: 17px;
  text-shadow: 0 0 18px rgba(243, 198, 79, .72);
  animation: legendary-label-pulse 1.15s ease-in-out infinite;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete::before {
  content: "";
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: #fff4c7;
  opacity: 0;
  animation: legendary-screen-flash .72s ease-out;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .legendary-reveal-rays {
  animation: legendary-rays-release 3.2s cubic-bezier(.12, .74, .2, 1) both;
  will-change: transform, opacity;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward {
  position: relative;
  z-index: 4;
  gap: 13px;
  margin-top: -38px;
  animation: legendary-reward-arrival 1.15s cubic-bezier(.14, 1.08, .24, 1) both;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward-constellation {
  width: min(430px, 82vw);
  height: 330px;
  filter:
    drop-shadow(0 0 8px #fff)
    drop-shadow(0 0 24px rgba(243, 198, 79, .95))
    drop-shadow(0 0 64px rgba(243, 198, 79, .46));
  animation: legendary-constellation-float 3.2s 1.1s ease-in-out infinite;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .constellation-reward-line {
  stroke-width: 4.4;
  opacity: 1;
  animation:
    legendary-line-draw .9s calc(var(--edge-index) * 48ms) ease-out forwards,
    legendary-line-glow 1.8s calc(1.15s + var(--edge-index) * 48ms) ease-in-out infinite;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .constellation-reward-star {
  stroke-width: 4;
  filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #f3c64f);
  animation:
    legendary-star-burst .6s calc(.08s + var(--star-index) * 58ms) cubic-bezier(.12, 1.8, .28, 1) forwards,
    legendary-star-pulse 1.7s calc(1.05s + var(--star-index) * 58ms) ease-in-out infinite;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward span {
  color: #f3c64f;
  font-size: 16px;
  text-shadow: 0 0 18px rgba(243, 198, 79, .72);
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward strong {
  color: #fff8dc;
  font-size: 46px;
  text-shadow: 0 0 12px #f3c64f, 0 0 38px rgba(243, 198, 79, .72);
  animation: legendary-name-arrival .72s .42s cubic-bezier(.2, 1.35, .28, 1) both;
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward button {
  border-color: #f3c64f;
  box-shadow: 0 0 28px rgba(243, 198, 79, .3);
}

.cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-particles i {
  width: 14px;
  height: 14px;
  z-index: 3;
  border-radius: 0;
  background: #fff8dc;
  clip-path: polygon(50% 0, 62% 35%, 100% 50%, 62% 65%, 50% 100%, 38% 65%, 0 50%, 38% 35%);
  box-shadow: 0 0 18px #f3c64f;
  animation: legendary-particle-burst 1.7s calc(var(--particle-index, 0) * 35ms) cubic-bezier(.16, .78, .22, 1) both;
}

.chest-particles i:nth-child(1) { --particle-index: 0; }
.chest-particles i:nth-child(2) { --particle-index: 1; }
.chest-particles i:nth-child(3) { --particle-index: 2; }
.chest-particles i:nth-child(4) { --particle-index: 3; }
.chest-particles i:nth-child(5) { --particle-index: 4; }
.chest-particles i:nth-child(6) { --particle-index: 5; }
.chest-particles i:nth-child(7) { --particle-index: 6; }
.chest-particles i:nth-child(8) { --particle-index: 7; }
.chest-particles i:nth-child(9) { --tx: -320px; --ty: -55px; --particle-index: 8; }
.chest-particles i:nth-child(10) { --tx: 310px; --ty: -35px; --particle-index: 9; }
.chest-particles i:nth-child(11) { --tx: -265px; --ty: -235px; --particle-index: 10; }
.chest-particles i:nth-child(12) { --tx: 255px; --ty: -245px; --particle-index: 11; }
.chest-particles i:nth-child(13) { --tx: -285px; --ty: 210px; --particle-index: 12; }
.chest-particles i:nth-child(14) { --tx: 295px; --ty: 205px; --particle-index: 13; }
.chest-particles i:nth-child(15) { --tx: -55px; --ty: -300px; --particle-index: 14; }
.chest-particles i:nth-child(16) { --tx: 45px; --ty: 285px; --particle-index: 15; }

@keyframes legendary-stars-awaken {
  0%, 100% { opacity: .68; }
  50% { opacity: 1; }
}

@keyframes legendary-chest-charge {
  0% { transform: translateZ(0) scale(1); }
  45% { transform: translateZ(0) scale(1.015); }
  72% { transform: translateZ(0) scale(1.045); }
  88% { transform: translateZ(0) scale(1.09); }
  94% { transform: translateZ(0) scale(1.04); }
  100% { transform: translateZ(0) scale(1.12); }
}

@keyframes legendary-shine-build {
  0% { opacity: .04; transform: scale(.88); }
  45% { opacity: .28; transform: scale(.98); }
  72% { opacity: .58; transform: scale(1.08); }
  88% { opacity: .92; transform: scale(1.3); }
  96% { opacity: 1; transform: scale(1.62); }
  100% { opacity: 0; transform: scale(2); }
}

@keyframes legendary-label-pulse {
  0%, 100% { opacity: .72; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1.035); }
}

@keyframes legendary-screen-flash {
  0% { opacity: .96; }
  24% { opacity: .38; }
  100% { opacity: 0; }
}

@keyframes legendary-rays-release {
  0% { opacity: 0; transform: rotate(-9deg) scale(.54); }
  20% { opacity: .72; }
  70% { opacity: .38; }
  100% { opacity: .16; transform: rotate(18deg) scale(1.08); }
}

@keyframes legendary-reward-arrival {
  0% { opacity: 0; transform: translate3d(0, 120px, 0) scale(.36); }
  54% { opacity: 1; transform: translate3d(0, -14px, 0) scale(1.08); }
  76% { transform: translate3d(0, 4px, 0) scale(.98); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes legendary-constellation-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.025); }
}

@keyframes legendary-line-draw {
  from { stroke-dashoffset: 230; opacity: .08; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes legendary-line-glow {
  0%, 100% { opacity: .88; }
  50% { opacity: 1; }
}

@keyframes legendary-star-burst {
  0% { opacity: 0; transform: scale(.05) rotate(-35deg); }
  68% { opacity: 1; transform: scale(2.1) rotate(8deg); }
  100% { opacity: 1; transform: scale(1.18) rotate(0); }
}

@keyframes legendary-star-pulse {
  0%, 100% { opacity: .88; transform: scale(1.08); }
  50% { opacity: 1; transform: scale(1.42); }
}

@keyframes legendary-name-arrival {
  0% { opacity: 0; transform: translateY(26px) scale(.72); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes legendary-particle-burst {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0); }
  16% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.4) rotate(210deg); }
}
@media (max-width: 900px) {
  .cosmetics-section {
    width: min(620px, calc(100vw - 28px));
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .cosmetics-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .cosmetics-section { margin-top: 14px; }
  .cosmetics-heading h2 { font-size: 30px; }
  .cosmetics-chest-summary { grid-template-columns: 50px 1fr; }
  .cosmetics-chest-summary button { grid-column: 1 / -1; width: 100%; }
  .cosmetics-progress { grid-template-columns: 1fr; }
  .cosmetics-progress div { display: flex; justify-content: space-between; gap: 10px; }
  .cosmetics-progress b { margin: 0; }
  .chant-picker { grid-template-columns: 1fr; }
  .chest-stage { min-height: 100dvh; }
  .chest-hover-wrap,
  .spherical-chest { width: 178px; }
  .vault-platform { top: calc(50% + 100px); width: 92vw; }
  #chest-opening-label { top: calc(50% - 255px); }
  .chest-reward strong { font-size: 28px; }
  .cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward-constellation {
    width: min(360px, 88vw);
    height: 280px;
  }
  .cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward strong { font-size: 34px; }
  .cosmetic-chest-modal[data-rarity="legendary"].is-complete .chest-reward { margin-top: -22px; }
  .cosmetic-chest-modal[data-rarity="legendary"] #chest-opening-label { font-size: 14px; }
}
