/* css/party-tabs.css — Party sub-tabs: skills, classes/growth hexagon, crystals, gear, enchanting. Loaded after the files before it (see css/style.css). */

/* The Entourage tab specifically wants a bit of breathing room ABOVE each
   .class-level-row too (both the global Entourage Level bar and each follower's own
   usage-level row in the detail pane), not just below — scoped to .entourage-layout
   only so this doesn't touch the Party > Classes tab's own copy or the safe-zone
   title row's copy (.zone-title-row .class-level-row above), which each have their
   own spacing already tuned. */
.entourage-layout .class-level-row {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* color: var(--color-black) overrides .entourage-level-status's own shared color:var(--color-text-secondary) (see that
   rule's comment above), which otherwise leaks through onto the GLOBAL Follower
   Level bar's "LV N" text specifically — same equal-specificity, later-in-the-
   cascade-wins reasoning that rule's own comment already describes for font-size.
   Every OTHER user of this class has nothing else setting color, so this is just a
   no-op restatement of the already-black default there. */
.class-level-heading {
  font-size: 1.1rem;
  color: var(--color-black);
}

/* Reuses .stat-growth-bar/.stat-growth-bar-fill/.stat-growth-bar-text's own HP-bar-
   style pill (see their own comment above) for the CLASS level's XP progress instead
   of a stat's growth bucket — same visual language, different bucket. Grows to fill
   whatever room .class-level-text's "LV N" text doesn't take in their shared row,
   capped at the hexagon's own width so the row never stretches wider than the chart
   sitting below it. */
.class-level-progress-bar {
  flex: 1 1 auto;
  max-width: 160px;
}

/* Small centered caption sitting between the XP bar and the hexagon itself (see
   party-ui.js's buildPartyClassesLeftColumn) — same max-width as the hexagon below it
   so it stays centered over the chart rather than the whole (wider) left column. */
.class-hexagon-heading {
  margin: 0 auto;
  max-width: 160px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-text-secondary);
}

/* Takes up the remaining space next to the fixed-width left column — the Skills list
   (see party-ui.js's buildPartySkillsView) grows to fill whatever room is left. */
.party-classes-right {
  flex: 1 1 380px;
  min-width: 280px;
}

/* The growth radar/hexagon chart itself (see party-ui.js's buildClassGrowthHexagon) —
   width:100% + height:auto (rather than the SVG's own fixed pixel attributes) lets it
   shrink on a narrow .party-classes-left without ever growing past its own 160px cap.
   margin: 0 auto centers it within the wider .party-classes-left column, since the SVG
   itself has no inherent horizontal alignment. */
.class-growth-hexagon {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  margin: 0 auto;
}

.class-hexagon-grid-ring {
  fill: none;
  stroke: var(--color-border-light);
  stroke-width: 1;
}

.class-hexagon-grid-spoke {
  stroke: var(--color-border-light);
  stroke-width: 1;
}

.class-hexagon-data-polygon {
  fill: rgba(70, 130, 230, 0.25);
  stroke: var(--color-chart-accent);
  stroke-width: 2;
}

.class-hexagon-data-dot {
  fill: var(--color-chart-accent);
}

.class-hexagon-label {
  font-size: 0.7rem;
  font-weight: bold;
  fill: var(--color-border-dark);
}

/* min-height keeps every button (one-line unlocked name, two-line locked name +
   requirement) the same height, so a grid row holding a mix of the two doesn't end
   up taller/shorter than a row of all-unlocked or all-locked buttons. */
.class-select-button {
  padding: 0.4rem 0.3rem;
  min-height: 3.1rem;
}

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

/* The "(Requires X Lv N)" second line on a locked class button — small enough, and
   with little enough side padding on the button itself, to stay on one line rather
   than wrapping onto a third. */
.class-select-requirement {
  display: block;
  font-size: 0.65rem;
  white-space: nowrap;
}

/* Same "(Requires X Lv N)" second line as .class-select-requirement above, for a
   locked Home Activity button (see dom-helpers.js's buildSafeZoneActivitySelector) — also
   used for a locked Exploration Activity button (buildExplorationActivitySelector). */
.safe-zone-activity-requirement {
  display: block;
  font-size: 0.65rem;
  white-space: nowrap;
}

.crystal-section {
  margin-bottom: 0.5rem;
}

.crystal-sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.crystal-sort-button {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}

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

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

/* The Crystals tab's own left (Equipped Crystals + the selected crystal's detail
   card)/right (Available Crystals) split — see party-ui.js's buildPartyCrystalsView.
   Wraps on a narrow window rather than squeezing 5 crystal slot boxes down below a
   readable size. */
.party-crystals-split {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* Fixed rather than flex-grow — sized to comfortably fit 5 96px slot boxes in one row
   (5 * 96px + 4 * 0.5rem gaps ≈ 512px) and .crystal-detail's own 472px cap sitting
   below them, with a little breathing room on top of both. */
.party-crystals-left {
  flex: 0 0 520px;
}

/* Takes up the remaining space next to the fixed-width left column. */
.party-crystals-right {
  flex: 1 1 380px;
  min-width: 280px;
}

/* Opaque white so an unselected equipped-crystal box reads clearly against the page's
   own zone-art backdrop — .slot-box-empty/-selected-ally/.crystal-slot-pending
   already define their own background (or deliberately none, for Empty) and come
   later in the cascade, so they still win over this one. */
.crystal-slot-box {
  flex-direction: column;
  justify-content: center;
  font-size: 0.75rem;
  padding: 4px;
  background: var(--color-white);
}

/* A crystal slot not unlocked yet (party-crystals-ui.js's buildCrystalSlotUnlockBox): greyed like a locked zone box, one word. */
.slot-box.crystal-slot-locked {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg-disabled);
}

.crystal-slot-pending {
  border-color: var(--color-pending-border);
  background: var(--color-pending-bg);
}

.crystal-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 260px;
  overflow-y: auto;
}

/* Opaque white so an unselected available-crystal row reads clearly against the
   page's own zone-art backdrop — .crystal-list-item-selected already defines its own
   background and comes later in the cascade, so it still wins over this one. */
.crystal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 2px solid var(--color-border-dark);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  background: var(--color-white);
}

.crystal-list-item-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.crystal-list-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.crystal-list-item-selected {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

/* Opaque white so this detail card reads clearly against the page's own zone-art
   backdrop instead of letting it show through. */
.crystal-detail {
  border: 2px solid var(--color-border-dark);
  padding: 0.75rem;
  max-width: 100%;
  background: var(--color-white);
  height: 197px;
}

.crystal-detail h4 {
  margin-block-start: 0;
}

/* Left (name + stats grid)/right (Equip-or-Unequip/Dust/Disassemble, stacked one
   under the other) split — see party-ui.js's buildCrystalDetail. Wraps on a narrow
   window rather than squeezing the stats grid down unreadably. */
.crystal-detail-split {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.crystal-detail-left {
  flex: 1 1 200px;
}

/* Fixed rather than flex-grow — just wide enough for the longest button label
   ("Disassemble"), stacked instead of side by side. */
.crystal-detail-right {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crystal-detail-right button {
  height: 28px;
}

/* 3 columns (stat name, base bonus, Dust bonus), no header row — see
   party-ui.js's buildCrystalStatsGrid. Same display:contents-row-becomes-grid-items
   trick as .stats-list/.stat-line (see that pair's own comment) — right-aligned
   number columns to left-align the stat name only. */
.crystal-stats-grid {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  column-gap: 8px;
  row-gap: 2px;
  font-size: 0.85rem;
}

.crystal-stat-row {
  display: contents;
}

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

.crystal-stat-base, .crystal-stat-dust {
  text-align: right;
  min-width: 2em;
}

/* Same red as .crystal-dust-level (the crystal-name-line's own dustLevel counter) —
   this is that same Dust mechanic's contribution, just broken out per-stat here
   instead of shown as one combined count. */
.crystal-stat-dust {
  color: var(--color-danger-border);
  font-weight: bold;
}

.crystal-equip-hint {
  color: var(--color-pending-border);
  font-size: 0.8rem;
}

.crystal-dust-level {
  color: var(--color-danger-border);
  font-weight: bold;
}

.crystal-dust-insufficient {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

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

/* The Equipment tab's own left (Gear Resources + the 5 slot boxes, stacked)/right
   (selected slot's own detail) split — see party-ui.js's buildPartyGearView. Same
   shape as .party-classes-split/.party-crystals-split. */
.party-gear-split {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.party-gear-left {
  flex: 0 0 340px;
}

.party-gear-right {
  flex: 1 1 380px;
  min-width: 280px;
}

/* Narrower than .resources-summary-list's own default 7-column grid — only 5 gear
   resources exist (ore/ingots/relics/furs/textiles), and this now sits inside the
   340px-wide left column rather than a full-width one. */
.gear-resources-summary-list {
  grid-template-columns: repeat(2, 1fr);
}

/* One under another (not the horizontal row every other slot-box list uses) — see
   party-ui.js's buildPartyGearView. */
.gear-slot-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Overrides .slot-box's own fixed 96x96 square — a fixed-width, left-aligned list row
   instead, now that these stack vertically in their own column rather than sitting in
   a horizontal row. */
.gear-slot-box {
  width: 350px; /* fixed, so a long weapon name never changes the box width (the label ellipsizes instead) */
  flex-shrink: 0;
  height: auto;
  align-items: stretch;
  justify-content: center;
  text-align: left;
  font-size: 0.75rem;
  padding: 8px 10px;
  line-height: 1.3;
}

/* The slot box's own single-line content — label left-aligned, "Total Lv N"
   right-aligned, on the same line (see party-ui.js's buildGearSlotBox). */
.gear-slot-box-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.gear-slot-label {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear-slot-total-level {
  flex-shrink: 0;
  white-space: nowrap;
}

.gear-slot-detail {
  border: 2px solid var(--color-border-dark);
  padding: 0.75rem;
  max-width: 100%;
  background: var(--color-white);
  height: 370px;
}

.gear-slot-detail .gear-upgrade-button {
  /* Every stat's button (Upgrade, Locked or Maxed) is the same size, so the rows line up in both
     columns whatever the cost text says. A long cost list wraps inside it rather than growing it. */
  box-sizing: border-box;
  justify-content: center;
  width: 13rem;
  height: 3rem;
  overflow: hidden;
  text-align: center;
}

.gear-slot-detail .gear-upgrade-cost {
  font-size: 0.7rem;
  line-height: 1.15;
}

.gear-slot-detail h4 {
  margin: 0;
}

/* Title + cycle controls share one row (see party-ui.js's buildGearSlotDetail) — same
   content height for every slot's detail card whether or not it has cycle buttons. */
.gear-slot-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  height: 28px;
}

.gear-slot-detail-title-row h4 {
  margin: 0;
}

.gear-cycle-row {
  display: flex;
  gap: 0.5rem;
}

/* Fixed width (rather than sizing to each button's own type-name text) so both
   buttons stay the same size/position as the player cycles through types whose own
   names are wildly different lengths ("One-Hand Weapon (1HW)" vs "Ranged Weapon
   (RNG)") — text that doesn't fit truncates with an ellipsis instead of growing the
   button. */
.gear-cycle-button {
  width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2 columns x 4 rows (8 stats total — see party-ui.js's buildGearSlotDetail) rather
   than one long single-column stack, so the detail card's own extra horizontal room
   gets used instead of sitting empty next to a tall, narrow list. */
.gear-stat-rows {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* Cancels .zone-upgrade-row's own margin-bottom (meant for a plain vertical stack) —
   the grid's own `gap` above already provides consistent spacing in both directions. */
.gear-stat-rows .zone-upgrade-row {
  margin-bottom: 0;
}

.gear-stat-rows .zone-upgrade-description {
  font-size: 0.7rem;
}

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

/* The Enchanter's enchant slots at the bottom of a gear card (see party-gear-ui.js's buildGearEnchantSection).
   Once the Enchanter is built the card grows to fit them; every card gets them, so all stay the same height. */
.gear-slot-detail-with-enchants {
  height: 505px;
}

/* Chaotic Equilibrium's + and - dials and the Enchanter's enchant-pool list (see ui/entourage-enchanter-ui.js). */
.enchanter-knob-controls {
  display: flex;
  gap: 0.35rem;
}

.enchanter-knob-button {
  width: 2.2rem;
  font-weight: bold;
}

.enchanter-knob-summary {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.enchanter-pool-list {
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.enchanter-pool-line-locked {
  color: var(--color-text-muted);
}

/* The "Click to unlock" buttons that front the enchant slots and the Chaotic Equilibrium dials (the gold
   .unlock-pending look comes from the shared class). */
.gear-enchant-intro-button,
.enchanter-intro-button {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.gear-enchant-section {
  margin-top: 0.6rem;
  border-top: 2px solid var(--color-border-light);
  padding-top: 0.4rem;
}

.gear-enchant-section h5 {
  margin: 0 0 0.35rem;
}

.gear-enchant-locked-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.gear-enchant-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.gear-enchant-slot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: 1px solid var(--color-border-light);
  padding: 0.4rem;
  min-width: 0;
}

/* "New" and "Reroll" side by side (party-gear-ui.js's buildGearEnchantSlotBox), each taking half the slot's width. */
.gear-enchant-button-row {
  display: flex;
  gap: 0.25rem;
}

.gear-enchant-button-row .gear-enchant-button {
  flex: 1 1 0;
  min-width: 0;
}

.gear-enchant-slot-locked {
  opacity: 0.55;
}

.gear-enchant-value {
  font-size: 0.8rem;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear-enchant-value-top {
  color: var(--color-enchant-top);
}

.gear-enchant-range {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.gear-slot-detail .gear-enchant-button {
  width: 100%;
  height: 2.6rem;
}

/* "Previously equipped by X" on an inventory crystal that Auto-equip took off a hero (party-crystals-ui.js). */
.crystal-previous-owner {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.4rem;
  border: 1px solid var(--color-pending-border);
  border-radius: 999px;
  background: var(--color-pending-bg);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Party > Automation rows and the same rows on a follower's page (party-automation-ui.js). */
.automation-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 0.75rem;
  flex-shrink: 0;
  max-width: 50%;
}

/* Descriptions are full sentences here: let them use the row's width (the generic row caps them at 320px). */
.automation-row .zone-upgrade-description {
  max-width: 560px;
}

.automation-row-hidden,
.automation-row-locked {
  opacity: 0.6;
}

.automation-requirement {
  font-style: italic;
}

.automation-note {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.automation-switch,
.automation-choice,
.automation-choice select {
  font-size: 0.85rem;
}

.automation-switch {
  margin-top: 0; /* the shared .auto-max-toggle look adds a top gap meant for the layer controls */
}

/* Party > Prestige: one row per stat / class, with its own button at the right end. */
.prestige-row {
  align-items: center;
  gap: 0.75rem;
}

.prestige-row .dashboard-stat-value {
  margin-left: auto;
}

/* Party > Classes: the class name with its role bubble beside it (party-classes-ui.js). */
.party-classes-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
