#achievement-toast-container {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.achievement-toast {
  --achv-rest-bottom: 30px;
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  max-width: min(92vw, 380px);
  padding: 10px 22px 10px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow:
    0 10px 34px rgba(15, 23, 42, 0.18),
    0 0 26px rgba(37, 99, 235, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 0;
  pointer-events: auto;
}

html.dark .achievement-toast {
  background: rgba(19, 24, 40, 0.66);
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(59, 130, 246, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.achievement-toast.is-visible {
  animation: achievementToastRise 4.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes achievementToastRise {
  0% { bottom: -100px; opacity: 0; }
  10% { bottom: var(--achv-rest-bottom); opacity: 1; }
  88% { bottom: var(--achv-rest-bottom); opacity: 1; }
  100% { bottom: -100px; opacity: 0; }
}

.achievement-icon-slot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--blue-500, #3b82f6), var(--blue-700, #1d4ed8));
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(37, 99, 235, 0.55);
}

html.dark .achievement-icon-slot {
  box-shadow:
    0 0 0 3px rgba(19, 24, 40, 0.85),
    0 0 18px rgba(96, 165, 250, 0.55);
}

.achievement-icon-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.achievement-text-slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.achievement-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600, #2563eb);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark .achievement-title {
  color: var(--blue-400, #60a5fa);
}

.achievement-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .achievement-toast {
    --achv-rest-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px) + 10px);
  }
}

@media (max-width: 480px) {
  .achievement-toast {
    min-width: 0;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding: 9px 16px 9px 9px;
    gap: 11px;
  }
  .achievement-icon-slot {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .achievement-title {
    font-size: 0.64rem;
  }
  .achievement-desc {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .achievement-toast.is-visible {
    animation-duration: 3.4s;
    animation-timing-function: ease-in-out;
  }
}
