/* Global motion  -  respects prefers-reduced-motion */

@keyframes tb-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tb-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tb-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tb-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.tb-page-in .site-content,
.tb-page-in.site-main-canvas > .site-content,
.tb-page-in .games-lobby {
  animation: tb-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tb-soft-page-in.site-main-canvas:not(:has(.fs-game-shell)),
.tb-soft-page-in .site-content:not(:has(.fs-game-shell)),
main.tb-soft-page-in .site-content:not(:has(.fs-game-shell)) {
  animation: tb-soft-fade-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tb-soft-fade-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

@keyframes tb-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tb-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tb-dropdown--open.currency-picker__menu,
.tb-dropdown--open.topbar-user-dropdown {
  animation: tb-dropdown-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top right;
}

.tb-stagger-item {
  opacity: 0;
  transform: translateY(12px);
  animation: tb-rise 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--tb-i, 0) * 48ms);
}

.tb-reveal {
  animation: tb-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tb-reveal-scale {
  animation: tb-scale-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-msg-in {
  animation: tb-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-card {
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.game-card:not(.game-card--soon):hover {
  transform: translateY(-3px);
}

.ax-btn,
.pressable-medium,
button.original-primary,
.fs-controls-panel button {
  transition:
    transform 0.14s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ax-btn:active:not(:disabled),
.pressable-medium:active:not(:disabled) {
  transform: scale(0.97);
}

.home-hero--splash {
  animation: tb-fade-in 0.55s ease both;
}

.games-grid.is-grid-ready {
  animation: tb-fade-in 0.32s ease both;
}

.is-grid-ready .game-card {
  animation: none;
  opacity: 1;
  transform: none;
}

.tide-game-page .site-content {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .tb-page-in .site-content,
  .tb-stagger-item,
  .tb-reveal,
  .tb-reveal-scale,
  .chat-msg-in,
  .games-grid.is-grid-ready,
  .home-hero--splash,
  main.tb-soft-page-in,
  main.tb-soft-page-in .site-content {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .auth-overlay--open,
  .auth-card--open,
  .tb-dropdown--open {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .game-card:not(.game-card--soon):hover {
    transform: none;
  }
}
