/* ============================================================
   bond.css — Companion Bond System (Prompt 7)
   Rank banners, journal UI, card mini-badges, glow effects.
   ============================================================ */

/* ── Rank-up Banner (non-modal, slides in from top-right) ───── */
.bond-rank-banner {
  position: fixed;
  top: 80px; right: -380px;
  width: 340px;
  z-index: 3000;
  background: linear-gradient(135deg, rgba(5,8,30,0.97) 0%, rgba(10,14,50,0.97) 100%);
  border: 1px solid var(--brb-color, #ffd060);
  border-radius: 14px;
  box-shadow: 0 0 28px var(--brb-color, #ffd060)44, 0 8px 32px rgba(0,0,0,0.7);
  padding: 18px 20px 16px;
  text-align: center;
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}
.bond-rank-banner.brb-in {
  right: 16px;
  opacity: 1;
}
.brb-emoji {
  font-size: 2rem;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px var(--brb-color, #ffd060));
}
.brb-eyebrow {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--brb-color, #ffd060);
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 4px;
}
.brb-rank-name {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 2px;
}
.brb-rank-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brb-color, #ffd060);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.brb-reward {
  font-size: 0.75rem;
  color: rgba(200,220,255,0.75);
  line-height: 1.45;
}

/* ── Alien button bond glow states ──────────────────────────── */
#alien-btn.bond-glow-companion {
  filter: drop-shadow(0 0 18px #ff80c055) !important;
}
#alien-btn.bond-glow-ally {
  filter: drop-shadow(0 0 22px #a060ff66) !important;
  animation: bond-glow-pulse-ally 3s ease-in-out infinite;
}
#alien-btn.bond-glow-legend {
  filter: drop-shadow(0 0 28px #ffd70088) !important;
  animation: bond-glow-pulse-legend 2.5s ease-in-out infinite;
}

@keyframes bond-glow-pulse-ally {
  0%, 100% { filter: drop-shadow(0 0 22px #a060ff66); }
  50%       { filter: drop-shadow(0 0 32px #a060ffaa); }
}
@keyframes bond-glow-pulse-legend {
  0%, 100% { filter: drop-shadow(0 0 28px #ffd70088); }
  50%       { filter: drop-shadow(0 0 40px #ffd700cc); }
}

/* ── Portrait bond frames (in collection detail + journal) ───── */
.bond-frame-companion .acd-portrait {
  box-shadow: 0 0 20px #ff80c055, inset 0 0 12px #ff80c022;
}
.bond-frame-ally .acd-portrait {
  box-shadow: 0 0 24px #a060ff66, inset 0 0 14px #a060ff33;
}
.bond-frame-legend {
  position: relative;
}
.bond-frame-legend::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #ffd700, #ff8c00, #ff4500, #ffd700, #ff8c00, #ffd700);
  z-index: 0;
  animation: bond-legend-spin 4s linear infinite;
  opacity: 0.7;
}
.bond-frame-legend .acd-portrait {
  position: relative;
  z-index: 1;
}
@keyframes bond-legend-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Collection grid card — bond mini badge ─────────────────── */
.ac-bond-mini {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(0,0,0,0.7);
  color: #ffd060;
  letter-spacing: 0.5px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* ── Header bond rank pill ───────────────────────────────────── */
.hdr-bond-rank {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.5px;
  margin-top: 2px;
  transition: color 0.4s ease;
}

/* ── BOND JOURNAL PAGE ──────────────────────────────────────── */

.bj-page {
  padding: 0 0 80px;
  max-width: 680px;
  margin: 0 auto;
}
.bj-page-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 900;
  color: #e8f4ff;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  margin: 4px 0 6px;
}
.bj-page-sub {
  font-size: 0.74rem;
  color: rgba(180,220,255,0.65);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 0 16px;
}

/* Hero row: portrait + rank info side by side */
.bj-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 16px 16px;
}
.bj-hero .acd-portrait-frame {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}
.bj-hero .acd-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bj-hero-info {
  flex: 1;
  min-width: 0;
}
.bj-alien-name {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 1.2rem;
  font-weight: 900;
  color: #e8f0ff;
  margin-bottom: 6px;
}
.bj-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--brp-color, #ffd060);
  color: var(--brp-color, #ffd060);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1px;
  margin-bottom: 10px;
  box-shadow: 0 0 12px var(--brp-color, #ffd060)33;
}
.bj-bond-lv-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}
.bj-bond-lv-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(180,200,255,0.6);
  text-transform: uppercase;
}
.bj-bond-lv-num {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 1.8rem;
  font-weight: 900;
  color: #e8f0ff;
  line-height: 1;
}
.bj-bond-lv-max {
  font-size: 0.75rem;
  color: rgba(150,170,220,0.55);
}

/* Bond XP bar */
.bj-xp-wrap { margin-top: 2px; }
.bj-xp-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.bj-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brp-color, #ffd060) 0%, #fff8 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--brp-color, #ffd060)66;
}
.bj-xp-label {
  font-size: 0.68rem;
  color: rgba(180,200,255,0.6);
}

/* Section label */
.bj-section {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(150,180,255,0.55);
  text-transform: uppercase;
  padding: 18px 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bj-mem-count {
  font-size: 0.62rem;
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-family: inherit;
  letter-spacing: 0;
  color: rgba(180,200,255,0.6);
}

/* ── Rank Track ─────────────────────────────────────────────── */
.bj-rank-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 8px 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.bj-rank-track::-webkit-scrollbar { display: none; }

.bj-rank-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  flex-shrink: 0;
  cursor: default;
}
.bj-rn-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.3s;
}
.bj-rank-node.bj-rn-done .bj-rn-dot {
  background: rgba(61,255,160,0.15);
  border-color: #3dffa0;
  color: #3dffa0;
  font-size: 0.8rem;
}
.bj-rank-node.bj-rn-active .bj-rn-dot {
  background: rgba(255,208,96,0.15);
  border-color: #ffd060;
  box-shadow: 0 0 12px #ffd06066;
  font-size: 1rem;
}
.bj-rank-node.bj-rn-locked .bj-rn-dot {
  opacity: 0.35;
}
.bj-rn-name {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  color: rgba(180,200,255,0.7);
  white-space: nowrap;
}
.bj-rank-node.bj-rn-done .bj-rn-name { color: #3dffa0; }
.bj-rank-node.bj-rn-active .bj-rn-name { color: #ffd060; }
.bj-rank-node.bj-rn-locked .bj-rn-name { opacity: 0.4; }

.bj-rn-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.10);
  margin-top: 15px; /* aligns with center of dot (32px/2 - 1px) */
  min-width: 16px;
  border-radius: 1px;
}
.bj-rn-line.bj-rn-line-done {
  background: #3dffa066;
}

/* ── Memories ────────────────────────────────────────────────── */
.bj-memories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 4px;
}
.bj-memory {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.bj-mem-unlocked {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.bj-mem-unlocked:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}
.bj-mem-locked {
  background: rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.05);
  opacity: 0.6;
}
.bj-mem-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bj-mem-num {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(150,180,255,0.5);
  flex-shrink: 0;
}
.bj-mem-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #c8deff;
  flex: 1;
}
.bj-mem-thresh {
  font-size: 0.65rem;
  color: rgba(150,180,255,0.45);
  flex-shrink: 0;
  white-space: nowrap;
}
.bj-mem-text {
  font-size: 0.80rem;
  color: rgba(200,220,255,0.80);
  line-height: 1.65;
  font-style: italic;
}
.bj-mem-locked-text {
  font-style: normal;
  color: rgba(150,170,200,0.45);
}

/* ── Rank Rewards ────────────────────────────────────────────── */
.bj-rewards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 4px;
}
.bj-rew-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.bj-rew-earned {
  background: rgba(61,255,160,0.06);
  border-color: rgba(61,255,160,0.18);
}
.bj-rew-locked {
  background: rgba(0,0,0,0.15);
  border-color: rgba(255,255,255,0.05);
  opacity: 0.55;
}
.bj-rew-emoji  { font-size: 0.90rem; flex-shrink: 0; }
.bj-rew-rank   { font-weight: 700; font-size: 0.75rem; color: #c8deff; width: 80px; flex-shrink: 0; }
.bj-rew-label  { font-size: 0.73rem; color: rgba(180,200,255,0.75); flex: 1; line-height: 1.4; }
.bj-rew-status {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(61,255,160,0.8);
  flex-shrink: 0;
  white-space: nowrap;
}
.bj-rew-locked .bj-rew-status { color: rgba(150,170,200,0.45); }

/* ── How Bond Grows guidance ─────────────────────────────────── */
.bj-guidance {
  margin: 18px 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(80,200,255,0.04);
  border: 1px solid rgba(80,200,255,0.12);
}
.bj-guidance-title {
  font-family: var(--font-hd, 'Orbitron', monospace);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(80,200,255,0.65);
  margin-bottom: 10px;
}
.bj-guidance-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bj-guidance-item {
  font-size: 0.74rem;
  color: rgba(180,200,255,0.65);
  line-height: 1.4;
}

/* ── Collection header bond chip ─────────────────────────────── */
.ac-stat-bond {
  color: #ffd060 !important;
}

/* ── Responsive: smaller screens ─────────────────────────────── */
@media (max-width: 520px) {
  .bj-hero { gap: 12px; }
  .bj-hero .acd-portrait-frame { width: 72px; height: 72px; }
  .bj-alien-name { font-size: 1rem; }
  .bj-bond-lv-num { font-size: 1.4rem; }
  .bj-rank-track  { gap: 0; }
  .bond-rank-banner { width: 290px; }
}
