/* SudanGamesPay website — calm white + green storefront.
   Palette eyeballed from the owner's home reference (see DESIGN_MAP.md
   §6.1); the approved preview's exact hex could not be fetched
   (muse.ai blocked), so these are close approximations to re-check
   against the preview when it is reachable. */
:root {
  --bg: #F4FAF6;
  --card: #FFFFFF;
  --green: #0B6B3A;
  --green-mid: #16A34A;
  --green-soft: #E8F5EC;
  --green-pale: #D9F0E2;
  --green-line: #BFE6CC;
  --text: #0F241A;
  --muted: #5A6B60;
  --border: #E3EDE7;
  --red: #C0392B;
  --gold: #B98A1D;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(11, 107, 58, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--green); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }
img { max-width: 100%; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex: none;
  box-shadow: 0 0 0 3px var(--green-pale);
}
.brand .name { font-weight: 800; color: var(--green); font-size: 17px; white-space: nowrap; }
.wallet-pill {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green);
  border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: 15px;
  border: none;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--green); font-size: 18px; position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon-btn .dot {
  position: absolute; top: 6px; inset-inline-end: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--red);
  border: 2px solid #fff;
}
.back-btn {
  border: none; background: none; color: var(--green);
  font-size: 22px; font-weight: 800; padding: 4px 8px;
}

/* ---------- search ---------- */
.search-row { display: flex; gap: 10px; padding: 12px 14px 4px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 0 14px; height: 46px; box-shadow: var(--shadow);
}
.search-box input { border: none; outline: none; flex: 1; background: none; color: var(--text); }
.search-box input::placeholder { color: var(--muted); }
.filter-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--border);
  background: #fff; color: var(--green); font-size: 18px; box-shadow: var(--shadow);
}

/* ---------- hero ---------- */
.hero {
  margin: 12px 14px; border-radius: 20px;
  background: linear-gradient(135deg, #D9F0E2, #BFE6CC 60%, #A8DDBB);
  padding: 20px; display: flex; gap: 12px; align-items: center;
  min-height: 150px; box-shadow: var(--shadow); overflow: hidden;
}
.hero .txt { flex: 1; }
.hero h1 { margin: 0 0 12px; font-size: 22px; line-height: 1.5; color: var(--green); font-weight: 900; }
.hero .art { font-size: 44px; line-height: 1.1; text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: none; border-radius: 999px;
  padding: 11px 22px; font-size: 16px; font-weight: 800;
}
.btn:disabled { background: #B9CFC2; color: #fff; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green-line); }
.btn.danger { background: var(--red); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.block { width: 100%; }

/* ---------- sections ---------- */
.section { padding: 6px 14px; }
.section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 900; color: var(--green); margin: 14px 0 10px;
}
.section-head::before { content: ""; width: 5px; height: 22px; background: var(--green); border-radius: 3px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 4px 10px; text-align: center; box-shadow: var(--shadow);
  border: none; color: var(--text);
}
.tile .ic {
  width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
}
.tile .lbl { font-size: 13px; font-weight: 700; line-height: 1.4; }
.tile.soon { opacity: .65; }
.tile.soon .tag { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- social + more banners ---------- */
.banner {
  margin: 10px 14px; border-radius: 20px; background: var(--green-soft);
  padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
}
.banner .txt { flex: 1; }
.banner h3 { margin: 0 0 4px; color: var(--green); font-size: 17px; }
.banner p { margin: 0; color: var(--muted); font-size: 14px; }
.banner .art { font-size: 40px; }

/* ---------- cards / lists ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 10px 14px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 6px; font-size: 18px; color: var(--green); }
.card h3 { margin: 14px 0 6px; font-size: 16px; color: var(--green); }
.card p { margin: 6px 0; line-height: 1.7; color: var(--text); }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row .grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.price { font-weight: 800; color: var(--green); }
.price .sdg { display: block; font-size: 13px; color: var(--muted); font-weight: 700; }
.big-balance { font-size: 34px; font-weight: 900; color: var(--green); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: var(--green-soft); color: var(--green);
}
.pill.red { background: #FDECEA; color: var(--red); }
.pill.gold { background: #FBF3DC; color: var(--gold); }

/* ---------- game cards (dark glowing frame) ---------- */
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 14px; }
.game-card { background: none; border: none; padding: 0; text-align: center; }
.game-frame {
  position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #0E2A3F, #081826 70%);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 2px #16A34A, 0 0 18px rgba(22, 163, 74, .55), 0 0 34px rgba(34, 211, 238, .25);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 8px 6px;
}
.game-frame::before, .game-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: 15px; pointer-events: none;
  background:
    radial-gradient(circle at 8% 8%, rgba(22,163,74,.35), transparent 40%),
    radial-gradient(circle at 92% 92%, rgba(34,211,238,.28), transparent 40%);
}
.game-frame .brand-top, .game-frame .brand-bottom {
  color: #fff; font-weight: 900; text-shadow: 0 1px 4px rgba(0,0,0,.7); z-index: 2; line-height: 1.15;
}
.game-frame .brand-top .t1, .game-frame .brand-bottom .t1 { font-size: 15px; letter-spacing: .5px; }
.game-frame .brand-top .t2, .game-frame .brand-bottom .t2 { font-size: 9px; font-weight: 700; opacity: .9; }
.game-frame .art { z-index: 2; width: 72%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); }
.game-frame .art-fallback { z-index: 2; font-size: 54px; }
.game-frame .corner {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: var(--green); z-index: 3;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900;
  box-shadow: 0 0 10px rgba(22,163,74,.9), 0 0 0 2px rgba(34,211,238,.6);
}
.game-frame .corner.tl { top: 6px; inset-inline-start: 6px; }
.game-frame .corner.tr { top: 6px; inset-inline-end: 6px; }
.game-frame .corner.bl { bottom: 6px; inset-inline-start: 6px; }
.game-frame .corner.br { bottom: 6px; inset-inline-end: 6px; }
.game-name { margin-top: 8px; font-weight: 800; font-size: 15px; }
.game-sub { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------- pack grid (product page) ---------- */
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 14px; }
.pack {
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow);
}
.pack.sel { border-color: var(--green-mid); background: var(--green-soft); box-shadow: 0 0 0 2px var(--green-mid); }
.pack .nm { font-weight: 800; font-size: 16px; }
.pack .pr { margin-top: 6px; font-weight: 800; color: var(--green); font-size: 15px; }
.pack .pr .sdg { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.pack .out { color: var(--red); font-size: 12px; font-weight: 800; }

/* ---------- forms ---------- */
.field { margin: 10px 0; }
.field label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--green-line); border-radius: 12px;
  padding: 12px 14px; background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px var(--green-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field input:disabled { background: var(--green-soft); }
.qty-row { display: flex; align-items: center; gap: 12px; }
.qty-row button {
  width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--green-line);
  background: #fff; color: var(--green); font-size: 20px; font-weight: 900;
}
.qty-row .qv { font-size: 18px; font-weight: 900; min-width: 34px; text-align: center; }
.total-bar {
  margin: 14px; border-radius: var(--radius); background: var(--green);
  color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center;
}
.total-bar .t { font-weight: 800; }
.total-bar .v { font-weight: 900; font-size: 20px; }
.total-bar .s { font-size: 12px; opacity: .85; }
.buy-wrap { padding: 4px 14px 10px; }
.ok-msg { color: var(--green); font-weight: 800; }
.err-msg { color: var(--red); font-weight: 800; }
details.info { margin: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
details.info summary { font-weight: 900; color: var(--green); cursor: pointer; font-size: 16px; }
details.info p { line-height: 1.8; color: var(--text); }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 20px));
  background: #fff; border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 6px 24px rgba(11, 107, 58, .16);
  display: flex; z-index: 50;
}
.bottomnav a {
  flex: 1; text-align: center; padding: 10px 2px 8px; color: var(--muted);
  font-size: 12px; font-weight: 700; border-inline-start: 1px solid var(--border);
}
.bottomnav a:first-child { border-inline-start: none; }
.bottomnav a .ic { display: block; font-size: 20px; line-height: 1.2; }
.bottomnav a.active { color: var(--green); }
.bottomnav a.active .ic { font-weight: 900; }

/* ---------- misc ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin: 8px 14px; box-shadow: var(--shadow);
}
.list-row .thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--green-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px; z-index: 99; max-width: 90vw; text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
}
.tabs { display: flex; gap: 8px; padding: 8px 14px; overflow-x: auto; }
.tabs button {
  border: 1.5px solid var(--green-line); background: #fff; color: var(--green);
  border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 14px; white-space: nowrap;
}
.tabs button.active { background: var(--green); color: #fff; border-color: var(--green); }
.addr-box {
  direction: ltr; text-align: left; background: var(--green-soft);
  border-radius: 10px; padding: 10px 12px; word-break: break-all; font-size: 13px; font-weight: 700;
}
.toggle {
  width: 52px; height: 30px; border-radius: 999px; border: none; position: relative; flex: none;
  background: #CBD5CF; transition: background .15s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .15s;
}
.toggle.on { background: var(--green-mid); }
.toggle.on::after { transform: translateX(-22px); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: start; vertical-align: middle; }
.admin-table th { color: var(--green); font-size: 13px; }
.admin-table input[type=text], .admin-table input[type=number] { width: 100%; padding: 6px 8px; border: 1.5px solid var(--green-line); border-radius: 8px; font-size: 14px; }
@media (max-width: 380px) {
  /* v1.05 web: the reference keeps 4 tiles per row even on narrow
     phones — shrink the tiles instead of reflowing to 3. */
  .tile { padding: 10px 2px 8px; }
  .tile .ic { width: 44px; height: 44px; font-size: 20px; }
  .tile .lbl { font-size: 11px; }
  .brand .name { font-size: 15px; }
}

/* ---------- login branding (v1.04 #3) ---------- */
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-brand .logo { font-size: 34px; }
.login-brand .name { font-weight: 900; color: var(--green); font-size: 21px; }
.login-preview { margin: 14px 0 4px; }
.login-preview .hero { margin: 0 0 10px; }
.login-preview .tiles { grid-template-columns: repeat(3, 1fr); }

/* ================================================================
   v1.05 — website rebuild (browser, /): pixel-faithful to the
   owner's reference image 163830_5_qnjv.png. Only the shell + home
   change here; every inner page keeps the styles above untouched.
   The Telegram shell (static/index.html + static/style.css) is
   NOT affected by anything in this section.
   ================================================================ */

/* ---------- header (web): logo / wallet / bell / hamburger ---------- */
.topbar .brand .logo svg { width: 24px; height: 24px; display: block; }
.topbar .brand .logo {
  width: 44px; height: 44px; font-size: 0;
  background: radial-gradient(circle at 30% 25%, #17A34A, #0B6B3A 70%);
  box-shadow: 0 0 0 3px #D9F0E2, 0 0 0 5px #EFF8F1;
}
.topbar .brand .name { font-size: 19px; letter-spacing: -.2px; }
.wallet-pill svg { width: 19px; height: 19px; flex: none; }
.wallet-pill.guest #walletAmt { display: none; }
.wallet-pill.guest { padding: 8px 10px; }
.icon-btn svg { width: 21px; height: 21px; display: block; }
.icon-btn { box-shadow: var(--shadow); }

/* ---------- search (web): filter first, magnifier at the end ---------- */
.search-box .mag { display: flex; align-items: center; color: var(--muted); flex: none; }
.search-box .mag svg { width: 20px; height: 20px; }
.filter-btn svg { width: 22px; height: 22px; display: block; margin: 0 auto; }

/* ---------- hero (web): controller + gift cards, carousel dots ---------- */
.hero-web {
  margin: 12px 14px 0; border-radius: 22px; position: relative;
  background: linear-gradient(120deg, #DDF3E4 0%, #C4EAD2 55%, #A9DCBC 100%);
  padding: 18px 16px; display: flex; align-items: center; gap: 8px;
  min-height: 178px; box-shadow: var(--shadow); overflow: hidden;
}
.hero-web::after {
  content: ""; position: absolute; inset-inline-start: -40px; bottom: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255,255,255,.35); pointer-events: none;
}
.hero-web .txt { flex: 1; position: relative; z-index: 2; }
.hero-web h1 { margin: 0 0 14px; font-size: 23px; line-height: 1.55; color: var(--green); font-weight: 900; }
.hero-web .btn { padding: 11px 20px; font-size: 15px; box-shadow: 0 4px 14px rgba(11,107,58,.35); }
.hero-web .art { position: relative; width: 196px; height: 148px; flex: none; z-index: 1; }
.hero-web .pad { position: absolute; inset-inline-start: 2px; top: 6px; width: 178px; transform: rotate(-5deg); filter: drop-shadow(0 10px 12px rgba(11,107,58,.28)); }
.hero-web .pad svg { width: 100%; height: auto; display: block; }
.mini-card {
  position: absolute; width: 82px; height: 106px; border-radius: 10px;
  background: #101010; color: #fff; overflow: hidden;
  box-shadow: 0 8px 16px rgba(0,0,0,.35); display: flex; flex-direction: column;
}
.mini-card.play { inset-inline-end: 4px; bottom: 0; transform: rotate(7deg); }
.mini-card.pubg { inset-inline-start: 6px; bottom: 2px; transform: rotate(-8deg); border: 2px solid #C9A227; }
.mini-card img { width: 100%; height: 72px; object-fit: cover; display: block; }
.mini-card .mc-label {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900; letter-spacing: .4px; text-align: center; line-height: 1.3;
}
.mini-card.pubg .mc-label { color: #F5C518; font-size: 10px; }
.mini-card.play .mc-play { flex: 1; display: flex; align-items: center; justify-content: center; }
.mini-card.play .mc-play svg { width: 30px; height: 30px; }
.mini-card.play .mc-label { color: #E8F5EC; font-size: 10px; font-weight: 700; padding-bottom: 6px; }
.dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 2px; }
.dots span { width: 9px; height: 9px; border-radius: 999px; background: #C4D8CB; }
.dots span.on { width: 26px; background: var(--green); }

/* ---------- service tiles (web): 4 + 3, designed SVG icons ---------- */
.tiles { grid-template-columns: repeat(4, 1fr); }
.tile .ic svg { width: 28px; height: 28px; display: block; }
.tile .ic { background: var(--green-soft); position: relative; }
.tile .ic.usdt { background: var(--green); color: #fff; }
.tile .ic.usdt .t { font-size: 26px; font-weight: 900; line-height: 1; }
.tile .ic.usdt .arr { position: absolute; inset-inline-end: 3px; top: 50%; transform: translateY(-50%); font-size: 12px; font-style: normal; font-weight: 900; }
.tile .lbl { font-size: 12.5px; }

/* ---------- social banner (web): globe + floating social icons ---------- */
.banner-social {
  background: linear-gradient(120deg, #DDF3E4 0%, #BDE7CC 60%, #9FD8B4 100%);
  padding: 16px; position: relative; overflow: hidden;
}
.banner-social .txt h3 { font-size: 18px; }
.banner-social .txt p { color: #2E6B45; font-weight: 700; }
.banner-social .soc { position: relative; width: 128px; height: 108px; flex: none; }
.banner-social .soc .globe { position: absolute; inset: 8px 14px; }
.banner-social .soc .globe svg { width: 100%; height: 100%; display: block; }
.soc-chip {
  position: absolute; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.soc-chip svg { width: 20px; height: 20px; display: block; }
.soc-chip.ig { inset-inline-start: 0; top: 0; background: linear-gradient(45deg, #FEDA75, #D62976 55%, #962FBF); border-radius: 11px; }
.soc-chip.tg { inset-inline-end: 0; top: 2px; background: #229ED9; border-radius: 50%; }
.soc-chip.tt { inset-inline-end: 6px; bottom: 2px; background: #111; border-radius: 10px; }
.soc-chip.yt { inset-inline-start: 8px; bottom: 0; background: #FF0000; border-radius: 10px; }

/* ---------- more-categories gift banner (web) ---------- */
.banner-gift {
  background: linear-gradient(120deg, #EAF7EF, #D5EEDF);
  padding: 14px 16px; margin: 10px 14px;
}
.banner-gift .gift { width: 74px; flex: none; }
.banner-gift .gift svg { width: 100%; height: auto; display: block; }
.banner-gift .txt h3 { font-size: 15px; font-weight: 800; margin: 0; }
.arrow-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex: none;
  background: var(--green); color: #fff; font-size: 20px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(11,107,58,.35);
}

/* ---------- bottom nav (web): line icons + active underline ---------- */
.bottomnav a { position: relative; }
.bottomnav a .ic svg { width: 23px; height: 23px; display: block; margin: 0 auto 2px; }
.bottomnav a .ic { font-size: 0; }
.bottomnav a.active { color: var(--green); }
.bottomnav a.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 3px; border-radius: 3px 3px 0 0; background: var(--green);
}

/* ---------- green wave at the very bottom (web) ---------- */
.wave {
  position: fixed; left: 0; right: 0; bottom: 0; height: 92px;
  z-index: 1; pointer-events: none;
}
.wave svg { width: 100%; height: 100%; display: block; }
