/* Monsters Page – Bestiary / Ecology Bands
   Assumes global colors/typography/layout are handled by styles.css
   and only adds page-specific styling.
*/

.monsters-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header / intro matches Characters tone but text-only (no cards) */
.monsters-page .page-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.monsters-page .page-title {
  font-size: 2.25rem;
  margin: 0 0 0.25rem;
}

.monsters-page .page-subtitle {
  margin: 0;
  max-width: 720px;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Legend / toolbar */

.bestiary-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top left,
    rgba(255, 255, 255, 0.06),
    rgba(0, 0, 0, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-group {
  min-width: 180px;
}

.legend-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  opacity: 0.7;
  margin: 0 0 0.25rem;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
}

.legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.legend-dot--low {
  background: #4caf50;
}

.legend-dot--medium {
  background: #ffc107;
}

.legend-dot--high {
  background: #ff5722;
}

/* Section headers */

.bestiary-section {
  margin-bottom: 3rem;
}

.bestiary-section-header {
  margin-bottom: 0.75rem;
}

.bestiary-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  margin: 0;
}

.bestiary-section-title::before {
  content: "";
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  border: 2px solid #f0c674;
  box-shadow: 0 0 0 1px rgba(240, 198, 116, 0.25);
}

.bestiary-section-desc {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
  max-width: 720px;
}

/* Ecology band container */

.bestiary-section-body {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at top left,
      rgba(255, 255, 255, 0.04),
      rgba(0, 0, 0, 0.9));
  overflow: hidden;
}

/* Monster rows (“bands”) */

.monster-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.monster-band:last-child {
  border-bottom: none;
}

.monster-band:nth-child(2n) {
  background: rgba(255, 255, 255, 0.02);
}

/* Thumbnail as IMAGE, not flex box */

.monster-thumb {
  width: 52px;
  height: 52px;
  border-radius: 0.8rem;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.7);
}

.monster-thumb:hover {
  transform: scale(1.08);
}

/* Main text */

.monster-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.monster-name {
  font-size: 1rem;
  margin: 0;
}

.monster-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.82rem;
  opacity: 0.8;
}

.meta-divider {
  opacity: 0.5;
}

.monster-lore {
  margin: 0;
  font-size: 0.84rem;
  opacity: 0.85;
}

/* Tag / info column */

.monster-tags {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
  font-size: 0.75rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.tag-pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.5);
}

/* Habitat flavors */

.tag-pill--wilderness {
  border-color: #4caf50;
}

.tag-pill--dungeon {
  border-color: #9c27b0;
}

.tag-pill--ruin {
  border-color: #ff9800;
}

.tag-pill--shrine {
  border-color: #03a9f4;
}

/* Rarity flavors */

.tag-pill--common {
  border-color: #b0bec5;
}

.tag-pill--rare {
  border-color: #03a9f4;
}

.tag-pill--legendary {
  border-color: #ffc107;
}

.tag-pill--env {
  background: rgba(100, 155, 255, 0.2);
  border: 1px solid rgba(100, 155, 255, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #cfe2ff;
  margin-right: 4px;
}

.tag-pill-poisonous{
  content: " ☠︎";
  font-size: 1rem;
  margin-left: 6px;
  opacity: 0.85;
  color: #c47aff; /* deep glowing purple */
  text-shadow: 0 0 6px rgba(150, 50, 220, 0.7);
}
/* Threat label */

.danger-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.7);
}

.danger-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.danger-dot--low {
  background: #4caf50;
}

.danger-dot--medium {
  background: #ffc107;
}

.danger-dot--high {
  background: #ff9800;
}

.danger-dot--danger {
  background: #ff5722;
}


.danger-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== Popup card overlay (works like character cards) ===== */

/* Full-screen dimmed backdrop */
.monster-popup {
  position: fixed;
  inset: 0;
  display: none;                 /* shown as flex when active */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
}

/* Card window – styled like the character detail card */
.monster-popup-card {
  width: 420px;
  max-width: 90vw;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 24px;

  background: radial-gradient(circle at 0% 0%,
              rgba(110, 150, 255, 0.35),
              #141730 55%,
              #101224 100%);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(120, 140, 255, 0.45);

  color: #e6e9ff;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: popupFadeIn 0.22s ease-out;
}

/* Header row: title on left, pill on right */
.monster-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.monster-popup-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.popup-image {
  width: 100%;
  height: auto;
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow:
    0 6px 20px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.1);
}

/* Pill like “Strength • Dexterity” */
.monster-popup-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  background: rgba(22, 30, 70, 0.9);
  border: 1px solid rgba(150, 180, 255, 0.7);
  color: #d5ddff;
  white-space: nowrap;
}

/* Body text in the card */
.monster-popup-text {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #c9cff8;
  white-space: pre-line; /* preserves line breaks from data-desc */
}

.monster-popup-icon-row {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
}

.popup-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;  /* optional: makes pixel art crisp */
  object-fit: contain;         /* preserves the icon shape */
  border-radius: 4px;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    0 0 0 1px rgba(255,255,255,0.12);
}


.popup-icon-label {
  font-size: 0.8rem;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

/* Same soft “pop in” as your cards */
@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* Responsive tweaks */

@media (max-width: 800px) {
  .bestiary-toolbar {
    padding: 0.9rem 1rem;
  }

  .monsters-page {
    padding-inline: 1rem;
  }
}

@media (max-width: 700px) {
  .monster-band {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: flex-start;
  }

  .monster-tags {
    grid-column: 1 / -1;
    align-items: flex-start;
    margin-top: 0.25rem;
  }

  .monster-thumb {
    width: 44px;
    height: 44px;
  }
}
