/* THE CASHIER'S RACE BOARD: dogs and horses (Austin, 23 November 2026: "i want to introduce system bet played like
   this with similar user experience on races", then "its too clustered together. can you make use of the dead spaces so
   we can expand the buttons just like theirs", then "Yes, build it"). The board is drawn by web/raceboard.js; the samples
   he chose from are in docs/design/reference/race-system-bet-proposal/.

   EVERY RULE READS A TOKEN of the cashier's own sheets (cashier-ui.css, cashier-dark.css, cashier-navy.css), so light,
   dark and an agent's own look all reach it. The only colours typed here are a runner's own colour (the trap chips, as
   the old picker's were) and the green of Add to slip, which is the green of Place: what a colour MEANS follows nobody.
   No text is under 12px (the counter's floor). */

/* ---- the board ---- */
.rb{padding:10px 12px 8px;display:flex;flex-direction:column;gap:8px}
.rbg{display:grid;grid-template-columns:var(--rb-lab,4.6rem) repeat(var(--n),minmax(0,1fr)) 3.6rem;gap:8px 10px;align-items:stretch}
.rbs{display:grid;grid-template-columns:var(--rb-lab,4.6rem) repeat(var(--m),minmax(0,1fr));gap:8px 10px;align-items:stretch}
.rb[data-many="true"] .rbg{gap:8px 6px;grid-template-columns:4.2rem repeat(var(--n),minmax(0,1fr)) 3.2rem}
.rb[data-many="true"] .rbs{gap:8px 6px}
.rblab{align-self:center;font:800 max(12px,.95rem) var(--disp);letter-spacing:.08em;color:var(--ink);line-height:1.15;text-transform:uppercase}
.rblab i{display:block;font:600 max(12px,.75rem) var(--ui);letter-spacing:0;color:var(--ink3);font-style:normal;text-transform:none}
.rbsep{height:1px;background:var(--line2);opacity:.55}

/* a runner's own colour: the number on every tile */
.rbchip{display:inline-flex;align-items:center;justify-content:center;width:1.7rem;height:1.7rem;border-radius:5px;flex:0 0 auto;
  font:800 max(12px,1.05rem) var(--mono);color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 1px 2px rgba(0,0,0,.35)}
.rb[data-many="true"] .rbchip{width:1.45rem;height:1.45rem;font-size:max(12px,.9rem)}
/* a short board (1280 x 720): a smaller number leaves room for a name of two lines */
.rb[data-tight="true"] .rbchip{width:1.4rem;height:1.4rem;font-size:max(12px,.9rem)}
.rb[data-tight="true"] .rbk .rbt{gap:2px}
.rbchip.t1{background:linear-gradient(180deg,#DB4D3E,#A92B1F)}.rbchip.t2{background:linear-gradient(180deg,#3457C4,#182F7C)}
.rbchip.t3{background:linear-gradient(180deg,#FFFFFF,#D5DCE2);color:#12202B}.rbchip.t4{background:linear-gradient(180deg,#333F4C,#0E151C)}
.rbchip.t5{background:linear-gradient(180deg,#F39A45,#C8650F)}.rbchip.t6{background:linear-gradient(180deg,#9BA7A8,#667273)}
.rbchip.t7{background:#0A7D43}.rbchip.t8{background:#F4C20D;color:#12202B}.rbchip.t9{background:#7D3FBF}
.rbchip.t10{background:#6FC3E8;color:#12324A}.rbchip.t11{background:#8A5A2B}.rbchip.t12{background:#128B8B}

/* a tile: the runner (or the bet's own word) on top, its price in a strip underneath. It is the counter's key
   (.pillodd), so a picked one is the counter's red and a closed one takes no press. */
.pillodd.rbk{position:relative;height:auto;min-height:0;display:flex;flex-direction:column;align-items:stretch;padding:0;overflow:hidden}
.rbk .rbt{height:var(--rb-th);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:0 3px;min-width:0}
.rbk .rbt b{font:800 max(12px,.8rem) var(--disp);text-transform:uppercase;letter-spacing:.02em;color:inherit;max-width:100%;
  text-align:center;line-height:1.08;max-height:2.2em;overflow:hidden}   /* a name takes two lines where one is too narrow */
.rbk .rbt small{font:600 max(12px,.75rem) var(--ui);color:inherit;opacity:.85;text-align:center;line-height:1.1}
/* A NAME IS WHOLE OR IT IS NOT SHOWN (the counter's rule for a game's name, cashier-ui.css stage 5): where one runner's name
   cannot be whole in its tile (twelve horses on a narrow screen) the tiles carry the numbers alone, and the name is in the
   tile's hover text. raceboard.js measures and sets this. */
.rb[data-names="off"] .rbk .rbt b.nm{display:none}
.rbk .rbt b.big{font:800 1.55rem var(--mono);letter-spacing:0}
.rb[data-many="true"] .rbk .rbt{gap:2px}
.rb[data-many="true"] .rbk .rbt b,.rb[data-narrow="true"] .rbk .rbt b.nm{font:700 max(12px,.75rem) var(--ui);text-transform:none;letter-spacing:-.01em;line-height:1.05}
.rb[data-many="true"] .rbk .rbt b.big{font:800 1.2rem var(--mono)}
.rbk .rbpr{height:24px;display:flex;align-items:center;justify-content:center;font:800 1rem var(--mono);letter-spacing:.01em;
  background:linear-gradient(180deg,var(--nv-band-top,var(--deep-top)),var(--nv-band-bot,var(--deep-bot)));color:var(--nv-on-band,#fff)}
html[data-theme="dark"] .rbk .rbpr{background:var(--nv-well,rgba(0,0,0,.46));color:var(--nv-gold,var(--ink))}
.pillodd.rbk[data-sel="true"] .rbchip{box-shadow:0 0 0 2px #fff}
html[data-theme="dark"] .pillodd.rbk[data-sel="true"] .rbpr{color:#fff}   /* gold on a picked tile's strip read at 4:1 */
.rbk .rbfav{position:absolute;top:3px;right:4px;font:800 max(12px,.75rem) var(--disp);letter-spacing:.04em;color:var(--nv-gold,var(--ink2))}
.pillodd.rbk[data-sel="true"] .rbfav{color:inherit}
/* twelve runners: no room for the word beside the number, so the favourite wears a gold edge along the top of its tile */
.rb[data-many="true"] .rbk .rbfav{top:0;left:0;right:0;height:3px;font-size:0;background:var(--nv-gold,var(--ink2))}
/* a row that cannot be picked yet (2nd before 1st, 3rd before 2nd), and a race that takes no bet */
.pillodd.rbk.dim,.pillodd.rball.dim{opacity:.3}
.pillodd.rbk:disabled,.pillodd.rball:disabled{opacity:.45;cursor:not-allowed}
.pillodd.rball{height:auto;min-height:0;padding:0;font:800 max(12px,.8rem) var(--disp);letter-spacing:.06em}
.rbtabs{display:flex;gap:6px;align-items:center;flex-wrap:wrap;min-height:34px}
.rbtabs .mpill{margin:0;font-size:max(12px,.9rem)}
.rbhint{margin-left:auto;font:600 max(12px,.8rem) var(--ui);color:var(--ink2)}

/* ---- what the picks make, on the slip's side, with the button that puts them on the slip ---- */
.rbpend{margin:6px 8px 4px;padding:9px 10px 10px;border-radius:8px;border:1px solid var(--nv-gold,var(--line2));
  background:linear-gradient(180deg,rgba(245,194,66,.20),rgba(245,194,66,.07));display:flex;flex-direction:column;gap:5px}
.rbpend .t{display:flex;align-items:center;justify-content:space-between;gap:8px}
.rbpend .t b{font:800 1.05rem var(--disp);color:var(--ink)}
.rbpend .t .v{font:800 1.25rem var(--mono);color:var(--ink);white-space:nowrap}
.rbpend .t .v small{font:600 max(12px,.75rem) var(--ui);color:var(--ink3);margin-right:5px}
.rbpend i{font:600 max(12px,.78rem) var(--ui);font-style:normal;color:var(--ink2);line-height:1.3}
.rbpend .c{font:600 max(12px,.78rem) var(--ui);color:var(--ink2)}
.rbpend .c b{font:800 1rem var(--mono);color:var(--ink);margin-right:6px}
.rbpend .b{display:flex;gap:8px;margin-top:3px}
/* its two buttons are their own, not the counter's price key: Add to slip is the green of Place, and a key's dress would repaint it */
.rbbtn{height:2.7rem;border-radius:var(--r2,6px);border:1px solid var(--line2);cursor:pointer;
  font:800 max(12px,.85rem) var(--disp);letter-spacing:.06em;text-transform:uppercase;
  background:linear-gradient(180deg,var(--key-top),var(--key-bot));color:var(--ink)}
.rbbtn.go{flex:1;background:linear-gradient(180deg,#15803D,#0F6630);border-color:#0A4F25;color:#fff}   /* white reads at 5:1 on the paler end */
.rbbtn.no{flex:0 0 5.2rem}
.rbbtn:disabled{opacity:.45;cursor:not-allowed}
.rbbtn:focus-visible{outline:2px solid var(--nv-gold,var(--ink));outline-offset:2px}

/* ---- every line of a race slip has its own stake box (rbStakeCell): a tap opens the number pad ---- */
table.seltab td.stk{width:1%;padding:.14rem .3rem .14rem 0;text-align:right}
table.seltab td.stk input{width:4.4rem;max-width:100%;box-sizing:border-box;text-align:right;cursor:pointer;
  border:1.5px solid var(--line2);border-radius:var(--r1,6px);padding:.2rem .4rem;background:var(--panel);color:var(--ink);
  font:700 max(12px,.88rem) var(--mono)}
table.seltab td.stk input:hover,table.seltab td.stk input:focus-visible{border-color:var(--acc3);outline:none;box-shadow:0 0 0 3px var(--accdim)}
/* a line whose stake was typed on the line itself, and so differs from the slip's own box */
table.seltab td.stk input[data-own="true"]{border-color:var(--nv-gold,var(--acc3))}
/* lines all on one race: the race is said once above them (rbSlipHead) and the Event ID column is not shown */
table.seltab[data-rs="one"] th:first-child,table.seltab[data-rs="one"] td.ev{display:none}
table.seltab caption{caption-side:top;text-align:left;padding:.3rem .55rem .25rem;font:800 max(12px,.8rem) var(--disp);
  letter-spacing:.06em;text-transform:uppercase;color:var(--ink2)}
table.seltab caption[hidden]{display:none}
table.seltab[data-rs] td.sel{text-align:left}
table.seltab td.sel .nb{white-space:nowrap}

