/* ============================================================
   ALIEN COLLECTION — v5 Champion Roster
   Design: Brawl Stars-level champion feel.
   · Alien is the hero — always the dominant visual
   · 1-second comprehension: active, power, upgradeable
   · Upgrade button impossible to miss
   · Characters feel owned, not catalogued
   ============================================================ */

/* ── Rarity color tokens ───────────────────────────────────── */
:root {
  --rar-common:    #3dffa0;
  --rar-rare:      #50c8ff;
  --rar-epic:      #b060ff;
  --rar-mythic:    #ff8040;
  --rar-legendary: #ffd060;
}

/* ── Full-screen overlay ────────────────────────────────────── */
#modal-alien-collection {
  position: fixed; inset: 0; z-index: 1200;
  display: none;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #080c38 0%, #030518 45%, #010108 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#modal-alien-collection.ac-overlay-in { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   HEADER — stat dashboard
   ════════════════════════════════════════════════════════════ */

.ac-header {
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 14px;
  height: 54px;
  background: rgba(3,5,22,0.98);
  border-bottom: 1px solid rgba(80,180,255,0.15);
  gap: 8px;
}
.ac-header-icon { font-size: 1.2rem; opacity: 0.85; flex-shrink: 0; }
.ac-header-title {
  font-family: var(--font-hd);
  font-size: 0.90rem; font-weight: 900;
  letter-spacing: 3px; color: #c8deff;
  text-shadow: 0 0 18px rgba(80,180,255,0.35);
  flex-shrink: 0;
}

/* Stat chips row in header */
.ac-header-stats {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  margin-left: 8px; overflow: hidden;
}
.ac-stat-chip {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(180,210,255,0.75);
  background: rgba(80,180,255,0.07);
  border: 1px solid rgba(80,180,255,0.16);
  border-radius: 20px; padding: 3px 10px;
  white-space: nowrap; flex-shrink: 0;
}
.ac-stat-dna { color: var(--rar-common); border-color: rgba(61,255,160,0.22); background: rgba(61,255,160,0.06); }
.ac-stat-upgradeable { color: #fff; background: rgba(255,208,96,0.12); border-color: rgba(255,208,96,0.30); }
.ac-stat-upgradeable-active {
  animation: acUpgPulse 1.8s ease-in-out infinite;
}
@keyframes acUpgPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 10px rgba(255,208,96,0.35); }
}

/* Matches the global .modal-close treatment so every screen closes the same way */
.ac-close-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  color: var(--text-dim); font-size: 0.95rem;
  width: 38px; height: 38px;
  min-width: 38px; min-height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s, transform 0.12s, border-color 0.15s;
  flex-shrink: 0;
}
.ac-close-btn:hover {
  color: #ff6680;
  background: rgba(255,68,85,0.14);
  border-color: rgba(255,68,85,0.35);
  transform: scale(1.10);
}

/* ── Scrollable body ────────────────────────────────────────── */
#ac-body {
  flex: 1 1 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
#ac-body::-webkit-scrollbar { width: 8px; }
#ac-body::-webkit-scrollbar-thumb { background: rgba(80,180,255,0.35); border-radius: 4px; }
#ac-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }

/* ════════════════════════════════════════════════════════════
   COMPANION GRID
   ════════════════════════════════════════════════════════════ */

.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Base card ─────────────────────────────────────────────── */
.ac-card {
  position: relative;
  border-radius: 16px; overflow: hidden;
  cursor: pointer;
  background: rgba(8,10,36,0.95);
  border: 1.5px solid rgba(80,180,255,0.12);
  display: flex; flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
              border-color 0.2s, box-shadow 0.2s;
  min-height: 175px;
}
.ac-card:hover { transform: translateY(-4px) scale(1.03); }

/* ── Active card — GREEN glow, immediately obvious ───────── */
.ac-card-active {
  border-color: rgba(61,255,160,0.60) !important;
  box-shadow: 0 0 32px rgba(61,255,160,0.22), 0 4px 20px rgba(0,0,0,0.5);
}
.ac-card-active:hover {
  border-color: rgba(61,255,160,0.90) !important;
  box-shadow: 0 0 48px rgba(61,255,160,0.32), 0 8px 28px rgba(0,0,0,0.6);
}
.ac-card-active .ac-portrait-img {
  filter: drop-shadow(0 0 14px rgba(61,255,160,0.70));
}

/* ── Upgrade-available glow pulse ────────────────────────── */
.ac-card-upgradeable:not(.ac-card-active) {
  border-color: rgba(255,208,96,0.35) !important;
  animation: acCardUpgradePulse 2.2s ease-in-out infinite;
}
@keyframes acCardUpgradePulse {
  0%, 100% { box-shadow: 0 0 0px rgba(255,208,96,0); }
  50%       { box-shadow: 0 0 20px rgba(255,208,96,0.22); }
}
/* The infinite pulse above and the rarity :hover box-shadow below both
   drive box-shadow on the same element — fighting every frame and reading
   as a flicker. Freeze the pulse mid-hover so only the hover state controls
   box-shadow while the pointer is over the card. */
.ac-card-upgradeable:not(.ac-card-active):hover {
  animation-play-state: paused;
}

/* ── Rarity border tints (unlocked only) ─────────────────── */
.ac-card-unlocked.ac-rarity-common    { border-color: rgba(61,255,160,0.22); }
.ac-card-unlocked.ac-rarity-rare      { border-color: rgba(80,200,255,0.26); }
.ac-card-unlocked.ac-rarity-epic      { border-color: rgba(176,96,255,0.32); }
.ac-card-unlocked.ac-rarity-mythic    { border-color: rgba(255,128,64,0.35); }
.ac-card-unlocked.ac-rarity-legendary { border-color: rgba(255,208,96,0.40); }

.ac-card-unlocked.ac-rarity-common:hover    { border-color: rgba(61,255,160,0.55);  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 18px rgba(61,255,160,0.14); }
.ac-card-unlocked.ac-rarity-rare:hover      { border-color: rgba(80,200,255,0.60);  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 20px rgba(80,200,255,0.18); }
.ac-card-unlocked.ac-rarity-epic:hover      { border-color: rgba(176,96,255,0.65);  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 22px rgba(176,96,255,0.20); }
.ac-card-unlocked.ac-rarity-mythic:hover    { border-color: rgba(255,128,64,0.70);  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 28px rgba(255,128,64,0.24); }
.ac-card-unlocked.ac-rarity-legendary:hover { border-color: rgba(255,208,96,0.80);  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 34px rgba(255,208,96,0.30); }

/* Locked card */
.ac-card-locked { opacity: 0.55; }
.ac-card-locked:hover { opacity: 0.80; transform: translateY(-2px) scale(1.02); }

/* ── Rarity bars (top of card) ───────────────────────────── */
.ac-card-rarity-bar { height: 3px; width: 100%; flex-shrink: 0; }
.ac-rarity-common    .ac-card-rarity-bar { background: linear-gradient(90deg, transparent, var(--rar-common), transparent); }
.ac-rarity-rare      .ac-card-rarity-bar { background: linear-gradient(90deg, transparent, var(--rar-rare), transparent); }
.ac-rarity-epic      .ac-card-rarity-bar { background: linear-gradient(90deg, transparent, var(--rar-epic), transparent); }
.ac-rarity-mythic    .ac-card-rarity-bar { background: linear-gradient(90deg, transparent, var(--rar-mythic), transparent); }
.ac-rarity-legendary .ac-card-rarity-bar {
  background: linear-gradient(90deg, transparent 0%, var(--rar-legendary) 20%, #fff 35%,
    var(--rar-legendary) 50%, #ff8040 65%, var(--rar-legendary) 80%, transparent 100%);
  background-size: 200% auto;
  animation: acLegendaryShimmer 2.5s linear infinite;
}
@keyframes acLegendaryShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.ac-card-locked-stripe {
  height: 3px; width: 100%; flex-shrink: 0;
  background: linear-gradient(90deg, transparent, rgba(255,208,96,0.22), transparent);
}

/* ── Level + upgrade badges at top of card ────────────────── */
.ac-card-badges-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 7px 0;
  flex-shrink: 0;
}
.ac-card-level-badge {
  font-family: var(--font-hd);
  font-size: 0.58rem; font-weight: 900;
  color: rgba(200,230,255,0.75);
  background: rgba(10,15,50,0.90);
  border: 1px solid rgba(80,180,255,0.18);
  border-radius: 8px; padding: 2px 6px;
  letter-spacing: 0.5px;
}
.ac-card-upgrade-badge {
  font-size: 0.75rem;
  background: rgba(255,208,96,0.15);
  border: 1px solid rgba(255,208,96,0.40);
  border-radius: 8px; padding: 2px 5px;
  color: #ffd060;
  animation: acUpgBadgePulse 1.5s ease-in-out infinite;
}
@keyframes acUpgBadgePulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}
/* Moved off the badge row (which already carries Level + Upgrade) and onto
   the portrait corner — a personal-preference marker shouldn't compete with
   the two decision-relevant badges (level / upgrade-available) for attention. */
.ac-card-fav-dot {
  position: absolute; top: 4px; right: 6px; z-index: 2;
  font-size: 0.68rem; color: rgba(255,208,96,0.80);
  text-shadow: 0 0 6px rgba(255,208,96,0.5);
}

/* ── Active banner strip ───────────────────────────────────── */
.ac-active-banner {
  width: 100%;
  background: rgba(61,255,160,0.13);
  border-top: 1px solid rgba(61,255,160,0.30);
  border-bottom: 1px solid rgba(61,255,160,0.30);
  color: var(--green);
  font-size: 0.46rem;
  font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; text-align: center;
  padding: 5px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
}

/* ── Portrait area ────────────────────────────────────────── */
.ac-portrait-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 8px 4px;
  position: relative;
}
.ac-portrait-img {
  max-width: 84px; max-height: 84px;
  width: auto; height: auto;
  object-fit: contain; display: block;
  transition: transform 0.2s;
}
.ac-card-unlocked:hover .ac-portrait-img { transform: scale(1.12); }
.ac-silhouette {
  filter: brightness(0) saturate(0) !important;
  opacity: 0.12;
}
.ac-lock-icon {
  position: absolute; font-size: 1.4rem; opacity: 0.50;
}

/* ── Card info footer ─────────────────────────────────────── */
.ac-card-info {
  padding: 4px 8px 10px;
  text-align: center;
}
.ac-card-name {
  font-family: var(--font-hd);
  font-size: 0.74rem; font-weight: 700;
  color: #ddeeff; letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-card-name-locked {
  font-size: 0.60rem; color: rgba(255,208,96,0.50); letter-spacing: 1px;
}
.ac-card-power {
  font-family: var(--font-hd);
  font-size: 0.80rem; font-weight: 900;
  color: rgba(255,208,96,0.90);
  margin-top: 2px; letter-spacing: 0.5px;
}
.ac-card-power-locked {
  font-size: 0.58rem; font-weight: 400;
  color: rgba(255,208,96,0.35); letter-spacing: 0;
}

/* ── Card meta row: Role + Bond + Evolution (Prompt 6, Phases 2/5/6) ──
   Secondary/tertiary identity info — kept small and below the Power
   headline so Power stays the one unambiguous primary stat. */
.ac-card-meta-row {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px;
  margin-top: 4px;
}
.ac-card-role {
  font-size: 0.54rem; font-weight: 700; letter-spacing: 0.6px;
  color: rgba(160,210,255,0.65);
  background: rgba(80,180,255,0.08);
  border: 1px solid rgba(80,180,255,0.18);
  border-radius: 6px; padding: 1px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; max-width: 100%;
}
/* Bond mini badge — repositioned from absolute portrait overlay into the
   meta row so its meaning (Bond rank) sits next to Power, not floating
   unexplained on the portrait. */
.ac-card-meta-row .ac-bond-mini {
  position: static;
  background: rgba(255,208,96,0.10);
  border: 1px solid rgba(255,208,96,0.22);
}
.ac-card-evo-badge {
  font-size: 0.54rem; font-weight: 800; letter-spacing: 0.5px;
  border-radius: 6px; padding: 1px 6px;
  white-space: nowrap; text-transform: uppercase;
}
.ac-evo-ready {
  color: #1a1206;
  background: rgba(255,208,96,0.95);
  animation: goalReadyPulse 1.4s ease-in-out infinite;
}
.ac-evo-done {
  color: #04140c;
  background: rgba(176,96,255,0.85);
}

/* ── Sort bar (Part 8) ────────────────────────────────────── */
.ac-sort-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.ac-sort-label {
  font-family: var(--font-hd);
  font-size: 0.56rem; font-weight: 700; letter-spacing: 2px;
  color: rgba(160,210,255,0.55); margin-right: 4px;
}
.ac-sort-btn {
  font-family: var(--font-hd);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.5px;
  color: rgba(200,230,255,0.70);
  background: rgba(10,15,50,0.70);
  border: 1px solid rgba(80,180,255,0.18);
  border-radius: 8px; padding: 5px 11px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ac-sort-btn:hover { background: rgba(80,180,255,0.14); color: #fff; }
.ac-sort-btn.ac-sort-active {
  background: rgba(80,180,255,0.22);
  border-color: rgba(80,180,255,0.55);
  color: #cfeaff;
}

/* ── World badge — shown alongside the alien name everywhere a companion
   is displayed (Part 2). World grouping itself lives only in the side-panel
   roster; the picker (Part 4) is a flat, ownership-focused inventory. ──── */
.ac-card-world-badge {
  font-family: var(--font-hd);
  font-size: 0.52rem; font-weight: 700; letter-spacing: 1px;
  color: rgba(80,180,255,0.70);
  text-transform: uppercase;
  margin-top: 1px;
}
.acd-world-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-hd);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  opacity: 0.65;
}

/* ── Card status badges: ACTIVE / STRONGEST / NEW (Part 12) ──
   In-flow centered strip between the top badge row and the portrait, so the
   badges never overlap the level/upgrade badges, the fav dot, or the name. */
.ac-card-status-col {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px; padding: 4px 6px 0;
  flex-shrink: 0;
}
.ac-status-badge {
  font-family: var(--font-hd);
  font-size: 0.46rem; font-weight: 800; letter-spacing: 0.8px;
  padding: 2px 6px; border-radius: 6px; text-transform: uppercase;
  white-space: nowrap;
}
.ac-badge-active {
  color: #04140c;
  background: linear-gradient(90deg, var(--green, #3dffa0), #28d488);
  box-shadow: 0 0 8px rgba(61,255,160,0.4);
}
.ac-badge-strongest {
  color: #1a1206;
  background: rgba(255,208,96,0.95);
  box-shadow: 0 0 8px rgba(255,208,96,0.4);
}
.ac-badge-new {
  color: #ddeeff;
  background: rgba(80,180,255,0.22);
  border: 1px solid rgba(80,180,255,0.55);
}

/* ════════════════════════════════════════════════════════════
   NEXT SIGNAL DETECTED
   ════════════════════════════════════════════════════════════ */

.ac-next-signal {
  background: linear-gradient(135deg, rgba(255,208,96,0.06) 0%, rgba(80,180,255,0.03) 100%);
  border: 1.5px solid rgba(255,208,96,0.25);
  border-radius: 16px; padding: 14px 16px;
  margin-bottom: 14px; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
  position: relative; overflow: hidden;
}
.ac-next-signal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,208,96,0.6), transparent);
  animation: acNextScan 2.2s ease-in-out infinite;
}
@keyframes acNextScan {
  0%   { opacity: 0; transform: scaleX(0.3); }
  50%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0.3); }
}
.ac-next-signal:hover {
  border-color: rgba(255,208,96,0.50);
  box-shadow: 0 0 24px rgba(255,208,96,0.10);
  transform: translateY(-1px);
}
.ac-next-eyebrow {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: rgba(255,208,96,0.80);
  margin-bottom: 10px;
}
.ac-next-inner { display: flex; align-items: center; gap: 14px; }
.ac-next-portrait-wrap { position: relative; flex-shrink: 0; }
.ac-next-portrait { width: 58px; height: 58px; object-fit: contain; display: block; }
.ac-next-lock-icon {
  position: absolute; bottom: -4px; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  background: rgba(10,14,30,0.92);
  border: 1px solid rgba(255,208,96,0.45);
}
.ac-next-info { flex: 1; min-width: 0; }
.ac-next-name {
  font-family: var(--font-hd);
  font-size: 0.95rem; font-weight: 700;
  color: rgba(255,208,96,0.80); letter-spacing: 1px; margin-bottom: 4px;
}
.ac-next-hint {
  font-size: 0.68rem; color: rgba(200,220,255,0.45);
  font-style: italic; line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ac-next-progress-wrap { margin-top: 2px; }
.ac-next-progress-track {
  height: 5px; background: rgba(255,208,96,0.10);
  border-radius: 3px; overflow: hidden; margin-bottom: 4px;
}
.ac-next-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255,208,96,0.5), rgba(255,208,96,0.9));
  border-radius: 3px; transition: width 0.7s ease;
}
.ac-next-progress-label {
  font-size: 0.60rem; color: rgba(255,208,96,0.50); letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════════
   COLLECTION PROGRESS
   ════════════════════════════════════════════════════════════ */
/* Collection Complete payoff (Anticipation pass, Prompt 5.5 Phase 4) */
.ac-complete-banner {
  background: linear-gradient(135deg, rgba(61,255,160,0.08) 0%, rgba(80,180,255,0.03) 100%);
  border: 1.5px solid rgba(61,255,160,0.30);
  border-radius: 16px; padding: 16px; margin-bottom: 14px;
  text-align: center;
}
.ac-complete-eyebrow {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: rgba(61,255,160,0.85);
  margin-bottom: 8px;
}
.ac-complete-title {
  font-family: var(--font-hd); font-size: 1rem; font-weight: 900;
  color: #e8fff0; margin-bottom: 8px;
}
.ac-complete-reward {
  font-size: 0.8rem; color: #c8deff; margin-bottom: 12px;
}
.ac-complete-reward strong { color: #3dffa0; }
.ac-complete-owned {
  display: block; margin-top: 4px; font-size: 0.7rem; color: rgba(61,255,160,0.75);
}
.ac-complete-btn {
  background: linear-gradient(135deg, rgba(61,255,160,0.85), rgba(80,200,255,0.85));
  border: none; border-radius: 10px; padding: 8px 20px;
  font-family: var(--font-hd); font-size: 0.78rem; font-weight: 800;
  color: #04140c; cursor: pointer; letter-spacing: 0.5px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ac-complete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(61,255,160,0.25);
}

.ac-progress-section {
  background: rgba(8,10,36,0.70);
  border: 1px solid rgba(80,180,255,0.12);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
}
.ac-progress-label-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.ac-progress-title {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: rgba(80,180,255,0.60);
}
.ac-progress-count { font-size: 0.78rem; color: #c8deff; }
.ac-progress-count strong { font-family: var(--font-hd); font-size: 1rem; font-weight: 900; color: var(--green); }
.ac-progress-bar-track {
  height: 8px; background: rgba(80,180,255,0.10);
  border-radius: 4px; overflow: hidden; margin-bottom: 6px;
}
.ac-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(61,255,160,0.7), rgba(80,200,255,0.8));
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.25,1,0.5,1);
}
.ac-progress-sub { font-size: 0.62rem; color: var(--text-dim); text-align: right; }

/* ════════════════════════════════════════════════════════════
   SHARED BADGES
   ════════════════════════════════════════════════════════════ */
.ac-badge-active {
  display: inline-flex; align-items: center;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--green);
  background: rgba(61,255,160,0.12);
  border: 1px solid rgba(61,255,160,0.40);
  border-radius: 20px; padding: 3px 10px;
}
.ac-badge-rarity {
  display: inline-flex; align-items: center;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; border-radius: 20px; border: 1px solid; padding: 3px 10px;
}
.ac-badge-rarity.ac-rarity-common    { color: var(--rar-common);    border-color: rgba(61,255,160,0.38);  background: rgba(61,255,160,0.09); }
.ac-badge-rarity.ac-rarity-rare      { color: var(--rar-rare);      border-color: rgba(80,200,255,0.38);  background: rgba(80,200,255,0.09); }
.ac-badge-rarity.ac-rarity-epic      { color: var(--rar-epic);      border-color: rgba(176,96,255,0.42);  background: rgba(176,96,255,0.10); }
.ac-badge-rarity.ac-rarity-mythic    { color: var(--rar-mythic);    border-color: rgba(255,128,64,0.42);  background: rgba(255,128,64,0.10); }
.ac-badge-rarity.ac-rarity-legendary { color: var(--rar-legendary); border-color: rgba(255,208,96,0.48);  background: rgba(255,208,96,0.12); }

/* ════════════════════════════════════════════════════════════
   DETAIL PAGE — Champion Layout
   LEFT (portrait) | CENTER (identity + upgrade) | RIGHT (stats)
   BOTTOM: lore
   ════════════════════════════════════════════════════════════ */

.acd-page {
  display: flex; flex-direction: column;
  min-height: 100%;
  gap: 0;
}

.ac-back-btn {
  background: rgba(80,180,255,0.06); border: 1px solid rgba(80,180,255,0.25);
  border-radius: 8px; cursor: pointer;
  color: rgba(80,180,255,0.85); font-size: 1.0rem;
  padding: 10px 18px 10px 14px; letter-spacing: 0.5px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
  transition: color 0.15s, transform 0.15s, background 0.15s;
  align-self: flex-start; flex-shrink: 0; margin-bottom: 8px;
  min-height: 42px;
}
.ac-back-btn:hover { color: #fff; background: rgba(80,180,255,0.14); transform: translateX(-2px); }

/* ── 3-column layout ────────────────────────────────────────── */
.acd-layout {
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  gap: 28px;
  align-items: start;
}

/* ── LEFT: Portrait hero ────────────────────────────────────── */
.acd-col-portrait {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.acd-portrait-frame {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  border-radius: 24px;
  background: rgba(8,10,36,0.80);
  border: 2px solid rgba(80,180,255,0.14);
}
.acd-portrait {
  width: 200px; height: 200px;
  object-fit: contain; display: block;
}
/* Rarity glows */
.acd-portrait-frame.ac-rarity-common    { border-color: rgba(61,255,160,0.30); }
.acd-portrait-frame.ac-rarity-rare      { border-color: rgba(80,200,255,0.35); }
.acd-portrait-frame.ac-rarity-epic      { border-color: rgba(176,96,255,0.40); }
.acd-portrait-frame.ac-rarity-mythic    { border-color: rgba(255,128,64,0.45); }
.acd-portrait-frame.ac-rarity-legendary { border-color: rgba(255,208,96,0.50); }

.acd-portrait-frame.ac-rarity-common    .acd-portrait { filter: drop-shadow(0 0 22px rgba(61,255,160,0.45)); }
.acd-portrait-frame.ac-rarity-rare      .acd-portrait { filter: drop-shadow(0 0 24px rgba(80,200,255,0.50)); }
.acd-portrait-frame.ac-rarity-epic      .acd-portrait { filter: drop-shadow(0 0 28px rgba(176,96,255,0.55)); }
.acd-portrait-frame.ac-rarity-mythic    .acd-portrait { filter: drop-shadow(0 0 32px rgba(255,128,64,0.60)); }
.acd-portrait-frame.ac-rarity-legendary .acd-portrait { filter: drop-shadow(0 0 36px rgba(255,208,96,0.65)); }

/* Active: override all with green pulse */
.acd-portrait-frame.acd-portrait-active {
  border-color: rgba(61,255,160,0.65) !important;
  box-shadow: 0 0 40px rgba(61,255,160,0.20);
}
.acd-portrait-frame.acd-portrait-active .acd-portrait {
  filter: drop-shadow(0 0 30px rgba(61,255,160,0.80)) !important;
  animation: acdPortraitPulse 2.8s ease-in-out infinite;
}
@keyframes acdPortraitPulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(61,255,160,0.80)); }
  50%       { filter: drop-shadow(0 0 52px rgba(61,255,160,1.00)); }
}

.acd-badges {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.acd-badge-owned {
  display: inline-flex; align-items: center;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(80,200,255,0.75); background: rgba(80,200,255,0.08);
  border: 1px solid rgba(80,200,255,0.25); border-radius: 20px; padding: 3px 10px;
}
.acd-fav-btn {
  background: rgba(255,208,96,0.05); border: 1px solid rgba(255,208,96,0.18);
  border-radius: 10px; color: rgba(255,208,96,0.45);
  font-size: 0.80rem; font-weight: 600; padding: 8px 20px; cursor: pointer;
  font-family: var(--font-ui); letter-spacing: 0.5px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  width: 100%; text-align: center;
}
.acd-fav-btn:hover { background: rgba(255,208,96,0.10); border-color: rgba(255,208,96,0.38); color: #ffd060; transform: scale(1.03); }
.acd-fav-btn.acd-fav-active { background: rgba(255,208,96,0.12); border-color: rgba(255,208,96,0.40); color: #ffd060; }

/* ── CENTER: Identity + level + power + upgrade ─────────────── */
.acd-col-center {
  display: flex; flex-direction: column;
  gap: 16px;
}
.acd-name {
  font-family: var(--font-hd);
  font-size: 2.0rem; font-weight: 900;
  color: #eaf8ff; letter-spacing: 0.5px; line-height: 1.05;
}
.acd-title {
  font-size: 0.80rem; color: var(--text-dim); font-style: italic;
  margin-top: -10px;
}

/* ── Role + Evolution status row (Prompt 6, Phases 2 & 6) ──────── */
.acd-role-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.acd-role-badge {
  font-family: var(--font-hd);
  font-size: 0.62rem; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(160,210,255,0.80);
  background: rgba(80,180,255,0.10);
  border: 1px solid rgba(80,180,255,0.28);
  border-radius: 8px; padding: 4px 10px;
}
/* Level progress row */
.acd-level-row {
  display: flex; align-items: center; gap: 10px;
}
.acd-level-label {
  font-family: var(--font-hd);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 2px;
  color: rgba(80,180,255,0.55); flex-shrink: 0;
}
.acd-level-num {
  font-family: var(--font-hd);
  font-size: 1.30rem; font-weight: 900;
  color: #c8deff; flex-shrink: 0; min-width: 28px;
}
.acd-level-bar-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
}
.acd-level-bar-track {
  flex: 1; height: 7px;
  background: rgba(80,180,255,0.10);
  border-radius: 4px; overflow: hidden;
}
.acd-level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(80,180,255,0.6), rgba(61,255,160,0.8));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.acd-level-max {
  font-size: 0.62rem; color: rgba(80,180,255,0.45); flex-shrink: 0; letter-spacing: 1px;
}

/* ── Power-block delta chip (vs. active companion) ──────────────
   Reused inline next to the Power number — no separate box needed. */
.acd-cmp-chip {
  font-family: var(--font-hd);
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
}
.acd-cmp-up    { background: rgba(61,255,160,0.14); color: #3dffa0; }
.acd-cmp-down  { background: rgba(255,90,90,0.14);  color: #ff8a8a; }
.acd-cmp-even  { background: rgba(150,170,200,0.14); color: rgba(200,215,235,0.75); }

/* Ability strip merged into the Power block (Prompt: UX Pass 2) */
.acd-power-ability {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,208,96,0.12);
}
.acd-power-ability-icon { font-size: 0.85rem; color: rgba(255,208,96,0.65); flex-shrink: 0; }
.acd-power-ability-text {
  font-size: 0.74rem; color: rgba(255,232,190,0.80);
  line-height: 1.35;
}

/* Keep power display class as hidden fallback — no longer used as focal element */
.acd-power-display { display: none; }
.acd-power-icon, .acd-power-val, .acd-power-label { display: none; }

/* ── Detail page: Power headline block (Part 2 + Part 4) ─────── */
.acd-power-block {
  padding: 12px 16px;
  background: rgba(255,208,96,0.06);
  border: 1px solid rgba(255,208,96,0.22);
  border-left: 3px solid rgba(255,208,96,0.55);
  border-radius: 14px;
}
.acd-power-block.acd-power-strongest {
  background: rgba(255,208,96,0.10);
  border-color: rgba(255,208,96,0.45);
  box-shadow: 0 0 18px rgba(255,208,96,0.14);
}
.acd-power-row { display: flex; align-items: center; gap: 10px; }
.acd-power-value {
  font-family: var(--font-hd);
  font-size: 1.25rem; font-weight: 900; letter-spacing: 0.4px;
  color: #ffd874; text-shadow: 0 0 12px rgba(255,208,96,0.4);
}
.acd-power-tag {
  font-size: 0.5rem; font-weight: 800; letter-spacing: 1px;
  color: #1a1206; background: rgba(255,208,96,0.92);
  padding: 2px 7px; border-radius: 6px;
}
/* ── UPGRADE BUTTON — the largest element on the page ────────── */
.acd-upgrade-btn {
  width: 100%;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(61,255,160,0.18) 0%, rgba(61,255,160,0.08) 100%);
  border: 2.5px solid rgba(61,255,160,0.60);
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  box-shadow: 0 0 30px rgba(61,255,160,0.15), inset 0 1px 0 rgba(61,255,160,0.15);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.acd-upgrade-btn::before {
  content: '';
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(61,255,160,0.08), transparent);
  transition: left 0.4s;
}
.acd-upgrade-btn:hover::before { left: 150%; }
.acd-upgrade-btn:hover {
  background: linear-gradient(135deg, rgba(61,255,160,0.28) 0%, rgba(61,255,160,0.16) 100%);
  border-color: rgba(61,255,160,0.90);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(61,255,160,0.28), inset 0 1px 0 rgba(61,255,160,0.20);
}
.acd-upgrade-btn:active { transform: scale(0.98); }

/* Can't-afford state */
.acd-upgrade-btn-locked {
  background: rgba(40,50,90,0.60);
  border-color: rgba(80,100,160,0.40);
  box-shadow: none;
  cursor: default;
}
.acd-upgrade-btn-locked:hover {
  background: rgba(40,50,90,0.70);
  border-color: rgba(80,100,160,0.55);
  transform: none;
  box-shadow: none;
}
.acd-upgrade-btn-locked::before { display: none; }

.acd-upgrade-title {
  font-family: var(--font-hd);
  font-size: 1.10rem; font-weight: 900; letter-spacing: 2px;
  color: var(--green);
  margin-bottom: 12px;
}
.acd-upgrade-btn-locked .acd-upgrade-title {
  color: rgba(180,200,240,0.60);
}
.acd-upgrade-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.acd-upgrade-cost {
  display: flex; align-items: center; gap: 6px;
}
.acd-upgrade-cost-icon { font-size: 1.1rem; }
.acd-upgrade-cost-val {
  font-family: var(--font-hd);
  font-size: 1.05rem; font-weight: 900;
  color: var(--rar-common);
}
.acd-upgrade-need {
  font-size: 0.68rem; color: rgba(255,100,100,0.75);
  background: rgba(255,60,60,0.08); border: 1px solid rgba(255,60,60,0.20);
  border-radius: 8px; padding: 2px 7px;
  white-space: nowrap;
}
.acd-upgrade-gain {
  display: flex; flex-direction: column; align-items: flex-end;
}
.acd-upgrade-gain-label {
  font-size: 0.52rem; letter-spacing: 1.0px; color: rgba(255,208,96,0.55);
  text-transform: uppercase; white-space: nowrap;
}
.acd-upgrade-gain-val {
  font-family: var(--font-hd);
  font-size: 0.90rem; font-weight: 900; color: #ffd060;
  white-space: nowrap;
}

/* DNA progress bar when can't afford */
.acd-upgrade-dna-bar-wrap { margin-top: 14px; }
.acd-upgrade-dna-bar-track {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden; margin-bottom: 6px;
}
.acd-upgrade-dna-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(61,255,160,0.4), rgba(61,255,160,0.7));
  border-radius: 3px; transition: width 0.5s ease;
}
.acd-upgrade-dna-count {
  font-size: 0.68rem; color: rgba(61,255,160,0.50); text-align: right;
}

/* Max level state */
.acd-upgrade-max {
  padding: 20px 24px;
  background: rgba(255,208,96,0.06);
  border: 2px solid rgba(255,208,96,0.30);
  border-radius: 18px; text-align: center;
}
.acd-upgrade-max-label {
  font-family: var(--font-hd);
  font-size: 1.1rem; font-weight: 900; letter-spacing: 3px; color: #ffd060;
  margin-bottom: 6px;
}
.acd-upgrade-max-sub { font-size: 0.72rem; color: rgba(255,208,96,0.45); font-style: italic; }

/* ── Companion select / active ──────────────────────────────── */
.acd-cta-select {
  width: 100%; padding: 16px 24px;
  background: rgba(80,180,255,0.07);
  border: 2px solid rgba(80,180,255,0.35);
  border-radius: 14px; color: rgba(80,200,255,0.85);
  font-family: var(--font-hd);
  font-size: 0.90rem; font-weight: 900; letter-spacing: 2.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.acd-cta-select:hover {
  background: rgba(80,180,255,0.14); border-color: rgba(80,180,255,0.70);
  transform: translateY(-2px);
}
.acd-cta-active {
  width: 100%; text-align: center; padding: 16px 24px;
  background: rgba(61,255,160,0.05); border: 2px solid rgba(61,255,160,0.22);
  border-radius: 14px; color: rgba(61,255,160,0.70);
  font-family: var(--font-hd);
  font-size: 0.82rem; font-weight: 700; letter-spacing: 2px; cursor: default;
}

/* ── RIGHT: Bond + Evolution status pills (Prompt: UX Pass 2) ──
   Replaces the old separate Bond/Evolution/Behavior cards with one
   compact, icon-led, tappable strip. */
.acd-col-right {
  display: flex; flex-direction: column; gap: 10px;
}
.acd-status-strip {
  display: flex; flex-direction: column; gap: 8px;
}
.acd-status-pill {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: rgba(80,180,255,0.04);
  border: 1px solid rgba(80,180,255,0.14);
  border-radius: 12px; padding: 10px 12px;
  cursor: pointer; font-family: var(--font-ui);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.acd-status-pill:hover {
  background: rgba(80,180,255,0.09); border-color: rgba(80,180,255,0.35);
  transform: translateY(-1px);
}
.acd-status-pill:active { transform: scale(0.98); }
.acd-status-pill-icon {
  font-size: 1.15rem; line-height: 1; flex-shrink: 0;
  width: 26px; text-align: center;
}
.acd-status-pill-body { flex: 1; min-width: 0; }
.acd-status-pill-label {
  display: block;
  font-family: var(--font-hd);
  font-size: 0.70rem; font-weight: 800; letter-spacing: 0.5px;
  color: #cce4ff;
}
.acd-status-pill-bar-track {
  display: block; height: 4px; margin-top: 5px;
  background: rgba(80,180,255,0.10); border-radius: 2px; overflow: hidden;
}
.acd-status-pill-bar-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, rgba(80,180,255,0.6), rgba(61,255,160,0.8));
  border-radius: 2px; transition: width 0.5s ease;
}
.acd-status-pill-sub {
  display: block;
  font-size: 0.60rem; color: rgba(160,210,255,0.50);
  margin-top: 3px; line-height: 1.3;
}
.acd-status-pill-arrow {
  font-size: 1.0rem; color: rgba(160,210,255,0.35);
  flex-shrink: 0; transition: transform 0.15s, color 0.15s;
}
.acd-status-pill:hover .acd-status-pill-arrow {
  color: rgba(160,210,255,0.70); transform: translateX(2px);
}
.acd-status-pill-pulse {
  border-color: rgba(255,208,96,0.55);
  background: rgba(255,208,96,0.08);
  animation: goalReadyPulse 1.4s ease-in-out infinite;
}
.acd-status-pill-pulse .acd-status-pill-label,
.acd-status-pill-pulse .acd-status-pill-sub { color: #ffd060; }

/* Evolution requirement icons — filled vs. empty, no per-item sentences */
.acd-evo-dot-row { display: inline-flex; gap: 3px; margin-top: 4px; vertical-align: middle; }
.acd-evo-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(176,96,255,0.18); border: 1px solid rgba(176,96,255,0.35);
}
.acd-evo-dot-filled { background: rgba(176,96,255,0.85); border-color: rgba(176,96,255,0.95); }

/* ── BOTTOM: Lore (secondary) ───────────────────────────────── */
.acd-lore-section {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(8,10,36,0.50);
  border: 1px solid rgba(80,180,255,0.08);
  border-top: 2px solid rgba(80,180,255,0.12);
  border-radius: 0 0 14px 14px;
}
.acd-lore-label {
  font-size: 0.52rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: rgba(80,180,255,0.30); margin-bottom: 8px;
}
.acd-lore-text {
  font-size: 0.78rem; color: rgba(200,225,255,0.38);
  line-height: 1.70; font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   LOCKED DETAIL PAGE
   ════════════════════════════════════════════════════════════ */
.acd-page-locked { align-items: stretch; }
.acd-locked-center {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 20px;
  max-width: 440px; margin: 0 auto;
}
.acd-locked-portrait-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.acd-portrait-locked {
  width: 170px; height: 170px;
  object-fit: contain; display: block;
}
.acd-lock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; opacity: 0.60;
}
.acd-name-locked { font-size: 1.25rem; color: rgba(255,208,96,0.75); letter-spacing: 2px; }
.acd-badge-signal {
  display: inline-flex; align-items: center;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,208,96,0.80); background: rgba(255,208,96,0.09);
  border: 1px solid rgba(255,208,96,0.28); border-radius: 20px; padding: 4px 13px;
}
.acd-progress-section {
  width: 100%; background: rgba(255,208,96,0.04);
  border: 1px solid rgba(255,208,96,0.15); border-radius: 14px; padding: 16px;
}
.acd-progress-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,208,96,0.55); margin-bottom: 10px;
}
.acd-progress-track {
  height: 8px; background: rgba(255,208,96,0.10);
  border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}
.acd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255,208,96,0.5), rgba(255,208,96,0.9));
  border-radius: 4px; transition: width 0.6s ease;
}
.acd-progress-numbers {
  font-size: 0.72rem; color: rgba(255,208,96,0.55); text-align: center;
}
.acd-mystery-hint {
  font-size: 0.82rem; color: rgba(200,220,255,0.42);
  line-height: 1.65; font-style: italic; text-align: center;
  padding: 14px 18px;
  background: rgba(40,40,70,0.25);
  border: 1px solid rgba(80,80,120,0.18);
  border-left: 2px solid rgba(255,208,96,0.22);
  border-radius: 10px;
  width: 100%;
}

/* ════════════════════════════════════════════════════════════
   COMPANIONS NAV BUTTON  — progression card entry point
   Design: portrait + level badge + name + DNA progress bar.
   Looks like a character progression element, not a widget.
   ════════════════════════════════════════════════════════════ */
#hdr-alien-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: linear-gradient(135deg, rgba(61,255,160,0.10) 0%, rgba(61,255,160,0.04) 100%);
  border: 1.5px solid rgba(61,255,160,0.32);
  border-radius: 14px; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.2s;
  flex-shrink: 0; min-width: 160px; max-width: 220px;
  position: relative;
}
#hdr-alien-btn:hover {
  background: linear-gradient(135deg, rgba(61,255,160,0.19) 0%, rgba(61,255,160,0.10) 100%);
  border-color: rgba(61,255,160,0.60);
  transform: scale(1.035);
  box-shadow: 0 0 20px rgba(61,255,160,0.22);
}
#hdr-alien-btn:active { transform: scale(0.96); }

/* Upgrade-available state — turns gold, pulses */
#hdr-alien-btn.hdr-has-upgrades {
  border-color: rgba(255,208,96,0.62) !important;
  box-shadow: 0 0 14px rgba(255,208,96,0.24);
  animation: hdrAlienUpgPulse 2s ease-in-out infinite;
}
@keyframes hdrAlienUpgPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,208,96,0.18); }
  50%       { box-shadow: 0 0 30px rgba(255,208,96,0.45); }
}
#hdr-alien-btn.hdr-has-upgrades .hdr-dna-bar-fill {
  background: linear-gradient(90deg, rgba(255,208,96,0.75), rgba(255,208,96,1.0));
}
#hdr-alien-btn.hdr-has-upgrades .hdr-dna-label {
  color: #ffd060;
  animation: goalReadyPulse 1.4s ease-in-out infinite;
}

/* Intro flash — plays once when upgrades become available */
#hdr-alien-btn.hdr-upg-intro {
  animation: hdrUpgIntro 0.6s ease-out !important;
}
@keyframes hdrUpgIntro {
  0%   { box-shadow: 0 0 0 rgba(255,208,96,0); }
  30%  { box-shadow: 0 0 44px rgba(255,208,96,0.65); }
  100% { box-shadow: 0 0 8px rgba(255,208,96,0.18); }
}

/* Upgrade badge — corner indicator */
.hdr-upgrade-badge {
  /* Kept inside the button bounds — a negative top offset put the badge
     above the header where the viewport clipped its upper half. */
  position: absolute; top: 2px; right: 2px;
  background: linear-gradient(135deg, #ffd060, #ff9820);
  color: #1a0600;
  font-family: var(--font-hd);
  font-size: 0.54rem; font-weight: 900; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 10px; min-width: 18px;
  text-align: center;
  box-shadow: 0 0 12px rgba(255,208,96,0.70), 0 2px 6px rgba(0,0,0,0.5);
  animation: hdrBadgePop 0.35s cubic-bezier(0.34,1.56,0.64,1),
             hdrBadgeBounce 2s 0.4s ease-in-out infinite;
  white-space: nowrap; z-index: 2;
}
@keyframes hdrBadgePop {
  0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}
@keyframes hdrBadgeBounce {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.18); }
}

/* Portrait block — relative container so level badge can overlay */
.hdr-portrait-block {
  position: relative;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
}

.hdr-alien-portrait {
  width: 40px; height: 40px; object-fit: contain; display: block;
  filter: drop-shadow(0 0 8px rgba(61,255,160,0.55));
  transition: filter 0.3s;
  flex-shrink: 0;
}

/* Level badge — overlaid on portrait bottom center */
.hdr-lv-badge {
  position: absolute;
  bottom: -5px; left: 50%;
  transform: translateX(-50%);
  background: rgba(4,8,32,0.94);
  border: 1px solid rgba(61,255,160,0.50);
  border-radius: 6px;
  font-family: var(--font-hd);
  font-size: 0.46rem; font-weight: 900; letter-spacing: 0.5px;
  color: var(--green);
  padding: 1px 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Companion info block: label + name + progress bar */
.hdr-companion-info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; overflow: hidden; flex: 1;
  padding-top: 1px;
}

/* "COMPANIONS" — navigation label */
.hdr-companion-label {
  font-family: var(--font-hd);
  font-size: 0.42rem; font-weight: 700; letter-spacing: 2.5px;
  color: rgba(61,255,160,0.58); text-transform: uppercase;
  line-height: 1;
}

/* Alien name — the identity anchor */
.hdr-alien-name {
  font-family: var(--font-hd);
  font-size: 0.70rem; font-weight: 700; color: var(--green);
  letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.1;
}

/* DNA progress bar row — visual progress to next level */
.hdr-dna-progress {
  display: flex; align-items: center; gap: 5px;
  margin-top: 1px;
}

.hdr-dna-bar-track {
  flex: 1; height: 4px;
  background: rgba(61,255,160,0.10);
  border-radius: 2px; overflow: hidden;
  min-width: 36px;
}

.hdr-dna-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(61,255,160,0.55), rgba(61,255,160,0.90));
  border-radius: 2px;
  transition: width 0.55s ease;
}

/* DNA label: "12/25" or "READY!" */
.hdr-dna-label {
  font-family: var(--font-hd);
  font-size: 0.46rem; font-weight: 700;
  color: rgba(61,255,160,0.68);
  white-space: nowrap; flex-shrink: 0;
  line-height: 1;
}

/* Bond progress row — rank label + XP-to-next-rank bar (retention pass 5.5) */
.hdr-bond-progress {
  display: flex; align-items: center; gap: 5px;
  margin-top: 1px;
}

.hdr-bond-rank {
  font-family: var(--font-hd);
  font-size: 0.46rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  line-height: 1;
}

.hdr-bond-bar-track {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
  min-width: 36px;
}

.hdr-bond-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255,208,96,0.55), rgba(255,208,96,0.90));
  border-radius: 2px;
  transition: width 0.55s ease;
}

.hdr-bond-xp {
  font-family: var(--font-hd);
  font-size: 0.46rem; font-weight: 700;
  color: rgba(255,208,96,0.68);
  white-space: nowrap; flex-shrink: 0;
  line-height: 1;
}

/* Shared animation for ready pulse */
@keyframes goalReadyPulse {
  0%, 100% { opacity: 0.80; }
  50%       { opacity: 1.00; }
}

/* ════════════════════════════════════════════════════════════
   DNA FLOAT — animated reward text when DNA is earned
   ════════════════════════════════════════════════════════════ */
.dna-float {
  position: fixed;
  pointer-events: none;
  z-index: 9500;
  font-family: var(--font-hd);
  font-size: 1.0rem; font-weight: 900;
  color: #3dffa0;
  text-shadow: 0 0 12px rgba(61,255,160,0.9), 0 0 28px rgba(61,255,160,0.45);
  animation: dnaFloatAnim 1.7s ease-out forwards;
  white-space: nowrap;
  transform: translateX(-50%);
}
.dna-float-passive {
  font-size: 0.80rem;
  color: rgba(61,255,160,0.80);
  text-shadow: 0 0 8px rgba(61,255,160,0.55);
}
@keyframes dnaFloatAnim {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.15); }
  12%  { transform: translateX(-50%) translateY(-10px) scale(1.0); }
  75%  { opacity: 0.85; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-68px) scale(0.88); }
}

/* ════════════════════════════════════════════════════════════
   DNA DISCOVERY TOAST — fires once on very first DNA earned
   ════════════════════════════════════════════════════════════ */
.dna-discovery-toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(110px);
  z-index: 8000;
  background: linear-gradient(135deg, rgba(6,12,48,0.98) 0%, rgba(3,7,28,0.98) 100%);
  border: 2px solid rgba(61,255,160,0.58);
  border-radius: 18px;
  padding: 16px 20px 16px 16px;
  display: flex; align-items: center; gap: 14px;
  min-width: 260px; max-width: 380px;
  box-shadow: 0 0 50px rgba(61,255,160,0.25), 0 12px 40px rgba(0,0,0,0.75);
  transition: transform 0.42s cubic-bezier(0.22,1,0.36,1), opacity 0.42s;
  opacity: 0;
}
.dna-discovery-toast.dna-disc-in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.dna-disc-icon {
  font-size: 2.2rem; flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(61,255,160,0.7));
  animation: dnaDiscIconPulse 1.8s ease-in-out infinite;
}
@keyframes dnaDiscIconPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(61,255,160,0.60)); }
  50%       { filter: drop-shadow(0 0 18px rgba(61,255,160,1.00)); }
}
.dna-disc-body { flex: 1; min-width: 0; }
.dna-disc-eyebrow {
  font-family: var(--font-hd);
  font-size: 0.50rem; font-weight: 700; letter-spacing: 2.5px;
  color: rgba(61,255,160,0.65); text-transform: uppercase;
  margin-bottom: 2px;
}
.dna-disc-title {
  font-family: var(--font-hd);
  font-size: 0.95rem; font-weight: 900; letter-spacing: 0.5px;
  color: #eaffef; margin-bottom: 5px; line-height: 1.1;
}
.dna-disc-text {
  font-size: 0.74rem; color: rgba(200,230,255,0.80);
  line-height: 1.45; margin-bottom: 10px;
}
.dna-disc-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 18px;
  background: rgba(61,255,160,0.14);
  border: 1.5px solid rgba(61,255,160,0.52);
  border-radius: 10px; cursor: pointer;
  color: var(--rar-common);
  font-family: var(--font-hd);
  font-size: 0.68rem; font-weight: 900; letter-spacing: 1.5px;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.dna-disc-btn:hover {
  background: rgba(61,255,160,0.26);
  border-color: rgba(61,255,160,0.78);
  transform: scale(1.04);
}

/* ════════════════════════════════════════════════════════════
   MOBILE NAV UPGRADE DOT
   ════════════════════════════════════════════════════════════ */
#mob-btn-aliens { position: relative; }
.mob-upgrade-dot {
  position: absolute; top: 5px; right: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ffd060;
  box-shadow: 0 0 8px rgba(255,208,96,0.85);
  animation: mobDotPulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes mobDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.85; }
}

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

/* Phone ≤ 480px */
@media (max-width: 480px) {
  #ac-body { padding: 10px; }
  .ac-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
  .ac-portrait-img { max-width: 70px; max-height: 70px; }
  .ac-card { min-height: 145px; }

  .ac-next-signal { padding: 10px 12px; }
  .ac-next-portrait { width: 46px; height: 46px; }
  .ac-next-name { font-size: 0.84rem; }
  .ac-next-hint { -webkit-line-clamp: 1; }

  .acd-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .acd-col-portrait { order: 1; }
  .acd-col-center   { order: 2; }
  .acd-col-right    { order: 3; }
  .acd-portrait { width: 140px; height: 140px; }
  .acd-name { font-size: 1.4rem; }
  .acd-power-value { font-size: 1.5rem; }
  .acd-upgrade-btn { padding: 16px 18px; }
  .acd-upgrade-title { font-size: 0.90rem; }
  .hdr-alien-text { display: none; }
  #hdr-alien-btn { padding: 3px 5px; min-width: 0; max-width: 44px; }
  .ac-header-stats { gap: 5px; }
  .ac-stat-chip { font-size: 0.62rem; padding: 3px 8px; }
}

/* Small tablet 481–680px */
@media (min-width: 481px) and (max-width: 680px) {
  .ac-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .acd-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .acd-col-portrait { order: 1; }
  .acd-col-center   { order: 2; }
  .acd-col-right    { order: 3; }
  .acd-portrait { width: 160px; height: 160px; }
}

/* Tablet 681–960px */
@media (min-width: 681px) and (max-width: 960px) {
  .ac-grid { grid-template-columns: repeat(4, 1fr); }
  .acd-layout { grid-template-columns: 220px 1fr 180px; gap: 20px; }
  .acd-portrait { width: 170px; height: 170px; }
}

/* Desktop ≥ 961px */
@media (min-width: 961px) {
  .ac-grid { grid-template-columns: repeat(5, 1fr); }
  #ac-body { max-width: 1100px; margin: 0 auto; }
  .acd-page { max-width: 1000px; margin: 0 auto; }
}

/* ════════════════════════════════════════════════════════════
   DNA PARTICLES — travel from alien to ALIENS button
   ════════════════════════════════════════════════════════════ */
.dna-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9600;
  font-size: 1.5rem;
  line-height: 1;
  transform-origin: center center;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 10px rgba(61,255,160,0.95));
}

/* Flash when particle lands on ALIENS button */
@keyframes hdrDnaFlash {
  0%   { box-shadow: 0 0 0 rgba(61,255,160,0); }
  30%  { box-shadow: 0 0 36px rgba(61,255,160,0.85), inset 0 0 16px rgba(61,255,160,0.25); }
  100% { box-shadow: 0 0 8px rgba(61,255,160,0.12); }
}
#hdr-alien-btn.hdr-dna-flash {
  animation: hdrDnaFlash 0.45s ease-out !important;
}
/* First-DNA beacon: sustained pulse on ALIENS button */
@keyframes hdrDnaBeacon {
  0%, 100% { box-shadow: 0 0 6px rgba(61,255,160,0.20); border-color: rgba(61,255,160,0.50); }
  50%       { box-shadow: 0 0 32px rgba(61,255,160,0.65); border-color: rgba(61,255,160,0.90); }
}
#hdr-alien-btn.hdr-dna-beacon {
  animation: hdrDnaBeacon 1.2s ease-in-out infinite !important;
}

/* ════════════════════════════════════════════════════════════
   DNA PROGRESS HINT — "+N 🧬 · X more needed" near alien
   ════════════════════════════════════════════════════════════ */
.dna-progress-hint {
  position: fixed;
  pointer-events: none;
  z-index: 9400;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transform: translateX(-50%) translateY(0);
  opacity: 0;
  animation: dphIn 0.28s cubic-bezier(0.22,1,0.36,1) forwards;
}
.dna-progress-hint.dph-out {
  animation: dphOut 0.35s ease-in forwards;
}
@keyframes dphIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes dphOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-18px); }
}
.dph-plus {
  font-family: var(--font-hd);
  font-size: 1.3rem; font-weight: 900;
  color: #3dffa0;
  text-shadow: 0 0 16px rgba(61,255,160,0.95);
}
.dph-goal {
  font-family: var(--font-hd);
  font-size: 0.60rem; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(80,180,255,0.70);
  background: rgba(4,8,32,0.88);
  border: 1px solid rgba(80,180,255,0.20);
  border-radius: 20px; padding: 2px 10px;
  white-space: nowrap;
}
.dph-goal.dph-ready {
  color: #ffd060;
  border-color: rgba(255,208,96,0.40);
  background: rgba(30,20,4,0.90);
  box-shadow: 0 0 12px rgba(255,208,96,0.28);
}

/* ════════════════════════════════════════════════════════════
   LEVEL-UP BANNER — flies in when alien levels up
   ════════════════════════════════════════════════════════════ */
.ac-levelup-banner {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9700;
  opacity: 0;
  pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(3,8,30,0.97) 0%, rgba(6,18,50,0.97) 100%);
  border: 2px solid rgba(61,255,160,0.60);
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(61,255,160,0.35), 0 12px 40px rgba(0,0,0,0.7);
  transition: opacity 0.30s, transform 0.30s cubic-bezier(0.22,1,0.36,1);
}
.ac-levelup-banner.alb-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.alb-alien {
  font-family: var(--font-hd);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 2.5px;
  color: rgba(61,255,160,0.75); text-transform: uppercase;
}
.alb-level {
  font-family: var(--font-hd);
  font-size: 2.2rem; font-weight: 900; letter-spacing: 1px;
  color: #eaffef; line-height: 1;
  text-shadow: 0 0 30px rgba(61,255,160,0.70);
}
.alb-power {
  font-family: var(--font-hd);
  font-size: 0.80rem; font-weight: 900; letter-spacing: 2px;
  color: #ffd060;
}

/* Portrait burst on level-up */
@keyframes acdLevelupBurst {
  0%   { box-shadow: 0 0 0 rgba(61,255,160,0); transform: scale(1); }
  20%  { box-shadow: 0 0 60px rgba(61,255,160,0.85), 0 0 100px rgba(61,255,160,0.40); transform: scale(1.05); }
  60%  { box-shadow: 0 0 30px rgba(61,255,160,0.45); transform: scale(1.02); }
  100% { box-shadow: 0 0 18px rgba(61,255,160,0.20); transform: scale(1); }
}
.acd-levelup-burst {
  animation: acdLevelupBurst 0.65s ease-out !important;
}

/* ════════════════════════════════════════════════════════════
   GAMEPLAY POWER-UP FEEDBACK — alien button when companion levels
   ════════════════════════════════════════════════════════════ */
@keyframes alienPowerUp {
  0%   { filter: drop-shadow(0 0 8px currentColor) brightness(1); transform: scale(1); }
  18%  { filter: drop-shadow(0 0 50px rgba(61,255,160,1)) brightness(1.5); transform: scale(1.12); }
  50%  { filter: drop-shadow(0 0 28px rgba(61,255,160,0.8)) brightness(1.2); transform: scale(1.06); }
  100% { filter: drop-shadow(0 0 14px rgba(61,255,160,0.5)) brightness(1); transform: scale(1); }
}
#alien-btn.alien-power-up .alien-img {
  animation: alienPowerUp 0.80s cubic-bezier(0.22,1,0.36,1) !important;
}

/* "POWER UP" label that flies upward near alien */
.alien-powerup-label {
  position: fixed;
  pointer-events: none;
  z-index: 9500;
  font-family: var(--font-hd);
  font-size: 1.10rem; font-weight: 900; letter-spacing: 3px;
  color: #3dffa0;
  text-shadow: 0 0 16px rgba(61,255,160,0.9), 0 0 32px rgba(61,255,160,0.5);
  transform: translateX(-50%);
  animation: powerupLabelAnim 1.1s cubic-bezier(0.22,0.61,0.36,1) forwards;
  white-space: nowrap;
}
@keyframes powerupLabelAnim {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.1); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1.0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-80px) scale(0.85); }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES for companion button
   ════════════════════════════════════════════════════════════ */

/* Phone ≤ 480px — compact button: portrait + bar + count only */
@media (max-width: 480px) {
  #hdr-alien-btn {
    min-width: 0 !important;
    max-width: 148px !important;
    padding: 3px 8px 3px 3px !important;
    gap: 5px !important;
  }
  .hdr-portrait-block { width: 34px; height: 34px; }
  .hdr-alien-portrait { width: 32px !important; height: 32px !important; }
  .hdr-lv-badge { font-size: 0.40rem !important; padding: 1px 4px !important; bottom: -4px; }
  .hdr-companion-label { display: none !important; }
  .hdr-alien-name { font-size: 0.60rem !important; }
  .hdr-dna-bar-track { min-width: 28px !important; }
  .hdr-dna-label { font-size: 0.42rem !important; }
  .hdr-bond-progress { display: none !important; }
}

/* Tablet 481–680px — show label but compact */
@media (min-width: 481px) and (max-width: 680px) {
  #hdr-alien-btn { min-width: 130px; max-width: 175px; }
  .hdr-alien-portrait { width: 34px !important; height: 34px !important; }
  .hdr-portrait-block { width: 36px; height: 36px; }
}
