/* feature:wallet — the MEU SALDO window (Client/app/wallet.js) and the GM panel's Carteira tab (gm_panel.js).
   Work-ID 20260926-wallet-7b51. Built on the shared Shutdown skin: the #modal window chrome and the 24px nine-slice
   panel PNGs of ui/login (slot / frame-active), like the reward windows.
   UI hover geometry (Docs/UI_HOVER_GEOMETRY_POLICY.md): every control has its box authored in the idle rule;
   hover / focus / selected only repaint (background, colour, opacity, inset shadow, outline with negative offset). */

#modal[data-view="wallet"],#modal[data-view="gm"]{
  --wl-gold:var(--sd-gold,#efc989);--wl-gold-bright:var(--sd-gold-bright,#ffe0a0);--wl-cream:var(--sd-cream,#f0ede7);
  --wl-muted:var(--sd-secondary,#cbbbad);--wl-red:var(--sd-red,#bf4c46);--wl-red-bright:var(--sd-red-bright,#d17b6c);
  --wl-inset:var(--sd-inset,#171e30);--wl-in:#7fe0a0;--wl-out:#ff8a8a;--wl-test:#ffb347;--wl-test-ink:#1e2941;
}
.wl-root,.wl-content{display:flex;flex-direction:column;gap:10px;color:var(--wl-cream);min-width:0}
.wl-loading,.wl-empty{margin:18px 0;text-align:center;color:var(--wl-muted)}
.wl-icon{width:18px;height:18px;object-fit:contain;image-rendering:pixelated;vertical-align:middle;flex:0 0 auto}
.wl-icon.large{width:40px;height:40px}

/* Panels share the 24px nine-slice of the login/HUD slots. */
.wl-hero,.wl-fact,.wl-history-wrap,.wl-confirm{
  box-sizing:border-box;border:7px solid transparent;
  border-image:url("../login/slot.png?v=cabare-uv-1") 24 fill / 7px / 0 stretch;background-color:var(--wl-inset);
}
.wl-hero{display:flex;align-items:center;gap:14px;padding:8px 12px;min-height:104px}
.wl-hero.test{border-image-source:url("../login/frame-active.png?v=cabare-uv-1")}
.wl-crest{display:grid;place-items:center;width:64px;height:64px;flex:0 0 64px;border-radius:50%;
  background:radial-gradient(circle at 50% 40%,#28324a,#192135 70%);box-shadow:inset 0 0 0 2px var(--wl-gold),0 0 12px #efc98955}
.wl-hero-copy{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}
.wl-hero-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.wl-hero h3{margin:0;font-size:16px;letter-spacing:.08em;color:var(--wl-gold-bright);text-transform:uppercase}
.wl-amount{display:block;font-size:30px;line-height:1.1;font-weight:900;color:var(--wl-cream);font-variant-numeric:tabular-nums;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-sub,.wl-note{margin:0;color:var(--wl-muted);font-size:12px;line-height:1.35}
.wl-note{text-align:center}
.wl-heading{margin:2px 0 0;color:var(--wl-gold);font-size:13px;letter-spacing:.08em}

/* The test money label: a fixed pill, never a control. */
.wl-test-badge{display:inline-flex;align-items:center;box-sizing:border-box;height:22px;padding:0 10px;border-radius:3px;
  background:repeating-linear-gradient(135deg,var(--wl-test) 0 8px,#ffc56d 8px 16px);color:var(--wl-test-ink);
  font-size:11px;font-weight:900;letter-spacing:.12em;white-space:nowrap;box-shadow:inset 0 0 0 1px #0d111c55}

.wl-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.wl-fact{display:flex;flex-direction:column;gap:2px;padding:4px 8px;min-width:0}
.wl-fact span{color:var(--wl-muted);font-size:11px;letter-spacing:.1em}
.wl-fact strong{color:var(--wl-gold-bright);font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* History */
.wl-history-wrap{padding:2px 4px;max-height:min(42vh,340px);overflow:auto}
.wl-history{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.wl-row{display:grid;grid-template-columns:minmax(0,8.5rem) minmax(0,1fr) 3.4rem minmax(0,7rem) minmax(0,7rem);align-items:center;gap:8px;
  padding:6px 4px;border-bottom:1px solid #ffffff14;font-size:12px;min-height:38px;box-sizing:border-box}
.wl-row:last-child{border-bottom:0}
.wl-row-time{color:var(--wl-muted);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-row-what{display:flex;flex-direction:column;min-width:0}
.wl-row-what strong{color:var(--wl-cream);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-row-what small{color:var(--wl-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-row-delta,.wl-row-after{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-row-delta{font-weight:800}
.wl-row.in .wl-row-delta{color:var(--wl-in)}
.wl-row.out .wl-row-delta{color:var(--wl-out)}
.wl-row-after{color:var(--wl-muted)}
.wl-chip{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:18px;padding:0 4px;border-radius:2px;
  font-size:10px;font-weight:900;letter-spacing:.08em}
.wl-chip.test{background:var(--wl-test);color:var(--wl-test-ink)}
.wl-chip.empty{visibility:hidden}

/* Pager: fixed buttons, only paint changes with the state. */
.wl-pager{display:flex;align-items:center;justify-content:center;gap:10px}
#modal[data-view] .wl-pager :is(.wl-page-prev,.wl-page-next){box-sizing:border-box;width:128px;min-width:128px;max-width:128px;height:32px;
  margin:0;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#modal[data-view] .wl-pager :is(.wl-page-prev,.wl-page-next):disabled{opacity:.45}
.wl-page-label{min-width:7rem;text-align:center;color:var(--wl-muted);font-variant-numeric:tabular-nums}

/* GM panel: Carteira tab */
#modal[data-view="gm"] .gm-tab i.fa-solid.fa-wallet::before{content:"";display:inline-block;width:1.25em;height:1.25em;vertical-align:-.15em;
  background:url("../GameIcon/icons/ui-money.png?v=10") center/contain no-repeat;image-rendering:pixelated}
.wl-gm-balance{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:2px 0 6px}
.wl-gm-balance .wl-amount{font-size:24px}
.wl-blocked{display:block;color:var(--wl-out)}
#modal[data-view="gm"] .wl-gm .wl-review{box-sizing:border-box;width:160px;min-width:160px;max-width:160px;height:34px;margin:0;padding:0 8px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-confirm{display:flex;flex-direction:column;gap:6px;padding:8px 10px;margin-top:8px}
.wl-confirm.credit{box-shadow:inset 0 0 0 1px #7fe0a055}
.wl-confirm.debit{box-shadow:inset 0 0 0 1px #ff8a8a55}
.wl-confirm h3{margin:0;font-size:14px;letter-spacing:.06em;color:var(--wl-gold-bright);text-transform:uppercase}
.wl-confirm .gm-row{flex-wrap:nowrap;gap:8px}
.wl-confirm-amount{margin:0;font-size:24px;font-weight:900;font-variant-numeric:tabular-nums}
.wl-confirm.credit .wl-confirm-amount{color:var(--wl-in)}
.wl-confirm.debit .wl-confirm-amount{color:var(--wl-out)}
#modal[data-view="gm"] .wl-confirm :is(.wl-confirm-go,.wl-confirm-cancel){box-sizing:border-box;width:112px;min-width:112px;max-width:112px;height:34px;
  margin:0;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#modal[data-view="gm"] .wl-confirm :is(.wl-confirm-go,.wl-confirm-cancel):focus-visible{outline:2px solid var(--wl-gold-bright);outline-offset:-4px}
#modal[data-view="gm"] .wl-gm .wl-history-wrap,#modal[data-view="gm"] .wl-gm .wl-history{max-height:none}

@media (max-width:720px){
  .wl-row{grid-template-columns:minmax(0,1fr) 3rem minmax(0,6rem);grid-template-areas:"what chip delta" "time chip after"}
  .wl-row-time{grid-area:time}.wl-row-what{grid-area:what}.wl-row .wl-chip{grid-area:chip}.wl-row-delta{grid-area:delta}.wl-row-after{grid-area:after}
  .wl-amount{font-size:24px}
  .wl-facts{grid-template-columns:repeat(3,minmax(0,1fr))}
}
