/* ============================================
   AA888BET - layout.css
   Prefix: pg47-  (all custom classes)
   Mobile-first. Max content width 430px.
   ============================================ */

:root {
  --pg47-bg-0: #0a0e1f;
  --pg47-bg-1: #111936;
  --pg47-bg-2: #18224a;
  --pg47-card: #1b2552;
  --pg47-gold: #f5c542;
  --pg47-gold-2: #ff9f1c;
  --pg47-red: #e23b54;
  --pg47-blue: #2d6cff;
  --pg47-green: #16d39a;
  --pg47-text: #f3f5ff;
  --pg47-text-mute: #aab2d6;
  --pg47-border: rgba(255, 255, 255, 0.08);
  --pg47-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Be Vietnam Pro", Roboto, system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a244f 0%, var(--pg47-bg-0) 60%);
  color: var(--pg47-text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--pg47-gold); text-decoration: none; }
a:hover { color: var(--pg47-gold-2); }

.pg47-wrap { max-width: 430px; margin: 0 auto; position: relative; }

/* ===== Header ===== */
.pg47-header {
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(180deg, rgba(10,14,31,0.98), rgba(17,25,54,0.92));
  border-bottom: 1px solid var(--pg47-border);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
}
.pg47-header-row { display: flex; align-items: center; gap: 10px; }
.pg47-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 19px; letter-spacing: 0.5px;
  color: #fff; flex: 1;
}
.pg47-logo-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  display: flex; align-items: center; justify-content: center;
  color: #1a1208; font-weight: 900; font-size: 16px;
  box-shadow: 0 4px 12px rgba(245,197,66,0.4);
}
.pg47-logo-text span { color: var(--pg47-gold); }
.pg47-menu-btn {
  background: transparent; border: 1px solid var(--pg47-border);
  color: #fff; width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
}
.pg47-auth { display: flex; gap: 8px; }
.pg47-btn {
  border: none; cursor: pointer; font-weight: 700;
  border-radius: 10px; padding: 9px 16px; font-size: 13.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pg47-btn:active { transform: scale(0.96); }
.pg47-btn-login {
  background: transparent; color: #fff;
  border: 1px solid rgba(245,197,66,0.55);
}
.pg47-btn-register {
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208;
  box-shadow: 0 4px 14px rgba(245,197,66,0.35);
}

/* ===== Marquee ===== */
.pg47-marquee {
  background: linear-gradient(90deg, #2a1245, #12204a);
  color: var(--pg47-gold);
  padding: 7px 0; overflow: hidden;
  font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--pg47-border);
  white-space: nowrap;
}
.pg47-marquee span {
  display: inline-block; padding-left: 100%;
  animation: pg47marquee 22s linear infinite;
}
@keyframes pg47marquee { to { transform: translateX(-100%); } }

/* ===== Hero Slider ===== */
.pg47-hero-slider {
  position: relative; margin: 12px 12px 0; border-radius: 16px;
  overflow: hidden; box-shadow: var(--pg47-shadow);
  aspect-ratio: 16 / 9;
}
.pg47-hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease;
  display: flex; align-items: flex-end;
}
.pg47-hero-slide.pg47-active { opacity: 1; }
.pg47-hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.pg47-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(7,9,22,0.88) 0%, rgba(7,9,22,0.15) 55%, transparent 100%);
}
.pg47-hero-caption {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
}
.pg47-hero-caption h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.pg47-hero-caption p { margin: 0; font-size: 12.5px; color: var(--pg47-text-mute); }
.pg47-hero-cta { margin-top: 8px; }
.pg47-hero-cta button {
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208; border: none; font-weight: 800;
  padding: 8px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
}
.pg47-hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.45); color: #fff; border: none;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 14px; z-index: 2;
}
.pg47-hero-arrow.prev { left: 8px; }
.pg47-hero-arrow.next { right: 8px; }
.pg47-hero-dots {
  position: absolute; bottom: 8px; right: 12px;
  display: flex; gap: 5px; z-index: 2;
}
.pg47-hero-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.4); cursor: pointer;
}
.pg47-hero-dot.pg47-active { background: var(--pg47-gold); width: 18px; border-radius: 4px; }

/* ===== Section base ===== */
.pg47-section { padding: 22px 14px 6px; }
.pg47-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.pg47-section-title {
  font-size: 18px; font-weight: 800; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.pg47-section-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, var(--pg47-gold), var(--pg47-gold-2));
}
.pg47-section-link { font-size: 12px; color: var(--pg47-gold); font-weight: 600; }

/* ===== Quick Stats ===== */
.pg47-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 14px 12px 0;
}
.pg47-stat {
  background: var(--pg47-card); border: 1px solid var(--pg47-border);
  border-radius: 12px; padding: 10px 6px; text-align: center;
}
.pg47-stat-num { font-size: 16px; font-weight: 800; color: var(--pg47-gold); }
.pg47-stat-label { font-size: 10.5px; color: var(--pg47-text-mute); margin-top: 2px; }

/* ===== Filter Tabs ===== */
.pg47-filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  scrollbar-width: none;
}
.pg47-filters::-webkit-scrollbar { display: none; }
.pg47-filter-tab {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px;
  background: var(--47-bg-1, var(--pg47-bg-1)); color: var(--pg47-text-mute);
  border: 1px solid var(--pg47-border); font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.pg47-filter-tab.pg47-active {
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208; border-color: transparent;
}

/* ===== Game Grid ===== */
.pg47-game-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
}
.pg47-game-card {
  background: var(--pg47-card); border: 1px solid var(--pg47-border);
  border-radius: 12px; overflow: hidden; position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
}
.pg47-game-card:active { transform: scale(0.97); }
.pg47-game-thumb {
  position: relative; aspect-ratio: 1; overflow: hidden; background: #0c1430;
}
.pg47-game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pg47-game-badge {
  position: absolute; top: 5px; left: 5px;
  background: linear-gradient(135deg, var(--pg47-red), #b41e35);
  color: #fff; font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 5px;
}
.pg47-game-badge.hot { background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2)); color: #1a1208; }
.pg47-game-name {
  padding: 6px 8px; font-size: 11.5px; font-weight: 600;
  text-align: center; color: #fff; line-height: 1.3;
  height: 34px; display: flex; align-items: center; justify-content: center;
}
.pg47-game-play {
  position: absolute; inset: 0; background: rgba(7,9,22,0.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.pg47-game-card:hover .pg47-game-play { opacity: 1; }
.pg47-game-play button {
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208; border: none; font-weight: 800;
  padding: 6px 14px; border-radius: 18px; font-size: 12px; cursor: pointer;
}

/* ===== Featured Block ===== */
.pg47-feature {
  background: linear-gradient(135deg, #1f2c63, #2a1245);
  border: 1px solid var(--pg47-border); border-radius: 16px;
  padding: 16px; margin: 14px 12px 0;
}
.pg47-feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--pg47-gold); }
.pg47-feature p { margin: 0; font-size: 13px; color: var(--pg47-text-mute); }
.pg47-feature-row {
  display: flex; gap: 10px; margin-top: 12px; overflow-x: auto;
  scrollbar-width: none;
}
.pg47-feature-row::-webkit-scrollbar { display: none; }
.pg47-feature-card {
  flex: 0 0 140px; background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 10px;
}
.pg47-feature-card img { border-radius: 8px; aspect-ratio: 1; object-fit: cover; }
.pg47-feature-card span { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; }

/* ===== Promo Banner ===== */
.pg47-promo-banner {
  margin: 16px 12px; padding: 16px;
  background: linear-gradient(135deg, #b3261e, #e23b54);
  border-radius: 16px; color: #fff;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 10px 24px rgba(226,59,84,0.3);
}
.pg47-promo-banner .pg47-promo-icon {
  font-size: 30px; line-height: 1;
}
.pg47-promo-banner h3 { margin: 0 0 3px; font-size: 16px; }
.pg47-promo-banner p { margin: 0; font-size: 12px; opacity: 0.92; }
.pg47-promo-banner button {
  margin-left: auto; background: #fff; color: var(--pg47-red);
  border: none; padding: 8px 14px; border-radius: 18px;
  font-weight: 800; cursor: pointer; font-size: 12.5px;
}

/* ===== SEO Content ===== */
.pg47-content {
  padding: 18px 14px;
  color: var(--pg47-text-mute); font-size: 14px;
}
.pg47-content h2 {
  color: #fff; font-size: 19px; margin: 22px 0 10px;
  padding-left: 10px; border-left: 4px solid var(--pg47-gold);
}
.pg47-content h3 { color: var(--pg47-gold); font-size: 16px; margin: 16px 0 6px; }
.pg47-content p { margin: 0 0 11px; }
.pg47-content ul { padding-left: 20px; margin: 0 0 11px; }
.pg47-content li { margin-bottom: 5px; }
.pg47-content strong { color: #fff; }
.pg47-content a { font-weight: 600; }

/* ===== FAQ ===== */
.pg47-faq-item {
  background: var(--pg47-card); border: 1px solid var(--pg47-border);
  border-radius: 10px; margin-bottom: 8px; overflow: hidden;
}
.pg47-faq-header {
  padding: 12px 14px; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13.5px; color: #fff;
}
.pg47-faq-header i { color: var(--pg47-gold); transition: transform 0.2s; }
.pg47-faq-item.pg47-open .pg47-faq-header i { transform: rotate(180deg); }
.pg47-faq-body {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  padding: 0 14px; color: var(--pg47-text-mute); font-size: 13px;
}
.pg47-faq-item.pg47-open .pg47-faq-body {
  max-height: 400px; padding: 0 14px 12px;
}

/* ===== Footer ===== */
.pg47-footer {
  background: linear-gradient(180deg, #0a0e1f, #060a1a);
  border-top: 1px solid var(--pg47-border);
  padding: 22px 14px 30px; margin-top: 18px;
}
.pg47-footer-cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.pg47-footer h4 {
  color: var(--pg47-gold); font-size: 13px; margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.pg47-footer ul { list-style: none; padding: 0; margin: 0; }
.pg47-footer li { margin-bottom: 5px; }
.pg47-footer a { color: var(--pg47-text-mute); font-size: 12.5px; }
.pg47-footer a:hover { color: var(--pg47-gold); }
.pg47-footer-bottom {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--pg47-border);
  text-align: center; color: var(--pg47-text-mute); font-size: 11.5px;
}
.pg47-pay-row {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 12px 0;
}
.pg47-pay-row span {
  background: rgba(255,255,255,0.05); border: 1px solid var(--pg47-border);
  padding: 4px 10px; border-radius: 6px; font-size: 11px; color: var(--pg47-text-mute);
}

/* ===== Mobile Bottom Nav ===== */
.pg47-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: linear-gradient(180deg, rgba(17,25,54,0.98), rgba(10,14,31,1));
  border-top: 1px solid var(--pg47-border);
  display: flex; justify-content: space-around; align-items: stretch;
  height: 62px; max-width: 430px; margin: 0 auto;
  backdrop-filter: blur(10px);
}
.pg47-bottom-nav button, .pg47-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: var(--pg47-text-mute);
  background: transparent; border: none; cursor: pointer;
  font-size: 10.5px; font-weight: 600; text-decoration: none;
  min-width: 60px; min-height: 60px;
  transition: color 0.18s, transform 0.18s;
}
.pg47-bottom-nav button:active, .pg47-bottom-nav a:active { transform: scale(0.92); }
.pg47-bottom-nav .pg47-nav-icon { font-size: 21px; line-height: 1; }
.pg47-bottom-nav .pg47-nav-center .pg47-nav-icon {
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; font-size: 22px;
  box-shadow: 0 6px 14px rgba(245,197,66,0.4);
  border: 3px solid #0a0e1f;
}
.pg47-bottom-nav .active { color: var(--pg47-gold); }

/* ===== Mobile Menu (drawer) ===== */
#pg47-mobile-menu {
  position: fixed; top: 0; right: -100%; width: 80%; max-width: 320px;
  height: 100vh; z-index: 9999; background: #0c1230;
  box-shadow: -8px 0 30px rgba(0,0,0,0.5);
  transition: right 0.3s ease; overflow-y: auto; padding: 16px;
}
#pg47-mobile-menu.pg47-open { right: 0; }
.pg47-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--pg47-border);
}
.pg47-menu-head h3 { margin: 0; color: var(--pg47-gold); font-size: 17px; }
.pg47-menu-close {
  background: transparent; border: 1px solid var(--pg47-border);
  color: #fff; width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
}
.pg47-menu-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; margin-bottom: 4px;
}
.pg47-menu-link:hover {
  background: rgba(245,197,66,0.08);
  border-color: rgba(245,197,66,0.25);
}
.pg47-menu-link i { color: var(--pg47-gold); width: 20px; text-align: center; }
.pg47-menu-cta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px;
}
.pg47-overlay-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 9998; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.pg47-overlay-bg.show { opacity: 1; pointer-events: auto; }

/* ===== Back to top ===== */
.pg47-back-top {
  position: fixed; right: 14px; bottom: 78px; z-index: 999;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pg47-gold), var(--pg47-gold-2));
  color: #1a1208; border: none; font-size: 18px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

/* ===== Reveal animation ===== */
.pg47-reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.5s; }
.pg47-reveal.pg47-visible { opacity: 1; transform: translateY(0); }

@media (min-width: 769px) {
  .pg47-bottom-nav { display: none; } body { padding-bottom: 0; }
  .pg47-wrap, .pg47-stats, .pg47-hero-slider { max-width: 1100px; }
  .pg47-game-grid { grid-template-columns: repeat(6, 1fr); }
  .pg47-footer-cols, .pg47-stats { grid-template-columns: repeat(4, 1fr); }
  .pg47-stats, .pg47-hero-slider { margin: 18px auto 0; }
}
@media (max-width: 768px) { main { padding-bottom: 80px; } }
