/* M134-08: phần dùng chung trang chủ + trang phụ (tin tức, tải game, nhập code, nạp, tài khoản):
   chân trang nhiều cột + thông tin sản phẩm, dải cảnh báo 18+, công tắc "Hiệu ứng chuyển động", nút lên đầu trang, ô truy cập nhanh.
   Dùng token màu / chữ của trang đang nạp (--bg, --ink, --azure, --jade, --font-title… đã khai báo ở style.css / tp.css / tk2.css). */

/* ---------- tắt hiệu ứng theo lựa chọn người xem (chung.js đặt html[data-motion="off"], nhớ trong localStorage) ---------- */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }

/* ---------- chân trang ---------- */
.ft { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface, #fff); }
.ft-in { max-width: 1240px; margin: 0 auto; padding: 44px var(--gut) 28px; display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, .8fr)) minmax(0, 1.2fr); gap: 28px 32px; }
.ft-brand img { width: 120px; height: auto; }
.ft-brand p { margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; }
.ft-brand .foot-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ft-brand .foot-links a, .ft-brand .foot-links .is-soon { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font-size: 14px; text-decoration: none; transition: border-color .2s, color .2s; }
.ft-brand .foot-links a:hover { border-color: var(--azure); color: var(--azure-2); }
.ft-brand .foot-links .is-soon { color: var(--muted); }
.ft-col { display: flex; flex-direction: column; gap: 9px; }
.ft-col h2, .ft-info-h { margin: 0 0 4px; font: 700 15px/1.2 var(--font-title); font-stretch: 106%; letter-spacing: .02em; color: var(--ink); }
.ft-col a { color: var(--ink-2); font-size: 14.5px; text-decoration: none; transition: color .2s; }
.ft-col a:hover, .ft-col a:focus-visible { color: var(--azure-2); }
.ft-info { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.ft-info div { display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
.ft-info dt { color: var(--muted); }
.ft-info dd { margin: 0; color: var(--ink); font-weight: 500; }
.ft-bar { max-width: 1240px; margin: 0 auto; padding: 16px var(--gut) 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; border-top: 1px solid var(--line); }
.ft-age { display: flex; align-items: center; gap: 12px; flex: 1 1 420px; margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.ft-18 { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--red, #e5483d); border-radius: 10px; color: var(--red, #e5483d);
  font: 800 16px/1 var(--font-title); }
.ft-motion { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; cursor: pointer; user-select: none; }
.ft-motion input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ft-switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #c6d2e1; transition: background-color .2s; }
.ft-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(19, 35, 63, .3); transition: transform .2s; }
.ft-motion input:checked + .ft-switch { background: var(--jade); }
.ft-motion input:checked + .ft-switch::after { transform: translateX(18px); }
.ft-motion input:focus-visible + .ft-switch { outline: 2px solid var(--azure); outline-offset: 3px; }
.ft-copy { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- nút lên đầu trang ---------- */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .94); color: var(--ink); cursor: pointer; box-shadow: 0 10px 24px -12px rgba(16, 39, 90, .5); transition: transform .2s, border-color .2s, color .2s, opacity .2s; }
.to-top:hover, .to-top:focus-visible { border-color: var(--azure); color: var(--azure-2); transform: translateY(-2px); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- ô truy cập nhanh (trang chủ + trang tải game) ---------- */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px; border: 1px solid rgba(47, 102, 245, .2); border-radius: 12px; background: rgba(255, 255, 255, .86);
  color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .3s, transform .2s; }
.quick a:hover, .quick a:focus-visible { border-color: var(--azure); box-shadow: 0 10px 22px -14px rgba(47, 102, 245, .7); transform: translateY(-2px); }
.quick svg { flex: none; width: 22px; height: 22px; color: var(--azure-2); }
.quick span { display: grid; line-height: 1.2; }
.quick small { color: var(--muted); font-size: 12px; }
.quick b { font: 600 15px/1.2 var(--font-title); font-stretch: 104%; }

@media (max-width: 1100px) {
  .ft-in { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ft-brand, .ft-info { grid-column: span 3; }
  .ft-info { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 640px) {
  .ft-in { grid-template-columns: 1fr 1fr; padding-top: 32px; }
  .ft-brand, .ft-info { grid-column: 1 / -1; }
  .ft-col:last-of-type { grid-column: 1 / -1; }
  .ft-info { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr 1fr; }
  .to-top { right: 12px; bottom: 12px; }
}

/* M414-28: biểu tượng trước mục liên hệ ở chân trang (data-lh = id mục trong /cau-hinh/lien-he.json): Fanpage = Facebook, Trang hỗ trợ = tai nghe */
.foot-links a[data-lh="fanpage"], .foot-links a[data-lh="hotro"] { display: inline-flex; align-items: center; gap: 6px; }
.foot-links a[data-lh="fanpage"]::before, .foot-links a[data-lh="hotro"]::before { content: ""; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--lh-icon) center / contain no-repeat; mask: var(--lh-icon) center / contain no-repeat; }
.foot-links a[data-lh="fanpage"] { --lh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 8h3V4h-3a4 4 0 0 0-4 4v3H7v4h3v6h4v-6h3l1-4h-4V8z'/%3E%3C/svg%3E"); }
.foot-links a[data-lh="hotro"] { --lh-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 14v-2a8 8 0 0 1 16 0v2M4 14h3v5H5a1 1 0 0 1-1-1zM20 14h-3v5h2a1 1 0 0 0 1-1z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ---------- M475-02: nút bật / tắt hiệu ứng trên thanh menu (chung.js tạo .top-fx trong .top-acc) + lớp cánh hoa đào ---------- */
.top-fx { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 14px 0 11px; border: 1.5px solid rgba(226, 102, 143, .38); border-radius: 10px;
  background: rgba(255, 255, 255, .78); color: #d4537a; cursor: pointer; font: 600 14px/1 var(--font-title); font-stretch: 104%; white-space: nowrap; transition: border-color .2s, color .2s, box-shadow .2s; }
.top-fx svg { flex: none; width: 20px; height: 20px; }
.top-fx .top-fx-off { display: none; }
.top-fx[data-on="false"] { border-color: var(--line); color: var(--muted); } /* M475-06: trạng thái theo data-on (chữ nút = việc sẽ làm) */
.top-fx[data-on="false"] .top-fx-off { display: inline; }
.top-fx:hover, .top-fx:focus-visible { border-color: #e2668f; box-shadow: 0 0 0 4px rgba(226, 102, 143, .12); outline: 0; }
@media (max-width: 1160px) { .top-fx { width: 42px; padding: 0; } .top-fx-t { display: none; } } /* M475-06: hiện chữ khi rộng > 1160 px (trước 1400; 1100 px chữ menu bị xuống dòng) */
@media (max-width: 420px) { .top-fx { width: 38px; min-height: 38px; } .top-fx svg { width: 18px; height: 18px; } }
.petals { position: fixed; inset: 0; z-index: 39; width: 100%; height: 100%; pointer-events: none; }
@media print { .petals, .top-fx { display: none; } }
/* M475-02: màn hẹp – nút hiệu ứng vào menu ☰ (dòng .nav-fx), thanh trên đủ chỗ cho Đăng nhập / Đăng ký */
.nav-fx { display: none; }
@media (max-width: 560px) {
  .top-acc > .top-fx { display: none; }
  .top-nav .nav-fx { display: flex; justify-content: flex-start; gap: 10px; width: 100%; min-height: 50px; padding: 0 16px; border: 0; border-radius: 0; background: transparent; font-size: 15px; }
  .top-nav .nav-fx:hover, .top-nav .nav-fx:focus-visible { box-shadow: none; background: rgba(226, 102, 143, .06); }
}