/* BackgammonX v0.2.6 — 07-player-status.css — TX-STYLE FIXED RAILS REV 1
   Two compact, TX-styled rails inside the fixed play-area shell, outside
   the rotating board stage. Presentation only.

   v0.2.6 CHANGE (this pass): the v0.2.3 design had ONE rail per PLAYER
   (Blue's rail showing both its BAR and OFF stats, Red's rail the same),
   using large-ish typography (.bgx-inline-* rules, now deleted below).
   The owner's TX reference instead organizes by STAT-TYPE: one "BORNE
   OFF" rail (both players together) at the top, one "BAR / CAPTURED"
   rail (both players together) at the bottom — visually smaller/lighter
   throughout (heading 8px, player name 11px, value 11px — the v0.2.3
   rule this replaces used no heading at all and 14px/12px for name/
   value). See Bv0.2.6.html for the matching markup change and
   CLAUDE-COMPLETION-REPORT.txt for the full before/after. `.bgx-play-
   area-shell`, `.bgx-board-rotation-stage` and the `.board-frame` border
   suppression below are UNCHANGED from v0.2.3 — still the same "one
   visible rounded box, rails overlaid flush against its inside top/
   bottom edge" architecture that pass established; only the rails'
   OWN internal layout and sizing changed. */

:root { --bgx-css-07: 1; }

.board-column {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.bgx-play-area-shell {
  width: 100%;
  /* v0.2.12 §A — desktop max-width raised 720px -> 1280px (the handoff's
     own suggested desktop max), so the shell can fill the much wider
     board column .app-main now allows (css/01) on large viewports. This
     is an UPPER BOUND only: at any viewport where the board column
     itself is narrower than the cap, the shell simply fills that column
     at its actual (smaller) width. Tablet (<=1023px, 560px) and phone
     (<=639px, 100%) breakpoints below are UNCHANGED, per the handoff's
     own "tablet/phone remain as they are" instruction.

     v0.2.22 — the cap is now a FLAT 2400px, not min(2400px, calc(100vw -
     320px)). The "- 320px" term approximated "the board column's real
     available width" for the pre-v0.2.22 2-column .app-main grid, where
     a 280px side panel + gaps really did eat roughly that much of the
     viewport on every desktop breakpoint. v0.2.22's page-sections stack
     (css/14-section-stack.css) replaced that grid: .board-column no
     longer shares horizontal space with a side panel at all, and is
     already capped by the stack's own 1060px max-width several levels
     up. Subtracting a now-nonexistent panel's width from the raw
     viewport stopped approximating the column's real available width —
     at some desktop/tablet widths it UNDER-estimated it (clamping the
     shell narrower than its own column, below), which is exactly the
     "upper bound only" invariant this comment has always promised.
     Dropping the viewport term and keeping a flat ceiling restores that
     invariant: the real limit is once again simply "whatever the column
     actually provides," exactly as originally intended. */
  max-width: 2400px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: rgba(5, 9, 12, 0.18);
  border: 1px solid rgba(184, 145, 45, 0.16);
  border-radius: 14px;
  position: relative;
  overflow: hidden;   /* a rail's square corners can never visually poke past the shell's own rounded corner */
}

.bgx-board-rotation-stage {
  width: 100%;
  display: grid;
  place-items: center;
  transform-origin: center center;
}

.bgx-play-area-shell .board-frame {
  width: 100%;
  max-width: none;
  border-color: transparent;   /* suppresses the second, inner rounded outline so only the shell's own border reads as "the" rounded box */
}

/* ── the two rails ──────────────────────────────────────────────────
   Absolutely positioned inside the shell, overlaid flush against its
   top/bottom inside edge (unchanged mounting model from v0.2.3) —
   outside .bgx-board-rotation-stage, so the board rotation transform
   (whenever it is added) can never reach them. z-index 40 keeps them
   above every board content layer (checker-layer/geometry-calibration-
   layer sit at z-index 1-2, see this file's own selectors further down
   for the off-preview-layer rule's removal note). */
.bgx-rail {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;   /* centers via auto margins, not transform — keeps `transform` permanently unset, so nothing can ever compose a rotation onto a rail */
  /* v0.2.12 §A — cap raised 460px -> 820px, preserving roughly the same
     92%-of-shell / fixed-cap RATIO the v0.2.6 design established
     (460/720 ~= 0.64; 820/1280 ~= 0.64) so the rail grows visually
     proportionate to the much larger shell/board rather than staying a
     tiny strip across a huge board — while every typography rule below
     (heading 8px, name/value 11px) is completely UNCHANGED, per the
     handoff's own explicit "do not enlarge typography 2x" instruction. */
  width: min(95%, 1280px);
  box-sizing: border-box;
  padding: 3px 9px 4px;
  background: linear-gradient(180deg, rgba(10,13,19,.96), rgba(4,7,11,.96));
  border: 1px solid rgba(180,145,55,.30);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 2px 6px rgba(0,0,0,.22);
  color: #f2f4f7;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.15;
  overflow: hidden;
  z-index: 40;
  pointer-events: none;
  transform: none !important;   /* unchanged guarantee from v0.2.3: nothing can ever visually rotate a rail */
}
.bgx-rail-off { top: 6px; }
.bgx-rail-bar { bottom: 6px; }

.bgx-rail-heading {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(216, 180, 106, 0.85);   /* subtle BGX gold, matching the shell's own accent color */
  border-bottom: 1px solid rgba(180, 145, 55, 0.22);
  padding-bottom: 2px;
  margin-bottom: 3px;
}

.bgx-rail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

/* v0.2.12 §B — .bgx-rail-cell becomes a small column: the existing
   text line (name — value[/15]) stays exactly as it was, now wrapped
   in its own .bgx-rail-cell-text row below, with the checker markers
   as a second row underneath. This is the ONLY reason
   .bgx-rail-cell-text exists — every rule that used to live directly
   on .bgx-rail-cell for the inline name/dash/value/denom layout moved
   there unchanged (same gap, same align-items:baseline, same font-
   size). */
.bgx-rail-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
}
.bgx-rail-cell-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

/* Compact, presentation-only checker markers — one per checker,
   BoardState.bar[side]/off[side]-driven (js/20-player-status.js).
   pointer-events:none (§B: "the existing rail CELL remains the Bar
   source / borne-off destination interaction affordance", never these
   markers). Overlapping fan layout (negative margin-left on every
   marker after the first) keeps a FIXED row height regardless of count
   — up to 15 markers stay inside one compact row rather than wrapping
   and growing the rail taller, satisfying "compact enough to fit the
   approved rails" / "controlled overlap/compression... for higher
   counts" directly. Never hides the numeric count above it — that text
   row is completely untouched. */
.bgx-rail-checkers {
  display: flex;
  align-items: center;
  height: var(--bgx-rail-marker-size, 9px);
  pointer-events: none;
}
.bgx-rail-checker {
  width: var(--bgx-rail-marker-size, 9px);
  height: var(--bgx-rail-marker-size, 9px);
  border-radius: 50%;
  flex: 0 0 auto;
  box-sizing: border-box;
  box-shadow: inset -1px -1px 1.5px rgba(0, 0, 0, 0.45), inset 1px 1px 1px rgba(255, 255, 255, 0.35), 0 0.5px 1px rgba(0, 0, 0, 0.5);
  /* v0.2.19 PATCH-4 §2 — border-width now matches css/06's own
     in-play .checker-p1/.checker-p2 border (1.5px, was 0.5px). The
     OUTER diameter already matched exactly (both read the same
     --bgx-rail-marker-size / --checker-size percentage against the
     same board width), confirmed directly via getBoundingClientRect()
     at every required breakpoint before this change — but a 3x
     thinner border still visibly eats less into the coloured fill
     area than the in-play checker's own border does, which reads as
     a real, if subtle, size mismatch even with an identical outer
     edge. box-sizing:border-box (added above) keeps the OUTER
     diameter exactly where syncRailMarkerSize() and js/18's own
     --checker-size already place it — only the border's own share of
     that fixed outer box changes, matching css/06 exactly rather than
     inventing any new size constant. */
  border: 1.5px solid rgba(0, 0, 0, 0.4);
}
/* v0.2.19 PATCH-1 §8 — per-colour border overrides, same reasoning and
   same tokens as css/06's own checker borders: black/white specifically
   need a border calibrated for contrast against the board itself, not
   the generic dark edge every other colour can share. */
.bgx-rail-checkers-blue .bgx-rail-checker { border-color: var(--bgx-p1-border, rgba(0, 0, 0, 0.4)); }
.bgx-rail-checkers-red  .bgx-rail-checker { border-color: var(--bgx-p2-border, rgba(0, 0, 0, 0.4)); }
/* v0.2.19 §D — markers now match the REAL rendered in-play checker
   diameter (js/20's own syncRailMarkerSize(), a measured pixel value
   published as --bgx-rail-marker-size, with a 9px fallback for the
   brief window before first measurement) rather than a fixed 9px/8px.
   Since that diameter is now typically much larger than the old fixed
   size (a checker is a meaningful fraction of the board's own width),
   the overlap between stacked markers scales proportionally too —
   the same ~44% overlap ratio the original fixed 4px/9px design used
   — so up to 15 markers stay compact and contained rather than
   spreading past the rail cell at the new, larger marker size. */
.bgx-rail-checker + .bgx-rail-checker { margin-left: calc(var(--bgx-rail-marker-size, 9px) * -0.44); }
/* v0.2.19 §E — driven by the player's own colour choice; the class
   names (.bgx-rail-checkers-blue/-red, matching each rail cell's own
   -blue/-red suffix) stay as stable DOM hooks per the handoff's own
   explicit allowance ("backward-compatible DOM IDs/classes may remain
   temporarily") — P1/P2 is the authoritative identity, expressed here
   via the --bgx-p1-... and --bgx-p2-... custom properties js/24 sets, with the
   ORIGINAL blue/red values as fallbacks. -blue is always P1's own
   rail cell, -red always P2's, regardless of which of the 5 colours
   that player actually chose. */
.bgx-rail-checkers-blue .bgx-rail-checker { background: radial-gradient(circle at 32% 28%, var(--bgx-p1-light, #bfe0ff), var(--bgx-p1-mid, #62b5ff) 55%, var(--bgx-p1-dark, #2c74ad) 100%); }
.bgx-rail-checkers-red  .bgx-rail-checker { background: radial-gradient(circle at 32% 28%, var(--bgx-p2-light, #ffc2c8), var(--bgx-p2-mid, #ff6675) 55%, var(--bgx-p2-dark, #b8323e) 100%); }

.bgx-rail-name { font-weight: 700; white-space: nowrap; }
/* v0.2.19 PATCH-2 §C — the rail name is NEUTRAL, accessible text ("P1 —
   Blue" / "P2 — Black" ...). Patch 1 coloured the text itself with the
   player's mid tone, which measured ~1.6:1 for Black on these always-
   dark rails. Ownership is carried by the P1/P2 text; the colour is
   shown by the checker markers beside it (whose own edges are the
   contrasting per-colour border tokens) — never by text colour alone. */
.bgx-rail-blue .bgx-rail-name,
.bgx-rail-red .bgx-rail-name { color: #f2f4f7; }

.bgx-rail-dash { color: rgba(220, 226, 235, 0.42); }

.bgx-rail-value {
  margin-left: auto;
  color: rgba(225, 231, 240, 0.86);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.bgx-rail-denom {
  color: rgba(220, 226, 235, 0.72);   /* v0.2.19 PATCH-2 §C: was 0.42 (3.3:1); now >=4.5:1 on the always-dark rail */
  font-size: 9.5px;
  margin-left: 1px;
}

/* subtle highlight while a player actually has a checker on the bar —
   same "has-bar" signal v0.2.3 had, now scoped to that cell within the
   bottom rail specifically (js/20-player-status.js toggles this class). */
.bgx-rail-bar .bgx-rail-cell.bgx-has-bar .bgx-rail-name,
.bgx-rail-bar .bgx-rail-cell.bgx-has-bar .bgx-rail-value {
  color: rgba(255, 220, 120, 0.96);
}

@media (max-width: 1023px) {
  .bgx-play-area-shell { max-width: 760px; padding: 7px; }
  .bgx-rail { width: min(94%, 560px); padding: 3px 8px 3px; }
  .bgx-rail-off { top: 5px; }
  .bgx-rail-bar { bottom: 5px; }
  .bgx-rail-heading { font-size: 7.5px; }
  .bgx-rail-cell { font-size: 10.5px; }
  .bgx-rail-cell-text { gap: 4px; }
  .bgx-rail-row { gap: 10px; }
}

@media (max-width: 639px) {
  .bgx-play-area-shell { max-width: 100%; padding: 6px; }
  .bgx-rail { width: 96%; padding: 3px 7px 3px; }
  .bgx-rail-off { top: 4px; }
  .bgx-rail-bar { bottom: 4px; }
  .bgx-rail-heading { font-size: 7px; letter-spacing: 0.8px; }
  .bgx-rail-cell { font-size: 10px; }
  .bgx-rail-cell-text { gap: 3px; }
  .bgx-rail-row { gap: 8px; }
  .bgx-rail-denom { font-size: 9px; }
  /* v0.2.19 §D — .bgx-rail-checker/.bgx-rail-checkers no longer need a
     fixed override here: --bgx-rail-marker-size (js/20) already tracks
     the real rendered checker diameter continuously at every width,
     phone included, so a separate fixed 8px value would now be WRONG
     rather than merely redundant. */
}
