:root {
  --bg1: #b5f25e;
  --bg2: #7fdc3d;
  --panel: rgba(183, 255, 116, 0.86);
  --panel-border: rgba(65, 122, 22, 0.6);
  --green-dark: #0c8d1d;
  --green-btn: linear-gradient(180deg, #0fa718 0%, #077f12 100%);
  --gold: linear-gradient(180deg, #f5d76e 0%, #b97c15 100%);
  --blue: linear-gradient(180deg, #53b6ff 0%, #1e57f0 100%);
  --purple: linear-gradient(180deg, #bb5cff 0%, #7e23db 100%);
  --shadow: 0 14px 34px rgba(0,0,0,0.25);
  --text: #203106;
  --white: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.35), transparent 20%),
    radial-gradient(circle at 82% 22%, rgba(255,255,255,0.28), transparent 18%),
    linear-gradient(180deg, #70d8ff 0%, #bff6ff 18%, #9be375 45%, #6cd944 100%);
  overflow-x: hidden;
}
.scene { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.temple { position: absolute; width: 280px; height: 420px; bottom: 70px; background: linear-gradient(180deg, #ffd876 0%, #ca7b12 60%, #955300 100%); clip-path: polygon(10% 35%, 28% 19%, 50% 10%, 72% 19%, 90% 35%, 86% 38%, 82% 92%, 18% 92%, 14% 38%); filter: drop-shadow(0 10px 18px rgba(0,0,0,0.26)); opacity: 0.95; }
.temple::before { content: ""; position: absolute; inset: 13% 15% 8% 15%; background: linear-gradient(180deg, #49b4ff 0%, #197cd6 100%); clip-path: polygon(6% 14%, 50% 0%, 94% 14%, 82% 20%, 18% 20%); }
.temple::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 18%; height: 34%; background: linear-gradient(180deg, #ffefb8 0%, #df9e35 100%); border-radius: 10px; box-shadow: inset 0 0 0 6px rgba(126,65,0,.35); }
.temple.left { left: -20px; transform: scale(1.03); }
.temple.right { right: -20px; transform: scaleX(-1) scale(1.03); }
.waterfall { position: absolute; width: 120px; height: 260px; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(175,225,255,0.75), rgba(97,175,255,0.35)); border-radius: 60px 60px 0 0; filter: blur(1px); opacity: 0.7; }
.waterfall.left { left: 70px; }
.waterfall.right { right: 70px; }
.balloon { position: absolute; width: 56px; height: 72px; border-radius: 50% 50% 46% 46%; background: linear-gradient(180deg, #ffcd4e 0%, #ff9d16 100%); box-shadow: inset -8px -10px 0 rgba(255,255,255,.18), var(--shadow); }
.balloon::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: -14px; width: 2px; height: 16px; background: #946100; }
.balloon.b1 { top: 90px; left: 12%; }
.balloon.b2 { top: 110px; right: 13%; }
.balloon.b3 { top: 210px; right: 18%; width: 30px; height: 38px; }
.sparkles { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.6) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(255,216,87,0.7) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(255,92,214,0.35) 0 1px, transparent 1.5px); background-size: 120px 120px,150px 150px,180px 180px; background-position: 0 0,32px 52px,80px 20px; opacity:.45; }
.page {
  position: relative;
  z-index: 1;
  max-width: 1050px;
  width: 100%;
  margin: 18px auto 40px;
  padding: 0 16px;
}
.panel {
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  overflow: hidden;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.hero { padding: 18px 22px 26px; position: relative; min-height: 560px; }
.notice-top { text-align: center; font-size: 13px; color: #355300; margin-bottom: 16px; font-weight: 700; }
.logo-wrap { text-align: center; margin-top: 18px; margin-bottom: 18px; }
.link-reset { text-decoration: none; }
.logo { display: inline-block; padding: 18px 34px 20px; border-radius: 999px; background: radial-gradient(circle at 50% 50%, rgba(130,255,234,0.98) 0%, rgba(72,188,196,0.95) 26%, rgba(23,91,125,0.96) 56%, rgba(6,50,45,0.88) 100%); box-shadow: 0 0 0 6px rgba(255,255,255,.18), 0 0 35px rgba(78,255,223,.45); border: 4px solid rgba(255,255,255,.24); position: relative; }
.logo::before, .logo::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; background: radial-gradient(circle at 30% 30%, #9cff8c 0%, #2b9132 55%, #185719 100%); border-radius: 18px; box-shadow: 0 0 0 4px rgba(62,97,18,.35); }
.logo::before { left: -18px; }
.logo::after { right: -18px; }
.logo-main { display:block; font-size:64px; font-weight:900; line-height:1; color:#ffe25a; text-shadow:0 2px 0 #8f2f00, 0 4px 0 #8f2f00, 0 7px 12px rgba(0,0,0,.35); }
.logo-sub { display:block; font-size:52px; font-weight:900; line-height:1; color:#dcfbff; text-shadow:0 2px 0 #1079a9, 0 4px 10px rgba(0,0,0,.35); margin-top:2px; font-style:italic; }
.user-bar { margin-top: 10px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.user-bar.compact { margin-bottom: 12px; }
.user-box { background: rgba(255,255,255,.25); border:1px solid rgba(77,111,29,.35); border-radius:999px; padding:10px 16px; font-weight:800; }
.btn { border:0; cursor:pointer; color:var(--white); font-weight:800; border-radius:14px; padding:14px 16px; box-shadow:0 8px 18px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.25); text-align:center; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:transform .15s ease, box-shadow .15s ease, filter .15s ease; user-select:none; }
.btn:hover { transform:translateY(-2px); filter:brightness(1.04); }
.btn:active { transform:translateY(1px); }
.btn-blue { background:var(--blue); }
.btn-purple { background:var(--purple); }
.btn-green { background:var(--green-btn); }
.btn-gold { background:var(--gold); color:#412300; }
.btn-pill { border-radius:16px; min-height:56px; border:3px solid #eedf29; font-size:16px; }
.btn-small { padding:10px 14px; min-height: auto; }
.download-grid, .action-grid, .stats-grid, .card-grid { display:grid; gap:14px; }
.download-grid { grid-template-columns: repeat(3, minmax(110px, 140px)); justify-content:center; margin-top:16px; margin-bottom:18px; }
.action-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.action-grid.top-gap { margin: 10px 0 22px; }
.helper-text { text-align:center; margin-top:18px; font-size:14px; color:#4f710b; }
.marquee-row { display:flex; align-items:center; gap:10px; margin:14px 0 4px; font-weight:800; color:#7a1200; }
.marquee-box { flex:1; overflow:hidden; white-space:nowrap; background:rgba(255,255,255,.2); border-radius:999px; padding:7px 14px; border:1px solid rgba(77,111,29,.35); }
.marquee-track { display:inline-block; animation:ticker 15s linear infinite; }
@keyframes ticker { from { transform:translateX(100%); } to { transform:translateX(-100%); } }
.section-title { text-align:center; font-size:28px; font-weight:900; color:#7d2500; margin-bottom:18px; }
.inner-panel { background: rgba(255,255,255,0.12); border-radius: 18px; padding: 22px 18px; border:1px solid rgba(89,137,21,.24); }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.stat-card { background: rgba(255,255,255,.24); border:1px solid rgba(84,112,17,.25); border-radius: 16px; padding: 14px; text-align: center; }
.stat-label { font-size: 13px; font-weight: 700; color: #4f710b; }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 900; color: #7a1200; }
.stat-sub { margin-top: 4px; font-size: 12px; color: #456c10; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: rgba(255,255,255,.24); border:1px solid rgba(84,112,17,.25); border-radius: 16px; padding: 16px; }
.card-title { font-size: 18px; font-weight: 900; color: #7a1200; margin-bottom: 10px; }
.meta-list { display: grid; gap: 8px; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(84,112,17,.25); padding-bottom: 6px; }
.meta-row:last-child { border-bottom: 0; padding-bottom: 0; }
.meta-key { font-weight: 700; color: #4f710b; }
.meta-value { font-weight: 800; text-align: right; }
.empty-box { background: rgba(255,255,255,.24); border:1px dashed rgba(84,112,17,.4); border-radius: 16px; padding: 18px; text-align: center; font-weight: 700; color: #456c10; }
.table-wrap { overflow-x: auto; border-radius: 16px; }
.data-table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.24); overflow: hidden; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid rgba(84,112,17,.22); text-align: left; vertical-align: top; }
.data-table th { background: rgba(12,141,29,.12); color: #325106; font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.badge-success { background: rgba(17, 145, 34, .15); color: #0f7e1f; }
.badge-danger { background: rgba(180, 35, 24, .12); color: #b42318; }
.badge-warning { background: rgba(184, 124, 21, .16); color: #8a5a00; }
.badge-info { background: rgba(30, 87, 240, .14); color: #1d4ed8; }
.side-floating { position: fixed; right: 18px; bottom: 42px; display: flex; flex-direction: column; gap: 12px; z-index: 12; }
.side-floating .btn { min-width: 138px; justify-content: flex-start; padding-inline: 18px; border-radius: 14px; font-size: 16px; }
.toast { position: fixed; top: 20px; right: 20px; color:#fff; padding:12px 16px; border-radius:12px; box-shadow: var(--shadow); z-index:50; display:none; font-weight:700; max-width:360px; }
.flex-actions { display:flex; justify-content:center; gap:12px; flex-wrap:wrap; margin-top:18px; }
.inline-note { margin: 6px 0 18px; text-align: center; font-size: 14px; color: #456c10; font-weight: 700; }

@media (max-width: 980px) { .side-floating { right:10px; bottom:18px; } .temple { opacity:.65; } }
@media (max-width: 760px) {
  .logo-main { font-size:48px; }
  .logo-sub { font-size:38px; }
  .download-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .action-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .side-floating { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
  .side-floating .btn { min-width: 150px; justify-content: center; }
}
@media (max-width: 520px) {
  .hero { padding: 16px 14px 22px; min-height: auto; }
  .logo-main { font-size:38px; }
  .logo-sub { font-size:30px; }
  .download-grid, .action-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 24px; }
}
/* FIX lớp đè nút ở trang chủ */
.action-grid,
.action-grid.top-gap {
  position: relative !important;
  z-index: 200 !important;
}

.action-grid a,
.action-grid button,
.action-grid .btn {
  position: relative !important;
  z-index: 210 !important;
  pointer-events: auto !important;
}

/* Các lớp nền trang trí không được chặn click */
.scene,
.sparkles,
.temple,
.waterfall,
.balloon {
  pointer-events: none !important;
}

/* Nếu có khối nào nằm chồng phía dưới thì ép nó xuống */
.download-grid,
.platform-grid,
.link-grid,
.live-notice-bar,
.inner-panel,
.stats-grid {
  position: relative;
  z-index: 1;
}
/* FIX cụm nút header bị lớp khác đè */
.hero {
  position: relative !important;
  isolation: isolate !important;
}

.header-controls-safe {
  position: relative !important;
  z-index: 5000 !important;
  isolation: isolate !important;
  margin-bottom: 26px;
}

.user-bar,
.action-grid {
  position: relative !important;
  z-index: 5001 !important;
}

.user-bar a,
.action-grid a,
.action-grid button,
.user-bar .btn,
.action-grid .btn {
  position: relative !important;
  z-index: 5002 !important;
  pointer-events: auto !important;
}

/* Hạ các khối nội dung bên dưới xuống */
.inner-panel,
.section-title,
.stats-grid,
.platform-grid,
.download-grid,
.link-grid,
.live-notice-bar,
.notice-track,
.notice-wrap,
.home-platforms,
.home-downloads,
.home-links {
  position: relative !important;
  z-index: 1 !important;
}

/* Các lớp trang trí không được chặn click */
.scene,
.sparkles,
.temple,
.waterfall,
.balloon {
  pointer-events: none !important;
}