/* css/adventure.css — Adventure panel: floating numbers, zone header, party/enemy rows, slot boxes, status effects, combat log, hero detail card, action boxes and activity selectors. Loaded after the files before it (see css/style.css). */

/* Full-viewport overlay for floating combat/resource numbers — see
   js/ui/floating-numbers-ui.js. Sits above the game and the toasts (z-index 1000) but BELOW every modal window (.modal-overlay,
   2000: Settings, intros, feedback, ...), so a number never floats in front of an open window. Never intercepts clicks. */
#floating-numbers-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1500;
}

/* Speech bubbles over a hero or enemy box (js/ui/speech-bubbles-ui.js): one fixed layer like the floating numbers, each
   bubble centred over the top edge of its box, with a small tail pointing down. Never intercepts clicks. */
#speech-bubble-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1500;
}

/* ---- Ceremonies (js/ui/ceremony-ui.js): banners, death fades, level-up glows ---- */
#ceremony-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1400;
}

/* The boss intro card and "Layer N reached!": centred over the enemy row, sliding in and out over 2 s. */
.ceremony-banner {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 260px;
  padding: 0.5rem 1.5rem;
  background: var(--color-ceremony-banner-bg);
  color: var(--color-ceremony-banner-text);
  border-top: 2px solid var(--color-title-gold-mid);
  border-bottom: 2px solid var(--color-title-gold-mid);
  text-align: center;
  animation: ceremony-banner-slide 2s ease-out forwards;
}

.ceremony-banner-boss-intro {
  border-color: var(--color-ceremony-boss-accent);
}

.ceremony-banner-title {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.ceremony-banner-text {
  font-family: "Cinzel", serif; /* a clean classical capital (2026-11-02; IM Fell read too pirate-like here) */
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--color-title-gold-mid);
}

.ceremony-banner-still {
  animation: none;
}

@keyframes ceremony-banner-slide {
  0% { opacity: 0; transform: translate(-30%, -50%); }
  12% { opacity: 1; transform: translate(-50%, -50%); }
  85% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-70%, -50%); }
}

/* A fallen enemy's box: a copy laid over the slot that flashes and fades (the real slot is already free). The id makes it
   outrank the slot box's own `position: relative` (party-entourage.css, loaded later): without it, several copies made at
   once stacked one under the other. */
#ceremony-layer .ceremony-death-ghost {
  position: absolute;
  margin: 0;
  box-sizing: border-box;
}

.ceremony-death-normal {
  animation: ceremony-death-fade 0.6s ease-out forwards;
}

.ceremony-death-fled {
  animation: ceremony-fled-fade 0.6s ease-in forwards;
}

.ceremony-death-boss {
  animation: ceremony-boss-death 1.5s ease-out forwards;
}

@keyframes ceremony-death-fade {
  0% { opacity: 1; box-shadow: inset 0 0 0 200px transparent; }
  25% { opacity: 1; box-shadow: inset 0 0 0 200px var(--color-ceremony-death-flash); }
  100% { opacity: 0; box-shadow: inset 0 0 0 200px var(--color-ceremony-death-flash); }
}

@keyframes ceremony-fled-fade {
  0% { opacity: 1; translate: 0 0; }
  100% { opacity: 0; translate: 40px 0; }
}

@keyframes ceremony-boss-death {
  0% { opacity: 1; translate: 0 0; box-shadow: inset 0 0 0 200px transparent; }
  10% { translate: -4px 0; box-shadow: inset 0 0 0 200px var(--color-ceremony-boss-flash); }
  20% { translate: 4px 0; }
  30% { translate: -3px 0; box-shadow: inset 0 0 0 200px var(--color-ceremony-death-flash); }
  40% { translate: 3px 0; }
  50% { opacity: 1; translate: 0 0; }
  100% { opacity: 0; box-shadow: inset 0 0 0 200px var(--color-ceremony-death-flash); }
}

/* A hero's level-up: a gold glow and a rising arrow (Player level), a smaller silver one (Class level). */
.ceremony-level-up {
  animation: ceremony-level-glow-gold 1.2s ease-out;
}

.ceremony-class-level-up {
  animation: ceremony-level-glow-silver 0.9s ease-out;
}

@keyframes ceremony-level-glow-gold {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: inset 0 0 0 3px var(--color-title-gold-mid), inset 0 0 18px var(--color-title-gold-mid); }
}

@keyframes ceremony-level-glow-silver {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: inset 0 0 0 2px var(--color-ceremony-class-silver), inset 0 0 10px var(--color-ceremony-class-silver); }
}

/* Scoped like .activity-indicator-row so it outranks party-entourage.css's `.actor-slot-box > :not(...)` (position:
   relative), which otherwise put the words in the box's flow and pushed the HP bar and buffs up for a second. */
.ceremony-level-arrow,
.slot-box.actor-slot-box > .ceremony-level-arrow {
  position: absolute;
  left: 50%;
  bottom: 6px;
  translate: -50% 0;
  white-space: nowrap;
  font-weight: bold;
  font-size: 0.85rem;
  color: var(--color-title-gold-mid);
  text-shadow: 0 0 4px var(--color-black);
  pointer-events: none;
  animation: ceremony-level-arrow-rise 1.2s ease-out forwards;
}

.ceremony-level-arrow-class-level-up {
  font-size: 0.75rem;
  color: var(--color-ceremony-class-silver);
  animation-duration: 0.9s;
}

@keyframes ceremony-level-arrow-rise {
  0% { opacity: 0; translate: -50% 0; }
  20% { opacity: 1; }
  100% { opacity: 0; translate: -50% -50px; }
}

.speech-bubble {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  max-width: 220px;
  padding: 4px 8px;
  border: 2px solid var(--color-speech-border);
  border-radius: 8px;
  background: var(--color-speech-bg);
  color: var(--color-speech-text);
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: center;
  animation: speech-bubble-pop 0.2s ease-out;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--color-speech-border);
}

@keyframes speech-bubble-pop {
  from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, calc(-100% - 8px)) scale(1); }
}

.floating-number {
  position: absolute;
  transform: translateX(-50%);
  font-size: 1.1rem;
  font-weight: 500;
  /* 4-direction black outline so the number reads against any background. */
  text-shadow: -1px -1px 0 var(--color-black), 1px -1px 0 var(--color-black), -1px 1px 0 var(--color-black), 1px 1px 0 var(--color-black);
  animation: floating-number-rise 0.9s ease-out forwards;
  white-space: nowrap;
}

/* The element icon in front of an elemental damage number: the colour of that element's tag bubble, with a thin light edge so the
   dark-element icon still reads against the dark outline. */
.floating-number .floating-number-element {
  width: 1em;
  height: 1em;
  margin-right: 0.15em;
  vertical-align: -0.1em;
  filter: drop-shadow(0 0 1px var(--color-white));
}
.floating-number-element-ice { background-color: var(--color-tag-ice-bg); }
.floating-number-element-fire { background-color: var(--color-tag-fire-bg); }
.floating-number-element-holy { background-color: var(--color-tag-holy-bg); }
.floating-number-element-dark { background-color: var(--color-tag-dark-bg); }

.floating-number-damage {
  color: var(--color-damage-text);
}

/* A critical hit — same "-N" text as a normal hit, gold instead of red is the only
   tell. */
.floating-number-critical-damage {
  color: var(--color-critical-text);
}

/* Words, not numbers (see floating-numbers-ui.js's FLOATING_WORD_LABELS): a miss is plain white, evade/parry/block share one cool tone. */
.floating-number-miss {
  color: var(--color-white);
  font-size: 0.95rem;
}

.floating-number-evade,
.floating-number-parry,
.floating-number-block,
.floating-number-graze {
  color: var(--color-defense-text);
  font-size: 0.95rem;
}

/* The Gilded Slime (combat.js): gold "Jackpot!" when it falls, a plain "Fled!" when it gets away. */
.floating-number-jackpot {
  color: var(--color-title-gold-mid);
  font-size: 1.15rem;
  font-weight: bold;
}

.floating-number-fled {
  color: var(--color-white);
  font-size: 0.95rem;
}

.floating-number-heal {
  color: var(--color-heal-text);
}

.floating-number-gold,
.floating-number-resource {
  color: var(--color-white);
}

.floating-number-dust {
  color: var(--color-heal-text);
}

/* A resource being SPENT (Home Activities' own resource costs, Entourage section
   abilities/crafting recipes, Build Housing) — same red as damage, since it's a loss
   either way, unlike .floating-number-resource's gain-colored white. */
/* A lost gamble (Merchant / Merchant Ship): lighter red than damage. */
.floating-number-gold-lost {
  color: var(--color-gold-lost-text);
}

.floating-number-resource-spent {
  color: var(--color-damage-text);
}

/* Placeholder color, tune later. */
.floating-number-fame {
  color: var(--color-fame-text);
}

/* Entourage XP (from Fame's passive trickle or the Recruit home activity
   completing — see engine/entourage-system.js's grantEntourageXp). Placeholder color,
   tune later. */
.floating-number-entourage-xp,
.floating-number-devotion-xp,
.floating-number-stat-xp,
.floating-number-zone-xp {
  color: var(--color-entourage-xp-text);
}

@keyframes floating-number-rise {
  from {
    opacity: 1;
    margin-top: 0;
  }
  to {
    opacity: 0;
    margin-top: -40px;
  }
}

.game-panel {
  display: none;
}

.game-panel.active {
  display: block;
}

.zone-status-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.zone-status {
  font-weight: bold;
  margin-top: 0; /* only the browser's default <p> margin — this is the header box's own top-most element */
}

.zone-status p {
  margin-block-end: 0; /* only the browser's default <p> margin — this is the header box's own top-most element */
}

/* Adventure panel's own header box (see adventure-ui.js's buildZoneHeaderBox) — the
   zone name/level line and that mode's own "zone options" (difficulty controls/
   Auto-return toggle) used to be two separate unboxed blocks stacked vertically; now
   one shared box, split left/right down the middle (reusing .split-view/.split-half
   verbatim, same as the Zones/Entourage tabs' own left-list/right-detail split) so
   the two halves read as one cohesive unit. */
.adventure-header-box {
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-bg-panel);
  padding: 0.75rem 1rem;
  height: 125px;
}

/* Top-aligned (the default for a flex column) — zone name/level line at the top, the
   "Go to last X zone" shortcuts (see adventure-ui.js's buildZoneShortcutButtons) at
   the bottom of the CONTENT, not pinned to the visual bottom of the box itself. */
.adventure-header-left {
  display: flex;
  flex-direction: column;
}

/* "Go to last X zone" shortcuts — used to be small buttons in the top nav bar (see
   ui-main.js's old setupZoneShortcutButtons); same compact look, now at the bottom of
   the header box's left column instead (see adventure-ui.js's buildZoneHeaderBox). */
.zone-header-shortcut-row {
  --zone-shortcut-button-height: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* The Move / Return buttons sit at the bottom of the header box's left column, whatever is above them. */
.adventure-header-left > .zone-header-shortcut-row {
  margin-top: auto;
  padding-top: 0.75rem;
}

.zone-header-shortcut-button {
  font-size: 0.8rem;
  /* Fixed height so the square quickbar buttons beside it can match it exactly. */
  height: var(--zone-shortcut-button-height);
  box-sizing: border-box;
  padding: 0 0.6rem;
  color: var(--color-text-secondary);
}

/* Follower quickbar (Max Rations/Feast/Gear Up): square icon buttons, right-aligned in the
   shortcut row, as tall as the text shortcut buttons (see adventure-quickbar-ui.js). */
.zone-quickbar {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.zone-quickbar-button {
  width: var(--zone-shortcut-button-height);
  height: var(--zone-shortcut-button-height);
  box-sizing: border-box;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.zone-quickbar-button .icon {
  font-size: 1.1rem;
}

/* One quickbar button plus, once its automation is unlocked, its small "A" switch on the top-right corner
   (adventure-quickbar-ui.js). Dim when off, green when on. */
.zone-quickbar-item {
  position: relative;
  display: inline-flex;
}

.zone-quickbar-auto {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: bold;
  line-height: 1;
  color: var(--color-text-secondary);
  background: var(--color-bg-disabled);
  border: 1px solid var(--color-text-secondary);
}

.zone-quickbar-auto.zone-quickbar-auto-on {
  color: var(--color-party-safe-text);
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}

/* The right half may nest a .zone-difficulty block (danger-zone Battle mode) — that
   class carries its OWN border/background/padding everywhere else it's used (Zones
   tab, standalone), which would double up unwantedly here since the outer
   .adventure-header-box above already provides that same look. Stripped back to a
   plain content block in this one spot only. */
.adventure-header-right .zone-difficulty {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* A safe zone's title row in the Adventure header: the zone name on the left and the global
   Entourage Level bar right-aligned on the same line (see adventure-ui.js's buildZoneHeaderBox).
   (Not .zone-status-row — that older class is the plain title row an Arena attempt uses.) */
.zone-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Same height in EVERY zone (with or without the Entourage Level bar), so switching zones never
     shifts the lines below it: tall enough for the bar, and the text on both sides is the same
     size (see the heading rule below). */
  min-height: 1.5rem;
  /* The zone name's own bottom margin (a plain <p>'s 1em) is zeroed below so the name centers
     against the bar; this puts it back on the ROW, because the level line under it has a negative
     top margin that assumes it (without it, that line overlaps the title). */
  margin-bottom: 0.25em;
}

.zone-title-row .zone-status {
  margin: 0 0 0.5em;
}

/* The plain "All followers constructed!" text (shown instead of the bar once nothing is left to
   build) carries .entourage-level-status's "hug the title above" negative margin; here it shares the
   title's own row, so that margin would push it up out of line with the zone name. */
.zone-title-row .entourage-level-status {
  margin: 0;
}

.zone-title-row .class-level-row {
  flex: 0 0 auto;
  margin-bottom: 0;
}

/* "Entourage LV N" is styled exactly like the zone name next to it (same size, weight and color) —
   .class-level-heading's own larger size/black is for the Entourage tab, not this header. */
.zone-title-row .class-level-heading {
  font-size: inherit;
  font-weight: bold;
  color: inherit;
  line-height: inherit;
}

.zone-title-row .class-level-progress-bar {
  width: 160px;
}

/* A safe zone's own right half also nests the global Entourage Level status (see
   dom-helpers.js's buildEntourageLevelStatus) right after the Resources summary,
   rather than directly under a title like every other place that reuses
   .entourage-level-status — the shared "hug the title above" -0.5rem margin (see
   that rule) needs cancelling back to a normal gap here specifically. */
.adventure-header-right .entourage-level-status {
  margin-top: 0.5rem;
}


/* .follower-usage-level-status deliberately NOT listed here (unlike
   .entourage-level-status) — it now only ever sits on the inline <strong> "LV N"
   heading inside a .class-level-row (see dom-helpers.js's
   buildFollowerUsageLevelStatus), where a vertical margin is a no-op and this rule's
   own font-size/color would just get overridden by .class-level-heading's anyway
   (equal specificity, later in the cascade). .entourage-level-status stays listed —
   it's still a plain block-level <p> in its own "every follower constructed" fallback
   case (see buildEntourageLevelStatus), which this rule's spacing genuinely applies to. */
.zone-level-status, .zone-exploration-status, .zone-arena-status, .zone-war-status, .entourage-level-status, .war-zone-level-status {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: -0.5rem; /* sits right under .zone-status/the zone menu title, not a full paragraph gap below it */
}

.zone-progress {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.slot-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Extra headroom above the party roster row so the reorder arrows (see
   .party-reorder-buttons below) have room to sit above a selected box without
   overlapping the "Party" header above it. */
.party-row {
  margin-top: 0.5rem;
}

/* Party panel only (see party-ui.js's buildPartyHeroRow) — positioning context for
   the reorder arrows, which sit just above the box rather than inside it. */
.party-slot-wrapper {
  position: relative;
}

.party-reorder-buttons {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  /* Above the hero box, which is position: relative (for its portrait) and comes later in the
     DOM, so it would otherwise paint over these arrows. */
  z-index: 2;
}

.party-reorder-buttons button {
  font-size: 0.6rem;
  padding: 0 4px;
  line-height: 1.1;
}

.slot-box {
  width: 96px;
  height: 96px;
  /* Fixed size: a flex row must never squeeze or stretch a box because of its portrait or name. */
  flex: 0 0 auto;
  border: 2px solid var(--color-border-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.85rem;
  box-sizing: border-box;
  background-color: white;
}

.slot-box-empty {
  border-style: dashed;
  color: var(--color-text-muted);
}

/* .slot-box.slot-box-empty (two classes, not one) so this reliably beats a
   same-specificity sibling like .crystal-slot-box regardless of source order —
   guarantees a genuinely blank placeholder no matter which other slot-type class
   (crystal, gear, ...) it's combined with on the same element; those set their own
   opaque white background for their OCCUPIED look, which would otherwise leak
   through onto their empty state too. */
.slot-box.slot-box-empty {
  background: none;
}

.slot-box-hire {
  border-style: dashed;
  color: var(--color-text-muted);
  flex-direction: column;
  gap: 4px;
}

/* The next hire slot while Beginnia's Fame is still short of its threshold: "Needs N Fame", not clickable. */
.slot-box-hire-waiting {
  opacity: 0.75;
  cursor: default;
}

.hire-cost {
  font-weight: bold;
  font-size: 0.75rem;
}

/* Opaque white so an unselected hero/enemy box reads clearly against the page's own
   zone-art backdrop (see adventure-ui.js's updateAdventurePanelBackground) instead of
   letting it show through — .slot-box-selected-ally/-enemy (added on top of this same
   class when a box IS selected) and .random-event-box/.actor-slot-box-dead already
   define their own background and come later in the cascade, so they still win over
   this one. */
.actor-slot-box {
  flex-direction: column;
  justify-content: flex-start;
  padding: 6px;
  gap: 4px;
  background: var(--color-white);
}

/* A corpse still sitting in its slot (hp<=0 — see combat.js's handleEnemyDeath, which
   leaves it in place at 0 HP until the whole wave clears rather than disappearing) —
   greyed out and dimmed so "dead" reads clearly at a glance, beyond just an empty HP
   bar. Applied on top of .actor-slot-box, never replacing it. */
.actor-slot-box-dead {
  opacity: 0.5;
  filter: grayscale(100%);
  border-color: var(--color-text-muted);
}

.random-event-box {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--color-pending-bg);
  border-color: var(--color-pending-border);
}

.random-event-status {
  font-size: 0.7rem;
  color: var(--color-random-event-text);
}

.actor-name {
  font-weight: bold;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Monster rarity name coloring — see data/monster-rarities.js and adventure-ui.js's
   actorNameRarityClass(). Normal-rarity enemies and heroes get no extra class, so they
   just keep the default .actor-name color. */
.actor-name-magic {
  color: var(--color-rarity-magic);
}

.actor-name-rare {
  color: var(--color-rarity-rare);
}

.actor-name-legendary {
  color: var(--color-rarity-legendary);
}

/* A boss (see combat.js's spawnBossEnemy) — bright red, distinct from Legendary's
   purple even though a boss's rarity is internally set to "legendary" for reward-reuse
   purposes (see actorNameRarityClass()'s isBoss check, which always wins). */
.actor-name-boss {
  color: var(--color-boss-text);
}

.hp-track {
  position: relative;
  width: 100%;
  height: 16px;
  background: var(--color-bg-disabled);
  border: 1px solid var(--color-text-muted);
  overflow: hidden;
}

.hp-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-fill-green); /* light green, so the black HP text stays readable on top */
  width: 100%;
  transition: width 0.05s linear;
}

.hp-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-black);
  font-size: 0.65rem;
  font-weight: bold;
  line-height: 1;
}

/* Adventure Stats view only (see dom-helpers.js's buildStatusEffectList) — the full
   per-effect bubble breakdown, one badge per distinct active effect. */
.status-effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 3px;
  margin-bottom: 0.75rem; /* same gap .stats-list leaves before the safe-zone activity selector */
}

/* Always present in the DOM (even with no active effects — see dom-helpers.js's
   refreshStatusEffectList) so live ticks can find and refresh it; collapse its margins
   when empty so it doesn't add a blank gap for an unaffected actor. */
.status-effect-list:empty {
  margin: 0;
}

.status-effect-badge {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
  white-space: nowrap;
}

.status-effect-debuff {
  background: var(--color-debuff-bg);
  color: var(--color-debuff-text);
}

.status-effect-buff {
  background: var(--color-buff-bg);
  color: var(--color-success-border);
}

/* Functionally an ITEM rather than a normal buff/debuff (see dom-helpers.js's
   statusEffectBadgeColorClass) — Rations and Gear Up (blue) and Order Feast (purple),
   see engine/entourage-system.js. Override .status-effect-buff's green rather than
   replacing the buff/debuff dichotomy everywhere, so only these named effects
   stand out. */
.status-effect-item-blue {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

/* Exploration/gathering buffs (Gear Up) — any future exploration buff can reuse this class. */
.status-effect-exploration {
  background: var(--color-exploration-buff-bg);
  color: var(--color-exploration-buff-text);
}

.status-effect-item-gold {
  background: var(--color-unlock-bg);
  color: var(--color-unlock-text);
  border: 1px solid var(--color-unlock-border);
}

.status-effect-item-purple {
  background: var(--color-item-purple-bg);
  color: var(--color-item-purple-text);
}

/* Actor slot box only (see adventure-ui.js's buildStatusEffectIndicator) — a compact
   count of distinct active buffs/debuffs, without listing them (that full breakdown
   is the .status-effect-list above, shown in the Adventure Stats view instead). */
.status-indicator-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 3px;
}

.status-indicator-badge {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
  font-weight: bold;
  white-space: nowrap;
}

.status-indicator-buff {
  background: var(--color-buff-bg);
  color: var(--color-buff-text);
}

.status-indicator-debuff {
  background: var(--color-debuff-bg);
  color: var(--color-debuff-text);
}

/* A hero's current home/exploration activity, at the top of their slot box (adventure-ui.js's buildHeroActivityIndicator). */
/* Sits ON the box's top border line (half above, half below, centered) instead of taking a row inside it. The
   extra .slot-box.actor-slot-box is needed to beat ".actor-slot-box > :not(.slot-box-portrait) { position: relative }". */
.slot-box.actor-slot-box > .activity-indicator-row {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  max-width: calc(100% - 4px);
  z-index: 2;
}

.status-indicator-activity {
  background: var(--color-info-bg);
  color: var(--color-tag-explored-text);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.combat-log {
  margin-top: 1rem;
  height: 166px;
  overflow-y: auto;
  border: 1px solid var(--color-text-muted);
  padding: 6px 6px 2px 6px;
  font-size: 0.75rem;
  background: var(--color-bg-soft);
  box-sizing: border-box;
}

/* Raid mode (see adventure-ui.js's buildRaidBattlefield) shows 6 slot-rows above
   the log instead of the normal 2 — shortened so the whole battlefield + log still
   fits without excessive scrolling. */
.combat-log-compact {
  height: 80px;
}

/* The log's Show/Hide toggle (adventure-ui.js's buildCombatLog) and its collapsed state: one line tall, still scrolled
   to the bottom, so only the newest message shows. */
.combat-log-wrapper {
  margin-top: 1rem;
}

.combat-log-wrapper .combat-log {
  margin-top: 0;
}

.combat-log-toggle {
  display: block;
  margin: 0 0 4px auto;
  padding: 1px 8px;
  font-size: 0.7rem;
}

/* Hidden by default (since 2026-11-02): only the "Show combat log" button shows. */
.combat-log.combat-log-collapsed {
  display: none;
}

/* Raid's own 3-hero-rows-then-3-enemy-rows battlefield (see adventure-ui.js's
   buildRaidBattlefield) — each .slot-row inside is still just 6 boxes wide,
   unchanged from a normal single-party fight; this wrapper only adds a visual gap
   between the hero-row block and the enemy-row block so the two sides read as
   distinct groups rather than 6 identical stacked rows. */
.raid-battlefield .slot-row:nth-child(3) {
  margin-bottom: 1rem;
}

.log-line {
  padding: 1px 0;
}

/* Shared left/right split for the Adventure and Zones panels: main options on the
   left half of the window, an expanding detail menu on the right half. */
.split-view {
  display: flex;
  margin-top: 0.5rem;
}

.split-half {
  width: 50%;
  box-sizing: border-box;
}

.split-half:first-child {
  padding-right: 1.5rem;
}

.split-half:last-child {
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border-light);
}

.slot-box-clickable {
  cursor: pointer;
}

.slot-box-selected-ally {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* Mission mode's benched heroes (see state.js's missionActiveHeroIndexes) — greyed
   out to read as "here, but not fighting," same washed-out treatment a locked zone
   box already uses. */
.slot-box-inactive {
  opacity: 0.4;
  filter: grayscale(1);
}

.slot-box-selected-enemy {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

/* A selected resource node (a resource encounter's box) reads blue, the gathering colour, not the enemy red. */
.resource-node-box.slot-box-selected-enemy {
  border-color: var(--color-info-text);
  background: var(--color-info-bg);
}

/* Wraps the hero's name/job <h3> and the Rename control (see
   buildHeroDetailContent/buildHeroRenameControl) on the same line — Party > Stats
   only, see showRenameControl. */
.hero-detail-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.hero-detail-title-row h3 {
  margin: 0;
}

.hero-detail-title-row .hero-rename-control {
  margin-bottom: 0;
}

/* Hero > Stats' Rename control (see dom-helpers.js's buildHeroRenameControl). */
.hero-rename-control {
  margin-bottom: 0.4rem;
}

.hero-rename-button {
  /* The pencil icon button, sized like the party switcher's (.party-switcher-rename-button). */
  font-size: 0.8rem;
  padding: 0.1rem 0.3rem;
  line-height: 1;
}

.hero-rename-input {
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
}

.level-display {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

/* "<name> LV N" on the left, a slim "NN%" XP pill on the right (same look as the God XP bar). */
.level-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* A fixed width (not the text's own), so the XP bars of "Player LV 7" and "Chronomagus LV 12" start at the same place. */
.level-line-label {
  flex: 0 0 10.5em;
  width: 10.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-line-bar {
  flex: 0 1 110px;
  min-width: 60px;
  height: 14px;
}

.level-line-bar[hidden] {
  display: none;
}

/* Grid rather than flex so every stat line's columns (name, total value,
   gear-or-rarity bonus, status effect bonus, growth) line up vertically across all
   6 rows, with a header row (see .stats-list-header) above them — each
   .stat-line/.stats-list-header is `display: contents`, so their spans become direct
   grid items of this grid instead of being laid out inside their own row box. */
.stats-list {
  display: grid;
  grid-template-columns: max-content max-content max-content max-content 160px;
  column-gap: 8px;
  row-gap: 2px;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  max-width: none;
}

/* Adventure panel's own hero/enemy detail card (see dom-helpers.js's
   buildHeroDetailContent, rendered into adventure-ui.js's buildActionMenu) — a small
   split-left-right panel up top: title/level/buff-debuff list on the left, the six
   stat lines on the right, using the whitespace that used to sit empty next to them.
   Whatever comes after (home-activity selector or battle skill/action boxes) is a
   SIBLING of this whole split, not part of it, so it stays full width underneath.
   Only built at all when showStatusEffectList is true — the Party panel's own copy of
   this content (see party-ui.js) doesn't have this wrapper, so it keeps its original
   single-column stack untouched. */
.hero-detail-top-split {
  display: flex;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  height: 140px;
}

.hero-detail-top-left {
  flex: 1;
  margin-right: 0.50rem;
}

.hero-detail-top-left h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.hero-detail-top-right {
  flex: 1;
}

/* Nested inside .hero-detail-top-right now — no longer needs its own bottom margin
   (the split wrapper above already provides one) or width cap (it has a real column
   to itself instead of needing to stay narrow among other content). */
.hero-detail-top-right .stats-list {
  margin-bottom: 0;
  max-width: none;
}

.stat-line {
  display: contents;
}

/* Sits in row 1, above every actor's own stat-line rows (see buildStatsListHeader) —
   `display: contents` same as .stat-line so its own 4 spans become direct grid items
   too, rather than getting wrapped in their own row box. */
.stats-list-header {
  display: contents;
}

.stats-list-header-cell {
  text-align: center;
  font-size: 0.75rem;
}

.stat-name {
  text-align: left;
}

/* Total value, gear/rarity bonus, and buff/debuff delta are all numbers — right-
   aligned within their own column so they stay a fixed, easy-to-scan edge instead of
   each one starting wherever its own digit count happens to land. */
.stat-value, .stat-bonus, .stat-effect-bonus {
  text-align: right;
}

/* Shared layout (width only, no color) by a hero's gear/crystal bonus AND an enemy's
   rarity bonus (see statGearOrRarityBonusText) — the ACTUAL color comes from a second
   class: .stat-bonus-gear (hero) below, or the enemy's own rarity color (see
   buildStatLine's actorNameRarityClass) — kept as two separate classes, rather than
   this one setting a default green, so a legendary/rare enemy's own gold/purple isn't
   silently overridden by a same-specificity green rule later in the cascade. */
.stat-bonus {
  min-width: 2.5em;
}

.stat-bonus-gear {
  color: var(--color-success-border);
}

.stat-effect-bonus {
  min-width: 2.5em;
}

.stat-effect-buff {
  color: var(--color-success-border);
}

.stat-effect-debuff {
  color: var(--color-debuff-text);
}

/* A stat's own growth progress, HP-bar-style (see .hp-track/.hp-fill/.hp-text) —
   pale transparent blue rather than HP's green, with rounded corners (unlike the
   sharp-cornered HP bar) so it doesn't read as an actual health/danger indicator. A
   slim black border sets it apart from the surrounding cells same as the HP track's
   own border does. Sits in its own grid column (see .stats-list's last, wider track)
   rather than the compact max-content columns the others use, so there's real room
   for a bar rather than just a number. Empty (no fill/text children at all) for an
   enemy — see buildStatGrowthBar — so it renders as a blank cell, not an empty
   visible track. */
.stat-growth-bar {
  position: relative;
  height: 16px;
  border-radius: 8px;
  border: 1px solid var(--color-black);
  overflow: hidden;
  /* Opaque white so the bar's own UNFILLED portion reads clearly against the page's
     zone-art backdrop instead of the image showing through it — .stat-growth-bar-fill
     (the pale blue progress fill) still layers on top as its own absolutely-
     positioned child. */
  background: var(--color-white);
}

/* An enemy's own growth cell (see buildStatGrowthBar) — no fill/text children at
   all, so the border above would otherwise draw an empty pill outline implying a
   bar with nothing in it. Genuinely blank instead — background: none overrides
   .stat-growth-bar's own white fill for this same reason. */
.stat-growth-bar-empty {
  border: none;
  background: none;
}

.stat-growth-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(70, 130, 230, 0.25);
  width: 0%;
  transition: width 0.05s linear;
}

.stat-growth-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border-dark);
  font-size: 0.7rem;
}

/* 3 per row (see dom-helpers.js's buildHeroDetailContent), wrapping onto as many rows
   as an actor's own action count needs — used to be one long single-column stack.
   1fr columns (rather than a fixed per-box width) so the three always fit the action
   menu's own available width instead of overflowing it — the menu column is normally
   narrower than 3 * 236px (.action-box's old fixed width) would need. */
.action-box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.action-box {
  position: relative;
  border: 2px solid var(--color-border-dark);
  width: 236px; /* 225px + 5% (180px original + 25% + 5%), for room to read the DPS readout (see .action-dps) — the default for a STANDALONE box (see buildSafeZoneActivityProgressBox, not part of any grid) */
  height: 32px;
  background: var(--color-bg-disabled);
  overflow: hidden;
  box-sizing: border-box;
}

/* Combat/gathering action boxes specifically (see .action-box-grid above) fill their
   own grid cell instead of the fixed width above, so the three per row always fit the
   action menu's own available width. */
.action-box-grid .action-box {
  width: 100%;
}

.action-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-fill-green); /* light green, same family as the HP bar fill */
  width: 0%;
  transition: width 0.05s linear;
}

.action-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--color-black);
}

/* Skill tag bubbles (ui/damage-tag-ui.js): the same bubble as the buff/debuff badges, one color pair per tag. */
.tag-physical { background: var(--color-tag-physical-bg); color: var(--color-tag-physical-text); }
.tag-magic { background: var(--color-tag-magic-bg); color: var(--color-tag-magic-text); }
.tag-heal { background: var(--color-tag-heal-bg); color: var(--color-tag-heal-text); }
.tag-buff { background: var(--color-tag-buff-bg); color: var(--color-tag-buff-text); }
.tag-debuff { background: var(--color-tag-debuff-bg); color: var(--color-tag-debuff-text); }
.tag-ice { background: var(--color-tag-ice-bg); color: var(--color-tag-ice-text); }
.tag-fire { background: var(--color-tag-fire-bg); color: var(--color-tag-fire-text); }
.tag-holy { background: var(--color-tag-holy-bg); color: var(--color-tag-holy-text); }
.tag-dark { background: var(--color-tag-dark-bg); color: var(--color-tag-dark-text); }
.tag-family { background: var(--color-tag-family-bg); color: var(--color-tag-family-text); }
.tag-unknown { background: var(--color-tag-unknown-bg); color: var(--color-tag-unknown-text); }
/* A class's party role (data/class-roles.js), reusing the skill tag colours. */
.tag-role-tank { background: var(--color-tag-physical-bg); color: var(--color-tag-physical-text); }
.tag-role-healer { background: var(--color-tag-heal-bg); color: var(--color-tag-heal-text); }
.tag-role-damage { background: var(--color-tag-debuff-bg); color: var(--color-tag-debuff-text); }
.tag-role-support { background: var(--color-tag-buff-bg); color: var(--color-tag-buff-text); }

/* An enemy card's element / family bubbles under its name (damage-tag-ui.js's buildEnemyTraitsRow). */
/* Left-aligned: it must out-rank .skill-tag-row's flex-end (declared further down, same specificity otherwise). */
.skill-tag-row.enemy-traits-row {
  justify-content: flex-start;
  align-items: center;
  margin: 0.15rem 0 0.25rem;
}

.enemy-traits-progress {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* The tag row at the top right of a skill card, beside the skill's name. */
.skill-name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}

.skill-tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  flex: 0 0 auto;
}

/* The element icon in a small box at the top right of a battle action box (ui/damage-tag-ui.js). */
.action-element-icon {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 17px;
  height: 17px;
  box-sizing: border-box;
  border: 1px solid currentColor;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.action-element-icon .icon {
  width: 12px;
  height: 12px;
}

/* Debug/balance DPS readout (see dom-helpers.js's actionDpsText) — small and
   right-aligned at the end of the action box, sitting on top of the label/fill. */
.action-dps {
  position: absolute;
  bottom: 1px;
  right: 4px;
  display: flex;
  align-items: flex-end;
  font-size: 0.5rem;
  color: var(--color-border-dark);
}

.safe-zone-activity-heading {
  font-weight: bold;
  margin-bottom: 0.4rem;
  /* A flex row so the [?] hint (buildHelpHint) is vertically centred on the text, like the loot pill's. */
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 3 per row, wrapping onto as many rows as SAFE_ZONE_ACTIVITY_DATA needs — same
   action-box-grid pattern as the combat/gathering action boxes (see
   .action-box-grid above), reused here for the same "evenly aligned rows instead of
   a ragged flex-wrap" reasoning. */
.safe-zone-activity-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.safe-zone-activity-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  /* Fills its own grid cell (see .safe-zone-activity-buttons above) instead of a
     fixed width — every button in a row still stays the same size as its row-mates,
     just sized by the grid instead of a fixed rem value. overflow/ellipsis is a
     safety net for a label too long even for that. */
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Fixed height too — a locked button's second "(Requirement)" line (see
     .safe-zone-activity-requirement) would otherwise make ONLY that button taller
     than its single-line siblings in the same row. Flex-centered so a plain
     single-line button's text doesn't just sit at the top of that extra height. */
  min-height: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.safe-zone-activity-locked {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
  cursor: default;
}

.safe-zone-activity-active {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* The selected activity's flavor line + mechanics summary (see dom-helpers.js's
   buildSafeZoneActivityDetail) — same look as a skill card's .skill-flavor/
   .skill-formula, just its own class names since it's a different system. */
.safe-zone-activity-flavor {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.25rem 0;
}

.safe-zone-activity-mechanics {
  font-size: 0.8rem;
  color: var(--color-border-dark);
  margin: 0 0 0.5rem 0;
}

/* Exploration mode's own per-hero Activity picker (see dom-helpers.js's
   buildExplorationActivitySelector) — mirrors .safe-zone-activity-* above 1:1, just
   its own class names since it's a different system (data/exploration-activities.js). */
.exploration-activity-heading {
  font-weight: bold;
  margin-bottom: 0.4rem;
  /* A flex row so the [?] hint is vertically centred on the text (the same as .safe-zone-activity-heading). */
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 3 per row, same action-box-grid pattern as .safe-zone-activity-buttons/
   .action-box-grid above — reused here for the same reason. */
.exploration-activity-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

/* Identical box to .safe-zone-activity-button (see it above for the reasoning): fills its grid cell,
   a fixed minimum height so a locked button's small second line ("(Needs Seamstress)") can't make
   only that button taller than its row-mates, and flex-centered text. The second line itself
   reuses .safe-zone-activity-requirement. */
.exploration-activity-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.exploration-activity-locked {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
  cursor: default;
}

.exploration-activity-active {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.exploration-activity-flavor {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem 0;
}

/* Battle Activities (potion buttons, see dom-helpers-battle-activities.js) — same look as the
   Exploration Activity picker above, just its own class names. The two-line button reads
   "{name}" over "Count: n". */
.battle-activity-selector {
  margin-top: 0.75rem;
}

.battle-activity-selector[hidden] {
  display: none;
}

.battle-activity-heading {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.battle-activity-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.battle-activity-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  width: 100%;
  min-height: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.battle-activity-count {
  font-size: 0.7rem;
}

/* The hero is already under this potion: the button is greyed (disabled) AND carries the gold tag look. */
.battle-activity-active {
  border-color: var(--color-unlock-border);
}

/* Random Event option selector (see dom-helpers-random-event.js) — shown in the
   Adventure panel's action menu once an active event's own box is selected. Same
   look as .safe-zone-activity-* above, just always 2 columns (every event has
   exactly 2 options) rather than 4. */
.random-event-selector-heading {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.random-event-selector-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.random-event-selector-button {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  width: 100%;
  min-height: 2.6rem;
}

/* A picked-but-not-yet-confirmed option — same highlighted-but-not-final look as
   .safe-zone-activity-active, so it reads as "this one's currently filling" rather
   than "this one is done." The OTHER button stays perfectly normal/clickable next to
   it — nothing here disables it. */
.random-event-selector-button-selected {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.random-event-decision-block {
  margin-top: 0.25rem;
}

.random-event-selector-countdown {
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--color-random-event-text);
  margin: 0 0 0.25rem 0;
}

.random-event-selector-flavor {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0.4rem 0 0 0;
}

/* The "Confirm Action" bar's own fill color — same gold tone the random-event status
   line/box already uses elsewhere, so this reads as part of the same system rather
   than a generic combat/gathering action bar. */
.random-event-confirm-fill {
  background: var(--color-pending-border);
}

/* God panel (see js/ui/god-ui.js) — same look as the safe-zone activity selector
   above, just its own class names since it's a different system. */
.god-pray-heading {
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.god-pray-hint {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem 0;
}

.god-level-status {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem 0;
}

.god-select-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.god-select-button {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

.god-select-active {
  font-weight: bold;
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* The Rates readout for a fighting party (adventure-ui.js's fillPartyRatesLine): "N gold/min · N XP/min",
   right-aligned on the zone's title row, styled like the town's "All followers in this zone
   recruited!" (.zone-title-row .entourage-level-status above). */
.zone-title-row .party-rates-line {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0;
  text-align: right;
}

/* A fighting party's unsold loot (adventure-ui.js's buildPartyLootLine): a gold pill, right-aligned in the
   shortcut row beside the Return button that banks it, with a [?] explaining how loot becomes gold. */
.party-loot-line {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: var(--zone-shortcut-button-height);
  padding: 0 0.6rem;
  border: 1px solid var(--color-medal-gold-border);
  border-radius: 4px;
  background: var(--color-medal-gold-bg);
  color: var(--color-medal-gold-text);
  font-size: 0.9rem;
  font-weight: bold;
  box-sizing: border-box;
}

/* The angel scout watching from a spare enemy slot (engine/angel-scout-system.js): faint and unclickable. */
.slot-box-angel-scout {
  opacity: 0.7;
  border-style: dashed;
  cursor: default;
}

/* The prologue's curtain (js/ui/prologue-ui.js): a full-window black (or, for the teleport, a white flash) over the game
   and under the story windows (2000), holding the opening line or the game's title. */
#prologue-curtain {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#prologue-curtain[hidden] {
  display: none;
}

.prologue-curtain-black {
  background: var(--color-black);
}

.prologue-curtain-flash {
  background: var(--color-white);
}

.prologue-curtain-line {
  max-width: 640px;
  margin: 0;
  color: var(--color-home-text);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

/* The one glowing way forward after the prologue: "Head out to Verdant Greens" (adventure-ui.js). */
.zone-header-shortcut-highlight {
  font-weight: 600;
}

/* Particles over a zone's background (js/ui/zone-effects-ui.js): behind every panel, over the page's background picture. */
#zone-effects-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* A hero under 25% HP, or a prologue fighter held at 1 HP (adventure-ui.js's isHeroNearDeath): a pulsing red halo (a steady one under Reduce motion). */
.slot-box-near-death {
  box-shadow: inset 0 0 0 3px var(--color-portrait-halo-hurt), inset 0 0 14px var(--color-portrait-halo-hurt);
  animation: near-death-pulse 1.1s ease-in-out infinite;
}

/* Drawn INSIDE the box (inset): neighbouring boxes and rows can't cover it, so the halo shows on all four sides. */
@keyframes near-death-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px var(--color-portrait-halo-hurt), inset 0 0 6px var(--color-portrait-halo-hurt); }
  50% { box-shadow: inset 0 0 0 3px var(--color-portrait-halo-hurt), inset 0 0 22px var(--color-portrait-halo-hurt); }
}

/* The first hero box and the first enemy box glow gold until the player has clicked one of each (adventure-ui.js). */
.slot-box-click-hint {
  box-shadow: inset 0 0 0 3px var(--color-party-selected-border), inset 0 0 12px var(--color-party-selected-border);
}

/* While the prologue plays (ui-main.js toggles body.prologue-active): only the fight shows. Everything above the zone
   header is made invisible but keeps its space, so nothing moves when it comes back. */
body.prologue-active #main-nav,
body.prologue-active #header-stats,
body.prologue-active #header-button-row {
  visibility: hidden;
}

body.prologue-active .party-switcher-row {
  visibility: hidden;
}

/* The Adventure header's Battle Level and Exploration Level, side by side (adventure-ui.js's buildZoneHeaderBox). */
.zone-level-line {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
}

.zone-level-line p {
  margin: 0;
}

/* The fight (red) / resource encounter (blue) tint over the page background (adventure-ui.js's updateAdventureTint):
   behind everything, fading in and out. */
.adventure-tint {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#adventure-tint-battle {
  background: linear-gradient(rgba(255, 255, 255, 0), var(--color-tint-battle));
}

#adventure-tint-gather {
  background: linear-gradient(rgba(255, 255, 255, 0), var(--color-tint-gather));
}

.adventure-tint-on {
  opacity: 1;
}

/* The prologue's opening (ui/prologue-ui.js): the burning city's embers rise over the black curtain just before it lifts. */
body.prologue-embers-over-curtain #zone-effects-canvas {
  z-index: 1901;
  animation: prologue-embers-in 1s ease-out;
}

@keyframes prologue-embers-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The line right under the zone name in the Adventure header: a danger zone's "Battle LV 3 (42%) • Exploration LV 2 (10%)"
   (.zone-level-summary) and a town's Level and Fame line (.zone-level-line). One rule for both, so they sit the same
   distance below the title row (pulled up into its bottom margin so it reads as the name's subtitle) and read the same. */
.zone-level-summary,
.zone-level-line {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: -8px 0 0;
}

/* Townsfolk passing by in a town's empty enemy slot boxes (townsfolk-ui.js): their own fixed layer under the speech
   bubbles (1500), the ceremonies (1400) and every modal; each one a faint bust filling a slot box, no name, no hover. */
#townsfolk-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1300;
}

.townsfolk-walker {
  position: absolute;
  overflow: hidden;
  box-sizing: border-box;
  background-color: white; /* inside the slot box's own border (townsfolk-ui.js insets it), so the bust reads against the town */
}

.townsfolk-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transform: translateY(16px);
  opacity: 0.3;
  image-rendering: pixelated;
  /* The same faint tan glow around the figure that a hero's portrait has (.slot-box-portrait). */
  filter: drop-shadow(0 0 20px var(--color-portrait-halo)) drop-shadow(0 0 6px var(--color-portrait-halo));
}

.townsfolk-walker-mirrored .townsfolk-portrait {
  transform: translateY(16px) scaleX(-1);
}

#townsfolk-layer .townsfolk-bubble {
  z-index: 1;
}
