/* =========================================
   5. MAIN DASHBOARD (The HUD)
========================================= */
.main-stage {
  padding: 40px 48px;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.52);
  color: var(--app-text, #f8fafc);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.page-back-link__icon {
  line-height: 1;
  font-size: 1rem;
}

.page-back-link:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.6);
  background: rgba(14, 116, 144, 0.34);
}

.page-back-link:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.72);
  outline-offset: 2px;
}

/* Welcome Header */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  animation: slideDown 0.6s var(--ease-elastic);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.greeting h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  text-align: left;
  white-space: nowrap;
  color: var(--app-text);
}

.greeting .page-title-text,
.greeting .page-title {
  background: var(--hero-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px var(--hero-title-glow);
}


.hud-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hud-stats-group--action {
  gap: 0;
}

.hud-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(
    135deg,
    rgba(14, 116, 144, 0.55),
    rgba(16, 185, 129, 0.35)
  );
  color: #e2f8ff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(8, 47, 73, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.65);
  box-shadow: 0 14px 28px rgba(8, 47, 73, 0.5);
}

.hud-action-btn:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.7);
  outline-offset: 2px;
}

.hud-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #e2e8f0;
}

.hud-stat-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.coin-pill .hud-icon {
  filter: drop-shadow(0 0 5px #fbbf24);
}

.mg-pill .hud-icon {
  filter: drop-shadow(0 0 5px #22d3ee);
}

/* HERO: The Mission Board */
.mission-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.8));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-2xl);
  padding: 32px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden; margin-bottom: 48px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.1);
  transition: transform 0.3s;
}
.mission-hero:hover { border-color: var(--color-primary); box-shadow: 0 0 30px rgb(var(--accent-purple-rgb, 139 92 246) / 0.2); }

/* Holographic texture overlay */
.mission-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.3; pointer-events: none; mix-blend-mode: overlay;
}

.mission-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: skewX(-25deg);
  animation: scanline 6s infinite ease-in-out;
  pointer-events: none;
}

.mission-content { z-index: 1; }
.tag-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--hero-chip-text);
  background: var(--hero-chip-bg); padding: 4px 10px; border-radius: 6px;
  margin-bottom: 12px; border: 1px solid var(--hero-chip-border);
}
.dot-pulse { width: 6px; height: 6px; background: var(--hero-chip-text); border-radius: 50%; box-shadow: 0 0 8px var(--hero-chip-text); animation: pulse 2s infinite; }

.mission-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; line-height: 1.1; }

.btn-play-hero {
  width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  display: grid; place-items: center; font-size: 1.8rem;
  border: none; cursor: pointer; z-index: 1;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
  transition: all 0.3s var(--ease-elastic);
  animation: pulse-glow 3s infinite;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  min-width: 64px;
  min-height: 64px;
  margin-left: 16px;
}
.btn-play-hero:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 0 30px rgba(139, 92, 246, 0.7); }

.btn-play-hero:disabled,
.btn-play-hero[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

.btn-play-hero:disabled:hover,
.btn-play-hero[aria-disabled="true"]:hover {
  transform: none;
}

@keyframes scanline {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

@media (max-width: 48rem) {
  .hud-header {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-back-link {
    margin-bottom: 12px;
    padding: 7px 10px;
    border-radius: 10px;
    gap: 0;
  }

  .page-back-link__label {
    display: none;
  }

  .greeting h1 {
    font-size: 1.8rem;
    text-align: center;
  }

  .hud-stats-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .hud-action-btn {
    width: 100%;
    max-width: 420px;
    text-align: center;
  }

  .hud-stat-pill {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .mission-hero {
    align-items: center;
    padding-right: 16px;
  }

  .mission-content {
    min-width: 0;
  }

}
