/**
 * HappyBingo - Main Stylesheet
 * All classes use s137- prefix for namespace isolation
 * Mobile-first responsive design
 * Color palette: #FFEB3B, #D2691E, #0F0F23, #DEB887, #FF1493
 */

/* ==================== CSS Variables ==================== */
:root {
  --s137-primary: #FFEB3B;
  --s137-primary-dark: #FDD835;
  --s137-secondary: #D2691E;
  --s137-secondary-light: #E67E22;
  --s137-bg-dark: #0F0F23;
  --s137-bg-darker: #080816;
  --s137-bg-light: #DEB887;
  --s137-accent: #FF1493;
  --s137-accent-light: #FF69B4;
  --s137-text-light: #FFFFFF;
  --s137-text-dark: #0F0F23;
  --s137-text-muted: #B0B0B0;
  --s137-border-color: rgba(222, 184, 135, 0.3);
  --s137-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --s137-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --s137-gradient-primary: linear-gradient(135deg, #FFEB3B 0%, #D2691E 100%);
  --s137-gradient-secondary: linear-gradient(135deg, #0F0F23 0%, #1a1a3e 100%);
  --s137-gradient-accent: linear-gradient(135deg, #FF1493 0%, #FF69B4 100%);
}

/* ==================== Reset & Base Styles ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--s137-text-light);
  background-color: var(--s137-bg-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* ==================== Container & Layout ==================== */
.s137-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.s137-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.s137-grid {
  display: grid;
  gap: 1.5rem;
}

.s137-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.s137-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.s137-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.s137-flex {
  display: flex;
  align-items: center;
}

.s137-flex-between {
  justify-content: space-between;
}

.s137-flex-center {
  justify-content: center;
}

.s137-flex-wrap {
  flex-wrap: wrap;
}

.s137-flex-column {
  flex-direction: column;
}

/* ==================== Header Styles ==================== */
.s137-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--s137-bg-dark);
  border-bottom: 2px solid var(--s137-primary);
  transition: all 0.3s ease;
}

.s137-header.s137-header-scrolled {
  background-color: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--s137-shadow);
}

.s137-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 430px;
  margin: 0 auto;
}

.s137-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--s137-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.s137-logo img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.s137-header-buttons {
  display: flex;
  gap: 1rem;
}

.s137-btn {
  padding: 0.6rem 1.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-block;
}

.s137-btn-primary {
  background: var(--s137-gradient-primary);
  color: var(--s137-bg-dark);
  box-shadow: 0 2px 8px rgba(255, 235, 59, 0.4);
}

.s137-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 235, 59, 0.6);
}

.s137-btn-secondary {
  background: var(--s137-gradient-accent);
  color: var(--s137-text-light);
  box-shadow: 0 2px 8px rgba(255, 20, 147, 0.4);
}

.s137-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 20, 147, 0.6);
}

.s137-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.s137-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--s137-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ==================== Mobile Menu ==================== */
.s137-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--s137-bg-darker);
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 2rem 0;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
 pointer-events: none;}

.s137-mobile-menu.s137-menu-open {
  right: 0;
 pointer-events: auto;}

.s137-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.s137-mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  color: var(--s137-text-light);
  cursor: pointer;
  padding: 0.5rem;
}

.s137-mobile-menu-list {
  padding: 1rem 0;
}

.s137-mobile-menu-item {
  display: block;
  padding: 1.2rem 2rem;
  font-size: 1.6rem;
  color: var(--s137-text-light);
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.s137-mobile-menu-item:hover,
.s137-mobile-menu-item.s137-nav-active {
  background-color: rgba(255, 235, 59, 0.1);
  border-left-color: var(--s137-primary);
  color: var(--s137-primary);
}

/* ==================== Main Content ==================== */
main {
  margin-top: 70px;
  padding-bottom: 80px;
}

.s137-section {
  padding: 2rem 0;
}

.s137-section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--s137-primary);
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================== Carousel ==================== */
.s137-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: var(--s137-shadow-lg);
}

.s137-carousel-slides {
  display: flex;
  transition: transform 0.5s ease;
}

.s137-carousel-slide {
  min-width: 100%;
  cursor: pointer;
}

.s137-carousel-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.s137-carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

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

.s137-carousel-dot.s137-active {
  background-color: var(--s137-primary);
  transform: scale(1.2);
}

/* ==================== Game Grid ==================== */
.s137-game-category {
  margin-bottom: 3rem;
}

.s137-category-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--s137-secondary-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.s137-category-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--s137-gradient-primary);
  border-radius: 2px;
}

.s137-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.s137-game-item {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.s137-game-item:hover {
  transform: translateY(-5px);
}

.s137-game-item:hover .s137-game-name {
  color: var(--s137-primary);
}

.s137-game-icon {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--s137-shadow);
  transition: all 0.3s ease;
}

.s137-game-item:hover .s137-game-icon {
  box-shadow: 0 8px 16px rgba(255, 235, 59, 0.3);
}

.s137-game-name {
  font-size: 1.1rem;
  color: var(--s137-text-light);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== Card Styles ==================== */
.s137-card {
  background: var(--s137-gradient-secondary);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--s137-shadow);
  border: 1px solid var(--s137-border-color);
}

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

.s137-card-content {
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--s137-text-muted);
}

.s137-card-content p {
  margin-bottom: 1rem;
}

.s137-card-content a {
  color: var(--s137-accent-light);
  font-weight: 600;
  text-decoration: underline;
}

/* ==================== Feature Lists ==================== */
.s137-feature-list {
  display: grid;
  gap: 1.5rem;
}

.s137-feature-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 3px solid var(--s137-primary);
}

.s137-feature-icon {
  width: 40px;
  height: 40px;
  background: var(--s137-gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.8rem;
}

.s137-feature-text h3 {
  font-size: 1.6rem;
  color: var(--s137-primary);
  margin-bottom: 0.5rem;
}

.s137-feature-text p {
  font-size: 1.4rem;
  color: var(--s137-text-muted);
  line-height: 1.5;
}

/* ==================== FAQ Section ==================== */
.s137-faq-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.s137-faq-question {
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--s137-text-light);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.s137-faq-question:hover {
  color: var(--s137-primary);
  background: rgba(255, 235, 59, 0.05);
}

.s137-faq-answer {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.4rem;
  color: var(--s137-text-muted);
  line-height: 1.6;
  display: none;
}

.s137-faq-item.s137-active .s137-faq-answer {
  display: block;
}

/* ==================== Bottom Navigation ==================== */
.s137-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(to right, #0F0F23 0%, #1a1a3e 50%, #0F0F23 100%);
  border-top: 2px solid var(--s137-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.s137-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 60px;
  min-height: 60px;
  padding: 8px;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 4px;
}

.s137-bottom-nav a:hover {
  background: rgba(255, 235, 59, 0.1);
}

.s137-bottom-nav a.s137-bottom-nav-active {
  background: rgba(255, 235, 59, 0.15);
}

.s137-bottom-nav a.s137-bottom-nav-active .s137-nav-icon {
  color: var(--s137-primary);
  transform: scale(1.1);
}

.s137-bottom-nav a.s137-bottom-nav-active .s137-nav-label {
  color: var(--s137-primary);
  font-weight: 700;
}

.s137-nav-icon {
  font-size: 24px;
  color: var(--s137-text-light);
  transition: all 0.3s ease;
}

.s137-nav-label {
  font-size: 10px;
  color: var(--s137-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .s137-bottom-nav {
    display: none;
  }

  main {
    padding-bottom: 2rem;
  }
}

/* Show menu toggle on mobile */
@media (max-width: 768px) {
  .s137-menu-toggle {
    display: flex;
  }

  .s137-header-buttons {
    display: none;
  }
}

/* ==================== Footer ==================== */
.s137-footer {
  background-color: var(--s137-bg-darker);
  padding: 3rem 0 8rem 0;
  border-top: 1px solid var(--s137-border-color);
}

.s137-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.s137-footer-link {
  padding: 0.5rem 1rem;
  font-size: 1.3rem;
  color: var(--s137-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.s137-footer-link:hover {
  color: var(--s137-primary);
  background: rgba(255, 235, 59, 0.1);
}

.s137-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.s137-partners img {
  width: 50px;
  height: 30px;
  object-fit: contain;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.s137-partners img:hover {
  opacity: 1;
}

.s137-footer-text {
  text-align: center;
  font-size: 1.2rem;
  color: var(--s137-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.s137-footer-text a {
  color: var(--s137-accent-light);
  font-weight: 600;
}

.s137-copyright {
  text-align: center;
  font-size: 1.1rem;
  color: var(--s137-text-muted);
  border-top: 1px solid var(--s137-border-color);
  padding-top: 1.5rem;
}

/* ==================== Utility Classes ==================== */
.s137-text-center {
  text-align: center;
}

.s137-text-primary {
  color: var(--s137-primary);
}

.s137-text-accent {
  color: var(--s137-accent);
}

.s137-mt-1 { margin-top: 1rem; }
.s137-mt-2 { margin-top: 2rem; }
.s137-mt-3 { margin-top: 3rem; }
.s137-mb-1 { margin-bottom: 1rem; }
.s137-mb-2 { margin-bottom: 2rem; }
.s137-mb-3 { margin-bottom: 3rem; }

.s137-hidden { display: none; }
.s137-visible { display: block; }

/* ==================== Loading & Toast ==================== */
.s137-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.s137-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 235, 59, 0.3);
  border-top-color: var(--s137-primary);
  border-radius: 50%;
  animation: s137-spin 1s linear infinite;
}

@keyframes s137-spin {
  to { transform: rotate(360deg); }
}

.s137-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--s137-gradient-primary);
  color: var(--s137-bg-dark);
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.4rem;
  font-weight: 600;
  box-shadow: var(--s137-shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.s137-toast.s137-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== Animations ==================== */
@keyframes s137-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s137-animate-fadeIn {
  animation: s137-fadeIn 0.5s ease;
}

/* ==================== Responsive Adjustments ==================== */
@media (max-width: 380px) {
  .s137-game-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .s137-bottom-nav {
    height: 56px;
  }

  .s137-nav-icon {
    font-size: 20px;
  }

  .s137-nav-label {
    font-size: 9px;
  }
}
