/* ============================================
   PsyVerse Quiz - Achievements Styles
   Royal gold neon design
   ============================================ */

/* ── Overlay ─────────────────────────────── */
.ach-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10,4,32,0.85);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity .35s ease;
}
.ach-overlay.ach-visible { opacity: 1; }

/* ── Modal ───────────────────────────────── */
.ach-modal {
  background: linear-gradient(160deg, #1a0050 0%, #0e0030 100%);
  border: 1.5px solid rgba(83,74,183,0.7);
  border-radius: 22px;
  width: 100%; max-width: 380px;
  max-height: 88vh; overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  animation: achModalIn .55s cubic-bezier(0.34,1.56,0.64,1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(83,74,183,0.4) transparent;
}
@keyframes achModalIn {
  from { opacity:0; transform:scale(0.75) translateY(30px) }
  to   { opacity:1; transform:scale(1)    translateY(0)    }
}

/* ── Neon top bar ────────────────────────── */
.ach-neon-top {
  height: 3px;
  background: linear-gradient(90deg, #534AB7, #1D9E75, #EF9F27, #1D9E75, #534AB7);
  background-size: 300% 100%;
  animation: achNeonFlow 4s linear infinite;
}
@keyframes achNeonFlow {
  0%   { background-position: 0%   50% }
  100% { background-position: 300% 50% }
}

/* ── Header ──────────────────────────────── */
.ach-head {
  padding: 18px 18px 10px;
  text-align: center;
  position: relative;
}
.ach-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: #AFA9EC; margin-bottom: 6px;
}
.ach-sub {
  font-size: 18px; font-weight: 700;
  color: #EEEDFE; line-height: 1.3;
}
.ach-sub em {
  color: #EF9F27;
  font-style: normal;
  text-shadow: 0 0 12px rgba(239,159,39,0.6);
}
.ach-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(83,74,183,0.5);
  background: rgba(83,74,183,0.15);
  color: #AFA9EC; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.ach-close:hover { background: rgba(83,74,183,0.35); color: #EEEDFE; }

/* ── Timer ───────────────────────────────── */
.ach-timer-row { padding: 0 18px 12px; }
.ach-timer-lbl {
  font-size: 10px; color: #7F77DD; font-weight: 600;
  text-align: right; margin-bottom: 5px; letter-spacing: .5px;
}
.ach-timer-track {
  height: 3px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
.ach-timer-fill {
  height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #534AB7, #EF9F27);
  animation: achDrain 10s linear forwards;
}
@keyframes achDrain { from { width:100% } to { width:0% } }

/* ── Divider ─────────────────────────────── */
.ach-divider { height: 1px; background: rgba(255,255,255,0.07); margin: 0 18px; }

/* ── Body ────────────────────────────────── */
.ach-body { padding: 14px 14px 6px; }
.ach-none {
  text-align: center; padding: 2rem 1rem;
  color: #7F77DD; font-size: 14px; font-weight: 600;
}

/* ── Category section ────────────────────── */
.ach-cat-section { margin-bottom: 18px; }
.ach-cat-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Badge grid ──────────────────────────── */
.ach-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

/* ── Badge card ──────────────────────────── */
.ach-badge-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(239,159,39,0.2);
  border-radius: 16px;
  padding: 14px 8px 12px;
  text-align: center;
  position: relative; overflow: hidden;
  animation: achBadgeIn .5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes achBadgeIn {
  from { opacity:0; transform:scale(0.5) translateY(12px) }
  to   { opacity:1; transform:scale(1)   translateY(0)    }
}
.ach-badge-card:nth-child(1) { animation-delay:.3s }
.ach-badge-card:nth-child(2) { animation-delay:.42s }
.ach-badge-card:nth-child(3) { animation-delay:.54s }
.ach-badge-card:nth-child(4) { animation-delay:.66s }
.ach-badge-card:nth-child(5) { animation-delay:.78s }
.ach-badge-card:nth-child(6) { animation-delay:.90s }

.ach-unlocked {
  border-color: rgba(239,159,39,0.55);
  background: rgba(239,159,39,0.07);
}
.ach-unlocked::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(239,159,39,0.14) 0%, transparent 70%);
  pointer-events: none;
}
.ach-locked {
  opacity: 0.32;
  filter: grayscale(0.5);
}

/* ── NEW pill ────────────────────────────── */
.ach-new-pill {
  position: absolute; top: 8px; right: 8px;
  font-size: 8px; font-weight: 800; letter-spacing: 1px;
  background: #EF9F27; color: #412402;
  padding: 2px 6px; border-radius: 4px;
}

/* ── Stack count ─────────────────────────── */
.ach-stack-count {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; font-weight: 800;
  background: rgba(83,74,183,0.85);
  color: #EEEDFE; padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(175,169,236,0.4);
}

/* ── Badge icon ──────────────────────────── */
.ach-badge-icon-wrap {
  width: 64px; height: 64px;
  margin: 0 auto 10px;
}
.ach-unlocked .ach-badge-icon-wrap {
  animation: achBadgePulse 2.8s ease-in-out infinite;
}
@keyframes achBadgePulse {
  0%,100% { filter: drop-shadow(0 0 4px  var(--glow)) drop-shadow(0 0 10px rgba(239,159,39,0.25)) }
  50%      { filter: drop-shadow(0 0 10px var(--glow)) drop-shadow(0 0 24px rgba(239,159,39,0.50)) drop-shadow(0 0 40px rgba(239,159,39,0.20)) }
}

/* ── Badge text ──────────────────────────── */
.ach-badge-name {
  font-size: 11px; font-weight: 700;
  line-height: 1.3; margin-bottom: 3px;
}
.ach-badge-desc {
  font-size: 9px; color: #7F77DD; line-height: 1.4;
}

/* ── Footer ──────────────────────────────── */
.ach-footer {
  padding: 10px 16px 18px;
  display: flex; justify-content: center;
}
.ach-view-all-btn {
  background: rgba(83,74,183,0.2);
  border: 1.5px solid rgba(83,74,183,0.5);
  color: #AFA9EC; font-size: 12px; font-weight: 700;
  padding: 9px 20px; border-radius: 20px;
  cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.ach-view-all-btn:hover {
  background: rgba(83,74,183,0.4); color: #EEEDFE;
}

/* ── Full badges page ────────────────────── */
.ach-page-shell {
  background: #0e0030; min-height: 100vh;
  padding-bottom: 4rem;
}
.ach-page-head {
  background: #1a0050;
  border-bottom: 1px solid rgba(83,74,183,0.4);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.ach-back-btn {
  font-size: 13px; font-weight: 700;
  color: #AFA9EC; background: none; border: none;
  cursor: pointer; font-family: inherit; padding: 0;
  flex-shrink: 0;
}
.ach-back-btn:hover { color: #EEEDFE; }
.ach-page-title {
  font-size: 18px; font-weight: 800;
  color: #EEEDFE; flex: 1; text-align: center;
}
.ach-page-progress {
  font-size: 11px; font-weight: 700;
  color: #EF9F27; flex-shrink: 0;
}
.ach-page-section {
  padding: 20px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ach-page-cat-label {
  font-size: 11px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1.5px solid;
  margin-bottom: 14px;
}

/* ── Countdown badges overlay ───────────────────── */
.cd-badges-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(10,4,32,0.88);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .3s ease;
}
.cd-badges-overlay.cd-badges-visible { opacity: 1; }
.cd-badges-panel {
  background: linear-gradient(160deg, #1a0050 0%, #0e0030 100%);
  border: 1.5px solid rgba(83,74,183,0.6);
  border-radius: 22px 22px 0 0;
  width: 100%; max-width: 480px;
  max-height: 88vh;
  overflow-y: auto; overflow-x: hidden;
  animation: cdPanelUp .4s cubic-bezier(0.34,1.56,0.64,1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(83,74,183,0.4) transparent;
}
@keyframes cdPanelUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.cd-badges-head {
  position: sticky; top: 0; z-index: 5;
  background: #1a0050;
  border-bottom: 1px solid rgba(83,74,183,0.3);
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.cd-badges-title {
  font-size: 16px; font-weight: 800; color: #EEEDFE;
}
.cd-badges-body { padding: 14px 14px 32px; }
.cd-badges-loading {
  text-align: center; padding: 3rem 1rem;
  color: #7F77DD; font-size: 14px; font-weight: 600;
}
.cd-badges-progress {
  font-size: 12px; font-weight: 700; color: #EF9F27;
  text-align: center; margin-bottom: 16px;
  padding: 8px 14px; background: rgba(239,159,39,0.08);
  border: 1px solid rgba(239,159,39,0.25); border-radius: 20px;
}
.cd-badges-cat-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
  margin: 16px 0 10px;
}
.cd-badges-grid {
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)) !important;
}
.cd-pill-badges {
  background: rgba(239,159,39,0.15);
  border: 1.5px solid rgba(239,159,39,0.4);
  color: #FAC775; cursor: pointer;
  font-family: inherit; font-size: inherit;
  padding: inherit; border-radius: inherit;
  transition: background .15s;
}
.cd-pill-badges:hover { background: rgba(239,159,39,0.28); }
