:root{
  --bg:#070A12;
  --card:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.14);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.70);
  --shadow: 0 14px 40px rgba(0,0,0,.55);
  --radius:16px;
  --max:1100px;

  /* button palette */
  --ios1:#2f86ff; --ios2:#1e57d9;
  --and1:#26c95a; --and2:#178a3c;
  --apk1:#f59e0b; --apk2:#c96f00;
  --dis1:#6473ff; --dis2:#3f4bd6;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 700px at 50% 20%, rgba(125,211,252,.18), transparent 55%),
              radial-gradient(900px 600px at 70% 70%, rgba(167,139,250,.18), transparent 60%),
              var(--bg);
  color:var(--text);
}
a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto; display:block}
.wrap{min-height:100%; display:flex; flex-direction:column}

.container{
  width:min(var(--max), calc(100% - 36px));
  margin:0 auto;
}

/* NAV */
.nav{
  position:sticky; top:0; z-index:10;
  backdrop-filter: blur(10px);
  background: rgba(7,10,18,.65);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.nav__inner{
  padding:14px 0;
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:800; letter-spacing:.2px;
}

/* Logo: no stretch, bigger, keep ratio */
.brand img{
  width:auto;
  height:60px;
  max-width:420px;
  border-radius:0;
  object-fit:contain;
}
@media (max-width:520px){
  .brand img{height:52px; max-width:260px;}
}

.menu{
  display:flex; align-items:center; gap:10px;
  color:var(--muted);
  font-weight:700;
  font-size:14px;
  flex-wrap:wrap;
  justify-content:center;
}
.menu a{padding:8px 10px; border-radius:10px}
.menu a:hover{background:rgba(255,255,255,.06); color:var(--text)}

/* ===== SSR-like compact pill switch (50% size) ===== */
.langSwitch{
  display:flex;
  align-items:center;
  gap:4px;
  padding:3px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.22);
}

.langSwitch .pill{
  all:unset;
  cursor:pointer;

  height:18px;          /* ↓ từ ~32px */
  min-width:27px;       /* ↓ từ ~48px */
  padding:0 10px;       /* ↓ */
  
  display:flex;
  align-items:center;
  justify-content:center;

  border-radius:999px;
  font-size:11px;       /* ↓ */
  font-weight:900;
  letter-spacing:.2px;

  color:rgba(255,255,255,.75);
  transition:
    background .18s ease,
    color .18s ease,
    transform .15s ease;
}

.langSwitch .pill:hover{
  color:#fff;
}

.langSwitch .pill.active{
  background: rgba(255,255,255,.18);
  color:#fff;
  transform: scale(1.03);
}

/* Theme icon slightly larger */
.langSwitch .pill--theme .themeIcon{
  font-size:14px;
  line-height:1;
}

/* ===== Light/Dark switch animation (respect reduced motion) ===== */
@media (prefers-reduced-motion: no-preference){
  html.theme-anim body,
  html.theme-anim .nav,
  html.theme-anim .panel,
  html.theme-anim .card,
  html.theme-anim .itemCard,
  html.theme-anim .dlBtn,
  html.theme-anim .tbox,
  html.theme-anim .footer,
  html.theme-anim .langSwitch{
    transition:
      background-color .22s ease,
      color .22s ease,
      border-color .22s ease,
      box-shadow .22s ease,
      filter .22s ease;
  }

  html.theme-anim .langSwitch .pill{
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
  }

  html.theme-anim .langSwitch .pill.active{
    transform: translateY(-1px);
  }
}

/* HERO */
.hero{padding:26px 0 12px}
.hero__inner{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap:16px;
  align-items:stretch;
}
.panel{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.heroCard{position:relative}
.heroBg{
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(7,10,18,.25), rgba(7,10,18,.92)),
    url("../images/hero-bg.jpg") center/cover no-repeat;
  filter:saturate(1.05);
}
.heroContent{
  position:relative;
  padding:22px;
  min-height:360px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.kicker{
  display:inline-flex; gap:8px; align-items:center;
  font-size:13px; font-weight:900; letter-spacing:.35px;
  color:rgba(255,255,255,.78);
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.14);
  padding:8px 10px;
  border-radius:999px;
  width:fit-content;
}
.title{margin:0;font-size:42px;line-height:1.05;letter-spacing:.2px}
.desc{
  margin:0;
  color:rgba(255,255,255,.80);
  font-size:15.5px;
  line-height:1.55;
  max-width:62ch;
}

/* cards stack */
.dlStack{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:14px;
  margin-top:6px;
}
.dlBtn{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-radius:10px;
  overflow:hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.14);
  transform: translateZ(0);
}
.dlBtn:hover{transform: translateY(-1px)}
.dlBtn__left{padding:14px 16px}
.dlBtn__title{
  font-weight:1000;
  letter-spacing:.6px;
  font-size:18px;
  line-height:1.0;
  text-transform:uppercase;
  color:#fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.dlBtn__sub{
  margin-top:6px;
  font-size:12px;
  font-weight:800;
  color:rgba(255,255,255,.90);
  text-shadow: 0 2px 0 rgba(0,0,0,.22);
}
.dlBtn__right{
  width:68px;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.14);
}
.dlBtn__right img{width:26px;height:26px;opacity:.95}

.dlBtn--ios{background: linear-gradient(180deg, var(--ios1), var(--ios2))}
.dlBtn--android{background: linear-gradient(180deg, var(--and1), var(--and2))}
.dlBtn--apk{background: linear-gradient(180deg, var(--apk1), var(--apk2))}
.dlBtn--discord{background: linear-gradient(180deg, var(--dis1), var(--dis2))}

/* SIDE */
.side{padding:18px; display:flex; flex-direction:column; gap:12px}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius:14px;
  background: var(--card);
  border:1px solid rgba(255,255,255,.12);
  color:var(--muted);
  font-weight:900;
  font-size:13px;
  width:fit-content;
}
.sideTitle{margin:0; font-size:16px; letter-spacing:.2px}
.countdown{display:grid;grid-template-columns: repeat(4, 1fr);gap:10px}
.tbox{
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:12px 10px;
  text-align:center;
}
.num{font-size:22px;font-weight:1000;letter-spacing:.4px;line-height:1.1}
.lbl{margin-top:6px;font-size:11px;color:rgba(255,255,255,.65);font-weight:900;letter-spacing:.25px}
.note{margin:0; color:rgba(255,255,255,.72); line-height:1.55; font-size:14px}

/* SECTIONS */
.section{padding:18px 0 10px}
.sectionHead{margin:0 0 12px}
.sectionHead h2{margin:0 0 6px; font-size:18px}
.muted{color:var(--muted); margin:0; font-size:14px}

/* CARDS */
.cards{display:grid;gap:14px}
.cards--maps{grid-template-columns: repeat(3, 1fr)}
.card{
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  background: rgba(255,255,255,.05);
  box-shadow: 0 12px 26px rgba(0,0,0,.38);
  overflow:hidden;
}
.cardMedia{aspect-ratio: 16 / 9; background: rgba(0,0,0,.2)}
.cardMedia img{width:100%;height:100%;object-fit:cover}
.cardBody{padding:12px}
.cardTitle{font-weight:1000; font-size:14px}
.cardMeta{margin-top:6px; color:rgba(255,255,255,.65); font-weight:800; font-size:12px}

/* ITEMS GRID */
.cards--items{grid-template-columns: repeat(4, 1fr)}
.itemCard{
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  background: rgba(255,255,255,.05);
  box-shadow: 0 12px 26px rgba(0,0,0,.38);
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.itemIcon{
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.itemIcon img{width:72%;height:72%;object-fit:contain}
.itemName{font-weight:1000; font-size:13px}
.itemMeta{color:rgba(255,255,255,.65); font-weight:800; font-size:12px}

/* SUPPORT */
.supportPanel{padding:16px}
.supportPanel h2{margin:0 0 6px; font-size:18px}

/* FOOTER */
.footer{padding:18px 0 26px; color:rgba(255,255,255,.55); font-size:13px}
.footer__inner{display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap}
.footerLinks{display:flex; gap:10px; align-items:center}
.footer a{color:rgba(255,255,255,.65)}
.footer a:hover{color:rgba(255,255,255,.92)}

/* RESPONSIVE */
@media (max-width: 980px){
  .hero__inner{grid-template-columns: 1fr}
  .title{font-size:36px}
  .cards--maps{grid-template-columns: 1fr}
  .cards--items{grid-template-columns: repeat(2, 1fr)}
  .nav__inner{flex-wrap:wrap; justify-content:center}
  .menu{order:3}
}
@media (max-width: 420px){
  .cards--items{grid-template-columns: 1fr}
  .dlBtn__title{font-size:16px}
}
@media (max-width: 520px){
  body{ font-size: 15px; }
  .dlBtn__title{ font-size: 17px; line-height: 1.05; }
  .dlBtn__sub{ font-size: 12px; line-height: 1.1; }
  .dlBtn{ min-height: 58px; padding: 10px 12px; }
}
@media (max-width: 520px){
  .dlBtn__title{font-size: 13px; line-height: 1.05; letter-spacing: .2px;}
  .dlBtn__sub{font-size: 9.5px; line-height: 1.1; opacity: .9;}
}
@media (max-width: 520px){
  .nav{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(7,10,18,0.98) !important;
  }
}
@media (max-width: 1520px){
  .dlBtn__right{background: transparent !important;}
  .dlBtn__right::before{display: none !important;}
}
/* ===== Mobile: pin background gradient to viewport (no "loop" when scroll deep) ===== */
@media (max-width: 520px){
  body{
    background: var(--bg) !important; /* nền phẳng cho phần nội dung dài */
  }

  body::before{
    content:"";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
      radial-gradient(1200px 700px at 50% 20%, rgba(125,211,252,.18), transparent 55%),
      radial-gradient(900px 600px at 70% 70%, rgba(167,139,250,.18), transparent 60%),
      var(--bg);
  }
}
/* ===== PARTNERS (Flex wrap, centered last row, 2:1 tiles) ===== */
.cards--partners{
  display:flex;
  flex-wrap:wrap;
  justify-content:center; /* căn giữa khi xuống hàng */
  gap:12px;
}

/* Default = mobile: 3 per row */
.cards--partners .pLogo{
  flex: 0 1 calc((100% - 2*12px) / 3);  /* 3 tiles/row */
  max-width: calc((100% - 2*12px) / 3);

  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background: rgba(255,255,255,.05);
  box-shadow: 0 10px 22px rgba(0,0,0,.32);

  padding:10px;
  aspect-ratio: 2 / 1; /* rộng x2 */
  display:flex;
  align-items:center;
  justify-content:center;

  transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}

.cards--partners .pLogo:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
}

.cards--partners .pLogo img{
  width:86%;
  height:86%;
  object-fit:contain;
  opacity:.95;
}

/* PC: 6 per row */
@media (min-width: 981px){
  .cards--partners .pLogo{
    flex-basis: calc((100% - 5*12px) / 6);  /* 6 tiles/row */
    max-width:  calc((100% - 5*12px) / 6);
  }
}

/* ===== FIX: Mobile LIGHT must use light page background (behind panels) ===== */
@media (max-width: 520px){

  /* iOS Safari sometimes shows html background behind body (overscroll area) */
  :root[data-theme="light"] html,
  :root[data-theme="light"] body{
    background: var(--dt-bg) !important;
  }

  /* If you pinned background with body::before on mobile, override it in light */
  :root[data-theme="light"] body::before{
    background:
      radial-gradient(1200px 700px at 50% 20%, rgba(125,211,252,.06), transparent 60%),
      radial-gradient(900px 600px at 70% 70%, rgba(167,139,250,.06), transparent 65%),
      var(--dt-bg) !important;
  }
}

/* ===== Founded pill: same style as nav EN/VN/Theme ===== */
/* ===== Founded pill (default/dark) ===== */
.foundedPill{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:8px 14px;
  border-radius:999px;

  font-size:12px;
  font-weight:900;
  letter-spacing:.3px;

  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.28);
  color: rgba(255,255,255,.92);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Fix anchor jump offset when using sticky header */
html{
  scroll-behavior: smooth;        /* optional */
  scroll-padding-top: 88px;       /* chỉnh theo chiều cao header của bạn */
}

/* Ensure each target section stops below the sticky header */
.section{
  scroll-margin-top: 88px;        /* cùng giá trị với scroll-padding-top */
}