.achievement-toast-root {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: calc(100vw - 3rem);
  pointer-events: none;
}

.achievement-toast {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  min-width: 18rem;
  max-width: 24rem;
  padding: 0.875rem 1rem;
  background: var(--pico-card-background-color);
  color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color);
  border-left: 4px solid var(--pico-primary);
  border-radius: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  animation: achievement-toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.achievement-toast--leaving {
  animation: achievement-toast-out 0.35s ease forwards;
}

.achievement-toast__icon {
  flex: 0 0 auto;
  font-size: 2rem;
  line-height: 1;
  animation: achievement-icon-pop 0.9s ease;
}

.achievement-toast__body {
  flex: 1 1 auto;
  min-width: 0;
}

.achievement-toast__label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.125rem;
}

.achievement-toast__title {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}

.achievement-toast__description {
  display: block;
  font-size: 0.8125rem;
  opacity: 0.85;
  margin-top: 0.125rem;
}

.achievement-toast__close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.55;
}

.achievement-toast__close:hover {
  opacity: 1;
}

.achievement-toast__close:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@keyframes achievement-toast-in {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes achievement-toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(22px) scale(0.94);
  }
}

@keyframes achievement-icon-pop {
  0% {
    transform: scale(0.35) rotate(-18deg);
  }

  55% {
    transform: scale(1.3) rotate(10deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .achievement-toast,
  .achievement-toast--leaving,
  .achievement-toast__icon {
    animation: none !important;
  }
}

@media (max-width: 600px) {
  .achievement-toast-root {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .achievement-toast {
    min-width: 0;
    max-width: none;
  }
}
