/* =====================================================================
   HTrade – giao dien mobile (san giao dich Web10 Quantum Blockchain)
   - 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, .35);
  --glow: rgba(56, 189, 248, .30);
  --gold: #f5c451;
  --cyan: #38bdf8;
  --purple: #9b5cf6;
  --pink: #ec4899;
  --green: #34d399;
  --red: #f87171;
  --txt: #eef3ff;
  --muted: #9a9ac2;
}

* { 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: #05050f 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(90px + 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; }

/* ===== Banner hero: 1 anh PNG, chuong TU CODE de len tren ===== */
.hero-wrap { position: relative; margin: -12px -14px 0; }
.hero-banner { width: 100%; height: auto; display: block; }
.bell-btn { position: absolute; right: 16px; top: 16px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; }
.bell-btn svg { width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.5)); }
.bell-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: #ef3b3b; box-shadow: 0 0 8px rgba(239,59,59,.8);
}

/* ===== Luoi 6 icon thao tac ===== */
.action-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 14px; }
.aicon {
  display: grid; justify-items: center; gap: 5px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 2px;
  background: rgba(12,10,28,.5); box-shadow: 0 0 6px var(--glow);
}
.aic { width: 20px; height: 20px; color: var(--cyan); }
.aicon span:last-child { font-size: 7px; font-weight: 700; color: var(--txt); line-height: 1.2; }

/* ===== The tong tai san ===== */
.asset-card {
  position: relative; margin-top: 14px; border-radius: 16px; padding: 14px;
  border: 1.5px solid var(--line); background: rgba(12,10,28,.6); box-shadow: 0 0 12px var(--glow);
  display: flex; align-items: center; gap: 10px;
}
.asset-left { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.asset-label { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.eye { width: 14px; height: 9px; border: 1.5px solid var(--muted); border-radius: 50%; display: inline-block; position: relative; }
.eye::after { content: ""; position: absolute; inset: 2px 4px; border-radius: 50%; background: var(--muted); }
.asset-value { font-size: 21px; font-weight: 900; }
.asset-sub { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.asset-change { color: var(--green); font-weight: 800; background: rgba(52,211,153,.15); border-radius: 99px; padding: 1px 7px; font-size: 9.5px; }
.asset-spark { flex: 0 0 auto; width: 130px; height: 44px; }

/* ===== 4 the ticker ===== */
.ticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.ticker-card {
  position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px;
  background: rgba(12,10,28,.55); box-shadow: 0 0 6px var(--glow); overflow: hidden;
}
.ticker-head { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.ticker-head img { width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; }
.ticker-head span { font-size: 8px; font-weight: 800; }
.ticker-card strong { display: block; font-size: 11px; font-weight: 900; }
.tk-change { display: inline-block; margin-top: 2px; font-size: 8.5px; font-weight: 800; }
.tk-change.up { color: var(--green); }
.tk-spark { position: absolute; right: 4px; bottom: 4px; width: 40px; height: 15px; }

/* ===== hang truot ngang chung ===== */
.hscroll {
  display: flex; gap: 8px;
  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; }

/* ===== Banner khuyen mai ===== */
.promo-banner { position: relative; margin-top: 14px; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--line); box-shadow: 0 0 10px var(--glow); }
.promo-banner img { width: 100%; height: auto; display: block; }
.promo-btn {
  position: absolute; right: 12px; bottom: 12px;
  height: 30px; padding: 0 14px; border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8, #9b5cf6); color: #fff;
  font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 0 10px rgba(155,92,246,.6);
}
.promo-btn i { font-style: normal; }

/* ===== Tab loc thi truong ===== */
.tab-row { margin-top: 14px; }
.tab {
  flex: 0 0 auto; height: 28px; padding: 0 12px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  border: 1.5px solid transparent;
}
.tab.active { color: var(--gold); border-color: rgba(245,196,81,.5); background: rgba(245,196,81,.1); }

/* ===== Bang thi truong ===== */
.market-table { margin-top: 10px; }
.mt-head {
  display: grid; grid-template-columns: 1.6fr 1fr .9fr .8fr; gap: 4px;
  font-size: 8.5px; color: var(--muted); padding: 0 10px 6px;
}
.mt-head span:nth-child(2) { text-align: right; }
.mt-head span:nth-child(3) { text-align: right; }
.mt-head span:nth-child(4) { text-align: right; }
.mt-row {
  position: relative; display: grid; grid-template-columns: 1.6fr 1fr .9fr .8fr; gap: 4px; align-items: center;
  padding: 9px 10px; border-radius: 11px;
}
.mt-row + .mt-row { margin-top: 2px; }
.mt-pair { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mt-pair img { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto; }
.mt-pair strong { display: block; font-size: 11px; font-weight: 800; white-space: nowrap; }
.mt-pair small { display: block; font-size: 7.5px; color: var(--muted); white-space: nowrap; }
.mt-price { text-align: right; }
.mt-price strong { display: block; font-size: 11px; font-weight: 800; }
.mt-price small { display: block; font-size: 7.5px; color: var(--muted); }
.mt-change { text-align: right; font-size: 10.5px; font-weight: 800; }
.mt-change.up { color: var(--green); }
.mt-change.down { color: var(--red); }
.mt-spark { width: 46px; height: 18px; justify-self: end; margin-right: 16px; }
.mt-star { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted); cursor: pointer; }
.mt-star.active { color: var(--gold); fill: var(--gold); }

.see-all-link { display: block; text-align: center; margin-top: 10px; font-size: 11px; color: var(--purple); }

/* ============== 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(10,8,24,.92), rgba(4,4,10,.98));
  border-top: 1px solid #241c40;
  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: #7d76a0; font-size: 9.5px;
}
.nav-item svg { width: 20px; height: 20px; }
.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: 56px; height: 56px;
  margin-top: -22px;
  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);
}
.nav-center-label { margin-top: -2px; font-size: 9px; font-weight: 800; color: var(--cyan); }
