/* Keno 80 — the play area's own components, and nothing else.
 *
 * BUILT THE WAY KENO 40 IS BUILT (kenoboard.css), because it opens the same
 * way: not a page the terminal navigates to, but a game it opens inside its
 * own shell — same top bar, same jackpot line, same draw boxes, only the
 * board in the middle changes.
 *
 * WHERE THE TERMINAL ALREADY HAS A COMPONENT, KENO 80 USES IT. The draw
 * boxes are the same .wk boxes Dogs uses for races, the market tabs are
 * .mpill, the round bar is .roundbar, a price is .pillodd. Only the parts
 * this game alone has — the eighty-number grid and its last-draw strip — get
 * CSS, and every one is prefixed k8- so it can never reach another game's
 * markup, not even Keno 40's.
 *
 * THE BOARD IS EIGHT COLOURS AND TEN COLUMNS, where Keno 40's is four
 * colours and five. A number's colour is (n-1) mod 8, so a row of ten runs
 * through every colour once and the eye can find a column by its stripe.
 *
 * cashier-ui.css and shop-screen.css are frozen. This file rides on top of
 * them and is loaded after, so anything here that shares a name loses to
 * specificity rather than to edit order — hence the prefix on everything.
 */

:root{
  /* the eight ball colours, in the order (n-1) mod 8 walks them.
     THESE ARE THE COUNTER'S, NOT THE WALL'S: keno80tv.html paints brighter
     ones because they sit on navy, and these sit on a pale board. */
  --k8-z0:#D6453D;  /* Red    */
  --k8-z1:#2E9E5B;  /* Green  */
  --k8-z2:#2B62C4;  /* Blue   */
  --k8-z3:#7B3FBF;  /* Purple */
  --k8-z4:#8A5A3C;  /* Brown  */
  --k8-z5:#E9A825;  /* Yellow */
  --k8-z6:#E8762B;  /* Orange */
  --k8-z7:#2B2F36;  /* Black  */
  --k8-navy:#0F2A3B;
  --k8-line:#DDE5EB;
  --k8-line2:#C6D3DC;
  --k8-panel2:#F6F9FB;
  --k8-ink:#10303F;
  --k8-mute:#5C7484;
  --k8-dim:#93A6B3;
  --k8-accent:#1F6F8B;
  --k8-pill-b:#8CC7D8;
  --k8-pill-h:#CDEFF8;
  --k8-pill-off:#E4EAEE;
  --k8-mono:var(--mono);
}

.k8-z0{--k8-zc:var(--k8-z0)}
.k8-z1{--k8-zc:var(--k8-z1)}
.k8-z2{--k8-zc:var(--k8-z2)}
.k8-z3{--k8-zc:var(--k8-z3)}
.k8-z4{--k8-zc:var(--k8-z4)}
.k8-z5{--k8-zc:var(--k8-z5)}
.k8-z6{--k8-zc:var(--k8-z6)}
.k8-z7{--k8-zc:var(--k8-z7)}

/* ---------- the last-draw strip ---------- */

.k8-lastrow{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px;
  min-height:46px; padding:6px 12px;
  background:var(--k8-panel2); border-bottom:1px solid var(--k8-line);
  font-family:var(--k8-mono);
}
.k8-lastrow .k8-cap{
  color:var(--k8-accent); white-space:nowrap; font-size:12px;
  letter-spacing:1.4px; text-transform:uppercase; font-weight:600;
}
.k8-balls{display:flex; gap:4px; flex-wrap:wrap}
.k8-ball{
  width:25px; height:25px; border-radius:50%; display:grid; place-items:center;
  font-family:var(--k8-mono); font-weight:700; font-size:12px; color:var(--on-strong,#FFFFFF);
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.55) 0 12%, rgba(255,255,255,0) 42%),
    var(--k8-zc,#8299A8);
  box-shadow:inset 0 -2px 4px rgba(0,0,0,.28);
}
/* yellow and orange need dark type or the number disappears */
.k8-ball.k8-z5,.k8-ball.k8-z6{color:#3A2A00}
.k8-facts{display:flex; gap:12px; flex-wrap:wrap; font-size:12px; color:var(--k8-mute)}
.k8-facts b{color:var(--k8-ink)}

/* ---------- the number board ---------- */

.k8-board{
  display:grid; grid-template-columns:minmax(0,1fr) 352px;
  align-items:stretch; min-height:100%;
}
.k8-gridwrap{padding:10px 12px 12px; min-width:0}

.k8-ntbl{width:100%; border-collapse:separate; border-spacing:0 5px}
.k8-ntbl th{
  font-size:11px; font-weight:700; color:var(--k8-mute);
  text-align:center; height:22px; letter-spacing:.4px;
}
.k8-ntbl th.k8-first{
  text-align:left; padding-left:8px; font-family:var(--k8-mono);
  font-size:11px; letter-spacing:1.4px; text-transform:uppercase;
}
.k8-ntbl td{padding:0 2px; text-align:center}
.k8-ntbl td.k8-first{text-align:left; padding-left:8px; white-space:nowrap; width:78px}
.k8-rl{font-family:var(--k8-mono); font-size:11.5px; color:var(--k8-mute); font-weight:600}
.k8-rl b{color:var(--k8-ink)}

/* a number on the grid. The 5px left stripe is the colour, so a punter
   reading a selection back can see which colours they are on without
   counting. Ten to a row, so it is a shade tighter than Keno 40's five. */
.k8-num{
  position:relative; display:inline-grid; place-items:center;
  width:100%; height:38px;
  border:1px solid var(--k8-pill-b); border-left:5px solid var(--k8-zc);
  border-radius:8px; background:linear-gradient(var(--t-c6e8f3,#C6E8F3),#AEDDEC);
  font-family:var(--k8-mono); font-weight:700; font-size:17px;
  color:var(--k8-ink); cursor:pointer;
}
.k8-num:hover{background:var(--k8-pill-h)}
.k8-num[aria-pressed="true"]{
  background:var(--k8-navy); border-color:var(--k8-navy);
  border-left-color:var(--k8-zc); color:var(--on-strong,#FFFFFF);
}
/* came out in the last draw */
.k8-num.k8-hit::after{
  content:""; position:absolute; right:5px; top:5px;
  width:6px; height:6px; border-radius:50%;
  background:var(--k8-zc); box-shadow:0 0 0 2px #fff;
}
.k8-num[aria-pressed="true"].k8-hit::after{box-shadow:0 0 0 2px var(--k8-navy)}
.k8-num:disabled{
  background:var(--k8-pill-off); border-color:var(--k8-line2);
  border-left-color:var(--k8-line2); color:var(--k8-dim); cursor:not-allowed;
}

.k8-legend{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  padding:4px 8px 0; font-size:11px; color:var(--k8-mute); font-weight:600;
}
.k8-legend i{
  display:inline-block; width:10px; height:10px; border-radius:3px;
  background:var(--k8-zc); margin-right:4px; vertical-align:-1px;
}
.k8-legend .k8-hitx{margin-left:auto}
.k8-legend .k8-hitx i{border-radius:50%; background:var(--k8-navy)}

/* ---------- the side card: what the board says about a selection ---------- */

.k8-side{
  border-left:1px solid var(--k8-line); background:var(--k8-panel2);
  padding:12px; display:flex; flex-direction:column; gap:10px; min-width:0;
}
.k8-side h3{
  margin:0; font-size:12px; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--k8-accent); font-family:var(--k8-mono); font-weight:600;
}
.k8-chosen{display:flex; gap:4px; flex-wrap:wrap; min-height:26px}
.k8-chosen .k8-empty{font-size:12px; color:var(--k8-mute); font-weight:600}
/* FIXED COLUMNS, so the money lines up down the whole tab. Each family is its
   own table, and left to themselves they each picked their own widths — a
   cashier reading prices down a screen should not have to find the column
   again at every heading. */
.k8-ptbl{width:100%; border-collapse:collapse; font-size:12.5px; table-layout:fixed}
.k8-ptbl td:first-child,.k8-ptbl th:first-child{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.k8-ptbl td.k8-m,.k8-ptbl th:nth-child(2){width:96px}
.k8-ptbl td.k8-c,.k8-ptbl th:nth-child(3){width:82px}
.k8-ptbl th{
  text-align:left; font-size:10.5px; letter-spacing:1.2px; text-transform:uppercase;
  color:var(--k8-mute); font-weight:700; padding:3px 6px;
  border-bottom:1px solid var(--k8-line);
}
.k8-ptbl td{padding:3px 6px; border-bottom:1px solid var(--k8-line)}
.k8-ptbl td.k8-m{
  text-align:right; font-family:var(--k8-mono); font-weight:700; color:var(--k8-ink);
}
.k8-ptbl td.k8-m.k8-best{color:var(--k8-accent)}
.k8-ptbl td.k8-c{text-align:right; font-size:11px; color:var(--k8-mute)}
.k8-note{font-size:11.5px; color:var(--k8-mute); line-height:1.45}
.k8-note b{color:var(--k8-ink)}

/* THE BOARD DOES NOT SELL. This screen is the board alone — the numbers, the
   prices and the last draw — and the slip down the right belongs to whatever
   game the counter was on. Saying so is better than a dead Add button. */
.k8-noslip{
  margin-top:auto; padding:8px 10px; border-radius:8px;
  background:var(--t-fbf3de,#FBF3DE); border:1px solid #E3CE8F;
  font-size:11.5px; color:#7A5C12; font-weight:600; line-height:1.45;
}

.k8-qp{display:flex; gap:4px; align-items:center; flex-wrap:wrap; padding:10px 8px 0}
.k8-qp .k8-cap{
  font-family:var(--k8-mono); font-size:11px; letter-spacing:1.2px;
  text-transform:uppercase; color:var(--k8-mute); margin-right:4px;
}
.k8-qp button{
  min-width:30px; height:26px; padding:0 7px; border-radius:7px;
  border:1px solid var(--k8-pill-b); background:var(--plate,#FFFFFF);
  font-family:var(--k8-mono); font-weight:700; font-size:12px;
  color:var(--k8-ink); cursor:pointer;
}
.k8-qp button:hover{background:var(--k8-pill-h)}
.k8-qp button.k8-clr{border-color:var(--k8-line2); color:var(--k8-mute)}

/* A SHORT COUNTER (15 November 2026, QA on #895). The board is eight rows of numbers and it did not give: at 1024x768 and 1280x720, once a draw had
   been played and the last-draw strip above it had grown to two lines, "Add to slip" and the quick-pick row sat below the bottom of the screen. Master
   was a few pixels short there already; the tab row kept at one height on every game (so the board does not hop) took another 33 to 36px and made it
   plain. On a screen 800px tall or less AND 1300px wide or less (1366x768 always fitted and is left exactly as it was) the board is drawn a little tighter: a number is 33px tall (it was 38; the press target is 33 by about 40 wide,
   over the 30px floor for a dense grid), the rows sit 3px apart (5), and the padding round the grid closes up. About 66px in all, and nothing else on
   the board changes size. */
@media (max-height:800px) and (max-width:1300px){
  .k8-num{height:33px}
  .k8-ntbl{border-spacing:0 3px}
  .k8-ntbl th{height:18px}
  .k8-gridwrap{padding:6px 12px 6px}
  .k8-side{padding-top:8px; padding-bottom:8px; gap:8px}
  /* THE LAST-DRAW DOT GOES INTO THE CORNER, above the digits (QA on #895). It stayed 5px from the top of a button that is now 33px tall, and at 1024
     wide, where a number is 28px across, it sat on the last digit of every lit number (17, 19, 28 ...). Tucked into the corner and a pixel smaller,
     with a thinner ring, it clears the top of the digits on every number at 1024x768 and 1280x720 (tools/terminal/screen_keno80_hit_dot.py). */
  .k8-num.k8-hit::after{top:1px; right:2px; width:5px; height:5px; box-shadow:0 0 0 1.5px #fff}
  .k8-num[aria-pressed="true"].k8-hit::after{box-shadow:0 0 0 1.5px var(--k8-navy)}
}
/* "ends in 1" on one line where the column has room for it: the .4px between letters was what broke it onto two at 1280 wide in Inter */
.k8-ntbl th:not(.k8-first){letter-spacing:0}

/* the panes fill the board area and scroll on a short screen, exactly as
   Keno 40's do */
body[data-keno80="true"] .k8-panes{flex:1; min-height:0; overflow:auto}

/* A PRICE IS A BUTTON. The terminal's own rule — "click on the odds to add
   your selections" — applies to this board too, so a price a cashier can
   take looks different from one they cannot. */
.k8-ptbl td.k8-buy{
  cursor:pointer; border-radius:6px;
  background:linear-gradient(var(--t-c6e8f3,#C6E8F3),#AEDDEC);
  box-shadow:inset 0 0 0 1px var(--k8-pill-b);
}
.k8-ptbl td.k8-buy:hover{background:var(--k8-pill-h)}
.k8-ptbl td.k8-buy:active{background:var(--k8-navy); color:var(--on-strong,#FFFFFF)}

/* the Add button under the pick card, the same one Keno 40 uses */
.k8-side .kn-add{margin-top:auto}
/* a press target of at least 32px (cashier upgrade, slice 4); the picture stays as it was */
.k8-qp button{position:relative}
.k8-qp button::before{content:""; position:absolute; inset:-3px; border-radius:inherit}
