/* Playora menu playful effects (scoped to menus) */
:root {
  --pop-shadow: 0 10px 20px rgba(74, 144, 226, 0.18);
}

/* Animated gradient underline for navbar links */
.navbar a:not(.logo) {
  position: relative;
}

.navbar a:not(.logo)::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
  pointer-events: none;
}

.navbar a:not(.logo):hover::after,
.navbar a:not(.logo):focus-visible::after {
  transform: scaleX(1);
}

/* Keep avatar link tight so toolbar doesn't shift when a custom avatar loads */
.navbar a#avatarLink {
  padding: 0 !important;
  margin-left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* No underline/border effect for avatar link */
.navbar a#avatarLink::after {
  content: none !important;
  display: none !important;
}

/* Force avatar image to fixed size and block to avoid baseline/padding jumps */
.navbar a#avatarLink .nav-avatar {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  display: block !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* Card sparkle accent on hover (game list tiles, sections) */
.game-section {
  overflow: hidden;
}

.game-section::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(255, 217, 61, 0.18),
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 30%,
      rgba(74, 144, 226, 0.14),
      transparent 35%
    ),
    radial-gradient(
      circle at 50% 80%,
      rgba(255, 107, 107, 0.12),
      transparent 40%
    );
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 250ms ease,
    transform 250ms ease;
  pointer-events: none;
}

.game-section:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Fun hover lift for images */
.game-preview:hover {
  transform: translateY(-3px) scale(1.03);
}

/* Focus styles for accessibility */
:where(a, button):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-color), white 35%);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .tile-animate,
  .game-section::after,
  .game-preview {
    animation: none !important;
    transition: none !important;
  }

  .navbar a:not(.logo)::after,
  .glass-tile,
  .welcome-logo,
  .welcome-subtitle,
  #sfxToggleBtn {
    transition: none !important;
  }
}

/* Consistent dark-friendly styles for the global SFX toggle button */
#sfxToggleBtn {
  margin-left: 12px;
  border-radius: 20px;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(232, 238, 245, 0.22);
  background: linear-gradient(
    180deg,
    rgba(59, 109, 181, 0.22),
    rgba(59, 109, 181, 0.12)
  );
  color: var(--text-color);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    transform 120ms ease;
  box-shadow:
    0 0 8px rgba(59, 109, 181, 0.45),
    0 0 18px rgba(59, 109, 181, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.25);
}

#sfxToggleBtn:hover {
  box-shadow:
    0 0 10px rgba(59, 109, 181, 0.75),
    0 0 22px rgba(59, 109, 181, 0.45),
    var(--pop-shadow);
}

#sfxToggleBtn:active {
  transform: scale(0.98);
}
