/* GAMEBOXLY — header balance with reused Libyana artwork.
   The balance still comes from the authenticated wallet_accounts query. */
body .topbar .account-wallet-group{display:flex!important;align-items:center!important;min-width:0}
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
  direction:rtl!important;display:flex!important;align-items:center!important;justify-content:center!important;
  gap:8px!important;box-sizing:border-box!important;
  max-width:min(100%,290px)!important;min-height:56px!important;
  padding:6px 8px!important;margin:0!important;
  border:1px solid #8975e37c!important;border-radius:21px!important;
  background:radial-gradient(circle at 7% 0%,#7955ff36,transparent 44%),linear-gradient(115deg,#111937,#202350 70%,#191c43)!important;
  color:#fff!important;
  box-shadow:inset 0 1px #e4d8ff35,0 5px 0 -3px #9d82ff52,0 12px 26px #04051854!important;
  isolation:isolate;
  transition:transform .2s ease,box-shadow .2s ease!important;
}
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip.hidden{display:none!important}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{
  display:grid;place-items:center;position:relative;flex:0 0 40px;
  width:40px;height:40px;box-sizing:border-box;overflow:hidden;
  padding:5px;border-radius:14px;
  background:linear-gradient(135deg,#fff,#f2eafa);
  border:1px solid #f3e5ff94;
  box-shadow:inset 0 1px #fff,0 0 17px #bc75e42b;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge img{
  display:block;width:100%;height:100%;object-fit:contain;
  position:relative;z-index:2;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge img:not([src]),
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge img[src=""]{display:none}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-fallback{
  display:grid;place-items:center;position:absolute;inset:0;
  font:900 14px/1.2 system-ui,sans-serif;color:#9a2794;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-wallet-balance-content{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
  flex:1 1 auto;min-width:0;gap:1px;
  text-align:right;
}
#customerWalletChip.gb-libyana-wallet-chip .customer-wallet-label{
  display:block!important;color:#c8bced!important;
  font:600 10px/1.5 'IBM Plex Sans Arabic',system-ui,sans-serif!important;
  white-space:nowrap;
}
#customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  display:block;color:#fff!important;font:850 clamp(12px,1.3vw,17px)/1.35 'IBM Plex Sans Arabic',system-ui,sans-serif!important;
  font-variant-numeric:tabular-nums;white-space:nowrap;
  text-shadow:0 1px 12px #ffffff25;
}
body .topbar .account-wallet-group #customerTopupShortcut{
  display:grid!important;place-items:center!important;flex:0 0 40px!important;
  width:40px!important;height:40px!important;min-height:40px!important;min-width:40px!important;
  border-radius:50%!important;
  padding:0!important;
  border:1px solid #e8d4ff99!important;
  background:radial-gradient(circle at 25% 20%,#c091ff,#9050fd 48%,#5b37d3)!important;
  box-shadow:inset 0 2px 1px #ffffff59,0 0 0 3px #a55fff20,0 3px 16px #9659f77a!important;
  color:#fff!important;cursor:pointer!important;
  transition:transform .18s ease,filter .18s ease!important;
}
#customerTopupShortcut svg{
  display:block;width:22px;height:22px;
  fill:none;stroke:currentColor;stroke-width:2.6;
  stroke-linecap:round;stroke-linejoin:round;
}
body .topbar #customerTopupShortcut:active{transform:scale(.92)!important}
body .topbar #customerTopupShortcut:hover{filter:brightness(1.08)}
body .topbar #customerTopupShortcut:focus-visible{outline:2px solid #fff!important;outline-offset:3px!important}
@media(max-width:760px){
  body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    min-height:50px!important;padding:5px 6px!important;border-radius:18px!important;gap:7px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{
    flex-basis:32px;width:32px;height:32px;border-radius:11px;padding:4px;
  }
  body .topbar .account-wallet-group #customerTopupShortcut{
    width:35px!important;height:35px!important;min-width:35px!important;min-height:35px!important;
    flex-basis:35px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{font-size:13px!important}
  #customerWalletChip.gb-libyana-wallet-chip .customer-wallet-label{font-size:9px!important}
}
@media(max-width:390px){
  body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    min-height:45px!important;padding:4px!important;gap:5px!important;max-width:190px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{
    flex-basis:29px;width:29px;height:29px;padding:3px;border-radius:9px;
  }
  body .topbar .account-wallet-group #customerTopupShortcut{
    width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;flex-basis:30px!important;
  }
  body .topbar .account-wallet-group #customerTopupShortcut svg{width:18px;height:18px}
  #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{font-size:12px!important}
  #customerWalletChip.gb-libyana-wallet-chip .customer-wallet-label{font-size:8px!important}
}
@media(max-width:350px){
  body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{max-width:161px!important;gap:4px!important}
  #customerWalletChip.gb-libyana-wallet-chip .customer-wallet-label{display:none!important}
  #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{font-size:11px!important}
  #customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{width:26px;height:26px;flex-basis:26px}
  body .topbar .account-wallet-group #customerTopupShortcut{
    width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;flex-basis:28px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #customerWalletChip.gb-libyana-wallet-chip,#customerTopupShortcut{transition:none!important}
}

/* Avoid any broken image marker; preserve the compact Li fallback. */
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge img{
  background:#fff;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge:has(img[src]) .gb-libyana-fallback{
  display:none;
}
#customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  overflow:hidden;text-overflow:ellipsis;max-width:100%;
}

/* Compact Libyana balance aligned beside the signed-in Google profile image.
   This is visual only: existing real-time balance, carrier selection and top-up stay active. */
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
  display:grid!important;
  direction:rtl!important;
  grid-template-columns:33px minmax(0,1fr) 33px!important;
  align-items:center!important;
  gap:5px!important;
  width:187px!important;
  max-width:187px!important;
  min-width:0!important;
  min-height:43px!important;
  height:43px!important;
  box-sizing:border-box!important;
  padding:3px 5px!important;
  margin:0!important;
  border:2px solid #575a69!important;
  border-radius:999px!important;
  background:linear-gradient(125deg,#292c36,#20222e 54%,#262834)!important;
  box-shadow:0 4px 11px #01030a38,inset 0 1px 2px #ffffff1c!important;
  transition:background .2s,border-color .2s!important;
}
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip.hidden{
  display:none!important;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{
  grid-column:1;
  display:grid!important;place-items:center!important;
  flex:none!important;
  width:33px!important;height:33px!important;
  min-width:33px!important;
  padding:2px!important;
  border:2px solid #eeeef2!important;
  border-radius:50%!important;
  background:#fff!important;
  box-shadow:0 1px 8px #ffffff2e!important;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge img{
  width:100%!important;height:100%!important;
  border-radius:50%!important;object-fit:contain!important;
}
#customerWalletChip.gb-libyana-wallet-chip .gb-wallet-balance-content{
  grid-column:2;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:none!important;
  width:100%!important;
  min-width:0!important;
  text-align:center!important;
}
#customerWalletChip.gb-libyana-wallet-chip .customer-wallet-label{display:none!important}
#customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  display:block!important;
  max-width:100%!important;
  margin:0!important;
  text-align:center!important;
  direction:ltr!important;
  unicode-bidi:isolate!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#f5f5f7!important;
  font:850 19px/1.2 system-ui,"IBM Plex Sans Arabic",sans-serif!important;
  letter-spacing:.1px!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  text-shadow:none!important;
}
body .topbar .account-wallet-group #customerTopupShortcut{
  grid-column:3;
  display:grid!important;place-items:center!important;
  width:33px!important;height:33px!important;
  min-width:33px!important;min-height:33px!important;
  flex:none!important;
  padding:0!important;
  border:1.5px solid #ee78c8!important;
  border-radius:50%!important;
  background:linear-gradient(145deg,#dd43b0,#bf2695)!important;
  color:#fff!important;
  box-shadow:inset 0 1px 2px #ffffff55,0 2px 10px #c82ea74b!important;
}
body .topbar .account-wallet-group #customerTopupShortcut svg{
  width:20px!important;height:20px!important;stroke-width:2.8!important;
}
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip[data-wallet-carrier="madar"]{
  border-color:#638679!important;
  background:linear-gradient(125deg,#1c3931,#18352d)!important;
}
body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip[data-wallet-carrier="madar"] #customerTopupShortcut{
  background:#1b694a!important;
  border-color:#89cea9!important;
  box-shadow:inset 0 1px #ffffff35!important;
}
@media(max-width:900px){
  /* Restore a single header row; the wallet sits immediately beside the profile photo. */
  body.l1017-live-ui .topbar:has(#customerWalletChip:not(.hidden)){
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    height:68px!important;
    min-height:68px!important;
    padding:8px 11px!important;
    gap:6px!important;
  }
  body.l1017-live-ui .topbar .account-wallet-group:has(#customerWalletChip:not(.hidden)){
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    order:8!important;
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    margin:0 0 0 0!important;
  }
  body.l1017-live-ui .topbar #googleProfileButton:not(.hidden){
    order:9!important;
    margin:0!important;
    width:40px!important;height:40px!important;
    flex:0 0 40px!important;
  }
  body.l1017-live-ui .topbar .brand{
    order:3!important;
    flex:0 1 auto!important;
    min-width:0!important;
    margin:0 auto 0 0!important;
  }
  body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:clamp(140px,39vw,170px)!important;
    max-width:170px!important;
    min-height:40px!important;height:40px!important;
    grid-template-columns:30px minmax(0,1fr) 30px!important;
    gap:4px!important;
    padding:3px 4px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip .gb-libyana-badge{
    width:30px!important;height:30px!important;min-width:30px!important;
  }
  body .topbar .account-wallet-group #customerTopupShortcut{
    width:30px!important;height:30px!important;
    min-width:30px!important;min-height:30px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
    font-size:18px!important;
  }
}
@media(max-width:430px){
  body.l1017-live-ui .topbar:has(#customerWalletChip:not(.hidden)){
    padding-inline:9px!important;
    gap:5px!important;
  }
  body.l1017-live-ui .topbar .brand{
    max-width:65px!important;
    flex:0 1 65px!important;
  }
  body.l1017-live-ui .topbar .brand b{
    font-size:15px!important;
    letter-spacing:-.5px!important;
  }
  body.l1017-live-ui .topbar #phMenuButton,
  body.l1017-live-ui .topbar #llHeaderSearch{
    width:36px!important;height:36px!important;flex:0 0 36px!important;
  }
  body.l1017-live-ui .topbar #googleProfileButton:not(.hidden){
    width:38px!important;height:38px!important;flex:0 0 38px!important;
  }
  body .topbar .account-wallet-group #customerWalletChip.gb-libyana-wallet-chip{
    width:clamp(134px,38vw,157px)!important;
    max-width:157px!important;
  }
  #customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
    font-size:17px!important;
  }
}
@media(max-width:350px){
  body.l1017-live-ui .topbar:has(#customerWalletChip:not(.hidden)) #llHeaderSearch{
    display:none!important;
  }
}

/* Keep the authenticated wallet amount readable without "40..." truncation.
   JS only scales the typography; this stylesheet never changes balances. */
#customerWalletChip.gb-libyana-wallet-chip .gb-wallet-balance-content{
  overflow:visible!important;
}
#customerWalletChip.gb-libyana-wallet-chip #customerHeaderBalance{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  font-size:var(--l1017-header-balance-font-size,16px)!important;
  font-variant-numeric:tabular-nums lining-nums!important;
  letter-spacing:-.2px!important;
  font-feature-settings:"tnum" 1;
}
