/* ===== Reset & tokens ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue:   #2f7bff;
  --blue-2: #1d59d8;
  --cyan:   #5cd6ff;
  --purple: #8a3ffb;
  --purple-2:#6a1fd0;
  --gold:   #e9b53d;
  --green:  #36d07a;
  --red:    #ff5d6c;
  --text:   #eaf2ff;
  --muted:  #8ba0c8;
  --card:   rgba(16,26,56,.55);
  --line:   rgba(96,150,255,.22);

  /* thanh nav + nút tròn */
  --nav-h:  60px;
  --fab:    72px;   /* = 60 * 1.2 -> lớn hơn chiều cao thanh công cụ 20% */
}

html { background: #05081a; }
html, body { overscroll-behavior: none; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #05081a;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* ===== Phone frame ===== */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 75% 8%, rgba(47,123,255,.30), transparent 55%),
    radial-gradient(90% 50% at 20% 0%, rgba(138,63,251,.18), transparent 60%),
    linear-gradient(180deg, #0a1130 0%, #070b22 40%, #05081a 100%);
  box-shadow: 0 0 40px rgba(0,0,0,.6);
}

svg { display: block; }

/* ===== Hero (1 ảnh nền + nút menu/chuông đè lên) ===== */
.hero { position: relative; flex-shrink: 0; width: 100%; }
.hero-bg {
  display: block; width: 100%; height: auto;
  background: #0a1130;   /* nền tạm khi ảnh chưa tải */
}
.menu-btn, .bell-btn {
  position: absolute; top: 10px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(12,22,52,.5);
  border: 1px solid rgba(120,170,255,.35);
  backdrop-filter: blur(6px);
  color: #eaf2ff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.menu-btn { left: 8px; }
.bell-btn { right: 8px; }
.menu-btn svg, .bell-btn svg { width: 19px; height: 19px; }
.bell-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red);
}

/* ===== Content scroll ===== */
.content {
  flex: 1;
  overflow-x: hidden;
  padding: 18px 16px calc(var(--fab) / 2 + var(--nav-h) + 24px);
}

/* ===== Generic card ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ===== Wallet ===== */
.wallet { padding: 16px; margin-bottom: 18px; }
.wallet-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: .5px; color: var(--cyan);
  margin-bottom: 12px;
}
.wallet-head svg { width: 20px; height: 20px; }

.wallet-main { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.balance-row { display: flex; align-items: center; gap: 10px; }
.coin-sm { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(233,181,61,.5)); }
.balance { font-size: 30px; font-weight: 800; line-height: 1; }
.balance-unit { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.balance-unit .eye { width: 15px; height: 15px; cursor: pointer; }
.balance-vnd { font-size: 13px; color: #cfe0ff; margin: 8px 0 6px; }
.rate {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.rate svg { width: 13px; height: 13px; }
.rate-up { color: var(--green); font-weight: 700; }

.wallet-buttons { display: flex; flex-direction: column; gap: 12px; }
.big-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 132px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px; cursor: pointer;
  padding: 15px 20px;
  font-family: "Tahoma", "Segoe UI", Arial, sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: .3px;
  color: #fff;
  transition: transform .12s, box-shadow .12s;
}
.big-btn svg { width: 21px; height: 21px; position: relative; z-index: 2; }
.big-btn span:not(.bb-glow), .big-btn { line-height: 1; }
/* lớp bóng loáng (gloss) phủ nửa trên */
.bb-glow {
  position: absolute; left: 0; right: 0; top: 0; height: 55%;
  background: linear-gradient(180deg, rgba(255,255,255,.40), rgba(255,255,255,0));
  border-radius: 18px 18px 50% 50% / 18px 18px 22px 22px;
  pointer-events: none; z-index: 1;
}
.deposit {
  background: linear-gradient(180deg, #6fb0ff 0%, #2f7bff 48%, #1a54cf 100%);
  box-shadow: 0 10px 22px rgba(47,123,255,.45), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -6px 14px rgba(13,40,110,.5);
}
.withdraw {
  background: linear-gradient(180deg, #c07bff 0%, #8a3ffb 48%, #5e1bc0 100%);
  box-shadow: 0 10px 22px rgba(138,63,251,.45), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 14px rgba(60,15,130,.5);
}
.big-btn:hover { box-shadow: 0 12px 26px rgba(47,123,255,.55); }
.withdraw:hover { box-shadow: 0 12px 26px rgba(138,63,251,.55); }
.big-btn:active { transform: translateY(1px) scale(.985); }

.wallet-quick {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px;
  margin-top: 16px;
}
.wq {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 4px; min-width: 0;
  background: rgba(20,32,66,.5);
  border: 1px solid var(--line); border-radius: 14px;
  color: #d7e4ff; font-size: 10px; font-weight: 500; line-height: 1.2; text-align: center;
  cursor: pointer;
}
.wq svg { width: 22px; height: 22px; color: var(--cyan); }
.wq:active { background: rgba(47,123,255,.18); }

/* ===== Section head ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 12px; }
.section-head h3 { font-size: 14px; font-weight: 800; letter-spacing: 1px; color: #dce7ff; }
.customize, .see-all {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--cyan); cursor: pointer;
}
.customize svg { width: 15px; height: 15px; }

/* ===== Tiện ích nhanh ===== */
.utils { margin-bottom: 18px; }
.util-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.util {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  color: #d7e4ff; font-size: 10.5px; font-weight: 500; text-align: center;
}
.util-ic {
  width: 100%; aspect-ratio: 1; max-width: 62px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,32,66,.6);
  border: 1px solid var(--line); border-radius: 16px;
  color: var(--cyan);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.util-ic svg { width: 26px; height: 26px; }
.util:active .util-ic { background: rgba(47,123,255,.2); }

/* ===== Promo: mỗi thẻ là 1 ảnh, nút đè lên góc dưới-trái ===== */
.promos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.promo { position: relative; }
.promo-bg {
  display: block; width: 100%; height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(16,26,56,.55);   /* nền tạm khi ảnh chưa tải */
}
.promo-btn {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, #3a8bff, var(--blue-2));
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 8.5px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(47,123,255,.4), inset 0 1px 0 rgba(255,255,255,.4);
}
.promo-btn svg { width: 10px; height: 10px; }
.promo-btn:active { transform: translateY(1px) scale(.98); }

/* ===== Giao dịch gần đây ===== */
.recent { margin-bottom: 8px; }
.tx {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(96,150,255,.12);
}
.tx:last-child { border-bottom: none; }
.tx-ic {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tx-ic svg { width: 21px; height: 21px; }
.tx-ic.green  { background: rgba(54,208,122,.16); color: var(--green); }
.tx-ic.blue   { background: rgba(47,123,255,.16); color: var(--blue); }
.tx-ic.purple { background: rgba(138,63,251,.16); color: var(--purple); }
.tx-name { font-size: 13px; font-weight: 600; color: #eaf2ff; }
.tx-amount { font-size: 12px; font-weight: 700; margin-top: 3px; }
.tx-amount.plus  { color: var(--green); }
.tx-amount.minus { color: var(--red); }
.tx-meta { text-align: right; }
.tx-date { font-size: 11px; color: var(--muted); }
.tx-status { font-size: 11px; color: var(--green); font-weight: 600; margin-top: 3px; }

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: linear-gradient(180deg, rgba(12,20,48,.92), rgba(8,12,32,.98));
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav-item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 10px; font-weight: 500;
  height: 100%;
  justify-content: center;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--blue); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(47,123,255,.7)); }

/* nút tròn giữa: sát đáy, đường kính = 120% chiều cao thanh nav nên nhô lên trên */
.nav-center { position: relative; justify-content: flex-end; padding-bottom: 6px; color: var(--blue); }
.nav-fab {
  position: absolute; left: 50%; bottom: 18px;
  transform: translateX(-50%);
  width: var(--fab); height: var(--fab); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1b2b58, #0c1738);
  border: 2px solid var(--blue);
  color: #cfe6ff;
  box-shadow: 0 0 18px rgba(47,123,255,.65), inset 0 0 12px rgba(92,214,255,.35);
}
.nav-fab svg { width: 30px; height: 30px; }
.nav-fab::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid rgba(92,214,255,.35);
}
