/* =====================================================================
   JESU – Blockchain Luong Tu Web5 (giao dien mobile)
   - 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
   - Header: TOAN BO la 1 ANH PNG, chi code NUT + WEB5 ID len tren
   - Hieu ung vien neon CHAY + CHOP (tone VANG / GOLD)
   ===================================================================== */

:root {
  --maxw: 440px;
  --bg: #0a0820;
  --gold: #f5c451;
  --gold2: #d4a438;
  --amber: #ffb347;
  --cyan: #4dd8e0;
  --blue: #3b82f6;
  --purple: #a855f7;
  --line: rgba(168, 85, 247, .38);
  --glow: rgba(168, 85, 247, .22);
  --neon: #a855f7;
  --card: rgba(14, 12, 40, .62);
  --txt: #f0ece4;
  --muted: #a89e8a;
  --up: #34d399;
  --down: #ef4444;
}

* { 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, h4, p { margin: 0; }

.app { position: relative; width: min(100vw, var(--maxw)); height: 100%; margin: 0 auto; }
.screen {
  height: 100%;
  padding: 12px 11px 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; }

/* ===== khung the chung ===== */
.card, .card-banner {
  position: relative;
  border: 1.5px solid var(--line);
  background-color: var(--card);
  box-shadow: 0 0 12px var(--glow), inset 0 0 18px rgba(245,196,81,.06);
  backdrop-filter: blur(3px);
  border-radius: 15px;
}

/* layout 2 cot */
.duo { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; align-items: start; margin-top: 10px; }
.duo-banner {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.duo-banner::-webkit-scrollbar { display: none; }

/* cot phai trong duo */
.right-col { display: flex; flex-direction: column; justify-content: center; gap: 10px; }

/* nut chung */
.btn-gold {
  width: 100%; height: 30px; border-radius: 9px; margin-top: 9px;
  background: linear-gradient(90deg, var(--gold2), var(--gold));
  color: #2a1800; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 0 12px rgba(245,196,81,.5);
}
.btn-gold.sm { height: 26px; font-size: 10px; }
.btn-ghost {
  width: 100%; height: 28px; border-radius: 9px; margin-top: 9px;
  border: 1px solid var(--line); color: var(--amber); font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(245,196,81,.08);
}
.btn-ghost.sm { height: 24px; font-size: 9.5px; margin-top: 7px; }

/* ======================= Header: 1 ANH PNG + overlay ======================= */
.hero-head { position: relative; }
.hero-head-img { width: 100%; height: auto; display: block; }

/* menu / chuong */
.menu-btn { position: absolute; top: 3.5%; left: 2%; z-index: 3;
  display: grid; gap: 5px; align-content: center; width: 26px; height: 30px; }
.menu-btn span { width: 22px; height: 2.4px; border-radius: 99px; background: #f0ece4; box-shadow: 0 0 8px rgba(255,215,0,.7); }
.bell-btn { position: absolute; top: 3%; right: 2%; z-index: 3; width: 32px; height: 32px; display: grid; place-items: center; }
.bell-btn svg { width: 21px; height: 21px; color: #f0ece4; filter: drop-shadow(0 0 6px rgba(255,215,0,.6)); }
.bell-badge {
  position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 99px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 800;
  line-height: 15px; text-align: center; box-shadow: 0 0 8px rgba(239,68,68,.8);
}

/* WEB5 ID badge */
.web5-id {
  position: absolute; bottom: 8%; right: 3%; z-index: 3;
  display: flex; align-items: center; gap: 5px;
  background: rgba(14, 12, 40, .72);
  border: 1.2px solid var(--line);
  border-radius: 10px;
  padding: 5px 9px;
  backdrop-filter: blur(6px);
}
.web5-label { font-size: 8px; font-weight: 800; color: var(--gold); }
.web5-addr { font-size: 7.5px; color: var(--muted); font-weight: 600; }
.web5-badge {
  font-size: 7px; font-weight: 800; color: var(--cyan);
  background: rgba(77,216,224,.15); border: 1px solid rgba(77,216,224,.35);
  padding: 1px 5px; border-radius: 99px;
}

/* ======================= 7 dich vu (1 hang cuon ngang) ======================= */
.svcrow {
  margin-top: 10px; padding: 10px;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.svcrow::-webkit-scrollbar { display: none; }
.svc-box {
  flex: 0 0 auto; width: 48px; aspect-ratio: 1;
  border-radius: 12px; overflow: hidden;
  border: 1.3px solid var(--line); background: rgba(245,196,81,.06);
  box-shadow: 0 0 10px var(--glow);
  display: grid; place-items: center;
}
.svc-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ======================= JESU Wallet & Tech Banner Row (cuon ngang) ======================= */
.wallet-tech-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wallet-tech-row::-webkit-scrollbar { display: none; }

.blockchain {
  flex: 0 0 215px;
  height: 216px; /* Increased 20% */
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.wallet-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.bc-title { font-size: 10px; font-weight: 800; color: var(--gold); letter-spacing: .2px; }
.wallet-badge {
  font-size: 6.5px; font-weight: 700; color: var(--cyan);
  background: rgba(77,216,224,.1); border: 1px solid rgba(77,216,224,.3);
  padding: 2px 6px; border-radius: 99px; white-space: nowrap;
}

.oc-head { margin-top: 6px; }
.oc-head h4 { font-size: 8px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.oc-balance { margin-top: 3px; font-size: 15px; font-weight: 900; line-height: 1;
  background: linear-gradient(90deg, #ffd700, #ffb347); -webkit-background-clip: text; background-clip: text; color: transparent; }
.oc-balance small { font-size: 8px; -webkit-text-fill-color: var(--muted); }
.oc-usd { margin-top: 2px; font-size: 8px; color: var(--gold); }

/* wallet actions (5 nut tron) */
.wallet-actions { display: flex; justify-content: space-between; gap: 3px; margin-top: 8px; }
.wact { display: grid; justify-items: center; gap: 3px; flex: 1 1 0; min-width: 0; }
.wact-ic {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1.2px solid var(--line); background: rgba(245,196,81,.1); box-shadow: 0 0 8px var(--glow);
}
.wact-ic svg { width: 14px; height: 14px; color: var(--amber); }
.wact small { font-size: 7px; color: #e8dfc8; font-weight: 700; }

/* coins (hang ngang, 3 coin) */
.coins { display: flex; gap: 4px; margin-top: 8px; }
.coin {
  flex: 1 1 0; min-width: 0; text-align: center; padding: 5px 2px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(245,196,81,.05);
}
.coin img { width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 2px; }
.coin b { display: block; font-size: 7px; color: var(--amber); }
.coin span { display: block; font-size: 7.5px; font-weight: 800; }
.coin em { display: block; font-style: normal; font-size: 6px; color: var(--muted); }

/* Banner Cong nghe Blockchain */
.tech-banner {
  flex: 0 0 auto;
  height: 216px; /* Increased 20% */
  width: auto;
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}
.tech-img {
  height: 100%;
  width: auto;
  display: block;
}

/* ======================= Banner BDS & Staking JCOIN ======================= */
.duo-banner .card-banner {
  flex: 0 0 auto;
  height: 144px; /* Increased 20% */
  width: auto;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}
.duo-banner .card-banner img {
  height: 100%;
  width: auto;
  display: block;
}

/* Nút bấm overlay mờ viền neon tím/xanh theo style Jesu */
.banner-btn {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  width: auto;
  margin: 0;
  z-index: 3;
  height: 24px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  color: #f0ece4;
  background: rgba(14, 12, 40, 0.72);
  border: 1px solid rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ======================= 8 card nho phia duoi (cuon ngang) ======================= */
.bottom-cards { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.bcard-row {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; touch-action: pan-x;
  padding-bottom: 2px;
}
.bcard-row::-webkit-scrollbar { display: none; }

.bcard {
  flex: 0 0 auto;
  width: auto;
  height: 114px; /* Increased 20% */
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}
.bcard .bcard-img {
  height: 100%;
  width: auto;
  display: block;
}
.bcard .banner-btn {
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 18px;
  font-size: 7.5px;
  border-radius: 5px;
}

/* ======================= BOTTOM NAV ======================= */
.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,32,.84), rgba(6,4,20,.98));
  border-top: 1px solid rgba(245,196,81,.25);
  padding: 7px 4px calc(10px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.nav-item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #5e5a4e; font-size: 8.5px; font-weight: 700; letter-spacing: .2px; }
.nav-item svg { width: 20px; height: 20px; color: currentColor; }
.nav-item.active { color: var(--gold); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(245,196,81,.7)); }
.nav-center { position: relative; flex: 0 0 auto; }
.nav-center-hex {
  width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
  background: url("public/nav-center-btn.png") center / cover no-repeat;
  filter: drop-shadow(0 0 12px rgba(245,196,81,.7));
}

/* =====================================================================
   HIEU UNG VIEN NEON CHAY + CHOP (tone VANG / GOLD)
   ===================================================================== */
@property --neon-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.card, .card-banner, .btn-gold { position: relative; }

.card::after, .card-banner::after, .btn-gold::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px;
  background: conic-gradient(from var(--neon-a),
    transparent 0deg 55deg,
    rgba(255,179,71,.35) 80deg,
    var(--neon) 104deg,
    #ffffff 118deg,
    var(--neon) 132deg,
    rgba(212,164,56,.5) 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: 5;
  filter: drop-shadow(0 0 4px var(--neon));
}
.card:nth-of-type(2)::after { animation-delay: -.5s; }
.card:nth-of-type(3)::after { animation-delay: -1s; }
.card:nth-of-type(4)::after { animation-delay: -1.5s; }
.card:nth-of-type(5)::after { animation-delay: -2s; }
.btn-gold::after { padding: 1.3px; }

.card, .card-banner { animation: neon-blink 2.8s ease-in-out infinite; }
.card:nth-of-type(2) { animation-delay: -.5s; }
.card:nth-of-type(3) { animation-delay: -1s; }
.card:nth-of-type(4) { animation-delay: -1.5s; }
.card:nth-of-type(5) { animation-delay: -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(245,196,81,.06); }
  50%      { box-shadow: 0 0 18px rgba(255,215,0,.45), inset 0 0 20px rgba(245,196,81,.12); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card-banner { animation: none; }
  .card::after, .card-banner::after, .btn-gold::after { animation: none; }
}
