/* Isolate the native TLGAWY store from reference theme button defaults. */
html.tlgawy-reference-ui #tlgawy_store_overlay { z-index:2147483110!important; background:rgba(0,0,0,.4)!important; backdrop-filter:blur(3px)!important; -webkit-backdrop-filter:blur(3px)!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-shell { border-radius:20px!important; background:#f4f5f7!important; box-shadow:none!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-hero { background:var(--ref-chrome,#222)!important; color:#fff!important; padding:18px 22px 16px 60px!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .hero-copy { min-width:0!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .hero-copy h1 { font-size:24px!important; line-height:1.4!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .hero-balances { margin:0!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-close { display:flex!important; color:#fff!important; background:transparent!important; border:0!important; top:12px!important; left:12px!important; border-radius:50%!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay button { font-family:inherit!important; cursor:pointer; }
html.tlgawy-reference-ui #tlgawy_store_overlay button:focus-visible { outline:2px solid #03add8!important; outline-offset:2px!important; }

/* All 14 sections remain visible; labels can wrap on narrow screens. */
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs { display:grid!important; grid-template-columns:repeat(7,minmax(0,1fr))!important; grid-template-rows:none!important; grid-auto-rows:minmax(38px,auto)!important; height:auto!important; min-height:0!important; gap:6px!important; padding:8px 10px!important; background:#fff!important; overflow:visible!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button { display:flex!important; align-items:center!important; justify-content:center!important; width:100%!important; min-width:0!important; height:100%!important; min-height:38px!important; padding:5px 7px!important; margin:0!important; float:none!important; color:#444!important; background:#f4f4f4!important; border:1px solid #e6e6e6!important; border-radius:7px!important; font-size:11px!important; line-height:1.4!important; gap:5px!important; box-shadow:none!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button span { min-width:0!important; white-space:normal!important; overflow-wrap:anywhere!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button i { flex:0 0 auto!important; display:inline-block!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button.active { background:var(--ref-chrome,#222)!important; color:#fff!important; border-color:transparent!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button:not(.active):hover { background:#e9e9e9!important; color:#222!important; }

/* Explicit colours are required because the reference theme sets every
   unclassified button to white text on a transparent background. */
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-buy,
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-reward button,
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-task button,
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card.owned button,
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-retry { display:inline-flex!important; align-items:center!important; justify-content:center!important; gap:4px!important; background:#222!important; color:#fff!important; border:0!important; border-radius:7px!important; padding:8px 10px!important; min-height:32px!important; white-space:normal!important; line-height:1.4!important; font-size:11px!important; box-shadow:none!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-buy.gift-buy { background:#f0f0f0!important; color:#333!important; border:1px solid #ddd!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-buy.pause { background:#9a4f11!important; color:#fff!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-buy.resume { background:#087f5b!important; color:#fff!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay button:disabled { color:#4b5563!important; background:#e5e7eb!important; border-color:transparent!important; cursor:default!important; opacity:1!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card-foot { display:flex!important; flex-wrap:wrap!important; align-items:center!important; justify-content:space-between!important; gap:8px!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card-actions { display:flex!important; flex-wrap:wrap!important; gap:5px!important; min-width:0!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card-actions > button { flex:1 1 auto!important; min-width:0!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-grid { grid-template-columns:repeat(4,minmax(0,1fr))!important; }
/* Nested scrolling plus content-visibility:auto can leave visible cards blank.
   Keep card text painted; the original image/video observer still loads only
   previews near the viewport. */
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card { content-visibility:visible!important; contain-intrinsic-size:none!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card h3 { white-space:normal!important; overflow-wrap:anywhere!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-reward { grid-template-columns:50px minmax(0,1fr) auto!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .reward-body { min-width:0!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-security { font-weight:400!important; line-height:1.8!important; }
html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-load-error { min-height:220px; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:15px; padding:24px; text-align:center; color:#444; background:#fff; }

@media(max-width:999px) {
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs { grid-template-columns:repeat(4,minmax(0,1fr))!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-grid { grid-template-columns:repeat(3,minmax(0,1fr))!important; }
}
@media(max-width:720px) {
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-shell { border-radius:0!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-hero { flex-wrap:wrap!important; gap:8px!important; padding:12px 12px 10px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .hero-copy { width:100%!important; padding-left:36px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .hero-copy h1 { font-size:18px!important; margin:2px 0!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .hero-balances { display:flex!important; width:100%!important; gap:5px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .hero-balances > div { flex:1 1 0!important; min-width:0!important; padding:5px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .hero-balances strong { font-size:11px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs { gap:4px!important; padding:6px!important; grid-auto-rows:minmax(40px,auto)!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button { min-height:40px!important; padding:4px!important; font-size:9px!important; gap:3px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button i { display:none!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card-foot { align-items:stretch!important; flex-direction:column!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-card-actions { width:100%!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-reward { grid-template-columns:40px minmax(0,1fr)!important; gap:8px!important; padding:12px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .reward-icon { width:40px!important; height:40px!important; font-size:22px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-reward button { grid-column:1/-1!important; width:100%!important; }
}
@media(max-width:720px) and (max-height:480px) {
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs { display:flex!important; flex-wrap:nowrap!important; height:44px!important; overflow-x:auto!important; overflow-y:hidden!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button { flex:0 0 auto!important; width:auto!important; height:32px!important; min-height:32px!important; padding:4px 10px!important; }
  html.tlgawy-reference-ui #tlgawy_store_overlay .tlgawy-store-tabs button span { white-space:nowrap!important; }
}
