/* Billions Earn — Premium Black Glass design system */

:root {
  color-scheme: dark;
  --bg-0: #07070c;
  --bg-1: #0c0c15;
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.09);
  --text-hi: #f1f1f8;
  --text-mid: #b7b7cc;
  --text-lo: #7d7d95;
  --cyan: #3ecbff;
  --blue: #5b7bff;
  --violet: #9b6bff;
  --emerald: #2fe0a6;
  --magenta: #ff6bd6;
  --amber: #ffb648;
  --danger: #ff5d7a;
  /* Signature accent - buttons, focus states, active nav, brand glow */
  --orange: #ff8a3d;
  --orange-hi: #ffb066;
  --orange-soft: rgba(255, 138, 61, 0.16);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-glow: 0 8px 40px rgba(255, 138, 61, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  min-height: 100vh;
  padding-bottom: 88px;
  overflow-x: hidden;
  background: var(--bg-0);
}

/*
 * Ambient RGB lighting - a real element (not a pseudo-element, to sidestep
 * any stacking-context edge cases), fixed full-viewport, sitting behind
 * everything. Two animations layered together:
 *   - ambientDrift: slowly moves each color blob's position independently
 *   - ambientHue: rotates the hue of the whole layer through the spectrum
 * The hue-rotate is isolated to this one decorative element on purpose -
 * applying it to `body` itself would shift text/photo colors too.
 */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1100px 640px at 10% -14%, rgba(62, 203, 255, 0.55), transparent 58%),
    radial-gradient(950px 700px at 108% -6%, rgba(155, 107, 255, 0.50), transparent 56%),
    radial-gradient(750px 620px at 90% 55%, rgba(255, 107, 214, 0.30), transparent 55%),
    radial-gradient(950px 750px at 50% 120%, rgba(47, 224, 166, 0.38), transparent 58%),
    radial-gradient(650px 550px at 18% 62%, rgba(255, 138, 61, 0.30), transparent 55%);
  background-repeat: no-repeat;
  background-size: 160% 160%;
  animation: ambientDrift 22s ease-in-out infinite alternate, ambientHue 30s linear infinite;
}
@media (max-width: 640px) {
  /* Cheaper on mobile GPUs: drift only, skip the hue rotation. */
  .ambient-bg { animation: ambientDrift 22s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  .ambient-bg { animation: none; }
}

@keyframes ambientDrift {
  0%   { background-position: 0% 0%, 100% 0%, 100% 60%, 50% 120%, 15% 60%; }
  50%  { background-position: 15% 10%, 90% 15%, 85% 45%, 55% 105%, 25% 45%; }
  100% { background-position: 5% -8%, 105% -4%, 95% 55%, 45% 118%, 10% 65%; }
}
@keyframes ambientHue {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; color: var(--text-mid); }
img { max-width: 100%; display: block; }

.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- Glass surfaces ---------- */
.glass-card {
  /* Near-opaque, not just tinted-translucent: backdrop-filter below actively
     samples and blurs whatever sits behind the card, including the page-wide
     .ambient-bg layer - at low opacity that blur let the ambient colors wash
     across the whole card face as a big diffuse block. This keeps enough
     translucency for a frosted-glass edge without letting the background
     dominate the card's own interior. */
  background: linear-gradient(180deg, rgba(22,21,28,0.90), rgba(15,14,19,0.94));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-glow);
}

.glass-panel {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

/* ---------- Auth page extra glow ---------- */
.auth-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: authGlowFloat 9s ease-in-out infinite alternate;
}
.auth-glow-a { width: 380px; height: 380px; top: -120px; left: -100px; background: radial-gradient(circle, rgba(255,138,61,0.4), transparent 70%); animation-delay: 0s; }
.auth-glow-b { width: 420px; height: 420px; bottom: -160px; right: -120px; background: radial-gradient(circle, rgba(155,107,255,0.35), transparent 70%); animation-delay: -4.5s; }
@keyframes authGlowFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, 25px) scale(1.12); }
  100% { transform: translate(-20px, -15px) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-glow { animation: none; }
}
.auth-card {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 1px rgba(255,138,61,0.1), 0 20px 60px rgba(0,0,0,0.45), var(--shadow-glow);
}

/* ---------- Reusable: constantly-moving RGB glow halo, for forms/cards ----------
   Deliberately a blurred CIRCLE (not a rotated rect/inherit-radius shape) so
   the spin never reveals hard corners - a rotating circle looks identical at
   every angle, only the conic-gradient's colors visibly drift around it. */
.glow-ring { position: relative; z-index: 0; }
.glow-ring::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 118%; height: 118%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--magenta), var(--orange), var(--emerald), var(--cyan));
  filter: blur(28px);
  opacity: 0.4;
  transform: translate(-50%, -50%) rotate(0deg);
  animation: glowRingSpin 8s linear infinite;
}
@keyframes glowRingSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .glow-ring::before { animation: none; }
}

/* ---------- Reusable: constantly-moving RGB light traveling the BORDER ----------
   Cheaper than .glow-ring (no blur filter) so it's safe to put on many small
   cards at once - stat tiles, admin panels - without the halo overlap/GPU cost
   of stacking dozens of blurred glow-rings side by side. A conic-gradient is
   masked down to a thin ring exactly on the card's own edge via mask-composite,
   so it is immune to overflow:hidden clipping the way .glow-ring's oversized
   halo would be. */
@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.glow-border { position: relative; z-index: 0; }
.glow-border::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle), var(--cyan), var(--violet), var(--magenta), var(--orange), var(--emerald), var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
  animation: borderAngleSpin 14s linear infinite;
  pointer-events: none;
}
@keyframes borderAngleSpin { to { --border-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) {
  .glow-border::after { animation: none; }
}

/* Softer variant for large hero cards (wallet balance, etc.) - lower
   opacity and a gentle blur so the moving light reads as an ambient glow
   right at the edge instead of a hard neon line or a big color wash
   spilling across the card's own background.
   Deliberately NOT a conic-gradient (masked border or blurred ellipse
   alike): on a very wide, short card, mapping angles onto such an
   elongated shape compresses color transitions near the left/right
   edges into a visible vertical stripe once blurred - reproduced and
   confirmed with both approaches. A hue-cycling blurred box-shadow has
   no angle-to-position mapping to distort in the first place, so it
   stays a smooth, even glow around the border at any aspect ratio. */
@property --glow-hue {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}
.glow-border-soft {
  animation: glowHueCycle 16s linear infinite;
  box-shadow: 0 0 34px 3px hsl(var(--glow-hue) 90% 62% / 0.32);
}
@keyframes glowHueCycle { to { --glow-hue: 360; } }
@media (prefers-reduced-motion: reduce) {
  .glow-border-soft { animation: none; }
}

/* QR code frame - white quiet-zone padding preserved for scannability, tighter glow */
.qr-frame {
  display: inline-block;
  background: #fff;
  padding: 14px;
  border-radius: 16px;
  line-height: 0;
  margin-bottom: 16px;
}
.qr-frame img { width: 200px; height: 200px; border-radius: 4px; }
.qr-frame.glow-border::after { padding: 2.5px; opacity: 1; animation-duration: 10s; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 7, 12, 0.72);
  border-bottom: 1px solid var(--surface-border);
}
.app-header-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, #fff 0%, #fff 35%, var(--orange-hi) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-mark {
  width: 46px; height: 46px;
  display: block; flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(255, 138, 61, 0.55));
}
.brand-mark.lg { width: 84px; height: 84px; }
.brand-mark.sm { width: 32px; height: 32px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-1); border: 1px solid var(--surface-border);
  color: var(--text-hi); position: relative; cursor: pointer;
}
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--magenta); box-shadow: 0 0 6px var(--magenta);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, opacity .12s ease;
  width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, rgba(255,138,61,0.28), rgba(255,107,61,0.18));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,160,90,0.55);
  color: var(--orange-hi);
  box-shadow: 0 0 22px rgba(255,138,61,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  text-shadow: 0 0 12px rgba(255,138,61,0.5);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(255,138,61,0.4), rgba(255,107,61,0.28));
  box-shadow: 0 0 30px rgba(255,138,61,0.55), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-secondary { background: var(--surface-2); color: var(--text-hi); border-color: var(--surface-border); }
.btn-ghost { background: transparent; color: var(--text-mid); border-color: var(--surface-border); }
.btn-danger { background: rgba(255, 93, 122, 0.12); color: var(--danger); border-color: rgba(255, 93, 122, 0.3); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-mid); margin-bottom: 7px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--surface-border);
  color: var(--text-hi); font-size: 15px; outline: none;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.16); }
.input::placeholder { color: var(--text-lo); }
select.input option { background: var(--bg-1); color: var(--text-hi); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.field-hint { color: var(--text-lo); font-size: 12.5px; margin-top: 6px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-cyan { background: rgba(62, 203, 255, 0.14); color: var(--cyan); }
.badge-emerald { background: rgba(47, 224, 166, 0.14); color: var(--emerald); }
.badge-amber { background: rgba(255, 182, 72, 0.14); color: var(--amber); }
.badge-danger { background: rgba(255, 93, 122, 0.14); color: var(--danger); }
.badge-violet { background: rgba(155, 107, 255, 0.14); color: var(--violet); }
.badge-muted { background: var(--surface-2); color: var(--text-mid); }

/* ---------- Alerts / toasts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: rgba(255, 93, 122, 0.1); color: #ffb3c1; border: 1px solid rgba(255, 93, 122, 0.25); }
.alert-success { background: rgba(47, 224, 166, 0.1); color: #a9f5da; border: 1px solid rgba(47, 224, 166, 0.25); }

#toast-stack { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 420px; }
.toast {
  padding: 13px 16px; border-radius: var(--radius-sm); background: rgba(19, 19, 32, 0.95);
  border: 1px solid var(--surface-border); backdrop-filter: blur(10px); font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: translateY(0);} }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(9, 9, 16, 0.82); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav-inner { max-width: 480px; margin: 0 auto; display: flex; justify-content: space-between; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; color: var(--text-lo); font-size: 10.5px; font-weight: 600; border-radius: 12px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--orange); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(255,138,61,0.6)); }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-tile { padding: 16px; position: relative; z-index: 0; }
.stat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--border-angle), var(--cyan), var(--violet), var(--magenta), var(--orange), var(--emerald), var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
  animation: borderAngleSpin 14s linear infinite;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .stat-tile::after { animation: none; }
}
.stat-tile .label { font-size: 12px; color: var(--text-lo); margin-bottom: 6px; }
.stat-tile .value { font-size: 19px; font-weight: 700; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-action { padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-hi); }
.quick-action .qa-icon {
  width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,138,61,0.18), rgba(255,107,61,0.1)); border: 1px solid rgba(255,138,61,0.25);
  color: var(--orange-hi);
}
.quick-action .qa-icon svg { width: 21px; height: 21px; }

.product-card { overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.product-card .img-wrap { aspect-ratio: 1.3/1; background: var(--surface-2); overflow: hidden; position: relative; flex-shrink: 0; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.marketplace-chip {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.02em; color: #fff; background: rgba(9, 9, 16, 0.72);
  border: 1px solid rgba(255,255,255,0.18); backdrop-filter: blur(4px);
  max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: rgba(9, 9, 16, 0.72);
  border: 1px solid rgba(255,255,255,0.25); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center; padding-left: 3px;
  backdrop-filter: blur(4px);
}
.product-card .body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-card .title {
  font-size: 14px; font-weight: 600; margin: 6px 0 8px; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  min-height: calc(1.35em * 2);
}
.product-card .price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.product-card .price { font-size: 16px; font-weight: 700; }
.product-card .price-original { font-size: 12.5px; color: var(--text-lo); text-decoration: line-through; }

.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -ms-overflow-style: none; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--surface-1); border: 1px solid var(--surface-border); color: var(--text-mid);
}
.tab.active { background: linear-gradient(135deg, rgba(255,138,61,0.2), rgba(255,107,61,0.16)); color: var(--orange-hi); border-color: rgba(255,138,61,0.4); }

/* ---------- Empty / skeleton ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-lo); }
.empty-state .icon { font-size: 34px; margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 37%, var(--surface-1) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Section ---------- */
.section { padding: 20px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { font-size: 16px; }
.section-head a { font-size: 12.5px; color: var(--orange); font-weight: 600; }

/* ---------- Membership badge ---------- */
.membership-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.membership-bronze { background: rgba(205,127,50,0.16); color: #e0a06a; }
.membership-silver { background: rgba(192,192,192,0.16); color: #d8d8e0; }
.membership-gold { background: rgba(232,185,35,0.16); color: #ffd873; }
.membership-platinum { background: rgba(126,232,224,0.16); color: #7ee8e0; }

/* ---------- Table (admin) ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th { text-align: left; padding: 12px 14px; color: var(--text-lo); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--surface-border); white-space: nowrap; }
table.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
table.data-table tr:hover td { background: rgba(255,255,255,0.02); }
/* Long titles/descriptions get truncated with an ellipsis (full text on hover)
   instead of stretching the row and pushing the action buttons off-screen. */
table.data-table td.cell-truncate {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The actions column stays pinned to the right on horizontal scroll, so Edit/
   Archive/etc. never require scrolling all the way across a wide row to reach. */
table.data-table th:last-child, table.data-table td:last-child {
  position: sticky; right: 0; background: #0d0d17; white-space: nowrap;
  box-shadow: -10px 0 14px -10px rgba(0,0,0,0.55);
}
table.data-table th:last-child { background: #0a0a12; }
table.data-table tr:hover td:last-child { background: #14141f; }
.admin-thumb {
  width: 42px; height: 42px; border-radius: 9px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--surface-border); display: block;
}
.admin-thumb-missing {
  width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 93, 122, 0.1); border: 1px solid rgba(255, 93, 122, 0.3); color: var(--danger); font-size: 15px;
}
.admin-thumb-empty {
  width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--surface-border); color: var(--text-lo); font-size: 13px;
}

/* ---------- Modal / bottom sheet ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } }
.modal-sheet { width: 100%; max-width: 480px; background: var(--bg-1); border: 1px solid var(--surface-border); border-radius: 22px 22px 0 0; padding: 22px; max-height: 85vh; overflow-y: auto; }
@media (min-width: 640px) { .modal-sheet { border-radius: 22px; } }

.mono { font-family: "SF Mono", Menlo, Consolas, monospace; }
.text-muted { color: var(--text-lo); }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-auto { margin-top: auto; }
.mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; }

/* ---------- Chatbot widget ---------- */
.chat-fab {
  position: fixed; bottom: 96px; right: 16px; z-index: 60; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.chat-fab-core {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--magenta));
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 10px 30px rgba(255,138,61,0.35);
}
/* Crisp neon ring hugging the icon's own edge - not a blurred oversized
   halo - so it reads as a lit border box around the icon instead of a
   diffuse color wash spilling across the corner of the screen. */
.chat-fab-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from var(--border-angle), var(--cyan), var(--violet), var(--magenta), var(--orange), var(--emerald), var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderAngleSpin 14s linear infinite;
  z-index: -1;
}
@media (prefers-reduced-motion: reduce) {
  .chat-fab-ring { animation: none; }
}
.chat-window {
  position: fixed; bottom: 96px; right: 16px; z-index: 61; width: min(360px, calc(100vw - 32px));
  max-height: 70vh; display: none; flex-direction: column; overflow: hidden;
}
.chat-window.open { display: flex; }
.chat-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--surface-border); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.chat-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--surface-border); }
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(62,203,255,0.22), rgba(91,123,255,0.22)); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.chat-quick button { font-size: 12px; padding: 7px 11px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--surface-border); color: var(--text-hi); cursor: pointer; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--surface-border); }
.chat-input-row input { flex: 1; }

/* ---------- Desktop nav (hidden on mobile, shown via media query below) ---------- */
.desktop-nav { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .chat-fab, .chat-window { bottom: 24px; }

  .container { max-width: 900px; padding: 0 24px; }
  .app-header-inner { max-width: 1180px; padding: 14px 32px; }

  .desktop-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
  .desktop-nav a {
    padding: 9px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-mid);
    display: flex; align-items: center; gap: 7px;
  }
  .desktop-nav a svg { width: 17px; height: 17px; }
  .desktop-nav a:hover { background: var(--surface-1); color: var(--text-hi); }
  .desktop-nav a.active { background: linear-gradient(135deg, rgba(255,138,61,0.16), rgba(255,107,61,0.14)); color: var(--orange-hi); }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-actions { max-width: 560px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1240px) {
  .container { max-width: 1080px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Billions Flight (virtual Game Points crash game) ---------- */
.flight-gp-balance {
  font-size: 24px; font-weight: 800; margin: 2px 0 6px;
  background: linear-gradient(120deg, #fff, var(--orange-hi));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Play panel: graph + entry/join controls as ONE visual card (glow-border
   goes on this outer wrapper) - previously two separate cards with a gap
   between them, which pushed the actual "how to play" controls further
   down the page than they needed to be. */
.flight-panel { padding: 0; overflow: hidden; }
.flight-stage {
  position: relative; overflow: hidden;
  aspect-ratio: 16/9; background: radial-gradient(ellipse at 50% 100%, rgba(255,138,61,0.1), transparent 65%), var(--surface-1);
}
.flight-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.flight-controls { padding: 14px 18px 18px; border-top: 1px solid var(--surface-border); }
.flight-multiplier {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 34px; font-weight: 800; letter-spacing: -0.01em; color: #fff;
  text-shadow: 0 0 22px rgba(255,138,61,0.6), 0 0 4px rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
}
.flight-overlay {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: rgba(6,6,10,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.flight-countdown-number {
  font-size: 46px; font-weight: 800; color: var(--orange-hi);
  text-shadow: 0 0 26px rgba(255,138,61,0.7);
  animation: flightCountdownPulse 1s ease-in-out infinite;
}
@keyframes flightCountdownPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.85; }
}
.flight-crashed-label {
  font-size: 15px; font-weight: 800; letter-spacing: 0.12em; color: var(--danger);
}
.flight-crashed-mult {
  font-size: 40px; font-weight: 800; color: #fff;
  text-shadow: 0 0 22px rgba(255,93,122,0.65);
}
.flight-join-btn, .flight-claim-btn {
  min-height: 52px; font-size: 15.5px; font-weight: 800; letter-spacing: 0.01em;
}
.flight-claim-btn {
  background: linear-gradient(135deg, var(--emerald), #1fb489); border-color: transparent;
  box-shadow: 0 0 0 0 rgba(47,224,166,0.5);
  animation: flightClaimPulse 1.6s ease-in-out infinite;
}
.flight-claim-btn.claimed { animation: none; background: var(--surface-2); color: var(--text-mid); opacity: 0.8; }
@keyframes flightClaimPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,224,166,0.45); }
  50% { box-shadow: 0 0 0 10px rgba(47,224,166,0); }
}
/* ---------- Convert card: single B$<->USD swap widget, Binance-style ---------- */
.swap-card {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 18px;
}
.swap-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta), var(--orange), var(--emerald), var(--cyan));
  background-size: 200% 100%;
  animation: swapTopGlow 6s linear infinite;
}
@keyframes swapTopGlow { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .swap-card::before { animation: none; } }
.swap-rate-badge {
  position: absolute; top: 14px; right: 16px; z-index: 1;
  font-size: 11px; font-weight: 700; color: var(--text-mid);
  background: var(--surface-2); border: 1px solid var(--surface-border);
  padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.swap-row {
  background: var(--surface-2); border: 1px solid var(--surface-border);
  border-radius: 14px; padding: 12px 14px; margin-top: 10px;
}
.swap-label { font-size: 11px; color: var(--text-mid); margin-bottom: 6px; }
.swap-input-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.swap-amount {
  background: transparent; border: none; outline: none; color: var(--text-hi);
  font-size: 22px; font-weight: 700; width: 100%; padding: 0; font-variant-numeric: tabular-nums;
}
.swap-amount::placeholder { color: var(--text-lo); }
.swap-amount[readonly] { color: var(--text-mid); }
.swap-currency {
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; color: var(--orange-hi);
  background: var(--orange-soft); padding: 5px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.swap-hint { font-size: 11px; color: var(--text-lo); margin-top: 6px; }
.swap-flip-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; margin: -8px auto 0; position: relative; z-index: 1;
  background: var(--bg-1); border: 3px solid var(--bg-0);
  color: var(--orange-hi); cursor: pointer; transition: transform 0.25s ease;
}
.swap-flip-btn:hover, .swap-flip-btn:focus-visible { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .swap-flip-btn { transition: none; } }
.swap-submit-btn { margin-top: 14px; }

.flight-wallet-link { display: inline-flex; align-items: center; gap: 4px; }
.flight-wallet-plane {
  color: var(--orange-hi); transform: translateX(0);
  animation: flightWalletPlaneFly 1.8s ease-in-out infinite;
}
@keyframes flightWalletPlaneFly {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(3px) translateY(-2px); }
}
.flight-header { padding: 16px 18px; }
.flight-howto {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.flight-howto::-webkit-scrollbar { display: none; }
.flight-howto-step {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--surface-border);
  border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 11.5px; color: var(--text-mid); white-space: nowrap;
}
.flight-howto-num {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 19px; height: 19px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--magenta)); color: #1a0f05;
  font-size: 10.5px; font-weight: 800;
}
.flight-history-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mult-pill {
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--surface-border); color: var(--text-mid);
}
.mult-pill-good { background: rgba(47,224,166,0.14); border-color: rgba(47,224,166,0.3); color: var(--emerald); }
.mult-pill-bad { background: rgba(255,93,122,0.12); border-color: rgba(255,93,122,0.28); color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .flight-countdown-number, .flight-claim-btn, .flight-wallet-plane { animation: none; }
}
