/* Partner Arcade: Wallet popover + the Deposit key. Load after shared.css and stats.css
   (it reuses .lstrack and .lsicon from there). The accent colour (#8b7bff, the system's
   ONE colour) appears only on the deposit keys: this is the "buy" moment of the arcade. */
:root { --accent: #8b7bff; --accent-rgb: 139, 123, 255; }

/* ---------- header: pill + Deposit key ---------- */
.top__wallet { display: inline-flex; align-items: center; gap: 14px; justify-self: center; }
.top__wallet .bal { cursor: pointer; }
.top__wallet .bal[aria-expanded="true"] { box-shadow: var(--sh-socket), inset 0 0 0 1px rgba(242, 240, 236, .24), 0 0 0 6px #151516, 0 0 0 7px rgba(255, 255, 255, .08), -10px 16px 26px rgba(0, 0, 0, .55); }

/* the Deposit key: an accent keycap on a deep violet skirt. It breathes a soft glow, a band of
   light sweeps across it now and then (from the upper right, like everything else), it lifts
   toward the light on hover and sinks 5px when pressed. */
.depkey {
  position: relative; display: inline-block; padding: 0 0 5px; border: 0; border-radius: 15px; cursor: pointer; color: #121213;
  background: linear-gradient(180deg, #5b4fd0, #3f3596);
  box-shadow: -8px 12px 20px rgba(0, 0, 0, .5), -2px 3px 5px rgba(0, 0, 0, .35), 0 0 0 rgba(var(--accent-rgb), 0);
  transition: padding .12s ease, transform .15s var(--ease), box-shadow .3s;
  animation: depglow 3.6s ease-in-out infinite;
}
@keyframes depglow { 50% { box-shadow: -8px 12px 20px rgba(0, 0, 0, .5), -2px 3px 5px rgba(0, 0, 0, .35), 0 0 26px rgba(var(--accent-rgb), .32); } }
.depkey__face {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border-radius: 14px;
  background: radial-gradient(130% 140% at 75% 10%, #b9b0ff 0%, #8b7bff 55%, #7464ea 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .5), inset 0 -2px 4px rgba(0, 0, 0, .14);
  font: 750 15px/1 var(--sans); letter-spacing: -.005em; white-space: nowrap;
}
.depkey__face::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 38%; left: 120%; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, 0));
  transform: skewX(-18deg); animation: depsheen 5.2s ease-in-out 1.2s infinite;
}
@keyframes depsheen { 0%, 70% { left: 120%; } 92%, 100% { left: -60%; } }
.depkey svg { width: 17px; height: 17px; flex: none; transition: transform .35s var(--spring); }
.depkey:hover { transform: translate(1px, -2px); box-shadow: -10px 16px 24px rgba(0, 0, 0, .5), -2px 4px 6px rgba(0, 0, 0, .35), 0 0 34px rgba(var(--accent-rgb), .5); animation-play-state: paused; }
.depkey:hover svg { transform: rotate(90deg) scale(1.08); }
.depkey:active, .depkey.is-on { padding-bottom: 1px; transform: translateY(4px); box-shadow: -4px 6px 10px rgba(0, 0, 0, .45), 0 0 22px rgba(var(--accent-rgb), .35); animation: none; }
.depkey:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }

/* ---------- the modal: centred, the page dims behind it ---------- */
.wallet-ov {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(80% 70% at 50% 45%, rgba(10, 10, 10, .55), rgba(4, 4, 4, .86));
  animation: ovin .25s var(--ease);
}
.wallet-ov[hidden] { display: none; }
.wallet-ov.is-out { animation: ovout .2s ease-in forwards; }
.wallet-ov.is-out .wallet { animation: wout .2s ease-in forwards; }
@keyframes ovin { from { opacity: 0; } }
@keyframes ovout { to { opacity: 0; } }
html.wallet-lock { overflow: hidden; }
.wallet {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 26px; overflow-y: auto; scrollbar-width: none;
  background: radial-gradient(120% 60% at 100% 0%, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 55%), linear-gradient(195deg, #222224, #19191b 60%, #141416);
  box-shadow: inset -1.5px 1.5px 0 rgba(255, 255, 255, .07), inset 2px -3px 0 rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .025), -22px 34px 60px rgba(0, 0, 0, .7), -5px 8px 16px rgba(0, 0, 0, .45);
  transform-origin: 50% 40%; animation: win .36s var(--spring);
}
.wallet::-webkit-scrollbar { display: none; }
.wallet > * { flex-shrink: 0; }
@keyframes win { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes wout { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.wallet__head { display: flex; align-items: center; gap: 12px; }
.wallet__head h2 { margin: 0; font: 850 22px/1 var(--display); font-stretch: 88%; font-variation-settings: 'wdth' 88; letter-spacing: -.02em; }
.wallet__rate { font: 500 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--t3); }
.wallet__head .lsicon { margin-left: auto; }

/* two balances side by side, with a little channel between them that lights up when points move */
.wbals { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); align-items: stretch; }
.wbal .label { white-space: nowrap; }
.wbal { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 15px 16px; border-radius: 18px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); }
.wbal b { font: 850 24px/.95 var(--display); font-stretch: 92%; font-variation-settings: 'wdth' 92; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbal--pts b { font-size: 28px; }
.wbal b small { margin-left: 5px; font: 500 12px/1 var(--sans); letter-spacing: 0; color: var(--t3); }
.wbal__sub { font: 400 12px/1.3 var(--sans); color: var(--t2); }
.wbal__flow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.wbal__flow i { width: 5px; height: 5px; border-radius: 50%; background: #0a0a0b; box-shadow: inset -1px 1px 2px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .06); }
.wbal__flow.is-go i { animation: flowin .9s var(--ease) both; }
.wbal__flow.is-go i:nth-child(1) { animation-delay: .2s; } .wbal__flow.is-go i:nth-child(2) { animation-delay: .1s; }
.wbal__flow.is-back i { animation: flowout .9s var(--ease) both; }
.wbal__flow.is-back i:nth-child(2) { animation-delay: .1s; } .wbal__flow.is-back i:nth-child(3) { animation-delay: .2s; }
@keyframes flowin { 30% { background: rgb(var(--accent-rgb)); box-shadow: 0 0 10px rgba(var(--accent-rgb), .9); } }
@keyframes flowout { 30% { background: var(--cream); box-shadow: 0 0 10px rgba(242, 240, 236, .9); } }

.wpane { display: flex; flex-direction: column; gap: 14px; }
.wpane[hidden] { display: none; }
.wfield { display: flex; flex-direction: column; gap: 10px; }
.wfield__box input { font-size: 22px; }
.wfield__cur { font: 700 20px/1 var(--sans) !important; letter-spacing: 0 !important; color: var(--t2) !important; text-transform: none !important; }
.wquick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wquick--3 { grid-template-columns: repeat(3, 1fr); }
.wquick .ckey { min-width: 0; padding: 0; }
.wget { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 0; }
.wget .label { margin-right: auto; }
.wget b { font: 850 26px/1 var(--display); font-stretch: 92%; font-variation-settings: 'wdth' 92; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wget small { font: 500 12px/1 var(--sans); color: var(--t3); }

/* the big deposit key stands in a socket, like the shop's buy key */
.wsocket { position: relative; padding: 8px; border-radius: 26px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-socket); }
.wsocket .sparks { left: 50%; top: 40%; z-index: 2; }
.wsocket .sparks i { background: rgb(var(--accent-rgb)); box-shadow: 0 0 8px rgba(var(--accent-rgb), .9); }
.wsocket .sparks b { border-color: rgba(var(--accent-rgb), .8); }
.keycap--accent {
  --kc-face: radial-gradient(130% 140% at 75% 10%, #b9b0ff 0%, #8b7bff 55%, #7464ea 100%);
  --kc-base: linear-gradient(180deg, #5b4fd0, #3f3596); --kc-ink: #121213;
  --kc-shine: inset 0 1.5px 0 rgba(255, 255, 255, .5), inset 0 -2px 4px rgba(0, 0, 0, .14);
}
.keycap--accent .keycap__face { position: relative; overflow: hidden; height: 64px; font-size: 17px; gap: 10px; }
.keycap--accent .keycap__face::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 30%; left: 120%; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, 0));
  transform: skewX(-18deg); animation: depsheen 4.6s ease-in-out .6s infinite;
}
.keycap--accent:hover { box-shadow: -10px 16px 24px rgba(0, 0, 0, .5), -2px 4px 6px rgba(0, 0, 0, .35), 0 0 40px rgba(var(--accent-rgb), .5); }
.keycap--accent:hover svg { transform: rotate(90deg) scale(1.08); }
.keycap--accent:disabled { --kc-face: #2a2a2c; --kc-base: #3a3a3c; --kc-ink: var(--t3); --kc-shine: none; }
.keycap--accent:disabled .keycap__face::after { display: none; }
.wdone { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; border-radius: 13px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well), inset 0 0 0 1px rgba(var(--accent-rgb), .25); font: 400 13.5px/1.4 var(--sans); color: var(--t2); animation: wdone .4s var(--spring); }
.wdone[hidden] { display: none; }
.wdone b { color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; }
.wdone .led { width: 7px; height: 7px; background: rgb(var(--accent-rgb)); box-shadow: 0 0 8px rgba(var(--accent-rgb), .8); }
.wdone button { margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer; color: var(--cream); font: 600 13.5px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; }
.wdone button[hidden] { display: none; }
@keyframes wdone { from { opacity: 0; transform: translateY(-4px); } }
/* withdraw: the full breakdown, before anything is confirmed */
.wstep { display: flex; flex-direction: column; gap: 14px; }
.wstep[hidden] { display: none; }
.wbreak { display: flex; flex-direction: column; margin: 0; padding: 4px 14px; border-radius: 16px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); }
.wbreak div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font: 400 13.5px/1.3 var(--sans); color: var(--t2); font-variant-numeric: tabular-nums; }
.wbreak div + div { border-top: 1px solid var(--hair); }
.wbreak dt, .wbreak dd { margin: 0; }
.wbreak dd { color: var(--cream); font-weight: 600; white-space: nowrap; }
.wbreak__total dt { color: var(--cream); font-weight: 600; }
.wbreak__total dd { font: 850 20px/1 var(--display) !important; font-stretch: 92%; font-variation-settings: 'wdth' 92; }

/* the emailed code */
.wlead { margin: 0; font: 400 14px/1.5 var(--sans); color: var(--t2); }
.wcode { position: relative; display: flex; align-items: center; height: 64px; padding: 0 18px; border-radius: 16px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); transition: box-shadow .2s; }
.wcode:focus-within { box-shadow: var(--sh-well), inset 0 0 0 1.5px rgba(242, 240, 236, .5); }
.wcode.is-bad { box-shadow: var(--sh-well), inset 0 0 0 1.5px var(--error-line); animation: wshake .35s ease-in-out; }
.wcode.is-ok { box-shadow: var(--sh-well), inset 0 0 0 1.5px rgba(242, 240, 236, .55), 0 0 18px rgba(242, 240, 236, .12); }
@keyframes wshake { 25% { translate: -5px 0; } 50% { translate: 4px 0; } 75% { translate: -2px 0; } }
.wcode input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--cream); font: 700 30px/1 var(--sans); letter-spacing: .5em; font-variant-numeric: tabular-nums; }
.wcode input::placeholder { color: rgba(242, 240, 236, .2); }
.wcode__state { width: 9px; height: 9px; border-radius: 50%; background: #0a0a0b; box-shadow: inset -1px 1px 2px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .06); }
.wcode.is-ok .wcode__state { background: var(--cream); box-shadow: 0 0 8px rgba(242, 240, 236, .8); }
.wcode.is-bad .wcode__state { background: var(--out); box-shadow: 0 0 8px rgba(229, 140, 125, .6); }
.wcode__msg { min-height: 18px; margin: -6px 0 0; font: 500 13px/1.4 var(--sans); color: var(--t2); }
.wcode.is-bad + .wcode__msg { color: var(--error-text); }
/* Cancel and Confirm side by side, same size: Cancel in the accent, Confirm in plain grey (owner's call) */
.wconfirm { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; }
.wconfirm .keycap__face { height: 56px; font-size: 15.5px; }
.wconfirm .keycap--accent .keycap__face { height: 56px; font-size: 15.5px; }
.keycap--grey {
  --kc-face: radial-gradient(130% 140% at 75% 10%, #4a4a4d 0%, #3c3c3f 60%, #333336 100%);
  --kc-base: linear-gradient(180deg, #1d1d1f, #151517); --kc-ink: rgba(242, 240, 236, .82);
  --kc-shine: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.wconfirm .keycap:disabled { cursor: not-allowed; opacity: .45; }

/* wager goals: real tiers, real bonus, progress kept on withdraw */
.wgoal { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); }
.wgoal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wgoal__head b { font: 700 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.wgoal__groove { position: relative; height: 10px; border-radius: 999px; background: #070707; box-shadow: inset -1px 2px 3px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .05); overflow: hidden; }
.wgoal__fill { position: absolute; left: 0; top: 1px; bottom: 1px; width: 0; border-radius: 999px; background: linear-gradient(90deg, #d6d4ce, #fbfaf7); box-shadow: 0 0 12px rgba(242, 240, 236, .35); transition: width .8s var(--ease); }
.wgoal__fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(105deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 70%); background-size: 220% 100%; animation: gshine 2.8s ease-in-out infinite; }
@keyframes gshine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.wgoal p { margin: 0; font: 400 12.5px/1.5 var(--sans); color: var(--t2); }
.wgoal p b { color: var(--cream); font-weight: 600; font-variant-numeric: tabular-nums; }
.wgoal__steps { display: flex; justify-content: space-between; font: 500 10.5px/1 var(--sans); color: var(--t3); font-variant-numeric: tabular-nums; }
.wresend { align-self: center; padding: 4px 0; border: 0; background: none; cursor: pointer; font: 500 13px/1 var(--sans); color: var(--t2); border-bottom: 1px solid var(--hair2); }
.wresend:hover:not(:disabled) { color: var(--cream); }
.wresend:disabled { cursor: default; color: var(--t3); border-bottom-color: transparent; }
.wnote { margin: -2px 0 0; font: 400 12.5px/1.5 var(--sans); color: var(--t2); }

/* activity */
.wact { list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow-y: auto; border-radius: 18px; background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well); scrollbar-width: thin; scrollbar-color: rgba(242, 240, 236, .15) transparent; }
.wact__row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 10px; }
.wact__row + .wact__row { border-top: 1px solid rgba(242, 240, 236, .06); }
.wact__ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--t2); background: linear-gradient(195deg, #2a2a2c, #1e1e20 60%, #19191b); box-shadow: var(--clay-edge), -3px 5px 8px rgba(0, 0, 0, .45); }
.wact__ico svg { width: 16px; height: 16px; }
.wact__row--deposit .wact__ico { color: rgb(var(--accent-rgb)); }
.wact__what, .wact__amt { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wact__amt { text-align: right; }
.wact__what b, .wact__amt b { font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; }
.wact__what small, .wact__amt small { font: 400 11.5px/1 var(--sans); color: var(--t3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wact__empty { padding: 24px; text-align: center; font: 400 13px/1.5 var(--sans); color: var(--t2); }

/* phones: icon-only key beside the pill; the wallet is a sheet from the bottom */
@media (max-width: 620px) {
  .top__wallet { justify-self: end; gap: 10px; }
  .top__wallet .bal { height: 50px; padding: 0 16px 0 13px; }
  .depkey__face { height: 42px; padding: 0 12px; }
  .depkey__text { display: none; }
  .wallet-ov { place-items: end center; padding: 8px; }
  .wallet { width: 100%; max-height: 90vh; transform-origin: 50% 100%; animation-name: winm; }
  @keyframes winm { from { opacity: 0; transform: translateY(40px); } }
  .wbals { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); }
  .wbal { padding: 13px 13px; }
  .wbal b, .wbal--pts b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .depkey, .depkey__face::after, .keycap--accent .keycap__face::after, .wallet, .wallet-ov, .wallet-ov.is-out, .wallet-ov.is-out .wallet, .wdone, .wbal__flow i, .wgoal__fill::after { animation: none !important; }
}
