/* HIGH GLOSS ON THE MARKET BUTTONS — Keno 40, Keno 80, Colour Colour and
 * 6 Lucky Balls.
 *
 * WHY THIS IS ONE FILE AND NOT FOUR. Spin 2 Win learned the lesson first: a
 * gloss written out per colour drifts, because the next colour is added to one
 * gradient and not the other, and two buttons on the same board end up catching
 * the light differently. So the shine is ONE layer. Every button underneath
 * keeps painting its own colour exactly as it always did, and a single ::before
 * lays the highlight over the top of it — red, navy, pale blue and gold all
 * catch the light the same way, and a new colour later is one background line
 * and never a second gradient to keep in step.
 *
 * SPIN 2 WIN'S BOARD IS DARK AND THESE FOUR ARE LIGHT, so the recipe is tuned
 * rather than copied. On navy a white band reads as a hard specular; on a pale
 * blue pill the same band washes the colour out and the price stops being
 * legible from across a counter. What carries the gloss here is the pairing:
 * a bright, tight band at the top, a soft dark foot underneath, and a crisp
 * hairline along the top edge. The button's own colour is never touched.
 *
 * WHY ::before AND z-index:-1. A price pill's text is often a bare text node
 * rather than an element, so Spin 2 Win's trick of lifting the children above
 * the shine (.s2w-c > *) would have nothing to lift. A negative z-index inside
 * a stacking context of the button's own making paints the band ABOVE the
 * background and BELOW the text, which is exactly what is wanted and needs no
 * markup at all. Not one line of HTML changes for any of these four games.
 *
 * WHAT IS DELIBERATELY NOT HERE. Football and the races use the same .pillodd
 * that Keno and Colour Colour use, and they are NOT glossed: every rule is
 * scoped to the body attribute the terminal sets while one of these four games
 * is open, so the other coupons look exactly as they did. cashier-ui.css and
 * shop-screen.css stay frozen; this file rides on top and is loaded after them.
 *
 * KENO 80 HAS NO PRICE BUTTONS TODAY. Its board is the eighty numbers and a set
 * of read-only pays tables — "the BOARD ALONE for now", as the terminal puts
 * it — so what is glossed there is the grid. The .pillodd rule is written for
 * it anyway, so the day it grows a coupon its prices arrive already shining
 * rather than as the one flat board on the counter.
 */

/* ---------------------------------------------------------------------------
   THE SHINE ITSELF — the only place the recipe is written down.
   --------------------------------------------------------------------------- */

body[data-keno="true"] .pillodd,
body[data-keno="true"] .kn-num,
body[data-keno80="true"] .pillodd,
body[data-keno80="true"] .k8-num,
body[data-cc="true"] .pillodd,
.opill {
  position: relative;
  isolation: isolate;          /* so the band below can sit at z-index -1 */
  box-shadow:
    inset 0  1px 0        rgba(255,255,255,.95),  /* the lit top edge            */
    inset 0 -7px 9px -7px rgba(8,34,44,.42),      /* the foot falling into shade */
    inset 0  0  0  1px    rgba(255,255,255,.16),  /* a hairline rounding it      */
    0 1px 2px      rgba(11,42,53,.20),            /* it sits ON the board        */
    0 2px 6px -3px rgba(11,42,53,.30);
}

body[data-keno="true"] .pillodd::before,
body[data-keno="true"] .kn-num::before,
body[data-keno80="true"] .pillodd::before,
body[data-keno80="true"] .k8-num::before,
body[data-cc="true"] .pillodd::before,
.opill::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 54%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
                rgba(255,255,255,.80) 0%,
                rgba(255,255,255,.42) 38%,
                rgba(255,255,255,.12) 76%,
                rgba(255,255,255,0)  100%);
  /* THE BAND HAS A BELLY. A straight-edged highlight reads as a stripe; the
     asymmetric radius curves its lower edge the way light actually pools on
     something rounded, which is the whole difference between "two-tone" and
     "wet". The top corners follow the button, so the shine never squares off a
     rounded edge. */
  border-radius: inherit;
  border-bottom-left-radius:  60% 100%;
  border-bottom-right-radius: 60% 100%;
}

/* ---------------------------------------------------------------------------
   THE STATES. A highlight eats a thin outline alive, so PICKED and CLOSED both
   have to be re-stated or a cashier loses track of what is on the slip.
   --------------------------------------------------------------------------- */

/* PICKED. The button already goes dark underneath; the shine stays, dimmed, so
   it still reads as the same object rather than a hole in the board, and a
   bright ring inside the edge carries the state. */
body[data-keno="true"] .pillodd[data-sel="true"],
body[data-keno="true"] .kn-num[aria-pressed="true"],
body[data-keno80="true"] .pillodd[data-sel="true"],
body[data-keno80="true"] .k8-num[aria-pressed="true"],
body[data-cc="true"] .pillodd[data-sel="true"],
.opill.on {
  box-shadow:
    inset 0  1px 0         rgba(255,255,255,.30),
    inset 0 -8px 10px -7px rgba(0,0,0,.55),
    inset 0  0  0  2px     rgba(255,255,255,.85),
    0 0 0 2px      var(--accglow, rgba(23,180,208,.45)),
    0 3px 10px     rgba(11,42,53,.34);
}
body[data-keno="true"] .pillodd[data-sel="true"]::before,
body[data-keno="true"] .kn-num[aria-pressed="true"]::before,
body[data-keno80="true"] .pillodd[data-sel="true"]::before,
body[data-keno80="true"] .k8-num[aria-pressed="true"]::before,
body[data-cc="true"] .pillodd[data-sel="true"]::before,
.opill.on::before { opacity: .40 }

/* CLOSED. "Not for sale" has to read at a glance from the other side of a
   counter, so a shut button loses most of its shine as well as its colour —
   fading alone leaves a glossy ghost that still looks pressable. */
body[data-keno="true"] .pillodd:disabled,
body[data-keno="true"] .kn-num:disabled,
body[data-keno80="true"] .pillodd:disabled,
body[data-keno80="true"] .k8-num:disabled,
body[data-cc="true"] .pillodd:disabled,
.opill:disabled {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
  filter: saturate(.35);
}
body[data-keno="true"] .pillodd:disabled::before,
body[data-keno="true"] .kn-num:disabled::before,
body[data-keno80="true"] .pillodd:disabled::before,
body[data-keno80="true"] .k8-num:disabled::before,
body[data-cc="true"] .pillodd:disabled::before,
.opill:disabled::before { opacity: .22 }

/* PRESSED. The light has to move, or a glossy button feels like a picture of a
   button: the band shortens and the foot deepens, as if the face went in. */
body[data-keno="true"] .pillodd:active:not(:disabled),
body[data-keno="true"] .kn-num:active:not(:disabled),
body[data-keno80="true"] .pillodd:active:not(:disabled),
body[data-keno80="true"] .k8-num:active:not(:disabled),
body[data-cc="true"] .pillodd:active:not(:disabled),
.opill:active:not(:disabled) {
  box-shadow:
    inset 0  2px 5px rgba(8,34,44,.45),
    inset 0 -1px 0   rgba(255,255,255,.35);
}
body[data-keno="true"] .pillodd:active:not(:disabled)::before,
body[data-keno="true"] .kn-num:active:not(:disabled)::before,
body[data-keno80="true"] .pillodd:active:not(:disabled)::before,
body[data-keno80="true"] .k8-num:active:not(:disabled)::before,
body[data-cc="true"] .pillodd:active:not(:disabled)::before,
.opill:active:not(:disabled)::before { height: 40%; opacity: .72 }
