/* =============================================================
   evolution.css — Evolution System Styles
   Covers: trial panel, path overlay, ceremony, evolved visuals,
   detail section, journal section.
   ============================================================= */

/* ── Evolved alien button states ─────────────────────────── */
.alien-evolved-A,
.alien-evolved-B {
  position: relative;
}

.alien-evolved-A::after,
.alien-evolved-B::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--evo-color, #c070ff);
  animation: evo-pulse-ring 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.alien-evolved-B::after {
  animation-duration: 1.8s;
  border-style: dashed;
}

@keyframes evo-pulse-ring {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1.0; transform: scale(1.06); }
}

/* Evolved aura glow on the alien image */
.alien-evolved-A .alien-img,
.alien-evolved-B .alien-img {
  filter: drop-shadow(0 0 10px var(--evo-color, #c070ff))
          drop-shadow(0 0 22px var(--evo-color, #c070ff));
  transition: filter 0.4s;
}

/* Evolved particle trail (idle) */
.alien-evolved-A .alien-img {
  animation: evo-breathe-a 3s ease-in-out infinite;
}
.alien-evolved-B .alien-img {
  animation: evo-breathe-b 2s ease-in-out infinite;
}

@keyframes evo-breathe-a {
  0%,100% { transform: scale(1)   translateY(0); }
  50%      { transform: scale(1.03) translateY(-3px); }
}
@keyframes evo-breathe-b {
  0%,100% { transform: scale(1)   rotate(0deg); }
  25%      { transform: scale(1.04) rotate(1deg); }
  75%      { transform: scale(1.02) rotate(-1deg); }
}

/* ── Evolution Trial Panel ────────────────────────────────── */
.evo-trial-panel {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, rgba(20,12,40,0.97), rgba(12,6,28,0.97));
  border: 1px solid #7040c0;
  border-radius: 14px;
  padding: 14px 18px 12px;
  min-width: 300px;
  max-width: 380px;
  z-index: 700;
  box-shadow: 0 4px 32px rgba(112,64,192,0.5);
  animation: evo-panel-in 0.35s cubic-bezier(.22,1,.36,1) forwards;
  color: #e0d8f8;
  font-family: inherit;
}

@keyframes evo-panel-in {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

.evo-trial-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c090ff;
  margin-bottom: 6px;
}

.evo-trial-desc {
  font-size: 12px;
  color: #b8a8d8;
  margin-bottom: 10px;
  line-height: 1.45;
}

.evo-trial-bar-wrap {
  height: 7px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.evo-trial-bar {
  height: 100%;
  background: linear-gradient(90deg, #7040c0, #c070ff);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.evo-trial-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #9080b0;
}

.evo-trial-fail-msg {
  margin-top: 8px;
  font-size: 12px;
  color: #ff7060;
  text-align: center;
}

.evo-trial-dismiss {
  display: block;
  margin: 10px auto 0;
  padding: 5px 18px;
  background: transparent;
  border: 1px solid rgba(112,64,192,0.5);
  border-radius: 20px;
  color: #8060a0;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.evo-trial-dismiss:hover {
  border-color: #c070ff;
  color: #c070ff;
}

/* ── Path Overlay ─────────────────────────────────────────── */
.evo-path-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,2,14,0.94);
  /* Triggered from inside the Alien Collection overlay (z-index 1200) —
     must render above it. Aligned to the "full attention" tier (9999),
     same as .modal-overlay. */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  overflow-y: auto;
  animation: evo-overlay-in 0.4s ease;
}

@keyframes evo-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.evo-path-inner {
  max-width: 780px;
  width: 100%;
  color: #e0d8f8;
}

.evo-path-headline {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #c090ff;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.evo-path-success-msg {
  font-size: 13px;
  color: #a8c8a0;
  text-align: center;
  margin-bottom: 12px;
  font-style: italic;
  line-height: 1.5;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.evo-path-warning {
  font-size: 12px;
  color: #ffc070;
  text-align: center;
  margin-bottom: 20px;
}

.evo-path-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.evo-path-card {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(var(--evo-path-color, #c070ff), 0.3);
  border-color: rgba(128,80,200,0.3);
  border-radius: 16px;
  padding: 18px 16px 14px;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.evo-path-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--evo-path-color, #c070ff) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.evo-path-card:hover,
.evo-path-card.evo-path-selected {
  border-color: var(--evo-path-color, #c070ff);
  box-shadow: 0 0 24px rgba(192,112,255,0.3);
  transform: translateY(-3px);
}
.evo-path-card:hover::before,
.evo-path-card.evo-path-selected::before { opacity: 0.07; }

.evo-path-icon {
  font-size: 28px;
  margin-bottom: 6px;
  text-align: center;
}

.evo-path-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--evo-path-color, #c070ff);
  text-align: center;
  margin-bottom: 2px;
}

.evo-path-tagline {
  font-size: 11px;
  color: #9080b0;
  text-align: center;
  font-style: italic;
  margin-bottom: 6px;
}

.evo-path-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  color: #a890c8;
  margin: 0 auto 10px;
  display: block;
  text-align: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.evo-path-desc {
  font-size: 12px;
  color: #c0b0e0;
  line-height: 1.5;
  margin-bottom: 12px;
}

.evo-path-traits {
  margin-bottom: 10px;
}

.evo-path-trait {
  margin-bottom: 8px;
}

.evo-trait-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--evo-path-color, #c070ff);
  margin-bottom: 2px;
}

.evo-trait-desc {
  display: block;
  font-size: 11px;
  color: #9888b8;
  line-height: 1.4;
}

.evo-path-title-preview {
  font-size: 11px;
  color: #7860a0;
  text-align: center;
  margin-bottom: 12px;
  font-style: italic;
}
.evo-path-title-preview em {
  color: #c0a0e8;
}

.evo-path-confirm-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, rgba(var(--evo-path-color, #c070ff), 0.15), rgba(var(--evo-path-color, #c070ff), 0.08));
  background: linear-gradient(135deg, rgba(120,60,200,0.25), rgba(80,40,140,0.2));
  border: 1px solid var(--evo-path-color, #c070ff);
  border-radius: 24px;
  color: var(--evo-path-color, #c070ff);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.04em;
}
.evo-path-confirm-btn:hover {
  background: rgba(192,112,255,0.2);
  transform: scale(1.02);
}

.evo-path-cancel {
  display: block;
  margin: 0 auto;
  padding: 7px 24px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  color: #6050808;
  color: rgba(200,180,255,0.4);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.evo-path-cancel:hover {
  color: #c090ff;
  border-color: rgba(192,144,255,0.5);
}

/* ── Ceremony Overlay ─────────────────────────────────────── */
.evo-ceremony {
  position: fixed;
  inset: 0;
  background: rgba(2,1,8,0.97);
  /* Same "full attention" tier as .evo-path-overlay / .modal-overlay (9999) —
     must render above the Alien Collection overlay (1200) it's launched from. */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #e0d8f8;
  overflow: hidden;
}

.evo-ceremony-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.evo-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid var(--evo-ceremony-color, #c070ff);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: evo-ring-expand 2s ease-out infinite;
}
.evo-ring.slow { animation-duration: 3.5s; }

.evo-ring.r1 { width: 160px; height: 160px; animation-delay: 0s; }
.evo-ring.r2 { width: 260px; height: 260px; animation-delay: 0.5s; }
.evo-ring.r3 { width: 380px; height: 380px; animation-delay: 1.0s; }

@keyframes evo-ring-expand {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.3); }
  30%  { opacity: 0.8; }
  100% { opacity: 0;  transform: translate(-50%,-50%) scale(1.4); }
}

.evo-ceremony-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(220,235,255,0.85) 0%, rgba(120,160,255,0.4) 60%, transparent 100%);
  animation: evo-flash 1.4s ease-out forwards;
  pointer-events: none;
}
@keyframes evo-flash {
  0%   { opacity: 0; }
  35%  { opacity: 0.55; }
  100% { opacity: 0; }
}

.evo-ceremony-label {
  position: relative;
  font-size: 16px;
  color: #c090ff;
  letter-spacing: 0.12em;
  animation: evo-pulse-text 1.5s ease-in-out infinite;
}
@keyframes evo-pulse-text {
  0%,100% { opacity: 0.6; }
  50%      { opacity: 1.0; }
}

.evo-ceremony-portrait {
  position: relative;
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 50%;
  animation: evo-portrait-in 0.6s cubic-bezier(.22,1,.36,1);
}
.evo-portrait-glow {
  filter: drop-shadow(0 0 18px var(--evo-ceremony-color, #c070ff))
          drop-shadow(0 0 40px var(--evo-ceremony-color, #c070ff));
}
@keyframes evo-portrait-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.evo-ceremony-name {
  position: relative;
  font-size: 22px;
  font-weight: 700;
  color: #e8d8ff;
  animation: evo-slide-up 0.5s ease;
}

.evo-ceremony-title-reveal {
  position: relative;
  font-size: 24px;
  font-weight: 700;
  color: var(--evo-ceremony-color, #c070ff);
  letter-spacing: 0.06em;
  animation: evo-title-reveal 0.7s cubic-bezier(.22,1,.36,1);
  text-align: center;
  padding: 0 20px;
}
@keyframes evo-title-reveal {
  from { opacity: 0; letter-spacing: 0.3em; }
  to   { opacity: 1; letter-spacing: 0.06em; }
}

.evo-ceremony-path-name {
  position: relative;
  font-size: 13px;
  color: #9880b8;
  font-style: italic;
  animation: evo-slide-up 0.5s 0.2s ease both;
}

.evo-ceremony-traits {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: evo-slide-up 0.5s 0.4s ease both;
}

.evo-reward-trait {
  font-size: 13px;
  color: #c8b8e8;
  text-align: center;
}

@keyframes evo-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.evo-ceremony-dismiss {
  position: relative;
  padding: 11px 36px;
  background: linear-gradient(135deg, rgba(192,112,255,0.2), rgba(120,60,200,0.15));
  border: 1px solid var(--evo-ceremony-color, #c070ff);
  border-radius: 30px;
  color: var(--evo-ceremony-color, #c070ff);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.06em;
  animation: evo-slide-up 0.5s 0.7s ease both;
  transition: transform 0.15s, box-shadow 0.2s;
}
.evo-ceremony-dismiss:hover {
  transform: scale(1.04);
  box-shadow: 0 0 20px rgba(192,112,255,0.4);
}

/* ── Evolution Section (Detail Page) ─────────────────────── */
.evo-section {
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 8px;
  font-family: inherit;
}

.evo-locked {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.evo-ready {
  background: rgba(192,112,255,0.06);
  border: 1px solid rgba(192,112,255,0.3);
  animation: evo-ready-pulse 3s ease-in-out infinite;
}
@keyframes evo-ready-pulse {
  0%,100% { border-color: rgba(192,112,255,0.3); }
  50%      { border-color: rgba(192,112,255,0.7); }
}

.evo-done {
  background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(192,112,255,0.05));
  border: 1px solid var(--evo-color, #c070ff);
}

.evo-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #c090ff;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.evo-section-hint {
  font-size: 12px;
  color: #8070a0;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Anticipation pass (Prompt 5.5, Phase 4) — locked-state path teasers:
   name + one-line tagline only, no traits/rewards. */
.evo-path-teaser-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.evo-path-teaser {
  flex: 1;
  min-width: 140px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(var(--evo-path-color, #c070ff), 0.25);
  border-left: 3px solid var(--evo-path-color, #c070ff);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evo-path-teaser-icon {
  font-size: 16px;
}

.evo-path-teaser-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--evo-path-color, #c070ff);
}

.evo-path-teaser-tagline {
  font-size: 10.5px;
  color: #9080b0;
  font-style: italic;
}

/* Requirements as filled/empty icon chips — hover for the exact number,
   no per-item sentences needed to read the bar at a glance. */
.evo-req-icon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evo-req-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 46px;
  padding: 6px 4px;
  border-radius: 10px;
  cursor: help;
}

.evo-req-icon-glyph { font-size: 16px; line-height: 1; }
.evo-req-icon-cap   { font-size: 9px; letter-spacing: 0.4px; text-transform: uppercase; }

.evo-req-icon-met {
  background: rgba(112,208,128,0.10);
}
.evo-req-icon-met .evo-req-icon-glyph { color: #70d080; }
.evo-req-icon-met .evo-req-icon-cap   { color: rgba(112,208,128,0.75); }

.evo-req-icon-unmet {
  background: rgba(112,96,160,0.08);
}
.evo-req-icon-unmet .evo-req-icon-glyph { opacity: 0.55; }
.evo-req-icon-unmet .evo-req-icon-cap   { color: #7060a0; }

.evo-section-ready-msg {
  font-size: 12px;
  color: #c0b0e0;
  margin-bottom: 10px;
  line-height: 1.5;
}

.evo-trial-desc-preview {
  font-size: 11px;
  color: #8878a8;
  margin-bottom: 12px;
  line-height: 1.45;
  font-style: italic;
}

.evo-start-trial-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, rgba(192,112,255,0.18), rgba(120,60,200,0.12));
  border: 1px solid #9060d0;
  border-radius: 24px;
  color: #c090ff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.15s;
}
.evo-start-trial-btn:hover {
  background: rgba(192,112,255,0.28);
  transform: scale(1.02);
}

.evo-done-badge {
  font-size: 15px;
  font-weight: 700;
  color: var(--evo-color, #c070ff);
  margin-bottom: 3px;
}

.evo-done-path {
  font-size: 12px;
  color: #a090c0;
  margin-bottom: 3px;
}

.evo-done-date {
  font-size: 10px;
  color: #6050808;
  color: rgba(200,180,255,0.4);
  margin-bottom: 10px;
}

.evo-done-traits {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.evo-done-trait {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evo-done-trait-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--evo-color, #c090ff);
}

.evo-done-trait-desc {
  font-size: 11px;
  color: #8878a8;
  line-height: 1.4;
}

/* ── Journal Evolution Section ────────────────────────────── */
.bj-evo-section {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(192,112,255,0.05);
  border-left: 3px solid rgba(192,112,255,0.4);
  border-radius: 0 10px 10px 0;
  color: #e0d8f8;
}

.bj-evo-header {
  font-size: 13px;
  font-weight: 700;
  color: #c090ff;
  margin-bottom: 5px;
}

.bj-evo-evolved-on {
  font-size: 11px;
  color: rgba(200,180,255,0.5);
  margin-bottom: 4px;
}

.bj-evo-tagline {
  font-size: 12px;
  color: #9880b8;
  font-style: italic;
  margin-bottom: 10px;
}

.bj-evo-progress {
  font-size: 12px;
  color: #7060a0;
  margin-bottom: 4px;
}

.bj-evo-hint {
  font-size: 11px;
  color: #5040708;
  color: rgba(180,160,220,0.5);
}

.bj-evo-traits {
  margin-bottom: 10px;
}

.bj-evo-trait {
  font-size: 11px;
  color: #b0a0d0;
  line-height: 1.55;
  margin-bottom: 4px;
}
.bj-evo-trait strong { color: #c090ff; }

.bj-evo-memories { margin-top: 10px; }

.bj-evo-mem-title {
  font-size: 12px;
  font-weight: 700;
  color: #a080c0;
  margin-bottom: 7px;
}

.bj-evo-memory {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.bj-evo-memory strong {
  display: block;
  font-size: 12px;
  color: #c0a0e8;
  margin-bottom: 3px;
}

.bj-evo-memory p {
  font-size: 11px;
  color: #9080b0;
  line-height: 1.5;
  margin: 0;
}
