/* ============================================================
 * COPIED VERBATIM from bng-game: client/inventory/modules/stats_module.css
 * WHY: the two-column stat-bar block (HP, fatigue, resolve, attributes, armor, etc.).
 * NOT copied: that module's JS — this project renders the same DOM
 *   server-side (Jinja), so no bng-game JS runs here.
 * bng-game's own header + its BB-source citations are kept below.
 * ============================================================ */

/*
 * bng-game/webapp/inventory/modules/stats_module.css
 *
 * Maps to BB's character_screen_stats_module — two columns of progressbar
 * rows, each row = icon + 12.7rem-wide BB inventory bar with a centred
 * numeric/text label.
 *
 * Column 1 (LEFT, 8 rows):
 *   ArmorHead, ArmorBody, Hitpoints, ActionPoints, Fatigue, Morale,
 *   Bravery, Initiative
 * Column 2 (MIDDLE in BB, 8 rows):
 *   MeleeSkill, RangeSkill, MeleeDefense, RangeDefense, RegularDamage,
 *   CrushingDamage, ChanceToHitHead, SightDistance
 *
 * Recreated from BB vanilla source (under external/bb-vanilla-data/data_001/):
 *   ui/screens/character/modules/character_screen_left_panel/
 *     character_screen_stats_module.css
 *   ui/controls/progressbar.css
 *
 * coui://gfx/... paths rewritten to /bb/images/... (served by Flask).
 */

/* BB: ui/screens/character/modules/character_screen_left_panel/character_screen_stats_module.css */
/* BB: ui/controls/progressbar.css */


/* Source: character_screen_stats_module.css L12-19 — outer .stats-module
 * pinned to the bottom of the left panel (.l-left-content-container).
 * BB sets height to 32.5% of the parent (paperdoll/skills/stats split). */
.character-screen-container .stats-module
{
    width:    100%;
    height:   32.5%;
    position: absolute;
    bottom:   0.0rem;
}

/* Source: character_screen_stats_module.css L21-27 — two equal columns
 * floated side-by-side (left + middle). The 0.4rem top margin nudges
 * the rows clear of the .skills-module above. */
.character-screen-container .stats-module .stats-column
{
    width:      50%;
    height:     100%;
    float:      left;
    margin-top: 0.4rem;
}

/* Source: character_screen_stats_module.css L29-35 — each row is a
 * fixed-percentage strip of the column. 12.2% × 8 ≈ 97.6%, leaving
 * a small bottom gap before the parchment frame. */
.character-screen-container .stats-module .stats-row
{
    width:    100%;
    height:   12.2%;
    position: relative;
}

/* Source: character_screen_stats_module.css L37-47 — inner row layout:
 * 92% wide, 2.6rem tall, centered horizontally inside the row strip. */
.character-screen-container .stats-module .stats-row > .l-stats-row
{
    left:     0;
    right:    0;
    top:      0;
    bottom:   0;
    width:    92%;
    height:   2.6rem;
    position: absolute;
    margin:   auto;
}

/* Source: character_screen_stats_module.css L49-57 — fixed-width icon
 * column on the left of each row. */
.character-screen-container .stats-module .l-stats-row > .l-stats-row-icon-column
{
    top:      0;
    left:     0;
    width:    3.0rem;
    height:   2.6rem;
    position: absolute;
    float:    left;
}

/* Source: character_screen_stats_module.css L59-63 — every <img> in a
 * row is the 2.6rem-square stat icon. */
.character-screen-container .stats-module .stats-row img
{
    width:  2.6rem;
    height: 2.6rem;
}

/* Source: character_screen_stats_module.css L65-73 — progressbar column
 * fills the rest of the row (left of progressbar starts at 3.0rem,
 * stretches to the right edge). */
.character-screen-container .stats-module .l-stats-row > .l-stats-row-progressbar-column
{
    top:      0;
    left:     3.0rem;
    right:    0;
    bottom:   0;
    height:   2.6rem;
    position: absolute;
}

/* Source: character_screen_stats_module.css L75-84 — progressbar
 * container, 2.2rem tall, vertically centered. */
.character-screen-container .stats-module .stats-row .stats-progressbar-container
{
    top:      0;
    left:     0;
    right:    0;
    bottom:   0;
    height:   2.2rem;
    position: absolute;
    margin:   auto;
}


/* --- Progressbar rules from progressbar.css ---------------------------- */
/* Reused for the inventory stats bars; the bottombar already pulls in
 * the smaller `bar_*` 15.5rem variants for its tactical strip. The
 * inventory uses the longer 12.7rem `inventory_bar_*_127.png` family
 * cited in BB progressbar.css L33-46. */

/* Source: progressbar.css L16-24 — base .ui-control.progressbar. */
.character-screen-container .stats-module .ui-control.progressbar
{
    width:    100%;
    height:   100%;
    position: relative;

    overflow: hidden;
    outline:  hidden;
}

/* Source: progressbar.css L33-38 — empty-bar parchment frame. */
.character-screen-container .stats-module .ui-control.progressbar.has-frame
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_empty_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

/* Source: progressbar.css L47-59 — fill bars stack inside the frame. */
.character-screen-container .stats-module .ui-control.progressbar .normal-bar
{
    width:    100%;
    height:   100%;
    position: absolute;
    z-index:  1;
}

/* Source: progressbar.css L66-81 — centred label. */
.character-screen-container .stats-module .ui-control.progressbar .label
{
    top:      50%;
    width:    100%;
    position: relative;
    z-index:  3;

    -webkit-transform: translateY(-50%);
            transform: translateY(-50%);

    white-space:   nowrap;
    text-align:    center;
    text-overflow: ellipsis;
}


/* --- Per-stat fill colors --------------------------------------------- */
/* Source: progressbar.css L101-239 — each style uses a specific BB skin
 * sprite. Three of them have unique fills (armor / health / action /
 * morale / fatigue); the rest fall back to inventory_bar_fill_neutral_127. */

.character-screen-container .stats-module .ui-control.progressbar.armor-head .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.armor-body .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_armor_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

.character-screen-container .stats-module .ui-control.progressbar.hitpoints .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_health_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

.character-screen-container .stats-module .ui-control.progressbar.action-points .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_action_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

.character-screen-container .stats-module .ui-control.progressbar.fatigue .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_fatigue_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

.character-screen-container .stats-module .ui-control.progressbar.morale .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_morale_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}

.character-screen-container .stats-module .ui-control.progressbar.bravery .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.initiative .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.melee-skill .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.range-skill .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.melee-defense .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.range-defense .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.regular-damage .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.crushing-damage .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.chance-to-hit-head .normal-bar,
.character-screen-container .stats-module .ui-control.progressbar.sight-distance .normal-bar
{
    background-image:  url("/bb/images/ui/inventory/inventory_bar_fill_neutral_127.png");
    background-size:   12.7rem 2.2rem;
    background-repeat: no-repeat;
}
