/* UI 017.3B.2.7.3 — persistent Character dock composition.
   The local Character dock never disappears while the B.2 Item Sheet opens,
   stays open, or closes. Scoped to #i173a-character-layer only. */

/*
  Character already owns --i173a-dock-reserve (98px) specifically to reserve
  vertical space for its local dock. B.2.7.3 uses that same contract for the
  Item Sheet instead of covering the dock and trying to restore it afterwards.
*/
#i173a-character-layer:has(.i173b2-overlay) .i173a-local-dock{
  z-index:2600030;
  opacity:1!important;
  visibility:visible!important;
  transform:translateZ(0)!important;
  animation:none!important;
  transition:none!important;
  /* Keep navigation visually present but inert while the modal sheet owns input. */
  pointer-events:none;
}

/* The modal overlay remains below the persistent dock. The backdrop therefore
   dims Character content without dimming or hiding the dock itself. */
#i173a-character-layer .i173b2-overlay{
  z-index:2600020;
}

/* The sheet opens above the reserved dock area instead of occupying the screen
   bottom. This keeps actions readable and prevents the persistent dock from
   covering Item Sheet controls. */
#i173a-character-layer .i173b2-sheet{
  bottom:calc(var(--i173a-dock-reserve,98px) + 4px);
  max-height:min(78vh,690px);
  border-bottom:1px solid rgba(220,177,83,.34);
  border-radius:24px 24px 18px 18px;
}

/* The sheet is no longer attached to the physical safe-area edge, so its footer
   does not need to consume the iPhone home-indicator inset. */
#i173a-character-layer .i173b2-actions{
  padding-bottom:10px;
  border-radius:0 0 18px 18px;
}

/* Explicitly preserve the same dock pixels throughout every B.2 state. */
#i173a-character-layer:has(.i173b2-overlay.is-open) .i173a-local-dock,
#i173a-character-layer:has(.i173b2-overlay:not(.is-open)) .i173a-local-dock{
  opacity:1!important;
  visibility:visible!important;
  transform:translateZ(0)!important;
}

html.arena-cool-mode #i173a-character-layer:has(.i173b2-overlay) .i173a-local-dock,
html[data-performance="cool"] #i173a-character-layer:has(.i173b2-overlay) .i173a-local-dock{
  animation:none!important;
  transition:none!important;
  opacity:1!important;
  transform:translateZ(0)!important;
}

@media (max-width:380px){
  #i173a-character-layer .i173b2-sheet{
    bottom:calc(var(--i173a-dock-reserve,98px) + 2px);
    max-height:76vh;
  }
}

@media (prefers-reduced-motion:reduce){
  #i173a-character-layer:has(.i173b2-overlay) .i173a-local-dock{
    animation:none!important;
    transition:none!important;
  }
}
