/* =====================================================================
   HGO – giao dien mobile (viet moi hoan toan)
   - Toan trang BI KHOA truot ngang + doc (rubber-band)
   - Chi vung .screen duoc cuon doc ben trong
   - Anh trong /public giu nguyen ten, chi can thay file
   ===================================================================== */

:root {
  --maxw: 440px;        /* be ngang khung mobile */
  --line: #e22a2a;      /* vien do cho tat ca thanh phan */
  --glow: rgba(239, 59, 59, .45);
  --txt: #f3f3f3;
  --muted: #d2c2c2;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;            /* khoa cuon viewport */
  overscroll-behavior: none;   /* chan rubber-band */
}

body {
  position: fixed;             /* ghim ca giao dien */
  inset: 0;
  color: var(--txt);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: none;          /* chan vuot vung ngoai khung */
  /* anh nen PNG cho toan bo web (thay public/bg-app.png de doi nen) */
  background: #060406 url("public/bg-app.png") center top / cover no-repeat;
}

a { text-decoration: none; color: inherit; }
button { border: 0; font: inherit; color: inherit; cursor: pointer; background: none; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }

/* khung dien thoai can giua tren desktop */
.app {
  position: relative;
  width: min(100vw, var(--maxw));
  height: 100%;
  margin: 0 auto;
}

/* ====== Vung cuon duy nhat ====== */
.screen {
  height: 100%;
  padding: 12px 14px calc(86px + env(safe-area-inset-bottom));
  overflow-y: auto;                 /* cuon doc ben trong */
  overflow-x: hidden;               /* khoa truot ngang */
  overscroll-behavior: contain;     /* khong lan ra ngoai */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;              /* chi cho vuot doc */
}
.screen::-webkit-scrollbar { width: 0; height: 0; }

/* ======================= Header ======================= */
.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

/* nut hamburger – TU CODE */
.menu-btn {
  display: grid; gap: 6px; place-content: center;
  width: 44px; height: 44px;
}
.menu-btn span {
  width: 28px; height: 3px; border-radius: 99px;
  background: #f0f0f0; box-shadow: 0 0 10px rgba(255,255,255,.65);
}

.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.brand-text h1 { font-size: 30px; line-height: .95; font-weight: 800; }
.brand-text p { font-size: 10px; font-weight: 700; letter-spacing: .8px; margin-top: 2px; }

/* nut chuong – TU CODE */
.bell-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.bell-ic { width: 24px; height: 24px; color: #f0f0f0; filter: drop-shadow(0 0 7px rgba(255,255,255,.5)); }
.bell-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 99px; background: #ef3b3b; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  box-shadow: 0 0 8px rgba(239,59,59,.7);
}

.hero-sub { text-align: center; margin: 8px 0 12px; display: grid; gap: 3px; }
.hero-sub strong { font-size: 14px; letter-spacing: .3px; text-shadow: 0 0 10px rgba(255,255,255,.4); }
.hero-sub span { font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* ===== khung chung: nen TRONG SUOT, vien DO ===== */
.wallet, .svc, .assets, .promo, .quick-tile, .quick-card, .banner-wide {
  border: 1.5px solid var(--line);
  background-color: transparent;
  box-shadow: 0 0 10px var(--glow), inset 0 0 16px rgba(239,59,59,.08);
}

/* ===================== The vi ===================== */
.wallet {
  position: relative; border-radius: 16px; padding: 15px 16px; overflow: hidden;
  /* dung emblem-hgo.png lam NEN cho ca the vi */
  background-image:
    linear-gradient(90deg, rgba(6,2,4,.78) 30%, rgba(6,2,4,.30) 70%, rgba(6,2,4,.15)),
    url("public/emblem-hgo.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.wallet-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.eye { width: 18px; height: 11px; border: 2px solid #d8d8d8; border-radius: 50%; position: relative; }
.eye::after { content: ""; position: absolute; inset: 2px 5px; border-radius: 50%; background: #d8d8d8; }
.wallet-balance { margin-top: 10px; font-size: 33px; font-weight: 900; line-height: 1; }
.wallet-balance small { font-size: 15px; font-weight: 800; }
.wallet-usd { margin-top: 6px; font-size: 14px; color: var(--muted); }
.wallet-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.3);
}
.wallet-stats span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.wallet-stats strong { display: block; font-size: 12px; }

/* ===== hang trượt ngang: KHONG ep nho, an bot va keo ngang ===== */
.hscroll {
  display: flex; gap: 8px; margin-top: 12px;
  overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x pan-y;           /* keo ngang trong hang, van cho vuot doc lot xuong cuon trang */
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { height: 0; }

/* =================== Dich vu =================== */
.svc {
  flex: 0 0 68px;                       /* kich thuoc co dinh, khong co lai */
  border-radius: 12px; padding: 8px 4px 9px;
  display: grid; justify-items: center; text-align: center; gap: 2px;
}
.svc-img { width: 100%; display: grid; place-items: center; }
.svc-img img { width: 100%; height: 54px; object-fit: contain; border-radius: 8px; }
.svc.round .svc-img img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; }
.svc strong { margin-top: 4px; font-size: 11px; font-weight: 700; line-height: 1.15; }
.svc small { font-size: 9.5px; color: var(--muted); line-height: 1.1; }

/* ============== 3 banner + nut TU CODE ============== */
.promo {
  flex: 0 0 150px;                 /* co dinh, keo ngang neu khong du cho */
  position: relative; border-radius: 13px; overflow: hidden;
  aspect-ratio: 71 / 100;          /* khop ti le anh banner cua ban */
}
.promo > img { width: 100%; height: 100%; object-fit: cover; }
/* nut nen DO */
.promo-btn {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  height: 30px; border-radius: 7px;
  background: linear-gradient(#ff4d4d, #c11616);
  border: 1px solid #ff9a9a;
  color: #fff; font-size: 10.5px; font-weight: 800; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 0 10px rgba(239,59,59,.7);
}
.promo-btn i { font-style: normal; font-weight: 900; }

/* ============== Banner ngang web3 ============== */
.banner-wide { width: 100%; height: auto; margin-top: 12px; border-radius: 14px; }

/* ================== Hang nhanh ================== */
.quick { align-items: stretch; height: 100px; }
.quick-card, .quick-tile { flex: 0 0 auto; height: 100%; border-radius: 12px; overflow: hidden; }
.quick-card img, .quick-tile img { width: 100%; height: 100%; object-fit: cover; }
.quick-card { aspect-ratio: 218 / 100; }
.quick-tile { aspect-ratio: 79 / 100; }

/* ================== Tai san ================== */
.assets { margin-top: 12px; border-radius: 14px; overflow: hidden; }
.assets-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 8px; }
.assets-head h2 { font-size: 16px; font-weight: 800; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { position: relative; width: 40px; height: 22px; border-radius: 99px; background: #5f5f5f; transition: background .2s; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #161616; transition: transform .2s; }
.switch input:checked + span { background: #ef3b3b; }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }

.asset {
  display: grid; grid-template-columns: 36px 1fr auto 16px;
  align-items: center; gap: 11px; padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.asset-coin { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.asset-name strong { display: block; font-size: 14px; }
.asset-name small { display: block; font-size: 10.5px; color: var(--muted); }
.asset-amt { text-align: right; font-size: 13px; font-weight: 800; }
.asset-amt small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.chev { font-style: normal; font-size: 22px; color: var(--muted); text-align: center; line-height: 1; }

/* ============== BOTTOM NAV (port tu Hpawn) ============== */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: linear-gradient(180deg, rgba(20,8,10,.92), rgba(10,5,6,.98));
  border-top: 1px solid #3a1418;
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: #8a6065; font-size: 11px;
}
.nav-item img { width: 22px; height: 22px; filter: grayscale(1) brightness(1.5) opacity(.6); }
.nav-item.active { color: #ff2d3f; }
.nav-item.active img { filter: drop-shadow(0 0 6px rgba(255,45,63,.6)); }
.nav-center-circle img { filter: none !important; }
.nav-center { position: relative; }
/* Nut = 1 vong tron, nen la anh PNG trong /public */
.nav-center-circle {
  width: 60px; height: 60px;
  margin-top: -24px;
  border-radius: 50%;
  background-image: url("public/nav-center-btn.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
