/* =====================================================================
   HNFT – giao dien mobile (NFT da vu tru Web10)
   - 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;
  --line: rgba(155, 92, 246, .40);
  --glow: rgba(124, 58, 237, .40);
  --gold: #f5c451;
  --cyan: #38bdf8;
  --purple: #9b5cf6;
  --green: #34d399;
  --txt: #f3f0ff;
  --muted: #b1a4d4;
}

* { 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;
  background: #08050f 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, h3, p { margin: 0; }

.app {
  position: relative;
  width: min(100vw, var(--maxw));
  height: 100%;
  margin: 0 auto;
}

.screen {
  position: relative;
  height: 100%;
  padding: 12px 14px calc(86px + 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 ======================= */
.hd-row { display: flex; align-items: center; gap: 8px; }

.profile-mini { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-mini-avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--cyan); box-shadow: 0 0 10px rgba(56,189,248,.55);
}
.edit-dot {
  position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--purple); display: grid; place-items: center; border: 1.5px solid #08050f;
}
.edit-dot svg { width: 8px; height: 8px; color: #fff; }
.profile-text { min-width: 0; }
.profile-name { font-size: 12px; font-weight: 800; white-space: nowrap; }
.profile-id { font-size: 8px; color: var(--muted); white-space: nowrap; }
.vip-tag {
  display: inline-block; margin-top: 1px; font-size: 8px; font-weight: 800;
  color: #3a2600; background: linear-gradient(160deg, #ffe08a, var(--gold));
  border-radius: 99px; padding: 0 6px;
}

/* Logo HNFT: 1 anh PNG duy nhat, nam giua hang header, to 1.5 lan */
.brand-mark { flex: 0 0 auto; height: 51px; width: auto; margin: 0 auto; }

.hd-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.hd-ic { position: relative; width: 28px; height: 28px; display: grid; place-items: center; color: #eef1ff; }
.hd-ic svg { width: 18px; height: 18px; }
.hd-dot {
  position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%;
  background: #ef3b3b; box-shadow: 0 0 6px rgba(239,59,59,.8);
}

/* Vi HCoin: nam sat ben phai, ngay canh dong xu H */
.wallet-row { margin-top: 10px; justify-content: flex-end; align-items: center; gap: 8px; }
.wallet-text { display: grid; gap: 1px; text-align: right; }
.storage-label { font-size: 9px; font-weight: 700; color: var(--muted); }
.wallet-value { font-size: 16px; font-weight: 900; color: var(--gold); }
.wallet-value small { font-size: 10px; font-weight: 800; }
.wallet-usd { font-size: 8.5px; color: var(--muted); }
.coin-badge { width: 34px; height: 34px; flex: 0 0 auto; }

/* ===== Banner hero: toan bo la 1 anh, chi nut TU CODE de len tren ===== */
.hero-banner { position: relative; margin-top: 12px; border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); box-shadow: 0 0 12px var(--glow); }
.hero-banner img { width: 100%; height: auto; display: block; }
.hero-btn {
  position: absolute; left: 14px; bottom: 14px;
  height: 32px; padding: 0 16px; border-radius: 99px;
  background: rgba(8,5,20,.55); border: 1.5px solid var(--cyan); color: #eaf7ff;
  font-size: 10.5px; font-weight: 800; box-shadow: 0 0 10px rgba(56,189,248,.6); backdrop-filter: blur(3px);
}

/* ===== hang truot ngang chung ===== */
.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; }

/* ===== 6 icon chuc nang: SVG inline ===== */
.action-row { gap: 8px; }
.aicon { flex: 0 0 64px; display: grid; justify-items: center; gap: 5px; text-align: center; }
/* moi icon la 1 anh PNG day du (nen gradient + hinh ve da co san) */
.aic { width: 46px; height: 46px; border-radius: 14px; }
.aicon span { font-size: 8px; font-weight: 800; letter-spacing: .2px; color: var(--muted); }

/* ===== tieu de section ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.section-head h2 { font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.see-all { font-size: 10px; color: var(--cyan); }

/* ===== danh muc hot ===== */
.cat-row { gap: 10px; }
.cat-card { flex: 0 0 110px; border-radius: 14px; overflow: hidden; position: relative; border: 1.5px solid var(--line); }
.cat-card img { width: 100%; height: 120px; object-fit: cover; }
.cat-label { padding: 6px 8px 8px; background: rgba(10,6,20,.7); }
.cat-label strong { display: block; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.cat-label span { display: block; font-size: 9px; color: var(--muted); }

/* ===== NFT noi bat ===== */
.nft-row { gap: 10px; }
.nft-card { flex: 0 0 155px; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); background: rgba(15,10,28,.6); }
.nft-img { position: relative; }
.nft-img img { width: 100%; height: 150px; object-fit: cover; }
.nft-tag { position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 5px; color: #fff; }
.nft-tag.hot { background: #ef3b3b; box-shadow: 0 0 8px rgba(239,59,59,.7); }
.nft-info { padding: 8px 9px 10px; display: grid; gap: 3px; }
.nft-info strong { font-size: 11px; font-weight: 700; line-height: 1.2; }
.nft-price { font-size: 11px; font-weight: 800; color: var(--gold); }
.nft-meta { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 2px; }
.nft-like { color: #f472b6; }

/* ===== 4 the thong ke ===== */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.stat-tile {
  border: 1.5px solid var(--line); border-radius: 13px; padding: 10px 12px;
  background: rgba(15,10,28,.6); box-shadow: 0 0 8px var(--glow);
  display: grid; gap: 3px;
}
.stat-tlabel { font-size: 8.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.stat-tile strong { font-size: 15px; font-weight: 900; }
.stat-tile strong small { font-size: 9px; font-weight: 700; color: var(--muted); }
.stat-tile strong.online { color: var(--green); }
.stat-sub { font-size: 10px; font-weight: 800; }
.stat-sub.up { color: var(--green); }
.mini-bar, .mini-line { width: 60px; height: 20px; color: var(--cyan); margin-top: 2px; }

/* ===== Banner Stake HCoin: toan bo la 1 anh, chi nut TU CODE de len tren ===== */
.stake-banner {
  position: relative; margin-top: 16px; border-radius: 16px; overflow: hidden;
  border: 1.5px solid rgba(245,196,81,.5); box-shadow: 0 0 12px rgba(245,196,81,.3);
}
.stake-banner img { width: 100%; height: auto; display: block; }
.stake-btn {
  position: absolute; left: 14px; bottom: 14px;
  height: 32px; padding: 0 18px; border-radius: 99px;
  background: linear-gradient(160deg, #ffe08a, var(--gold)); color: #3a2600;
  font-size: 10.5px; font-weight: 800; box-shadow: 0 0 10px rgba(245,196,81,.6);
}

/* ============== BOTTOM NAV (5 muc) ============== */
.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(14,8,26,.92), rgba(6,4,12,.98));
  border-top: 1px solid #241a3c;
  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: #7c72a0; font-size: 8.5px; font-weight: 700; letter-spacing: .2px;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--cyan); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(56,189,248,.6)); }
.nav-center { position: relative; }
.nav-center-circle {
  width: 58px; height: 58px;
  margin-top: -24px;
  border-radius: 50%;
  background-image: url("public/nav-center-btn.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 16px rgba(155,92,246,.6);
}
