/* Keno 40 — the play area's own components, and nothing else.
 *
 * WHERE THE TERMINAL ALREADY HAS A COMPONENT, KENO 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, a group heading is #grphead .g.
 * Only the parts Keno alone has — the number grid, the pick card, the
 * last-draw strip, the bingo board — get CSS, and every one is prefixed kn-
 * so it can never reach another game's markup.
 *
 * 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 four zone colours, used by balls, stripes, swatches and bingo cells */
  --kn-z0:#D6453D;  /* Red    1-10  */
  --kn-z1:#2B62C4;  /* Blue   11-20 */
  --kn-z2:#2E9E5B;  /* Green  21-30 */
  --kn-z3:#E9A825;  /* Yellow 31-40 */
  --kn-navy:#0F2A3B;
  --kn-navy2:#173B50;
  --kn-line:#DDE5EB;
  --kn-line2:#C6D3DC;
  --kn-panel2:#F6F9FB;
  --kn-ink:#10303F;
  --kn-mute:#5C7484;
  --kn-dim:#93A6B3;
  --kn-accent:#1F6F8B;
  --kn-accent2:#6FC3DA;
  --kn-pill-b:#8CC7D8;
  --kn-pill-h:#CDEFF8;
  --kn-pill-off:#E4EAEE;
  --kn-gold:#C4912A;
  --kn-tabon:#CFEAF5;
}

.kn-z0{--kn-zc:var(--kn-z0)}
.kn-z1{--kn-zc:var(--kn-z1)}
.kn-z2{--kn-zc:var(--kn-z2)}
.kn-z3{--kn-zc:var(--kn-z3)}

/* ---------- the last-draw strip (§1.4) ---------- */

.kn-lastrow{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px;
  min-height:46px; padding:6px 12px;
  background:var(--kn-panel2); border-bottom:1px solid var(--kn-line);
  font-family:var(--mono);
}
.kn-lastrow .kn-cap{
  color:var(--kn-accent); white-space:nowrap; font-size:12px;
  letter-spacing:1.4px; text-transform:uppercase; font-weight:600;
}
.kn-balls{display:flex; gap:4px; flex-wrap:wrap}
.kn-ball{
  width:25px; height:25px; border-radius:50%; display:grid; place-items:center;
  font-family:var(--mono);
  font-weight:700; font-size:12px; color:var(--on-strong,#FFFFFF);
  /* the same lit sphere the TV paints, at counter size: glint, sheen, the
     light bouncing back off the far edge, then the body shading to its rim.
     The zone class already carries the colour in --kn-zc. */
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.9) 0, rgba(255,255,255,.3) 12%, rgba(255,255,255,0) 30%),
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.45) 0, rgba(255,255,255,.08) 36%, rgba(255,255,255,0) 60%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.26) 0, rgba(255,255,255,0) 46%),
    radial-gradient(circle at 50% 112%, rgba(0,0,0,.45) 0, rgba(0,0,0,0) 62%),
    var(--kn-zc, var(--kn-navy));
  box-shadow:
    inset 0 -2px 4px rgba(0,0,0,.32),
    inset 0 1px 2px rgba(255,255,255,.5),
    0 1px 2px rgba(0,0,0,.35);
  text-shadow:0 1px 1px rgba(0,0,0,.4);
  flex:0 0 auto;
}
.kn-ball.kn-z3{color:#3A2A00; text-shadow:0 1px 1px rgba(255,255,255,.45)}
.kn-ball.kn-pop{animation:kn-pop .25s ease-out}
@keyframes kn-pop{from{transform:scale(.3);opacity:0} to{transform:scale(1);opacity:1}}
@media (prefers-reduced-motion:reduce){ .kn-ball.kn-pop{animation:none} }

.kn-facts{
  display:flex; flex-wrap:wrap; gap:6px 12px; margin-left:auto;
  font-size:12px; color:var(--kn-mute); white-space:nowrap;
  font-family:inherit;
}
.kn-facts b{font-family:var(--mono); color:var(--kn-ink)}
.kn-facts .kn-row-hit{color:var(--kn-gold); font-weight:700; letter-spacing:1px}

/* ---------- the number board (§2) ---------- */

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

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

/* a number on the grid. The 5px left stripe is the zone colour, so a punter
   reading a selection back can see which colours they are on without
   counting. */
.kn-num{
  position:relative; display:inline-grid; place-items:center;
  width:100%; height:42px;
  border:1px solid var(--kn-pill-b); border-left:5px solid var(--kn-zc);
  border-radius:9px; background:linear-gradient(var(--t-c6e8f3,#C6E8F3),#AEDDEC);
  font-family:var(--mono);
  font-weight:700; font-size:20px; color:var(--kn-ink);
  cursor:pointer;
}
.kn-num:hover{background:var(--kn-pill-h)}
.kn-num[aria-pressed="true"]{
  background:var(--kn-navy); border-color:var(--kn-navy);
  border-left-color:var(--kn-zc); color:var(--on-strong,#FFFFFF);
}
/* the two numbers Neighbours adds for you */
.kn-num.kn-nb{background:var(--t-fbf3de,#FBF3DE); border-color:var(--kn-gold); color:var(--kn-gold)}
/* came out in the last draw */
.kn-num.kn-hit::after{
  content:""; position:absolute; right:6px; top:6px;
  width:7px; height:7px; border-radius:50%;
  background:var(--kn-zc); box-shadow:0 0 0 2px #fff;
}
.kn-num[aria-pressed="true"].kn-hit::after{box-shadow:0 0 0 2px var(--kn-navy)}
.kn-num:disabled{
  background:var(--kn-pill-off); border-color:var(--kn-line2);
  border-left-color:var(--kn-line2); color:var(--kn-dim); cursor:not-allowed;
}

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

.kn-qp{display:flex; gap:4px; align-items:center; flex-wrap:wrap; padding:10px 8px 0}
.kn-qp .kn-cap{
  color:var(--kn-mute); margin-right:6px; font-size:12px; font-weight:600;
  font-family:var(--mono);
  letter-spacing:1.4px; text-transform:uppercase;
}
.kn-qp button{
  width:34px; height:32px; border:1px solid var(--kn-line2); border-radius:8px;
  background:var(--plate,#FFFFFF); font-family:var(--mono);
  font-weight:700; font-size:14px; color:var(--kn-ink); cursor:pointer;
}
.kn-qp button:hover{border-color:var(--kn-accent2); background:var(--t-e9f6fa,#E9F6FA)}
.kn-qp button.kn-clr{
  width:auto; padding:0 10px; color:var(--kn-mute);
  font-family:inherit; font-weight:600; font-size:12px; letter-spacing:0;
  text-transform:none;
}

/* ---------- the pick card (§2.2) ---------- */

.kn-card{
  border-left:1px solid var(--kn-line); display:flex; flex-direction:column;
  background:var(--kn-panel2); min-width:0;
}
.kn-ch{
  display:flex; align-items:baseline; justify-content:space-between;
  height:44px; padding:0 14px; background:var(--kn-navy2); color:var(--on-strong,#FFFFFF);
  position:sticky; top:0; z-index:2;
}
.kn-ch h3{
  margin:0; font-family:var(--mono);
  font-weight:700; font-size:15px; letter-spacing:1.8px; text-transform:uppercase;
}
.kn-ch .kn-cnt{
  font-family:var(--mono);
  font-size:13px; color:#CFE3EC;
}
.kn-chosen{
  display:flex; flex-wrap:wrap; gap:4px; min-height:52px; padding:10px 14px;
  align-items:center; background:var(--plate,#FFFFFF); border-bottom:1px solid var(--kn-line);
}
.kn-chosen .kn-empty{font-size:12.5px; color:var(--kn-dim)}
.kn-note{
  padding:8px 14px; font-size:12.5px; color:var(--kn-mute);
  border-bottom:1px solid var(--kn-line);
}
.kn-note b{color:var(--kn-ink)}

.kn-ladder{width:100%; border-collapse:collapse; background:var(--plate,#FFFFFF)}
.kn-ladder th{
  font-family:var(--mono);
  font-size:10.5px; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--kn-mute); text-align:left; padding:7px 14px;
  border-bottom:1px solid var(--kn-line); font-weight:600;
}
.kn-ladder td{
  padding:8px 14px; border-bottom:1px solid var(--kn-line); font-size:13px;
}
.kn-ladder td.kn-m{
  font-family:var(--mono);
  font-weight:700; font-size:17px; color:var(--kn-accent);
}
.kn-ladder td.kn-m.kn-best{color:var(--kn-gold)}
.kn-ladder td.kn-m small{
  font-family:inherit; font-weight:500; font-size:11px;
  color:var(--kn-mute); margin-left:6px;
}
.kn-ladder td.kn-c{
  color:var(--kn-mute); font-family:var(--mono);
  font-size:12px;
}

.kn-bands{
  display:flex; gap:6px; padding:10px 14px;
  border-bottom:1px solid var(--kn-line); background:var(--plate,#FFFFFF);
}
.kn-bands .pillodd{flex:1; min-width:0}

.kn-add{
  margin:12px 14px; height:46px; border:0; border-radius:9px;
  background:var(--kn-navy); color:var(--on-strong,#FFFFFF);
  font-family:var(--mono);
  font-weight:700; font-size:14px; letter-spacing:1.8px; text-transform:uppercase;
  cursor:pointer;
}
.kn-add:hover{background:var(--kn-navy2)}
.kn-add:disabled{background:var(--kn-pill-off); color:var(--kn-dim); cursor:not-allowed}
.kn-help{padding:0 14px 12px; font-size:12px; color:var(--kn-dim)}

/* ---------- the table tabs (§3) ---------- */

/* A LABELLED PILL is the terminal's own price pill with a caption above it,
   used where the column heading cannot carry the label ("MOSTLY LOW" over
   2.31). The pill itself stays the terminal's .pillodd so Keno's prices and
   Dogs' prices are the same object on screen. */
.pillodd.kn-lb{
  display:grid; grid-template-rows:auto auto; gap:0; line-height:1.05;
  padding:3px 12px 4px; place-items:center;
}
.pillodd.kn-lb small{
  font-weight:700; font-size:10.5px; letter-spacing:.6px;
  text-transform:uppercase; color:var(--kn-accent);
}
.pillodd.kn-lb[data-sel="true"] small{color:#BFE5F1}
/* the big prices wear gold */
.pillodd.kn-gold{background:linear-gradient(#F6E3A8,#EDCF74); border-color:#D8B54F}
.pillodd.kn-gold[data-sel="true"]{background:var(--kn-navy); border-color:var(--kn-navy)}
.pillodd.kn-sm{min-width:62px; height:40px; font-size:16px; padding:0 6px}
.pillodd.kn-sm.kn-lb small{font-size:9.5px}
.pillodd:disabled{
  background:var(--kn-pill-off); border-color:var(--kn-line2);
  color:var(--kn-dim); cursor:not-allowed;
}

/* a colour swatch in the Colours table */
.kn-sw{
  display:inline-grid; place-items:center; width:26px; height:26px;
  border-radius:6px; color:var(--on-strong,#FFFFFF);
  font-family:var(--mono);
  font-weight:700; font-size:13px; margin-right:8px; vertical-align:middle;
}
.kn-sw.kn-z0{background:var(--kn-z0)}
.kn-sw.kn-z1{background:var(--kn-z1)}
.kn-sw.kn-z2{background:var(--kn-z2)}
.kn-sw.kn-z3{background:var(--kn-z3); color:#3A2A00}

/* a section band inside a tab (FIRST BALL · EXACT NUMBER, TOTAL OF ALL 20) */
.kn-section{border-bottom:1px solid var(--kn-line)}
.kn-section .kn-sh{
  min-height:34px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:4px 14px; background:var(--kn-panel2);
  border-bottom:1px solid var(--kn-line);
  font-family:var(--mono);
  font-weight:600; font-size:12px; letter-spacing:1.8px; text-transform:uppercase;
  color:var(--kn-navy);
}
.kn-section .kn-sh small{
  font-family:inherit; font-weight:500; font-size:12px; letter-spacing:0;
  text-transform:none; color:var(--kn-mute);
}
.kn-section .kn-sb{padding:10px 14px 12px}
.kn-mini{display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:6px}
.kn-mini .pillodd{width:100%; min-height:2.3rem; font-size:1rem}
/* the name column carries a title over a subtitle, so it needs the room the
   fixture board gives two club names */
body[data-keno="true"] .fx{padding-right:.6rem}
.kn-mini .pillodd small{font-size:9.5px}
.kn-pillrow{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
/* THE FROZEN SHEET GIVES EVERY PRICE PILL width:100%, because on the fixture
   board each one owns its own grid cell. In a free-flowing row that makes
   every pill a full line, so a row of six bands becomes six rows. */
.kn-pillrow .pillodd{width:auto; min-width:8.5rem; flex:0 1 auto}
.kn-section .kn-sb .kn-pillrow .pillodd{padding:3px 14px 4px}
.kn-pillrow .kn-lead{
  font-family:var(--mono);
  font-size:11px; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--kn-mute); font-weight:600; min-width:66px;
}

/* the bingo board's cells */
.kn-bcell{
  display:inline-grid; place-items:center; width:52px; height:38px;
  border:1px solid var(--kn-line2); border-radius:7px; background:var(--plate,#FFFFFF);
  font-family:var(--mono);
  font-weight:600; font-size:15px; color:var(--kn-mute);
}
.kn-bcell.kn-hit{background:var(--kn-zc); border-color:var(--kn-zc); color:var(--on-strong,#FFFFFF)}
.kn-bcell.kn-z3.kn-hit{color:#3A2A00}

/* the note under a table ("a tie for the most pays nobody") */
.kn-foot{padding:10px 14px 14px; font-size:12.5px; color:var(--kn-mute)}

/* ---------- the two dark bottom strips (§1.5) ---------- */

.kn-strips{display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--kn-line)}
.kn-strip{border-right:1px solid var(--kn-line); min-width:0}
.kn-strip:last-child{border-right:0}
.kn-strip .kn-sh{
  min-height:32px; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:4px 14px; background:var(--kn-navy); color:var(--on-strong,#FFFFFF);
  font-family:var(--mono);
  font-weight:700; font-size:12px; letter-spacing:1.8px; text-transform:uppercase;
}
.kn-strip .kn-sh small{
  font-family:inherit; font-weight:500; font-size:12px; letter-spacing:0;
  text-transform:none; color:#CFE3EC;
}
.kn-strip .kn-sb{display:flex; gap:8px; padding:8px 14px 10px; align-items:flex-end; flex-wrap:wrap}
.kn-strip .kn-sb .kn-c{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  /* THE PRICE HAS TO BE READABLE FROM THE OTHER SIDE OF THE COUNTER. The
     terminal's pill stretches to its container, so without a floor here four
     of them in a strip squeeze down to the width of the caption above. */
  min-width:104px; flex:0 0 auto;
}
.kn-strip .kn-sb .kn-c .pillodd{width:100%}
.kn-strip .kn-sb .kn-c small{
  font-family:var(--mono);
  font-size:10px; letter-spacing:1.4px; text-transform:uppercase;
  color:var(--kn-mute); font-weight:600;
}

/* ---------- the play area's own scroll ---------- */

/* THE BOARD SCROLLS, THE STRIPS DO NOT. The two strips are the shop's
   shortest-priced markets and belong under the cashier's hand at all times;
   the grid above them can be as tall as it likes. */
body[data-keno="true"] #frows{display:flex; flex-direction:column; min-height:0}
body[data-keno="true"] .kn-panes{flex:1; min-height:0; overflow:auto}

/* Keno drives its own headings, so the terminal's fixture-board heading rows
   stay out of the way on the number-board tabs. */
body[data-keno="true"] .grphead:empty,
body[data-keno="true"] .colhead:empty{display:none}

/* the slip's Draws row (§4.2) — the same controls the stake row uses */
.kn-draws{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:6px 0 2px}
.kn-draws label{font-weight:600; font-size:13px; white-space:nowrap; margin-right:auto}
.kn-draws button{
  min-width:44px; height:34px; border:1px solid var(--kn-line2); border-radius:8px;
  background:var(--plate,#FFFFFF); font-family:var(--mono);
  font-weight:700; font-size:14px; color:var(--kn-ink); cursor:pointer;
}
.kn-draws button[aria-pressed="true"]{
  background:var(--kn-tabon); border-color:#9FD3E4; color:var(--kn-accent);
}
.kn-capline{padding:2px 0 6px; font-size:11.5px; color:var(--kn-dim)}

/* THE TERMINAL'S FIXTURE CELL IS A GRID, not a flex row — index2.html sets
   `.frow .fx{display:grid}` so football can place two clubs and a score in
   fixed tracks. Racing steps around it with .fx.rcfx; Keno does the same, so
   the name column can give its title and subtitle the whole width instead of
   collapsing each child to its own content. */
.frow .fx.kn-fx{
  display:flex; align-items:center; gap:.3rem;
  padding-left:.45rem; padding-right:.5rem; min-width:0;
}

/* a market row's name: the title over its plain-words subtitle.
   The terminal's own .tm cell is a horizontal row — two clubs and a score —
   so a Keno market row brings its own, the way racing brings .rcname. */
.fx .kn-nm{display:flex; flex-direction:column; min-width:0; flex:1 1 0; gap:1px}
.fx .kn-nm b{
  font-family:"Sora","Manrope",sans-serif; font-weight:800; font-size:.92rem;
  letter-spacing:-.015em; color:var(--kn-ink); line-height:1.15;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.fx .kn-nm i{
  font-style:normal; font-size:.68rem; color:var(--kn-mute); line-height:1.2;
  /* the subtitle is the plain-words explanation a cashier reads to a punter,
     so it wraps to a second line rather than trailing off in an ellipsis */
  white-space:normal; overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}

/* ===== the operator's counter settings =====
   Each rule is one switch in the back office under Keno 40. The till puts the
   answers on <body> as data attributes and the hiding happens here, so no
   painting code has to carry an if for a setting an operator may never touch. */
body[data-kn-chance="false"]    .kn-ladder .kn-c,
body[data-kn-chance="false"]    .kn-ladder th.kn-c{display:none}
body[data-kn-moneyback="false"] .kn-mb{display:none}
body[data-kn-quickpick="false"] .kn-qp{display:none}
body[data-kn-lastrow="false"]   .kn-lastrow{display:none}

/* SALES SUSPENDED — the board stays up (a cashier still needs to read prices
   and check slips) but nobody can miss why nothing is selling. */
.kn-suspend{
  display:flex; flex-direction:column; gap:2px;
  margin:0 0 10px; padding:10px 14px; border-radius:8px;
  background:#5A1A1A; border:1px solid #A33; color:#FFE6E6;
}
.kn-suspend b{font-size:13px; letter-spacing:1.2px}
.kn-suspend span{font-size:12px; color:#F3C9C9}

/* the Keno results table: nine narrow columns and one very wide one, so the
   shared results styling needs telling which is which or the headings collide */
.kn-restab{width:100%; border-collapse:collapse}
.kn-restab th, .kn-restab td{padding:7px 10px; text-align:left; white-space:nowrap}
.kn-restab thead th{
  font-size:11px; letter-spacing:1px; text-transform:uppercase;
  color:var(--kn-accent, #7A8FA6); border-bottom:1px solid rgba(127,127,127,.3);
}
.kn-restab td:nth-child(3){width:99%}          /* the balls take what is left */
.kn-restab th:nth-child(n+4), .kn-restab td:nth-child(n+4){text-align:right}
.kn-restab tbody tr + tr td{border-top:1px solid rgba(127,127,127,.16)}
.kn-restab .kn-balls{gap:3px}
