/* =====================================================================
   HMEN – Trợ lý AI đa năng (giao dien mobile, tone DO neon)
   - 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
   - Banner (top + explore): chi code KHUNG/NUT, phan con lai la ANH;
     khung scale dung ti le anh (width 100% / height auto).
   - Hieu ung vien neon CHAY + CHOP (mang tu hgame, tone do).
   ===================================================================== */

:root {
  --maxw: 440px;
  --bg: #0a0306;
  --red: #ff2d3f;
  --line: rgba(255,45,63,.42);
  --glow: rgba(255,45,63,.30);
  --neon: #ff5a6a;          /* vet sang chay tren vien */
  --card: rgba(24,8,12,.55);
  --txt: #f4eaec;
  --muted: #c79aa0;
}

* { 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: var(--bg) 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; }

/* ====== Vung cuon duy nhat ====== */
.screen {
  height: 100%;
  padding: 12px 12px calc(92px + 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; }

/* ===== khung the chung: nen mo, vien do ===== */
.card, .card-banner {
  border: 1.5px solid var(--line);
  background-color: var(--card);
  box-shadow: 0 0 12px var(--glow), inset 0 0 18px rgba(255,45,63,.08);
  backdrop-filter: blur(3px);
}

/* ===================== TOP BANNER (gop header + hero robot) =====================
   1 tam ANH PNG lon, KHONG VIEN, tran het be ngang + cham mep tren.
   Chi code NUT menu + chuong noi tren anh. */
.topbanner {
  position: relative;
  margin: -12px -12px 0;        /* full-bleed */
}
/* theo ti le anh; day anh MO DAN sang nen de mat duong vien ngan cach */
.topbanner-img {
  width: 100%; height: auto; display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 92%, rgba(0,0,0,.6) 97%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 92%, rgba(0,0,0,.6) 97%, transparent 100%);
}

/* file lottie - thu nho 50%, doi sang trai, gap trai con 70% (27% -> 18.9%) */
.tb-lottie {
  position: absolute;
  top: 50%; left: 18.9%;
  transform: translateY(-50%);       /* chi can giua theo chieu doc */
  width: 23%; aspect-ratio: 1 / 1;   /* can chieu cao ro rang, neu khong se bi 0 */
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(255,45,63,.45));
}
.tb-lottie::part(canvas), .tb-lottie svg, .tb-lottie canvas { width: 100% !important; height: 100% !important; }

.tb-menu {
  position: absolute; top: 3%; left: 4%;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; gap: 5px; align-content: center; justify-items: center;
  border: 1.5px solid var(--line); background: rgba(20,6,9,.45);
  box-shadow: 0 0 10px var(--glow);
}
.tb-menu span { width: 20px; height: 2.5px; border-radius: 99px; background: #ffe3e6; box-shadow: 0 0 8px rgba(255,90,106,.8); }

.tb-bell {
  position: absolute; top: 3%; right: 4%;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--line); background: rgba(20,6,9,.45);
  box-shadow: 0 0 10px var(--glow);
}
.tb-bell svg { width: 22px; height: 22px; color: #ffe3e6; filter: drop-shadow(0 0 6px rgba(255,90,106,.6)); }
.tb-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 3px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 8px rgba(255,45,63,.8);
}

/* ===================== Thanh trang thai ===================== */
.status {
  margin-top: 12px; border-radius: 14px; padding: 12px 10px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stat { display: flex; align-items: center; gap: 8px; }
.stat-ic { width: 22px; height: 22px; flex: 0 0 auto; filter: drop-shadow(0 0 5px currentColor); }
.stat strong { display: block; font-size: 11.5px; font-weight: 700; }
.stat small { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-green { background: #2fe87f; box-shadow: 0 0 8px #2fe87f; }

/* ===================== Tieu de section ===================== */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 2px 10px; }
.sec-head h2 { font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.see-all { font-size: 11.5px; color: var(--red); font-weight: 600; }

/* ===================== Tinh nang chinh (8 o, vien mau rieng) ===================== */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feat { display: grid; justify-items: center; gap: 7px; text-align: center; }
.feat-ic {
  width: 100%; aspect-ratio: 1 / 1; max-width: 70px; border-radius: 16px;
  display: grid; place-items: center;
  color: var(--c);
  border: 1.5px solid var(--c);
  background: rgba(18,8,14,.5);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 55%, transparent),
              inset 0 0 12px color-mix(in srgb, var(--c) 22%, transparent);
}
.feat-ic svg { width: 30px; height: 30px; filter: drop-shadow(0 0 4px var(--c)); }
.feat strong { font-size: 10.5px; font-weight: 600; line-height: 1.2; color: #f0e6e8; }
/* mau neon cho tung o */
.f-purple  { --c: #b06bff; }
.f-red     { --c: #ff3b4d; }
.f-orange  { --c: #ff8a3d; }
.f-blue    { --c: #3d8bff; }
.f-cyan    { --c: #2fe8d0; }
.f-magenta { --c: #e85ad8; }
.f-blue2   { --c: #5a8bff; }
.f-green   { --c: #3ee87f; }

/* ===================== Banner kham pha (anh + nut) ===================== */
.explore-banner { position: relative; margin-top: 16px; border-radius: 14px; overflow: hidden; }
.eb-img { width: 100%; height: auto; display: block; }   /* theo ti le anh */
.eb-btn {
  position: absolute; left: 16px; bottom: 14%;
  height: 30px; padding: 0 16px; border-radius: 7px;
  background: linear-gradient(90deg, #ff2d3f, #b3121f);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  border: 1px solid #ff7079;
  box-shadow: 0 0 14px rgba(255,45,63,.6);
}

/* ===================== He sinh thai HGROUP (truot ngang) ===================== */
.hgroup {
  display: flex; gap: 14px;
  overflow-x: auto; overflow-y: hidden;
  touch-action: pan-x; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 2px;
}
.hgroup::-webkit-scrollbar { height: 0; }
.eco { flex: 0 0 auto; width: 64px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.eco-ic {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--c);
  border: 2px solid var(--c);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 28%, transparent), rgba(14,6,10,.7));
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent);
}
.eco-ic svg { width: 26px; height: 26px; filter: drop-shadow(0 0 4px var(--c)); }
.eco-ic b { font-size: 22px; font-weight: 900; filter: drop-shadow(0 0 5px var(--c)); }
.eco strong { font-size: 11px; font-weight: 600; color: #f0e6e8; }
.e-amber   { --c: #ffb547; }
.e-green   { --c: #2fe87f; }
.e-red     { --c: #ff3b4d; }
.e-blue    { --c: #3d8bff; }
.e-magenta { --c: #e85ad8; }
.e-cyan    { --c: #2fe8d0; }

/* ===================== Vi HCOIN ===================== */
.wallet { margin-top: 16px; border-radius: 16px; padding: 14px 16px; }
.wallet-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.eye { width: 17px; height: 11px; border: 2px solid var(--muted); border-radius: 50%; position: relative; }
.eye::after { content: ""; position: absolute; inset: 2px 5px; border-radius: 50%; background: var(--muted); }
.wallet-mid { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.wallet-balance { font-size: 26px; font-weight: 900; line-height: 1; }
.wallet-balance small { font-size: 13px; font-weight: 800; color: var(--muted); }
.wallet-usd { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.wallet-spark { width: 46%; height: 50px; flex: 0 0 auto; filter: drop-shadow(0 0 5px rgba(255,59,77,.6)); }
.wallet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.wa-btn {
  height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; font-weight: 800; color: #ffe3e6;
  border: 1.5px solid var(--line); background: rgba(30,8,12,.5);
  box-shadow: 0 0 10px var(--glow);
}
.wa-btn svg { width: 17px; height: 17px; color: var(--red); }

/* ===================== BOTTOM NAV (nut H luc giac o giua) ===================== */
.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(24,6,10,.86), rgba(10,3,5,.98));
  border-top: 1px solid rgba(255,45,63,.30);
  padding: 8px 6px calc(12px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #8a5a60; font-size: 10.5px;
}
.nav-item svg { width: 23px; height: 23px; color: currentColor; }
.nav-item.active { color: var(--red); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(255,45,63,.7)); }
.nav-center { position: relative; }
.nav-center-hex {
  width: 62px; height: 62px; margin-top: -28px;
  background: url("public/nav-center-btn.png") center / cover no-repeat;
  /* cat anh thanh hinh LUC GIAC */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  filter: drop-shadow(0 0 12px rgba(255,45,63,.7));
}
.noti-wrap { position: relative; display: inline-grid; place-items: center; }
.noti-dot { position: absolute; top: -1px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }

/* =====================================================================
   HIEU UNG VIEN NEON CHAY + CHOP (tone do) tren cac KHOI/BANNER/NUT chinh
   ===================================================================== */
@property --neon-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.status, .explore-banner, .wallet, .eb-btn, .wa-btn { position: relative; }
.eb-btn { position: absolute; }   /* giu vi tri tuyet doi */

.status::after, .explore-banner::after, .wallet::after,
.eb-btn::after, .wa-btn::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1.6px;
  background: conic-gradient(from var(--neon-a),
    transparent 0deg 55deg,
    rgba(255,90,106,.35) 80deg,
    var(--neon) 104deg,
    #ffffff 118deg,
    var(--neon) 132deg,
    rgba(255,150,90,.4) 156deg,
    transparent 185deg 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: neon-run 2.8s linear infinite;
  pointer-events: none; z-index: 4;
  filter: drop-shadow(0 0 4px var(--neon));
}
.explore-banner::after { animation-delay: -.6s; }
.wallet::after { animation-delay: -1.2s; }
.wa-btn:nth-child(2)::after { animation-delay: -.7s; }
.wa-btn:nth-child(3)::after { animation-delay: -1.4s; }

.status, .explore-banner, .wallet { animation: neon-blink 2.8s ease-in-out infinite; }
.explore-banner { animation-delay: -.6s; }
.wallet { animation-delay: -1.2s; }

@keyframes neon-run { to { --neon-a: 360deg; } }
@keyframes neon-blink {
  0%, 100% { box-shadow: 0 0 10px var(--glow), inset 0 0 16px rgba(255,45,63,.08); }
  50%      { box-shadow: 0 0 18px rgba(255,45,63,.7), inset 0 0 20px rgba(255,45,63,.16); }
}

@media (prefers-reduced-motion: reduce) {
  .status, .explore-banner, .wallet { animation: none; }
  .status::after, .explore-banner::after, .wallet::after,
  .eb-btn::after, .wa-btn::after { animation: none; }
}
