/* Shared by classic and New Year. Only entrance animations are replaced. */
.motion-managed .rating-podium-scene::before,
.motion-managed .rating-iceberg,
.motion-managed .rating-list-row { animation: none; }
.motion-managed .rating-podium-card {
  animation: podium-card-float 5.8s 760ms cubic-bezier(.36, 0, .24, 1) infinite;
}
.motion-managed .rating-podium-card.is-first { animation-delay: 680ms; }
.motion-managed .rating-podium-card.is-second { animation-delay: 1120ms; }
.motion-managed .rating-podium-card.is-third { animation-delay: 1480ms; }

/* A 200+ player panel used a 17,000px live backdrop. Its existing gradients,
   borders and shadows supply the appearance without re-filtering that huge layer. */
.motion-managed .rating-showcase-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@supports (content-visibility: auto) {
  .motion-managed .rating-list-row {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 62px;
    overflow-clip-margin: 24px;
  }
}
/* Preparing only currently entering rows avoids hundreds of permanent GPU layers. */
.motion-managed .rating-list-row[data-motion="enter"] { will-change: opacity, transform; }

.avatar:has(> .avatar-fallback) { position: relative; }
.avatar-fallback { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.avatar img, .avatarx-photo img { position: relative; z-index: 1; }
img[data-media-state] { transition: opacity 180ms ease; }
img[data-media-state="loading"], img[data-media-state="error"], img[data-media-src] { opacity: 0; }

.motion-managed .motion-target[data-motion="waiting"]:not(.rating-podium-scene),
.motion-managed .rating-podium-card[data-motion="waiting"],
.motion-managed .rating-podium-scene[data-motion="waiting"]::before,
.motion-managed .rating-podium-scene[data-motion="waiting"] .rating-iceberg { opacity: 0; }
.motion-managed .motion-target[data-motion="enter"]:not(.rating-podium-scene) {
  animation: iceberg-content-in 440ms var(--motion-delay, 0ms) cubic-bezier(.2, .8, .2, 1) backwards;
}
.motion-managed .rating-podium-scene[data-motion="enter"]::before,
.motion-managed .rating-podium-scene[data-motion="enter"] .rating-iceberg {
  animation: ranking-iceberg-in 440ms var(--motion-delay, 0ms) cubic-bezier(.2, .8, .2, 1) backwards;
}
.motion-managed .rating-podium-card[data-motion="enter"] {
  animation: ranking-card-in 440ms var(--motion-delay, 0ms) cubic-bezier(.2, .8, .2, 1) backwards,
    podium-card-float 5.8s 760ms cubic-bezier(.36, 0, .24, 1) infinite;
}
.motion-managed .rating-podium-card.is-first[data-motion="enter"] { animation-delay: var(--motion-delay, 0ms), 680ms; }
.motion-managed .rating-podium-card.is-second[data-motion="enter"] { animation-delay: var(--motion-delay, 0ms), 1120ms; }
.motion-managed .rating-podium-card.is-third[data-motion="enter"] { animation-delay: var(--motion-delay, 0ms), 1480ms; }
@keyframes iceberg-content-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Reserve the same podium geometry while a different rating is being fetched. */
.rating-loading { overflow: hidden; }
.rating-loading .rating-podium-scene::before,
.rating-loading .rating-podium-scene::after { display: none; }
.rating-loading .rating-podium-scene { margin-top: -6px; }
.rating-loading-podium { position: absolute; inset: 0; }
.rating-loading-person {
  position: absolute; bottom: 27.5%; width: 26%; height: 42%;
  border-radius: 26px 26px 17px 17px; background: var(--surface-2, #183041);
}
.rating-loading-person:nth-child(1) { left: 1.5%; }
.rating-loading-person:nth-child(2) { left: 35%; width: 30%; bottom: 38%; }
.rating-loading-person:nth-child(3) { right: 1.5%; }
.rating-loading-line { height: 62px; margin-top: 8px; border-radius: 16px; background: var(--surface-2, #183041); }
.rating-loading-shapes { opacity: .55; animation: iceberg-loading-breathe 1.6s ease-in-out infinite alternate; }
.rating-loading-status { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
@keyframes iceberg-loading-breathe { to { opacity: .85; } }
@media (prefers-reduced-motion: reduce) {
  .motion-managed .motion-target[data-motion],
  .motion-managed .rating-podium-card[data-motion] { opacity: 1; animation: none !important; }
  .motion-managed .rating-podium-scene[data-motion]::before { opacity: .96; animation: none !important; }
  .motion-managed .rating-podium-scene[data-motion] .rating-iceberg { opacity: .72; animation: none !important; }
  .rating-loading-shapes { animation: none; }
  img[data-media-state] { transition: none; }
}

/* Carousel art is opaque: no need to re-blur the moving scene underneath it. */
.event-carousel .hero-card.has-image,
html[data-season="newyear"] .event-carousel .hero-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Only the current neighbourhood needs compositor layers. Layout stays intact. */
.event-carousel-slide:not(.is-prepared) { visibility: hidden; }
.event-carousel-slide.is-prepared { will-change: transform, opacity; }
.event-carousel-slide:not(.is-prepared) .hero-card::after {
  animation-play-state: paused;
  will-change: auto;
}
/* The duplicate-to-first jump must not restart scale/opacity on the same card. */
.event-carousel-track.is-jump-reset .event-carousel-slide { transition: none; }
