/*
 * TBJILI Core Stylesheet
 * All classes use pg40- prefix for namespace isolation
 * Color palette: #1E90FF | #BDC3C7 | #95A5A6 | #E0FFFF | #212F3D
 * Mobile-first design, max-width 430px
 */

/* CSS Variables */
:root {
  --pg40-primary: #1E90FF;
  --pg40-secondary: #BDC3C7;
  --pg40-muted: #95A5A6;
  --pg40-light: #E0FFFF;
  --pg40-dark: #212F3D;
  --pg40-accent: #FF6B35;
  --pg40-success: #2ECC71;
  --pg40-warning: #F39C12;
  --pg40-danger: #E74C3C;
  --pg40-bg: #1a2332;
  --pg40-card: #243447;
  --pg40-text: #E8F0FE;
  --pg40-text-muted: #8899AA;
  --pg40-border: #2C3E50;
  --pg40-header-h: 56px;
  --pg40-bottom-h: 60px;
  --pg40-radius: 10px;
  --pg40-radius-sm: 6px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--pg40-dark);
  color: var(--pg40-text);
  line-height: 1.5rem;
  font-size: 1.4rem;
  overflow-x: hidden;
  max-width: 430px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pg40-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--pg40-light); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* Container */
.pg40-container { width: 100%; padding: 0 1.2rem; max-width: 430px; margin: 0 auto; }
.pg40-wrapper { padding-top: var(--pg40-header-h); padding-bottom: 2rem; }
@media (max-width: 768px) {
  .pg40-wrapper { padding-bottom: calc(var(--pg40-bottom-h) + 2rem); }
}

/* Header */
.pg40-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(135deg, var(--pg40-dark) 0%, #182636 100%);
  border-bottom: 1px solid var(--pg40-primary);
  height: var(--pg40-header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem;
  max-width: 430px; margin: 0 auto;
}
.pg40-logo { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.pg40-logo img { width: 28px; height: 28px; border-radius: 4px; }
.pg40-logo-text { font-size: 1.6rem; font-weight: 700; color: var(--pg40-primary); letter-spacing: 0.5px; }
.pg40-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.pg40-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.2rem; border-radius: var(--pg40-radius-sm);
  font-size: 1.2rem; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.25s ease; min-height: 36px; min-width: 44px;
}
.pg40-btn-register {
  background: linear-gradient(135deg, var(--pg40-primary), #1565C0);
  color: #fff;
}
.pg40-btn-register:hover { background: linear-gradient(135deg, #2196F3, var(--pg40-primary)); transform: scale(1.03); }
.pg40-btn-login {
  background: transparent; color: var(--pg40-primary);
  border: 1.5px solid var(--pg40-primary);
}
.pg40-btn-login:hover { background: var(--pg40-primary); color: #fff; }
.pg40-btn-promo {
  background: linear-gradient(135deg, var(--pg40-accent), #E65100);
  color: #fff; font-size: 1.3rem; padding: 0.8rem 1.6rem;
  border-radius: var(--pg40-radius); width: 100%;
}
.pg40-btn-promo:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(255,107,53,0.4); }
.pg40-btn-text-link {
  background: none; border: none; color: var(--pg40-primary);
  font-weight: 700; cursor: pointer; font-size: 1.3rem;
  text-decoration: underline; padding: 0;
}
.pg40-btn-text-link:hover { color: var(--pg40-light); }

/* Hamburger */
.pg40-hamburger {
  display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  background: none; border: none; padding: 8px; min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.pg40-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--pg40-primary);
  border-radius: 2px; transition: all 0.3s;
}

/* Mobile Menu */
.pg40-menu-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 9998; display: none;
  opacity: 0; transition: opacity 0.3s;
}
.pg40-overlay-active { display: block; opacity: 1; }
.pg40-mobile-menu {
  position: fixed; top: 0; right: -280px; width: 280px; height: 100%;
  background: var(--pg40-dark); z-index: 9999;
  transition: right 0.35s ease; padding: 2rem 1.5rem;
  border-left: 1px solid var(--pg40-primary);
  overflow-y: auto;
}
.pg40-menu-active { right: 0; }
.pg40-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.pg40-menu-title { font-size: 1.8rem; font-weight: 700; color: var(--pg40-primary); }
.pg40-menu-close {
  background: none; border: none; color: var(--pg40-text-muted);
  font-size: 2.4rem; cursor: pointer; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.pg40-menu-nav { display: flex; flex-direction: column; gap: 0.3rem; }
.pg40-menu-link {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1rem 1.2rem; border-radius: var(--pg40-radius-sm);
  color: var(--pg40-text); font-size: 1.4rem; font-weight: 500;
  transition: all 0.2s;
}
.pg40-menu-link:hover { background: var(--pg40-card); color: var(--pg40-primary); }
.pg40-menu-link i, .pg40-menu-link .material-icons-outlined { font-size: 2rem; color: var(--pg40-primary); }

/* Carousel */
.pg40-carousel { position: relative; width: 100%; overflow: hidden; border-radius: var(--pg40-radius); margin-bottom: 1.5rem; }
.pg40-carousel-track { position: relative; width: 100%; height: 180px; }
.pg40-carousel-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.6s ease; cursor: pointer;
}
.pg40-slide-active { opacity: 1; }
.pg40-carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.pg40-carousel-dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.pg40-carousel-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.4); cursor: pointer; border: none;
  transition: all 0.3s;
}
.pg40-dot-active { background: var(--pg40-primary); transform: scale(1.3); }

/* Section */
.pg40-section { margin-bottom: 2rem; padding: 0 1.2rem; }
.pg40-section-title {
  font-size: 1.8rem; font-weight: 700; color: var(--pg40-text);
  margin-bottom: 1rem; padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--pg40-primary);
  display: flex; align-items: center; gap: 0.6rem;
}
.pg40-section-title i { color: var(--pg40-primary); font-size: 2rem; }

/* Game Grid */
.pg40-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.pg40-game-item {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; transition: transform 0.2s;
  border-radius: var(--pg40-radius-sm); padding: 0.5rem;
}
.pg40-game-item:hover { transform: scale(1.05); background: var(--pg40-card); }
.pg40-game-item img {
  width: 64px; height: 64px; border-radius: 10px;
  object-fit: cover; margin-bottom: 0.4rem;
  border: 1.5px solid var(--pg40-border);
}
.pg40-game-name {
  font-size: 1rem; color: var(--pg40-text-muted);
  text-align: center; line-height: 1.2rem;
  max-width: 72px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* Category Header */
.pg40-cat-header {
  font-size: 1.4rem; font-weight: 600; color: var(--pg40-primary);
  margin: 1.5rem 0 0.8rem; display: flex; align-items: center; gap: 0.5rem;
}
.pg40-cat-header i { font-size: 1.6rem; }

/* Cards */
.pg40-card {
  background: var(--pg40-card); border-radius: var(--pg40-radius);
  padding: 1.5rem; border: 1px solid var(--pg40-border);
  margin-bottom: 1.2rem;
}
.pg40-card-title { font-size: 1.6rem; font-weight: 700; color: var(--pg40-primary); margin-bottom: 0.8rem; }
.pg40-card p { font-size: 1.3rem; line-height: 1.8rem; color: var(--pg40-text-muted); margin-bottom: 0.8rem; }

/* Features Grid */
.pg40-features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.pg40-feature-item {
  background: var(--pg40-card); border-radius: var(--pg40-radius);
  padding: 1.2rem; text-align: center; border: 1px solid var(--pg40-border);
}
.pg40-feature-icon { font-size: 2.4rem; color: var(--pg40-primary); margin-bottom: 0.6rem; }
.pg40-feature-title { font-size: 1.2rem; font-weight: 600; color: var(--pg40-text); margin-bottom: 0.3rem; }
.pg40-feature-desc { font-size: 1rem; color: var(--pg40-text-muted); line-height: 1.4rem; }

/* Testimonials */
.pg40-testimonial {
  background: var(--pg40-card); border-radius: var(--pg40-radius);
  padding: 1.2rem; margin-bottom: 1rem; border-left: 3px solid var(--pg40-primary);
}
.pg40-testimonial-name { font-size: 1.2rem; font-weight: 600; color: var(--pg40-primary); }
.pg40-testimonial-stars { color: var(--pg40-warning); font-size: 1rem; margin: 0.3rem 0; }
.pg40-testimonial-text { font-size: 1.2rem; color: var(--pg40-text-muted); line-height: 1.6rem; }

/* Winners */
.pg40-winner-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 0; border-bottom: 1px solid var(--pg40-border);
}
.pg40-winner-name { font-size: 1.2rem; color: var(--pg40-text); font-weight: 500; }
.pg40-winner-game { font-size: 1rem; color: var(--pg40-text-muted); }
.pg40-winner-amount { font-size: 1.3rem; color: var(--pg40-success); font-weight: 700; }

/* FAQ */
.pg40-faq-item { margin-bottom: 1rem; }
.pg40-faq-q {
  font-size: 1.3rem; font-weight: 600; color: var(--pg40-text);
  padding: 0.8rem; background: var(--pg40-card); border-radius: var(--pg40-radius-sm);
  margin-bottom: 0.4rem; border-left: 3px solid var(--pg40-primary);
}
.pg40-faq-a { font-size: 1.2rem; color: var(--pg40-text-muted); padding: 0 0.8rem; line-height: 1.6rem; }

/* Payment Icons */
.pg40-payment-row { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin: 1rem 0; }
.pg40-payment-badge {
  background: var(--pg40-card); border: 1px solid var(--pg40-border);
  border-radius: var(--pg40-radius-sm); padding: 0.5rem 1rem;
  font-size: 1.1rem; color: var(--pg40-text-muted); font-weight: 500;
}

/* Footer */
.pg40-footer {
  background: var(--pg40-dark); border-top: 1px solid var(--pg40-border);
  padding: 2rem 1.2rem; text-align: center; margin-top: 2rem;
}
.pg40-footer-brand { font-size: 1.2rem; color: var(--pg40-text-muted); line-height: 1.6rem; margin-bottom: 1.2rem; }
.pg40-footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1.2rem; }
.pg40-footer-link {
  background: var(--pg40-card); border: 1px solid var(--pg40-border);
  border-radius: var(--pg40-radius-sm); padding: 0.4rem 0.8rem;
  font-size: 1rem; color: var(--pg40-text-muted); transition: all 0.2s;
}
.pg40-footer-link:hover { color: var(--pg40-primary); border-color: var(--pg40-primary); }
.pg40-footer-copy { font-size: 1rem; color: var(--pg40-muted); margin-top: 1rem; }

/* Bottom Navigation */
.pg40-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(180deg, #1a2d40 0%, var(--pg40-dark) 100%);
  border-top: 1px solid var(--pg40-primary);
  display: none; height: var(--pg40-bottom-h);
}
@media (max-width: 768px) {
  .pg40-bottom-nav { display: flex; justify-content: space-around; align-items: center; max-width: 430px; margin: 0 auto; }
}
.pg40-bottom-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 60px; min-height: 60px; background: none; border: none;
  cursor: pointer; transition: all 0.25s; color: var(--pg40-text-muted);
  padding: 0.4rem 0;
}
.pg40-bottom-btn:hover, .pg40-bottom-btn:active { color: var(--pg40-primary); transform: scale(1.08); }
.pg40-bottom-btn i, .pg40-bottom-btn .material-icons-outlined, .pg40-bottom-btn ion-icon {
  font-size: 22px; margin-bottom: 2px;
}
.pg40-bottom-btn span { font-size: 1rem; line-height: 1.2rem; }
.pg40-bottom-active { color: var(--pg40-primary); }

/* Help page specific */
.pg40-help-section { margin-bottom: 2rem; padding: 0 1.2rem; }
.pg40-help-title { font-size: 1.6rem; font-weight: 700; color: var(--pg40-text); margin-bottom: 1rem; border-left: 3px solid var(--pg40-primary); padding-left: 0.8rem; }
.pg40-help-content { font-size: 1.3rem; line-height: 1.8rem; color: var(--pg40-text-muted); }
.pg40-help-content p { margin-bottom: 0.8rem; }
.pg40-step-list { counter-reset: step-counter; }
.pg40-step-item {
  counter-increment: step-counter; position: relative;
  padding: 0.8rem 0 0.8rem 3rem; margin-bottom: 0.5rem;
}
.pg40-step-item::before {
  content: counter(step-counter); position: absolute; left: 0; top: 0.8rem;
  width: 2rem; height: 2rem; background: var(--pg40-primary);
  border-radius: 50%; color: #fff; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Promo CTA */
.pg40-cta-box {
  background: linear-gradient(135deg, var(--pg40-primary), #1565C0);
  border-radius: var(--pg40-radius); padding: 1.5rem; text-align: center;
  margin: 1.5rem 0;
}
.pg40-cta-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.pg40-cta-desc { font-size: 1.2rem; color: rgba(255,255,255,0.85); margin-bottom: 1rem; }

/* Utility classes */
.pg40-text-center { text-align: center; }
.pg40-mt-1 { margin-top: 1rem; }
.pg40-mb-1 { margin-bottom: 1rem; }
.pg40-hidden { display: none; }

/* Desktop styles */
@media (min-width: 769px) {
  body { max-width: 430px; }
  .pg40-hamburger { display: none; }
}
