/* ============================================================
   NEXUS — Command Center SPA
   Mobile-first glassmorphism design system
   Feel: technology from 2035
   ============================================================ */

/* ---- CUSTOM PROPERTIES ---- */
:root {
  /* Core palette */
  --bg:            #06060f;
  --bg-elevated:   #0d0d1a;
  --bg-card:       #111122;
  --glass:         rgba(255, 255, 255, 0.025);
  --glass-hover:   rgba(255, 255, 255, 0.045);
  --glass-border:  rgba(255, 255, 255, 0.06);
  --glass-border-bright: rgba(0, 212, 255, 0.15);

  /* Accent colors */
  --cyan:          #00d4ff;
  --cyan-dim:      rgba(0, 212, 255, 0.12);
  --cyan-glow:     rgba(0, 212, 255, 0.25);
  --purple:        #a78bfa;
  --purple-dim:    rgba(167, 139, 250, 0.12);
  --green:         #6ee7b7;
  --green-dim:     rgba(110, 231, 183, 0.12);
  --gold:          #fbbf24;
  --gold-dim:      rgba(251, 191, 36, 0.15);
  --pink:          #f472b6;
  --orange:        #f97316;

  /* Text */
  --fg:            #e2e8f0;
  --fg-dim:        #94a3b8;
  --fg-muted:      #475569;
  --fg-subtle:     #2d3a4f;

  /* Fonts */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;

  /* Spacing */
  --gutter:        1.25rem;
  --section-gap:   1.5rem;
  --card-radius:   14px;
  --nav-height:    64px;
  --header-height: 56px;
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Prevent pull-to-refresh on mobile */
  overscroll-behavior-y: contain;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

/* ============================================================
   APP SHELL
   ============================================================ */

#nexus-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
#nexus-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-dim);
  border: 1px solid var(--glass-border-bright);
  border-radius: 8px;
  color: var(--cyan);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--fg-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  position: relative;
}

.icon-btn:hover,
.icon-btn:active {
  background: var(--glass-hover);
  color: var(--fg);
  border-color: rgba(255,255,255,0.1);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.signal-count {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--cyan);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.signal-count:empty { display: none; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan-dim), var(--purple-dim));
  border: 1px solid var(--glass-border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.2s;
}

.user-avatar:hover { transform: scale(1.05); }

/* ---- MAIN CONTENT ---- */
#nexus-main {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  overflow-x: hidden;
}

.page {
  display: none;
  padding: var(--gutter);
  animation: pageIn 0.3s ease-out;
}

.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}

/* ============================================================
   CARDS — GLASSMORPHISM
   ============================================================ */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, background 0.25s;
}

.card:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--glass-hover);
}

/* Rarity variants */
.card.rare    { border-color: rgba(167, 139, 250, 0.2); }
.card.legendary { border-color: rgba(251, 191, 36, 0.2); }
.card.mythic   { border-color: rgba(0, 212, 255, 0.3); box-shadow: 0 0 20px rgba(0,212,255,0.08); }

/* ============================================================
   HOME — COMMAND CENTER
   ============================================================ */

.hero-mission {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(167,139,250,0.06));
  border: 1px solid var(--glass-border-bright);
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.hero-mission::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(0,212,255,0.08), transparent 60%);
  pointer-events: none;
}

.hero-mission-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.hero-mission-tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-mission h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.hero-mission p {
  font-size: 0.85rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 340px;
}

.hero-mission-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.badge-cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0,212,255,0.2);
}

.badge-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(251,191,36,0.2);
}

.badge-purple {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(167,139,250,0.2);
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(110,231,183,0.2);
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.stat-card .stat-icon.cyan    { background: var(--cyan-dim); color: var(--cyan); }
.stat-card .stat-icon.purple  { background: var(--purple-dim); color: var(--purple); }
.stat-card .stat-icon.green   { background: var(--green-dim); color: var(--green); }
.stat-card .stat-icon.gold    { background: var(--gold-dim); color: var(--gold); }

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.2rem;
}

.stat-card .stat-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---- TOP OPERATORS ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.see-all {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cyan);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.2s;
}

.see-all:hover { opacity: 0.7; }

/* ---- OPERATOR MINI CARD ---- */
.operator-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.operator-mini {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  /* 44px min touch target */
  min-height: 60px;
}

.operator-mini:hover {
  border-color: rgba(255,255,255,0.1);
  background: var(--glass-hover);
  transform: translateX(2px);
}

.operator-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}

.operator-mini:hover .operator-avatar {
  box-shadow: 0 0 12px currentColor;
}

.op-info { flex: 1; min-width: 0; }
.op-handle {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-role {
  font-size: 0.72rem;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #000; }
.rank-2 { background: var(--silver-dim); color: #fff; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: var(--glass); color: var(--fg-dim); border: 1px solid var(--glass-border); }

.rank-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

/* ============================================================
   MISSIONS PAGE
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--fg-dim);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-height: 36px; /* touch target */
}

.filter-chip:hover {
  border-color: rgba(255,255,255,0.12);
  color: var(--fg);
}

.filter-chip.active {
  background: var(--cyan-dim);
  border-color: var(--glass-border-bright);
  color: var(--cyan);
}

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ---- MISSION CARD ---- */
.mission-card {
  padding: 1.25rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mission-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(0,212,255,0.08), transparent);
  pointer-events: none;
}

.mission-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.mission-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  flex: 1;
}

.rarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.rarity-common     { background: var(--glass); color: var(--fg-dim); border: 1px solid var(--glass-border); }
.rarity-rare       { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.rarity-legendary  { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(251,191,36,0.2); }
.rarity-mythic     { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,212,255,0.2); box-shadow: 0 0 8px rgba(0,212,255,0.15); }

.mission-desc {
  font-size: 0.82rem;
  color: var(--fg-dim);
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mission-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.difficulty-bar {
  display: flex;
  gap: 3px;
}

.difficulty-bar span {
  width: 14px; height: 4px;
  border-radius: 2px;
  background: var(--glass-border);
}

.difficulty-bar span.filled { background: var(--cyan); }
.difficulty-bar span.filled.orange { background: var(--orange); }
.difficulty-bar span.filled.red { background: #ef4444; }

.credits-badge {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.join-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
  transition: background 0.2s, transform 0.15s;
  min-height: 44px; /* 44px touch target */
  font-family: var(--font-body);
}

.join-btn:hover {
  background: rgba(0,212,255,0.2);
  transform: scale(1.03);
}

.join-btn:active { transform: scale(0.98); }

.join-btn.joined {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}

/* ============================================================
   OPERATORS PAGE
   ============================================================ */

.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-bar input {
  width: 100%;
  height: 48px;
  padding: 0 1rem 0 3rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.search-bar input::placeholder { color: var(--fg-muted); }
.search-bar input:focus { border-color: var(--glass-border-bright); }

.search-icon {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
}

.operator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

/* ---- OPERATOR CARD ---- */
.operator-card {
  padding: 1.25rem;
  cursor: pointer;
}

.op-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.op-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.op-card-info { flex: 1; min-width: 0; }

.op-card-handle {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.op-card-role {
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-card-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--green);
}

.op-card-availability .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.op-card-availability.busy { color: var(--orange); }
.op-card-availability.offline { color: var(--fg-muted); }

.op-card-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.op-card-location {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.op-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--fg-dim);
}

.skill-score {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cyan);
}

.op-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.op-stat { text-align: center; }
.op-stat-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.15rem;
}
.op-stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============================================================
   TEAMS PAGE
   ============================================================ */

.team-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.team-card {
  padding: 1.5rem;
  cursor: pointer;
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.team-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fg);
}

.team-tagline {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 1rem;
}

.team-members {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.team-member-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  margin-left: -8px;
}

.team-member-avatar:first-child { margin-left: 0; }

.team-member-count {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-left: 0.5rem;
}

.team-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-mission {
  font-size: 0.72rem;
  color: var(--fg-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-forming  { background: var(--purple-dim); color: var(--purple); }
.status-active   { background: var(--green-dim); color: var(--green); }
.status-completed { background: var(--cyan-dim); color: var(--cyan); }

/* ============================================================
   PROFILE PAGE
   ============================================================ */

/* ============================================================
   PROFILE — FULL IDENTITY ARCHITECTURE
   ============================================================ */

/* ---- HOLOGRAPHIC BANNER ---- */
.profile-banner {
  position: relative;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #060618 0%, #0a0a20 40%, #060614 100%);
  border: 1px solid var(--glass-border-bright);
}

.profile-banner-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: grid-drift 12s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to   { background-position: 28px 28px; }
}

.profile-banner-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,212,255,0.14) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(167,139,250,0.12) 0%, transparent 50%);
  animation: banner-glow-shift 6s ease-in-out infinite alternate;
}

@keyframes banner-glow-shift {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

.profile-banner-scan {
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.06), transparent);
  animation: banner-scan 4s ease-in-out infinite;
}

@keyframes banner-scan {
  0%   { left: -60%; }
  100% { left: 110%; }
}

/* ---- OPERATOR CARD ---- */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--glass);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  margin-top: -40px; /* overlaps banner bottom */
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0,212,255,0.05), transparent 60%);
  pointer-events: none;
}

/* ---- XP RING ---- */
.profile-xp-ring-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}

.profile-xp-ring {
  position: absolute;
  inset: 0;
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
}

.xp-ring-track {
  fill: none;
  stroke: rgba(0,212,255,0.1);
  stroke-width: 4;
}

.xp-ring-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--cyan));
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card-avatar {
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--fg);
  box-shadow: 0 0 16px rgba(0,212,255,0.1);
}

.profile-level-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--cyan);
  border-radius: 100px;
  padding: 1px 7px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
}

/* ---- CARD INFO ---- */
.profile-card-info {
  flex: 1;
  min-width: 0;
}

.profile-card-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.2rem;
}

.profile-card-handle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.profile-card-name {
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.1rem;
}

.profile-card-role {
  font-size: 0.72rem;
  color: var(--cyan);
  font-weight: 500;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-location {
  font-size: 0.68rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.profile-earned-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--purple-dim);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 100px;
  padding: 0.2rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.05em;
}

.profile-title-icon {
  font-size: 0.75rem;
}

/* ---- GLOBAL RANK ---- */
.profile-global-rank {
  flex-shrink: 0;
  text-align: center;
}

.profile-rank-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-rank-label {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 0.2rem;
}

/* ---- REPUTATION GRID ---- */
.profile-rep-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.profile-rep-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem 0.75rem 0.6rem;
  transition: border-color 0.2s;
}

.profile-rep-card:hover {
  border-color: rgba(0,212,255,0.15);
}

.rep-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.rep-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.rep-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.rep-bar-fill.cyan   { background: linear-gradient(90deg, var(--cyan), rgba(0,212,255,0.6)); }
.rep-bar-fill.purple { background: linear-gradient(90deg, var(--purple), rgba(167,139,250,0.6)); }
.rep-bar-fill.green  { background: linear-gradient(90deg, var(--green), rgba(110,231,183,0.6)); }

.rep-label {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---- PROFILE SECTION TITLE ---- */
.profile-section-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
}

/* ---- SKILL PROFILE ---- */
.profile-skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.profile-skill-row {}

.profile-skill-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.profile-skill-name {
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-transform: capitalize;
}

.profile-skill-score {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
}

.profile-skill-bar-track {
  height: 4px;
  background: var(--glass-border);
  border-radius: 2px;
  overflow: hidden;
}

.profile-skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- INTERESTS ---- */
.profile-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--fg-dim);
  text-transform: capitalize;
  transition: border-color 0.2s, color 0.2s;
}

.interest-tag:hover {
  border-color: rgba(0,212,255,0.2);
  color: var(--fg);
}

/* ---- BIO ---- */
.profile-bio-card {
  padding: 1rem;
}

.profile-bio-text {
  font-size: 0.82rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.profile-bio-placeholder {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.profile-bio-edit-btn {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: opacity 0.2s;
}

.profile-bio-edit-btn:hover { opacity: 0.7; }

.profile-bio-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border-bright);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 0.75rem;
  resize: vertical;
  outline: none;
  margin-bottom: 0.75rem;
  -webkit-appearance: none;
}

.profile-bio-textarea:focus { border-color: var(--cyan); }

.profile-bio-btn-row {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.profile-bio-save-btn,
.profile-bio-cancel-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
  min-height: 36px;
}

.profile-bio-save-btn {
  background: var(--cyan-dim);
  border: 1px solid var(--glass-border-bright);
  color: var(--cyan);
}

.profile-bio-save-btn:hover { background: rgba(0,212,255,0.2); }

.profile-bio-cancel-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--fg-dim);
}

.profile-bio-cancel-btn:hover { background: var(--glass-hover); }

/* ---- MISSIONS ON PROFILE ---- */
.profile-mission-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.profile-mission-card {
  padding: 0.9rem;
}

.profile-mission-card.completed {
  border-color: rgba(110,231,183,0.15);
}

.profile-mission-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.profile-mission-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  flex: 1;
}

.profile-mission-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.profile-mission-progress {}

.profile-progress-bar {
  height: 3px;
  background: var(--glass-border);
  border-radius: 2px;
  overflow: hidden;
}

.profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
}

/* ---- EMPTY MISSIONS STATE ---- */
.profile-empty-missions {
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.profile-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

.profile-empty-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-dim);
  margin-bottom: 0.35rem;
}

.profile-empty-sub {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.profile-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
  transition: background 0.2s, transform 0.15s;
  font-family: var(--font-body);
  min-height: 44px;
}

.profile-cta-btn:hover { background: rgba(0,212,255,0.2); }

/* ---- CONTRIBUTION GRAPH ---- */
.profile-contrib-wrap {
  padding: 1rem;
}

.contrib-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.contrib-total {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg);
}

.contrib-days {
  font-size: 0.68rem;
  color: var(--fg-muted);
}

.contrib-graph {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.contrib-graph::-webkit-scrollbar { display: none; }

.contrib-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.contrib-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  transition: transform 0.15s;
}

.contrib-cell:hover { transform: scale(1.3); }

.contrib-cell.level-0 { background: rgba(255,255,255,0.04); }
.contrib-cell.level-1 { background: rgba(0,212,255,0.18); }
.contrib-cell.level-2 { background: rgba(0,212,255,0.38); }
.contrib-cell.level-3 { background: rgba(0,212,255,0.62); }
.contrib-cell.level-4 { background: rgba(0,212,255,0.88); box-shadow: 0 0 4px rgba(0,212,255,0.5); }

.contrib-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 0.6rem;
  justify-content: flex-end;
}

.contrib-legend-cell {
  width: 11px;
  height: 11px;
}

/* ---- CERTIFICATION BADGES ---- */
.profile-certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.profile-cert-badge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-cert-badge.locked {
  opacity: 0.55;
  filter: saturate(0.4);
}

.profile-cert-badge::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.3;
}

.cert-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  display: block;
  line-height: 1;
}

.cert-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-dim);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.cert-status {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--glass);
  border-radius: 100px;
  padding: 0.15rem 0.5rem;
  display: inline-block;
}

/* Skeleton for profile banner */
.profile-banner-skeleton {
  height: 140px;
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

/* ============================================================
   SIGNAL PANEL
   ============================================================ */

.signal-panel {
  position: fixed;
  top: 0; right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--glass-border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.signal-panel.open {
  transform: translateX(0);
}

.signal-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.signal-panel-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.signal-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem var(--gutter) 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.signal-item {
  padding: 0.85rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.signal-item:hover { background: var(--glass-hover); }
.signal-item.unread { border-color: rgba(0,212,255,0.1); }

.signal-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.signal-type.mission_created { color: var(--cyan); }
.signal-type.team_formed     { color: var(--purple); }
.signal-type.milestone_reached { color: var(--gold); }
.signal-type.alert           { color: #ef4444; }

.signal-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.signal-msg {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.5;
}

.signal-time {
  font-size: 0.65rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 15, 0.7);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.panel-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   FLOATING BOTTOM NAVIGATION
   ============================================================ */

.nexus-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  /* safe area padding for iOS home indicator */
  padding-bottom: var(--safe-bottom);
}

.nav-safe-area {
  height: env(safe-area-inset-bottom, 0px);
  background: transparent;
}

.nav-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  background: rgba(6, 6, 15, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  padding: 0 0.5rem;
  padding-top: 0.5rem;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  transition: color 0.2s, transform 0.15s;
  min-width: 56px;
  min-height: 48px;
  border-radius: 10px;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

.nav-item span {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-item:hover { color: var(--fg-dim); }
.nav-item:active { transform: scale(0.92); }

/* Active state — cyan glow */
.nav-item.active {
  color: var(--cyan);
}

.nav-item.active svg {
  filter: drop-shadow(0 0 6px var(--cyan));
}

/* Active glow indicator bar */
.nav-glow {
  position: absolute;
  bottom: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(0,212,255,0.4);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg,
    var(--glass) 0%,
    rgba(255,255,255,0.05) 50%,
    var(--glass) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 1.25rem;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 0.6rem;
  border-radius: 4px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }
.skeleton-line.full { width: 100%; }

/* ============================================================
   ERROR STATES
   ============================================================ */

.error-state {
  text-align: center;
  padding: 3rem 1rem;
}

.error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: #ef4444;
}

.error-state h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.4rem;
}

.error-state p {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 1.25rem;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--fg-dim);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 44px;
  font-family: var(--font-body);
}

.retry-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.1);
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--fg-muted);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}

.empty-state p {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ============================================================
   PAGE-SPECIFIC SPACING
   ============================================================ */

/* Missions page title */
#page-missions .page-title { margin-bottom: 0; }
#page-operators .page-title { margin-bottom: 0.25rem; }

/* ============================================================
   CSS TRANSITIONS — GPU ACCELERATED
   ============================================================ */

/* Use transform/opacity for all animations */
.card, .nav-item, .operator-mini, .mission-card, .operator-card, .team-card, .icon-btn {
  will-change: transform;
}

/* Touch feedback */
button:active {
  opacity: 0.85;
}

/* ============================================================
   RESPONSIVE — TABLET/DESKTOP
   ============================================================ */

@media (min-width: 768px) {
  :root {
    --gutter: 2rem;
  }

  #nexus-main {
    padding-left: calc(50% + var(--gutter));
    /* Space for future sidebar nav */
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .operator-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mission-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .team-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .operator-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mission-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   ANIMATION PERFORMANCE
   ============================================================ */

/* Prefer transform + opacity over box-shadow animations */
@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.02); }
}

/* Intersection-observer-based fade-in for lists */
.fade-in {
  animation: fadeInUp 0.4s ease-out both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   UTILITY
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }

/* ============================================================
   ENERGY STATES
   ============================================================ */

.energy-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--energy-color, var(--cyan));
  box-shadow: 0 0 8px var(--energy-color, var(--cyan));
  animation: pulse-dot 2s ease-in-out infinite;
}

.mission-energy-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.energy-calm .energy-dot,
.energy-calm .energy-label { color: #3b82f6; }
.energy-calm .energy-dot { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }

.energy-rising .energy-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.energy-rising .energy-label { color: var(--cyan); }

.energy-critical .energy-dot { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.energy-critical .energy-label { color: var(--orange); }

/* ============================================================
   NETWORK BAR (Section 2)
   ============================================================ */

.network-bar {
  margin: 0 calc(-1 * var(--gutter));
  padding: 0.5rem var(--gutter);
  background: rgba(0, 212, 255, 0.04);
  border-top: 1px solid rgba(0,212,255,0.1);
  border-bottom: 1px solid rgba(0,212,255,0.1);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.network-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.network-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  flex-shrink: 0;
}

.network-dot.pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

.network-text {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   COMMAND CENTER HERO (Section 3)
   ============================================================ */

.hero-command-panel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
  background: var(--glass);
  box-shadow: 0 0 40px var(--energy-glow, rgba(0,212,255,0.1));
}

.hero-panel-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, var(--energy-glow, rgba(0,212,255,0.1)), transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hero-energy-state {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--energy-color, var(--cyan));
}

.hero-phase-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--fg-dim);
}

.hero-mission-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-progress-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.ring-svg {
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.ring-bg {
  stroke: var(--glass-border);
}

.ring-fill {
  stroke: var(--energy-color, var(--cyan));
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
  filter: drop-shadow(0 0 4px var(--energy-color, var(--cyan)));
}

.ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--fg);
}

.hero-next-obj { flex: 1; min-width: 0; }
.next-obj-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}
.next-obj-text {
  font-size: 0.82rem;
  color: var(--fg);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}
.next-obj-eta {
  font-size: 0.72rem;
  color: var(--fg-dim);
}

.hero-team-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hero-avatars {
  display: flex;
  gap: -8px;
}

.team-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  border: 2px solid var(--bg);
  margin-left: -6px;
  transition: transform 0.2s;
}

.team-avatar:first-child { margin-left: 0; }
.team-avatar:hover { transform: translateY(-2px); z-index: 1; }

.avatar-status {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--bg);
}

.avatar-status.status-active { background: var(--green); }
.avatar-status.status-idle { background: var(--gold); }

.hero-member-count {
  font-size: 0.72rem;
  color: var(--fg-dim);
}

.hero-ctas {
  display: flex;
  gap: 0.75rem;
}

.hero-cta-primary {
  flex: 1;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.hero-cta-secondary {
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
}

/* ============================================================
   BUTTONS (global)
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  background: var(--cyan);
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  min-height: 44px;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary.btn-joined { background: var(--green); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  background: var(--glass);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 44px;
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.12);
}

.badge-orange {
  background: rgba(249,115,22,0.12);
  color: var(--orange);
  border: 1px solid rgba(249,115,22,0.2);
}

/* ============================================================
   MOMENTUM PANEL (Section 4)
   ============================================================ */

.stats-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

.stats-scroll::-webkit-scrollbar { display: none; }

.momentum-card {
  flex-shrink: 0;
  min-width: 120px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

.momentum-card-skeleton {
  flex-shrink: 0;
  min-width: 120px;
  height: 80px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.momentum-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.momentum-value.cyan { color: var(--cyan); }
.momentum-value.purple { color: var(--purple); }
.momentum-value.gold { color: var(--gold); }
.momentum-value.green { color: var(--green); }

.momentum-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============================================================
   CONTRIBUTION FEED (Section 5)
   ============================================================ */

.feed-law-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: rgba(110,231,183,0.12);
  color: var(--green);
  border: 1px solid rgba(110,231,183,0.2);
  border-radius: 100px;
}

.contribution-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s;
}

.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--glass-hover); }

.feed-event-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--glass-border);
  color: var(--fg-dim);
}

.feed-event-icon.task_completed { background: rgba(110,231,183,0.15); color: var(--green); }
.feed-event-icon.operator_joined { background: rgba(0,212,255,0.12); color: var(--cyan); }
.feed-event-icon.mission_created { background: rgba(167,139,250,0.15); color: var(--purple); }
.feed-event-icon.mission_completed { background: rgba(251,191,36,0.12); color: var(--gold); }
.feed-event-icon.team_formed { background: rgba(244,114,182,0.12); color: var(--pink); }
.feed-event-icon.milestone_reached { background: rgba(249,115,22,0.12); color: var(--orange); }

.feed-body {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-actor { font-weight: 600; color: var(--fg); }
.feed-action { color: var(--fg-dim); }
.feed-mission { color: var(--fg-muted); font-style: italic; }

.feed-time {
  font-size: 0.65rem;
  color: var(--fg-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.load-more-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--fg-dim);
  font-size: 0.78rem;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}

.load-more-btn:hover { background: var(--glass-hover); color: var(--fg); }

/* ============================================================
   SIGNALS STACK (Section 6)
   ============================================================ */

.signal-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--cyan);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 100px;
}

.signals-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-stack-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
}

.signal-stack-card:hover { background: var(--glass-hover); }

.signal-stack-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.25rem;
}

.signal-stack-title {
  font-size: 0.82rem;
  color: var(--fg);
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.signal-stack-time {
  font-size: 0.65rem;
  color: var(--fg-muted);
}

/* ============================================================
   MISSION CARD ENHANCEMENTS
   ============================================================ */

.mission-card { cursor: pointer; }

.mission-progress-bar {
  height: 3px;
  background: var(--glass-border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.85rem 0;
}

.mission-progress-bar.large { height: 6px; border-radius: 3px; }

.mission-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease-out;
  min-width: 2px;
}

.why-it-matters {
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(167,139,250,0.06);
  border-left: 2px solid rgba(167,139,250,0.3);
  border-radius: 0 8px 8px 0;
}

.why-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.2rem;
}

.why-it-matters p {
  font-size: 0.78rem;
  color: var(--fg-dim);
  line-height: 1.5;
}

.member-count {
  font-size: 0.72rem;
  color: var(--fg-dim);
}

/* ============================================================
   MISSION DETAIL OVERLAY
   ============================================================ */

.full-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6,6,15,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.full-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.full-overlay-panel {
  width: 100%;
  max-height: 92vh;
  background: var(--bg-elevated);
  border-top: 1px solid var(--glass-border);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.full-overlay.open .full-overlay-panel {
  transform: translateY(0);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.overlay-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.close-overlay-btn {
  color: var(--fg-dim);
}

.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--gutter);
  -webkit-overflow-scrolling: touch;
}

/* Mission detail sections */

.mission-detail-hero {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(0,0,0,0.3), var(--glass));
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: 2px solid var(--energy-color, var(--cyan));
  border-radius: 14px;
  margin-bottom: 1rem;
}

.mission-detail-energy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--energy-color, var(--cyan));
}

.mission-detail-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.mission-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.mission-detail-section {
  margin-bottom: 1.25rem;
}

.mission-detail-section h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.6rem;
}

.mission-detail-section p {
  font-size: 0.85rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

.why-section .mission-detail-section h3 { color: var(--purple); }

/* Phase tracker */
.phase-tracker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  opacity: 0.4;
}

.phase-step.active { opacity: 1; }
.phase-step.done { opacity: 0.8; }

.phase-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--glass-border);
  border: 2px solid var(--glass-border);
}

.phase-step.active .phase-dot {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.phase-step.done .phase-dot {
  background: var(--green);
  border-color: var(--green);
}

.phase-step span {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--fg-dim);
}

/* Requirements grid */
.requirements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.req-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

.req-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.req-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
}

.req-role {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--fg-dim);
}

/* Task list */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  transition: opacity 0.3s;
}

.task-item.completed { opacity: 0.6; }

.task-check {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--green);
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
}

.task-item.completed .task-check {
  background: rgba(110,231,183,0.15);
  border-color: rgba(110,231,183,0.3);
}

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 0.82rem;
  color: var(--fg);
  margin-bottom: 0.15rem;
  line-height: 1.4;
}

.task-desc {
  font-size: 0.72rem;
  color: var(--fg-dim);
  line-height: 1.4;
}

.task-claim-btn {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  background: rgba(0,212,255,0.1);
  color: var(--cyan);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  min-height: 30px;
}

.task-claim-btn:hover { background: rgba(0,212,255,0.2); }

/* Detail actions */
.mission-detail-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
}

.mission-detail-actions .btn-primary { flex: 1; }
.mission-detail-actions .btn-secondary { flex-shrink: 0; }

/* ============================================================
   MISSION COMPLETION SCREEN
   ============================================================ */

.completion-overlay .full-overlay-panel {
  max-height: 100vh;
  border-radius: 0;
  background: linear-gradient(180deg, #0a0a1a 0%, #06060f 100%);
  align-items: center;
  justify-content: center;
}

.completion-screen {
  padding: 2rem var(--gutter);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.completion-burst {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
}

.burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: burst-out 1.5s ease-out infinite;
}

.burst-ring.r2 { animation-delay: 0.3s; }
.burst-ring.r3 { animation-delay: 0.6s; }

@keyframes burst-out {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.completion-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gold);
  filter: drop-shadow(0 0 16px var(--gold));
}

.completion-headline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.completion-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.completion-stat .cstat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.completion-stat .cstat-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.completion-impact {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.impact-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.4rem;
}

.completion-impact p {
  font-size: 0.82rem;
  color: var(--fg-dim);
  line-height: 1.5;
}

.completion-unlock {
  margin-bottom: 1.5rem;
}

.unlock-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 12px;
}

.unlock-icon { font-size: 1.5rem; }

.unlock-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.15rem;
}

.unlock-sub {
  font-size: 0.72rem;
  color: var(--fg-dim);
}

.completion-actions .btn-primary {
  width: 100%;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  resize: vertical;
}

.form-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.form-input::placeholder { color: var(--fg-muted); }

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

select.form-input option { background: var(--bg-elevated); }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--cyan);
}

.form-error {
  font-size: 0.78rem;
  color: var(--orange);
  padding: 0.5rem 0.75rem;
  background: rgba(249,115,22,0.08);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 8px;
  margin-top: 0.75rem;
}

/* ============================================================
   PROFILE ENHANCEMENTS
   ============================================================ */

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--green);
  margin-top: 0.4rem;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (min-width: 600px) {
  .hero-command-panel .hero-content { padding: 2rem; }
  .hero-mission-title { font-size: 1.75rem; }
  .completion-stats { gap: 3rem; }
  .requirements-grid { grid-template-columns: repeat(4, 1fr); }
  .mission-detail-actions { gap: 1rem; }
}
.mb-1 { margin-bottom: 1rem; }