/* css/zones.css — Zones panel and the shared box styles: zone list/boxes, patronage, Gods list, Tutorial list, zone upgrades, difficulty rows. Loaded after the files before it (see css/style.css). */

.zone-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.zone-list p {
  margin-top: 0.5rem;
}

/* Entourage' own left-hand list (see entourage-ui.js's buildFollowerList) has no
   Safe/Danger-style sections — its boxes sit directly inside .zone-list rather than
   inside a .zone-list-section, so without this override they'd inherit .zone-list's
   own SECTION-to-section gap (1rem) instead of the tighter box-to-box gap a Zones
   section itself uses (.zone-list-section's own 0.5rem below) — same spacing as the
   Zones tab now, scoped to Entourage only so Zones' own section spacing is untouched. */
/* Every box in the Gods list is the same fixed height as a zone/follower box elsewhere. */
#god-panel .zone-box {
  height: 46px;
}

#entourage-panel .zone-list,
#god-panel .zone-list {
  gap: 0.5rem;
}

.zone-list-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.zone-list-heading {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
}

/* Opaque white so an unselected zone box reads clearly against the page's own
   zone-art backdrop (see adventure-ui.js's updateAdventurePanelBackground) — also
   reused as-is by entourage-ui.js's own follower boxes (see its file comment),
   so this covers those too. .zone-box-selected-safe/-danger/-locked already define
   their own background and come later in the cascade, so they still win over this
   one. */
/* zones-ui.js's buildZoneBox/entourage-ui.js's buildFollowerBox are now real
   <button>s (for keyboard/screen-reader access) rather than plain clickable <div>s —
   this neutralizes the handful of browser default button styles .zone-box itself
   doesn't already override (font, text alignment, text color), so converting them
   changed no visual look. */
button.zone-box {
  font: inherit;
  text-align: left;
  color: inherit;
}

.zone-box {
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border-dark);
  cursor: pointer;
  width: 413px; /* 220px + 25%, then +50% of that (275px * 1.5) */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-sizing: border-box;
  background: var(--color-white);
}

/* The tags on a zone box saying where the selected party last returned / fought / explored (see
   zones-ui.js's buildZoneVisitTags). Same compact bubble shape as .status-indicator-badge. The group
   is right-aligned inside the box (the box is a space-between flex row) and its tags sit side by
   side with a small gap when one zone carries both Fought and Explored. */
.zone-tag-group {
  display: flex;
  gap: 0.3rem;
}

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

.zone-tag-returned {
  background: var(--color-tag-returned-bg);
  color: var(--color-tag-returned-text);
}

.zone-tag-fought {
  background: var(--color-debuff-bg);
  color: var(--color-tag-fought-text);
}

.zone-tag-explored {
  background: var(--color-info-bg);
  color: var(--color-tag-explored-text);
}

.zone-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.zone-row .zone-box {
  width: 413px; /* same as a plain zone box — the Blessings button sits to its right */
  flex: none;
}

/* Zone Patronage's per-zone button (see zones-ui.js's buildZoneBlessingsButton), right of
   its zone's own box. */
.zone-blessings-button {
  flex: 1; /* takes whatever is left of the row after the 413px zone box */
  display: flex;
  align-items: center;
  justify-content: center; /* god icons (or the label) centered in the button */
  gap: 0.25rem;
  padding: 3px 6px;
  box-sizing: border-box;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* The god icons grow to the button's full inner height (the button itself stretches to
   its zone box's height, see .zone-row). */
.zone-blessings-button .icon {
  height: 100%;
  width: auto;
  aspect-ratio: 1 / 1;
  vertical-align: baseline;
}

/* Zone Patronage modal (see patronage-ui.js). */
.patronage-box {
  max-width: 560px;
}

#patronage-slots {
  flex-wrap: wrap;
}

.patronage-god-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 40vh;
  overflow-y: auto;
  margin: 0.5rem 0;
}

.patronage-god-list .zone-box {
  width: 100%;
  padding: 0.4rem 0.75rem;
}

.patronage-bonus-description {
  font-weight: bold;
}

.holy-palace-level-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.holy-palace-edict-row {
  align-items: center;
  justify-content: space-between;
}

.holy-palace-devotion,
.holy-palace-active {
  margin: 0.25rem 0;
}

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

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

/* A War Zone's own selected-box color (see data/zones.js's warZone flag) — distinct
   from both -safe (green) and -danger (red) at a glance. */
.zone-box-selected-war {
  border-color: var(--color-war-border);
  background: var(--color-war-bg);
}

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

/* Unsafe zone's "Battle"/"Exploration" buttons (see zones-ui.js's buildZoneMoveButtons)
   — a safe zone still just gets the one plain "Move to this zone" button, unaffected. */
.zone-move-buttons {
  display: flex;
  gap: 0.5rem;
}

/* The Move button itself (see zones-ui.js's buildZoneMoveButton) — full width of its
   section and noticeably taller/bolder than a plain button, so the single most
   important "go fight/explore/move" action on the whole zone menu reads as an obvious
   clickable call-to-action rather than blending into the upgrade list below it. */
.zone-move-button {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  font-weight: bold;
}

/* Same greyed-out treatment as a locked zone box (.zone-box-locked) — Exploration
   stays a "???" button with no click handler until state.explorationUnlocked. */
.zone-move-button-locked {
  cursor: default;
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

.zone-upgrades {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Tutorial panel (see js/ui/tutorial-ui.js) — same left-list/right-detail look as the
   Zones panel above, just its own class names (and no locked/safe/danger variants —
   every topic is always available) since it's a different, static system. */
.tutorial-list {
  /* Two equal-width columns, one box per cell — new topics simply flow into the next row. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  align-content: start;
}

/* Gods tab left panel: two columns like the Tutorial list; the Devotion bar spans both. */
.zone-list.god-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  align-content: start;
}

.god-list > .class-level-row {
  grid-column: 1 / -1;
}

/* .zone-box has a fixed 413px width; in the grid each box fills its own column instead (like .tutorial-box). */
.god-list > .zone-box {
  width: auto;
  min-width: 0;
}

.tutorial-box {
  padding: 0.75rem 1rem;
  background-color: white;
  border: 2px solid var(--color-border-dark);
  cursor: pointer;
  box-sizing: border-box;
}

/* A topic whose feature isn't available yet: same greyed-out look as a locked zone box (see
   .zone-box-locked), but its name stays readable. No pointer cursor — it can't be clicked. */
.tutorial-box-locked {
  cursor: default;
  color: var(--color-text-muted);
  background-color: var(--color-bg-disabled);
  border-color: var(--color-border-light);
}

/* "New" on a topic the player hasn't opened since it unlocked (js/ui/tutorial-ui.js). */
.tutorial-box-new {
  margin-left: 0.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--color-pending-bg);
  border: 1px solid var(--color-pending-border);
  color: var(--color-medal-gold-text);
  font-size: 0.75rem;
  font-weight: 600;
}

/* A former intro window's words at the bottom of a topic (data/tutorials.js's introIds). */
.tutorial-intro-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
}

.tutorial-intro-list-heading {
  margin-bottom: 0.25rem;
  font-weight: 600;
}

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

.tutorial-detail {
  background-image: linear-gradient(
      rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)
  );
  padding-right: 1.5rem;

}

.tutorial-description p {
  margin: 0 0 1rem 0;
}

.tutorial-description p:last-child {
  margin-bottom: 0;
}

/* Opaque white so an unselected/usable upgrade row reads clearly against the page's
   own zone-art backdrop — also reused as-is by entourage-ui.js's own follower action
   rows (see its file comment), so this covers those too.
   .zone-upgrade-row-locked/-insufficient already define their own background and come
   later in the cascade, so they still win over this one. */
.zone-upgrade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 2px solid var(--color-border-dark);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--color-white);
}

/* The Foreman's Build action rows (entourage-ui.js's buildBuildActionRow), locked ones included: a one-column grid
   whose rows are all as tall as the tallest, so the list doesn't jump as projects unlock. Their description gets a
   wider max-width (420px) than the usual 320px so the text wraps onto fewer lines. */
.foreman-build-list {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.foreman-build-list .zone-upgrade-row {
  margin-bottom: 0;
}

.foreman-build-list .zone-upgrade-description {
  max-width: 420px;
}

.zone-upgrade-name {
  font-weight: bold;
}

.zone-upgrade-description {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  /* 460px since 2026-10-29 (it was 320px, which wrapped the zone upgrades', Gear Up's and the Tutor's descriptions onto
     several short lines). A max-width only: on a phone the row's own width still wins. A row with two buttons side by side
     keeps the narrower 320px (the rule below). */
  max-width: 460px;
}

/* Rows with two buttons side by side (Order Rations + [Max], a recipe + Bulk, a zone point's - / +): the buttons need the
   room, so the description stays at its old 320px there. */
.zone-upgrade-row:has(.zone-upgrade-button-group) .zone-upgrade-description {
  max-width: 320px;
}

.zone-upgrade-button {
  flex-shrink: 0;
  height: 28px;
}

/* Not-yet-unlocked upgrade (see zones-ui.js's buildLockedZoneUpgradeRow) — same grey
   treatment as a locked zone box (.zone-box-locked). */
/* Order Rations' [Max] button (see entourage-ui.js's buildFollowerAbilityRow): a small button
   sitting right after the main Order button. */
.zone-upgrade-button-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.zone-upgrade-bulk-button {
  flex-shrink: 0;
  height: 28px;
}

.zone-upgrade-max-button {
  flex-shrink: 0;
  height: 28px;
  padding: 0 0.5rem;
  font-size: 0.8rem;
}

/* A Build action under construction (see ui/entourage-ui.js's patchBuildActionRow): a fill grows from left to right
   as --build-progress (0-100%) rises, drawn on a ::before layer behind the row's content. It is a gradient that
   darkens toward a soft, glowing leading edge. */
.zone-upgrade-row-constructing {
  position: relative;
  overflow: hidden;
}

.zone-upgrade-row-constructing::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--build-progress, 0%);
  background: linear-gradient(to right, var(--color-build-progress), var(--color-build-progress-edge));
  border-right: 2px solid var(--color-build-progress-edge);
  box-shadow: 0 0 10px var(--color-build-progress-edge);
  pointer-events: none;
}

/* The row's own text/buttons sit above the fill. */
.zone-upgrade-row-constructing > * {
  position: relative;
}

.zone-upgrade-button[hidden] {
  display: none;
}

.zone-upgrade-row-locked {
  justify-content: center;
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

/* A locked ROW (the class also greys single buttons) is as tall as an ordinary upgrade row (a name, a line of description and a
   two-line button: about 62px), so a "Requires ..." box doesn't look like a thin strip between full rows (since 2026-10-29).
   A row with more text still grows past it. */
.zone-upgrade-row.zone-upgrade-row-locked {
  min-height: 3.875rem;
}

/* A locked row that still has its own name element (the Tutor's Multiclass Study) reads like plain "Requires ..." text. */
.zone-upgrade-row-locked .zone-upgrade-name {
  font-weight: normal;
  color: var(--color-text-muted);
  text-align: center;
}

/* The Alchemist's potion rows (see js/ui/entourage-alchemist-ui.js): the Brew and Upgrade
   buttons stack in one column at the right of the shared .zone-upgrade-row. */
.alchemist-potion-buttons button {
  white-space: nowrap;
}

.alchemist-potion-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* A gear stat's Upgrade button: "Upgrade" over its cost line, so a long cost list (gold plus up to
   three resources) sits below the word instead of stretching the button sideways. */
.gear-upgrade-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: auto;
  min-height: 28px;
  padding: 0.2rem 0.6rem;
  line-height: 1.25;
}

/* Every follower button (the Entourage pages and the automation rows, upgrade-button-ui.js, since 2026-10-31) is two lines,
   the verb over its cost or detail ("Upgrade" / "(11 [meat])", "Upgrading" / "0:20", "Maxed" / "(Quartermaster Lv 3)"). The
   second line is always there and never wraps, so a row keeps its height whatever state its button is in. 9rem fits "Upgrade
   underway"; a longer cost still widens the button. */
#entourage-panel .gear-upgrade-button,
.party-automation-view .gear-upgrade-button {
  min-width: 9rem;
}

#entourage-panel .gear-upgrade-button > span,
.party-automation-view .gear-upgrade-button > span {
  white-space: nowrap;
}

/* A flex row would otherwise keep its border when [hidden] is set. */
.mess-hall-upgrade-row[hidden],
.mess-hall-flowers-lock[hidden] {
  display: none;
}

.mess-hall-upgrades-heading {
  margin: 0.75rem 0 0.35rem;
}

.gear-upgrade-cost {
  font-size: 0.75rem;
}

.zone-upgrade-insufficient {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.zone-difficulty {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-panel);
}

.battles-won-line {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
}

.difficulty-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.difficulty-text {
  font-size: 0.85rem;
  font-weight: bold;
}

.auto-max-toggle {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Auto-max + Announce new layers side by side. */
.layer-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
}

/* The Seamstress's loom / Blacksmith's forge (entourage-conversion-ui.js): a whole-row button reusing the build fill
   above; a stopped bar keeps its (empty or paused) fill but reads as idle. */
.conversion-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
}

.conversion-bar.conversion-bar-stopped {
  border-style: dashed;
}

/* Zone points (zone-points-ui.js): the "Points: x to place" line above a Battle/Exploration upgrade list, the small - / + buttons
   on each row, and the zone speed slider (Arena tab and the Adventure header's shortcut row). */
.zone-points-header {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.zone-point-button {
  min-width: 28px;
  height: 28px;
  font-weight: bold;
}

.zone-speed-control {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  margin: 0.25rem 0 0.5rem;
}

.zone-speed-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.zone-speed-control input[type="range"] {
  width: 100%;
}

/* At the top layer the +1 / +5 (and at layer 1 the -1 / -5) fade well back, so a new top layer makes them pop. */
.difficulty-row button:disabled {
  opacity: 0.3;
  filter: grayscale(1);
}
