/* r24 core kit — the page on every screen.
   Stacked (the play above, the panel below) on portrait and near-square screens; the panel beside the play from a width-to-height
   ratio of 1.3 (the three-way rule of Stake Engine's web-sdk: >= 1.3 landscape, otherwise stacked).
   The stage is 800 x 1000 of its own units and is fitted whole into the room the panel and the top bar leave (kit.js fit()).
   The background is one picture that is larger than the stage on every side and moves and scales WITH the stage, so the play always
   lies on the same part of it and no screen ever shows its edge, a copy of it or a blurred band. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--r24-edge, #05080b); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body { font-family: var(--r24-body, system-ui, sans-serif); color: var(--r24-text, #f1f5f9); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
.r24 { position: fixed; inset: 0; height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }

/* the layers behind and over the grid: each fills the screen and is placed by the kit */
.r24-bg, .r24-stage, .r24-fx, .r24-flash, .r24-shade { position: absolute; left: 0; top: 0; pointer-events: none; }
.r24-bg { z-index: 0; max-width: none; object-fit: cover; will-change: transform; }
.r24-shade { z-index: 1; inset: 0; width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .38) 100%); }
.r24-stage { z-index: 2; width: 800px; height: 1000px; }
.r24-world { position: absolute; inset: 0; }
.r24-fx { z-index: 3; width: 100%; height: 100%; }
.r24-flash { z-index: 4; inset: 0; width: 100%; height: 100%; opacity: 0; }
.r24-spr, .r24-txt, .r24-box, .r24-actor { pointer-events: none; will-change: transform; }
/* a picture that PixiJS draws: the element stays, with its place and its size, and is no longer painted by the browser */
.r24-spr.r24-pxd > img { object-fit: none !important; object-position: -99999px -99999px !important; }
.r24-actor.r24-pxd { background-size: 0 0 !important; }
.r24-spr { display: block; width: max-content; line-height: 0; }
.r24-spr img { display: block; max-width: none; pointer-events: none; -webkit-user-drag: none; }
.r24-txt { font-family: var(--r24-display); font-weight: 800; white-space: nowrap; line-height: 1; paint-order: stroke fill; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.r24-tap { pointer-events: auto; }
.r24-tap::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, var(--r24-tapmin, 44px)); height: max(100%, var(--r24-tapmin, 44px)); transform: translate(-50%, -50%); }          /* the finger's room is never smaller than 44 points (Apple HIG, WCAG 2.5.5) */

/* the top bar */
.r24-top { grid-row: 1; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: calc(4px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
.r24-top h1 { margin: 0; font: 800 20px/1 var(--r24-display); letter-spacing: .01em; color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.r24-hist { flex: 1 1 0; min-width: 0; display: flex; gap: 5px; justify-content: flex-end; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 24px); -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px); flex-direction: row-reverse; }
.r24-hist span { flex: none; font: 700 12px/1 var(--r24-body); font-variant-numeric: tabular-nums; padding: 6px 8px; border-radius: 99px; background: rgba(0, 0, 0, .5); color: var(--r24-muted); }
.r24-hist span.win { background: var(--r24-win); color: var(--r24-win-ink); }
.r24-hist span.push { color: var(--r24-text); }
.r24-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font: 700 18px/1 var(--r24-body); cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.r24-ico[data-a=quick] { opacity: .5; }
.r24-ico[data-a=quick].on { opacity: 1; background: var(--r24-accent); color: #111; }

/* the room the stage is fitted into */
.r24-wrap { grid-row: 2; position: relative; min-width: 0; min-height: 0; pointer-events: none; }
.r24-how { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: max-content; max-width: min(92%, 520px); z-index: 6; padding: 9px 14px; border-radius: 14px; background: rgba(0, 0, 0, .62); color: #fff; font: 600 14px/1.3 var(--r24-body); text-align: center; pointer-events: auto; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .25s; }
.r24-how:empty, body.r24-played .r24-how { opacity: 0; pointer-events: none; }

/* the panel */
.r24-panel { grid-row: 3; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: linear-gradient(180deg, var(--r24-panel), var(--r24-panel2)); border-top: 2px solid var(--r24-accent); box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); width: 100%; max-width: 560px; justify-self: center; }
@media (min-width: 560px) { .r24-panel { border-radius: 18px 18px 0 0; border: 2px solid var(--r24-accent); border-bottom: 0; } }
.r24-acts { display: flex; flex-wrap: wrap; gap: 8px; min-height: calc(var(--r24-rows, 1) * 56px + (var(--r24-rows, 1) - 1) * 8px); align-content: flex-start; }          /* as tall as this engine's buttons ever get, from the first moment: the play never changes size when the buttons change */
.r24-acts > * { flex: 1 1 100%; min-width: 0; }
.r24-acts.r24-pair > .r24-take, .r24-acts.r24-pair > .r24-gos { flex: 1 1 0; }
.r24-acts.r24-wait { opacity: .6; pointer-events: none; }
.r24-row { display: flex; gap: 8px; }
.r24-row > * { flex: 1 1 0; min-width: 0; }
.r24-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 10px; border: 0; border-radius: 14px; cursor: pointer; font-family: var(--r24-display); color: var(--r24-text); background: rgba(255, 255, 255, .1); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); transition: transform .06s, filter .12s; }
.r24-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.r24-btn:disabled { filter: saturate(.4) brightness(.75); cursor: default; }
.r24-btn b { font-weight: 800; font-size: 19px; line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; text-align: center; overflow-wrap: anywhere; }
.r24-btn small { font: 700 12.5px/1.1 var(--r24-body); opacity: .88; font-variant-numeric: tabular-nums; }
.r24-btn small:empty { display: none; }
.r24-bet { background: var(--r24-primary); color: var(--r24-primary-ink); }
.r24-take { background: var(--r24-win); color: var(--r24-win-ink); }
.r24-go { background: rgba(255, 255, 255, .13); border: 1.5px solid rgba(255, 255, 255, .28); }
.r24-go.r24-strong { background: var(--r24-primary); color: var(--r24-primary-ink); border-color: transparent; }
.r24-go.r24-minor { flex: 0 0 auto; min-width: 72px; opacity: .85; }
.r24-go.r24-minor b { font-size: 14px; }
.r24-picks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.r24-picks button { min-height: 40px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .14); color: var(--r24-text); font: 700 14px var(--r24-body); }
.r24-stakerow { display: flex; align-items: stretch; gap: 0; height: 46px; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .34); }
.r24-stakerow label { display: flex; align-items: center; padding: 0 12px; font: 700 12px var(--r24-body); letter-spacing: .06em; text-transform: uppercase; color: var(--r24-muted); }
.r24-stakerow input { flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--r24-text); font: 700 18px var(--r24-body); font-variant-numeric: tabular-nums; text-align: center; user-select: text; -webkit-user-select: text; }
.r24-stakerow button { width: 52px; border: 0; background: rgba(255, 255, 255, .1); color: var(--r24-text); font: 700 16px var(--r24-body); cursor: pointer; }
.r24-stakerow button + input { border-left: 1px solid rgba(255, 255, 255, .08); border-right: 1px solid rgba(255, 255, 255, .08); }
.r24-settings { display: flex; flex-direction: column; gap: 8px; }
.r24-settings:empty { display: none; }
.r24-set { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r24-chip { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: var(--r24-text); font: 700 14px var(--r24-body); cursor: pointer; }
.r24-chip.on { background: var(--r24-accent); color: #16110a; }
.r24-slider label { font: 700 13px var(--r24-body); color: var(--r24-muted); min-width: 0; flex: 0 0 auto; }
.r24-slider input { flex: 1 1 80px; min-width: 0; height: 44px; accent-color: var(--r24-primary); }
.r24-slider output { font: 800 15px var(--r24-body); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.r24-set:not(.r24-slider) > label { font: 700 13px var(--r24-body); color: var(--r24-muted); flex: 1 1 100%; }
.r24-slider { flex-wrap: nowrap; gap: 10px; }
.r24-foot { display: flex; align-items: baseline; gap: 8px; }
.r24-ballbl { font: 700 12px var(--r24-body); letter-spacing: .06em; text-transform: uppercase; color: var(--r24-muted); }
.r24-bal { font: 800 18px var(--r24-body); font-variant-numeric: tabular-nums; }
.r24-foot i { font: 800 10px var(--r24-body); font-style: normal; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; background: var(--r24-accent); color: #16110a; }
.r24-foot i.r24-ver { margin-left: auto; padding: 0; font-size: 11px; background: none; color: var(--r24-muted); font-weight: 700; letter-spacing: .04em; white-space: nowrap; }          /* the protocol's version, quiet, at the end of the balance row */
.r24-foot i.r24-ver:empty { display: none; }
/* 30 Nov: real money on Storm: the player's wallet, deposit and withdraw (kit.js, storm.bar) */
.r24-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font: 600 12px var(--r24-body); color: var(--r24-muted); }
.r24-wallet span:first-child { color: var(--r24-text); font-family: ui-monospace, Menlo, Consolas, monospace; }
.r24-wallet button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); color: var(--r24-text); font: 800 12px var(--r24-body); cursor: pointer; }
.r24-wallet button[data-w="connect"] { background: var(--r24-accent); color: #16110a; }
.r24-wallet a { color: var(--r24-text); }
.r24-wallet .r24-wnote { flex-basis: 100%; color: var(--r24-accent); }
.r24-wallet .r24-wnote:empty { display: none; }
.r24-panel.r24-locked .r24-stakerow, .r24-panel.r24-locked .r24-settings { opacity: .45; pointer-events: none; }

/* the result, messages, the information panel */
.r24-result { position: absolute; z-index: 6; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; visibility: hidden; text-align: center; }
.r24-result b { font: 800 clamp(34px, 9vmin, 76px)/1 var(--r24-display); color: var(--r24-number); -webkit-text-stroke: 6px var(--r24-ink); paint-order: stroke fill; text-shadow: 0 5px 0 rgba(0, 0, 0, .4); text-transform: uppercase; white-space: nowrap; }
.r24-result span { font: 800 clamp(20px, 5vmin, 38px)/1 var(--r24-body); font-variant-numeric: tabular-nums; color: #fff; -webkit-text-stroke: 4px var(--r24-ink); paint-order: stroke fill; }
.r24-result.lose b { color: #fff; opacity: .92; font-size: clamp(26px, 6.5vmin, 52px); }
.r24-result.big b { font-size: clamp(44px, 12vmin, 104px); }
.r24-result span:empty, .r24-result b:empty { display: none; }
.r24-result i.r24-call { font: 800 clamp(30px, 8vmin, 64px)/1 var(--r24-display); font-style: normal; color: #fff; padding: .12em .5em .16em; border-radius: .5em; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); white-space: nowrap; text-transform: uppercase; }
.r24-result i.r24-call.red { background: #c62828; } .r24-result i.r24-call.black { background: #15151a; } .r24-result i.r24-call.green { background: #1f8a3b; }
.r24-toast { position: absolute; z-index: 7; left: 50%; top: 64px; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, .8); color: #fff; font: 600 14px var(--r24-body); visibility: hidden; max-width: 90vw; }
.r24-info { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .66); visibility: hidden; }
.r24-card { position: relative; width: min(100%, 460px); max-height: min(86dvh, 720px); display: flex; flex-direction: column; overflow: hidden; padding: 22px 20px 18px; border-radius: 18px; background: var(--r24-panel); border: 2px solid var(--r24-accent); color: var(--r24-text); user-select: text; -webkit-user-select: text; }
.r24-card h2 { margin: 0 34px 8px 0; font: 800 24px/1.1 var(--r24-display); }
.r24-card h3 { margin: 16px 0 6px; font: 800 12px var(--r24-body); letter-spacing: .08em; text-transform: uppercase; color: var(--r24-accent); }
.r24-card p { margin: 0 0 8px; font: 500 15px/1.4 var(--r24-body); }
.r24-card p.small { color: var(--r24-muted); font-size: 13px; margin-top: 10px; }
.r24-card a { color: var(--r24-accent); }
.r24-card table { width: 100%; border-collapse: collapse; font: 600 14px var(--r24-body); font-variant-numeric: tabular-nums; }
.r24-card td { padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.r24-card td:last-child { text-align: right; font-weight: 800; color: var(--r24-number); }
.r24-page { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0 -8px; padding: 0 8px; }          /* the name, the two pages' buttons and the close button stay; the page under them scrolls */
.r24-tabs { flex: none; display: flex; gap: 6px; margin: 4px 0 14px; }
.r24-tabs button { flex: 1 1 0; min-height: 44px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--r24-muted); font: 800 13px var(--r24-body); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.r24-tabs button.on { background: var(--r24-accent); color: #16110a; }
.r24-facts { display: flex; gap: 8px; margin: 0 0 12px; }
.r24-facts > div { flex: 1 1 0; min-width: 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.r24-facts small, .r24-kv small { display: block; margin-bottom: 2px; font: 700 10px var(--r24-body); letter-spacing: .08em; text-transform: uppercase; color: var(--r24-muted); }
.r24-facts b { font: 800 14px var(--r24-body); font-variant-numeric: tabular-nums; color: var(--r24-number); white-space: nowrap; }
.r24-card ol, .r24-card ul { margin: 0 0 8px; padding-left: 22px; font: 500 15px/1.4 var(--r24-body); }
.r24-card li { margin: 0 0 6px; }
.r24-card p:empty { display: none; }
.r24-storm { display: flex; justify-content: center; padding: 18px 24px; margin: 0 0 12px; border-radius: 12px; background: #000; }
.r24-storm svg { display: block; height: 26px; width: auto; }
.r24-seed { display: flex; gap: 8px; margin-bottom: 6px; }
.r24-seed input { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; background: rgba(0, 0, 0, .35); color: var(--r24-text); font: 600 14px ui-monospace, Menlo, Consolas, monospace; }
.r24-seed button { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: var(--r24-text); font: 800 13px var(--r24-body); cursor: pointer; }
.r24-kv { display: grid; gap: 10px; margin-bottom: 12px; }
.r24-kv span, .r24-kv a { display: block; font: 600 12px/1.35 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.r24-kv p { margin: 0; } .r24-kv p a { display: inline; font: inherit; word-break: normal; }
.r24-x { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: var(--r24-text); font-size: 24px; cursor: pointer; }

/* the panel beside the play: screens at least 1.3 times as wide as they are tall */
@media (min-aspect-ratio: 13/10) {
  .r24 { grid-template-columns: clamp(280px, 26vw, 360px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .r24-top { grid-column: 2; grid-row: 1; }
  .r24-wrap { grid-column: 2; grid-row: 2; }
  .r24-panel { grid-column: 1; grid-row: 1 / span 2; max-width: none; height: 100%; justify-content: center; border: 0; border-right: 2px solid var(--r24-accent); border-radius: 0; box-shadow: 10px 0 30px rgba(0, 0, 0, .35); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-y: auto; }
  .r24-stakerow { order: 1; } .r24-settings { order: 2; } .r24-acts { order: 3; } .r24-foot { order: 4; margin-top: 6px; }          /* amount, settings, then the button: the order of Stake's own game pages */
}
@media (min-aspect-ratio: 13/10) and (max-height: 480px) {          /* a phone held sideways */
  .r24 { grid-template-columns: clamp(240px, 34vw, 300px) minmax(0, 1fr); }
  .r24-panel { gap: 7px; padding-top: 8px; padding-bottom: 8px; }
  .r24-stakerow { height: 42px; } .r24-top { min-height: 44px; }
}
@media (max-height: 700px) and (max-aspect-ratio: 13/10) { .r24-panel { gap: 8px; padding-top: 10px; } }
@media (prefers-reduced-motion: reduce) { .r24-btn { transition: none; } }
