/* reward-engine.css - the reward vault (Progress page) and the chest celebration when a milestone is reached */

.mt-loot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 36, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mt-loot-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.mt-loot-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 28px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 165, 42, 0.25);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  border: 2px solid #eef2f6;
}

.mt-loot-overlay.is-active .mt-loot-card {
  transform: scale(1) translateY(0);
}

.mt-loot-sparkles {
  font-size: 1.5rem;
  margin-bottom: 8px;
  animation: mtFloat 2s ease-in-out infinite;
}

.mt-loot-chest {
  font-size: 5rem;
  line-height: 1;
  margin: 12px 0 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: mtWiggle 2s infinite ease-in-out;
}

.mt-loot-card.is-opening .mt-loot-chest {
  animation: mtPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mt-loot-item-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.mt-loot-item-icon.common { background: #e2e8f0; }
.mt-loot-item-icon.rare { background: #dbeafe; border: 2px solid #3b82f6; }
.mt-loot-item-icon.epic { background: #f3e8ff; border: 2px solid #a855f7; }
.mt-loot-item-icon.legendary { background: #fef3c7; border: 2px solid #d97706; }

.mt-loot-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.mt-loot-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 8px;
}

.mt-loot-name.rare { color: #2563eb; }
.mt-loot-name.epic { color: #9333ea; }
.mt-loot-name.legendary { color: #d97706; }

.mt-loot-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.mt-loot-badge.common { background: #f1f5f9; color: #64748b; }
.mt-loot-badge.rare { background: #eff6ff; color: #2563eb; }
.mt-loot-badge.epic { background: #faf5ff; color: #9333ea; }
.mt-loot-badge.legendary { background: #fffbeb; color: #b45309; }

.mt-loot-blurb {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.45;
  margin: 0 0 20px;
}

.mt-loot-btn {
  width: 100%;
}

/* Vault card inside dashboard */
.re-reward-card .re-vault-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.re-vault-xp, .re-vault-shields {
  background: var(--surface-subtle, #f8fafc);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}

.re-relics-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.re-relic-badge {
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  transition: transform 0.15s ease;
}

.re-relic-badge:hover {
  transform: translateY(-2px);
}

.re-relic-badge.rare { border-color: #93c5fd; }
.re-relic-badge.epic { border-color: #d8b4fe; }
.re-relic-badge.legendary { border-color: #fde68a; background: #fffdf5; }

.re-relic-icon { font-size: 1.3rem; }
.re-relic-title { font-size: 0.78rem; font-weight: 600; line-height: 1.2; }

.re-titles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.re-title-tag {
  font-size: 0.75rem;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.re-loot-actions {
  display: flex;
  justify-content: flex-end;
}

@keyframes mtWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg) scale(1.05); }
  75% { transform: rotate(5deg) scale(1.05); }
}

@keyframes mtFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes mtPop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* line icons instead of emoji; goals still to earn (milestone version, 24 Oct 2026) */
.re-ic { width: 22px; height: 22px; flex-shrink: 0; }
.mt-loot-chest .re-ic.is-chest { width: 96px; height: 96px; color: #8a6312; }
.mt-loot-item-icon .re-ic { width: 46px; height: 46px; color: #1f3a68; }
.mt-loot-kind { margin: 0; font-size: .8rem; font-weight: 700; color: var(--ink-soft, #46546a); text-transform: uppercase; letter-spacing: .06em; }
.mt-loot-name { font-family: var(--font-display, Georgia, serif); }
.re-relic-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e9eef7; color: #1f3a68; }
.re-relic-icon.is-locked { background: #f1f3f7; color: #8a94a6; }
.re-relic-title small { display: block; font-weight: 500; color: var(--ink-soft, #46546a); font-size: .72rem; }
.re-vault-shields { display: inline-flex; align-items: center; gap: 6px; }
.re-note { color: var(--ink-soft, #46546a); font-size: .92rem; margin: 0 0 12px; }
.re-sub { font-size: .95rem; margin: 4px 0 8px; }
.re-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.re-goal { display: flex; gap: 10px; align-items: center; }
.re-goal-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.re-goal-text small { color: var(--ink-soft, #46546a); font-size: .82rem; }
.re-goal-bar { height: 6px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.re-goal-bar span { display: block; height: 100%; background: #22643f; border-radius: 99px; }
@media (prefers-reduced-motion: reduce) {
  .mt-loot-chest, .mt-loot-card, .mt-loot-card.is-opening .mt-loot-chest { animation: none; transition: none; }
}
/* a closed celebration is hidden from keyboard and screen readers too */
.mt-loot-overlay { visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.mt-loot-overlay.is-active { visibility: visible; transition: opacity .3s ease; }
