/* BB-faithful scrollbar — a port of BB's aciScrollBar "desk" theme, which BB
 * applies to every character-screen list.
 *
 * THIS PROJECT'S OWN code, NOT copied from bng-game. bng-game styled the
 * browser's native ::-webkit-scrollbar; that cannot reproduce BB's grip,
 * because the native grip is sized by the content ratio (so it stretches when
 * there's little overflow and can't be pinned to a fixed size that reaches the
 * track ends). BB's grip is a FIXED 32px handle whose POSITION is set from the
 * scroll fraction. So we draw BB's scrollbar ourselves: track + two end caps +
 * a fixed grip, positioned in scrollbar.js.
 *
 * Values cited from BB:
 *   external/bb-vanilla-data/data_001/ui/extern/jquery-aciScrollBar/css/
 *     aciScrollBar.desk.css
 *       .aciSb_bar_v                width:20px           -> 2.0rem bar
 *       .aciSb_space_t/.aciSb_space_b 18x18, end.png     -> 1.8rem end caps
 *       .aciSb_track_v              track_v.png repeat-y -> 1.8rem track
 *       .aciSb_grip / .aciSb_drag_vg height:32px, drag_g.png -> 3.2rem grip
 *       .aciSb_arrow_*              0x0, background:none -> NO arrows
 * Grip math (fixed grip, ratio-positioned) is jquery.aciScrollBar.js L422-433.
 * Sprites are the ones bb-data already serves at /bb/images/ui/misc/. */

/* Hide the native scrollbar on every BB-scrolled surface — the JS bar replaces
 * it: the skills icon list, the company-inventory grid, and the injury/trait
 * editor modal (user 2026-06-15: consistent BB scroll everywhere). */
.character-screen-container .skills-module .l-list-container::-webkit-scrollbar,
.character-screen-container .inventory-list-module .l-list-container::-webkit-scrollbar,
.character-screen-container .retinue-module::-webkit-scrollbar,
.character-screen .skills-edit-content::-webkit-scrollbar
{
    width:  0;
    height: 0;
}
.character-screen-container .skills-module .l-list-container,
.character-screen-container .inventory-list-module .l-list-container,
.character-screen-container .retinue-module,
.character-screen .skills-edit-content
{
    scrollbar-width: none;            /* Firefox */
}

/* When a surface actually overflows, scrollbar.js adds this so the content
 * clears the 2.0rem bar — the same space the native scrollbar used to take. */
.character-screen-container .bb-has-scroll
{
    padding-right: 2.0rem;
}

/* The bar: track_v.png repeating, with an end cap (end.png) over each end.
 * scrollbar.js sets top/left/height to overlay the scrolled surface's right
 * edge. */
.character-screen-container .bb-scrollbar
{
    position: absolute;
    width:    2.0rem;
    z-index:  10003;

    background:
        url("/bb/images/ui/misc/end.png")     center top    / 1.8rem 1.8rem no-repeat,
        url("/bb/images/ui/misc/end.png")     center bottom / 1.8rem 1.8rem no-repeat,
        url("/bb/images/ui/misc/track_v.png") center top    / 1.8rem auto   repeat-y;
}

/* The grip: a FIXED 3.2rem (32px) handle drawn at NATURAL size — never
 * stretched. scrollbar.js sets its `top` from the scroll fraction so it rides
 * the track from flush-top (scroll 0) to flush-bottom (max scroll). */
.character-screen-container .bb-scrollbar .bb-sb-grip
{
    position: absolute;
    left:     0;
    width:    2.0rem;
    height:   3.2rem;
    background: url("/bb/images/ui/misc/drag_g.png") center / 2.0rem 3.2rem no-repeat;
    cursor:   pointer;
}
