/**
 * JILI777 - Main Stylesheet
 * All classes use pg8d- prefix for namespace isolation
 * Color palette: #0D1117 #2F2F2F #5D5D5D #CD853F #FFC0CB
 * Mobile-first design | Max-width: 430px base
 */

/* === CSS Variables === */
:root {
  --pg8d-primary: #CD853F;
  --pg8d-secondary: #FFC0CB;
  --pg8d-bg-dark: #0D1117;
  --pg8d-bg-mid: #2F2F2F;
  --pg8d-bg-card: #1a1f2e;
  --pg8d-gray: #5D5D5D;
  --pg8d-text: #e8e8e8;
  --pg8d-text-muted: #a0a0a0;
  --pg8d-accent: #CD853F;
  --pg8d-accent-hover: #daa06d;
  --pg8d-radius: 8px;
  --pg8d-radius-lg: 12px;
  --pg8d-shadow: 0 2px 12px rgba(0,0,0,0.4);
  --pg8d-header-h: 56px;
  --pg8d-bottom-h: 60px;
  font-size: 62.5%;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--pg8d-text);
  background: var(--pg8d-bg-dark);
  -webkit-font-smoothing: antialiased;
  max-width: 100vw;
  overflow-x: hidden;
}
a { color: var(--pg8d-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--pg8d-accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* === Header === */
.pg8d-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--pg8d-header-h);
  background: var(--pg8d-bg-mid);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.2rem;
  z-index: 1000;
  border-bottom: 1px solid rgba(205,133,63,0.3);
  transition: box-shadow 0.3s;
}
.pg8d-header-scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
.pg8d-header-left { display: flex; align-items: center; gap: 0.8rem; }
.pg8d-header-logo { height: 28px; width: auto; border-radius: 4px; }
.pg8d-header-brand {
  font-size: 1.8rem; font-weight: 700;
  color: var(--pg8d-primary);
  letter-spacing: 0.5px;
}
.pg8d-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.pg8d-header-menu-btn {
  background: none; border: none; color: var(--pg8d-text);
  font-size: 2.2rem; cursor: pointer; padding: 0.4rem;
  display: flex; align-items: center;
}

/* === Buttons === */
.pg8d-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.4rem; border-radius: var(--pg8d-radius);
  font-size: 1.3rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.25s ease;
  text-align: center; gap: 0.5rem;
  min-height: 36px;
}
.pg8d-btn-register {
  background: linear-gradient(135deg, var(--pg8d-primary), #e8a84c);
  color: #0D1117;
}
.pg8d-btn-register:hover { background: linear-gradient(135deg, #e8a84c, var(--pg8d-primary)); transform: scale(1.03); }
.pg8d-btn-login {
  background: transparent;
  border: 1.5px solid var(--pg8d-primary);
  color: var(--pg8d-primary);
}
.pg8d-btn-login:hover { background: rgba(205,133,63,0.15); }
.pg8d-btn-promo {
  background: linear-gradient(135deg, var(--pg8d-primary), #c47a2e);
  color: #fff; font-size: 1.5rem; padding: 1rem 2.4rem;
  border-radius: var(--pg8d-radius-lg);
  box-shadow: 0 4px 16px rgba(205,133,63,0.4);
}
.pg8d-btn-promo:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(205,133,63,0.5); }

/* === Mobile Menu === */
.pg8d-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9998; opacity: 0;
  visibility: hidden; transition: all 0.3s;
}
.pg8d-overlay-active { opacity: 1; visibility: visible; }
.pg8d-mobile-menu {
  position: fixed; top: 0; right: -280px;
  width: 280px; height: 100vh;
  background: var(--pg8d-bg-mid);
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 2rem 1.6rem;
  overflow-y: auto;
}
.pg8d-menu-active { right: 0; }
.pg8d-mobile-menu .pg8d-menu-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--pg8d-text);
  font-size: 2.4rem; cursor: pointer;
}
.pg8d-mobile-menu nav a {
  display: block; padding: 1rem 0;
  color: var(--pg8d-text); font-size: 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pg8d-mobile-menu nav a:hover { color: var(--pg8d-primary); }

/* === Carousel / Banner === */
.pg8d-carousel {
  position: relative; overflow: hidden;
  margin-top: var(--pg8d-header-h);
  background: var(--pg8d-bg-dark);
}
.pg8d-slide {
  display: none; width: 100%;
  cursor: pointer;
}
.pg8d-slide-active { display: block; }
.pg8d-slide img { width: 100%; height: auto; }
.pg8d-dots {
  position: absolute; bottom: 1rem;
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.6rem;
}
.pg8d-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer; border: none; padding: 0;
}
.pg8d-dot-active { background: var(--pg8d-primary); width: 20px; border-radius: 4px; }

/* === Main Content === */
.pg8d-main {
  padding: 1.6rem;
  max-width: 430px;
  margin: 0 auto;
}
.pg8d-section {
  margin-bottom: 2.4rem;
}
.pg8d-section-title {
  font-size: 1.8rem; font-weight: 700;
  color: var(--pg8d-primary);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(205,133,63,0.3);
}

/* === Game Grid === */
.pg8d-category-title {
  font-size: 1.5rem; font-weight: 600;
  color: var(--pg8d-secondary);
  margin: 1.6rem 0 1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.pg8d-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}
.pg8d-game-item {
  text-align: center; cursor: pointer;
  border-radius: var(--pg8d-radius);
  padding: 0.5rem;
  transition: transform 0.2s;
  background: var(--pg8d-bg-card);
}
.pg8d-game-item:hover { transform: scale(1.05); }
.pg8d-game-item img {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--pg8d-radius);
  margin-bottom: 0.3rem;
}
.pg8d-game-name {
  font-size: 1rem; color: var(--pg8d-text-muted);
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Content Modules === */
.pg8d-card {
  background: var(--pg8d-bg-card);
  border-radius: var(--pg8d-radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.6rem;
  border: 1px solid rgba(205,133,63,0.15);
}
.pg8d-card h3 {
  font-size: 1.5rem; color: var(--pg8d-primary);
  margin-bottom: 0.8rem;
}
.pg8d-card p, .pg8d-card li {
  color: var(--pg8d-text-muted);
  font-size: 1.3rem; line-height: 1.6;
}
.pg8d-text-link {
  color: var(--pg8d-primary); font-weight: 600;
  cursor: pointer; border-bottom: 1px dashed var(--pg8d-primary);
}
.pg8d-text-link:hover { color: var(--pg8d-accent-hover); }

/* === RTP Table === */
.pg8d-rtp-table {
  width: 100%; border-collapse: collapse;
  font-size: 1.2rem;
}
.pg8d-rtp-table th {
  background: rgba(205,133,63,0.2);
  color: var(--pg8d-primary);
  padding: 0.6rem 0.8rem; text-align: left;
}
.pg8d-rtp-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--pg8d-text-muted);
}

/* === Testimonial === */
.pg8d-testimonial {
  background: var(--pg8d-bg-card);
  border-left: 3px solid var(--pg8d-primary);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--pg8d-radius) var(--pg8d-radius) 0;
  margin-bottom: 1rem;
}
.pg8d-testimonial-name { color: var(--pg8d-secondary); font-weight: 600; font-size: 1.2rem; }
.pg8d-testimonial-text { color: var(--pg8d-text-muted); font-size: 1.2rem; margin-top: 0.3rem; }

/* === Winner Badge === */
.pg8d-winner {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pg8d-winner-icon { color: var(--pg8d-primary); font-size: 1.6rem; }
.pg8d-winner-name { color: var(--pg8d-text); font-size: 1.2rem; }
.pg8d-winner-amount { color: var(--pg8d-secondary); font-weight: 700; font-size: 1.3rem; margin-left: auto; }

/* === Footer === */
.pg8d-footer {
  background: var(--pg8d-bg-mid);
  padding: 2rem 1.6rem 1.2rem;
  border-top: 1px solid rgba(205,133,63,0.2);
  margin-top: 2rem;
}
.pg8d-footer-brand { color: var(--pg8d-primary); font-size: 1.4rem; font-weight: 700; margin-bottom: 0.6rem; }
.pg8d-footer-desc { color: var(--pg8d-text-muted); font-size: 1.2rem; line-height: 1.5; margin-bottom: 1.2rem; }
.pg8d-footer-links { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.2rem; }
.pg8d-footer-links a {
  color: var(--pg8d-accent); font-size: 1.2rem;
  padding: 0.4rem 0.8rem;
  background: rgba(205,133,63,0.1);
  border-radius: 4px;
}
.pg8d-footer-links a:hover { background: rgba(205,133,63,0.2); }
.pg8d-footer-copy { color: var(--pg8d-gray); font-size: 1.1rem; text-align: center; margin-top: 1rem; }

/* === Bottom Navigation === */
.pg8d-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--pg8d-bottom-h);
  background: linear-gradient(180deg, #1e2433, #0D1117);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 1000;
  border-top: 1px solid rgba(205,133,63,0.25);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.pg8d-bottom-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--pg8d-text-muted);
  font-size: 1rem; cursor: pointer;
  min-width: 60px; min-height: 50px;
  transition: all 0.25s;
  gap: 0.2rem;
}
.pg8d-bottom-btn i, .pg8d-bottom-btn .material-icons {
  font-size: 22px;
}
.pg8d-bottom-btn span { font-size: 1rem; }
.pg8d-bottom-btn:hover, .pg8d-bottom-btn-active {
  color: var(--pg8d-primary);
}
.pg8d-bottom-btn-active {
  transform: scale(1.08);
}
.pg8d-bottom-btn-active::after {
  content: '';
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--pg8d-primary);
  margin-top: 1px;
}

/* === Payment Icons === */
.pg8d-payment-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center;
  padding: 0.8rem 0;
}
.pg8d-payment-item {
  background: var(--pg8d-bg-card);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  color: var(--pg8d-text-muted);
  border: 1px solid rgba(205,133,63,0.1);
}

/* === Help Page Styles === */
.pg8d-help-section { margin-bottom: 2rem; }
.pg8d-help-section h2 {
  font-size: 1.6rem; color: var(--pg8d-primary);
  margin-bottom: 0.8rem;
}
.pg8d-help-section h3 {
  font-size: 1.4rem; color: var(--pg8d-secondary);
  margin: 1rem 0 0.5rem;
}
.pg8d-help-section p, .pg8d-help-section li {
  color: var(--pg8d-text-muted); font-size: 1.3rem; line-height: 1.7;
}
.pg8d-faq-item {
  background: var(--pg8d-bg-card);
  border-radius: var(--pg8d-radius);
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  border-left: 3px solid var(--pg8d-primary);
}
.pg8d-faq-item strong { color: var(--pg8d-primary); display: block; margin-bottom: 0.4rem; }

/* === Utility === */
.pg8d-text-center { text-align: center; }
.pg8d-mt-1 { margin-top: 0.8rem; }
.pg8d-mt-2 { margin-top: 1.6rem; }
.pg8d-mb-1 { margin-bottom: 0.8rem; }
.pg8d-mb-2 { margin-bottom: 1.6rem; }
.pg8d-hidden { display: none !important; }

/* === Responsive === */
@media (max-width: 768px) {
  .pg8d-main { padding-bottom: 80px; }
}
@media (min-width: 769px) {
  .pg8d-bottom-nav { display: none; }
  .pg8d-main { max-width: 430px; }
  .pg8d-header-menu-btn { display: none; }
  .pg8d-desktop-nav { display: flex !important; gap: 1.2rem; align-items: center; }
  .pg8d-desktop-nav a { color: var(--pg8d-text-muted); font-size: 1.3rem; }
  .pg8d-desktop-nav a:hover { color: var(--pg8d-primary); }
}
