/* ================================================================
   MarketBlox — polish layer
   Loaded last on every storefront page. Shared refinements for
   depth, motion, mobile layout and consistency. Green / grey only.
   ================================================================ */

:root {
  --mb-g: #00c853;
  --mb-g2: #00e676;
  --mb-g-deep: #00953f;
  --mb-ink: #e8f5ec;
  --mb-mute: #8fb59a;
  --mb-surface: #0b1a10;
  --mb-surface-2: #10241a;
  --mb-line: rgba(0, 200, 83, .16);
  --mb-ease: cubic-bezier(.22, 1, .36, 1);
  --mb-tabbar-h: 0px;
}

/* Smooth cross-page fades in browsers that support view transitions */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .26s; animation-timing-function: ease; }

/* ── Base ─────────────────────────────────────────────────────── */
html { scrollbar-color: #0f5a2c #050d07; -webkit-tap-highlight-color: transparent; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: rgba(0, 230, 118, .32); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050d07; }
::-webkit-scrollbar-thumb { background: linear-gradient(#11643a, #0b3d1f); border-radius: 10px; border: 2px solid #050d07; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(#16804a, #0f5a2c); }
img { -webkit-user-drag: none; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--mb-g2);
  outline-offset: 3px;
}

.mbi { display: inline-block; vertical-align: -.16em; flex-shrink: 0; }

/* ── Scroll progress ─────────────────────────────────────────── */
.mb-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1003;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #00953f, #00e676 60%, #b9f6ca);
  box-shadow: 0 0 12px rgba(0, 230, 118, .7);
  pointer-events: none;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar { transition: background .3s, box-shadow .3s, backdrop-filter .3s; }
.navbar.scrolled {
  background: rgba(5, 14, 8, .82) !important;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 1px 0 rgba(0, 200, 83, .14) !important;
}
.nav-center .nav-link { position: relative; }
.nav-center .nav-link::after {
  content: ''; position: absolute; left: 50%; right: 50%; bottom: -6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--mb-g2), transparent);
  transition: left .35s var(--mb-ease), right .35s var(--mb-ease);
}
.nav-center .nav-link:hover::after,
.nav-center .nav-link.is-active::after { left: 10%; right: 10%; }
.nav-center .nav-link.is-active { color: #fff !important; }
.nav-center .ni-wrap { transition: transform .35s var(--mb-ease), filter .35s; }
.nav-center .nav-link:hover .ni-wrap { transform: translateY(-2px) rotate(-6deg) scale(1.08); filter: drop-shadow(0 6px 10px rgba(0, 200, 83, .45)); }

.hamburger { border-radius: 10px; padding: 8px !important; transition: background .2s; }
.hamburger:active { background: rgba(0, 200, 83, .12); }

/* ── Mobile menu ─────────────────────────────────────────────── */
.mobile-menu {
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(0, 200, 83, .14), transparent 60%),
    linear-gradient(180deg, #08160d, #050d07) !important;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.mobile-menu.open { animation: mbMenuIn .38s var(--mb-ease) both; }
@keyframes mbMenuIn { from { opacity: 0; transform: translateY(-12px) scale(.985); } to { opacity: 1; transform: none; } }
.mobile-menu.open .mm-game-link,
.mobile-menu.open .mm-link-row { animation: mbRowIn .45s var(--mb-ease) both; }
.mobile-menu.open > :nth-child(3) { animation-delay: .02s; }
.mobile-menu.open > :nth-child(4) { animation-delay: .04s; }
.mobile-menu.open > :nth-child(5) { animation-delay: .06s; }
.mobile-menu.open > :nth-child(6) { animation-delay: .08s; }
.mobile-menu.open > :nth-child(7) { animation-delay: .10s; }
.mobile-menu.open > :nth-child(8) { animation-delay: .12s; }
.mobile-menu.open > :nth-child(9) { animation-delay: .14s; }
.mobile-menu.open > :nth-child(10) { animation-delay: .16s; }
@keyframes mbRowIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.mm-game-link { border-radius: 14px; margin: 0 .75rem .35rem !important; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s; }
.mm-game-link:active { transform: scale(.98); background: rgba(0, 200, 83, .08); border-color: var(--mb-line); }
.mm-game-thumb { border-radius: 10px !important; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.mm-link-row { display: flex !important; align-items: center; gap: .75rem; }
.mm-link-row .mm-ico {
  width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 200, 83, .1); border: 1px solid var(--mb-line); color: var(--mb-g2); flex-shrink: 0;
}
.mm-link-row.is-active { color: var(--mb-g2) !important; }
.mm-new {
  margin-left: auto; font-size: .62rem; font-weight: 900; letter-spacing: .08em; color: #021;
  background: linear-gradient(135deg, #b9f6ca, #00e676); padding: .18rem .5rem; border-radius: 20px;
}
.mm-account-btn { box-shadow: 0 10px 30px rgba(0, 200, 83, .28); }

/* ── Buttons: depth + sheen ─────────────────────────────────── */
.btn-primary, .pc-btn-buy, .bs-btn-buy, .checkout-now-btn, .cart-checkout-btn, .drawer-checkout-btn,
.auth-btn, .auth-submit, .gvw-enter-btn, .spin-unlock-btn, .claim-btn, .hero-cta {
  position: relative; overflow: hidden; isolation: isolate;
}
.btn-primary::after, .pc-btn-buy::after, .bs-btn-buy::after, .checkout-now-btn::after,
.cart-checkout-btn::after, .drawer-checkout-btn::after, .gvw-enter-btn::after, .spin-unlock-btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -75%; width: 50%; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); transition: left .7s var(--mb-ease);
}
.btn-primary:hover::after, .pc-btn-buy:hover::after, .bs-btn-buy:hover::after, .checkout-now-btn:hover::after,
.cart-checkout-btn:hover::after, .drawer-checkout-btn:hover::after, .gvw-enter-btn:hover::after, .spin-unlock-btn:hover::after { left: 130%; }
.btn-primary:active, .pc-btn-buy:active, .pc-btn-cart:active, .bs-btn-buy:active, .bs-btn-cart:active,
.checkout-now-btn:active, .add-cart-btn:active, .cart-checkout-btn:active, .cart-nav-btn:active {
  transform: translateY(1px) scale(.97) !important;
  transition-duration: .08s !important;
}
.pc-btn-buy {
  background: linear-gradient(180deg, #19d867 0%, #00b84a 100%) !important;
  box-shadow: 0 3px 0 #007a30, 0 8px 18px -6px rgba(0, 200, 83, .55), inset 0 1px 0 rgba(255, 255, 255, .28) !important;
  color: #fff !important; text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}
.pc-btn-buy:hover { filter: brightness(1.07); box-shadow: 0 5px 0 #007a30, 0 14px 26px -8px rgba(0, 200, 83, .65), inset 0 1px 0 rgba(255, 255, 255, .3) !important; }
.pc-btn-buy.pc-btn-disabled { background: rgba(255, 255, 255, .06) !important; color: rgba(255, 255, 255, .4) !important; box-shadow: none !important; text-shadow: none; }
.pc-btn-cart { min-width: 44px; gap: .3rem; }
.pc-btn-cart svg { flex-shrink: 0; }

/* ── 3D tilt (desktop pointers only — JS adds .mb-tilt) ─────────── */
.mb-tilt { transform-style: preserve-3d; }
.mb-tilt.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) !important;
  transition: transform .1s linear, box-shadow .3s, border-color .3s !important;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 200, 83, .35), 0 18px 40px -18px rgba(0, 230, 118, .45) !important;
}
.mb-tilt.is-settling { transition: transform .55s var(--mb-ease), box-shadow .4s !important; }
.mb-glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .16), rgba(185, 246, 202, .05) 30%, transparent 55%);
  opacity: 0; transition: opacity .35s;
}
.mb-tilt.is-tilting .mb-glare { opacity: 1; }
.mb-tilt.is-tilting .pc-img-wrap img,
.mb-tilt.is-tilting .hgc-emoji img { transform: translateZ(30px) scale(1.06); }

/* ── Product cards ───────────────────────────────────────────── */
.product-card { border-radius: 20px; }
.product-card .pc-img-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 38%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5, 14, 8, .35));
}
.pc-badge-bundles { background: rgba(0, 200, 83, .14) !important; color: #69f0ae !important; border-color: rgba(0, 200, 83, .3) !important; }
.pc-badge-cyber   { background: rgba(185, 246, 202, .12) !important; color: #b9f6ca !important; border-color: rgba(185, 246, 202, .28) !important; }

/* Fixed header is ~100px tall (ticker + navbar): keep page titles clear of it */
.games-page-hero { padding-top: 8.25rem !important; }
.gvw-hero { padding-top: 132px !important; }
.aff-page { padding-top: 124px !important; }

/* Empty product badge (no label set) should not render as a green bar */
.product-badge:empty, #prod-badge:empty { display: none !important; }

/* Section headings — keep the green identity */
.bs-fire-title { display: inline-flex !important; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bs-fire-title .fire-float { display: inline-flex; filter: drop-shadow(0 6px 14px rgba(0, 230, 118, .5)) !important; }

.img-fallback { color: #2f7d4b; font-size: 0 !important; }

/* Giveaway placeholders */
.gvw-card-banner-placeholder { color: #00e676; }
.gvw-hero-badge, .gvw-meta-item, .gvw-ends-at, .gvw-entered-badge, .gvw-enter-btn { display: inline-flex; align-items: center; gap: .4em; }
.gvw-enter-btn, .gvw-entered-badge { justify-content: center; }

/* ── Account page ─────────────────────────────────────────────── */
.acc-wrap { padding-top: 8rem !important; }
body.dark .acc-tab, .acc-tab {
  background: rgba(255, 255, 255, .03) !important; border: 1.5px solid rgba(0, 200, 83, .18) !important; color: var(--mb-mute) !important;
}
body.dark .acc-tab:hover, .acc-tab:not(.active):hover { color: #fff !important; border-color: rgba(0, 200, 83, .45) !important; background: rgba(0, 200, 83, .08) !important; }
body.dark .acc-tab.active, .acc-tab.active {
  background: linear-gradient(180deg, #19d867, #00b84a) !important; color: #fff !important; border-color: transparent !important;
  box-shadow: 0 3px 0 #007a30, 0 10px 22px -8px rgba(0, 200, 83, .6) !important;
}
#tabAdmin { border-color: rgba(251, 191, 36, .35) !important; color: #fbbf24 !important; }
#tabAdmin.active { background: linear-gradient(180deg, #fbbf24, #d97706) !important; color: #1a1200 !important; }
.acc-wallet-card { background: linear-gradient(135deg, #00c853 0%, #00953f 60%, #0b6b32 100%) !important; box-shadow: 0 18px 40px -12px rgba(0, 200, 83, .5), inset 0 1px 0 rgba(255, 255, 255, .25) !important; }
.acc-wallet-card::before {
  content: ''; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); pointer-events: none;
}

/* ── Best-seller game tabs: one contained segmented bar ───────────── */
#bsGameTabs > * { --tab-color: #00c853 !important; }
.bs-tabs-wrap {
  padding: 6px !important; border-radius: 18px; max-width: 100%;
  background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 30px -18px rgba(0, 0, 0, .8);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  scroll-padding: 0 14px;
}
@media (min-width: 1000px) { .bs-tabs-wrap { -webkit-mask-image: none; mask-image: none; display: inline-block; } }
.bs-game-tabs { gap: 4px !important; padding: 0 !important; }
.bs-tab {
  gap: .6rem !important; padding: 5px 16px 5px 5px !important; border-radius: 13px !important;
  background: transparent !important; border: 1px solid transparent !important;
  color: rgba(225, 235, 228, .62) !important; font-size: .84rem !important; font-weight: 700 !important;
  transform: none !important; box-shadow: none !important;
  transition: background .25s, color .2s, border-color .25s, box-shadow .25s !important;
}
.bs-tab:hover { background: rgba(255, 255, 255, .05) !important; color: #fff !important; }
.bs-tab.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tab-color) 92%, #fff), var(--tab-color)) !important;
  color: #04140a !important;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--tab-color) 75%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
}
.bs-tab-thumb-wrap {
  position: relative; width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #1d3a27, #0e1f15); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1);
  font-size: .8rem; font-weight: 900; color: #b9f6ca;
}
.bs-tab-thumb-wrap::before { content: attr(data-initial); }
.bs-tab-thumb-wrap .bs-tab-thumb { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border-radius: 0 !important; box-shadow: none !important; object-fit: cover; }
.bs-tab.active .bs-tab-thumb-wrap { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55), 0 2px 8px rgba(0, 0, 0, .35); }
@media (max-width: 520px) {
  .bs-tab { padding: 4px 13px 4px 4px !important; font-size: .8rem !important; }
  .bs-tab-thumb-wrap { width: 26px; height: 26px; border-radius: 8px; }
}

/* The chat bubble shouldn't float over the open phone menu */
html:has(.mobile-menu.open) .mb-chat-btn, html:has(.mobile-menu.open) .mb-tabbar { opacity: 0 !important; pointer-events: none !important; }

/* ── Help / support cards: consistent icon tiles ───────────────── */
.sc-icon-wrap { color: var(--mb-g2); }
.sc-icon-wrap svg { width: 26px; height: 26px; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer { position: relative; }
.footer::before {
  content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 83, .5), transparent);
}
.footer-col a { transition: color .2s, transform .2s; display: inline-block; }
.footer-col a:hover { color: var(--mb-g2) !important; transform: translateX(3px); }

/* ── Mobile tab bar ──────────────────────────────────────────── */
.mb-tabbar { display: none; }
@media (max-width: 800px) {
  body.has-tabbar { --mb-tabbar-h: 66px; padding-bottom: calc(var(--mb-tabbar-h) + env(safe-area-inset-bottom)); }
  .mb-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 1400;
    height: 58px; border-radius: 20px; padding: 0 4px;
    background: rgba(8, 20, 12, .86);
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(0, 200, 83, .2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: transform .35s var(--mb-ease), opacity .3s;
  }
  .mb-tabbar.is-hidden { transform: translateY(calc(100% + 20px)); opacity: 0; }
  .mb-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: rgba(200, 230, 210, .55); text-decoration: none; font: 700 10.5px/1 'Plus Jakarta Sans', 'Nunito', system-ui, sans-serif;
    letter-spacing: .01em; background: none; border: 0; cursor: pointer; border-radius: 14px; transition: color .2s;
  }
  .mb-tab svg { transition: transform .3s var(--mb-ease); }
  .mb-tab:active svg { transform: scale(.86); }
  .mb-tab.is-active { color: var(--mb-g2); }
  .mb-tab.is-active::before {
    content: ''; position: absolute; top: 5px; left: 50%; width: 38px; height: 30px; transform: translateX(-50%);
    border-radius: 12px; background: rgba(0, 200, 83, .14); box-shadow: 0 0 18px rgba(0, 230, 118, .25); z-index: -1;
  }
  .mb-tab-badge {
    position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--mb-g2); color: #032; font-size: 10px; font-weight: 900; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #08140c, 0 0 10px rgba(0, 230, 118, .6);
  }
  .mb-tab-badge[data-n="0"] { display: none; }
  .mb-tab-badge.bump { animation: mbBump .45s var(--mb-ease); }
  @keyframes mbBump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

  /* Lift floating widgets above the tab bar */
  body.has-tabbar .mb-chat-btn { bottom: calc(var(--mb-tabbar-h) + 18px + env(safe-area-inset-bottom)) !important; }
  body.has-tabbar #mb-live-order,
  body.has-tabbar .rp-popup { bottom: calc(var(--mb-tabbar-h) + 18px + env(safe-area-inset-bottom)) !important; }
  body.has-tabbar .cart-toast { bottom: calc(var(--mb-tabbar-h) + 24px + env(safe-area-inset-bottom)) !important; }
}

@media (min-width: 521px) and (max-width: 800px) {
  body.has-tabbar .mb-chat-widget { bottom: calc(var(--mb-tabbar-h) + 86px + env(safe-area-inset-bottom)) !important; max-height: calc(100dvh - var(--mb-tabbar-h) - 150px) !important; }
}

/* ── Phone layout fixes ──────────────────────────────────────── */
@media (max-width: 520px) {
  .nav-right #currencyPickerSlot { display: none !important; }
  .bs-fire-title .fire-float-delay { display: none !important; }
  .bs-fire-title { flex-wrap: nowrap; }
  .products-grid { gap: .7rem !important; }
  .product-card { border-radius: 16px; }
  .pc-body { padding: .7rem .75rem .45rem !important; }
  .pc-name { font-size: .82rem !important; }
  .pc-actions { gap: .4rem !important; padding: 0 .6rem .7rem !important; }
  .pc-btn-buy { font-size: .74rem !important; letter-spacing: .03em !important; white-space: nowrap; padding: .62rem .35rem !important; border-radius: 11px !important; }
  .pc-btn-buy svg { width: 12px; height: 12px; }
  .pc-btn-cart { padding: .62rem .6rem !important; border-radius: 11px !important; }
  .pc-btn-cart .pc-cart-label { display: none; }

  .acc-wrap { padding-top: 7.25rem !important; }
  .acc-wallet-card { flex-wrap: wrap; }
  .acc-deposit-btn { width: 100%; justify-content: center; padding: .8rem !important; }

  /* Toasts drop in from the top on phones so they never cover bottom buttons */
  .cart-toast, body.has-tabbar .cart-toast, body.has-buy-bar .cart-toast { top: calc(108px + env(safe-area-inset-top)); bottom: auto !important; height: auto !important; transform: translateX(-50%) translateY(-24px) !important; max-width: calc(100vw - 32px); }
  .cart-toast.show { transform: translateX(-50%) translateY(0) !important; }
  body.mb-cart-open .mb-tabbar, body.mb-cart-open .mb-chat-btn, body.mb-cart-open #mb-live-order, body.mb-cart-open .rp-popup { opacity: 0 !important; pointer-events: none !important; }

  /* Live-order toast: compact on phones so it doesn't cover the page */
  #mb-live-order { width: auto !important; max-width: calc(100vw - 104px) !important; left: 12px !important; padding: 10px 11px !important; gap: 9px !important; }
  #mb-live-order * { font-size: 12px; }

  /* Long words / codes never force sideways scrolling */
  h1, h2, h3, p, li, td { overflow-wrap: anywhere; }
}

/* Sticky buy bar on product pages (was always hidden by a later rule) */
@media (max-width: 860px) {
  .mobile-buy-bar { display: flex !important; }
  body.has-buy-bar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.has-buy-bar .mb-chat-btn { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  body.has-buy-bar #mb-live-order, body.has-buy-bar .rp-popup { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .mobile-buy-bar .checkout-now-btn {
    background: linear-gradient(180deg, #19d867, #00b84a) !important; color: #fff !important; border: 0 !important;
    box-shadow: 0 3px 0 #007a30, 0 10px 24px -8px rgba(0, 200, 83, .6) !important; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  }
  .mobile-buy-bar .add-cart-btn {
    background: rgba(255, 255, 255, .04) !important; color: var(--mb-ink) !important; border: 1.5px solid rgba(0, 200, 83, .3) !important;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 800;
  }
}

/* ── Motion preferences ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .mb-tilt.is-tilting { transform: none !important; }
}
