/**
 * PH JL4 Layout Stylesheet
 * All classes use prefix "sb4d-" for namespace isolation
 * Color Palette: #FFD700 | #FFBF00 | #40E0D0 | #0E1621 | #FFCCCB
 * Dark: #0E1621 (bg) | Light: #FFD700, #FFBF00, #40E0D0 (text/accents)
 */

/* CSS Variables */
:root {
  --sb4d-primary: #FFD700;
  --sb4d-secondary: #FFBF00;
  --sb4d-accent: #40E0D0;
  --sb4d-bg: #0E1621;
  --sb4d-bg-light: #162233;
  --sb4d-bg-card: #1a2d42;
  --sb4d-text: #FFFFFF;
  --sb4d-text-muted: #FFCCCB;
  --sb4d-text-dim: #8899aa;
  --sb4d-border: #2a3f55;
  --sb4d-gradient: linear-gradient(135deg, #0E1621 0%, #162233 50%, #1a2d42 100%);
  --sb4d-gold-gradient: linear-gradient(135deg, #FFD700 0%, #FFBF00 100%);
  --sb4d-teal-gradient: linear-gradient(135deg, #40E0D0 0%, #2ab5a5 100%);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--sb4d-bg);
  color: var(--sb4d-text);
  line-height: 1.5rem;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.sb4d-container { max-width: 430px; margin: 0 auto; padding: 0 1.2rem; width: 100%; }
.sb4d-wrapper { width: 100%; overflow-x: hidden; }

/* Header */
.sb4d-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(14, 22, 33, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sb4d-border);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 1.2rem;
}
.sb4d-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 430px; margin: 0 auto;
}
.sb4d-logo-area { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.sb4d-logo-area img { width: 28px; height: 28px; border-radius: 6px; }
.sb4d-logo-text { color: var(--sb4d-primary); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.5px; }
.sb4d-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.sb4d-btn-register {
  background: var(--sb4d-gold-gradient);
  color: var(--sb4d-bg); border: none; border-radius: 20px;
  padding: 0.6rem 1.4rem; font-size: 1.2rem; font-weight: 700;
  cursor: pointer; transition: all 0.3s ease; white-space: nowrap;
}
.sb4d-btn-register:hover { transform: scale(1.05); box-shadow: 0 0 12px rgba(255, 215, 0, 0.4); }
.sb4d-btn-login {
  background: transparent; color: var(--sb4d-accent);
  border: 1px solid var(--sb4d-accent); border-radius: 20px;
  padding: 0.5rem 1.2rem; font-size: 1.2rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease; white-space: nowrap;
}
.sb4d-btn-login:hover { background: rgba(64, 224, 208, 0.1); }
.sb4d-hamburger {
  background: none; border: none; color: var(--sb4d-primary);
  font-size: 2rem; cursor: pointer; padding: 0.4rem;
  display: flex; align-items: center; justify-content: center;
}

/* Mobile Menu Overlay */
.sb4d-menu-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6); z-index: 9998;
  opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sb4d-overlay-active { opacity: 1; visibility: visible; }

/* Mobile Side Menu */
.sb4d-mobile-menu {
  position: fixed; top: 0; right: -280px; width: 280px; height: 100vh;
  background: var(--sb4d-bg-light); z-index: 9999;
  transition: right 0.3s ease; padding: 2rem 1.5rem;
  overflow-y: auto;
}
.sb4d-menu-active { right: 0; }
.sb4d-menu-close {
  background: none; border: none; color: var(--sb4d-text);
  font-size: 2.4rem; cursor: pointer; position: absolute; top: 1rem; right: 1.5rem;
}
.sb4d-menu-title {
  color: var(--sb4d-primary); font-size: 1.8rem; font-weight: 700;
  margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--sb4d-border);
}
.sb4d-menu-link {
  display: block; color: var(--sb4d-text); text-decoration: none;
  padding: 1rem 0; font-size: 1.4rem; border-bottom: 1px solid rgba(42, 63, 85, 0.5);
  transition: color 0.2s ease;
}
.sb4d-menu-link:hover { color: var(--sb4d-primary); }

/* Main Content */
.sb4d-main { margin-top: 56px; }
@media (max-width: 768px) { .sb4d-main { padding-bottom: 80px; } }

/* Carousel */
.sb4d-carousel { position: relative; overflow: hidden; width: 100%; border-radius: 0 0 12px 12px; }
.sb4d-slide {
  display: none; width: 100%; cursor: pointer;
}
.sb4d-slide-active { display: block; }
.sb4d-slide img { width: 100%; height: auto; display: block; }
.sb4d-carousel-controls {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 5;
}
.sb4d-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4); cursor: pointer; transition: all 0.3s;
}
.sb4d-dot-active { background: var(--sb4d-primary); width: 20px; border-radius: 4px; }

/* Section Titles */
.sb4d-section-title {
  font-size: 1.8rem; font-weight: 700; color: var(--sb4d-primary);
  margin: 2rem 0 1rem; padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--sb4d-accent);
}
.sb4d-section-subtitle {
  font-size: 1.4rem; color: var(--sb4d-text-muted);
  margin-bottom: 1.2rem; line-height: 1.6;
}

/* Game Grid */
.sb4d-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin: 1rem 0;
}
.sb4d-game-card {
  background: var(--sb4d-bg-card); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--sb4d-border);
}
.sb4d-game-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.sb4d-game-card img { width: 100%; height: auto; display: block; aspect-ratio: 1/1; object-fit: cover; }
.sb4d-game-card-title {
  padding: 0.5rem; font-size: 1.1rem; text-align: center;
  color: var(--sb4d-text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Category Header */
.sb4d-cat-header {
  display: flex; align-items: center; gap: 0.8rem;
  margin: 2rem 0 1rem;
}
.sb4d-cat-header i, .sb4d-cat-header .material-icons { font-size: 2rem; color: var(--sb4d-accent); }
.sb4d-cat-title { font-size: 1.6rem; font-weight: 700; color: var(--sb4d-primary); }

/* Content Cards */
.sb4d-card {
  background: var(--sb4d-bg-card); border-radius: 12px;
  padding: 1.5rem; margin: 1rem 0;
  border: 1px solid var(--sb4d-border);
}
.sb4d-card-title { font-size: 1.5rem; font-weight: 700; color: var(--sb4d-primary); margin-bottom: 0.8rem; }
.sb4d-card-text { font-size: 1.3rem; color: var(--sb4d-text-muted); line-height: 1.8; }
.sb4d-card-text a { color: var(--sb4d-accent); text-decoration: underline; cursor: pointer; }

/* Promo Buttons */
.sb4d-promo-btn {
  display: inline-block; background: var(--sb4d-gold-gradient);
  color: var(--sb4d-bg); font-weight: 700; font-size: 1.3rem;
  padding: 1rem 2.4rem; border-radius: 25px; border: none;
  cursor: pointer; transition: all 0.3s ease; text-align: center;
  text-decoration: none;
}
.sb4d-promo-btn:hover { transform: scale(1.05); box-shadow: 0 0 16px rgba(255, 215, 0, 0.5); }

/* Text Link */
.sb4d-text-link { color: var(--sb4d-accent); cursor: pointer; text-decoration: underline; font-weight: 600; }
.sb4d-text-link:hover { color: var(--sb4d-primary); }

/* FAQ Accordion */
.sb4d-faq-item { border-bottom: 1px solid var(--sb4d-border); }
.sb4d-faq-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 0; cursor: pointer; color: var(--sb4d-text); font-size: 1.3rem; font-weight: 600;
}
.sb4d-faq-icon { color: var(--sb4d-accent); font-size: 1.4rem; transition: transform 0.3s ease; }
.sb4d-faq-content {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  color: var(--sb4d-text-muted); font-size: 1.2rem; line-height: 1.8;
  padding-bottom: 0;
}

/* Footer */
.sb4d-footer {
  background: var(--sb4d-bg-light); padding: 2rem 1.2rem 3rem;
  border-top: 1px solid var(--sb4d-border); margin-top: 2rem;
}
.sb4d-footer-inner { max-width: 430px; margin: 0 auto; }
.sb4d-footer-desc { font-size: 1.2rem; color: var(--sb4d-text-dim); line-height: 1.7; margin-bottom: 1.5rem; }
.sb4d-footer-promos { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.5rem; }
.sb4d-footer-promos .sb4d-promo-btn { font-size: 1.1rem; padding: 0.6rem 1.4rem; }
.sb4d-footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; margin-bottom: 1.5rem; }
.sb4d-footer-links a { color: var(--sb4d-text-dim); font-size: 1.1rem; text-decoration: none; transition: color 0.2s; }
.sb4d-footer-links a:hover { color: var(--sb4d-accent); }
.sb4d-footer-copy { font-size: 1rem; color: var(--sb4d-text-dim); text-align: center; padding-top: 1rem; border-top: 1px solid var(--sb4d-border); }

/* Bottom Navigation */
.sb4d-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(14, 22, 33, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sb4d-border);
  height: 60px;
  display: flex; justify-content: space-around; align-items: center;
  padding: 0 0.4rem;
}
.sb4d-bottom-nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 60px; min-height: 52px; background: none; border: none;
  color: var(--sb4d-text-dim); cursor: pointer; transition: all 0.2s ease;
  padding: 0.4rem; border-radius: 8px;
}
.sb4d-bottom-nav-btn:hover { color: var(--sb4d-primary); background: rgba(255, 215, 0, 0.05); }
.sb4d-nav-active { color: var(--sb4d-primary) !important; }
.sb4d-nav-active i, .sb4d-nav-active .material-icons { color: var(--sb4d-primary) !important; }
.sb4d-bottom-nav-btn i, .sb4d-bottom-nav-btn .material-icons { font-size: 2.2rem; margin-bottom: 2px; }
.sb4d-bottom-nav-btn span { font-size: 1rem; font-weight: 500; }

@media (min-width: 769px) {
  .sb4d-bottom-nav { display: none; }
}

/* Utility Classes */
.sb4d-text-center { text-align: center; }
.sb4d-mt-1 { margin-top: 1rem; }
.sb4d-mt-2 { margin-top: 2rem; }
.sb4d-mb-1 { margin-bottom: 1rem; }
.sb4d-mb-2 { margin-bottom: 2rem; }
.sb4d-flex-center { display: flex; justify-content: center; align-items: center; }
.sb4d-gap-1 { gap: 1rem; }

/* Animations */
@keyframes sb4d-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.sb4d-animate-in { animation: sb4d-fadeIn 0.5s ease forwards; }

/* Winner Ticker */
.sb4d-winner-ticker {
  background: var(--sb4d-bg-card); border-radius: 8px; padding: 0.8rem 1.2rem;
  display: flex; align-items: center; gap: 0.8rem; margin: 0.8rem 0;
  border: 1px solid var(--sb4d-border);
}
.sb4d-winner-badge { color: var(--sb4d-primary); font-size: 1.6rem; }
.sb4d-winner-info { flex: 1; font-size: 1.1rem; color: var(--sb4d-text-muted); }
.sb4d-winner-amount { color: var(--sb4d-accent); font-weight: 700; font-size: 1.2rem; }

/* Trust Badge Row */
.sb4d-trust-row { display: flex; justify-content: center; gap: 1.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.sb4d-trust-item { text-align: center; font-size: 1.1rem; color: var(--sb4d-text-dim); }
.sb4d-trust-item i { font-size: 2rem; color: var(--sb4d-primary); display: block; margin-bottom: 0.3rem; }

/* Payment Row */
.sb4d-payment-row { display: flex; justify-content: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.sb4d-payment-item {
  background: var(--sb4d-bg-card); border: 1px solid var(--sb4d-border);
  border-radius: 8px; padding: 0.6rem 1.2rem; font-size: 1.1rem; color: var(--sb4d-text-muted);
}
