/* Toasts premium — dopamina visual Duskara */

#dsk-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 2rem));
}

.dsk-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(18, 12, 32, 0.96), rgba(8, 6, 16, 0.98));
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 24px rgba(139, 92, 246, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: dsk-toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  overflow: hidden;
  position: relative;
}

.dsk-toast::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.08), transparent 55%);
  pointer-events: none;
}

.dsk-toast--out {
  animation: dsk-toast-out 0.35s ease-in forwards;
}

@keyframes dsk-toast-in {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.92);
    filter: blur(4px);
  }
  60% {
    transform: translateX(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes dsk-toast-out {
  to {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
}

.dsk-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.dsk-toast-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.dsk-toast-body {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.dsk-toast-title {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #f5e6ff;
  line-height: 1.2;
}

.dsk-toast-msg {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: rgba(196, 181, 253, 0.85);
  line-height: 1.35;
}

.dsk-toast-amount {
  font-family: Cinzel, serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dsk-gold, #d4af37);
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.dsk-toast-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
  animation: dsk-toast-spark 0.8s ease-out forwards;
}

@keyframes dsk-toast-spark {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(0); }
}

/* Tipos */
.dsk-toast--gold { border-color: rgba(212, 175, 55, 0.45); box-shadow: 0 0 28px rgba(212, 175, 55, 0.25); }
.dsk-toast--gold .dsk-toast-icon { background: radial-gradient(circle, #fde68a, #b45309); }

.dsk-toast--crystals { border-color: rgba(56, 189, 248, 0.4); box-shadow: 0 0 28px rgba(56, 189, 248, 0.2); }
.dsk-toast--crystals .dsk-toast-icon { background: radial-gradient(circle, #bae6fd, #0369a1); }

.dsk-toast--xp { border-color: rgba(167, 139, 250, 0.45); box-shadow: 0 0 28px rgba(139, 92, 246, 0.25); }
.dsk-toast--xp .dsk-toast-icon { background: radial-gradient(circle, #c4b5fd, #6d28d9); }

.dsk-toast--item { border-color: rgba(139, 92, 246, 0.35); }
.dsk-toast--mail { border-color: rgba(244, 114, 182, 0.35); box-shadow: 0 0 24px rgba(244, 114, 182, 0.15); }
.dsk-toast--mail .dsk-toast-icon { background: linear-gradient(145deg, #4c1d95, #831843); }

.dsk-toast--vip { border-color: rgba(212, 175, 55, 0.6); box-shadow: 0 0 32px rgba(212, 175, 55, 0.35); animation: dsk-toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards, dsk-toast-vip-pulse 2s ease-in-out infinite; }
.dsk-toast--vip .dsk-toast-icon { background: radial-gradient(circle, #fef3c7, #d97706); }

@keyframes dsk-toast-vip-pulse {
  0%, 100% { box-shadow: 0 0 28px rgba(212, 175, 55, 0.3); }
  50% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.5); }
}

.dsk-toast--boss { border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 0 32px rgba(239, 68, 68, 0.25); }
.dsk-toast--boss .dsk-toast-icon { background: radial-gradient(circle, #fca5a5, #991b1b); }

.dsk-toast--harvest { border-color: rgba(74, 222, 128, 0.5); box-shadow: 0 0 28px rgba(74, 222, 128, 0.25); }
.dsk-toast--harvest .dsk-toast-icon { background: radial-gradient(circle, #86efac, #166534); }

.dsk-toast--craft { border-color: rgba(249, 115, 22, 0.45); }
.dsk-toast--craft .dsk-toast-icon { background: radial-gradient(circle, #fdba74, #c2410c); }

.dsk-toast--animal { border-color: rgba(74, 222, 128, 0.4); }
.dsk-toast--animal .dsk-toast-icon { background: radial-gradient(circle, #bbf7d0, #15803d); }

.dsk-toast--slot { border-color: rgba(212, 175, 55, 0.4); }
.dsk-toast--friend { border-color: rgba(96, 165, 250, 0.4); }
.dsk-toast--clan { border-color: rgba(139, 92, 246, 0.45); }

/* Raridade item */
.dsk-toast--rarity-common { border-color: rgba(156, 163, 175, 0.4); }
.dsk-toast--rarity-refined { border-color: rgba(34, 197, 94, 0.45); }
.dsk-toast--rarity-rare { border-color: rgba(59, 130, 246, 0.5); box-shadow: 0 0 24px rgba(59, 130, 246, 0.2); }
.dsk-toast--rarity-epic { border-color: rgba(168, 85, 247, 0.55); box-shadow: 0 0 28px rgba(168, 85, 247, 0.25); }
.dsk-toast--rarity-legendary {
  border-color: rgba(212, 175, 55, 0.65);
  box-shadow: 0 0 36px rgba(212, 175, 55, 0.35);
  animation: dsk-toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards, dsk-toast-vip-pulse 2.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .dsk-toast, .dsk-toast--vip, .dsk-toast--rarity-legendary {
    animation: none;
  }
  .dsk-toast-spark { display: none; }
}

@media (max-width: 480px) {
  #dsk-toast-host {
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
  }
}

/* Shimmer + impacto */
.dsk-toast-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.07) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  animation: dsk-toast-shimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes dsk-toast-shimmer {
  0%, 100% { transform: translateX(-120%); }
  50% { transform: translateX(120%); }
}

.dsk-toast--impact {
  animation: dsk-toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards, dsk-toast-glow 2.2s ease-in-out infinite;
}

.dsk-toast--impact-high {
  animation: dsk-toast-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards, dsk-toast-glow-strong 1.8s ease-in-out infinite;
  border-width: 2px;
}

@keyframes dsk-toast-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes dsk-toast-glow-strong {
  0%, 100% { filter: brightness(1) saturate(1); box-shadow: 0 0 36px rgba(212, 175, 55, 0.35); }
  50% { filter: brightness(1.2) saturate(1.15); box-shadow: 0 0 52px rgba(212, 175, 55, 0.55); }
}

.dsk-toast-qty {
  font-family: Cinzel, serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e9d5ff;
  align-self: center;
}

.dsk-toast-rarity {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dsk-toast-rarity--rare { color: #93c5fd; border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.12); }
.dsk-toast-rarity--epic { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.12); }
.dsk-toast-rarity--legendary { color: #fde68a; border-color: rgba(234, 179, 8, 0.55); background: rgba(234, 179, 8, 0.12); }
.dsk-toast-rarity--relic { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); }
.dsk-toast-rarity--divine { color: #f8fafc; border-color: rgba(248, 250, 252, 0.45); background: rgba(255, 255, 255, 0.08); }

.dsk-toast--dropRare { border-color: rgba(59, 130, 246, 0.55); box-shadow: 0 0 32px rgba(59, 130, 246, 0.28); }
.dsk-toast--dropRare .dsk-toast-icon { background: radial-gradient(circle, #93c5fd, #1d4ed8); }

.dsk-toast--dropLegendary { border-color: rgba(234, 179, 8, 0.65); box-shadow: 0 0 40px rgba(234, 179, 8, 0.35); }
.dsk-toast--dropLegendary .dsk-toast-icon { background: radial-gradient(circle, #fde68a, #b45309); }

.dsk-toast--dropDivine { border-color: rgba(248, 250, 252, 0.55); box-shadow: 0 0 48px rgba(255, 255, 255, 0.22), 0 0 32px rgba(239, 68, 68, 0.25); }
.dsk-toast--dropDivine .dsk-toast-icon { background: radial-gradient(circle, #fff, #7c2d12); }

.dsk-toast--exploration { border-color: rgba(74, 222, 128, 0.45); box-shadow: 0 0 32px rgba(74, 222, 128, 0.2); }
.dsk-toast--exploration .dsk-toast-icon { background: radial-gradient(circle, #86efac, #166534); }

.dsk-toast--infinite { border-color: rgba(56, 189, 248, 0.45); box-shadow: 0 0 32px rgba(56, 189, 248, 0.22); }
.dsk-toast--infinite .dsk-toast-icon { background: radial-gradient(circle, #7dd3fc, #0369a1); }

.dsk-toast--record { border-color: rgba(212, 175, 55, 0.65); box-shadow: 0 0 44px rgba(212, 175, 55, 0.35); }
.dsk-toast--record .dsk-toast-icon { background: radial-gradient(circle, #fef3c7, #ca8a04); }

.dsk-toast--collected { border-color: rgba(34, 197, 94, 0.45); }
.dsk-toast--collected .dsk-toast-icon { background: radial-gradient(circle, #bbf7d0, #15803d); }

.dsk-toast--inventory .dsk-toast-icon { background: radial-gradient(circle, #c4b5fd, #5b21b6); }
.dsk-toast--storage .dsk-toast-icon { background: radial-gradient(circle, #fdba74, #9a3412); }

.dsk-toast--rarity-epic {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.25);
}

.dsk-toast--rarity-relic,
.dsk-toast--rarity-divine {
  border-color: rgba(248, 250, 252, 0.45);
  box-shadow: 0 0 44px rgba(255, 255, 255, 0.18), 0 0 28px rgba(239, 68, 68, 0.2);
}

.dsk-toast--warn { border-color: rgba(251, 191, 36, 0.45); }
.dsk-toast--warn .dsk-toast-icon { background: radial-gradient(circle, #fde68a, #b45309); }

/* Keep animations and large bursts inside a fixed viewport overlay. */
#dsk-toast-host { width: min(360px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: clip; contain: layout paint; box-sizing: border-box; padding: .25rem; }
.dsk-toast { flex-shrink: 0; box-sizing: border-box; min-width: 0; max-width: 100%; }
.dsk-toast-body { min-width: 0; overflow-wrap: anywhere; }
.dsk-toast-msg { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes dsk-toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dsk-toast-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (max-width: 480px) { #dsk-toast-host { width: auto; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .dsk-toast, .dsk-toast--out { animation-duration: .01s; } }

#dsk-toast-host { contain: strict; height: calc(100dvh - 2rem); }
