/* =====================================================================
   Hbar – giao dien mobile (dung chung phong cach voi HGO / HBanks)
   - Theme TIM
   - Toan trang BI KHOA truot ngang + doc, chi .screen cuon doc ben trong
   - Anh trong /public deu la PNG XAM placeholder, chi can thay file
   ===================================================================== */

:root {
  --maxw: 440px;        /* be ngang khung mobile */
  --line: #7d3cf0;      /* vien tim cho tat ca thanh phan */
  --glow: rgba(140, 80, 240, .45);
  --txt: #f3f0ff;
  --muted: #c4b8e6;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  color: var(--txt);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  touch-action: none;
  /* anh nen PNG cho toan bo web (thay public/bg-app.png de doi nen) */
  background: #0a0618 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(96px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.screen::-webkit-scrollbar { width: 0; height: 0; }

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

.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(180,140,255,.7);
}

.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-logo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.brand-text h1 { font-size: 28px; line-height: .95; font-weight: 800; }

.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(180,140,255,.65)); }
.bell-badge {
  position: absolute; top: 5px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 99px; background: #c026d3;
  box-shadow: 0 0 8px rgba(192,38,211,.9);
}

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

/* ===== khung chung: nen TRONG SUOT, vien TIM ===== */
.wallet, .assets, .promo, .actions, .banner-wide {
  border: 1.5px solid var(--line);
  background-color: transparent;
  box-shadow: 0 0 12px var(--glow), inset 0 0 16px rgba(140,80,240,.08);
}

/* ===================== The vi ===================== */
.wallet {
  position: relative; border-radius: 16px; padding: 15px 16px; overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(10,6,24,.80) 30%, rgba(10,6,24,.30) 70%, rgba(10,6,24,.15)),
    url("public/emblem-hbar.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(180,150,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 nut nhanh (Nap / Rut / Chuyen / Lich su) ============ */
.actions {
  margin-top: 12px; border-radius: 14px; padding: 16px 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.action { display: grid; justify-items: center; gap: 7px; text-align: center; }
.action-ic {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, rgba(140,80,240,.35), rgba(90,40,180,.18));
  border: 1.5px solid var(--line);
  box-shadow: 0 0 12px var(--glow), inset 0 0 8px rgba(180,140,255,.2);
}
.action-ic img { width: 28px; height: 28px; object-fit: contain; }
.action-ic svg { width: 27px; height: 27px; color: #d8c9ff; filter: drop-shadow(0 0 5px rgba(150,90,255,.6)); }
.action strong { font-size: 13px; font-weight: 800; }

/* ===== hang trượt ngang ===== */
.hscroll {
  display: flex; gap: 10px; margin-top: 12px;
  overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { height: 0; }

/* ============== 3 the promo (anh + chu + nut TU CODE) ============== */
.promo {
  flex: 0 0 168px;
  position: relative; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1.5px solid var(--line);
  background: linear-gradient(180deg, rgba(30,14,60,.55), rgba(12,6,26,.55));
  box-shadow: 0 0 12px var(--glow);
  padding: 12px 12px 14px;
  min-height: 230px;
}
.promo-head strong { display: block; font-size: 16px; font-weight: 800; }
.promo-head small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.25; }
.promo > img { flex: 1; width: 100%; object-fit: contain; margin: 8px 0; min-height: 0; }
.promo-tag {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: linear-gradient(#a855f7, #7c3aed);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 7px;
  box-shadow: 0 0 10px rgba(150,90,255,.7);
}
.promo-btn {
  height: 32px; border-radius: 8px;
  background: linear-gradient(#9b5cf6, #6d28d9);
  border: 1px solid #c4a4ff;
  color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 0 10px rgba(150,90,255,.6);
}
.promo-btn i { font-style: normal; font-weight: 900; }

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

/* ================== 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: #4a3a6a; transition: background .2s; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #161122; transition: transform .2s; }
.switch input:checked + span { background: #8b3df0; }
.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(180,150,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; }

.asset-more { grid-template-columns: 22px 1fr 16px; justify-items: start; color: var(--muted); font-size: 13px; font-weight: 700; }
.asset-more span:nth-child(2) { text-align: center; width: 100%; }
.asset-more-ic { width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 5px; }

/* ============== BOTTOM NAV (dung chung dang) ============== */
.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(18,10,38,.92), rgba(8,4,18,.98));
  border-top: 1px solid #2a1850;
  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: #8a78b8; font-size: 11px;
}
.nav-item img { width: 22px; height: 22px; filter: grayscale(1) brightness(1.5) opacity(.6); }
.nav-item svg { width: 23px; height: 23px; color: currentColor; }
.nav-item.active { color: #b98bff; }
.nav-item.active img { filter: drop-shadow(0 0 6px rgba(170,110,255,.7)); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(170,110,255,.7)); }
.nav-center-circle img { filter: none !important; }
.nav-center { position: relative; color: #b98bff; }
.nav-center-label { font-size: 11px; }
/* Nut giua = 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;
}
