/* ============================================================
   Achievement notifications

   The layer is a sibling of #app on document.body, so no view's
   overflow or transform can clip it. Small toasts stack in the
   bottom-right corner; medium prompts use the centre and a
   dimmed backdrop.
   ============================================================ */

.notif-layer {
  position: fixed;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
}

/* ============ Small toast ============ */

.notif-stack {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.notif-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 340px;
  max-width: calc(100vw - 48px);
  padding: 12px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ach, #4a90d9);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: notif-toast-in 320ms cubic-bezier(0.2, 0.9, 0.2, 1.25) both;
}

.notif-toast.out {
  animation: notif-toast-out 220ms ease forwards;
}

.notif-art-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.notif-art {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  background: var(--ach, #4a90d9);
  color: #101010;
  font-family: 'Qezbriln Line', sans-serif;
  font-size: 40px;
  line-height: 1;
  animation: notif-badge-zoom 420ms cubic-bezier(0.2, 0.9, 0.2, 1.25) both;
}

.notif-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.notif-burst i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pcolor, #ffffff);
  opacity: 0;
  will-change: transform, opacity;
  animation: notif-firework 760ms ease-out var(--pdelay, 0ms) forwards;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-kicker {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #e0a83c;
}

.notif-name {
  margin-top: 5px;
  font-family: var(--font-condensed);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.notif-desc {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.notif-meta {
  margin-top: 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============ Medium prompt ============ */

.notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.58);
  pointer-events: auto;
  animation: notif-fade-in 180ms ease both;
}

.notif-backdrop.out {
  animation: notif-fade-out 180ms ease forwards;
}

.notif-modal {
  width: 430px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  animation: notif-modal-in 280ms cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.notif-modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px 11px 16px;
  background: var(--bg-mid);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-modal-head .notif-kicker { flex: 1; }

.notif-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.notif-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notif-modal-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
}

.notif-modal-body .notif-art-wrap,
.notif-modal-body .notif-art {
  width: 56px;
  height: 56px;
}

.notif-modal-body .notif-art { font-size: 47px; }

.notif-modal-copy {
  flex: 1;
  min-width: 0;
}

.notif-modal-copy .notif-name { font-size: 25px; }
.notif-modal-copy .notif-desc { font-size: 12px; }

.notif-suggestion {
  margin: 0 18px 18px;
  padding: 11px 12px;
  background: var(--bg-mid);
  border: 1px solid var(--cardBorders);
  border-radius: 6px;
}

.notif-suggestion-kicker {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.notif-suggestion-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-suggestion-title .material-symbols-outlined {
  font-size: 17px;
  color: var(--journey);
}

.notif-suggestion-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-suggestion-desc {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.notif-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 11px 16px;
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.notif-btn {
  padding: 5px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--cardBorders);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.notif-btn:hover {
  background: var(--bg-active);
}

.notif-btn.primary {
  background: #e0a83c;
  border-color: #e0a83c;
  color: #1a1a1a;
  font-weight: 700;
}

.notif-btn.primary:hover {
  background: #efba56;
  border-color: #efba56;
}

/* ============ Animation ============ */

@keyframes notif-toast-in {
  0% { opacity: 0; transform: translateY(14px) scale(0.72); }
  65% { opacity: 1; transform: translateY(0) scale(1.035); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notif-toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

@keyframes notif-badge-zoom {
  0% { transform: scale(0.55); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes notif-firework {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.25); }
}

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

@keyframes notif-fade-out {
  to { opacity: 0; }
}

@keyframes notif-modal-in {
  0% { opacity: 0; transform: scale(0.86) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 520px) {
  .notif-stack {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
  .notif-toast { width: 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .notif-toast,
  .notif-toast.out,
  .notif-art,
  .notif-backdrop,
  .notif-backdrop.out,
  .notif-modal {
    animation: none !important;
  }
  .notif-burst { display: none; }
}
