/**
 * JLJL8 Core CSS Module
 * All classes prefixed with s4f4- for namespace isolation
 * Color palette: #0D1117 | #E65100 | #9370DB | #EE82EE | #FF4500
 */

:root {
  --s4f4-primary: #E65100;
  --s4f4-secondary: #9370DB;
  --s4f4-accent: #EE82EE;
  --s4f4-highlight: #FF4500;
  --s4f4-bg: #0D1117;
  --s4f4-bg-card: #161B22;
  --s4f4-bg-deep: #090C10;
  --s4f4-text: #E6EDF3;
  --s4f4-text-muted: #8B949E;
  --s4f4-border: #21262D;
  --s4f4-gradient: linear-gradient(135deg, #E65100 0%, #FF4500 50%, #EE82EE 100%);
  --s4f4-radius: 12px;
  --s4f4-header-h: 60px;
  --s4f4-bottomnav-h: 62px;
}

*, *::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, Oxygen, sans-serif;
  background: var(--s4f4-bg);
  color: var(--s4f4-text);
  line-height: 1.5rem;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--s4f4-accent); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ==================== HEADER ==================== */
.s4f4-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--s4f4-header-h);
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--s4f4-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
}

.s4f4-logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.s4f4-logo-area img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.s4f4-logo-area span {
  font-size: 2rem;
  font-weight: 800;
  background: var(--s4f4-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.s4f4-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.s4f4-btn-login {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--s4f4-text);
  background: transparent;
  border: 1px solid var(--s4f4-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.s4f4-btn-login:hover {
  background: rgba(147, 112, 219, 0.15);
}

.s4f4-btn-register {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: var(--s4f4-gradient);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.s4f4-btn-register:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(230, 81, 0, 0.4);
}

.s4f4-hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--s4f4-text);
  font-size: 2rem;
  cursor: pointer;
}

/* ==================== MOBILE MENU ==================== */
.s4f4-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.s4f4-overlay-active { opacity: 1; visibility: visible; }

.s4f4-mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  z-index: 9999;
  background: var(--s4f4-bg-card);
  transition: right 0.3s ease;
  padding: 2rem 1.6rem;
  overflow-y: auto;
}

.s4f4-menu-active { right: 0; }

.s4f4-menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--s4f4-text);
  font-size: 2rem;
  cursor: pointer;
}

.s4f4-menu-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--s4f4-primary);
  margin-bottom: 2rem;
}

.s4f4-menu-link {
  display: block;
  padding: 1.2rem 0;
  font-size: 1.4rem;
  color: var(--s4f4-text);
  border-bottom: 1px solid var(--s4f4-border);
  transition: color 0.2s;
}

.s4f4-menu-link:hover {
  color: var(--s4f4-primary);
}

/* ==================== BOTTOM NAV ==================== */
.s4f4-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--s4f4-bottomnav-h);
  background: var(--s4f4-bg-deep);
  border-top: 1px solid var(--s4f4-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}

.s4f4-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 54px;
  background: none;
  border: none;
  color: var(--s4f4-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 10px;
  padding: 4px 8px;
}

.s4f4-nav-item:hover,
.s4f4-nav-item:focus {
  color: var(--s4f4-primary);
  background: rgba(230, 81, 0, 0.08);
}

.s4f4-nav-item i,
.s4f4-nav-item span.material-symbols-outlined {
  font-size: 22px;
  margin-bottom: 2px;
}

.s4f4-nav-item span.s4f4-nav-label {
  font-size: 1rem;
  font-weight: 500;
}

.s4f4-nav-active {
  color: var(--s4f4-primary) !important;
}

.s4f4-nav-active::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--s4f4-primary);
  border-radius: 2px;
  margin-top: 1px;
}

/* ==================== MAIN CONTENT ==================== */
.s4f4-main {
  margin-top: var(--s4f4-header-h);
  min-height: calc(100vh - var(--s4f4-header-h));
}

/* ==================== CAROUSEL ==================== */
.s4f4-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 var(--s4f4-radius) var(--s4f4-radius);
}

.s4f4-slide {
  display: none;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.5s;
}

.s4f4-slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 430/200;
  object-fit: cover;
}

.s4f4-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.s4f4-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.s4f4-dot-active {
  background: var(--s4f4-primary);
  width: 20px;
  border-radius: 4px;
}

/* ==================== GAME GRID ==================== */
.s4f4-section {
  padding: 2rem 1.2rem;
}

.s4f4-section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.4rem;
  padding-left: 8px;
  border-left: 4px solid var(--s4f4-primary);
}

.s4f4-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.s4f4-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  border-radius: 10px;
  overflow: hidden;
  background: var(--s4f4-bg-card);
  padding: 6px;
}

.s4f4-game-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(230, 81, 0, 0.2);
}

.s4f4-game-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.s4f4-game-item span {
  font-size: 1.1rem;
  text-align: center;
  color: var(--s4f4-text);
  margin-top: 4px;
  line-height: 1.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== CONTENT CARDS ==================== */
.s4f4-card {
  background: var(--s4f4-bg-card);
  border-radius: var(--s4f4-radius);
  padding: 2rem 1.6rem;
  margin: 1.2rem;
  border: 1px solid var(--s4f4-border);
}

.s4f4-card-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--s4f4-text);
}

.s4f4-card p {
  font-size: 1.4rem;
  line-height: 2.2rem;
  color: var(--s4f4-text-muted);
  margin-bottom: 1rem;
}

.s4f4-promo-text {
  color: var(--s4f4-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.s4f4-promo-text:hover {
  color: var(--s4f4-highlight);
}

/* ==================== FOOTER ==================== */
.s4f4-footer {
  background: var(--s4f4-bg-deep);
  padding: 3rem 1.2rem 2rem;
  border-top: 1px solid var(--s4f4-border);
}

.s4f4-footer-brand {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--s4f4-primary);
}

.s4f4-footer-desc {
  font-size: 1.3rem;
  color: var(--s4f4-text-muted);
  margin-bottom: 2rem;
  line-height: 2rem;
}

.s4f4-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}

.s4f4-footer-link {
  display: inline-block;
  padding: 6px 14px;
  font-size: 1.2rem;
  background: var(--s4f4-bg-card);
  color: var(--s4f4-text);
  border-radius: 6px;
  border: 1px solid var(--s4f4-border);
  transition: all 0.2s;
}

.s4f4-footer-link:hover {
  background: var(--s4f4-primary);
  border-color: var(--s4f4-primary);
  color: #fff;
}

.s4f4-footer-copy {
  font-size: 1.2rem;
  color: var(--s4f4-text-muted);
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--s4f4-border);
}

/* ==================== UTILITY CLASSES ==================== */
.s4f4-container { max-width: 430px; margin: 0 auto; }
.s4f4-text-center { text-align: center; }
.s4f4-mt-1 { margin-top: 1rem; }
.s4f4-mt-2 { margin-top: 2rem; }
.s4f4-mb-1 { margin-bottom: 1rem; }
.s4f4-mb-2 { margin-bottom: 2rem; }

.s4f4-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

.s4f4-badge-hot {
  background: rgba(255, 69, 0, 0.15);
  color: var(--s4f4-highlight);
}

.s4f4-badge-new {
  background: rgba(147, 112, 219, 0.15);
  color: var(--s4f4-secondary);
}

.s4f4-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.s4f4-feature-item {
  background: var(--s4f4-bg-card);
  border-radius: 10px;
  padding: 1.4rem;
  text-align: center;
  border: 1px solid var(--s4f4-border);
}

.s4f4-feature-item i {
  font-size: 2.4rem;
  color: var(--s4f4-primary);
  margin-bottom: 8px;
}

.s4f4-feature-item h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.s4f4-feature-item p {
  font-size: 1.2rem;
  color: var(--s4f4-text-muted);
}

.s4f4-cta-btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: var(--s4f4-gradient);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.s4f4-cta-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(230, 81, 0, 0.5);
}

.s4f4-winner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--s4f4-border);
}

.s4f4-winner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--s4f4-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.s4f4-winner-info { flex: 1; }
.s4f4-winner-name { font-size: 1.3rem; font-weight: 600; }
.s4f4-winner-game { font-size: 1.1rem; color: var(--s4f4-text-muted); }
.s4f4-winner-amount { font-size: 1.4rem; font-weight: 700; color: var(--s4f4-highlight); }

/* Category tabs */
.s4f4-cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 1.2rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.s4f4-cat-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 1.3rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--s4f4-bg-card);
  color: var(--s4f4-text-muted);
  border: 1px solid var(--s4f4-border);
  cursor: pointer;
  transition: all 0.2s;
}

.s4f4-cat-tab:hover,
.s4f4-tab-active {
  background: var(--s4f4-primary);
  color: #fff;
  border-color: var(--s4f4-primary);
}

/* ==================== DESKTOP / RESPONSIVE ==================== */
@media (min-width: 769px) {
  .s4f4-bottom-nav { display: none; }
  .s4f4-hamburger { display: none; }
  .s4f4-container { max-width: 430px; }
}

@media (max-width: 768px) {
  .s4f4-main {
    padding-bottom: 80px;
  }
  .s4f4-game-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}
