/* ═══════════════════════════════════════════════════════════════
   OfferQuest — Quest Map Styles (DOM Card Carousel)

   Covers: card carousel, image protection, SVG trails,
   Duolingo-style node markers, tooltips, zone badges,
   card transitions, locked state, and celebration overlays.
   ═══════════════════════════════════════════════════════════════ */

/* ── Carousel Container ──────────────────────────────────── */

.qm-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 83 / 50;                         /* matches native image ratio (5312×3200) */
  max-width: min(100%, calc(55vh * 83 / 50));     /* caps height at ~55vh without breaking ratio */
  margin: 0 auto;                                 /* center when max-width constrains */
  border-radius: 1.25rem;
  overflow: hidden;
  background: #0f172a;
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.dark .qm-carousel {
  box-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ── Card (one per zone) ─────────────────────────────────── */

.qm-card {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  transform: translateX(40px);
  will-change: opacity, transform;
}

.qm-card--active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.qm-card--exit-left {
  opacity: 0;
  transform: translateX(-40px);
  z-index: 1;
}

.qm-card--exit-right {
  opacity: 0;
  transform: translateX(40px);
  z-index: 1;
}

.qm-card--enter-right {
  opacity: 0;
  transform: translateX(40px);
}

.qm-card--enter-left {
  opacity: 0;
  transform: translateX(-40px);
}

/* ── Background Image (Protected) ────────────────────────── */

.qm-card__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;                  /* safe fallback — no cropping if sub-pixel ratio mismatch */
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  z-index: 0;
}

/* ── Dark Mode Tint Overlay ──────────────────────────────── */

.qm-card__tint {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 1;
  transition: background 0.3s ease;
}

.dark .qm-card__tint {
  background: rgba(15, 23, 42, 0.22);
}

/* ── SVG Trail Layer ─────────────────────────────────────── */

.qm-card__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.qm-trail {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qm-trail--bg {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 7;
  stroke-dasharray: 14 10;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

.dark .qm-trail--bg {
  stroke: rgba(255, 255, 255, 0.3);
}

.qm-trail--progress {
  stroke-width: 7;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

/* ── Node Markers Layer (scaled design-canvas: 830×500) ──── */

.qm-nodes {
  position: absolute;
  top: 0;
  left: 0;
  width: 830px;
  height: 500px;
  z-index: 3;
  pointer-events: none;
  transform-origin: 0 0;           /* JS applies scale(containerWidth / 830) */
}

/* ── Individual Node (Duolingo-style) ────────────────────── */

.qm-node {
  position: absolute;
  /* No translate centering — offset baked into design-px coords by JS */
  border: none;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.qm-node:hover:not(:disabled) {
  transform: scale(1.12);
}

.qm-node:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

/* Ring (glow/pulse layer behind the circle) */
.qm-node__ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Icon */
.qm-node__icon {
  position: relative;
  z-index: 1;
  line-height: 1;
  color: white;
  font-variation-settings: 'FILL' 1, 'wght' 600;
}

/* Label (below node) */
.qm-node__label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ── Node State: Complete ────────────────────────────────── */

.qm-node--complete {
  background: linear-gradient(145deg, #4ade80, #16a34a);
  box-shadow:
    0 4px 12px rgba(34, 197, 94, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.qm-node--complete .qm-node__ring {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.3), transparent 70%);
  opacity: 1;
}

.qm-node--complete .qm-node__icon {
  color: #ffffff;
}

.qm-node--complete .qm-node__label {
  color: #bbf7d0;
}

/* ── Node State: Current (Pulsing) ───────────────────────── */

.qm-node--current {
  background: linear-gradient(145deg, #60a5fa, #2563eb);
  box-shadow:
    0 4px 16px rgba(59, 130, 246, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
  z-index: 5;
}

.qm-node--current .qm-node__ring {
  opacity: 1;
  animation: qm-pulse 2s ease-in-out infinite;
}

.qm-node--current .qm-node__icon {
  color: #ffffff;
}

.qm-node--current .qm-node__label {
  color: #bfdbfe;
}

@keyframes qm-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(59, 130, 246, 0);
    transform: scale(1.06);
  }
}

.qm-node--current:hover {
  transform: scale(1.15);
}

/* ── Node State: Upcoming ────────────────────────────────── */

.qm-node--upcoming {
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid #d1d5db;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dark .qm-node--upcoming {
  background: rgba(30, 41, 59, 0.9);
  border-color: #475569;
}

.qm-node--upcoming .qm-node__icon {
  color: #9ca3af;
}

.dark .qm-node--upcoming .qm-node__icon {
  color: #64748b;
}

.qm-node--upcoming .qm-node__label {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Node State: Locked ──────────────────────────────────── */

.qm-node--locked {
  background: rgba(226, 232, 240, 0.5);
  border: 2px solid rgba(203, 213, 225, 0.3);
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.dark .qm-node--locked {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(71, 85, 105, 0.3);
}

.qm-node--locked .qm-node__icon {
  color: #94a3b8;
  font-size: 14px !important;
}

.qm-node--locked .qm-node__label {
  display: none;
}

.qm-node--locked:hover {
  transform: none;
}

/* ── Node State: Hidden (Mystery) ────────────────────────── */

.qm-node--hidden {
  background: linear-gradient(145deg, #a78bfa, #7c3aed);
  box-shadow:
    0 4px 12px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: qm-shimmer 3s ease-in-out infinite;
}

.qm-node--hidden .qm-node__icon {
  color: #ffffff;
}

.qm-node--hidden .qm-node__label {
  color: #c4b5fd;
}

@keyframes qm-shimmer {
  0%, 100% { box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35); }
  50% { box-shadow: 0 4px 20px rgba(167, 139, 250, 0.55); }
}

/* ── Node State: Gated ───────────────────────────────────── */

.qm-node--gated {
  background: linear-gradient(145deg, #e9d5ff, #c084fc);
  border: 2.5px solid #a855f7;
  box-shadow:
    0 4px 12px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dark .qm-node--gated {
  background: linear-gradient(145deg, #581c87, #7c3aed);
  border-color: #a855f7;
}

.qm-node--gated .qm-node__icon {
  color: #7c3aed;
}

.dark .qm-node--gated .qm-node__icon {
  color: #e9d5ff;
}

.qm-node--gated .qm-node__label {
  color: #e9d5ff;
}

/* ── Golden Node (Summit Offer) ──────────────────────────── */

.qm-node--golden {
  background: linear-gradient(145deg, #fde68a, #ca8a04) !important;
  border: 3px solid #eab308;
  box-shadow:
    0 4px 20px rgba(234, 179, 8, 0.5),
    0 0 30px rgba(234, 179, 8, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.qm-node--golden .qm-node__ring {
  opacity: 1;
  animation: qm-golden-pulse 2.5s ease-in-out infinite;
}

@keyframes qm-golden-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(234, 179, 8, 0); }
}

/* ── Node Type: Variable Visible (Diamond) ─────────────── */

.qm-node--variable:not(.qm-node--complete):not(.qm-node--locked) {
  border-radius: 6px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: 2px solid #d97706;
  box-shadow:
    0 4px 12px rgba(251, 191, 36, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.qm-node--variable:not(.qm-node--complete):not(.qm-node--locked) .qm-node__icon,
.qm-node--variable:not(.qm-node--complete):not(.qm-node--locked) .qm-node__label {
  transform: rotate(-45deg);
}

.qm-node--variable:not(.qm-node--complete):not(.qm-node--locked) .qm-node__ring {
  border-radius: 6px;
  opacity: 1;
  animation: qm-variable-shimmer 2.5s ease-in-out infinite;
}

@keyframes qm-variable-shimmer {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(251, 191, 36, 0.5); }
}

/* ── Node Type: Streak (Fire Glow) ─────────────────────── */

.qm-node--streak:not(.qm-node--locked) {
  background: linear-gradient(145deg, #f97316, #ea580c);
  border: 2px solid #c2410c;
  box-shadow:
    0 4px 12px rgba(249, 115, 22, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.qm-node--streak:not(.qm-node--locked) .qm-node__ring {
  opacity: 1;
  animation: qm-fire-glow 1.5s ease-in-out infinite alternate;
}

@keyframes qm-fire-glow {
  from { box-shadow: 0 0 8px 2px rgba(249, 115, 22, 0.4); }
  to   { box-shadow: 0 0 16px 6px rgba(249, 115, 22, 0.6); }
}

.qm-node--streak.qm-node--locked {
  background: rgba(226, 232, 240, 0.4);
  opacity: 0.45;
}

.qm-node--streak.qm-node--locked .qm-node__ring {
  animation: none;
  opacity: 0;
}

/* ── Node Type: Action Gate (Lock) ─────────────────────── */

.qm-node--action-gated.qm-node--gated {
  background: linear-gradient(145deg, #e9d5ff, #c084fc);
  border: 2.5px solid #a855f7;
  box-shadow:
    0 4px 12px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── Tooltip: Loot drop label ──────────────────────────── */

.qm-tooltip__loot {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ── Zone Badge (top-left floating) ───────────────────── */

.qm-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.dark .qm-card__badge {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.qm-card__badge-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.qm-card__badge-name {
  font-size: 0.875rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.dark .qm-card__badge-name {
  color: #f1f5f9;
}

.qm-card__badge-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.dark .qm-card__badge-sub {
  color: #94a3b8;
}

.qm-card__badge-progress {
  display: flex;
  align-items: center;
}

.qm-card__badge-pct {
  font-size: 0.8rem;
  font-weight: 800;
  color: #3b82f6;
}

.dark .qm-card__badge-pct {
  color: #60a5fa;
}

/* ── Locked Card Overlay ─────────────────────────────────── */

.qm-card--locked .qm-card__lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: #64748b;
  z-index: 5;
  border-radius: inherit;
}

.qm-lock-icon {
  font-size: 3rem;
  color: #475569;
}

.qm-lock-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #94a3b8;
}

.qm-lock-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

/* ── Tooltip ─────────────────────────────────────────────── */

.qm-tooltip {
  position: absolute;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.06);
  pointer-events: none;
  animation: qm-tooltip-pop 0.2s ease-out;
  max-width: 200px;
  text-align: center;
  transform: translate(-50%, -100%);
  transition: opacity 0.2s ease;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #1e293b;
}

.dark .qm-tooltip {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

@keyframes qm-tooltip-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -100%) translateY(6px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(0) scale(1);
  }
}

.qm-tooltip__xp {
  color: #eab308;
  font-weight: 700;
}

.qm-tooltip__gate {
  color: #a855f7;
  font-weight: 600;
}

.qm-tooltip__mystery {
  color: #94a3b8;
}

.qm-tooltip__done {
  color: #22c55e;
  font-weight: 700;
}

/* ── Zone Navigation (dots + arrows) ─────────────────────── */

.quest-zone-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.quest-zone-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dark .quest-zone-nav-btn {
  background: rgba(30, 41, 59, 0.8);
  border-color: #475569;
  color: #94a3b8;
}

.quest-zone-nav-btn:not(:disabled):hover {
  transform: scale(1.1);
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dark .quest-zone-nav-btn:not(:disabled):hover {
  background: #334155;
}

.quest-zone-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quest-zone-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quest-zone-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  padding: 0;
  background: #cbd5e1;
}

.dark .quest-zone-dot {
  background: #475569;
}

.quest-zone-dot.complete {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.quest-zone-dot.active {
  background: #3b82f6;
  width: 16px;
  height: 16px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.quest-zone-dot.locked {
  background: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.4;
}

.dark .quest-zone-dot.locked {
  background: #475569;
}

.quest-zone-dot:not(.locked):hover {
  transform: scale(1.3);
}

/* ═══════════════════════════════════════════════════════════════
   CELEBRATION ANIMATIONS (kept from previous implementation)
   ═══════════════════════════════════════════════════════════════ */

.quest-xp-popup {
  position: fixed;
  z-index: 10001;
  font-size: 1.75rem;
  font-weight: 900;
  color: #eab308;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(234, 179, 8, 0.4);
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.quest-xp-popup.animate {
  animation: xp-float 2s ease-out forwards;
}

@keyframes xp-float {
  0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 0; }
  12% { transform: translateX(-50%) translateY(-15px) scale(1.3); opacity: 1; }
  30% { transform: translateX(-50%) translateY(-40px) scale(1); }
  100% { transform: translateX(-50%) translateY(-120px) scale(0.8); opacity: 0; }
}

.quest-particle {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: particle-burst 0.6s ease-out forwards;
}

@keyframes particle-burst {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--end-x, 50px)), calc(-50% + var(--end-y, -50px))) scale(0); opacity: 0; }
}

.quest-ring {
  position: fixed;
  z-index: 9999;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.6;
}

.quest-ring.animate {
  animation: ring-expand 0.6s ease-out forwards;
}

@keyframes ring-expand {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

.quest-confetti-container {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
}

.quest-confetti-piece {
  position: absolute;
  top: -10px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) translateX(var(--drift, 30px)) rotate(var(--spin, 720deg)); opacity: 0; }
}

.quest-flash {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.85) 0%, transparent 70%);
  animation: quest-flash-anim 0.5s ease-out forwards;
  pointer-events: none;
}

.dark .quest-flash {
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
}

.quest-flash-gold {
  background: radial-gradient(circle at center, rgba(234, 179, 8, 0.5) 0%, transparent 70%) !important;
}

@keyframes quest-flash-anim {
  0% { opacity: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; }
}

.quest-celebration-text {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10002;
  text-align: center;
  animation: celebration-pop 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}

@keyframes celebration-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(0.95); }
  60% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) translateY(-30px); opacity: 0; }
}

.quest-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10003;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.quest-toast {
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.quest-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.quest-toast.hiding {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.quest-toast-info { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.quest-toast-milestone { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.quest-toast-zone { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.quest-toast-bonus { background: linear-gradient(135deg, #a855f7, #7c3aed); color: white; }
.quest-toast-streak { background: linear-gradient(135deg, #f97316, #ea580c); color: white; }
.quest-toast-legendary { background: linear-gradient(135deg, #eab308, #d97706); color: white; font-size: 1.1rem; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .qm-carousel {
    max-width: min(100%, calc(45vh * 83 / 50));   /* caps height at ~45vh */
    border-radius: 1rem;
  }

  /* Node scaling handled by ResizeObserver — no manual scale overrides */

  .qm-node__label {
    display: none;
  }

  .qm-card__badge {
    padding: 6px 10px 6px 8px;
    border-radius: 0.625rem;
  }

  .qm-card__badge-emoji {
    font-size: 1.2rem;
  }

  .qm-card__badge-name {
    font-size: 0.75rem;
  }

  .qm-card__badge-sub {
    display: none;
  }

  .quest-zone-nav-btn {
    width: 36px;
    height: 36px;
  }

  .quest-zone-dot {
    width: 10px;
    height: 10px;
  }

  .quest-zone-dot.active {
    width: 14px;
    height: 14px;
  }

  .quest-celebration-text p:first-child {
    font-size: 2.5rem !important;
  }

  .quest-xp-popup {
    font-size: 1.25rem;
  }

  .quest-toast {
    font-size: 0.85rem;
    padding: 0.625rem 1rem;
  }
}

@media (max-width: 480px) {
  .qm-carousel {
    max-width: min(100%, calc(35vh * 83 / 50));   /* caps height at ~35vh */
    border-radius: 0.75rem;
  }

  /* Node scaling handled by ResizeObserver — no manual scale overrides */

  .qm-card__badge {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    gap: 6px;
  }

  .qm-card__badge-progress {
    display: none;
  }

  .qm-lock-icon {
    font-size: 2rem;
  }

  .qm-lock-title {
    font-size: 1rem;
  }

  .qm-lock-subtitle {
    font-size: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .qm-node--current .qm-node__ring {
    animation: none;
  }

  .qm-node--hidden {
    animation: none;
  }

  .qm-node--golden .qm-node__ring {
    animation: none;
  }

  .qm-node--variable .qm-node__ring {
    animation: none;
  }

  .qm-node--streak .qm-node__ring {
    animation: none;
  }

  .qm-trail--progress {
    transition: none;
  }

  .qm-card {
    transition: opacity 0.15s ease;
    transform: none !important;
  }

  .qm-card--active {
    transform: none !important;
  }

  .qm-card--exit-left,
  .qm-card--exit-right {
    transform: none !important;
  }

  .quest-xp-popup,
  .quest-particle,
  .quest-ring,
  .quest-confetti-piece,
  .quest-flash,
  .quest-celebration-text {
    animation: none !important;
    transition: none !important;
  }

  .quest-xp-popup.animate {
    opacity: 1;
    transform: translateX(-50%) translateY(-20px);
  }

  .quest-toast {
    transition: opacity 0.15s !important;
  }
}
