/*
 * style-gem88-vin.css — Override palette + component riêng cho gem88-vin.com.co
 * Extends lib.css (luôn load SAU lib.css).
 * Palette: nền tối teal/emerald, accent gold.
 * R-41: màu trích từ mainsite GEM88 (emerald #12c98e, gold #f0d860, near-black teal #0a1512).
 *
 * MAP biến lib.css → giá trị gem88:
 *   --bg        #0a1512   (lib: #0b0e16)  — nền trang near-black teal
 *   --panel     #10201b   (lib: #161b27)  — nền card/panel tối
 *   --panel2    #172b22   (lib: #1e2536)  — nền panel2 (tab on, header row 2)
 *   --line      #1e332c   (lib: #2b3346)  — viền
 *   --line-soft rgba(18,201,142,.08)  (lib: rgba(255,255,255,.06))
 *   --ink       #d8e6e0   (lib: #eaeefb)  — body text
 *   --mut       #7ab5a0   (lib: #9aa5bf)  — muted text, footer links
 *   --brand     #12c98e   (lib: #ffc83d)  — màu chủ đạo emerald (thay gold)
 *   --brand2    #0da878   (lib: #e0a92a)  — brand đậm hơn
 *   --on        #031008   (lib: #15110a)  — chữ trên nền brand (đậm/tối)
 *   --heading   #f2fbf8   (lib: #fff)     — heading sáng trên nền tối
 *   --ok        #12c98e   (lib: #34d399)  — ok state
 *   --brand-grad linear-gradient(135deg,#1ee8a4,#0da878)
 *   --glow      0 0 0 1px rgba(18,201,142,.35), 0 8px 26px -8px rgba(18,201,142,.45)
 *   --panel-grad linear-gradient(160deg,#132118,#0c1810)
 *   --panel-grad2 linear-gradient(160deg,#172b22,#0e1e18)
 *   --shadow    0 6px 18px -8px rgba(0,0,0,.7)   (nền tối shadow đậm hơn)
 *
 * --brand2 (gold accent) = #f0d860 cho wordmark "88" + highlight nút phụ hover:
 *   Tách riêng thành --accent-gold để không nhầm với --brand2 xanh.
 */

:root {
  /* === NỀN & PANEL === */
  --bg:           #0a1512;
  --panel:        #10201b;
  --panel2:       #172b22;
  --line:         #1e332c;
  --line-soft:    rgba(18, 201, 142, .08);

  /* === CHỮ === */
  --ink:          #d8e6e0;
  --mut:          #7ab5a0;
  --heading:      #f2fbf8;

  /* === BRAND EMERALD === */
  --brand:        #12c98e;
  --brand2:       #0da878;
  --on:           #031008;
  --brand-grad:   linear-gradient(135deg, #1ee8a4, #0da878);
  --glow:         0 0 0 1px rgba(18,201,142,.35), 0 8px 26px -8px rgba(18,201,142,.45);

  /* === ACCENT GOLD (cho "88" wordmark, highlight phụ) === */
  --accent-gold:  #f0d860;
  --accent-gold2: #d4b830;   /* gold đậm hơn cho hover */

  /* === PANEL GRADIENT (tông teal thay navy) === */
  --panel-grad:   linear-gradient(160deg, #132118, #0c1810);
  --panel-grad2:  linear-gradient(160deg, #172b22, #0e1e18);

  /* === SHADOW (nền tối → shadow đậm hơn) === */
  --shadow:       0 6px 18px -8px rgba(0, 0, 0, .7);
  --shadow-lg:    0 16px 40px -14px rgba(0, 0, 0, .8);

  /* === OK / WARN === */
  --ok:           #12c98e;
  --warn:         #f0d860;
}

/* ── NỀN TRANG: nền tối teal + radial-gradient ấm nhẹ ở đỉnh (memory dark-bg technique) ── */
.lib {
  background:
    radial-gradient(900px 420px at 60% -80px, rgba(18,201,142,.06), transparent 60%),
    radial-gradient(600px 300px at 0% 0, rgba(18,201,142,.04), transparent 50%),
    var(--bg);
}

/* ── WORDMARK LOGO: "GEM88" ── */
/* Dùng chung ở header + footer + drawer */
.logo-text {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .04em;
  color: var(--heading);
  text-decoration: none;
  text-shadow: 0 0 18px rgba(18, 201, 142, .35);
  white-space: nowrap;
  line-height: 1;
}

.logo-text:hover {
  color: var(--heading);
  text-shadow: 0 0 24px rgba(18, 201, 142, .55);
}

/* Phần "88" — tô màu gold accent */
.logo-text .g88 {
  color: var(--accent-gold);
  text-shadow: 0 0 14px rgba(240, 216, 96, .5);
}

/* Footer logo — size nhỏ hơn header */
.lf .lf-logo {
  font-size: 20px;
  display: inline-block;
  margin-bottom: 8px;
}

/* ── HEADER: logo TRÁI (DESKTOP). Chỉ áp ≥641px — để mobile ≤640 dùng
   justify-content:space-between của lib.css (logo TRÁI, ☰ sát PHẢI).
   (Rule không media của bản cũ có specificity cao hơn media query lib.css
    → đè space-between → ☰ bị kẹt giữa. Scope desktop để mobile đúng.) ── */
@media (min-width: 641px) {
  .lh.rows-2 .lh-main {
    justify-content: flex-start;
  }
  /* spacer đẩy CTA + burger về phải trên desktop */
  .lh.rows-2 .lh-main .lh-sp {
    flex: 1;
  }
}

/* ── NÚT CTA — màu brand emerald thay gold ── */
/* btn-main: nền gradient xanh ngọc, chữ tối */
.btn-main {
  background: var(--brand-grad);
  color: var(--on);
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(18, 201, 142, .5);
}

.btn-main:hover {
  background: linear-gradient(135deg, #24f0b4, #0da878);
  box-shadow: 0 0 0 1px rgba(18,201,142,.55), 0 12px 30px -8px rgba(18,201,142,.6);
  transform: translateY(-2px);
}

/* lib.css: .lib a.btn-main chữ = --on (đậm trên nền emerald) — giữ nguyên rule này */
.lib a.btn-main,
.lib a.btn-main:hover {
  color: var(--on);
}

/* btn outline hover: chữ brand emerald + nền emerald nhạt (KHÔNG gold — tránh nhầm với gold accent) */
.lib a.btn:not(.btn-main):hover {
  color: var(--brand);
  background: rgba(18,201,142,.10);
}

/* ── H2 BORDER: brand emerald ── */
.h2 {
  border-left-color: var(--brand);
  background: linear-gradient(90deg, rgba(18,201,142,.10), transparent 40%);
}

/* ── HEADING TEXT-SHADOW nhẹ (dark-bg technique — tránh "chìm" trên nền tối) ── */
.h1 {
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  color: var(--heading);
}

.hero .h1 {
  text-shadow: 0 2px 18px rgba(0,0,0,.7), 0 0 30px rgba(18,201,142,.15);
}

/* ── HERO: tông emerald ── */
.hero {
  background:
    radial-gradient(900px 360px at 70% -60px, rgba(18,201,142,.14), transparent 60%),
    radial-gradient(500px 300px at 0% 120%, rgba(18,201,142,.08), transparent 55%),
    var(--panel-grad2);
}

/* ── CARD HOVER: viền emerald thay gold ── */
.card:hover {
  border-color: rgba(18,201,142,.4);
}

.box:hover {
  border-color: rgba(18,201,142,.35);
}

.gcard:hover {
  border-color: rgba(18,201,142,.5);
  box-shadow: var(--glow);
}

/* ── TABS: on = emerald ── */
.tabs .tab.on {
  background: var(--brand-grad);
  color: var(--on);
  box-shadow: 0 6px 16px -6px rgba(18,201,142,.5);
}

.tabs .tab:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ── ACCORDION / FAQ mở: viền emerald ── */
.acc details[open],
.faq details[open] {
  border-color: rgba(18,201,142,.4);
}

.acc summary::after,
.acc details[open] summary::after,
.faq summary::after,
.faq details[open] summary::after {
  color: var(--brand);
}

/* ── STEPS: đầu số màu emerald ── */
.steps li::before {
  background: var(--brand-grad);
  color: var(--on);
  box-shadow: 0 4px 12px -4px rgba(18,201,142,.6);
}

/* ── TOC: link màu emerald ── */
.toc a:hover {
  color: var(--brand);
}

/* ── PAGER ── */
.pager a:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(18,201,142,.06);
}

/* ── FILTER CHIP ── */
.filter .chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ── FOOTER LF: nền tối teal ── */
.lf {
  background: linear-gradient(180deg, #0e1e18, #081210);
}

.lf h4 {
  color: var(--brand);
}

.lf a:hover {
  color: var(--brand);
}

/* ── HEADER NAV: active/hover emerald ── */
.lh nav a:hover {
  color: var(--brand);
}

.lh nav a::after {
  background: var(--brand);
}

.lh .logo {
  /* override lib.css logo color (mặc định dùng --brand gold) */
  color: var(--heading);
  text-shadow: 0 0 18px rgba(18,201,142,.35);
}

/* Burger icon: màu emerald */
.lh .burger {
  color: var(--brand);
}

/* ── READ AREA ── */
.read h3 {
  color: var(--brand);
}

/* ── CTA-BLOCK: tông emerald ── */
.cta-block {
  background:
    radial-gradient(400px 120px at 50% -20px, rgba(18,201,142,.12), transparent),
    var(--panel-grad2);
  border-color: rgba(18,201,142,.25);
}

/* ── AUTHOR box: viền brand emerald ── */
.author {
  border-left-color: var(--brand);
}

.author .role {
  color: var(--brand);
}

/* ── TABLE: header row brand emerald ── */
.tbl th {
  color: var(--brand);
}

.tbl .rank,
.tbl .star {
  color: var(--brand);
}

/* ── TRUST BADGES: checkmark emerald ── */
.trust span::before {
  color: var(--brand);
}

/* ── REVIEW STARS ── */
.rv-role,
.rv-stars {
  color: var(--brand);
}

/* ── SCROLLBAR THIN (nền tối) ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* ══════════════════════════════════════════
   CAT-SLIDER — Slider infinite 5 chuyên mục
   CSS-only marquee (@keyframes translateX)
   ══════════════════════════════════════════ */

/* Keyframe: trượt từ 0 → -50% (10 slide → 5 slide = 1 vòng liền mạch) */
@keyframes cat-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Vùng chứa slider: ẩn overflow, giới hạn trong khung nội dung (--maxw) như các section khác — KHÔNG tràn viền */
.cat-slider-wrap {
  overflow: hidden;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
  /* mask fade hai bên để trông tự nhiên */
  mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

/* Track: flex, width đủ để chứa 10 slide không xuống hàng */
.cat-slider-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: cat-scroll 36s linear infinite;
}

/* Pause on hover (toàn bộ track) */
.cat-slider-wrap:hover .cat-slider-track {
  animation-play-state: paused;
}

/* Mỗi slide: width cố định, shrink = 0 */
.cat-slide {
  flex: 0 0 auto;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.cat-slide:hover {
  border-color: rgba(18, 201, 142, .4);
  box-shadow: var(--glow);
}

/* Ảnh: full width, height auto = uncropped, đúng tỉ lệ (~0.8) */
.cat-slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* Link ảnh: block để không có padding/line-height thừa */
.cat-slide-img-link {
  display: block;
  text-decoration: none;
}

/* Body slide: padding nội dung */
.cat-slide-body {
  padding: 12px 14px 16px;
}

/* Tên chuyên mục: link, màu heading, bold */
.cat-slide-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
  margin-bottom: 8px;
  line-height: 1.3;
}

.cat-slide-title:hover {
  color: var(--brand);
}

/* Mô tả: màu muted, cỡ nhỏ */
.cat-slide-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mut);
}

/* Link GEM88 bên trong desc */
.cat-slide-desc a {
  color: var(--brand);
  text-decoration: none;
}

.cat-slide-desc a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE — gem88-vin overrides
   Viewport ≤ 640px
   ══════════════════════════════════════════ */
@media (max-width: 640px) {

  /* 1. ẨN lh-nav (hàng nav thứ 2 của rows-2) trên mobile
        lib.css chỉ ẩn .lh nav và .lh .cta — không ẩn .lh-nav
        → drawer đã có đủ nav → ẩn hàng này đi */
  .lh-nav {
    display: none;
  }

  /* 2. HERO SPLIT → 1 cột trên mobile
        Inline style grid-template-columns:1fr 1fr + display:grid → phải override cả display
        để thắng inline style hoàn toàn */
  .hero-split {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 20px 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mọi child của hero-split: full width, không tràn */
  .hero-split > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Ảnh hero: full width, tỉ lệ vừa phải trên mobile */
  .hero-split > div:first-child img {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* hero-in (cột phải → cột dưới): bỏ padding dư */
  .hero-in {
    padding: 0 !important;
  }

  /* H1 hero: cỡ chữ hợp lý 1 cột */
  .hero .h1,
  .hero-split .h1 {
    font-size: clamp(20px, 5.5vw, 26px) !important;
    line-height: 1.25;
  }

  /* CTA row trong hero: xếp dọc cho gọn */
  .hero-split > div:last-child > div {
    flex-direction: column !important;
  }

  /* 3. STICKY CTA: sticky-cta chứa 2 nút — giữ flex nhưng
        đảm bảo nút không tràn ngang (đã có padding:9px 12px trong lib.css) */
  .sticky-cta {
    padding: 8px 10px;
    gap: 8px;
  }

  .sticky-cta .btn {
    font-size: 14px;
    padding: 11px 10px;
    min-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 4. WRAP + HERO SECTION: chặn tràn ngang tuyệt đối */
  .wrap {
    padding: 0 14px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .hero {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Mọi section: chặn tràn ngang */
  section {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* 5. LAY layouts: đảm bảo 1 cột + không tràn (lib.css đã làm nhưng
        đảm bảo chắc cho gem88) */
  .lay-mag,
  .lay-93,
  .lay-363,
  .lay-v2 {
    grid-template-columns: 1fr !important;
  }

  /* 6. ARC-ROW (archive list): 1 cột, ảnh full width */
  .arc-row {
    grid-template-columns: 1fr !important;
  }

  .arc-row .thumb {
    aspect-ratio: 16 / 9;
    width: 100%;
  }

  /* 7. RELATED GRID → 1 cột */
  .related-grid {
    grid-template-columns: 1fr !important;
  }

  /* 8. TABLE: cho phép scroll ngang trong container thay vì tràn */
  .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 9. BODY: đảm bảo không tràn ngang toàn trang */
  body {
    overflow-x: hidden;
  }

  /* 10. h2 font-size nhỏ hơn cho 390px */
  .h2 {
    font-size: clamp(17px, 4.5vw, 22px);
  }

  /* 11. CAT-SLIDER: slide nhỏ lại trên mobile */
  .cat-slide {
    width: 200px;
  }

  .cat-slider-track {
    gap: 10px;
    /* Tốc độ vừa hơn trên mobile */
    animation-duration: 28s;
  }
}
