/* Game frame v2 (FRAME-SPEC.md, 2026-11-20). PILOT: everything is scoped under body.fx2, which play.js turns on
   for the pilot game (Mines) or ?fx=2. When Zach okays it, the scope comes off and this becomes the kit's look.
   Values only from tokens (the blue action is set here as the token values for the pilot). */
body.fx2 {
  --accent: #1475e1; --accent-ink: #ffffff; --accent-hover: #1a8dff; --accent-soft: rgba(20, 117, 225, 0.16);
  --focus: #557086;
  --press: scale(.98);
}

/* page: no heading above the game (the name lives in the info block under it) */
body.fx2:not(.is-bare) .play-head { display: none; }

/* ---------- controls panel ---------- */
.fx2 .ui-controls { background: var(--surface); }
.fx2 .ui-stage { background: var(--stage); }
.fx2 .ui-label { font: 600 13px var(--font); color: var(--muted); }
.fx2 .ui-label b { font-weight: 600; color: var(--muted); }

/* mode tabs: a dark pill track with pill tabs */
.fx2 .ui-modes .ui-seg { background: var(--surface-2); border: 0; border-radius: 999px; padding: 5px; gap: 5px; }
.fx2 .ui-modes .ui-seg button { min-height: 34px; border-radius: 999px; font: 600 14px var(--font); color: var(--text); }
.fx2 .ui-modes .ui-seg button[aria-pressed="true"] { background: var(--surface-3); }
.fx2 .ui-modes .ui-seg button:hover:not([aria-pressed="true"]):not(:disabled) { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
/* other segmented choices: same raised look */
.fx2 .ui-seg { background: var(--surface-2); border: 2px solid var(--surface-3); border-radius: var(--radius-sm); }
.fx2 .ui-seg button { font-weight: 600; border-radius: 3px; }

/* boxes: dark fill, 2px border that brightens on hover and focus, small shadow */
.fx2 .ui-box { background: var(--surface-2); border: 2px solid var(--surface-3); border-radius: var(--radius-sm); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: border-color .1s; }
.fx2 .ui-box:hover { border-color: var(--surface-4); }
.fx2 .ui-box:focus-within { border-color: var(--surface-4); }
.fx2 .ui-box.is-bad { border-color: var(--lose); }
.fx2 .ui-box input, .fx2 .ui-select { font: 600 14px var(--font-num); font-variant-numeric: tabular-nums; color: var(--text); }
@media (pointer: coarse) { .fx2 .ui-box input, .fx2 .ui-select { font-size: 16px; } }   /* no zoom-on-focus on phones */
.fx2 .ui-gain-value { font: 600 14px var(--font-num); font-variant-numeric: tabular-nums; }
.fx2 .ui-gain { background: var(--surface-2); }
.fx2 .ui-gain:hover { border-color: var(--surface-3); }
/* ½ and 2×: one raised block joined to the right of the amount */
.fx2 .ui-box-btn { background: var(--surface-3); color: var(--text); border-left: 1px solid var(--surface-2); width: 44px; font: 600 13px var(--font); transition: background .1s, transform .1s, opacity .15s cubic-bezier(.4, 0, .2, 1); }
.fx2 .ui-box-btn:first-of-type { border-left: 0; }
.fx2 .ui-box-btn:last-child { border-radius: 0 2px 2px 0; }
.fx2 .ui-box-btn:hover:not(:disabled) { background: var(--surface-4); color: var(--text); }

/* buttons: secondary raised, main blue; every button presses in */
.fx2 .ui-btn { background: var(--surface-3); color: var(--text); border: 0; border-radius: var(--radius-sm); font: 700 14px var(--font); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: background .1s, transform .15s cubic-bezier(.4, 0, .2, 1), opacity .15s cubic-bezier(.4, 0, .2, 1); }   /* press: Stake's Play, 150 ms on the lock curve */
.fx2 .ui-btn:hover:not(:disabled) { background: var(--surface-4); }
.fx2 .ui-btn.is-primary { background: var(--accent); color: var(--accent-ink); }
.fx2 .ui-btn.is-primary:hover:not(:disabled) { background: var(--accent-hover); filter: none; }
/* Stake (measured on Keno's Play / Start Autoplay): a disabled main button keeps its colour and fades to .4 (150 ms, the lock curve) */
.fx2 .ui-btn.is-primary:disabled { opacity: .4; }
.fx2 .ui-btn.is-quiet { background: transparent; box-shadow: none; color: var(--muted); }
.fx2 .ui-btn:disabled:not(.is-primary) { opacity: .4; }   /* Stake: locked buttons keep their look and fade to .4 (150, the lock curve) */
.fx2 .ui-box-btn:disabled { opacity: .4; }   /* ½ / 2×: fade to .4 like Stake, no colour swap */
.fx2 .ui-btn:active:not(:disabled), .fx2 .ui-seg button:active:not(:disabled), .fx2 .ui-box-btn:active:not(:disabled),
.fx2 .bar-btn:active:not(:disabled), .fx2 .top-wallet:active { transform: var(--press); }
/* ui.button busyDelay: the pressed scale stays until the lock frame, then springs back (Stake) */
.fx2 .ui-btn.is-held { transform: var(--press); }
.fx2 .ui-seg button { transition: background .1s, color .1s, transform .1s; }

/* slider: raised track, blue fill */
.fx2 .ui-slider input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), var(--surface-3) var(--p)); }
.fx2 .ui-slider input[type=range]::-webkit-slider-thumb { background: var(--text); border-color: var(--accent); }

/* ---------- bar under the game: icons left (tooltips), our mark centre, Fairness right ---------- */
.fx2 .game-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px 8px; background: var(--surface); }
.fx2 .bar-left, .fx2 .bar-right { display: flex; align-items: center; gap: 2px; }
.fx2 .bar-right { justify-content: flex-end; }
.fx2 .bar-mid { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 700 15px var(--font); opacity: .75; text-decoration: none; }
.fx2 .bar-mid .brand-mark { width: 20px; height: 20px; }
.fx2 .bar-btn { color: var(--muted); transition: background .1s, color .1s, transform .1s; }
.fx2 .bar-btn svg { width: 18px; height: 18px; }
.fx2 .bar-left .bar-btn { padding: 0; width: 40px; position: relative; }
.fx2 .bar-left .bar-btn span { display: none; }
.fx2 .bar-right .bar-btn.fav { margin: 0; padding: 0; width: 40px; }
.fx2 .bar-right .bar-btn.fav span { display: none; }
.fx2 .bar-btn.fav[aria-pressed="true"] { color: var(--accent); }
/* tooltip with the name */
.fx2 .bar-btn[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  background: var(--text); color: var(--surface-2); font: 600 12px var(--font); padding: 5px 8px; border-radius: var(--radius-sm);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s, transform .1s; z-index: 5;
}
.fx2 .bar-btn[data-tip]:hover::after, .fx2 .bar-btn[data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.fx2 .bar-right .bar-btn { position: relative; }
@media (hover: none) { .fx2 .bar-btn[data-tip]::after { display: none; } }
@media (max-width: 760px) {
  .fx2 .game-bar { padding: 2px 4px; }
  .fx2 .bar-left .bar-btn, .fx2 .bar-right .bar-btn.fav { width: 44px; }
  .fx2 .bar-mid span { display: none; }
  .fx2 .bar-right .bar-btn:not(.fav) span { display: inline; }
  .fx2 .bar-right .bar-btn:not(.fav) { padding: 0 10px; }
}

/* ---------- info block under the frame: mark, game name, "Originals" ---------- */
.info-head { display: none; }
.fx2 .info-head { display: flex; align-items: center; gap: 12px; }
.fx2 .info-head .brand-mark { width: 28px; height: 28px; flex: none; }
.fx2 .info-head h1 { font: 700 18px var(--font); }
.fx2 .info-head p { font: 600 13px var(--font); color: var(--muted); }
.fx2 .info { margin-top: 20px; }

/* header Wallet button: blue like the main action */
.fx2 .top-wallet { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transition: background .1s, transform .1s; }
.fx2 .top-wallet:hover { background: var(--accent-hover) !important; filter: none; }

/* our mark and coin keep their own green; only the action turns blue */
.fx2 .brand-mark, .fx2 .ui-coin { --accent: var(--win); --accent-soft: color-mix(in srgb, var(--win) 14%, transparent); }
/* desktop: the main action follows the fields directly (no empty gap above it) */
.fx2 .ui-controls-end { margin-top: 4px; }
@container (max-width: 680px) { .fx2 .ui-controls-end { margin-top: 0; } }   /* phone: one 10px gap tabs -> Play -> wager */

/* ======================================================================================
   Site pages under fx2 (home, lobby, /me, /fair, /help, /about, sign in/up, wallet + search windows).
   Header, sidebar and phone bar: G2's header-v2.css. Info block under games: G3's info-v2.css.
   ====================================================================================== */

/* buttons: main = blue, secondary = raised #2f4553, all press in */
.fx2 .btn { border: 0; border-radius: var(--radius-sm); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: background .1s, transform .1s, opacity .15s; }
.fx2 .btn:not(.is-primary):not(.is-quiet):not(.top-wallet) { background: var(--surface-3); color: var(--text); }
.fx2 .btn:not(.is-primary):not(.is-quiet):not(.top-wallet):hover:not(:disabled) { background: var(--surface-4); }
.fx2 .btn.is-primary { background: var(--accent); color: var(--accent-ink); }
.fx2 .btn.is-primary:hover:not(:disabled) { background: var(--accent-hover); filter: none; }
.fx2 .btn.is-quiet { box-shadow: none; }
.fx2 .btn:active:not(:disabled), .fx2 .srch-chip:active, .fx2 .row-arrow:active:not(:disabled), .fx2 .tabs button:active { transform: var(--press); }
/* banner actions are main actions too */
.fx2 .banner-text a.btn:not(.is-quiet):not(.top-wallet) { background: var(--accent); color: var(--accent-ink); }
.fx2 .banner-text a.btn:not(.is-quiet):not(.top-wallet):hover { background: var(--accent-hover); }
.fx2 .row-arrow { background: var(--surface-3); border: 0; border-radius: var(--radius-sm); }
.fx2 .row-arrow:hover:not(:disabled) { background: var(--surface-4); }

/* pill tabs: home Lobby / Originals and the bets tabs, plus the page-level choices (sort, ranges, Fair play, Wallet) */
.fx2 .home-tabs, .fx2 #bet-tabs {
  display: inline-flex; align-self: flex-start; max-width: 100%; gap: 5px; padding: 5px; border: 0; border-radius: 999px; background: var(--surface-2); overflow-x: auto;
}
.fx2 .home-tabs button, .fx2 #bet-tabs button {
  min-height: 34px; padding: 0 18px; margin: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: 600 14px var(--font); white-space: nowrap;
  transition: background .1s, transform .1s;
}
.fx2 .home-tabs button[aria-selected="true"], .fx2 #bet-tabs button[aria-selected="true"] { background: var(--surface-3); border: 0; }
.fx2 .home-tabs button:hover:not([aria-selected="true"]), .fx2 #bet-tabs button:hover:not([aria-selected="true"]) { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.fx2 .lobby-head .sort, .fx2 #range .ui-seg, .fx2 .fair-tabs .ui-seg, .fx2 .wal-tabs .ui-seg { background: var(--surface-2); border: 0; border-radius: 999px; padding: 5px; gap: 5px; }
.fx2 .lobby-head .sort button, .fx2 #range .ui-seg button, .fx2 .fair-tabs .ui-seg button, .fx2 .wal-tabs .ui-seg button { border-radius: 999px; color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .fx2 .home-tabs { align-self: stretch; } .fx2 .home-tabs button { flex: 1; min-height: 34px; } }

/* boxes: search boxes and plain inputs in the bordered style */
.fx2 .search-box, .fx2 .input {
  background: var(--surface-2); border: 2px solid var(--surface-3); border-radius: var(--radius-sm); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: border-color .1s;
}
.fx2 .search-box:hover, .fx2 .search-box:focus-within, .fx2 .input:hover, .fx2 .input:focus { border-color: var(--surface-4); }
.fx2 .search-box input { font-weight: 600; font-size: 14px; }
@media (pointer: coarse) { .fx2 .search-box input, .fx2 .input { font-size: 16px; } }
.fx2 .kv-value { border: 2px solid var(--surface-3); border-radius: var(--radius-sm); }

/* cards and panels: no hairline, the surface does the work */
.fx2 .panel, .fx2 .me-head, .fx2 .list { border: 0; border-radius: 8px; }
.fx2 .ui-stat { background: var(--surface-2); border: 2px solid var(--surface-3); }   /* --lose on --surface-2 = 4.8:1 */
.fx2 .mdl { border: 0; }
.fx2 .srch-chip { background: var(--surface-3); border: 0; font-weight: 600; transition: background .1s, transform .1s; }
.fx2 .srch-chip:hover { background: var(--surface-4); }
.fx2 .foot { background: var(--stage); }

/* profile menu under fx2: same --surface-2 menu as the old look (beats header-v2's .fx2 .acct-menu) */
.fx2 .top .acct-menu { background: var(--surface-2); border-radius: var(--radius-sm); }
.fx2 .top .acct-menu a:hover, .fx2 .top .acct-menu button:hover { background: var(--surface-3); }

/* review 3 S5: compact utility bar (48px desktop, 50px phone, 16px icons) and the name row 20px below it */
.fx2 .game-bar { min-height: 48px; padding-top: 3px; padding-bottom: 3px; }   /* 40px buttons + 6 + 2px border = 48 */
.fx2 .bar-btn svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .fx2 .game-bar { min-height: 50px; padding-top: 2px; padding-bottom: 2px; } }   /* 44 + 4 + 2 = 50 */
.fx2 .info { margin-top: 20px; }
.fx2 .info-head h1 { font: 700 18px var(--font); }
.fx2 .info-head p { font: 600 13px var(--font); }
.fx2 .ui-box:has(:focus-visible), .fx2 .search-box:has(input:focus-visible), .fx2 .input:focus-visible { box-shadow: 0 0 0 2px var(--surface-4); outline: none; }

/* ===== Stake's measured sizes (2026-11-20, Zach: "make it exactly like Stake"; measured in his Firefox at 1920 wide,
   identical for all seven originals). Numbers only; every file is still ours.
   - page column: max 1200 px, 3vw padding each side, frame starts 24 px under the 60 px header
   - frame: controls panel 300 px (12 px padding, #213545, radius 8 0 0 8) + stage (#0e202d, radius 0 8 8 0), no border
   - stage height = 0.7 × stage width (900 → 630, 603 → 422), growing only when a game needs more
   - bar under the game: its own block, 4 px below the frame, 63 px tall, radius 8, buttons 52 × 46
   - theatre (Wider): the full width right of the sidebar (Stake), no top gap, frame + bar fill the window below the header ===== */
@media (min-width: 761px) {
  body.fx2:not(.is-bare) main { max-width: calc(1200px + 6vw); padding: 24px 3vw 32px; }
  body.fx2.is-theatre:not(.is-bare) main { max-width: none; padding: 0 0 32px; }   /* Stake (page probe): theatre = the whole width right of the sidebar, under the header (1920 → x 60, 1860 wide) */
}
@container (min-width: 681px) {
  .fx2 .ui-frame-in { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(calc((100cqw - 300px) * .7), auto); border: 0; border-radius: 8px; }
  .fx2 .ui-controls { padding: 12px; border-right: 0; border-radius: 8px 0 0 8px !important; background: var(--surface); }
  .fx2 .ui-stage { min-height: 0; border-radius: 0 8px 8px 0 !important; background: var(--stage); }
  .fx2.is-theatre .ui-frame-in { grid-template-rows: minmax(calc(100vh - 60px - 67px), auto); }
}
@media (min-width: 761px) {
  .fx2 #game:has(.ui-frame-in) + .game-bar { margin-top: 4px; border-radius: 8px; }
  .fx2 #game:has(+ .game-bar:not([hidden])) .ui-frame-in { border-radius: 8px; }
  .fx2 .game-bar:not(.is-mini) { min-height: 63px; padding: 8px 4px; border: 0; background: var(--surface); }
  .fx2 .game-bar:not(.is-mini) .bar-btn { min-width: 52px; height: 46px; }
}
@container (min-width: 681px) { .fx2 .ui-controls .ui-btn.is-primary { min-height: 44px; height: 44px; border-radius: 8px; } }   /* Stake: 276 × 44, radius 8 */

/* ===== Stake's recorded control feel (docs/motion-vs-stake.md "Hover and press"): one curve, 150 ms ===== */
.fx2 { --ease: cubic-bezier(.4, 0, .2, 1); }
/* 1. press-in (scale .98) and 2. switch-off fades: 150 ms on the curve */
.fx2 .ui-btn, .fx2 .btn { transition: background .15s var(--ease), transform .15s var(--ease), opacity .15s var(--ease), color .15s var(--ease); }
.fx2 .ui-seg button, .fx2 .ui-box-btn, .fx2 .bar-btn, .fx2 .top-wallet, .fx2 .srch-chip { transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease), opacity .15s var(--ease); }
/* 3. the amount box: switches off over 250 ease, selects (focus) over 300 ease */
.fx2 .ui-box { transition: border-color .3s ease, box-shadow .3s ease, opacity .25s ease; }
.fx2 .ui-box:has(input:disabled) { transition: opacity .25s ease, border-color .3s ease; }
.fx2 .ui-box input { transition: color .25s ease; }
/* 5. slider thumb: grows a little on hover and while held (our choice; Stake's isn't recorded) */
.fx2 .ui-slider input[type=range] { cursor: grab; }
.fx2 .ui-slider input[type=range]:active { cursor: grabbing; }
.fx2 .ui-slider input[type=range]:disabled { cursor: default; }
.fx2 .ui-slider input[type=range]::-webkit-slider-thumb { transition: transform .15s var(--ease); }
.fx2 .ui-slider input[type=range]::-moz-range-thumb { transition: transform .15s var(--ease); }
.fx2 .ui-slider input[type=range]:not(:disabled):hover::-webkit-slider-thumb { transform: scale(1.1); }
.fx2 .ui-slider input[type=range]:not(:disabled):active::-webkit-slider-thumb { transform: scale(1.1); }
.fx2 .ui-slider input[type=range]:not(:disabled):hover::-moz-range-thumb, .fx2 .ui-slider input[type=range]:not(:disabled):active::-moz-range-thumb { transform: scale(1.1); }
/* all of it off with Instant result or reduced motion. Each thumb pseudo-element in its OWN rule: a browser that
   doesn't know one of them drops the whole selector list (Chrome drops ::-moz-*). */
html.ui-still .fx2 :is(.ui-btn, .btn, .ui-seg button, .ui-box-btn, .bar-btn, .top-wallet, .srch-chip, .ui-box, .ui-box input) { transition: none; }
html.ui-still .fx2 .ui-slider input[type=range]::-webkit-slider-thumb { transition: none; transform: none; }
html.ui-still .fx2 .ui-slider input[type=range]::-moz-range-thumb { transition: none; transform: none; }
html.ui-still .fx2 .ui-btn.is-spin::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fx2 :is(.ui-btn, .btn, .ui-seg button, .ui-box-btn, .bar-btn, .top-wallet, .srch-chip, .ui-box, .ui-box input) { transition: none; }
  .fx2 .ui-btn.is-spin::after { animation: none; }
  .fx2 .ui-slider input[type=range]::-webkit-slider-thumb { transition: none; transform: none; }
  .fx2 .ui-slider input[type=range]::-moz-range-thumb { transition: none; transform: none; }
}

/* ===== bar buttons (lane 27): colour change only, on the lock curve. The premium-pass depth (lifted frame, top-light
   bevels, bar lift, hover/press shadows) was REMOVED in 5b's polish sweep (Zach: flat like Stake). ===== */
@media (min-width: 761px) {
  .fx2 .game-bar .bar-btn { transition: background-color .15s cubic-bezier(.4, 0, .2, 1), color .15s cubic-bezier(.4, 0, .2, 1); }
}

/* ===== phones (lane 27, 5b's kit job from cd's Chicken phone read research/chicken/phone-read.json): Stake's fields are
   amount 52 / difficulty 48 / net gain 52 px tall (ours were all 44 outside, 36 inside), and Play sits 11 px under the
   stage (ours 28 = the frame's 10 px gap + the controls' 4 px border + 14 px padding). Our look stays; only the sizes. ===== */
@media (max-width: 600px) {
  .fx2 .ui-controls .ui-box { height: 52px; min-height: 52px; }
  .fx2 .ui-controls .ui-select-box { height: 48px; min-height: 48px; }
  .fx2 .ui-frame-in { gap: 0; }
  .fx2 .ui-frame-in > .ui-controls { padding-top: 7px; }   /* 0 gap + 4 border + 7 = 11 */
}
