/* =========================================================
   tbjee.homes - Core Stylesheet (basefiles)
   All classes use prefix "pg31-" for namespace isolation.
   Palette: #1A1A2E (dark bg) | #808080 (muted text) | #228B22 (accent green)
   Mobile-first. Root font-size 62.5% (1rem = 10px).
   ========================================================= */

:root {
  --pg31-bg: #1A1A2E;
  --pg31-bg-alt: #20203a;
  --pg31-bg-card: #262648;
  --pg31-primary: #228B22;
  --pg31-primary-dark: #1c6f1c;
  --pg31-accent: #808080;
  --pg31-text: #f5f5f7;
  --pg31-text-muted: #b8b8c8;
  --pg31-border: #34345a;
  --pg31-gold: #f5c542;
  --pg31-radius: 1.2rem;
  --pg31-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .35);
  --pg31-header-h: 5.6rem;
  --pg31-bottomnav-h: 6.2rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 62.5%; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Hind Siliguri", "Noto Sans Bengali", "Segoe UI", system-ui, sans-serif;
  background: var(--pg31-bg);
  color: var(--pg31-text);
  line-height: 1.5rem;
  font-size: 1.5rem;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.pg31-container { width: 100%; max-width: 430px; margin: 0 auto; padding: 0 1.2rem; }
.pg31-wrapper { padding-top: var(--pg31-header-h); padding-bottom: calc(var(--pg31-bottomnav-h) + 2rem); }

/* ---------- Header ---------- */
.pg31-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #16162a 0%, #1A1A2E 100%);
  border-bottom: .1rem solid var(--pg31-border);
  box-shadow: var(--pg31-shadow);
}
.pg31-header-inner {
  max-width: 430px; margin: 0 auto;
  height: var(--pg31-header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
}
.pg31-logo {
  display: flex; align-items: center; gap: .6rem;
  color: var(--pg31-text); font-weight: 700; font-size: 1.8rem;
}
.pg31-logo img { width: 2.8rem; height: 2.8rem; border-radius: .6rem; }
.pg31-logo span { color: var(--pg31-primary); }

.pg31-header-actions { display: flex; align-items: center; gap: .6rem; }
.pg31-menu-btn {
  background: transparent; border: none; color: var(--pg31-text);
  font-size: 2.2rem; width: 4rem; height: 4rem; border-radius: .8rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pg31-menu-btn:hover { background: var(--pg31-bg-alt); }

.pg31-btn {
  border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 1.3rem;
  border-radius: 2rem; padding: .8rem 1.6rem;
  transition: transform .15s ease, opacity .15s ease;
  min-height: 3.6rem; display: inline-flex; align-items: center; gap: .4rem;
}
.pg31-btn:active { transform: scale(.96); }
.pg31-btn-login { background: transparent; color: var(--pg31-text); border: .12rem solid var(--pg31-primary); }
.pg31-btn-register { background: linear-gradient(135deg, var(--pg31-primary), var(--pg31-primary-dark)); color: #fff; box-shadow: 0 .3rem .8rem rgba(34,139,34,.35); }

/* ---------- Mobile Menu ---------- */
.pg31-mobile-menu {
  position: fixed; top: var(--pg31-header-h); left: 0; right: 0;
  background: var(--pg31-bg-alt);
  border-bottom: .1rem solid var(--pg31-border);
  max-height: 0; overflow: hidden; z-index: 9999;
  transition: max-height .3s ease;
  box-shadow: var(--pg31-shadow);
}
.pg31-mobile-menu.pg31-menu-open { max-height: 60rem; }
.pg31-mobile-menu ul { list-style: none; padding: 1rem; }
.pg31-mobile-menu li { border-bottom: .1rem solid var(--pg31-border); }
.pg31-mobile-menu li:last-child { border-bottom: none; }
.pg31-mobile-menu a {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.3rem 1rem; color: var(--pg31-text); font-size: 1.5rem;
}
.pg31-mobile-menu a:hover { background: rgba(34,139,34,.12); color: var(--pg31-primary); }
.pg31-mobile-menu i { font-size: 1.8rem; color: var(--pg31-primary); width: 2.4rem; text-align: center; }

/* ---------- Hero / Carousel ---------- */
.pg31-carousel {
  position: relative; overflow: hidden; border-radius: var(--pg31-radius);
  margin: 1.2rem 0; box-shadow: var(--pg31-shadow);
}
.pg31-carousel-track { display: flex; transition: transform .5s ease; }
.pg31-carousel-slide { min-width: 100%; position: relative; cursor: pointer; }
.pg31-carousel-slide img { width: 100%; height: 18rem; object-fit: cover; }
.pg31-carousel-cap {
  position: absolute; left: 1.2rem; bottom: 1.2rem; right: 1.2rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  color: #fff; padding: 1.5rem 1rem .8rem; border-radius: .6rem;
}
.pg31-carousel-cap h2 { font-size: 1.7rem; color: var(--pg31-gold); margin-bottom: .3rem; }
.pg31-carousel-cap p { font-size: 1.3rem; color: #fff; }
.pg31-carousel-dots {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: .6rem; z-index: 2;
}
.pg31-carousel-dot {
  width: .8rem; height: .8rem; border-radius: 50%;
  background: rgba(255,255,255,.5); border: none; cursor: pointer;
}
.pg31-carousel-dot.pg31-dot-active { background: var(--pg31-primary); width: 2rem; border-radius: .4rem; }

/* ---------- Sections ---------- */
.pg31-section { margin: 2.5rem 0; }
.pg31-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem;
}
.pg31-section-title {
  font-size: 1.8rem; font-weight: 700; color: var(--pg31-text);
  display: flex; align-items: center; gap: .8rem;
}
.pg31-section-title i { color: var(--pg31-primary); }
.pg31-section-title b { color: var(--pg31-gold); }
.pg31-more { font-size: 1.3rem; color: var(--pg31-primary); }

/* ---------- H1 ---------- */
.pg31-h1 {
  font-size: 2rem; font-weight: 800; color: var(--pg31-text);
  text-align: center; margin: 1.5rem 0; line-height: 1.3;
}
.pg31-h1 span { color: var(--pg31-primary); }

/* ---------- Game Grid ---------- */
.pg31-cat-label {
  display: inline-flex; align-items: center; gap: .6rem;
  background: rgba(34,139,34,.15); color: var(--pg31-primary);
  padding: .5rem 1.2rem; border-radius: 2rem;
  font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem;
}
.pg31-game-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.pg31-game-card {
  background: var(--pg31-bg-card); border-radius: 1rem; overflow: hidden;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  border: .1rem solid var(--pg31-border);
}
.pg31-game-card:active { transform: scale(.95); }
.pg31-game-card:hover { box-shadow: var(--pg31-shadow); border-color: var(--pg31-primary); }
.pg31-game-thumb {
  width: 100%; aspect-ratio: 1; object-fit: cover; background: #000;
}
.pg31-game-name {
  padding: .6rem .4rem; font-size: 1.15rem; text-align: center;
  color: var(--pg31-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Cards / generic ---------- */
.pg31-card {
  background: var(--pg31-bg-card); border-radius: var(--pg31-radius);
  padding: 1.6rem; border: .1rem solid var(--pg31-border); box-shadow: var(--pg31-shadow);
}
.pg31-card h3 { font-size: 1.6rem; color: var(--pg31-gold); margin-bottom: .8rem; }
.pg31-card p { color: var(--pg31-text-muted); margin-bottom: .8rem; font-size: 1.4rem; }

.pg31-prose { color: var(--pg31-text-muted); font-size: 1.4rem; line-height: 1.7; }
.pg31-prose p { margin-bottom: 1rem; }
.pg31-prose strong, .pg31-prose a { color: var(--pg31-primary); font-weight: 600; }

/* Feature list */
.pg31-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.pg31-feature {
  background: var(--pg31-bg-card); padding: 1.4rem 1rem; border-radius: 1rem;
  text-align: center; border: .1rem solid var(--pg31-border);
}
.pg31-feature i { font-size: 2.6rem; color: var(--pg31-primary); margin-bottom: .6rem; }
.pg31-feature h4 { font-size: 1.35rem; color: var(--pg31-text); margin-bottom: .4rem; }
.pg31-feature p { font-size: 1.2rem; color: var(--pg31-text-muted); }

/* Stats */
.pg31-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.pg31-stat { background: var(--pg31-bg-card); padding: 1.3rem; border-radius: 1rem; text-align: center; border: .1rem solid var(--pg31-border); }
.pg31-stat .pg31-num { font-size: 2rem; font-weight: 800; color: var(--pg31-gold); display: block; }
.pg31-stat .pg31-label { font-size: 1.2rem; color: var(--pg31-text-muted); }

/* Testimonials */
.pg31-testimonial {
  background: var(--pg31-bg-card); padding: 1.4rem; border-radius: 1rem;
  margin-bottom: 1rem; border-left: .3rem solid var(--pg31-primary);
  border: .1rem solid var(--pg31-border);
}
.pg31-testimonial .pg31-stars { color: var(--pg31-gold); margin-bottom: .5rem; }
.pg31-testimonial p { color: var(--pg31-text-muted); font-size: 1.35rem; margin-bottom: .5rem; }
.pg31-testimonial .pg31-author { color: var(--pg31-primary); font-weight: 600; font-size: 1.3rem; }

/* Payment row */
.pg31-payment-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.pg31-payment {
  flex: 1 1 8rem; background: var(--pg31-bg-card); padding: 1rem;
  border-radius: .8rem; text-align: center; border: .1rem solid var(--pg31-border);
  font-size: 1.25rem; color: var(--pg31-text); display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.pg31-payment i { color: var(--pg31-gold); font-size: 1.8rem; }

/* Winners */
.pg31-winner {
  display: flex; align-items: center; gap: 1rem;
  background: var(--pg31-bg-card); padding: 1rem; border-radius: .8rem;
  margin-bottom: .8rem; border: .1rem solid var(--pg31-border);
}
.pg31-winner .pg31-avatar { width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--pg31-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.pg31-winner .pg31-info { flex: 1; }
.pg31-winner .pg31-name { font-weight: 600; color: var(--pg31-text); }
.pg31-winner .pg31-game { font-size: 1.2rem; color: var(--pg31-text-muted); }
.pg31-winner .pg31-amount { color: var(--pg31-gold); font-weight: 800; }

/* CTA banner */
.pg31-cta {
  background: linear-gradient(135deg, var(--pg31-primary), var(--pg31-primary-dark));
  border-radius: var(--pg31-radius); padding: 2rem 1.5rem; text-align: center;
  margin: 2rem 0; box-shadow: var(--pg31-shadow);
}
.pg31-cta h3 { font-size: 1.8rem; color: #fff; margin-bottom: .6rem; }
.pg31-cta p { color: rgba(255,255,255,.9); margin-bottom: 1.2rem; font-size: 1.35rem; }
.pg31-cta .pg31-btn { background: #fff; color: var(--pg31-primary); font-size: 1.5rem; padding: 1rem 2.4rem; }

/* FAQ */
.pg31-faq-item { background: var(--pg31-bg-card); border-radius: .8rem; margin-bottom: .8rem; padding: 1.2rem 1.4rem; border: .1rem solid var(--pg31-border); }
.pg31-faq-item h4 { font-size: 1.4rem; color: var(--pg31-primary); margin-bottom: .4rem; }
.pg31-faq-item p { font-size: 1.3rem; color: var(--pg31-text-muted); }

/* ---------- Footer ---------- */
.pg31-footer {
  background: #12121f; border-top: .1rem solid var(--pg31-border);
  padding: 2.5rem 1.2rem; margin-top: 2rem;
}
.pg31-footer-brand { color: var(--pg31-text); font-size: 1.4rem; line-height: 1.7; margin-bottom: 1.5rem; }
.pg31-footer-brand b { color: var(--pg31-primary); }
.pg31-footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; margin-bottom: 1.5rem; }
.pg31-footer-links a { color: var(--pg31-text-muted); font-size: 1.25rem; padding: .4rem 0; }
.pg31-footer-links a:hover { color: var(--pg31-primary); }
.pg31-footer-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.5rem; }
.pg31-footer-actions .pg31-btn { flex: 1 1 12rem; justify-content: center; }
.pg31-copyright { text-align: center; color: var(--pg31-accent); font-size: 1.2rem; padding-top: 1.2rem; border-top: .1rem solid var(--pg31-border); }

/* ---------- Bottom Nav ---------- */
.pg31-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(180deg, #1c1c34, #12121f);
  border-top: .1rem solid var(--pg31-border);
  display: flex; justify-content: space-around; align-items: stretch;
  height: var(--pg31-bottomnav-h);
  box-shadow: 0 -.3rem 1rem rgba(0,0,0,.4);
}
.pg31-bottomnav-btn {
  flex: 1; min-width: 6rem; min-height: 6rem;
  background: transparent; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .2rem; color: var(--pg31-accent);
  transition: color .2s ease, transform .15s ease;
  font-family: inherit;
}
.pg31-bottomnav-btn:active { transform: scale(.92); }
.pg31-bottomnav-btn i { font-size: 2.2rem; }
.pg31-bottomnav-btn .pg31-nav-label { font-size: 1rem; line-height: 1.2; }
.pg31-bottomnav-btn.pg31-nav-active { color: var(--pg31-primary); }
.pg31-bottomnav-btn.pg31-nav-active i { color: var(--pg31-gold); }
.pg31-bottomnav-btn .material-icons,
.pg31-bottomnav-btn .ion { font-size: 2.2rem; }

/* Back to top */
.pg31-to-top {
  position: fixed; right: 1.4rem; bottom: calc(var(--pg31-bottomnav-h) + 1rem);
  width: 4rem; height: 4rem; border-radius: 50%; background: var(--pg31-primary);
  color: #fff; border: none; cursor: pointer; font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 900;
  box-shadow: var(--pg31-shadow);
}
.pg31-to-top.pg31-visible { opacity: 1; pointer-events: auto; }

/* ---------- Mobile main padding ---------- */
@media (max-width: 768px) {
  main { padding-bottom: calc(var(--pg31-bottomnav-h) + 1.5rem); }
}

/* ---------- Desktop: hide bottom nav, widen layout ---------- */
@media (min-width: 769px) {
  .pg31-bottomnav { display: none; }
  body { max-width: 768px; }
  .pg31-header-inner { max-width: 768px; }
  .pg31-game-grid { grid-template-columns: repeat(5, 1fr); }
}
