/* Atlas profile modal, rich content, facts, and character roster surfaces. */

body[data-page="atlas"] .atlas-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.78rem;
}

body[data-page="atlas"] .atlas-fact {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.14);
  background:
    var(--atlas-accent-surface-overlay);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.12);
}

body[data-page="atlas"] .atlas-facts--compact {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

body[data-page="atlas"] .atlas-fact-label {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body[data-page="atlas"] .atlas-fact-value {
  display: block;
  margin: 0;
  color: #fff;
  font-size: 0.97rem;
  line-height: 1.58;
  text-wrap: pretty;
}

body[data-page="atlas"] .atlas-profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 5, 8, 0.88);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
  transition: opacity 0.34s ease;
}

body[data-page="atlas"] .atlas-profile-modal.open {
  opacity: 1;
  pointer-events: auto;
}

body[data-page="atlas"] .atlas-profile-dialog {
  position: relative;
  width: min(1080px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.18);
  opacity: 0;
  background:
    var(--atlas-accent-dialog-overlay),
    linear-gradient(180deg, rgba(8, 9, 12, 0.99), rgba(12, 12, 14, 0.99));
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(var(--atlas-accent-rgb), 0.05) inset;
  transform: translateY(22px) scale(0.975);
  transition:
    opacity 0.4s ease,
    transform 0.46s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-page="atlas"] .atlas-profile-modal.open .atlas-profile-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body[data-page="atlas"] .atlas-profile-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 9999 !important;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 0;
  background: darkred;
  color: white;
  font-size: 2.5rem;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}

body[data-page="atlas"] .atlas-profile-close:hover,
body[data-page="atlas"] .atlas-profile-close:focus-visible {
  border: none;
  background: #8a1a1a;
  color: white;
  box-shadow: none;
}

body[data-page="atlas"] .atlas-profile-banner {
  position: relative;
  min-height: 280px;
  background-color: #121418;
  background-size: cover;
  background-position: center;
}

body[data-page="atlas"] .atlas-profile-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 8, 11, 0.08), rgba(7, 8, 11, 0.94)),
    linear-gradient(90deg, rgba(7, 8, 11, 0.2), rgba(7, 8, 11, 0));
}

body[data-page="atlas"] .atlas-profile-dialog--species .atlas-profile-banner::after,
body[data-page="atlas"] .atlas-profile-dialog--role .atlas-profile-banner::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--atlas-accent-band);
}

body[data-page="atlas"] .atlas-profile-head {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-width: 760px;
  padding: 1.3rem 1.35rem;
}

body[data-page="atlas"] .atlas-profile-kicker {
  margin: 0;
  color: rgba(var(--atlas-accent-rgb), 0.9);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body[data-page="atlas"] .atlas-profile-title {
  margin: 0;
  color: #fff;
  font-family: "Advent Pro", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  text-wrap: balance;
}

body[data-page="atlas"] .atlas-profile-description {
  margin: 0;
  color: rgba(245, 249, 255, 0.9);
  max-width: 62ch;
  line-height: 1.6;
}

body[data-page="atlas"] .atlas-profile-body {
  max-height: calc(100vh - 2rem - 280px);
  overflow-y: auto;
  padding: 1.35rem;
}

body[data-page="atlas"] .atlas-profile-content .dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0;
  background: none;
}

body[data-page="atlas"] .atlas-profile-content .dropdown-text {
  gap: 1rem;
}

body[data-page="atlas"] .atlas-profile-content .atlas-section-trigger,
body[data-page="atlas"] .atlas-profile-content .reveal-btn {
  display: none;
}

body[data-page="atlas"] .atlas-profile-content .hidden-content {
  display: block;
  margin-top: 0;
  padding: 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

body[data-page="atlas"] .atlas-profile-content .role-characters {
  margin-top: 0;
  padding-top: 1rem;
}

body[data-page="atlas"] .atlas-profile-section-title {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body[data-page="atlas"] .atlas-profile-shell {
  display: grid;
  gap: 1rem;
}

body[data-page="atlas"] .atlas-profile-panel,
body[data-page="atlas"] .atlas-profile-quote-card {
  padding: 1.05rem 1.1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.14);
  background:
    var(--atlas-accent-panel-overlay),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 16px 26px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(var(--atlas-accent-rgb), 0.04) inset;
}

body[data-page="atlas"] .atlas-profile-panel-head {
  margin-bottom: 0.9rem;
}

body[data-page="atlas"] .atlas-profile-panel-eyebrow,
body[data-page="atlas"] .atlas-profile-quote-kicker {
  margin: 0;
  color: rgba(var(--atlas-accent-rgb), 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body[data-page="atlas"] .atlas-profile-panel-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.2;
}

body[data-page="atlas"] .atlas-profile-panel-eyebrow + .atlas-profile-panel-title {
  margin-top: 0.25rem;
}

body[data-page="atlas"] .atlas-overview-block,
body[data-page="atlas"] .atlas-rich-text {
  display: grid;
  gap: 0.95rem;
}

body[data-page="atlas"] .atlas-overview-intro {
  display: grid;
  gap: 0.72rem;
  padding: clamp(1rem, 1.8vw, 1.25rem);
  border-radius: 22px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.14);
  background:
    var(--atlas-accent-intro-overlay),
    rgba(8, 10, 14, 0.76);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

body[data-page="atlas"] .atlas-overview-kicker {
  margin: 0;
  color: rgba(243, 247, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body[data-page="atlas"] .atlas-profile-summary,
body[data-page="atlas"] .atlas-rich-text p {
  margin: 0;
  max-width: none;
  color: rgba(238, 243, 250, 0.95);
  line-height: 1.7;
}

body[data-page="atlas"] .atlas-overview-intro .atlas-profile-summary {
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.78;
  text-wrap: pretty;
}

body[data-page="atlas"] .atlas-overview-support {
  color: rgba(221, 229, 239, 0.84);
  font-size: 0.95rem;
  line-height: 1.72;
  text-wrap: pretty;
}

body[data-page="atlas"] .atlas-profile-quote-text {
  margin: 0.4rem 0 0;
  max-width: none;
  color: #ffffff;
  font-size: clamp(1.12rem, 2vw, 1.42rem);
  font-style: italic;
  line-height: 1.65;
}

body[data-page="atlas"] .atlas-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.72rem;
}

body[data-page="atlas"] .atlas-roster-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.68rem 0.8rem;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.14);
  background:
    var(--atlas-accent-surface-overlay);
  color: inherit;
  isolation: isolate;
  text-decoration: none;
}

@keyframes atlas-main-roster-glint {
  0% {
    transform: translateX(-145%) rotate(12deg);
    opacity: 0;
  }

  22% {
    opacity: 0.82;
  }

  58% {
    opacity: 0.22;
  }

  100% {
    transform: translateX(165%) rotate(12deg);
    opacity: 0;
  }
}

body[data-page="atlas"] .atlas-roster-pill--main {
  border-color: rgba(255, 224, 144, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 224, 144, 0.12), rgba(var(--atlas-accent-rgb), 0.08)),
    var(--atlas-accent-surface-overlay);
  box-shadow:
    0 0 0 1px rgba(255, 236, 184, 0.08) inset,
    0 12px 24px rgba(0, 0, 0, 0.18),
    0 0 22px rgba(255, 212, 114, 0.12);
}

body[data-page="atlas"] .atlas-roster-pill--main::before {
  content: "";
  position: absolute;
  inset: -45% auto -45% -18%;
  z-index: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 202, 0.26), transparent);
  animation: atlas-main-roster-glint 4.8s ease-in-out infinite;
  pointer-events: none;
}

body[data-page="atlas"] .atlas-roster-pill--supporting {
  opacity: 0.92;
}

body[data-page="atlas"] .atlas-roster-pill img {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(var(--atlas-accent-rgb), 0.24);
  background: rgba(0, 0, 0, 0.34);
}

body[data-page="atlas"] .atlas-roster-pill--main img {
  border-color: rgba(255, 226, 151, 0.58);
  box-shadow:
    0 0 0 2px rgba(255, 236, 184, 0.08),
    0 0 20px rgba(255, 216, 116, 0.26);
  filter: saturate(1.12) brightness(1.06);
}

body[data-page="atlas"] .atlas-roster-name {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  color: #f6f9ff;
  font-weight: 700;
  overflow-wrap: anywhere;
}

body[data-page="atlas"] .atlas-roster-link {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(244, 249, 255, 0.32);
  transition: color 0.2s ease, text-shadow 0.2s ease, text-decoration-color 0.2s ease;
}

body[data-page="atlas"] .atlas-roster-link:hover,
body[data-page="atlas"] .atlas-roster-link:focus-visible {
  color: rgba(var(--atlas-accent-rgb), 0.98);
  text-shadow: 0 0 16px rgba(var(--atlas-accent-rgb), 0.24);
  text-decoration-color: rgba(var(--atlas-accent-rgb), 0.8);
}

body[data-page="atlas"] .atlas-empty-state {
  padding: 1.05rem;
  border-radius: 18px;
  border: 1px dashed rgba(var(--atlas-accent-rgb), 0.24);
  background: rgba(255, 255, 255, 0.03);
}

body[data-page="atlas"] .atlas-empty-state p {
  margin: 0;
  max-width: none;
  color: rgba(244, 248, 255, 0.84);
}

@media (max-width: 1024px) {
  body[data-page="atlas"] .atlas-profile-banner {
    min-height: 200px;
  }

  body[data-page="atlas"] .atlas-profile-body {
    max-height: calc(100vh - 2rem - 200px);
  }
}

@media (max-width: 900px) {
  body[data-page="atlas"] .atlas-profile-banner {
    min-height: 222px;
  }

  body[data-page="atlas"] .atlas-profile-body {
    max-height: calc(100vh - 2rem - 222px);
  }
}

@media (max-width: 640px) {
  body[data-page="atlas"] .atlas-profile-modal {
    padding: 0.6rem;
  }

  body[data-page="atlas"] .atlas-profile-dialog {
    border-radius: 22px;
  }

  body[data-page="atlas"] .atlas-profile-banner {
    min-height: 186px;
  }

  body[data-page="atlas"] .atlas-profile-head,
  body[data-page="atlas"] .atlas-profile-body {
    padding: 1rem;
  }

  body[data-page="atlas"] .atlas-profile-body {
    max-height: calc(100vh - 1.2rem - 186px);
  }

  body[data-page="atlas"] .atlas-profile-panel,
  body[data-page="atlas"] .atlas-profile-quote-card {
    padding: 0.92rem 0.92rem 1rem;
    border-radius: 18px;
  }

  body[data-page="atlas"] .atlas-roster-grid {
    grid-template-columns: 1fr;
  }
}
