/* ══════════════════════════════════════════════
   Quest Platform Design System
   Gamified educational platform styles
   ══════════════════════════════════════════════ */

/* ── HUD Bar ── */
.hud-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(88,166,255,0.04);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  min-width: 120px;
  transition: border-color 0.3s ease, transform 0.2s ease;
}
.hud-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.hud-icon { font-size: 1.3rem; flex-shrink: 0; }
.hud-info { display: flex; flex-direction: column; }
.hud-val { font-size: 1.1rem; font-weight: 800; color: #fff; transition: color 0.3s ease, text-shadow 0.3s ease; }
.hud-item:hover .hud-val { color: var(--accent); text-shadow: 0 0 8px rgba(88,166,255,0.3); }
.hud-lbl { font-size: 0.72rem; color: #8b949e; transition: color 0.3s ease; }
.hud-item:hover .hud-lbl { color: #c9d1d9; }

/* ── Quest / Task Cards ── */
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.quest-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}
.quest-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(88,166,255,0.12);
  border-color: var(--accent);
  background: rgba(88,166,255,0.03);
}
.quest-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a371f7, #3fb950);
  border-radius: 14px 14px 0 0;
}
.quest-card.quest-main::before {
  height: 4px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #fb923c);
  background-size: 200% 100%;
}
.quest-card.quest-main:hover::before {
  animation: shimmerBar 1.5s ease infinite;
}
.quest-card.quest-main:hover {
  border-color: rgba(251,191,36,0.4);
  box-shadow: 0 8px 32px rgba(251,191,36,0.12);
}
.quest-card.quest-timed::before {
  background: linear-gradient(90deg, #f85149, #fb923c);
  background-size: 200% 100%;
}
.quest-card.quest-timed:hover::before {
  animation: shimmerBar 1.5s ease infinite;
}
.quest-card.quest-timed:hover {
  border-color: rgba(248,81,73,0.35);
  box-shadow: 0 8px 32px rgba(248,81,73,0.12);
}
.quest-card.quest-weakness::before {
  background: linear-gradient(90deg, #a371f7, #58a6ff);
  background-size: 200% 100%;
}
.quest-card.quest-weakness:hover::before {
  animation: shimmerBar 1.5s ease infinite;
}

.quest-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.quest-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88,166,255,0.08);
  border-radius: 10px;
  transition: transform 0.3s ease;
}
.quest-card:hover .quest-icon { transform: scale(1.1); }
.quest-card.quest-main .quest-icon { background: rgba(251,191,36,0.1); }
.quest-card.quest-timed .quest-icon { background: rgba(248,81,73,0.1); }
.quest-card.quest-weakness .quest-icon { background: rgba(163,113,247,0.1); }
.quest-card.quest-weakness:hover {
  border-color: rgba(163,113,247,0.35);
  box-shadow: 0 4px 16px rgba(163,113,247,0.12);
}

.quest-title { color: #fff; font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; transition: color 0.3s ease; }
.quest-card:hover .quest-title { color: var(--accent); }
.quest-purpose { color: #8b949e; font-size: 0.82rem; margin: 0; line-height: 1.4; transition: color 0.3s ease; }
.quest-card:hover .quest-purpose { color: #c9d1d9; }

.quest-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.quest-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.quest-tag:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.quest-tag-diff {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
}
.quest-tag-diff.adv {
  background: rgba(248,81,73,0.12);
  color: #f85149;
  border-color: rgba(248,81,73,0.25);
}
.quest-tag-diff.sprint {
  background: rgba(251,146,36,0.12);
  color: #fb923c;
  border-color: rgba(251,146,36,0.25);
}
.quest-tag-time {
  background: rgba(88,166,255,0.1);
  color: #58a6ff;
  border: 1px solid rgba(88,166,255,0.2);
}
.quest-tag-reward {
  background: rgba(63,185,80,0.1);
  color: #3fb950;
  border: 1px solid rgba(63,185,80,0.2);
}

.quest-reward {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #8b949e;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(255,215,0,0.04);
  border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.quest-reward:hover {
  border-color: rgba(255,215,0,0.2);
  box-shadow: 0 2px 10px rgba(255,215,0,0.08);
}
.quest-reward strong { color: #ffd700; }

.quest-cta {
  display: block;
  text-align: center;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  color: #fff;
  background: var(--btn-bg);
  transition: background 0.2s ease;
  margin-top: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quest-cta:hover { background: var(--btn-hover); box-shadow: 0 4px 14px rgba(35,134,54,0.3); }
.quest-card:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.quest-cta:focus-visible { outline:2px solid #fff; outline-offset:2px; box-shadow:0 0 0 4px rgba(88,166,255,0.3); }
.quest-card.quest-main .quest-cta {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}
.quest-card.quest-main .quest-cta:hover {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.quest-card.quest-timed .quest-cta {
  background: linear-gradient(135deg, #dc2626, #f85149);
}
.quest-card.quest-timed .quest-cta:hover {
  background: linear-gradient(135deg, #f85149, #fb923c);
}

/* ── Timed quest pulse ── */
.quest-card.quest-timed .quest-tag-time {
  animation: timerPulse 2s ease-in-out infinite;
}
@keyframes timerPulse {
  0%,100% { box-shadow:none; }
  50% { box-shadow:0 0 8px rgba(248,81,73,0.35); }
}

/* ── Main quest accent glow ── */
.quest-card.quest-main {
  box-shadow: 0 0 0 0 rgba(251,191,36,0);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.quest-card.quest-main:hover {
  box-shadow: 0 8px 32px rgba(251,191,36,0.12);
}

/* ── Benefit Cards ── */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.benefit-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(88,166,255,0.1);
  border-color: var(--accent);
  border-left: 3px solid var(--accent);
}
.benefit-icon { font-size: 2.2rem; margin-bottom: 14px; filter: drop-shadow(0 2px 6px rgba(88,166,255,0.2)); transition: filter 0.3s, transform 0.3s; }
.benefit-card:hover .benefit-icon { filter: drop-shadow(0 4px 10px rgba(88,166,255,0.35)) brightness(1.2); transform: scale(1.12); }
.benefit-title { color: #fff; font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; transition: color 0.3s ease; }
.benefit-card:hover .benefit-title { color: var(--accent); text-shadow: 0 0 8px rgba(88,166,255,0.2); }
.benefit-desc { color: #8b949e; font-size: 0.88rem; margin: 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.3s ease; }
.benefit-card:hover .benefit-desc { color: #c9d1d9; }

/* ── Parent Value Cards ── */
.parent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
.parent-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.parent-card:hover {
  transform: translateY(-3px);
  border-color: #a371f7;
  box-shadow: 0 4px 16px rgba(163,113,247,0.12);
  background: rgba(163,113,247,0.03);
}
.parent-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #a371f7, #58a6ff);
  background-size: 200% 100%;
  border-radius: 12px 12px 0 0;
}
.parent-card:hover::before {
  animation: shimmerBar 1.5s ease infinite;
}
.parent-icon { font-size: 1.6rem; margin-bottom: 8px; transition: transform 0.3s ease; }
.parent-card:hover .parent-icon { transform: scale(1.15) rotate(-8deg); filter: drop-shadow(0 0 6px rgba(163,113,247,0.3)); }
.parent-title { color: #fff; font-size: 0.98rem; font-weight: 700; margin: 0 0 6px; transition: color 0.3s ease; }
.parent-card:hover .parent-title { color: var(--accent); }
.parent-desc { color: #8b949e; font-size: 0.82rem; margin: 0; line-height: 1.5; transition: color 0.3s ease; }
.parent-card:hover .parent-desc { color: #c9d1d9; }

/* ── Mode Selector Cards ── */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.mode-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.mode-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 40px rgba(88,166,255,0.15);
  border-color: var(--accent);
}
.mode-card:hover .mode-title { text-shadow: 0 0 10px rgba(255,255,255,0.25); }
.mode-price { transition: text-shadow 0.3s ease; }
.mode-card:hover .mode-price { text-shadow: 0 0 12px currentColor; }
.mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  border-radius: 16px 16px 0 0;
}
.mode-card.mode-empire::before { background: linear-gradient(90deg, #fbbf24, #f59e0b, #3fb950); }
.mode-card.mode-sprint::before { background: linear-gradient(90deg, #f85149, #fb923c); }
.mode-card.mode-topic::before { background: linear-gradient(90deg, #58a6ff, #a371f7); }

.mode-icon { font-size: 2.8rem; margin-bottom: 12px; transition: transform 0.3s ease, filter 0.3s ease; }
.mode-card:hover .mode-icon { transform: scale(1.15) rotate(-5deg); filter: drop-shadow(0 4px 8px rgba(88,166,255,0.3)) brightness(1.1); }
.mode-title { color: #fff; font-size: 1.3rem; font-weight: 800; margin: 0 0 8px; }
.mode-who { color: var(--accent); font-size: 0.82rem; font-weight: 600; margin: 0 0 10px; }
.mode-desc { color: #8b949e; font-size: 0.88rem; margin: 0 0 20px; line-height: 1.5; transition: color 0.3s ease; }
.mode-card:hover .mode-desc { color: #c9d1d9; }
.mode-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.mode-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(88,166,255,0.1);
  color: #58a6ff;
  border: 1px solid rgba(88,166,255,0.2);
}
.mode-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #fff;
  transition: all 0.2s;
  min-height: 44px;
}
.mode-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(88,166,255,0.35);
}
.mode-empire .mode-cta { background: linear-gradient(135deg, #238636, #2ea043); }
.mode-empire .mode-cta:hover { background: linear-gradient(135deg, #2ea043, #3fb950); }
.mode-sprint .mode-cta { background: linear-gradient(135deg, #dc2626, #f85149); }
.mode-sprint .mode-cta:hover { background: linear-gradient(135deg, #f85149, #fb923c); }
.mode-topic .mode-cta { background: linear-gradient(135deg, #1f6feb, #58a6ff); }
.mode-topic .mode-cta:hover { background: linear-gradient(135deg, #58a6ff, #79c0ff); }

@media (max-width: 768px) {
  .mode-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard Stats ── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.dash-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(88,166,255,0.1);
}
.dash-icon { font-size: 1.4rem; margin-bottom: 6px; transition: transform 0.2s ease; }
.dash-card:hover .dash-icon { transform: scale(1.15); filter: drop-shadow(0 2px 6px rgba(88,166,255,0.25)); }
.dash-val { font-size: 1.6rem; font-weight: 900; color: #fff; }
.dash-val.val-green { color: #3fb950; }
.dash-val.val-gold { color: #fbbf24; text-shadow: 0 0 12px rgba(251,191,36,0.25); }
.dash-val.val-blue { color: #58a6ff; }
.dash-val.val-purple { color: #a371f7; }
.dash-card:hover .dash-val.val-green { text-shadow: 0 0 12px rgba(63,185,80,0.3); }
.dash-card:hover .dash-val.val-gold { text-shadow: 0 0 16px rgba(251,191,36,0.4); }
.dash-card:hover .dash-val.val-blue { text-shadow: 0 0 12px rgba(88,166,255,0.3); }
.dash-card:hover .dash-val.val-purple { text-shadow: 0 0 12px rgba(163,113,247,0.3); }
.dash-lbl { font-size: 0.78rem; color: #8b949e; margin-top: 4px; transition: color 0.3s ease; }
.dash-card:hover .dash-lbl { color: #c9d1d9; }

/* ── Section Dividers ── */
.section-quest {
  max-width: 960px;
  margin: 0 auto;
  padding: 50px 24px;
}
.section-quest-head {
  text-align: center;
  margin-bottom: 32px;
}
.section-quest-head h2 {
  color: #fff;
  font-size: 1.6rem;
  margin: 0 0 8px;
  display: inline-block;
  position: relative;
}
.section-quest-head h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(88,166,255,0.3), rgba(163,113,247,0.15), transparent);
  border-radius: 1px;
}
.section-quest-head p {
  color: #8b949e;
  font-size: 0.95rem;
  margin: 0;
  transition: color 0.4s ease;
}
.section-quest:hover .section-quest-head p { color: #c9d1d9; }
.section-quest { position:relative; }
.section-quest::after { content:''; position:absolute; bottom:0; left:10%; right:10%; height:1px; background:linear-gradient(90deg,transparent,rgba(88,166,255,0.18),rgba(163,113,247,0.1),transparent); pointer-events:none; }
.section-quest[style*="padding-top:0"]::after,
.section-quest:last-of-type::after { display:none; }

.bg-gradient-quest {
  background: linear-gradient(180deg, rgba(88,166,255,0.05) 0%, transparent 100%);
  border-top: 1px solid rgba(88,166,255,0.15);
  border-bottom: 1px solid rgba(88,166,255,0.08);
}
.bg-gradient-parent {
  background: linear-gradient(180deg, rgba(163,113,247,0.06) 0%, transparent 100%);
  border-top: 1px solid rgba(163,113,247,0.15);
  border-bottom: 1px solid rgba(163,113,247,0.08);
}
.bg-gradient-growth {
  background: linear-gradient(180deg, rgba(63,185,80,0.05) 0%, transparent 100%);
  border-top: 1px solid rgba(63,185,80,0.15);
  border-bottom: 1px solid rgba(63,185,80,0.08);
}

/* ── Progress States ── */
.quest-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}
.quest-status-new {
  background: rgba(88,166,255,0.12);
  color: #58a6ff;
  position: relative;
  overflow: hidden;
}
.quest-status-new::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: statusShimmer 3s ease-in-out infinite;
}
@keyframes statusShimmer { 0%{left:-100%} 50%{left:100%} 100%{left:100%} }

/* ── Popular Badge Shimmer ── */
.popular-badge {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.popular-badge:hover { transform: translateX(-50%) scale(1.05); }
.popular-badge::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: statusShimmer 3s ease-in-out infinite;
}

.quest-status-active {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  animation: statusGlow 2s ease-in-out infinite;
}
@keyframes statusGlow { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 6px rgba(251,191,36,0.3)} }
.quest-status-done {
  background: rgba(63,185,80,0.12);
  color: #3fb950;
  box-shadow: 0 0 6px rgba(63,185,80,0.15);
}

/* ── Dual CTA Row ── */
.dual-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.dual-cta .cta-child {
  background: var(--btn-bg);
  color: #fff;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.dual-cta .cta-child:hover { background: var(--btn-hover); box-shadow: 0 4px 16px rgba(88,166,255,0.3); transform: translateY(-2px); }
.dual-cta .cta-parent {
  background: transparent;
  color: #a371f7;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #a371f7;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.dual-cta .cta-parent:hover { background: rgba(163,113,247,0.1); box-shadow: 0 4px 16px rgba(163,113,247,0.2); transform: translateY(-2px); }

/* ── Task Center Specific ── */
.tc-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.tc-section-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, rgba(88,166,255,0.3), transparent) 1;
  transition: border-image 0.3s ease;
}
.tc-section-title:hover {
  border-image: linear-gradient(90deg, rgba(88,166,255,0.6), rgba(163,113,247,0.3), transparent) 1;
}
.tc-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.tc-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--btn-bg), #3fb950);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}
.tc-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -50%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}
@keyframes progressShimmer { to { left: 150%; } }

/* ── Achievement Badges ── */
.badge-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text);
  transition: transform 0.2s, border-color 0.3s, box-shadow 0.3s;
}
.badge-item:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(88,166,255,0.15); border-color: rgba(88,166,255,0.3); color: #fff; }
.badge-item:hover .badge-icon { animation: badgePop .4s ease; }
@keyframes badgePop { 0%{transform:scale(1)} 40%{transform:scale(1.3) rotate(-8deg)} 70%{transform:scale(0.95) rotate(4deg)} 100%{transform:scale(1) rotate(0)} }
@keyframes shimmerBar { 0%{background-position:0% 0} 50%{background-position:100% 0} 100%{background-position:0% 0} }
.badge-item .badge-icon { font-size: 1.5rem; transition: transform 0.3s ease; }
.badge-item.badge-locked { opacity: 0.45; }
.badge-next {
  border-color: rgba(251,191,36,0.3);
  background: rgba(251,191,36,0.04);
  animation: badgeNextGlow 2.5s ease-in-out infinite;
}
@keyframes badgeNextGlow { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 10px rgba(251,191,36,0.15)} }
.badge-next-hint {
  font-size: 0.78rem;
  color: #fbbf24;
  font-weight: 600;
}

/* ── Onboarding (New User) ── */
.onboard-steps {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.onboard-step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  flex: 1 1 200px;
  max-width: 280px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.onboard-step:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(88,166,255,0.1);
  border-left: 3px solid var(--accent);
}
.onboard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(88,166,255,0.15);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 10px;
  box-shadow: 0 0 12px rgba(88,166,255,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.onboard-step:hover .onboard-step-num { transform: scale(1.12); box-shadow: 0 0 18px rgba(88,166,255,0.3); }
.onboard-step h4 { color: #fff; font-size: 0.95rem; margin: 0 0 6px; transition: color 0.3s ease; }
.onboard-step:hover h4 { color: var(--accent); }
.onboard-step p { color: #8b949e; font-size: 0.82rem; margin: 0; transition: color 0.3s ease; }
.onboard-step:hover p { color: #c9d1d9; }

/* ── Mode card gradient glow ── */
.mode-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  pointer-events: none;
}
.mode-card.mode-empire::after { background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(63,185,80,0.15)); }
.mode-card.mode-sprint::after { background: linear-gradient(135deg, rgba(248,81,73,0.25), rgba(251,146,36,0.15)); }
.mode-card.mode-topic::after  { background: linear-gradient(135deg, rgba(88,166,255,0.25), rgba(163,113,247,0.15)); }
.mode-card:hover::after { opacity: 1; }

/* ── Stagger entrance ── */
.stagger-1, .stagger-2, .stagger-3, .stagger-4 {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.visible .stagger-1 { opacity:1; transform:translateY(0); transition-delay:0.08s; }
.visible .stagger-2 { opacity:1; transform:translateY(0); transition-delay:0.16s; }
.visible .stagger-3 { opacity:1; transform:translateY(0); transition-delay:0.24s; }
.visible .stagger-4 { opacity:1; transform:translateY(0); transition-delay:0.32s; }

/* ── Quest card shimmer on reward tag ── */
.quest-reward strong {
  background: linear-gradient(90deg, #ffd700, #fff9c4, #ffd700);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rewardShimmer 3s ease-in-out infinite;
}
@keyframes rewardShimmer {
  0%,100% { background-position:0% 50%; }
  50% { background-position:100% 50%; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hud-bar { gap: 8px; padding: 12px 12px; }
  .hud-item { min-width: 0; flex: 1 1 calc(50% - 8px); padding: 8px 10px; }

  .quest-grid { grid-template-columns: 1fr; }

  .section-quest { padding: 36px 16px; }
  .section-quest-head h2 { font-size: 1.3rem; }

  .benefit-grid { grid-template-columns: 1fr 1fr; }

  .parent-grid { grid-template-columns: 1fr; }

  .dash-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .dash-card { padding: 14px 10px; }
  .dash-val { font-size: 1.3rem; }
}

@media (max-width: 400px) {
  .benefit-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Dash card hover pulse ── */
.dash-card:hover .dash-val {
  animation: valPop .35s ease;
}
@keyframes valPop {
  0% { transform:scale(1); }
  50% { transform:scale(1.15); }
  100% { transform:scale(1); }
}

/* ── Button active press ── */
.quest-cta:active, .mode-cta:active, .cta-child:active, .cta-parent:active {
  transform: scale(0.96);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .stagger-1,.stagger-2,.stagger-3,.stagger-4 { opacity:1; transform:none; transition:none; }
  .quest-reward strong { animation:none; -webkit-text-fill-color:#ffd700; }
  .mode-card { transition:none; }
  .quest-card { transition:none; }
  .benefit-card { transition:none; }
  .tc-progress-fill { transition:none; }
  .dash-card:hover .dash-val { animation:none; }
  .badge-item:hover .badge-icon { animation:none; }
  .quest-status-active { animation:none; }
  .badge-next { animation:none; }
}
