/* 789taya CSS Layout Styles */
/* All classes use prefix "s037-" for namespace isolation */

/* CSS Variables */
:root {
  /* Color palette */
  --s037-primary: #1C2833;
  --s037-secondary: #FFB347;
  --s037-accent: #40E0D0;
  --s037-success: #26A69A;
  --s037-light: #FFF8DC;
  --s037-dark: #0F1419;
  --s037-gray: #6C7B7B;
  --s037-white: #FFFFFF;
  --s037-black: #000000;

  /* Typography */
  --s037-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --s037-font-size-xs: 1rem; /* 10px */
  --s037-font-size-sm: 1.2rem; /* 12px */
  --s037-font-size-base: 1.4rem; /* 14px */
  --s037-font-size-lg: 1.6rem; /* 16px */
  --s037-font-size-xl: 1.8rem; /* 18px */
  --s037-font-size-2xl: 2rem; /* 20px */
  --s037-font-size-3xl: 2.4rem; /* 24px */

  /* Spacing */
  --s037-space-xs: 0.4rem;
  --s037-space-sm: 0.8rem;
  --s037-space-md: 1.2rem;
  --s037-space-lg: 1.6rem;
  --s037-space-xl: 2rem;
  --s037-space-2xl: 2.4rem;
  --s037-space-3xl: 3.2rem;

  /* Layout */
  --s037-container-max: 43rem;
  --s037-header-height: 6rem;
  --s037-bottom-nav-height: 6.4rem;

  /* Border radius */
  --s037-radius-sm: 0.4rem;
  --s037-radius-md: 0.8rem;
  --s037-radius-lg: 1.2rem;
  --s037-radius-xl: 1.6rem;

  /* Shadows */
  --s037-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --s037-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --s037-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --s037-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

body {
  font-family: var(--s037-font-primary);
  font-size: var(--s037-font-size-base);
  line-height: 1.5;
  color: var(--s037-light);
  background-color: var(--s037-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container and layout */
.s037-container {
  max-width: var(--s037-container-max);
  margin: 0 auto;
  padding: 0 var(--s037-space-md);
}

.s037-wrapper {
  min-height: 100vh;
  padding-top: var(--s037-header-height);
  padding-bottom: var(--s037-bottom-nav-height);
}

.s037-grid {
  display: grid;
  gap: var(--s037-space-md);
}

.s037-flex {
  display: flex;
}

.s037-flex-col {
  flex-direction: column;
}

.s037-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.s037-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Header */
.s037-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--s037-header-height);
  background: linear-gradient(135deg, var(--s037-primary) 0%, var(--s037-dark) 100%);
  backdrop-filter: blur(1rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.s037-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 var(--s037-space-md);
}

.s037-logo {
  display: flex;
  align-items: center;
  gap: var(--s037-space-sm);
  text-decoration: none;
  color: var(--s037-light);
}

.s037-logo-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--s037-radius-md);
}

.s037-logo-text {
  font-size: var(--s037-font-size-xl);
  font-weight: 700;
  background: linear-gradient(135deg, var(--s037-secondary) 0%, var(--s037-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.s037-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s037-space-sm);
}

.s037-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--s037-space-sm) var(--s037-space-lg);
  border: none;
  border-radius: var(--s037-radius-md);
  font-size: var(--s037-font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 4.4rem; /* Touch-friendly */
  min-width: 6rem;
  white-space: nowrap;
}

.s037-btn-primary {
  background: linear-gradient(135deg, var(--s037-secondary) 0%, #FFA726 100%);
  color: var(--s037-primary);
  box-shadow: var(--s037-shadow-sm);
}

.s037-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--s037-shadow-md);
}

.s037-btn-secondary {
  background: transparent;
  color: var(--s037-light);
  border: 2px solid var(--s037-accent);
}

.s037-btn-secondary:hover {
  background: var(--s037-accent);
  color: var(--s037-primary);
}

.s037-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--s037-light);
  font-size: var(--s037-font-size-2xl);
  cursor: pointer;
  padding: var(--s037-space-sm);
  border-radius: var(--s037-radius-sm);
  min-width: 4.4rem;
  min-height: 4.4rem;
}

/* Mobile menu */
.s037-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 30rem;
  height: 100vh;
  background: linear-gradient(135deg, var(--s037-primary) 0%, var(--s037-dark) 100%);
  backdrop-filter: blur(1rem);
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.s037-mobile-menu.s037-active {
  right: 0;
}

.s037-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(0.5rem);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.s037-menu-overlay.s037-active {
  opacity: 1;
  visibility: visible;
}

.s037-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s037-space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.s037-menu-close {
  background: none;
  border: none;
  color: var(--s037-light);
  font-size: var(--s037-font-size-2xl);
  cursor: pointer;
  padding: var(--s037-space-sm);
  border-radius: var(--s037-radius-sm);
  min-width: 4.4rem;
  min-height: 4.4rem;
}

.s037-menu-nav {
  padding: var(--s037-space-lg);
}

.s037-menu-item {
  display: block;
  padding: var(--s037-space-md) 0;
  color: var(--s037-light);
  text-decoration: none;
  font-size: var(--s037-font-size-base);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.3s ease;
}

.s037-menu-item:hover {
  color: var(--s037-secondary);
}

/* Carousel */
.s037-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  border-radius: var(--s037-radius-lg);
  margin: var(--s037-space-lg) 0;
  box-shadow: var(--s037-shadow-lg);
}

.s037-carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.s037-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.s037-carousel-slide.s037-active {
  opacity: 1;
}

.s037-carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s037-carousel-indicators {
  position: absolute;
  bottom: var(--s037-space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--s037-space-xs);
}

.s037-indicator {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.s037-indicator.s037-active {
  background: var(--s037-secondary);
  transform: scale(1.2);
}

/* Cards and game items */
.s037-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--s037-radius-lg);
  padding: var(--s037-space-lg);
  backdrop-filter: blur(1rem);
  transition: all 0.3s ease;
}

.s037-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--s037-shadow-lg);
  border-color: var(--s037-accent);
}

.s037-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: var(--s037-space-md);
  margin: var(--s037-space-lg) 0;
}

.s037-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--s037-light);
}

.s037-game-item:hover {
  transform: scale(1.05);
}

.s037-game-icon {
  width: 6rem;
  height: 6rem;
  border-radius: var(--s037-radius-lg);
  object-fit: cover;
  margin-bottom: var(--s037-space-sm);
  box-shadow: var(--s037-shadow-sm);
  transition: all 0.3s ease;
}

.s037-game-item:hover .s037-game-icon {
  box-shadow: var(--s037-shadow-md);
}

.s037-game-name {
  font-size: var(--s037-font-size-xs);
  font-weight: 500;
  line-height: 1.2;
  max-width: 8rem;
  word-break: break-word;
}

/* Typography */
.s037-h1 {
  font-size: var(--s037-font-size-3xl);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--s037-space-lg);
  background: linear-gradient(135deg, var(--s037-light) 0%, var(--s037-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.s037-h2 {
  font-size: var(--s037-font-size-2xl);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--s037-space-md);
  color: var(--s037-light);
}

.s037-h3 {
  font-size: var(--s037-font-size-xl);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--s037-space-sm);
  color: var(--s037-secondary);
}

.s037-text {
  font-size: var(--s037-font-size-base);
  line-height: 1.5;
  color: var(--s037-light);
  margin-bottom: var(--s037-space-md);
}

.s037-text-sm {
  font-size: var(--s037-font-size-sm);
  line-height: 1.4;
  color: var(--s037-gray);
}

/* Bottom navigation */
.s037-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--s037-bottom-nav-height);
  background: linear-gradient(135deg, var(--s037-primary) 0%, var(--s037-dark) 100%);
  backdrop-filter: blur(1rem);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: var(--s037-space-xs) 0;
}

.s037-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: 5.6rem;
  padding: var(--s037-space-xs);
  text-decoration: none;
  color: var(--s037-gray);
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: var(--s037-radius-md);
}

.s037-bottom-nav-item:hover,
.s037-bottom-nav-item.s037-active {
  color: var(--s037-secondary);
  background: rgba(255, 179, 71, 0.1);
  transform: translateY(-2px);
}

.s037-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: var(--s037-space-xs);
  transition: all 0.3s ease;
}

.s037-bottom-nav-item:hover .s037-bottom-nav-icon {
  transform: scale(1.1);
}

.s037-bottom-nav-text {
  font-size: var(--s037-font-size-xs);
  font-weight: 500;
  line-height: 1;
}

/* Footer */
.s037-footer {
  background: linear-gradient(135deg, var(--s037-dark) 0%, var(--s037-primary) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--s037-space-2xl) 0 var(--s037-space-3xl);
  margin-top: var(--s037-space-3xl);
}

.s037-footer-content {
  text-align: center;
}

.s037-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s037-space-lg);
  margin-bottom: var(--s037-space-xl);
}

.s037-footer-link {
  color: var(--s037-light);
  text-decoration: none;
  font-size: var(--s037-font-size-sm);
  transition: color 0.3s ease;
}

.s037-footer-link:hover {
  color: var(--s037-secondary);
}

.s037-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s037-space-lg);
  margin: var(--s037-space-xl) 0;
}

.s037-partner {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.s037-partner:hover {
  opacity: 1;
}

.s037-copyright {
  font-size: var(--s037-font-size-xs);
  color: var(--s037-gray);
  margin-top: var(--s037-space-lg);
}

/* Utility classes */
.s037-text-center {
  text-align: center;
}

.s037-text-left {
  text-align: left;
}

.s037-text-right {
  text-align: right;
}

.s037-mb-sm {
  margin-bottom: var(--s037-space-sm);
}

.s037-mb-md {
  margin-bottom: var(--s037-space-md);
}

.s037-mb-lg {
  margin-bottom: var(--s037-space-lg);
}

.s037-mt-sm {
  margin-top: var(--s037-space-sm);
}

.s037-mt-md {
  margin-top: var(--s037-space-md);
}

.s037-mt-lg {
  margin-top: var(--s037-space-lg);
}

.s037-hidden {
  display: none;
}

.s037-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .s037-menu-toggle {
    display: block;
  }

  .s037-header-actions .s037-btn:not(.s037-btn-primary) {
    display: none;
  }

  .s037-bottom-nav {
    display: flex;
  }

  .s037-wrapper {
    padding-bottom: var(--s037-bottom-nav-height);
  }

  .s037-carousel {
    height: 16rem;
  }

  .s037-game-grid {
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: var(--s037-space-sm);
  }

  .s037-game-icon {
    width: 5rem;
    height: 5rem;
  }
}

@media (min-width: 769px) {
  .s037-bottom-nav {
    display: none;
  }

  .s037-wrapper {
    padding-bottom: 0;
  }
}

/* Animations */
@keyframes s037-fadeIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes s037-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes s037-bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -3rem, 0);
  }
  70% {
    transform: translate3d(0, -1.5rem, 0);
  }
  90% {
    transform: translate3d(0, -0.4rem, 0);
  }
}

.s037-animate-fadeIn {
  animation: s037-fadeIn 0.6s ease-out;
}

.s037-animate-pulse {
  animation: s037-pulse 2s infinite;
}

.s037-animate-bounce {
  animation: s037-bounce 1s infinite;
}

/* Tooltip */
.s037-tooltip {
  position: absolute;
  background: var(--s037-dark);
  color: var(--s037-light);
  padding: var(--s037-space-sm);
  border-radius: var(--s037-radius-sm);
  font-size: var(--s037-font-size-xs);
  white-space: nowrap;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  animation: s037-fadeIn 0.3s ease-out forwards;
}

/* Loading states */
.s037-loading {
  position: relative;
  pointer-events: none;
}

.s037-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 2px solid var(--s037-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 0.6rem;
}

::-webkit-scrollbar-track {
  background: var(--s037-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--s037-secondary);
  border-radius: var(--s037-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--s037-accent);
}

/* Focus styles for accessibility */
.s037-btn:focus,
.s037-menu-toggle:focus,
.s037-menu-close:focus,
.s037-game-item:focus {
  outline: 2px solid var(--s037-accent);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --s037-primary: #000000;
    --s037-light: #FFFFFF;
    --s037-gray: #CCCCCC;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}