/**
 * peso63 CSS Styles - Mobile-first responsive design
 * All classes use s16d- prefix for namespace isolation
 */

/* CSS Variables - Color Palette */
:root {
  --s16d-primary: #212F3D;
  --s16d-secondary: #708090;
  --s16d-accent1: #4DB6AC;
  --s16d-accent2: #40E0D0;
  --s16d-white: #FFFFFF;
  --s16d-black: #000000;
  --s16d-gray-light: #F5F5F5;
  --s16d-gray-dark: #333333;
  --s16d-overlay: rgba(0, 0, 0, 0.8);
  --s16d-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --s16d-shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 10px base for rem units */
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.6rem; /* 16px */
  line-height: 1.5;
  color: var(--s16d-gray-dark);
  background-color: var(--s16d-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Container and Layout */
.s16d-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
  position: relative;
}

.s16d-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--s16d-white);
}

.s16d-main {
  flex: 1;
  padding-bottom: 80px; /* Space for bottom navigation */
}

.s16d-section {
  padding: 20px 0;
  margin-bottom: 20px;
}

/* Header Styles */
.s16d-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--s16d-primary) 0%, var(--s16d-secondary) 100%);
  z-index: 1000;
  box-shadow: var(--s16d-shadow);
}

.s16d-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  max-width: 430px;
  margin: 0 auto;
}

.s16d-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--s16d-white);
  font-size: 1.8rem;
  font-weight: bold;
}

.s16d-logo img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border-radius: 5px;
}

.s16d-header-buttons {
  display: flex;
  gap: 10px;
}

.s16d-header-btn {
  padding: 8px 16px;
  background: var(--s16d-accent1);
  color: var(--s16d-white);
  text-decoration: none;
  border-radius: 20px;
  font-size: 1.4rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.s16d-header-btn:hover {
  background: var(--s16d-accent2);
  transform: translateY(-2px);
  box-shadow: var(--s16d-shadow-hover);
}

.s16d-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--s16d-white);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

/* Mobile Navigation */
.s16d-mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--s16d-white);
  z-index: 9999;
  transition: left 0.3s ease;
  box-shadow: var(--s16d-shadow-hover);
  overflow-y: auto;
}

.s16d-mobile-menu.s16d-menu-open {
  left: 0;
}

.s16d-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--s16d-overlay);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.s16d-menu-overlay.s16d-menu-open {
  opacity: 1;
  visibility: visible;
}

.s16d-menu-header {
  background: linear-gradient(135deg, var(--s16d-primary) 0%, var(--s16d-secondary) 100%);
  color: var(--s16d-white);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.s16d-menu-close {
  background: none;
  border: none;
  color: var(--s16d-white);
  font-size: 24px;
  cursor: pointer;
}

.s16d-menu-nav {
  padding: 20px 0;
}

.s16d-menu-item {
  display: block;
  padding: 12px 20px;
  color: var(--s16d-gray-dark);
  text-decoration: none;
  font-size: 1.6rem;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--s16d-gray-light);
}

.s16d-menu-item:hover {
  background-color: var(--s16d-gray-light);
  color: var(--s16d-accent1);
  padding-left: 25px;
}

.s16d-menu-item.active {
  background-color: var(--s16d-accent1);
  color: var(--s16d-white);
}

/* Bottom Navigation */
.s16d-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--s16d-primary) 0%, var(--s16d-secondary) 100%);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.s16d-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  color: var(--s16d-white);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.s16d-nav-item:hover {
  transform: scale(1.1);
}

.s16d-nav-item.s16d-active {
  color: var(--s16d-accent2);
}

.s16d-nav-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.s16d-nav-text {
  font-size: 1.0rem;
  font-weight: 500;
  text-align: center;
}

.s16d-nav-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--s16d-accent2);
  color: var(--s16d-white);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 1.0rem;
  font-weight: bold;
}

/* Typography */
.s16d-h1 {
  font-size: 2.4rem;
  font-weight: bold;
  color: var(--s16d-primary);
  margin-bottom: 15px;
  text-align: center;
}

.s16d-h2 {
  font-size: 2.0rem;
  font-weight: bold;
  color: var(--s16d-primary);
  margin-bottom: 12px;
}

.s16d-h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--s16d-primary);
  margin-bottom: 10px;
}

.s16d-text {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--s16d-gray-dark);
  margin-bottom: 15px;
}

.s16d-text-center {
  text-align: center;
}

.s16d-text-white {
  color: var(--s16d-white);
}

/* Buttons */
.s16d-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--s16d-accent1) 0%, var(--s16d-accent2) 100%);
  color: var(--s16d-white);
  text-decoration: none;
  border-radius: 25px;
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: var(--s16d-shadow);
}

.s16d-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--s16d-shadow-hover);
}

.s16d-btn:active {
  transform: translateY(0);
}

.s16d-btn-small {
  padding: 8px 16px;
  font-size: 1.4rem;
}

.s16d-btn-large {
  padding: 16px 32px;
  font-size: 1.8rem;
}

.s16d-btn-block {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

/* Cards */
.s16d-card {
  background: var(--s16d-white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--s16d-shadow);
  transition: all 0.3s ease;
}

.s16d-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--s16d-shadow-hover);
}

.s16d-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.s16d-card-icon {
  width: 40px;
  height: 40px;
  margin-right: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--s16d-accent1) 0%, var(--s16d-accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s16d-white);
  font-size: 20px;
}

.s16d-card-title {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--s16d-primary);
}

.s16d-card-content {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--s16d-gray-dark);
}

/* Game Grid */
.s16d-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.s16d-game-item {
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: var(--s16d-gray-dark);
}

.s16d-game-item:hover {
  transform: scale(1.05);
}

.s16d-game-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 8px;
  box-shadow: var(--s16d-shadow);
}

.s16d-game-name {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Game Categories */
.s16d-category-section {
  margin-bottom: 30px;
}

.s16d-category-title {
  font-size: 2.0rem;
  font-weight: bold;
  color: var(--s16d-primary);
  margin-bottom: 15px;
  padding-left: 15px;
  border-left: 4px solid var(--s16d-accent1);
}

/* Carousel */
.s16d-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: var(--s16d-shadow);
}

.s16d-carousel-container {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.s16d-carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.s16d-carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s16d-carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 20px;
  color: var(--s16d-white);
}

.s16d-carousel-title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.s16d-carousel-description {
  font-size: 1.4rem;
}

.s16d-carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.s16d-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.s16d-carousel-dot.active {
  background: var(--s16d-white);
  transform: scale(1.2);
}

/* Features Section */
.s16d-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.s16d-feature-item {
  background: var(--s16d-white);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: var(--s16d-shadow);
  transition: all 0.3s ease;
}

.s16d-feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--s16d-shadow-hover);
}

.s16d-feature-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--s16d-accent1) 0%, var(--s16d-accent2) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s16d-white);
  font-size: 24px;
}

.s16d-feature-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--s16d-primary);
  margin-bottom: 5px;
}

.s16d-feature-description {
  font-size: 1.2rem;
  color: var(--s16d-gray-dark);
  line-height: 1.4;
}

/* Footer */
.s16d-footer {
  background: var(--s16d-primary);
  color: var(--s16d-white);
  padding: 30px 0;
  text-align: center;
}

.s16d-footer-content {
  margin-bottom: 20px;
}

.s16d-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.s16d-footer-link {
  color: var(--s16d-white);
  text-decoration: none;
  font-size: 1.4rem;
  transition: color 0.3s ease;
}

.s16d-footer-link:hover {
  color: var(--s16d-accent2);
}

.s16d-partners {
  margin-bottom: 20px;
}

.s16d-partners-title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.s16d-partners-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.s16d-partner-logo {
  width: 60px;
  height: 30px;
  object-fit: contain;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.s16d-partner-logo:hover {
  opacity: 1;
  transform: scale(1.1);
}

.s16d-copyright {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-top: 20px;
}

/* Loading States */
.s16d-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--s16d-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.s16d-loading.s16d-loading-active {
  opacity: 1;
  visibility: visible;
}

.s16d-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--s16d-white);
  border-top: 4px solid var(--s16d-accent1);
  border-radius: 50%;
  animation: s16d-spin 1s linear infinite;
}

@keyframes s16d-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animations */
.s16d-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.s16d-fade-in.s16d-fade-in-active {
  opacity: 1;
  transform: translateY(0);
}

.s16d-parallax {
  transition: transform 0.3s ease;
}

.s16d-lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.s16d-lazy.s16d-loaded {
  opacity: 1;
}

/* Utility Classes */
.s16d-text-center {
  text-align: center;
}

.s16d-text-left {
  text-align: left;
}

.s16d-text-right {
  text-align: right;
}

.s16d-mt-0 { margin-top: 0; }
.s16d-mt-10 { margin-top: 10px; }
.s16d-mt-20 { margin-top: 20px; }
.s16d-mb-0 { margin-bottom: 0; }
.s16d-mb-10 { margin-bottom: 10px; }
.s16d-mb-20 { margin-bottom: 20px; }

.s16d-hidden {
  display: none;
}

.s16d-visible {
  display: block;
}

/* Responsive Design */
@media (min-width: 768px) {
  .s16d-bottom-nav {
    display: none;
  }

  .s16d-main {
    padding-bottom: 0;
  }

  .s16d-container {
    max-width: 100%;
    padding: 0 20px;
  }

  .s16d-game-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .s16d-features {
    grid-template-columns: repeat(4, 1fr);
  }

  .s16d-menu-toggle {
    display: block;
  }

  .s16d-header-buttons {
    display: none;
  }
}

@media (max-width: 767px) {
  .s16d-menu-toggle {
    display: block;
  }

  .s16d-header-buttons {
    display: none;
  }

  .s16d-game-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .s16d-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .s16d-carousel {
    height: 180px;
  }
}

/* Accessibility */
.s16d-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;
}

/* Focus styles for better accessibility */
.s16d-btn:focus,
.s16d-header-btn:focus,
.s16d-nav-item:focus,
.s16d-menu-item:focus {
  outline: 3px solid var(--s16d-accent2);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .s16d-header,
  .s16d-bottom-nav,
  .s16d-mobile-menu,
  .s16d-loading {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .s16d-container {
    max-width: none !important;
  }
}