/* NO PERRY — War Table editor clarity + canonical paper-doll layout (55H2)
   Loads after 55G / 55E. Editor focal point; background = context only. */

/* ── Hero suppression: editor zone pulls focus ── */
.np-war-table-scene__builder-toning {
  background:
    linear-gradient(
      180deg,
      rgba(4, 3, 6, 0.58) 0%,
      rgba(4, 3, 6, 0.42) 18%,
      rgba(6, 5, 8, 0.62) 38%,
      rgba(8, 7, 11, 0.82) 52%,
      rgba(10, 9, 12, 0.92) 100%
    ) !important;
}

.np-war-table-scene__vignette {
  background:
    radial-gradient(ellipse 92% 78% at 50% 38%, transparent 28%, rgba(0, 0, 0, 0.68) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.52) 0%, transparent 14%, transparent 86%, rgba(0, 0, 0, 0.52) 100%) !important;
}

.np-war-table-scene .np-war-table-hero__dissolve {
  background:
    linear-gradient(180deg, transparent 0%, rgba(6, 5, 8, 0.52) 48%, rgba(6, 5, 8, 0.78) 100%) !important;
}

.np-war-table-scene #guild-constellation.np-arsenal-host {
  position: relative;
}

.np-war-table-scene #guild-constellation.np-arsenal-host::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 88% 62% at 50% 58%, rgba(6, 5, 8, 0.35), rgba(4, 3, 6, 0.88) 78%),
    linear-gradient(180deg, rgba(8, 7, 10, 0.55) 0%, rgba(6, 5, 8, 0.92) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.np-war-table-scene #guild-constellation.np-arsenal-host > * {
  position: relative;
  z-index: 1;
}

.np-war-table-scene .np-arsenal__war-table .np-arsenal__forge-center.np-arsenal__selected-warrior {
  background:
    linear-gradient(165deg, rgba(14, 12, 11, 0.98) 0%, rgba(6, 5, 7, 0.99) 100%) !important;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.72),
    inset 0 0 0 3px rgba(26, 23, 20, 0.98),
    inset 0 0 0 5px rgba(168, 138, 74, 0.55),
    inset 0 0 0 7px color-mix(in srgb, var(--np-role-edge, #a88a4a) 48%, transparent) !important;
}

.np-war-table-scene .np-arsenal__equip-chamber {
  background:
    linear-gradient(180deg, rgba(4, 3, 5, 0.96), rgba(8, 7, 9, 0.98)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(58, 52, 46, 0.88),
    inset 0 3px 14px rgba(0, 0, 0, 0.62),
    inset 0 0 0 2px color-mix(in srgb, var(--np-role-edge) 32%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ── Canonical paper-doll grid (fixed positions empty or filled) ── */
.np-arsenal {
  --wt-h2-slot: 72px;
  --wt-h2-slot-sm: 64px;
  --wt-h2-weapon-w: 76px;
  --wt-h2-weapon-h: 128px;
  --wt-h2-cell-h: 108px;
}

.np-arsenal__war-table .np-arsenal__socket-ring--canonical {
  display: grid;
  grid-template-columns: var(--wt-h2-weapon-w) var(--wt-h2-slot) var(--wt-h2-slot);
  grid-template-rows: var(--wt-h2-cell-h) var(--wt-h2-cell-h) var(--wt-h2-cell-h) var(--wt-h2-cell-h);
  grid-template-areas:
    ". head cape"
    "weapon chest offhand"
    ". feet . "
    "food . potion";
  gap: 0.35rem 0.42rem;
  justify-content: center;
  align-content: start;
  width: fit-content;
  margin-inline: auto;
  padding: 0.35rem;
}

.np-arsenal__war-table .np-arsenal__sock-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: var(--wt-h2-cell-h);
  position: relative;
  z-index: 2;
}

.np-arsenal__war-table .np-arsenal__socket-ring--canonical > .np-arsenal__sock,
.np-arsenal__war-table .np-arsenal__socket-ring--canonical .np-arsenal__sock {
  grid-area: unset;
}
.np-arsenal__war-table .np-arsenal__sock-cell--head { grid-area: head; }
.np-arsenal__war-table .np-arsenal__sock-cell--weapon { grid-area: weapon; }
.np-arsenal__war-table .np-arsenal__sock-cell--offhand { grid-area: offhand; }
.np-arsenal__war-table .np-arsenal__sock-cell--chest { grid-area: chest; }
.np-arsenal__war-table .np-arsenal__sock-cell--feet { grid-area: feet; }
.np-arsenal__war-table .np-arsenal__sock-cell--cape { grid-area: cape; }
.np-arsenal__war-table .np-arsenal__sock-cell--food { grid-area: food; }
.np-arsenal__war-table .np-arsenal__sock-cell--potion { grid-area: potion; }

/* Legacy sock-wrap alias (preview/export non-interactive paths) */
.np-arsenal__war-table .np-arsenal__sock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Click targets: full cell, no decorative blockers */
.np-arsenal__war-table .np-arsenal__sock {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 44px;
  min-width: 44px;
  padding: 0.1rem;
  gap: 0.18rem;
  cursor: pointer;
  pointer-events: auto;
  border: none;
  background: transparent;
  touch-action: manipulation;
}

.np-arsenal__war-table .np-arsenal__sock.is-disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.42;
}

.np-arsenal__war-table .np-arsenal__sock-aperture {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--wt-h2-slot);
  height: var(--wt-h2-slot);
  flex-shrink: 0;
  pointer-events: none;
}

.np-arsenal__war-table .np-arsenal__sock--weapon .np-arsenal__sock-aperture {
  width: var(--wt-h2-weapon-w);
  height: var(--wt-h2-weapon-h);
}

.np-arsenal__war-table .np-arsenal__sock--offhand .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--cape .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--food .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--potion .np-arsenal__sock-aperture {
  width: var(--wt-h2-slot-sm);
  height: var(--wt-h2-slot-sm);
}

/* Empty = same geometry as filled (no reflow) */
.np-arsenal__war-table .np-arsenal__sock.is-empty .np-arsenal__sock-aperture {
  width: var(--wt-h2-slot);
  height: var(--wt-h2-slot);
  opacity: 1;
  border: 1px dashed rgba(110, 98, 82, 0.55);
  background:
    radial-gradient(circle at 50% 38%, rgba(24, 20, 18, 0.94), rgba(6, 5, 6, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(72, 66, 58, 0.55),
    inset 0 2px 8px rgba(0, 0, 0, 0.48);
}

.np-arsenal__war-table .np-arsenal__sock--weapon.is-empty .np-arsenal__sock-aperture {
  width: var(--wt-h2-weapon-w);
  height: var(--wt-h2-weapon-h);
}

.np-arsenal__war-table .np-arsenal__sock--offhand.is-empty .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--cape.is-empty .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--food.is-empty .np-arsenal__sock-aperture,
.np-arsenal__war-table .np-arsenal__sock--potion.is-empty .np-arsenal__sock-aperture {
  width: var(--wt-h2-slot-sm);
  height: var(--wt-h2-slot-sm);
}

/* Fixed label block — empty/filled must not shift grid positions */
.np-arsenal__war-table .np-arsenal__sock-label {
  min-height: 2.35em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.np-arsenal__war-table .np-arsenal__sock.is-empty .np-arsenal__sock-label {
  opacity: 0.92;
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  max-width: 108px;
  color: rgba(198, 184, 152, 0.94);
  text-transform: uppercase;
}

.np-arsenal__war-table .np-arsenal__sock.is-filled .np-arsenal__sock-label {
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(168, 154, 120, 0.88);
}

.np-arsenal__war-table .np-arsenal__sock-aperture img {
  width: 96%;
  height: 96%;
  object-fit: contain;
  transform: scale(1.12);
  transform-origin: center center;
  pointer-events: none;
}

/* Offhand blocked by two-handed weapon — cell stays, slot reads inactive */
.np-arsenal__war-table .np-arsenal__sock-cell--offhand.is-offhand-blocked .np-arsenal__sock.is-disabled .np-arsenal__sock-label::after {
  content: ' · 2M';
  opacity: 0.72;
}

/* Remove / edit — sibling of sock, not blocking clicks */
.np-arsenal__war-table .np-arsenal__sock-cell .np-arsenal__sock-remove {
  margin-top: 0.1rem;
  pointer-events: auto;
  z-index: 3;
}

.np-arsenal__war-table .np-arsenal__sock-cell:hover .np-arsenal__sock-remove,
.np-arsenal__war-table .np-arsenal__sock-cell:focus-within .np-arsenal__sock-remove {
  opacity: 1;
}

/* ── Swaps isolated below primary loadout ── */
.np-arsenal__war-table .np-arsenal__bench {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.np-arsenal__war-table .np-arsenal__swap-rack {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(72, 66, 58, 0.45);
  width: 100%;
  max-width: 100%;
}

.np-arsenal__war-table .np-arsenal__swap-rack-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(168, 154, 120, 0.82);
}

.np-arsenal__war-table .np-arsenal__swap-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

/* Non-interactive preview/export: same grid when inside war-table context */
.np-arsenal__board-preview .np-arsenal__socket-ring--canonical,
.np-arsenal__build-preview .np-arsenal__socket-ring--canonical {
  display: grid;
  grid-template-columns: var(--wt-h2-weapon-w, 76px) var(--wt-h2-slot, 72px) var(--wt-h2-slot, 72px);
  grid-template-areas:
    ". head cape"
    "weapon chest offhand"
    ". feet . "
    "food . potion";
  gap: 0.3rem;
  justify-content: center;
}

.np-arsenal__board-preview .np-arsenal__sock--head,
.np-arsenal__build-preview .np-arsenal__sock--head { grid-area: head; }
.np-arsenal__board-preview .np-arsenal__sock--weapon,
.np-arsenal__build-preview .np-arsenal__sock--weapon { grid-area: weapon; }
.np-arsenal__board-preview .np-arsenal__sock--offhand,
.np-arsenal__build-preview .np-arsenal__sock--offhand { grid-area: offhand; }
.np-arsenal__board-preview .np-arsenal__sock--chest,
.np-arsenal__build-preview .np-arsenal__sock--chest { grid-area: chest; }
.np-arsenal__board-preview .np-arsenal__sock--feet,
.np-arsenal__build-preview .np-arsenal__sock--feet { grid-area: feet; }
.np-arsenal__board-preview .np-arsenal__sock--cape,
.np-arsenal__build-preview .np-arsenal__sock--cape { grid-area: cape; }
.np-arsenal__board-preview .np-arsenal__sock--food,
.np-arsenal__build-preview .np-arsenal__sock--food { grid-area: food; }
.np-arsenal__board-preview .np-arsenal__sock--potion,
.np-arsenal__build-preview .np-arsenal__sock--potion { grid-area: potion; }

@media (max-width: 900px) {
  .np-arsenal {
    --wt-h2-slot: 64px;
    --wt-h2-slot-sm: 56px;
    --wt-h2-weapon-w: 68px;
    --wt-h2-weapon-h: 112px;
    --wt-h2-cell-h: 96px;
  }
}

@media (max-width: 560px) {
  .np-arsenal {
    --wt-h2-slot: 56px;
    --wt-h2-slot-sm: 50px;
    --wt-h2-weapon-w: 60px;
    --wt-h2-weapon-h: 100px;
    --wt-h2-cell-h: 88px;
  }

  .np-arsenal__war-table .np-arsenal__socket-ring--canonical {
    gap: 0.28rem 0.32rem;
  }

  .np-arsenal__war-table .np-arsenal__sock.is-empty .np-arsenal__sock-label {
    font-size: 0.42rem;
  }
}
