/* ============================================================
 * cm88y.css - Mobile-first styles for cm88y.click (Vietnamese)
 * All custom classes use the g8d8- prefix.
 * Palette: #F8F8FF (ghost white) | #DDA0DD (plum) | #333333 (charcoal)
 * Dark background, light text, high contrast for mobile.
 * ============================================================ */

:root {
  --g8d8-primary: #DDA0DD;
  --g8d8-primary-deep: #B57EDC;
  --g8d8-bg: #333333;
  --g8d8-bg-deep: #262626;
  --g8d8-bg-soft: #3f3a40;
  --g8d8-text: #F8F8FF;
  --g8d8-text-dim: #d8d8e4;
  --g8d8-accent: #FFD24C;
  --g8d8-accent2: #FF6B9D;
  --g8d8-success: #4CD7A1;
  --g8d8-border: rgba(221, 160, 221, 0.25);
  --g8d8-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --g8d8-radius: 14px;
  --g8d8-radius-lg: 22px;
  --g8d8-header-h: 58px;
  --g8d8-bottomnav-h: 62px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--g8d8-bg);
  color: var(--g8d8-text);
  line-height: 1.5rem;
  font-size: 1.5rem;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--g8d8-primary); text-decoration: none; }
a:hover { color: var(--g8d8-accent); }
ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.g8d8-wrapper {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}
.g8d8-container {
  padding: 0 1.4rem;
}
main { padding-bottom: 90px; }

/* ---------- Header ---------- */
.g8d8-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--g8d8-header-h);
  background: linear-gradient(180deg, #2c2c2c 0%, #333333 100%);
  border-bottom: 1px solid var(--g8d8-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.g8d8-header-inner {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.g8d8-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--g8d8-text);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.4px;
}
.g8d8-brand img {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--g8d8-primary);
}
.g8d8-brand span b { color: var(--g8d8-primary); }
.g8d8-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.g8d8-menu-btn {
  background: transparent;
  border: 1px solid var(--g8d8-border);
  color: var(--g8d8-text);
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.g8d8-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.35rem;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  min-height: 40px;
  line-height: 1;
}
.g8d8-btn:active { transform: scale(0.96); }
.g8d8-btn-register {
  background: linear-gradient(135deg, var(--g8d8-primary) 0%, var(--g8d8-primary-deep) 100%);
  color: #2a1230;
  box-shadow: 0 4px 14px rgba(181, 126, 220, 0.45);
}
.g8d8-btn-login {
  background: transparent;
  color: var(--g8d8-text);
  border: 1.5px solid var(--g8d8-primary);
}

/* ---------- Mobile slide-down menu ---------- */
.g8d8-mobile-menu {
  position: fixed;
  top: var(--g8d8-header-h);
  left: 0; right: 0;
  background: var(--g8d8-bg-deep);
  border-bottom: 1px solid var(--g8d8-border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
  z-index: 999;
}
.g8d8-mobile-menu.g8d8-menu-open { max-height: 460px; }
.g8d8-mobile-menu ul { padding: 0.6rem 1.2rem 1rem; }
.g8d8-mobile-menu li a {
  display: block;
  padding: 1rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--g8d8-text);
  font-weight: 600;
  font-size: 1.45rem;
}
.g8d8-mobile-menu li a:active { color: var(--g8d8-primary); }

/* ---------- Hero / Carousel ---------- */
.g8d8-hero {
  margin-top: calc(var(--g8d8-header-h) + 1.2rem);
  position: relative;
  border-radius: var(--g8d8-radius-lg);
  overflow: hidden;
  box-shadow: var(--g8d8-shadow);
}
.g8d8-slides { position: relative; }
.g8d8-slide {
  display: none;
  position: relative;
  cursor: pointer;
}
.g8d8-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.g8d8-slide.g8d8-slide-active { display: block; }
.g8d8-slide-caption {
  position: absolute;
  left: 1.2rem; right: 1.2rem; bottom: 1.2rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0) 100%);
  padding: 1.6rem 1rem 0.6rem;
  border-radius: 0 0 var(--g8d8-radius-lg) var(--g8d8-radius-lg);
}
.g8d8-slide-caption h2 {
  font-size: 1.8rem; color: var(--g8d8-text); margin-bottom: 0.3rem;
}
.g8d8-slide-caption p { font-size: 1.3rem; color: var(--g8d8-text-dim); }
.g8d8-slider-ctrl {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 100%;
  display: flex; justify-content: space-between;
  padding: 0 0.8rem;
  pointer-events: none;
}
.g8d8-slider-ctrl button {
  pointer-events: auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}
.g8d8-dots {
  display: flex; justify-content: center; gap: 0.5rem;
  margin-top: 0.8rem;
}
.g8d8-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
}
.g8d8-dot.g8d8-dot-active { background: var(--g8d8-primary); width: 22px; border-radius: 4px; }

/* ---------- Section title ---------- */
.g8d8-section {
  margin: 2.4rem 0 1rem;
}
.g8d8-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.1rem;
  gap: 0.8rem;
}
.g8d8-section-head h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--g8d8-text);
  display: flex; align-items: center; gap: 0.6rem;
}
.g8d8-section-head h2 i { color: var(--g8d8-primary); }
.g8d8-section-head .g8d8-more {
  font-size: 1.25rem; color: var(--g8d8-primary); font-weight: 600;
}

/* ---------- Game grid ---------- */
.g8d8-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.g8d8-game-card {
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  border-radius: var(--g8d8-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  position: relative;
}
.g8d8-game-card:active {
  transform: scale(0.96);
  border-color: var(--g8d8-primary);
}
.g8d8-game-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
}
.g8d8-game-card .g8d8-game-name {
  display: block;
  text-align: center;
  font-size: 1.15rem;
  padding: 0.5rem 0.3rem 0.7rem;
  color: var(--g8d8-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.g8d8-game-card .g8d8-tag-hot {
  position: absolute; top: 6px; left: 6px;
  background: var(--g8d8-accent2);
  color: #fff;
  font-size: 0.95rem; font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

/* ---------- Category badge row ---------- */
.g8d8-cat-row {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1rem;
}
.g8d8-cat-badge {
  background: var(--g8d8-bg-soft);
  border: 1px solid var(--g8d8-border);
  color: var(--g8d8-text-dim);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 1.25rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.4rem;
}

/* ---------- Cards / panels ---------- */
.g8d8-card {
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  border-radius: var(--g8d8-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}
.g8d8-card h3 {
  font-size: 1.55rem; color: var(--g8d8-text);
  margin-bottom: 0.6rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.g8d8-card h3 i { color: var(--g8d8-primary); }
.g8d8-card p { color: var(--g8d8-text-dim); font-size: 1.35rem; }
.g8d8-card .g8d8-card-link {
  display: inline-block; margin-top: 0.8rem;
  color: var(--g8d8-primary); font-weight: 700;
}

/* ---------- CTA block ---------- */
.g8d8-cta {
  background: linear-gradient(135deg, var(--g8d8-primary-deep) 0%, var(--g8d8-accent2) 100%);
  border-radius: var(--g8d8-radius-lg);
  padding: 1.8rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  color: #fff;
  box-shadow: var(--g8d8-shadow);
}
.g8d8-cta h3 { font-size: 1.9rem; margin-bottom: 0.5rem; color: #fff; }
.g8d8-cta p { font-size: 1.3rem; color: rgba(255,255,255,0.92); margin-bottom: 1.1rem; }
.g8d8-cta .g8d8-btn {
  background: #fff;
  color: #6a1b9a;
  font-size: 1.5rem;
  padding: 0.9rem 2rem;
}

/* ---------- Features list ---------- */
.g8d8-feature-list {
  display: grid; grid-template-columns: 1fr; gap: 0.8rem;
}
.g8d8-feature-item {
  display: flex; align-items: flex-start; gap: 0.9rem;
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  padding: 1.1rem;
  border-radius: var(--g8d8-radius);
}
.g8d8-feature-item .g8d8-feature-ico {
  flex: 0 0 38px; height: 38px;
  border-radius: 10px;
  background: rgba(221,160,221,0.18);
  color: var(--g8d8-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
}
.g8d8-feature-item h4 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.g8d8-feature-item p { font-size: 1.25rem; color: var(--g8d8-text-dim); }

/* ---------- RTP table ---------- */
.g8d8-rpt-table {
  width: 100%; border-collapse: collapse;
  background: var(--g8d8-bg-deep);
  border-radius: var(--g8d8-radius);
  overflow: hidden;
}
.g8d8-rpt-table th, .g8d8-rpt-table td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.g8d8-rpt-table th {
  background: rgba(221,160,221,0.15);
  color: var(--g8d8-primary);
  font-weight: 700;
}
.g8d8-rpt-table td.g8d8-rt-num { color: var(--g8d8-success); font-weight: 700; }

/* ---------- FAQ accordion ---------- */
.g8d8-faq-item {
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  border-radius: var(--g8d8-radius);
  margin-bottom: 0.8rem;
  overflow: hidden;
}
.g8d8-faq-q {
  padding: 1.1rem 1.2rem;
  font-weight: 700;
  font-size: 1.4rem;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
  color: var(--g8d8-text);
}
.g8d8-faq-q .g8d8-faq-icon { color: var(--g8d8-primary); transition: transform 0.2s; }
.g8d8-faq-open .g8d8-faq-icon { transform: rotate(45deg); }
.g8d8-faq-a {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.2rem;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--g8d8-text-dim);
  font-size: 1.28rem;
}
.g8d8-faq-open .g8d8-faq-a {
  max-height: 320px;
  padding: 0 1.2rem 1.1rem;
}

/* ---------- Testimonials ---------- */
.g8d8-testi {
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  border-radius: var(--g8d8-radius-lg);
  padding: 1.2rem;
  margin-bottom: 0.9rem;
}
.g8d8-testi-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.g8d8-testi-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--g8d8-primary);
  color: #2a1230;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem;
}
.g8d8-testi-name { font-weight: 700; font-size: 1.35rem; }
.g8d8-testi-stars { color: var(--g8d8-accent); font-size: 1.2rem; }
.g8d8-testi p { color: var(--g8d8-text-dim); font-size: 1.28rem; }

/* ---------- Winners ticker ---------- */
.g8d8-winner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  border-radius: var(--g8d8-radius);
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
}
.g8d8-winner b { color: var(--g8d8-success); }

/* ---------- Payment chips ---------- */
.g8d8-pay-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.g8d8-pay-chip {
  background: var(--g8d8-bg-deep);
  border: 1px solid var(--g8d8-border);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 1.2rem; font-weight: 600;
  color: var(--g8d8-text);
  display: inline-flex; align-items: center; gap: 0.4rem;
}

/* ---------- Steps list ---------- */
.g8d8-steps { counter-reset: step; }
.g8d8-step {
  position: relative;
  padding: 0.8rem 0 0.8rem 3.2rem;
  border-left: 2px dashed var(--g8d8-border);
  margin-left: 1.2rem;
}
.g8d8-step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -1.5rem; top: 0.6rem;
  width: 28px; height: 28px;
  background: var(--g8d8-primary);
  color: #2a1230;
  border-radius: 50%;
  font-weight: 800; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.g8d8-step h4 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.g8d8-step p { font-size: 1.25rem; color: var(--g8d8-text-dim); }

/* ---------- SEO long text ---------- */
.g8d8-prose { color: var(--g8d8-text-dim); font-size: 1.32rem; line-height: 1.7rem; }
.g8d8-prose h3 { color: var(--g8d8-text); font-size: 1.55rem; margin: 1.2rem 0 0.5rem; }
.g8d8-prose p { margin-bottom: 0.8rem; }
.g8d8-prose strong { color: var(--g8d8-primary); }
.g8d8-prose a { color: var(--g8d8-accent); font-weight: 600; }

/* ---------- Footer ---------- */
.g8d8-footer {
  background: var(--g8d8-bg-deep);
  border-top: 1px solid var(--g8d8-border);
  padding: 2rem 1.4rem 5rem;
  margin-top: 2rem;
}
.g8d8-footer-brand {
  font-size: 1.8rem; font-weight: 800; margin-bottom: 0.6rem; color: var(--g8d8-text);
}
.g8d8-footer-brand b { color: var(--g8d8-primary); }
.g8d8-footer p { font-size: 1.25rem; color: var(--g8d8-text-dim); margin-bottom: 1rem; }
.g8d8-footer-links {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1rem;
}
.g8d8-footer-links a {
  color: var(--g8d8-text);
  font-size: 1.22rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.g8d8-footer-promo {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0;
}
.g8d8-footer-promo .g8d8-btn { font-size: 1.2rem; padding: 0.55rem 1rem; }
.g8d8-footer-copy {
  text-align: center; font-size: 1.15rem; color: var(--g8d8-text-dim);
  margin-top: 1.4rem; padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ---------- Mobile bottom navigation ---------- */
.g8d8-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--g8d8-bottomnav-h);
  background: linear-gradient(180deg, #2c2c2c 0%, #1f1f1f 100%);
  border-top: 1px solid var(--g8d8-border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.g8d8-bottom-nav-btn {
  flex: 1;
  min-width: 60px;
  min-height: 60px;
  background: transparent;
  border: none;
  color: var(--g8d8-text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}
.g8d8-bottom-nav-btn i,
.g8d8-bottom-nav-btn .material-icons-outlined,
.g8d8-bottom-nav-btn .ion-icon { font-size: 24px; }
.g8d8-bottom-nav-btn:active { transform: scale(0.92); color: var(--g8d8-primary); }
.g8d8-bottom-nav-btn.g8d8-nav-active { color: var(--g8d8-primary); }
.g8d8-bottom-nav-btn.g8d8-nav-active::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%;
  height: 3px; border-radius: 0 0 4px 4px;
  background: var(--g8d8-primary);
}
.g8d8-bottom-nav-btn.g8d8-nav-promo {
  color: var(--g8d8-accent);
}

/* ---------- Desktop: hide bottom nav, widen wrapper ---------- */
@media (min-width: 769px) {
  .g8d8-bottom-nav { display: none; }
  .g8d8-wrapper { max-width: 760px; }
  main { padding-bottom: 2rem; }
  .g8d8-grid { grid-template-columns: repeat(4, 1fr); }
  .g8d8-slide img { height: 320px; }
}
@media (max-width: 768px) {
  main { padding-bottom: calc(var(--g8d8-bottomnav-h) + 24px); }
}

/* ---------- Utility ---------- */
.g8d8-text-center { text-align: center; }
.g8d8-mt-1 { margin-top: 0.6rem; }
.g8d8-mt-2 { margin-top: 1.2rem; }
.g8d8-divider {
  height: 1px; background: var(--g8d8-border); margin: 1.4rem 0; border: none;
}
.g8d8-back-top {
  position: fixed; right: 14px; bottom: calc(var(--g8d8-bottomnav-h) + 12px);
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--g8d8-primary); color: #2a1230;
  border: none; font-size: 1.8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 998; box-shadow: var(--g8d8-shadow);
}
