/* CabyGoGo web. 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. */
: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;
  --news: #2e8be0; --event: #f2861b; --guide: #43a82a;
  --radius: 18px;
  --head: "Baloo 2", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 15.5px/1.6 var(--body); color: var(--ink);
  background: #dff3ff url("../assets/hero-bg.jpg") center top / 1600px auto no-repeat;
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
svg { display: block; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: 3px solid var(--ink); }
.top-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img:first-child { width: 42px; height: 42px; border-radius: 11px; }
.brand img + img { height: 34px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 14px 6px; border-radius: 12px; text-decoration: none;
  font: 700 17px/1 var(--head); color: var(--ink-2);
}
.nav a:hover { background: var(--cream-2); }
.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; }
.social svg { width: 38px; height: 38px; }
.social:hover { transform: translateY(-1px); }
.menu-toggle { display: none; margin-left: 4px; width: 42px; height: 42px; border: 0; border-radius: 11px; background: var(--cream-2); cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 3px; margin: 4px auto; border-radius: 2px; background: var(--ink); }

/* ---------- buttons (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;
}
.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: 14px 30px 11px; font-size: 23px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 34px 0 0; text-align: center; }
.hero-logo { width: min(460px, 86vw); margin: 0 auto; filter: drop-shadow(0 6px 0 rgba(30, 60, 110, .25)); }
.hero-tag {
  display: inline-block; margin: 6px 0 18px; padding: 4px 18px 2px; border-radius: 99px;
  background: rgba(255,255,255,.9); font: 700 18px/1.4 var(--head); color: var(--ink-2);
}
.hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-ground { height: 120px; margin-top: -10px; background: url("../assets/hero-fg.png") center bottom / auto 120px repeat-x; }

/* ---------- layout ---------- */
.main { padding: 0 0 48px; background: linear-gradient(180deg, #e9f7ff 0, #f4fbff 240px); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(30, 70, 120, .08); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.panel-head h2, .side h2 { margin: 0; font: 800 24px/1.1 var(--head); }
.panel-head a { font-weight: 600; font-size: 14px; color: var(--blue-2); text-decoration: none; }
.panel-pad { padding: 16px 18px 18px; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 18px 0; }
.tabs button {
  padding: 6px 14px 4px; border: 2px solid var(--line); border-radius: 99px; background: var(--cream);
  font: 700 15px/1.2 var(--head); color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* chips */
.chip { display: inline-block; flex: none; padding: 2px 9px 1px; border-radius: 7px; font: 700 12.5px/1.5 var(--body); color: #fff; background: var(--news); }
.chip-su-kien { background: var(--event); }
.chip-huong-dan { background: var(--guide); }

/* list */
.post-list { list-style: none; margin: 0; padding: 6px 0; }
.post-list a { display: flex; align-items: center; gap: 10px; padding: 11px 18px; text-decoration: none; border-top: 1px dashed var(--line); }
.post-list li:first-child a { border-top: 0; }
.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; color: var(--muted); }

/* featured + cards */
.featured { padding: 16px 18px 4px; }
.post-card { display: grid; grid-template-columns: 300px 1fr; gap: 16px; text-decoration: none; }
.post-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: var(--cream-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 78% center; transition: transform .25s; }
.post-card:hover img { transform: scale(1.04); }
.post-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 2px 0; }
.post-card-body strong { font: 800 22px/1.2 var(--head); }
.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: 18px; padding: 18px; }
.news-grid .post-card { grid-template-columns: 1fr; gap: 10px; }
.news-grid .post-card-body strong { font-size: 20px; }

/* sidebar */
.side { display: grid; gap: 18px; }
.side .panel { padding: 18px; }
.side p { margin: 6px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.community a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px;
  border: 2px solid var(--line); border-radius: 14px; text-decoration: none; background: var(--cream);
}
.community a:hover { border-color: var(--ink-2); }
.community svg { width: 40px; height: 40px; flex: none; }
.community strong { display: block; font: 800 17px/1.2 var(--head); }
.community small { color: var(--muted); font-size: 13px; }
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--cream); border: 2px dashed var(--orange-2); border-radius: 14px;
}
.code-box code { font: 800 20px/1 ui-monospace, Consolas, monospace; letter-spacing: 1px; }
.side .btn { width: 100%; }

/* ---------- page title / article ---------- */
.page-title { padding: 30px 0 22px; }
.page-title h1 { margin: 0; font: 800 clamp(30px, 5vw, 42px)/1.1 var(--head); color: #fff; text-shadow: 0 3px 0 rgba(20, 60, 120, .45); }
.article { padding: 22px 26px 30px; }
.crumbs { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--blue-2); text-decoration: none; }
.article-title { margin: 8px 0 4px; font: 800 clamp(26px, 4vw, 36px)/1.15 var(--head); }
.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 6px; border-radius: 16px; }
.article-body { font-size: 16.5px; line-height: 1.75; }
.article-body h3 { margin: 24px 0 6px; font: 800 22px/1.2 var(--head); }
.article-body a { color: var(--blue-2); }
.article-body li { margin: 4px 0; }
.article-body img { border-radius: 14px; margin: 14px 0; }

/* ---------- hero: nhân vật bay quanh logo ---------- */
.hero-stage { position: relative; width: min(760px, 100%); margin: 0 auto; }
.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: 2%; top: 40%; width: 118px; }
.f2 { left: 9%; top: 2%; animation-delay: -1s; }
.f3 { left: -3%; top: 74%; width: 74px; animation-delay: -2.2s; }
.f4 { right: 4%; top: 6%; width: 104px; animation-delay: -.6s; }
.f5 { right: 0; top: 50%; width: 80px; animation-delay: -1.7s; }
.f6 { right: 13%; top: 74%; width: 84px; animation-delay: -2.8s; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-3deg); } }

/* ---------- các dải hình ảnh ---------- */
.band { padding: 44px 0; }
.band-head { text-align: center; margin-bottom: 22px; }
.band-head h2 { margin: 0; font: 800 clamp(30px, 4.5vw, 40px)/1.1 var(--head); }
.band-head p { margin: 4px 0 0; color: var(--ink-2); }
.band-world { margin-top: 30px; background: linear-gradient(180deg, #fff3da, #ffe8bf); border-block: 3px solid var(--ink); }
.world-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.world-card { position: relative; margin: 0; transition: transform .15s; }
.world-card:hover { transform: translateY(-4px) rotate(-1deg); }
.world-card img { width: 100%; height: auto; }
.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; }
.main:has(.band-pals) { padding-bottom: 0; }

.band-modes { background: #2c2350 url("../assets/hero-bg.jpg") center / cover; background-blend-mode: multiply; color: #fff; }
.band-modes .band-head p { color: #d9d2ff; }
.modes-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px max(16px, calc((100% - 1120px) / 2)) 14px;
  scrollbar-width: thin;
}
.mode-card { position: relative; flex: 0 0 min(420px, 82vw); margin: 0; scroll-snap-align: start; border-radius: 18px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .35); }
.mode-card img { width: 100%; aspect-ratio: 734 / 312; object-fit: cover; }
.mode-card figcaption { position: absolute; left: 16px; top: 0; bottom: 0; width: 46%; display: flex; flex-direction: column; justify-content: center; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.mode-card strong { font: 800 26px/1.05 var(--head); }
.mode-card small { margin-top: 4px; font-size: 13px; line-height: 1.35; color: #f1edff; }

.band-pals { background: linear-gradient(180deg, #d9f3ff, #bfe9ff); overflow: hidden; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-row { display: flex; gap: 22px; width: max-content; animation: slide 50s linear infinite; }
.marquee-row img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(20, 60, 110, .2)); }
.marquee:hover .marquee-row { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- điều khoản / bảo mật ---------- */
.legal { max-width: 860px; }
.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: 1px dashed var(--line); }
.legal-other { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 600; }
.legal-other a { color: var(--blue-2); }

/* ---------- footer ---------- */
.foot { padding: 26px 0 32px; background: var(--ink); color: #e9d6bd; font-size: 14px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 44px; height: 44px; border-radius: 12px; }
.foot-brand strong { display: block; font: 800 20px/1 var(--head); color: #fff; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: #e9d6bd; text-decoration: none; }
.foot-links a:hover { color: #fff; }

/* ---------- nút nổi Zalo / Facebook ---------- */
.float { position: fixed; right: 16px; bottom: 18px; z-index: 30; display: grid; gap: 10px; }
.float a { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.float svg { width: 52px; height: 52px; }
.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, .6); }
.modal[hidden] { display: none; }
.modal-card {
  position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  padding: 24px 20px 22px; text-align: center; background: linear-gradient(180deg, var(--cream), var(--cream-2));
  border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 7px 0 var(--ink), 0 22px 40px rgba(0, 0, 0, .4);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal-x {
  position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; padding: 7px; border: 3px solid var(--ink); border-radius: 50%;
  background: linear-gradient(180deg, #ff7a63, #d9402d); color: #fff; cursor: pointer;
}
.modal-title { margin: 8px 0 4px; font: 800 26px/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: 110px; 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: 9px 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);
}
.dl-item:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.dl-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: #fff; }
.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); }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 760px) {
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; gap: 2px; margin: 0;
    padding: 10px 16px 14px; background: var(--cream); border-bottom: 3px solid var(--ink);
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 12px 14px 10px; }
  .menu-toggle { display: block; }
  .brand img + img { height: 28px; }
  .top-social .social { width: 34px; height: 34px; }
  .top-social svg { width: 34px; height: 34px; }
  body { background-size: 900px auto; }
  .hero { padding-top: 20px; }
  .hero-tag { font-size: 16px; }
  .btn-lg { padding: 12px 22px 9px; font-size: 20px; }
  .hero-ground { height: 70px; background-size: auto 70px; }
  .news-grid { grid-template-columns: 1fr; padding: 14px; }
  .article { padding: 18px 16px 24px; }
  .post-list a { padding: 11px 14px; flex-wrap: wrap; gap: 4px 8px; }
  .post-title { flex-basis: 100%; order: 3; white-space: normal; }
  .post-list time { margin-left: auto; }
  .float a, .float svg { width: 46px; height: 46px; }
  .floaty { width: 64px; }
  .f1, .f2, .f3, .f6 { display: none; } .f4 { width: 62px; right: -2%; top: 0; } .f5 { width: 54px; left: -1%; right: auto; top: 6%; }
  .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .world-card strong { font-size: 16px; } .world-card small { display: none; }
  .band { padding: 32px 0; }
  .mode-card strong { font-size: 21px; }
  .marquee-row img { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
