/* Capy Đi Bụi web (giao diện 2, 24/11/2026). Màu lấy từ logo và giao diện trong game: nâu mực, kem, cam "Bắt đầu",
   xanh lá, trời xanh. Khung, nút, popup đều viền nâu mực + bóng đổ thẳng như nút trong game. */
:root {
  --ink: #3d2410; --ink-2: #6b4425; --muted: #8a6d52; --line: #ecdcc4;
  --cream: #fff9ee; --cream-2: #fbeccf; --paper: #ffffff;
  --sky-1: #2a95ea; --sky-2: #a6e9fb;
  --orange-1: #ffc04f; --orange-2: #f2861b; --orange-t: #9b4a06;
  --green-1: #92de52; --green-2: #43a82a; --green-t: #2c6b17;
  --blue-1: #6cc8ff; --blue-2: #2e8be0; --blue-t: #164f8a;
  --purple-1: #c9a2ff; --purple-2: #8a5ae0; --purple-t: #4b2a8c;
  --night-1: #2d2460; --night-2: #18123c;
  --sand: #ffe7bd;
  --news: #2e8be0; --event: #f2861b; --guide: #43a82a;
  --radius: 22px;
  --pop: 0 6px 0 var(--ink);
  --head: "Baloo 2", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* chữ trắng viền nâu như tiêu đề trong game */
  --outline: 0 3px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink),
             2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 7px 0 var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* thuộc tính hidden thắng display:flex/grid của class (vd .tabs) */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 400 15.5px/1.6 var(--body); color: var(--ink); overflow-x: clip;
  background: #e3f5ff url("../assets/hero-bg.jpg") center top / 1920px auto no-repeat;
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 3px; }

/* ---------- header: thanh nổi bo tròn ---------- */
.top { position: sticky; top: 0; z-index: 40; padding-top: 10px; pointer-events: none; }
.top-inner {
  position: relative; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 10px;
  pointer-events: auto; background: rgba(255, 249, 238, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); transition: box-shadow .2s;
}
.top.scrolled .top-inner { box-shadow: 0 5px 0 var(--ink), 0 16px 32px rgba(15, 40, 80, .22); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand img:first-child { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--ink); }
/* chữ thương hiệu theo màu logo: "Capy" vàng, "Đi Bụi" kem, viền nâu */
.brand-text {
  padding-top: 4px; white-space: nowrap; font: 800 25px/1 var(--head); color: #fff1cf; letter-spacing: .3px;
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink),
               1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink), 0 4px 0 var(--ink);
}
.brand-text b { font-weight: 800; color: #ffcf2e; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  padding: 9px 15px 7px; border-radius: 13px; text-decoration: none;
  font: 700 17px/1 var(--head); color: var(--ink-2); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--cream-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--cream); }
.top-social { display: flex; gap: 8px; margin-left: auto; }
.social { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; transition: transform .12s; }
.social svg { width: 38px; height: 38px; }
.social:hover { transform: translateY(-2px); }
.top-cta { flex: none; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 12px; background: var(--cream-2); cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 3px; margin: 4px auto; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- nút (kiểu nút trong game) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px 8px; border: 3px solid var(--ink); border-radius: 16px; cursor: pointer; text-decoration: none;
  font: 800 19px/1.1 var(--head); color: #fff; letter-spacing: .2px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 var(--ink);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 2px 0 var(--ink); }
.btn svg { width: 22px; height: 22px; }
.btn-orange { background: linear-gradient(180deg, var(--orange-1), var(--orange-2)); text-shadow: 0 2px 0 var(--orange-t); }
.btn-green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); text-shadow: 0 2px 0 var(--green-t); }
.btn-blue { background: linear-gradient(180deg, var(--blue-1), var(--blue-2)); text-shadow: 0 2px 0 var(--blue-t); }
.btn-ghost { background: var(--cream); color: var(--ink-2); box-shadow: 0 4px 0 var(--ink); }
.btn-sm { padding: 7px 14px 5px; font-size: 16px; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 3px 0 var(--ink); }
.btn-lg { padding: 15px 34px 12px; font-size: 24px; border-radius: 18px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 6px 0 var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; margin-top: -77px; padding: 104px 0 0; text-align: center; }
/* tia nắng xoay chậm sau logo */
.hero::before {
  content: ""; position: absolute; left: 50%; top: 300px; width: 1500px; height: 1500px; margin: -750px 0 0 -750px;
  background: repeating-conic-gradient(rgba(255, 255, 255, .2) 0 7deg, rgba(255, 255, 255, 0) 7deg 15deg);
  -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 70%); mask: radial-gradient(closest-side, #000 18%, transparent 70%);
  animation: spin 100s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero > .wrap { position: relative; z-index: 2; }
.clouds { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cloud {
  position: absolute; left: 0; width: 170px; height: 54px; background: #fff; border-radius: 60px; opacity: .9;
  filter: drop-shadow(0 6px 0 rgba(40, 110, 180, .14)); animation: drift 90s linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 74px; height: 74px; left: 22px; top: -34px; }
.cloud::after { width: 96px; height: 96px; right: 20px; top: -50px; }
.cloud.c1 { top: 150px; animation-delay: -20s; }
.cloud.c2 { top: 300px; transform: scale(.7); animation-duration: 120s; animation-delay: -75s; opacity: .75; }
.cloud.c3 { top: 90px; animation-duration: 140s; animation-delay: -110s; opacity: .8; }
@keyframes drift { from { transform: translateX(-260px); } to { transform: translateX(calc(100vw + 60px)); } }

.hero-stage { position: relative; width: min(800px, 100%); margin: 0 auto; }
.hero-logo { width: min(540px, 86vw); height: auto; margin: 0 auto; filter: drop-shadow(0 7px 0 rgba(30, 60, 110, .25)); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.025); } }
.hero-tag {
  display: inline-block; margin: 6px 0 22px; padding: 7px 22px 4px; border-radius: 99px;
  background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  font: 800 19px/1.3 var(--head); color: var(--ink-2);
}
.hero-cta { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-platforms { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 20px 0 0; padding: 0; list-style: none; }
.plat {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 6px; border-radius: 99px; cursor: pointer;
  background: rgba(255, 255, 255, .8); border: 2px solid rgba(61, 36, 16, .2); color: var(--ink-2);
  font: 700 14px/1 var(--body); transition: background .15s, transform .12s;
}
.plat:hover { background: #fff; transform: translateY(-2px); }
.plat span { display: inline-flex; }
.plat svg { width: 18px; height: 18px; }
.hero-ground { position: relative; z-index: 1; height: 150px; margin-top: 4px; background: url("../assets/hero-fg.png") center bottom / auto 150px repeat-x; }

/* nhân vật bay quanh logo */
.floaty { position: absolute; width: 96px; filter: drop-shadow(0 5px 0 rgba(20, 60, 110, .25)); animation: bob 4s ease-in-out infinite; pointer-events: none; }
.f1 { left: 1%; top: 40%; width: 122px; }
.f2 { left: 9%; top: 0; animation-delay: -1s; }
.f3 { left: -3%; top: 76%; width: 76px; animation-delay: -2.2s; }
.f4 { right: 4%; top: 4%; width: 108px; animation-delay: -.6s; }
.f5 { right: 0; top: 50%; width: 82px; animation-delay: -1.7s; }
.f6 { right: 13%; top: 76%; width: 86px; animation-delay: -2.8s; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-3deg); } }

/* ---------- ô lối tắt (đè lên bãi cỏ) ---------- */
.quick { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: -104px; }
.quick-tile {
  position: relative; display: flex; align-items: center; min-height: 96px; padding: 14px 14px 12px 100px;
  border: 3px solid var(--ink); border-radius: 22px; text-decoration: none; color: #fff; cursor: pointer; text-align: left;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), var(--pop); transition: transform .12s, filter .15s;
}
.quick-tile:hover { transform: translateY(-4px); filter: brightness(1.05); }
.quick-tile:active { transform: translateY(2px); }
.quick-tile img {
  position: absolute; left: 6px; bottom: 8px; width: 88px; height: 88px; object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .22)); transition: transform .2s;
}
.quick-tile:hover img { transform: rotate(-7deg) scale(1.08); }
.quick-tile strong { display: block; font: 800 22px/1.05 var(--head); }
.quick-tile small { display: block; margin-top: 3px; font: 600 13px/1.3 var(--body); opacity: .96; }
.qt-orange { background: linear-gradient(180deg, var(--orange-1), var(--orange-2)); text-shadow: 0 2px 0 var(--orange-t); }
.qt-green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); text-shadow: 0 2px 0 var(--green-t); }
.qt-blue { background: linear-gradient(180deg, var(--blue-1), var(--blue-2)); text-shadow: 0 2px 0 var(--blue-t); }
.qt-purple { background: linear-gradient(180deg, var(--purple-1), var(--purple-2)); text-shadow: 0 2px 0 var(--purple-t); }
.quick-tile small { text-shadow: none; }

/* ---------- bố cục ---------- */
.main { padding: 0; background: linear-gradient(180deg, #e9f7ff 0, #f4fbff 320px); }
.main > .grid { padding-top: 40px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }
.panel { position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--pop), 0 20px 36px rgba(30, 70, 120, .12); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.panel-head h2, .side h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 800 25px/1.1 var(--head); }
.panel-head h2::before, .side h2::before {
  content: ""; flex: none; width: 10px; height: 22px; border-radius: 4px;
  background: linear-gradient(180deg, var(--orange-1), var(--orange-2)); box-shadow: 0 0 0 2px var(--ink);
}
.panel-head a { padding: 5px 12px 4px; border-radius: 99px; background: var(--cream); border: 2px solid var(--line); font-weight: 700; font-size: 13.5px; color: var(--blue-2); text-decoration: none; }
.panel-head a:hover { border-color: var(--blue-2); }
.panel-pad { padding: 16px 20px 20px; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.tabs button {
  padding: 7px 15px 5px; border: 2px solid var(--line); border-radius: 99px; background: var(--cream);
  font: 700 15px/1.2 var(--head); color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.tabs button:hover { border-color: var(--ink-2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 3px 0 rgba(61, 36, 16, .35); }

/* chips */
.chip { display: inline-block; flex: none; padding: 3px 10px 2px; border-radius: 8px; font: 700 12.5px/1.45 var(--body); color: #fff; background: var(--news); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.chip-su-kien { background: var(--event); }
.chip-huong-dan { background: var(--guide); }

/* danh sách bài */
.post-list { list-style: none; margin: 0; padding: 8px 0 10px; }
.post-list a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; border-top: 2px dashed var(--line); transition: background .15s; }
.post-list li:first-child a { border-top: 0; }
.post-list a:hover { background: var(--cream); }
.post-list a:hover .post-title { color: var(--blue-2); }
.post-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-list time { flex: none; font-size: 13px; color: var(--muted); }
.empty { padding: 18px 20px; color: var(--muted); }
.empty-box { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 30px; text-align: center; color: var(--ink-2); }
.empty-box img { width: 110px; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 5px 0 rgba(61, 36, 16, .2)); }
.empty-box p { margin: 0; font-size: 16px; }
.empty-box .btn { margin-top: 6px; }

/* bài nổi bật + thẻ bài */
.featured { padding: 18px 20px 6px; }
.post-card { display: grid; grid-template-columns: 330px 1fr; gap: 18px; text-decoration: none; }
.post-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: var(--cream-2); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 78% center; transition: transform .3s; }
.post-card:hover img { transform: scale(1.05); }
.post-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 2px 0; }
.post-card-body strong { font: 800 23px/1.2 var(--head); }
.post-card:hover .post-card-body strong { color: var(--blue-2); }
.post-card-body small { font-size: 14.5px; color: var(--ink-2); }
.post-card-body time { margin-top: auto; font-size: 13px; color: var(--muted); }
.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 20px; }
.news-grid .post-card { grid-template-columns: 1fr; gap: 12px; }
.news-grid .post-card-body strong { font-size: 20px; }

/* cột phải */
.side { display: grid; gap: 24px; }
.side .panel { padding: 20px; }
.side p { margin: 6px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.side .btn { width: 100%; }
.side-dl { background: linear-gradient(180deg, #fffaf0, #ffe9c0); }
.side-dl p { padding-right: 70px; }
.side-mascot { position: absolute; right: -14px; top: -40px; width: 100px; transform: rotate(8deg); pointer-events: none; filter: drop-shadow(0 5px 0 rgba(61, 36, 16, .25)); }
.code-box {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 9px 9px 16px;
  background: #fff6dc; border: 2px dashed var(--orange-2); border-radius: 14px;
}
.code-box code { font: 800 21px/1 ui-monospace, Consolas, monospace; letter-spacing: 1.5px; color: var(--orange-t); }
.side .code-box .btn { width: auto; }
.community a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 34px 11px 12px; margin-top: 10px;
  border: 2px solid var(--line); border-radius: 15px; text-decoration: none; background: var(--cream); transition: border-color .15s, transform .12s;
}
.community a::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-52%); font: 800 26px/1 var(--head); color: var(--muted); }
.community a:hover { border-color: var(--ink-2); transform: translateX(2px); }
.community svg { width: 42px; height: 42px; flex: none; }
.community strong { display: block; font: 800 17px/1.2 var(--head); }
.community small { color: var(--muted); font-size: 13px; }

/* ---------- tiêu đề trang con / bài viết ---------- */
.page-title { padding: 34px 0 24px; }
.page-title h1 { margin: 0; font: 800 clamp(32px, 5vw, 46px)/1.1 var(--head); color: #fff; text-shadow: var(--outline); }
.article { padding: 24px 28px 32px; }
.crumbs { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--blue-2); text-decoration: none; font-weight: 600; }
.article-title { margin: 10px 0 4px; font: 800 clamp(27px, 4vw, 38px)/1.15 var(--head); text-wrap: balance; }
.article-date { font-size: 13.5px; color: var(--muted); }
.article-cover { width: 100%; aspect-ratio: 734 / 312; object-fit: cover; object-position: right center; margin: 18px 0 8px; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.article-body { font-size: 16.5px; line-height: 1.75; }
.article-body h3 { margin: 26px 0 6px; font: 800 23px/1.2 var(--head); }
.article-body a { color: var(--blue-2); font-weight: 600; }
.article-body li { margin: 5px 0; }
.article-body img { border-radius: 14px; margin: 14px 0; }
.article-body .btn { color: #fff; }

/* ---------- các dải nội dung, nối nhau bằng mép sóng ---------- */
.band { position: relative; padding: 70px 0; }
.band::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 26px; pointer-events: none;
  background: var(--wave) repeat-x; background-size: 104px 26px;
}
.band-head { text-align: center; margin-bottom: 28px; }
.band-kicker {
  display: inline-block; margin-bottom: 8px; padding: 4px 14px 3px; border-radius: 99px; border: 2px solid var(--ink);
  background: var(--cream); font: 800 13px/1.3 var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-2);
}
.band-head h2 { margin: 0; font: 800 clamp(34px, 4.8vw, 50px)/1.05 var(--head); color: #fff; text-shadow: var(--outline); letter-spacing: .5px; }
.band-head p { margin: 12px 0 0; color: var(--ink-2); font-weight: 600; }

.band-world {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 26'%3E%3Cpath d='M0 26V14C13 4 26 4 39 13S65 22 78 13 98 6 104 9V26Z' fill='%23ffe7bd'/%3E%3C/svg%3E");
  margin-top: 90px; background: var(--sand) radial-gradient(rgba(155, 74, 6, .1) 2px, transparent 2.6px) 0 0 / 26px 26px;
}
.world-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.world-card { position: relative; margin: 0; transition: transform .18s; }
.world-card:nth-child(odd):hover { transform: translateY(-6px) rotate(-1.5deg); }
.world-card:nth-child(even):hover { transform: translateY(-6px) rotate(1.5deg); }
.world-card img { width: 100%; height: auto; filter: drop-shadow(0 8px 0 rgba(155, 74, 6, .18)); }
.world-card figcaption { position: absolute; left: 8%; right: 8%; top: 73%; bottom: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.world-card strong { font: 800 clamp(16px, 2vw, 23px)/1.1 var(--head); }
.world-card small { display: none; }

.band-modes {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 26'%3E%3Cpath d='M0 26V14C13 4 26 4 39 13S65 22 78 13 98 6 104 9V26Z' fill='%232d2460'/%3E%3C/svg%3E");
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(140, 120, 255, .35), transparent 60%),
    radial-gradient(#fff 1px, transparent 1.7px) 0 0 / 130px 130px,
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.7px) 40px 60px / 76px 76px,
    linear-gradient(180deg, var(--night-1), var(--night-2));
}
.band-modes .band-kicker { background: #ffe08a; }
.band-modes .band-head p { color: #d9d2ff; }
.modes-track {
  /* thẻ chạy sát lề trái màn hình (cách 20px), không canh theo khung 1160px nữa */
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 20px 18px;
  scroll-padding-inline: 20px; /* thẻ đầu không dính mép trái khi bám cuộn */
  scrollbar-width: none;
}
.modes-track::-webkit-scrollbar { display: none; }
/* kéo bằng chuột (ui.js) */
@media (hover: hover) and (pointer: fine) { .modes-track { cursor: grab; } }
.modes-track { -webkit-user-select: none; user-select: none; }
.modes-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.modes-track.free { scroll-snap-type: none; }
.modes-track.dragging .mode-card { transform: none; transition: none; }
.mode-card img { -webkit-user-drag: none; }
.mode-card {
  position: relative; flex: 0 0 min(440px, 82vw); margin: 0; scroll-snap-align: start; border-radius: 20px; overflow: hidden;
  border: 3px solid var(--ink); box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 9px 0 rgba(0, 0, 0, .4); transition: transform .18s;
}
.mode-card:hover { transform: translateY(-5px); }
.mode-card img { width: 100%; aspect-ratio: 734 / 312; object-fit: cover; }
.mode-card figcaption { position: absolute; left: 18px; top: 0; bottom: 0; width: 46%; display: flex; flex-direction: column; justify-content: center; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mode-card strong { font: 800 27px/1.05 var(--head); }
.mode-card small { margin-top: 4px; font-size: 13px; line-height: 1.35; color: #f1edff; }
.modes-nav { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.modes-nav button {
  width: 48px; height: 48px; border: 3px solid var(--ink); border-radius: 50%; cursor: pointer;
  background: linear-gradient(180deg, #fff, var(--cream-2)); color: var(--ink); font: 800 26px/1 var(--head);
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s;
}
.modes-nav button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.band-pals {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 26'%3E%3Cpath d='M0 26V14C13 4 26 4 39 13S65 22 78 13 98 6 104 9V26Z' fill='%23d9f3ff'/%3E%3C/svg%3E");
  overflow: visible; padding-bottom: 90px; background: linear-gradient(180deg, #d9f3ff, #bde8ff);
}
.marquee { overflow: hidden; padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row { display: flex; gap: 26px; width: max-content; animation: slide 55s linear infinite; }
.marquee-row img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(20, 60, 110, .2)); transition: transform .2s; }
.marquee-row img:hover { transform: translateY(-8px) scale(1.1); }
.marquee:hover .marquee-row { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.main:has(.band-pals) { padding-bottom: 0; }

/* ---------- điều khoản / bảo mật ---------- */
.legal { max-width: 880px; }
.legal .article-body { font-size: 15.5px; line-height: 1.7; }
.legal .article-body h3 { font-size: 21px; margin-top: 28px; padding-top: 14px; border-top: 2px dashed var(--line); }
.legal-other { margin: 28px 0 0; padding-top: 16px; border-top: 2px solid var(--line); font-weight: 600; }
.legal-other a { color: var(--blue-2); }

/* ---------- footer ---------- */
.foot {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 26'%3E%3Cpath d='M0 26V14C13 4 26 4 39 13S65 22 78 13 98 6 104 9V26Z' fill='%233d2410'/%3E%3C/svg%3E");
  position: relative; margin-top: 60px; padding: 34px 0 38px; background: var(--ink); color: #e9d6bd; font-size: 14px;
}
.band-pals + .foot, .main:has(.band-pals) + .foot { margin-top: 0; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 26px; background: var(--wave) repeat-x; background-size: 104px 26px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 48px; height: 48px; border-radius: 13px; border: 2px solid #e9d6bd; }
.foot-brand strong { display: block; font: 800 22px/1 var(--head); color: #fff; }
.foot-links { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.foot-links a { color: #e9d6bd; text-decoration: none; font-weight: 600; }
.foot-links a:hover { color: #ffd27a; }
.foot-copy { flex-basis: 100%; padding-top: 16px; border-top: 1px solid rgba(233, 214, 189, .2); font-size: 13px; color: #c7ae90; }

/* ---------- nút nổi Zalo / Facebook ---------- */
.float { position: fixed; right: 16px; bottom: 18px; z-index: 30; display: grid; gap: 10px; }
.float a { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.float svg { width: 54px; height: 54px; }
.float a:first-child { animation: nudge 3s ease-in-out infinite; }
@keyframes nudge { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-10deg); } 95% { transform: rotate(10deg); } }

/* ---------- popup ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(25, 14, 5, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: min(430px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 26px 22px 22px; text-align: center; background: linear-gradient(180deg, var(--cream), var(--cream-2));
  border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 7px 0 var(--ink), 0 22px 40px rgba(0, 0, 0, .4);
  animation: pop .22s cubic-bezier(.3, 1.5, .6, 1);
}
@keyframes pop { from { transform: scale(.88); opacity: 0; } }
.modal-x {
  position: absolute; right: 10px; top: 10px; width: 38px; height: 38px; padding: 7px; border: 3px solid var(--ink); border-radius: 50%;
  background: linear-gradient(180deg, #ff7a63, #d9402d); color: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--ink);
}
.modal-title { margin: 8px 0 4px; font: 800 27px/1.15 var(--head); }
.modal-sub { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.modal-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 12px; border: 3px solid var(--ink); }
.modal-mascot { width: 116px; margin: -6px auto 2px; animation: bob 4s ease-in-out infinite; }
.btn-zalo { width: 100%; background: linear-gradient(180deg, #3d8bff, #0068ff); text-shadow: 0 2px 0 #00399a; }
.btn-zalo svg { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 2px #fff; }
.modal-event {
  display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; text-align: left; text-decoration: none;
  background: #fff; border: 2px dashed var(--orange-2); border-radius: 14px; font-weight: 600; font-size: 14px;
}
.modal-event span:last-child { flex: 1; min-width: 0; }
.modal-later { margin-top: 12px; border: 0; background: none; cursor: pointer; font: 600 14px var(--body); color: var(--muted); text-decoration: underline; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-link { display: inline-block; margin-top: 14px; color: var(--blue-2); font-weight: 600; font-size: 14px; }
.dl-list { display: grid; gap: 10px; text-align: left; }
.dl-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, background .15s;
}
.dl-item:hover { background: #fffaf0; }
.dl-item:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.dl-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(180deg, var(--orange-1), var(--orange-2)); color: #fff; border: 2px solid var(--ink); }
.dl-ico svg { width: 26px; height: 26px; }
.dl-item strong { display: block; font: 800 20px/1.1 var(--head); }
.dl-item small { color: var(--muted); }

/* ---------- hiện dần khi cuộn (ui.js thêm class .reveal; không có JS thì hiện luôn) ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- điện thoại / máy tính bảng ---------- */
@media (max-width: 1000px) {
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -96px; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; gap: 12px; }
  .side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
  .top { padding-top: 8px; }
  .top-inner { height: 58px; gap: 8px; padding: 0 8px; border-radius: 17px; }
  .nav {
    display: none; position: absolute; left: -3px; right: -3px; top: calc(100% + 10px); flex-direction: column; gap: 2px; margin: 0;
    padding: 10px; background: var(--cream); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--pop);
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 13px 14px 11px; font-size: 18px; }
  .menu-toggle { display: block; }
  .top-social { display: none; }
  .top-cta { margin-left: auto; }
  .brand img:first-child { width: 38px; height: 38px; }
  .brand-text { font-size: 21px; }
  body { background-size: 1100px auto; }
  .hero { margin-top: -69px; padding-top: 86px; }
  .hero::before { top: 220px; }
  .hero-tag { font-size: 16px; padding: 6px 16px 3px; margin-bottom: 18px; }
  .btn-lg { padding: 12px 18px 9px; font-size: 19px; border-radius: 16px; }
  .hero-cta { gap: 10px; flex-wrap: nowrap; }
  .hero-platforms { gap: 5px; margin-top: 14px; flex-wrap: nowrap; }
  .plat { gap: 4px; padding: 5px 8px 4px; font-size: 12px; }
  .plat svg { width: 14px; height: 14px; }
  .hero-ground { height: 110px; background-size: auto 110px; }
  .cloud { width: 120px; height: 40px; }
  .cloud::before { width: 52px; height: 52px; left: 16px; top: -24px; }
  .cloud::after { width: 68px; height: 68px; right: 14px; top: -36px; }
  .floaty { width: 64px; }
  .f1, .f2, .f3, .f6 { display: none; } .f4 { width: 64px; right: -2%; top: -4%; } .f5 { width: 56px; left: -1%; right: auto; top: 2%; }
  /* điện thoại: nhân vật nhô lên trên, chữ ở dưới, căn giữa */
  .quick { gap: 12px; margin-top: -60px; }
  .quick-tile { flex-direction: column; justify-content: flex-start; min-height: 0; padding: 0 8px 11px; border-radius: 18px; text-align: center; }
  .quick-tile img { position: static; width: 70px; height: 70px; margin: -26px auto 2px; }
  .quick-tile strong { font-size: 19px; }
  .quick-tile small { font-size: 12px; }
  .main > .grid { padding-top: 30px; }
  .news-grid { grid-template-columns: 1fr; padding: 16px; }
  .article { padding: 20px 16px 24px; }
  .featured { padding: 16px 16px 4px; }
  .panel-head { padding: 16px 16px 0; }
  .tabs { padding: 12px 16px 0; }
  .post-list a { padding: 11px 16px; flex-wrap: wrap; gap: 4px 8px; }
  .post-title { flex-basis: 100%; order: 3; white-space: normal; }
  .post-list time { margin-left: auto; }
  .side-mascot { width: 84px; top: -34px; right: -8px; }
  .float a, .float svg { width: 46px; height: 46px; }
  .band { padding: 52px 0; }
  .band-world { margin-top: 64px; }
  .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .world-card strong { font-size: 16px; }
  .mode-card strong { font-size: 21px; }
  .modes-nav { display: none; }
  .marquee-row { gap: 18px; }
  .marquee-row img { width: 70px; height: 70px; }
  .band-pals { padding-bottom: 70px; }
  .foot { padding-bottom: 90px; }
}
@media (max-width: 380px) {
  .top-cta { padding: 6px 10px 4px; font-size: 15px; }
  .brand-text { font-size: 18.5px; }
  .btn-lg { padding: 11px 14px 8px; font-size: 17.5px; }
  .quick-tile strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
