/* Its own "boss" palette, same as trader.css/prestige.css - not the site's --bg/--surface/--accent
   tokens, so style.css's own light-mode overrides never touched it. No light-mode values existed
   at all until now - the light/dark toggle did nothing on this page, same underlying bug
   players.css had. --boss-no-flea-bg/text deliberately excluded from the override blocks below:
   that badge carries its own light-bg-dark-text pair regardless of page theme, so it's already
   accessible standalone and doesn't need a light-mode variant. */
.boss-detail-page {
  --boss-border: rgb(154 136 102 / 0.72);
  --boss-divider: rgb(255 255 255 / 0.13);
  --boss-panel: #252726;
  --boss-panel-dark: #171918;
  --boss-panel-deep: #111312;
  --boss-text: #d2cebb;
  --boss-muted: #8f8d82;
  --boss-accent: #a18c67;
  --boss-card-bg: rgb(0 0 0 / 0.12);
  --boss-glow: rgb(255 255 255 / 0.025);
  --boss-titlebar-bg: rgb(0 0 0 / 0.36);
  --boss-badge-border: #c8c6bb;
  --boss-badge-text: #e0ded4;
  --boss-poster-bg: #292a29;
  --boss-panel-section-bg: rgb(0 0 0 / 0.16);
  --boss-table-header-bg: rgb(0 0 0 / 0.3);
  --boss-table-cell-bg: #303130;
  --boss-table-hover-bg: #363736;
  --boss-escort-bg: rgb(0 0 0 / 0.25);
  --boss-loot-img-border: rgb(255 255 255 / 0.15);
  --boss-no-flea-bg: #d7d4c4;
  --boss-no-flea-text: #4b4b47;
}

@media (prefers-color-scheme: light) {
  .boss-detail-page:not([data-theme="dark"]) {
    --boss-border: rgb(122 102 64 / 0.4);
    --boss-divider: rgb(40 34 20 / 0.16);
    --boss-panel: #ece6d6;
    --boss-panel-dark: #ddd4bd;
    --boss-panel-deep: #c9bd9e;
    --boss-text: #241f14;
    --boss-muted: #6b6045;
    --boss-accent: #7a6640;
    --boss-card-bg: rgb(0 0 0 / 0.04);
    --boss-titlebar-bg: rgb(0 0 0 / 0.08);
    --boss-badge-border: #8f8874;
    --boss-badge-text: #241f14;
    --boss-poster-bg: #d9d0b4;
    --boss-panel-section-bg: rgb(0 0 0 / 0.05);
    --boss-table-header-bg: rgb(0 0 0 / 0.07);
    --boss-table-cell-bg: #ece6d6;
    --boss-table-hover-bg: #ddd4bd;
    --boss-escort-bg: rgb(0 0 0 / 0.06);
    --boss-loot-img-border: rgb(0 0 0 / 0.15);
  }
}

:root[data-theme="light"] .boss-detail-page {
  --boss-border: rgb(122 102 64 / 0.4);
  --boss-divider: rgb(40 34 20 / 0.16);
  --boss-panel: #ece6d6;
  --boss-panel-dark: #ddd4bd;
  --boss-panel-deep: #c9bd9e;
  --boss-text: #241f14;
  --boss-muted: #6b6045;
  --boss-accent: #7a6640;
  --boss-card-bg: rgb(0 0 0 / 0.04);
  --boss-titlebar-bg: rgb(0 0 0 / 0.08);
  --boss-badge-border: #8f8874;
  --boss-badge-text: #241f14;
  --boss-poster-bg: #d9d0b4;
  --boss-panel-section-bg: rgb(0 0 0 / 0.05);
  --boss-table-header-bg: rgb(0 0 0 / 0.07);
  --boss-table-cell-bg: #ece6d6;
  --boss-table-hover-bg: #ddd4bd;
  --boss-escort-bg: rgb(0 0 0 / 0.06);
  --boss-loot-img-border: rgb(0 0 0 / 0.15);
}

.boss-detail-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 30px auto 80px;
}

.entity-back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--boss-accent);
  text-decoration: none;
}

.entity-back-link:hover { text-decoration: underline; }

.boss-entity-card {
  display: grid;
  grid-template-columns: minmax(0, 850px) minmax(300px, 350px);
  min-height: 260px;
  border: 1px solid var(--boss-border);
  background: var(--boss-card-bg);
  box-shadow: 0 0 5px 3px var(--boss-glow);
  overflow: hidden;
}

.boss-entity-main { min-width: 0; display: flex; flex-direction: column; }

.boss-title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 20px;
  background: var(--boss-titlebar-bg);
  border-bottom: 1px solid var(--boss-divider);
}

.boss-entity-type {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--boss-badge-border);
  border-radius: 9px;
  color: var(--boss-badge-text);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boss-title-bar h1 {
  min-width: 0;
  margin: 0;
  color: var(--boss-accent);
  font-size: clamp(27px, 3.2vw, 36px);
  line-height: 1.1;
}

.boss-wiki-link {
  margin-left: auto;
  color: var(--boss-accent);
  text-decoration: none;
}

.boss-wiki-link:hover { text-decoration: underline; }

.boss-entity-content { padding: 20px; }

.boss-bio {
  max-width: 780px;
  margin: 0 0 20px;
  color: var(--boss-text);
  line-height: 1.45;
}

.boss-description-block {
  margin: 0 0 20px;
  color: var(--boss-text);
}

.boss-description-block h3 {
  margin: 0 0 14px;
  color: var(--boss-text);
  font-size: 18px;
  line-height: 1.2;
}

.boss-description-block p {
  max-width: 780px;
  margin: 0;
  color: var(--boss-text);
  line-height: 1.45;
}

.boss-property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.boss-property-card {
  min-width: 0;
  padding: 10px 20px;
  background: var(--boss-panel);
  border: 1px solid var(--boss-panel-deep);
}

.boss-property-behavior { grid-column: 1 / -1; }
.boss-property-health { grid-column: 1 / -1; }

.boss-property-label {
  margin-bottom: 5px;
  color: var(--boss-muted);
  font-size: 18px;
  font-weight: 600;
}

.boss-property-value {
  min-width: 0;
  color: var(--boss-accent);
  line-height: 1.5;
}

.boss-spawn-values { display: flex; flex-wrap: wrap; gap: 0; }
.boss-property-separator { color: var(--boss-text); margin-right: 4px; }

.boss-health-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.boss-health-part { white-space: nowrap; }
.boss-health-part span { color: var(--boss-accent); }
.boss-health-part strong { color: var(--boss-accent); font-weight: 500; }
.boss-health-separator { margin-right: 4px; color: var(--boss-text); }

.boss-poster-panel {
  position: relative;
  min-height: 260px;
  border-left: 1px solid var(--boss-border);
  background: var(--boss-poster-bg);
  overflow: hidden;
}

.boss-poster-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.boss-mobile-portrait { display: none; }

.boss-information-section { margin-top: 30px; }

.boss-panel-section {
  border: 1px solid var(--boss-divider);
  border-radius: 0 20px 0 0;
  overflow: hidden;
  background: var(--boss-panel-section-bg);
}

.boss-panel-section > h2 {
  margin: 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--boss-divider);
  color: var(--boss-text);
  font-size: 23px;
  line-height: 1.2;
}

.boss-section-icon { margin-right: 9px; font-size: 18px; }

.boss-loot-table-wrap,
.boss-table-wrap { overflow-x: auto; }

.boss-loot-table,
.boss-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  color: var(--boss-text);
}

.boss-loot-table thead th,
.boss-table thead th {
  padding: 13px 16px;
  color: var(--boss-text);
  background: var(--boss-table-header-bg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.boss-loot-table thead th:first-child { text-align: center; width: 66%; }
.boss-loot-table thead th:nth-child(2) { width: 17%; }
.boss-loot-table thead th:nth-child(3) { width: 17%; }

.boss-loot-table tbody td,
.boss-table tbody td {
  padding: 9px 16px;
  background: var(--boss-table-cell-bg);
  text-align: center;
  vertical-align: middle;
}

.boss-loot-table tbody tr:hover td,
.boss-table tbody tr:hover td { background: var(--boss-table-hover-bg); }

.boss-loot-name {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--boss-accent);
  text-align: left;
  text-decoration: none;
}

.boss-loot-name:hover span { text-decoration: underline; }

.boss-map-link {
  color: var(--boss-accent);
  text-decoration: none;
  white-space: nowrap;
}

.boss-map-link:hover { text-decoration: underline; }

.boss-escort-gear {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.boss-escort-gear-item {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--boss-escort-bg);
  flex-shrink: 0;
}

.boss-escort-gear-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.boss-loot-name img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--boss-loot-img-border);
  background: var(--boss-panel);
}

.boss-no-flea {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--boss-no-flea-bg);
  color: var(--boss-no-flea-text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.boss-trader-sell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.boss-trader-sell small { color: var(--boss-muted); font-size: 11px; }
.boss-trader-value { white-space: nowrap; }

.boss-table { border-spacing: 0; }
.boss-table thead th { text-align: left; }
.boss-table tbody td { border-top: 1px solid var(--boss-divider); text-align: left; }

.boss-empty-inline,
.boss-error {
  padding: 24px;
  color: var(--boss-text);
}

@media (max-width: 960px) {
  .boss-entity-card { grid-template-columns: 1fr; }
  .boss-poster-panel { display: none; }
  .boss-mobile-portrait { display: block; padding: 20px 20px 0; text-align: center; }
  .boss-mobile-portrait img { width: 124px; height: 124px; object-fit: contain; border: 1px solid var(--boss-divider); }
}

@media (max-width: 640px) {
  .boss-detail-shell { width: min(100% - 18px, 1200px); margin-top: 18px; }
  .boss-title-bar { flex-direction: column; align-items: flex-start; }
  .boss-wiki-link { margin-left: 0; }
  .boss-property-grid { grid-template-columns: 1fr; }
  .boss-property-behavior,
  .boss-property-health { grid-column: auto; }
  .boss-property-card { padding: 10px 12px; }
  .boss-loot-table thead th:first-child { width: auto; }
  .boss-loot-name { grid-template-columns: 52px minmax(150px, 1fr); }
  .boss-loot-name img { width: 52px; height: 52px; }
}
/* Keep tactical advice readable on both narrow screens and the full detail page. */
.boss-tactics-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 1.25rem; }
.boss-tactics-grid h3 { margin-bottom: .4rem; }
.boss-tactics p { max-width: 75ch; line-height: 1.6; }
