/* Bestiary — only what the atlas sheets do not already cover: the map cards as
   links, the mob list / drops tables (stacked under 640px), the stat strip,
   the portrait head and the roam cards. Loaded after atlas-pages.css on
   /bestiary/ only. */

.bst-wrap {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) clamp(16px, 2vw, 34px) clamp(60px, 7vw, 110px);
}
.bst-note {
  margin: 34px 0 0;
  color: var(--bone-dim);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.bst-index .realm-index-note { margin-top: 34px; }
.bst-empty { color: var(--bone-dim); font-size: 15px; }

/* -- index: realm cards as whole-card links --------------------------------- */
a.bst-map-card { color: inherit; text-decoration: none; }
a.bst-map-card h2, a.bst-map-card h3 { color: inherit; }
a.bst-map-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* -- crumbs + badges -------------------------------------------------------- */
.bst-crumb a { color: inherit; text-decoration: none; }
.bst-crumb a:hover { color: var(--gold-pale); }
.bst-crumb i { font-style: normal; margin: 0 6px; opacity: .6; }
.bst-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 8px 1px;
  border: 1px solid var(--gold);
  color: var(--gold-pale);
  font: 600 10px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bst-badge.boss { border-color: #b0563b; color: #f0a48a; }
.bst-badge.event { border-color: #4f8ea3; color: #a9dcec; }
h1 .bst-badge { font-size: 12px; margin-left: 12px; }

/* -- section label ---------------------------------------------------------- */
.bst-band { margin: 34px 0 12px; font-size: 0; }
.bst-band:first-child { margin-top: 0; }
.bst-band .eyebrow { display: block; margin: 0; font-size: 12px; }

/* -- tables ----------------------------------------------------------------- */
.bst-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.bst-table th, .bst-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.bst-table th {
  color: var(--gold);
  font: 600 11px/1.4 "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.bst-table tbody tr:last-child td { border-bottom: 0; }
.bst-table tbody tr:hover td { background: rgba(212, 191, 137, .05); }
.bst-table .c-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bst-table .c-pct { color: var(--gold-pale); font-weight: 600; }
.bst-table .c-item b { display: block; color: var(--bone); font-weight: 600; }
.bst-table .c-item small { display: block; margin-top: 3px; color: var(--bone-dim); font-size: 12.5px; line-height: 1.5; }

.bst-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--bone);
  text-decoration: none;
}
.bst-who:hover .bst-name { color: var(--gold-pale); }
.bst-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink-soft);
}
.bst-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bst-thumb.is-blank img { object-fit: contain; padding: 9px; opacity: .55; }
.bst-name { font-family: "TLC Marcellus", Georgia, serif; font-size: 17px; }

.bst-kind {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--bone-dim);
  font: 500 11px/1.6 "Inter", system-ui, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bst-kind.k-rupiah   { color: var(--gold-pale); border-color: rgba(212,191,137,.5); }
.bst-kind.k-equipment{ color: #c9d6e8; }
.bst-kind.k-quest    { color: #a9dcec; }
.bst-kind.k-unique   { color: #f0a48a; border-color: rgba(176,86,59,.6); }

/* -- mob head + stats ------------------------------------------------------- */
.bst-mob-head { display: flex; align-items: flex-end; gap: clamp(18px, 3vw, 36px); }
.bst-mob-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.bst-portrait {
  flex: 0 0 auto;
  width: clamp(120px, 16vw, 200px);
  height: clamp(120px, 16vw, 200px);
  overflow: hidden;
  border: 1px solid rgba(212,191,137,.45);
  border-radius: 50%;
  background: var(--ink-glass);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
}
.bst-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bst-portrait.is-blank img { object-fit: contain; padding: 26%; opacity: .6; }

.bst-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 0 0 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19,23,25,.72), rgba(7,9,10,.86));
}
.bst-stats > div { padding: 16px 18px; border-right: 1px solid var(--line); }
.bst-stats > div:last-child { border-right: 0; }
.bst-stats dt { margin: 0 0 4px; color: var(--gold); font: 600 11px/1.4 "Inter", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.bst-stats dd { margin: 0; color: var(--bone); font-family: "TLC Marcellus", Georgia, serif; font-size: 22px; line-height: 1.2; }

/* -- roam cards ------------------------------------------------------------- */
.bst-roam { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bst-roam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19,23,25,.72), rgba(7,9,10,.86));
  color: var(--bone);
  text-decoration: none;
  transition: border-color 300ms ease, transform 300ms ease;
}
.bst-roam-card:hover { border-color: rgba(212,191,137,.42); transform: translateY(-2px); }
.bst-roam-img { flex: 0 0 96px; align-self: stretch; background-position: center; background-size: cover; }
.bst-roam-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 12px 0; }
.bst-roam-body b { font-family: "TLC Marcellus", Georgia, serif; font-weight: 400; font-size: 17px; }
.bst-roam-body small { color: var(--bone-dim); font-size: 12.5px; }

/* -- responsive ------------------------------------------------------------- */
@media (max-width: 900px) {
  .bst-stats { grid-template-columns: repeat(3, 1fr); }
  .bst-stats > div:nth-child(3n) { border-right: 0; }
  .bst-stats > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .bst-wrap { padding-left: 16px; padding-right: 16px; }
  .bst-mob-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .bst-stats { grid-template-columns: repeat(2, 1fr); }
  .bst-stats > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .bst-stats > div:nth-child(2n) { border-right: 0; }
  .bst-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
  .bst-stats dd { font-size: 19px; }

  /* tables collapse to stacked rows */
  .bst-table, .bst-table tbody, .bst-table tr, .bst-table td { display: block; width: 100%; }
  .bst-table thead { display: none; }
  .bst-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .bst-table tbody tr:last-child { border-bottom: 0; }
  .bst-table td { padding: 6px 0; border-bottom: 0; text-align: left; }
  .bst-table .c-num { display: flex; justify-content: space-between; align-items: center; min-height: 40px; text-align: right; }
  .bst-table td.c-num::before, .bst-table td.c-kind::before {
    content: attr(data-label);
    color: var(--gold);
    font: 600 11px/1.4 "Inter", system-ui, sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
  }
  .bst-table td.c-kind { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
  .bst-table td.c-who, .bst-table td.c-item { padding-top: 0; }
  .bst-moblist td.c-num { min-height: 36px; padding: 4px 0; }
  .bst-roam { grid-template-columns: 1fr; }
}
