/* --- Permanent Sticker Tray --- */
.sticker-tray {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: 320px;
  max-height: min(60vh, 520px);
  background: #2a2140;
  border: 1px solid rgba(255,217,102,.5);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  padding: 12px;
  z-index: 1200;                 /* above confetti; below modals */
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  backdrop-filter: none;          /* flat, no glass */
}

.sticker-tray .tray-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.sticker-tray .tray-title {
  font-weight: 800; letter-spacing: .3px;
}

.sticker-tray .sticker-grid {
  overflow: auto;
  display: flex;
  grid-template-columns: repeat(6, 38px);
  gap: 8px;
  padding: 6px 2px 2px 2px;
}


.sticker-tray .sticker {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-size: 24px; border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .2s ease;
}
.sticker-tray .sticker.unlocked { background: rgba(255,255,255,.12); }
.sticker-tray .sticker.unlocked:hover { transform: scale(1.08); }

/* Pulse highlight for new unlocks */
@keyframes trayPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255,217,102,0); }
  50% { transform: scale(1.12); box-shadow: 0 0 16px rgba(255,217,102,.45); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255,217,102,0); }
}
.sticker-tray .sticker.pulse {
  animation: trayPulse 0.8s ease-out 1;
}

/* iPad portrait: center tray at bottom */
@media (max-width: 860px) {
  .sticker-tray {
    right: 50%;
    transform: translateX(50%);
    width: min(92vw, 420px);
  }
}

/* small ghost button (close – optional; can be hidden) */
.btn.ghost.small { padding: 6px 8px; border-radius: 10px; }

/* Ensure nothing overlaps the tray critical area */
body {
  /* allow content behind to be scrolled without being hidden by the tray */
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
}