/**
 * jl 77 Layout CSS
 * All classes use gb3e- prefix for namespace isolation
 * Mobile-first responsive design
 * Color scheme: #DCDCDC (light) | #2D2D2D (dark)
 * Version 1.0
 */

/* CSS Variables for theming */
:root {
  --gb3e-primary: #DCDCDC;
  --gb3e-secondary: #2D2D2D;
  --gb3e-bg: #2D2D2D;
  --gb3e-text: #DCDCDC;
  --gb3e-accent: #FF6B6B;
  --gb3e-success: #4CAF50;
  --gb3e-warning: #FF9800;
  --gb3e-error: #F44336;
  --gb3e-border: rgba(220, 220, 220, 0.2);
  --gb3e-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --gb3e-header-height: 60px;
  --gb3e-footer-height: 40px;
  --gb3e-mobile-nav-height: 60px;
}

/* Reset and 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, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--gb3e-text);
  background-color: var(--gb3e-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--gb3e-header-height);
  padding-bottom: var(--gb3e-mobile-nav-height);
}

@media (min-width: 769px) {
  body {
    padding-bottom: var(--gb3e-footer-height);
  }
}

/* Container and layout utilities */
.gb3e-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
}

.gb3e-wrapper {
  width: 100%;
  padding: 1rem 0;
}

.gb3e-grid {
  display: grid;
  gap: 1rem;
}

.gb3e-flex {
  display: flex;
}

.gb3e-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gb3e-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gb3e-flex-column {
  display: flex;
  flex-direction: column;
}

/* Header styles */
.gb3e-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--gb3e-header-height);
  background-color: var(--gb3e-secondary);
  border-bottom: 1px solid var(--gb3e-border);
  z-index: 1000;
  transition: all 0.3s ease;
}

.gb3e-header.scrolled {
  box-shadow: var(--gb3e-shadow);
}

.gb3e-header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.gb3e-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--gb3e-text);
  font-weight: 700;
  font-size: 1.8rem;
}

.gb3e-logo img {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.4rem;
}

.gb3e-header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.gb3e-btn {
  padding: 0.6rem 1.2rem;
  background-color: var(--gb3e-accent);
  color: white;
  border: none;
  border-radius: 0.4rem;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  min-width: 8.8rem;
}

.gb3e-btn:hover {
  background-color: #FF5252;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.gb3e-btn:active {
  transform: translateY(0);
}

.gb3e-btn.secondary {
  background-color: transparent;
  color: var(--gb3e-text);
  border: 2px solid var(--gb3e-primary);
}

.gb3e-btn.secondary:hover {
  background-color: var(--gb3e-primary);
  color: var(--gb3e-secondary);
}

.gb3e-menu-btn {
  background: none;
  border: none;
  color: var(--gb3e-text);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.4rem;
  transition: all 0.3s ease;
  display: none;
}

@media (max-width: 768px) {
  .gb3e-menu-btn {
    display: block;
  }
}

.gb3e-menu-btn:hover {
  background-color: rgba(220, 220, 220, 0.1);
}

/* Mobile menu */
.gb3e-mobile-menu {
  position: fixed;
  top: var(--gb3e-header-height);
  left: 0;
  right: 0;
  background-color: var(--gb3e-secondary);
  border-bottom: 1px solid var(--gb3e-border);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  max-height: calc(100vh - var(--gb3e-header-height));
  overflow-y: auto;
}

.gb3e-mobile-menu.active {
  transform: translateY(0);
}

.gb3e-menu-list {
  list-style: none;
  padding: 1rem 0;
}

.gb3e-menu-item {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--gb3e-border);
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: var(--gb3e-text);
  display: block;
  font-size: 1.6rem;
}

.gb3e-menu-item:hover {
  background-color: rgba(220, 220, 220, 0.1);
}

.gb3e-menu-item:last-child {
  border-bottom: none;
}

/* Desktop navigation */
.gb3e-desktop-nav {
  display: none;
}

@media (min-width: 769px) {
  .gb3e-desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }

  .gb3e-nav-link {
    color: var(--gb3e-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
    font-size: 1.5rem;
  }

  .gb3e-nav-link:hover {
    background-color: rgba(220, 220, 220, 0.1);
  }
}

/* Mobile bottom navigation */
.gb3e-mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--gb3e-mobile-nav-height);
  background-color: var(--gb3e-secondary);
  border-top: 1px solid var(--gb3e-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.5rem 0;
}

@media (min-width: 769px) {
  .gb3e-mobile-nav {
    display: none;
  }
}

.gb3e-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gb3e-text);
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 6rem;
  min-height: 5.5rem;
  border-radius: 0.4rem;
  padding: 0.5rem;
  gap: 0.3rem;
  cursor: pointer;
  background: none;
  border: none;
}

.gb3e-nav-item:hover {
  background-color: rgba(220, 220, 220, 0.1);
  transform: translateY(-2px);
}

.gb3e-nav-item:active {
  transform: translateY(0);
}

.gb3e-nav-item.active {
  color: var(--gb3e-accent);
}

.gb3e-nav-icon {
  font-size: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
}

.gb3e-nav-text {
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

/* Main content */
main.gb3e-main {
  min-height: calc(100vh - var(--gb3e-header-height) - var(--gb3e-footer-height));
  padding: 2rem 0;
}

@media (max-width: 768px) {
  main.gb3e-main {
    min-height: calc(100vh - var(--gb3e-header-height) - var(--gb3e-mobile-nav-height));
  }
}

/* Carousel */
.gb3e-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  border-radius: 0.8rem;
  background-color: var(--gb3e-secondary);
  margin-bottom: 2rem;
}

.gb3e-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

.gb3e-slide.active {
  display: block;
}

.gb3e-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.gb3e-carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.gb3e-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background-color: rgba(220, 220, 220, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gb3e-dot.active {
  background-color: var(--gb3e-accent);
  width: 2rem;
  border-radius: 0.4rem;
}

/* Cards */
.gb3e-card {
  background-color: var(--gb3e-secondary);
  border-radius: 0.8rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gb3e-border);
  transition: all 0.3s ease;
}

.gb3e-card:hover {
  box-shadow: var(--gb3e-shadow);
  transform: translateY(-2px);
}

.gb3e-card-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gb3e-border);
}

.gb3e-card-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gb3e-text);
  margin-bottom: 0.5rem;
}

.gb3e-card-subtitle {
  font-size: 1.4rem;
  color: rgba(220, 220, 220, 0.8);
}

.gb3e-card-content {
  color: var(--gb3e-text);
  line-height: 1.6;
}

/* Games grid */
.gb3e-games-section {
  margin-bottom: 3rem;
}

.gb3e-section-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gb3e-text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gb3e-accent);
}

.gb3e-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 380px) {
  .gb3e-games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gb3e-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--gb3e-text);
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.gb3e-game-item:hover {
  background-color: rgba(220, 220, 220, 0.1);
  transform: translateY(-2px);
}

.gb3e-game-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.4rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background-color: var(--gb3e-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gb3e-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gb3e-game-name {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  color: var(--gb3e-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Feature sections */
.gb3e-feature {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--gb3e-secondary);
  border-radius: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gb3e-border);
}

.gb3e-feature-icon {
  width: 5rem;
  height: 5rem;
  background-color: var(--gb3e-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.4rem;
  flex-shrink: 0;
}

.gb3e-feature-content h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gb3e-text);
}

.gb3e-feature-content p {
  font-size: 1.4rem;
  color: rgba(220, 220, 220, 0.8);
  line-height: 1.5;
}

/* Footer */
.gb3e-footer {
  background-color: var(--gb3e-secondary);
  border-top: 1px solid var(--gb3e-border);
  padding: 2rem 0 1rem;
  margin-top: 3rem;
}

.gb3e-footer-content {
  margin-bottom: 2rem;
}

.gb3e-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.gb3e-footer-link {
  color: var(--gb3e-text);
  text-decoration: none;
  font-size: 1.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  transition: all 0.3s ease;
}

.gb3e-footer-link:hover {
  background-color: rgba(220, 220, 220, 0.1);
  color: var(--gb3e-accent);
}

.gb3e-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.gb3e-partner {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  background-color: var(--gb3e-bg);
  padding: 0.5rem;
}

.gb3e-partner img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gb3e-copyright {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--gb3e-border);
  font-size: 1.3rem;
  color: rgba(220, 220, 220, 0.6);
}

/* Typography */
.gb3e-h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gb3e-text);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.gb3e-h2 {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--gb3e-text);
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

.gb3e-h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--gb3e-text);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.gb3e-text-center {
  text-align: center;
}

.gb3e-text-muted {
  color: rgba(220, 220, 220, 0.7);
}

.gb3e-link {
  color: var(--gb3e-accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.gb3e-link:hover {
  text-decoration: underline;
}

/* Loading states */
.gb3e-loading {
  opacity: 0.6;
  pointer-events: none;
}

.gb3e-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(220, 220, 220, 0.3);
  border-top: 2px solid var(--gb3e-accent);
  border-radius: 50%;
  animation: gb3e-spin 1s linear infinite;
}

@keyframes gb3e-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility classes */
.gb3e-hidden {
  display: none !important;
}

.gb3e-visible {
  display: block !important;
}

.gb3e-mt-1 { margin-top: 1rem; }
.gb3e-mt-2 { margin-top: 2rem; }
.gb3e-mt-3 { margin-top: 3rem; }

.gb3e-mb-1 { margin-bottom: 1rem; }
.gb3e-mb-2 { margin-bottom: 2rem; }
.gb3e-mb-3 { margin-bottom: 3rem; }

.gb3e-p-1 { padding: 1rem; }
.gb3e-p-2 { padding: 2rem; }
.gb3e-p-3 { padding: 3rem; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .gb3e-header, .gb3e-footer, .gb3e-mobile-nav {
    display: none;
  }

  body {
    padding: 0;
    color: #000;
    background: #fff;
  }
}