/* VALBLOX Upgrader page, on top of styles.css.
   The control panel, fields, buttons, the board well and the result plate are Mines' components: mines.css is
   imported here (not linked from the page head, so a shell sync that rewrites the head keeps them), as Keno and
   Blackjack do, so every game is one product. This file adds the Upgrader parts:
   - the panel: the target (multiplier field, a log slider, quick chips, or a picked item), the win arc's split
   - the stage: your stake as a coin stack plate, the iron dial from the banner (assets/games/upgrader/, generated by
     brand/valblox-games/upgrader/src) with the live frost arc (dragged round, split in up to 4) and the bronze
     pointer drawn over it, and the target
     plate (the item on its rarity plate, or a bronze multiplier medallion); the verdict line or result plate below
   - the item grid below the stage: the brand's 12 items on the cases pages' rarity plates (tokens and plate copied
     from cases.css, which this page does not load), search and sort, out-of-range items disabled with the reason
   - the fairness dialog (the same modal as the cases pages).
   Shadows fall down and a little to the right, from the site's one light (top, tilted 10deg left). */
@import url("mines.css");

.ug, .ugitems { width: 100%; }
.ug fieldset { border: 0; min-width: 0; }

/* ---------------------------------------------------------------- rarity tokens + plate (as in cases.css) */
.r-common { --r: #8997A6; --r-rgb: 137, 151, 166; --r-hi: #B3BFCC; --r-lo: #414F5D; --r-deep: #26313D; }
.r-uncommon { --r: #56C78D; --r-rgb: 86, 199, 141; --r-hi: #98E1B6; --r-lo: #18754B; --r-deep: #054D2E; }
.r-rare { --r: #6DB3FA; --r-rgb: 109, 179, 250; --r-hi: #A9D2FE; --r-lo: #32669A; --r-deep: #1B4267; }
.r-epic { --r: #B09DFC; --r-rgb: 176, 157, 252; --r-hi: #CEC5FE; --r-lo: #65569B; --r-deep: #413668; }
.r-legendary { --r: #EAB771; --r-rgb: 234, 183, 113; --r-hi: #F4CD9A; --r-lo: #996E30; --r-deep: #64471A; }
.rplate {
  --c: 10px; --rw: 1px; --n: 3px; background: var(--rim); --rim: #0E131B;
  --bt: rgba(var(--hi), .3); --bb: rgba(var(--lo), .6);
  --face:
    linear-gradient(0deg, var(--r) 0 2px, var(--r-hi) 2px 3px, rgba(var(--r-rgb), 0) 3px),
    radial-gradient(58% 48% at 50% 46%, rgba(var(--r-rgb), .28) 0%, rgba(var(--r-rgb), 0) 100%),
    linear-gradient(180deg, #1B222E 0%, #1E2633 52%, rgba(var(--r-rgb), .2) 100%), #1E2633;
}

/* ---------------------------------------------------------------- panel */
.ugp__goto { color: var(--lilac); opacity: 1; text-decoration: none; gap: 4px; }
.ugp__goto .ic { width: 15px; height: 15px; margin-top: 1px; }
.ugp__goto:hover { color: var(--lilac-light); }
.ugp__goto:focus-visible { outline: 2px solid rgba(var(--lilac-rgb), .7); outline-offset: 2px; }

/* the picked item: its rarity plate in a row above the multiplier field */
.ugp__pick {
  clear: both; position: relative; isolation: isolate; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-height: 58px; padding: 6px 7px 7px 8px; margin-bottom: 10px;
}
.ugp__pick[hidden] { display: none; }
.ugp__pick .rplate { --c: 9px; }
.ugp__pick-img { width: 46px; height: 46px; object-fit: contain; }
.ugp__pick-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ugp__pick-name { font-size: 13px; line-height: 16px; letter-spacing: .8px; color: var(--r-hi); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ugp__pick-val { display: inline-flex; align-items: center; gap: 5px; }
.ugp__pick-val img { width: 15px; height: 16px; }
.ugp__pick-val .num { font-family: "Skranji", sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .5px; color: var(--gold); }
.ugp__clear { width: 36px; height: 36px; padding: 0 0 3px; --c: 8px; --n: 3px; color: var(--muted); }
.ugp__clear .ic { width: 16px; height: 16px; }
.ugp__clear:hover { color: var(--white); }

.ugp__multi > .ic { width: 20px; height: 20px; flex: none; color: var(--lilac); }
.ugp__x { flex: none; padding: 0 10px 2px 0; font-family: "Skranji", sans-serif; font-weight: 700; font-size: 17px; color: var(--muted); }
.ugp__multi.is-item input { color: var(--gold); }

/* the slider: a carved groove, frost up to the knob; the knob is a small bronze stud lit from above */
.ugp__range {
  --p: 50%;
  clear: both; display: block; width: 100%; height: 26px; margin: 10px 0 2px; padding: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.ugp__range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #61B9DE 0, var(--lilac) var(--p), #10151D var(--p), #10151D 100%);
  box-shadow: inset 0 2px 0 rgba(5, 8, 12, .5), 0 1px 0 rgba(var(--hi), .55);
}
.ugp__range::-moz-range-track {
  height: 8px; border-radius: 4px; background: #10151D; box-shadow: inset 0 2px 0 rgba(5, 8, 12, .5), 0 1px 0 rgba(var(--hi), .55);
}
.ugp__range::-moz-range-progress { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #61B9DE, var(--lilac)); }
.ugp__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%;
  background: #EAB771; border: 2px solid #64471A;
  box-shadow: inset 0 2px 0 #F4CD9A, inset 0 -2px 0 #C6944C, 0 2px 0 rgba(4, 7, 12, .45);
}
.ugp__range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #EAB771; border: 2px solid #64471A;
  box-shadow: inset 0 2px 0 #F4CD9A, inset 0 -2px 0 #C6944C, 0 2px 0 rgba(4, 7, 12, .45);
}
.ugp__range:focus-visible { outline: none; }
.ugp__range:focus-visible::-webkit-slider-thumb { box-shadow: inset 0 2px 0 #F4CD9A, inset 0 -2px 0 #C6944C, 0 0 0 3px rgba(var(--lilac-rgb), .6); }
.ugp__range:focus-visible::-moz-range-thumb { box-shadow: inset 0 2px 0 #F4CD9A, inset 0 -2px 0 #C6944C, 0 0 0 3px rgba(var(--lilac-rgb), .6); }
.ugp__range:disabled { cursor: default; filter: saturate(.4) brightness(.75); }

.ugp__chips { margin-top: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mseg.ugp__chips .btn { font-size: 13px; letter-spacing: .4px; padding: 0 0 4px; }

.ugp__band { padding-top: 16px; padding-bottom: 18px; }
.ugp__band > .mlabel { margin-bottom: 8px; }
.ugp__band .mhint[hidden] { display: none; }
/* "Back to top" once the arc has been moved: a quiet text button in the label row, as the "pick an item" link */
.ugp__top {
  padding: 0; border: 0; background: none; font-family: inherit; color: var(--lilac); opacity: 1; cursor: pointer;
}
.ugp__top:hover { color: var(--lilac-light); }
.ugp__top:focus-visible { outline: 2px solid rgba(var(--lilac-rgb), .7); outline-offset: 2px; }
.ugp__top:disabled { cursor: default; opacity: .5; }
/* split the arc: 1 to 4 parts, each button a little dial with its arcs */
.ugp__split { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mseg.ugp__split .btn { height: 44px; gap: 7px; font-size: 16px; }
.ugp__split .ic { --ug-arc: #61B9DE; width: 22px; height: 22px; flex: none; }   /* its arcs in the dial's frost */
.ugp__split .btn:hover .ic { --ug-arc: #8FD4F3; }
.ugp__split .btn[aria-pressed="true"] .ic { --ug-arc: #B9E8FE; filter: drop-shadow(0 0 5px rgba(var(--lilac-rgb), .45)); }

.ugp__stats { margin-top: 18px; }
#ug-chance { color: var(--lilac-light); }
#ug-win { color: var(--gold); }
.mstart .ic { width: 22px; height: 22px; margin-top: -1px; }
.mstart[aria-disabled="true"] { filter: saturate(.35) brightness(.8); cursor: default; }

/* ---------------------------------------------------------------- stage */
.ugs { padding: 28px 24px; }
.ugs__in {
  width: 100%; display: grid; align-items: center; justify-content: center; column-gap: 14px; row-gap: 14px;
  grid-template-columns: 140px minmax(0, 384px) 140px;
  grid-template-areas: "stake dial target" "foot foot foot";
}
.ugcard--stake { grid-area: stake; }
.ugd { grid-area: dial; }
.ugcard--target { grid-area: target; }
.ugs__foot { grid-area: foot; min-height: 134px; display: grid; place-items: center; align-content: center; }   /* a result plate's height: the dial stays put as results come and go */
/* the browser's scroll anchor is never the cards or the foot: on a phone they sit under the dial (the stake card comes
   first in the page), and a line that comes or goes there would scroll the dial away under the hand. The dial is it. */
.ugs__in > .ugcard, .ugs__foot { overflow-anchor: none; }

/* stake and target plates */
.ugcard {   /* both plates the same height: label, art, name, value (the stake has no name line) */
  position: relative; isolation: isolate; width: 100%; min-height: 248px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; justify-items: center; align-items: center;
  padding: 14px 10px 16px; text-align: center; transition: filter .3s ease-out, opacity .3s ease-out;
}
.ugcard__plate { --c: 12px; --n: 4px; }
.ugcard--stake .ugcard__plate {
  --bt: rgba(var(--hi), .3); --bb: rgba(var(--lo), .6);
  --face: radial-gradient(58% 48% at 50% 52%, rgba(var(--gold-rgb), .12) 0%, rgba(var(--gold-rgb), 0) 100%), linear-gradient(180deg, #252E3E 0%, #1E2633 100%);
}
.ugcard--multi .rplate { --r: #8FD4F3; --r-rgb: 143, 212, 243; --r-hi: #B9E8FE; }   /* the medallion's plate takes the arc's frost */
.ugcard__k { font-family: "Skranji", sans-serif; font-size: 12px; line-height: 16px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.ugcard__art { width: 124px; height: 124px; margin: 6px 0 2px; display: grid; place-items: center; }
.ugcard__art > * { grid-area: 1 / 1; }
.ugcard__stack { width: 96px; height: 92px; margin-top: 14px; }
.ugcard__item { width: 118px; height: 118px; object-fit: contain; }
.ugcard__item[hidden], .ugmed[hidden] { display: none; }
.ugmed { position: relative; width: 112px; height: 117px; display: grid; place-items: center; }
.ugmed img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ugmed b {
  position: relative; margin-top: -5px; font-family: "Skranji", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .4px;
  color: var(--lilac-light); text-shadow: 0 2px 0 rgba(4, 7, 12, .55), 0 0 12px rgba(var(--lilac-rgb), .35);
}
.ugmed b.is-long { font-size: 17px; }
.ugcard__name {
  min-height: 34px; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 17px; letter-spacing: .8px;
  color: var(--white); text-transform: uppercase;
}
.ugcard--target:not(.ugcard--multi) .ugcard__name { color: var(--r-hi); }
.ugcard__v { display: inline-flex; align-items: center; gap: 6px; }
.ugcard__v img { width: 16px; height: 17px; }
.ugcard__v .num { font-size: 17px; letter-spacing: .6px; color: var(--gold); }
.ugs.is-spin .ugcard--stake { filter: saturate(.5) brightness(.8); }
.ugs.is-win .ugcard--target .rplate { --rim: var(--r); --glow: inset 0 0 20px rgba(var(--r-rgb), .4); }
.ugs.is-win .ugcard--target { filter: drop-shadow(0 0 14px rgba(var(--r-rgb), .35)); }
.ugs.is-lose .ugcard--target { filter: saturate(.45) brightness(.72); }

/* the dial: generated art below, the live arc, the miss mark and the pointer drawn over it in the same 440 box,
   and the reading in the face */
.ugd { position: relative; width: 100%; max-width: 384px; aspect-ratio: 1; justify-self: center; container-type: inline-size; }
.ugd__art, .ugd__live { position: absolute; inset: 0; width: 100%; height: 100%; }
.ugd__live { overflow: visible; }
.ugd__arc { transform-origin: 220px 216px; transition: opacity .35s ease-out, transform .22s cubic-bezier(.2, .8, .3, 1); }
.ugd__glow { opacity: 0; transition: opacity .4s ease-out; }
.ugd.is-win .ugd__glow { opacity: .9; }
.ugd.is-lose .ugd__arc { opacity: .34; }
/* a win on a split arc: the glow is on the part the roll landed in (the script sets it), the others sink back */
.ugd__veil { fill: #121925; opacity: 0; transition: opacity .35s ease-out; }
.ugd.is-win .ugd__veil { opacity: .62; }
/* the arcs are taken hold of on their ring (the script sets the cursor: a hand over an arc, a resize arrow along the
   ring over an edge), a soft frost glow while the pointer is over it; held, they lift off the groove toward you (a
   little larger, up toward the light, a soft shadow left down and to the right in the groove) and settle back when
   let go */
.ugd__band { touch-action: none; -webkit-tap-highlight-color: transparent; }
.ugd.is-spin .ugd__band, .ugd.no-arc .ugd__band { cursor: default; pointer-events: none; }
.ugd:not(.is-spin):not(.is-win):not(.is-lose):has(.ugd__band:hover) .ugd__glow { opacity: .3; }
.ugd__lift { fill: #05090F; opacity: 0; transition: opacity .22s ease-out; }
/* taken hold of, that arc alone (drawn in the held layer, upgrader.js) lifts out of the groove, its clasps with it,
   its shadow falls and it catches some light; let go, it settles back */
.ugd__held { transition: transform .22s cubic-bezier(.2, .8, .3, 1); }
.ugd.is-held .ugd__held.is-up { transform: translate(-1px, -3.5px); transition-duration: .14s; transition-timing-function: ease-out; }
.ugd.is-held .ugd__lift--held { opacity: .8; transition-duration: .14s; }
.ugd.is-held .ugd__held .ugd__glow { opacity: .55; transition-duration: .14s; }
.ugd.is-win .ugd__held .ugd__glow { opacity: 0; }   /* a win's glow is the arc's own (markHit) */
/* a bead (a long shot) cut as a gem: a dark rim, a lit facet toward the light (upgrader.js gemD) */
.ugd__gem-rim { fill: none; stroke: #1F5878; stroke-width: .8; }
.ugd__gem-hi { fill: #F2FAFE; opacity: .8; }
/* the grip across the middle of each long part: three grooves cut into the frost */
.ugd__grip path { fill: none; stroke-linecap: round; }
.ugd__grip-lo { stroke: #3C8DB5; stroke-width: 2.6; }
.ugd__grip-hi { stroke: #F2FAFE; stroke-width: 1.4; }
/* the edges' bronze clasps (faceted in the script): they show while the arcs can be shaped, and fade out for a
   spin and its result. They are drawn over the keyboard's focus ring (after it in the dial), so it never cuts across
   one. The one under the pointer grows, rises 2 toward
   the light (its shadow falling further), its face catches the light and an ice ring shows round it, over a dark key
   line; held, the ring is full and the clasp rises with its arc; at a limit the ring and its seat turn salmon. */
.ugd__handles { transition: opacity .2s ease-out; }
.ugd.is-spin .ugd__handles, .ugd.is-win .ugd__handles, .ugd.is-lose .ugd__handles, .ugd.no-arc .ugd__handles { opacity: 0; transition-duration: .12s; }
.ugd.is-keyed.is-win .ugd__handles, .ugd.is-keyed.is-lose .ugd__handles { opacity: 1; }   /* the keyboard on a slider after a round */
.ugd__clasp { transform-box: fill-box; transform-origin: center; transition: transform .16s cubic-bezier(.2, .8, .3, 1), translate .14s ease-out; }
.ugd__clasp.is-hot { transform: scale(1.26); }
.ugd__clasp.is-hot:not(.is-lift) { translate: -.5px -2px; }   /* (upgrader.js HOVER) */
.ugd__clasp.is-lift { translate: -1px -3.5px; }   /* the held arc's own, lifted with it (upgrader.js LIFT) */
.ugd__clasp-sh { fill: #091019; opacity: .45; transition: translate .14s ease-out, opacity .14s ease-out; }
.ugd__clasp.is-hot .ugd__clasp-sh { translate: .5px 1.4px; opacity: .6; }
.ugd__clasp-ring { fill: var(--lilac-light); opacity: 0; transition: opacity .14s ease-out, fill .14s ease-out; }
.ugd__clasp-key { fill: #05090F; opacity: 0; transition: opacity .14s ease-out; }
.ugd__clasp.is-hot .ugd__clasp-ring { opacity: .6; }
.ugd__clasp.is-hot .ugd__clasp-key { opacity: .9; }
.ugd.is-held .ugd__clasp.is-hot .ugd__clasp-ring { opacity: 1; }
.ugd__clasp-top { transition: fill .14s ease-out; }
.ugd__clasp.is-hot .ugd__clasp-top { fill: #F4CD9A; }   /* the face in the light (BRONZE[1]) */
.ugd__clasp-cut { fill: none; stroke: var(--bz4); stroke-width: 1.1; stroke-linecap: round; }
.ugd__clasp-rivet { fill: var(--bz0); stroke: var(--bz4); stroke-width: .9; }   /* a joint: one clasp holding two arcs */
/* held at a limit: its ring and its seat turn warm while it stays there */
.ugd__clasp.is-stop .ugd__clasp-sh { fill: var(--salmon); opacity: .8; }
.ugd__clasp.is-stop .ugd__clasp-ring { fill: var(--salmon); opacity: 1; }
/* while an edge is held the face clears for its reading: the face's own colour covers the emblem and the readout
   steps back, so only the tag is read */
.ugd__hush { opacity: 0; transition: opacity .14s ease-out; pointer-events: none; }
.ugd.is-sizing .ugd__hush { opacity: .88; }   /* with a mouse the emblem stays as a faint engraving: the face still the dial's */
.ugd.is-sizing.is-touch .ugd__hush { opacity: 1; }   /* the reading in the middle (touch): gone altogether */
.ugd.is-sizing .ugd__read { opacity: 0; transition-duration: .14s; }
/* where an arc snaps against another, under its clasp: two hairline frost cracks run out along the groove (ice in a
   groove of the grip's blue, so they read as cut into the frost), drawn by their dash, and a dark ring opens a little (the script plays
   them, upgrader.js snapTick) */
.ugd__snapfx { pointer-events: none; }
.ugd__snapfx > * { opacity: 0; }
.ugd__snap { fill: none; stroke: #070C14; stroke-width: 2.6; }
.ugd__crack, .ugd__crack-lo, .ugd__crack-core { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.ugd__crack { stroke: #F2FBFF; stroke-width: .9; }
.ugd__crack-core { stroke: #F2FBFF; stroke-width: 1.5; }
.ugd__crack-lo { stroke: #3C8DB5; stroke-width: 2.6; }   /* the grip grooves' blue: cut into the frost */
/* the keyboard's focus, drawn on the dial round the arc or round the clasp of an edge: ice over a dark line, so it
   reads on the arcs and on the steel alike */
.ugd__focus path { fill: none; stroke-linejoin: round; pointer-events: none; }
.ugd__focus path:first-child { stroke: rgba(5, 9, 15, .85); stroke-width: 5; }
.ugd__focus path:last-child { stroke: var(--lilac-light); stroke-width: 2.2; }
/* each arc as three sliders (role="slider": the arc, its start, its end), for the keyboard and screen readers; they
   sit on their parts of the ring and let the pointer through to the band */
.ugd__knobs[hidden] { display: none; }
.ugd__knob { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; }
.ugd__knob:focus { outline: none; }
/* the reading at an edge while it is held: the bet it now stands for and the chance, and what stops it at a limit.
   A steel plate with cut corners: the plate itself is its bronze rim, the face a step in from it (::before), so the
   rim runs unbroken round the cuts. For touch it sits in the middle of the face, larger (is-big). */
.ugd__tag {
  position: absolute; left: 0; top: 0; z-index: 2; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 1px;
  padding: 5px 11px 6px; min-width: 76px; pointer-events: none; white-space: nowrap; isolation: isolate;
  font-family: "Skranji", sans-serif; letter-spacing: .5px; text-align: center;
  background: var(--bz4);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.ugd__tag::before {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: linear-gradient(180deg, #1B2533 0%, #121925 100%);
  box-shadow: inset 0 2px 0 rgba(var(--hi), .55), inset 0 -2px 0 rgba(4, 7, 12, .5);
  clip-path: polygon(5.4px 0, calc(100% - 5.4px) 0, 100% 5.4px, 100% calc(100% - 5.4px), calc(100% - 5.4px) 100%, 5.4px 100%, 0 calc(100% - 5.4px), 0 5.4px);
}
.ugd__tag[hidden] { display: none; }
.ugd__tag.is-fixed { box-sizing: border-box; contain: size layout style; }   /* held at its measured size while up (upgrader.js) */
.ugd__tag-bet { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; line-height: 19px; color: var(--gold); }
.ugd__tag-bet img { width: 14px; height: 15px; }
.ugd__tag-ch { font-size: 12px; line-height: 15px; color: var(--lilac-light); }
.ugd__tag-why { max-width: 124px; margin-top: 2px; font-family: "GoldenSmile", sans-serif; font-size: 11px; line-height: 14px; letter-spacing: 1px; text-transform: uppercase; white-space: normal; text-wrap: balance; color: var(--salmon); }
.ugd__tag-why[hidden] { display: none; }
.ugd__tag.is-stop { background: var(--salmon); }   /* at a limit the rim warms */
.ugd__tag.is-next .ugd__tag-why { color: var(--muted); }   /* the next arc met: no limit, no warning */
.ugd__tag.is-big { padding: min(8px, 2.4cqw) min(16px, 4.4cqw) min(9px, 2.6cqw); min-width: min(112px, 32cqw); gap: 2px; }   /* (in the dial's width: inside the face on the smallest phones) */
.ugd__tag.is-big .ugd__tag-bet { gap: 6px; font-size: clamp(15px, 5.7cqw, 20px); line-height: 1.25; }
.ugd__tag.is-big .ugd__tag-bet img { width: 18px; height: 19px; }
.ugd__tag.is-big .ugd__tag-ch { font-size: clamp(12px, 4cqw, 14px); line-height: 1.3; }
.ugd__tag.is-big .ugd__tag-why { max-width: min(124px, 40cqw); }
.ugd__miss { fill: none; stroke: var(--salmon); stroke-width: 4.5; stroke-linecap: round; opacity: 0; }
.ugd.is-lose .ugd__miss { opacity: 1; transition: opacity .25s ease-out .1s; }
.ugd__read {
  position: absolute; left: 20%; right: 20%; top: 51.4%; display: flex; flex-direction: column; align-items: center; gap: 1.2cqw;
  text-align: center; pointer-events: none; transition: opacity .2s ease-out;
}
.ugd__num {
  font-family: "Skranji", sans-serif; font-weight: 700; font-size: 9.8cqw; line-height: 1; letter-spacing: .02em; white-space: nowrap;
  color: var(--white); text-shadow: 0 .6cqw 0 rgba(4, 7, 12, .55);
}
.ugd__num small { margin-left: .05em; font-size: .56em; color: var(--muted); }
.ugd__lbl { font-size: 3.5cqw; line-height: 1.2; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.ugd__read.is-empty .ugd__num { display: none; }
.ugd__read.is-empty .ugd__lbl { margin-top: 3cqw; font-size: 4.2cqw; color: var(--lilac); }
.ugd.is-spin .ugd__num { color: var(--lilac-light); }
.ugd.is-win .ugd__num { color: var(--green); text-shadow: 0 .6cqw 0 rgba(4, 7, 12, .55), 0 0 4cqw rgba(var(--green-rgb), .35); }
.ugd.is-lose .ugd__num { color: var(--salmon); }

/* verdict line, then the result plate in its place */
.ugs__foot > * { grid-area: 1 / 1; }
.ugs__rule { font-family: "Skranji", sans-serif; font-size: 15px; line-height: 20px; letter-spacing: .5px; color: var(--muted); text-align: center; text-wrap: balance; }
.ugs__rule b { font-weight: 700; color: var(--lilac-light); }
.ugs__rule[hidden], .ugs__cue[hidden] { display: none; }
/* until the arc has been moved once: how to move it, under the rule (the result plate covers both) */
.ugs__foot > .ugs__cue { grid-area: 2 / 1; }
.ugs__foot > .mresult { grid-area: 1 / 1 / 3 / 2; }
.ugs__cue {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 5px 14px 6px 10px;
  font-family: "Skranji", sans-serif; font-size: 13px; line-height: 18px; letter-spacing: .5px; color: var(--lilac-light);
  background: rgba(var(--lilac-rgb), .08); box-shadow: inset 0 0 0 1px rgba(var(--lilac-rgb), .22);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.ugs__cue .ic { width: 22px; height: 22px; flex: none; color: #8FD4F3; }
.ugs .mresult { min-width: 340px; padding: 18px 26px 20px; flex-direction: row; gap: 18px; }
.ugr__txt { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ugr__art { position: relative; isolation: isolate; width: 88px; height: 88px; flex: none; display: grid; place-items: center; }
.ugr__art[hidden] { display: none; }
.ugr__art .rplate { --c: 10px; --rim: var(--r); --glow: inset 0 0 16px rgba(var(--r-rgb), .35); }
.ugr__art img { width: 74px; height: 74px; object-fit: contain; }
.ugr__t.h-gold { font-size: 32px; line-height: 38px; gap: 14px; color: var(--green); text-shadow: 0 0 18px rgba(var(--green-rgb), .3), 0 3px 0 rgba(0, 0, 0, .3); }
.ugr--lose .ugr__t.h-gold { color: var(--salmon); text-shadow: 0 0 18px rgba(253, 74, 63, .22), 0 3px 0 rgba(0, 0, 0, .3); }
.ugr .mresult__pay[hidden] { display: none; }
.ugr__sub { font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .4px; color: var(--muted); text-align: center; text-wrap: balance; }
.ugr__sub b { font-weight: 700; color: var(--white); }

/* ---------------------------------------------------------------- item grid */
.ugitems { margin-top: 56px; container-type: inline-size; }
.ugitems__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 20px; }
.ugitems__t { gap: 12px; }
.ugitems__t .ic { width: 26px; height: 26px; color: var(--lilac); }
.ugitems__tools { display: flex; gap: 10px; }
.ugitems .minput { height: 44px; gap: 10px; padding: 0 12px 0 14px; }
.ugitems .minput > .ic { width: 18px; height: 18px; flex: none; color: var(--muted); }
.ugitems .minput input, .ugitems .minput select {
  flex: 1; min-width: 0; height: 100%; padding: 0 0 2px; border: 0; background: transparent; outline: 0; color: var(--white);
  font-family: "Skranji", sans-serif; font-weight: 400; font-size: 15px; letter-spacing: .5px;
}
.ugitems .minput input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.4); }
.ugsearch { width: 250px; }
.ugsort { width: 236px; position: relative; padding-right: 10px; }
.ugsort select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 26px; color: var(--lilac-light); }
.ugsort select option { background: var(--dropdown); color: var(--white); }
.ugsort__lbl { flex: none; font-size: 12px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; padding-bottom: 1px; }
.ugsort__chev { position: absolute; right: 12px; top: 50%; width: 18px !important; height: 18px !important; margin-top: -9px; pointer-events: none; color: var(--lilac) !important; }

.ugrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ugrid > li { display: flex; min-width: 0; }
.ugrid > li[hidden] { display: none; }
.ugi {
  position: relative; isolation: isolate; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 30px 10px 14px;
  border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; transition: transform .12s ease-out;
}
.ugi .rplate { --c: 12px; --n: 4px; }
.ugi__x {
  position: absolute; top: 9px; left: 10px; padding: 1px 7px 3px; font-family: "Skranji", sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .5px;
  color: var(--r-hi); background: rgba(var(--r-rgb), .12);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}
.ugi__x:empty { display: none; }
.ugi__img { width: 104px; height: 104px; object-fit: contain; }
.ugi__name { margin-top: 8px; min-height: 36px; display: flex; align-items: center; font-size: 14px; line-height: 18px; letter-spacing: .8px; color: var(--white); text-transform: uppercase; }
.ugi__val { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.ugi__val img { width: 15px; height: 16px; }
.ugi__val .num { font-family: "Skranji", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .6px; color: var(--gold); }
.ugi:not([aria-disabled="true"]):hover { transform: translateY(-3px); }
.ugi:not([aria-disabled="true"]):hover .rplate { --rim: rgba(var(--r-rgb), .6); }
.ugi:focus-visible { outline: none; }
.ugi:focus-visible .rplate { --rim: var(--lilac); }
.ugi[aria-pressed="true"] .rplate { --rim: var(--r); --rw: 2px; --glow: inset 0 0 20px rgba(var(--r-rgb), .38); }
.ugi[aria-pressed="true"]::after {   /* the picked target: a frost corner tag with the dial's chevrons */
  content: ""; position: absolute; top: 9px; right: 10px; width: 23px; height: 20px;
  background: url("assets/games/upgrader/tag.svg") center / 23px 20px no-repeat;
}
/* out of range at this bet: dimmed, the chip in ember, the reason on hover and on focus */
.ugi[aria-disabled="true"] { cursor: not-allowed; }
.ugi[aria-disabled="true"] :is(.ugi__img, .ugi__name, .ugi__val) { opacity: .4; filter: saturate(.35); }
.ugi[aria-disabled="true"] .ugi__x { color: var(--salmon); background: rgba(253, 74, 63, .13); }
.ugi__why {
  position: absolute; z-index: 5; left: 50%; bottom: calc(100% - 6px); width: max-content; max-width: min(230px, 92vw); padding: 8px 12px 10px;
  font-family: "Skranji", sans-serif; font-size: 13px; line-height: 17px; letter-spacing: .3px; color: var(--white); text-transform: none; text-align: center;
  background: #0E131B; box-shadow: inset 0 0 0 1px rgba(var(--hi), .9), 0 8px 16px rgba(4, 7, 12, .5);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s .15s;
}
.ugi[aria-disabled="true"]:is(:hover, :focus-visible) .ugi__why { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .15s ease-out, transform .15s ease-out; }
.ugrid.is-locked { pointer-events: none; }   /* while the pointer spins the target stays put */
.ugitems__empty { margin-top: 16px; text-align: center; font-family: "Skranji", sans-serif; font-size: 15px; letter-spacing: .4px; color: var(--muted); }
.ugitems__empty[hidden] { display: none; }

/* ---------------------------------------------------------------- fairness dialog (as on the cases pages) */
.fair { padding: 0; border: 0; background: none; color: inherit; width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: visible; }
.fair::backdrop { background: rgba(7, 10, 15, .66); }
.fair__in { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 12px; padding: 26px 30px 28px; }
.fair__in > .plate {
  --c: 16px; --n: 6px; --bt: rgba(var(--hi), .3); --bb: rgba(var(--lo), .6);
  --face: radial-gradient(70% 90% at 50% 0%, rgba(var(--lilac-rgb), .12) 0%, rgba(var(--lilac-rgb), 0) 100%), linear-gradient(180deg, #2A3446 0%, #1F2734 100%);
}
.fair__t { font-size: 22px; line-height: 30px; color: var(--lilac-light); text-transform: uppercase; }
.fair__in p { font-family: "Skranji", sans-serif; font-size: 14px; line-height: 20px; letter-spacing: .4px; color: var(--muted); }
.fair__in p b { font-weight: 400; color: var(--lilac-light); }
.fair__vals { margin: 2px 0; display: flex; flex-direction: column; gap: 8px; }
.fair__vals div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; align-items: center; }
.fair__vals dt { font-size: 12px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.fair__vals dd { margin: 0; min-width: 0; padding: 6px 10px 7px; background: #171D27; box-shadow: inset 0 2px 0 rgba(5, 8, 12, .5);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); }
.fair__vals code { display: block; font: 12px/16px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--white); overflow-wrap: anywhere; }
.fair__in .fair__demo { color: var(--gold); }
.fair__x { align-self: center; margin-top: 4px; height: 40px; }

/* ---------------------------------------------------------------- wider and narrower stages, grids */
@container (min-width: 960px) {   /* a wide stage: the dial at its drawn size (440), the plates a little larger */
  .ugs__in { grid-template-columns: 168px minmax(0, 440px) 168px; column-gap: 32px; }
  .ugd { max-width: 440px; }
  .ugcard { min-height: 264px; }
}
@container (max-width: 640px) {
  .ugs__in { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "dial dial" "foot foot" "stake target"; column-gap: 10px; row-gap: 12px; }   /* the rule and the result right under the dial */
  .ugd { max-width: 360px; }
  .ugcard { min-height: 220px; }
  .ugs__foot { min-height: 112px; }
}
@container (max-width: 420px) {
  .ugcard { padding: 12px 8px 14px; }
  .ugcard__art { width: 104px; height: 104px; }
  .ugcard__item { width: 100px; height: 100px; }
  .ugcard__stack { margin-top: 10px; }
  .ugmed { width: 100px; height: 104px; }
  .ugmed b { font-size: 19px; }
  .ugmed b.is-long { font-size: 15px; }
  .ugs .mresult { min-width: 0; width: 100%; padding: 14px 12px 16px; gap: 12px; }
  .ugr__art { width: 72px; height: 72px; }
  .ugr__art img { width: 60px; height: 60px; }
  .ugr__t.h-gold { font-size: 26px; line-height: 32px; }
  .ugr__t.h-gold::before, .ugr__t.h-gold::after { display: none; }
  .ugs .mresult__pay { font-size: 20px; line-height: 26px; }
}
@container (max-width: 980px) { .ugrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 640px) {
  .ugrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ugitems__tools { width: 100%; }
  .ugsearch { flex: 1; width: auto; min-width: 0; }
  .ugsort { width: 220px; }
}
@container (max-width: 520px) {
  .ugitems__tools { flex-direction: column; }
  .ugsearch, .ugsort { flex: none; width: 100%; }   /* flex: 1 in a column would squash the field to its text height */
}
@container (max-width: 460px) {
  .ugrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ugi { padding: 28px 8px 12px; }
  .ugi__img { width: 88px; height: 88px; }
  .ugi__name { font-size: 13px; line-height: 16px; }
}
@media (max-width: 600px) {
  .ugs { padding: 14px 10px; }
  .ugitems { margin-top: 44px; }
  .ugitems__t { width: 100%; justify-content: flex-start; }
}
/* short screens beside the stage (1181 x 760, 1024 x 768): a tighter panel, so Upgrade sits above the fold */
@media (min-width: 700px) and (max-height: 820px) {
  .ugp .mpanel__head { height: 66px; }
  .ugp .mpanel__icon { width: 40px; height: 40px; }
  .ugp .mpanel__icon .ic { width: 21px; height: 21px; margin-top: -1px; }
  .ugp .mpanel__body { padding-top: 16px; }
  .ugp .mfield + .mfield { margin-top: 12px; }
  .ugp .mquick { margin-top: 8px; }
  .ugp .ugp__range { margin: 6px 0 2px; }
  .ugp .ugp__band { margin-top: 12px !important; padding-top: 12px; padding-bottom: 14px; }
  .ugp .ugp__stats { margin-top: 12px; }
  .ugp .mstart { margin-top: 14px; }
}

/* bets table tabs (assets/js/bets-tabs.js): filtered rows hide; an empty filter says so */
.bets .brows > [hidden], .bets__empty[hidden] { display: none; }
.bets__empty { width: 100%; height: 56px; margin: 0; display: grid; place-items: center; font-family: "Skranji", sans-serif; font-size: 15px; letter-spacing: .6px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .ugi, .ugcard { transition: none; }
  .ugd__arc, .ugd__glow, .ugd__veil, .ugd.is-lose .ugd__miss, .ugd__lift, .ugd__held, .ugd.is-held .ugd__held.is-up { transition-duration: .15s; transition-delay: 0s; }
  .ugd__clasp { transition: translate .15s ease-out; }
  .ugd__clasp.is-hot { transform: none; }
  .ugd__clasp.is-hot:not(.is-lift) { translate: none; }   /* hover: the ring and the light, no rise */
  .ugi__why { transition: none; }
}
