/* ZIAMW Rewards: motion layer (hero count-up, drawn marker, floating icons, podium, risers).
   Everything here only runs when the visitor allows motion. */

.fl-layer { display: none; }

@media (prefers-reduced-motion: no-preference) {

  /* Floating line icons behind the hero */
  .hero { position: relative; }
  .fl-layer { display: block; position: absolute; z-index: -1; top: -40px; bottom: -60px; left: calc(50% - 50vw); right: calc(50% - 50vw); overflow: hidden; pointer-events: none; }
  .fl { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); color: var(--sun-dk); opacity: 0; transform: rotate(var(--r)); animation: fl-in .9s var(--d) ease-out forwards, fl-drift var(--t) calc(var(--d) + .9s) ease-in-out infinite alternate; }
  :root[data-theme="dark"] .fl { color: var(--sun); }
  .fl svg { display: block; width: 100%; height: 100%; }
  @keyframes fl-in { from { opacity: 0; translate: 0 18px; } to { opacity: var(--o, .3); translate: 0 0; } }
  @keyframes fl-drift { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx) var(--dy); rotate: var(--dr); } }
  :root[data-theme="dark"] .fl { --o: .2; }

  /* The yellow marker under the prize pool draws itself */
  .anim .h1-big .marker path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s cubic-bezier(.6, 0, .25, 1) forwards; }
  .anim .h1-big .marker path + path { animation-delay: .35s; }
  .anim.counting .h1-big .marker path { animation-delay: 1s; }
  .anim.counting .h1-big .marker path + path { animation-delay: 1.35s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }

  /* Crown over 1st place: a small bounce and a glint every few seconds */
  .p1::before { transform-origin: 50% 90%; animation: crown 4.5s 1.2s ease-in-out infinite; }
  @keyframes crown {
    0%, 78%, 100% { transform: none; filter: none; }
    84% { transform: translateY(-5px) rotate(-6deg) scale(1.08); filter: drop-shadow(0 0 10px rgba(255, 194, 26, .9)); }
    90% { transform: translateY(0) rotate(4deg) scale(1.02); filter: drop-shadow(0 0 4px rgba(255, 194, 26, .6)); }
  }

  /* Podium cards rise in when the board first shows */
  .podium.rise .p { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
  .podium.rise .p2 { animation-delay: .08s; }
  .podium.rise .p1 { animation-delay: .16s; }
  .podium.rise .p3 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

  /* A player who climbed since the last visit: the row glows once and shows an arrow */
  .r.r-up { animation: glow 2.8s ease-out; border-radius: 10px; }
  @keyframes glow { 0%, 25% { background: var(--sun-soft); box-shadow: -10px 0 0 var(--sun-soft), 10px 0 0 var(--sun-soft); } 100% { background: transparent; box-shadow: -10px 0 0 transparent, 10px 0 0 transparent; } }
}

.up-badge { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; background: var(--sun-soft); color: var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.up-badge svg { width: 10px; height: 10px; }

/* Preview controls: only shown with ?anim=1 */
.anim-panel { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 10px; border-radius: 16px; background: var(--night); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: 14px; font-weight: 600; }
.anim-panel b { padding: 0 6px; color: var(--sun); }
.anim-panel button, .anim-panel a { min-height: 40px; padding: 0 14px; border: 1px solid #3A3D44; border-radius: 10px; background: #22252B; color: #fff; font: inherit; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.anim-panel button:hover, .anim-panel a:hover { border-color: var(--sun); color: #fff; }
@media (max-width: 960px) { .anim-panel { left: 12px; right: 12px; bottom: 84px; flex-wrap: nowrap; justify-content: center; gap: 6px; padding: 8px; overflow-x: auto; } .anim-panel b { display: none; } .anim-panel button, .anim-panel a { flex: none; padding: 0 10px; font-size: 13px; } }
