/**
 * jiligames - Design System Stylesheet
 * All classes prefixed with g444- for namespace isolation
 * Mobile-first responsive design with color palette
 */

/* CSS Variables - Color Palette */
:root {
  --g444-primary: #AFEEEE;
  --g444-secondary: #EEEEEE;
  --g444-accent: #E0F2F1;
  --g444-highlight: #CD853F;
  --g444-dark: #0F0F23;
  --g444-text: #E8F5E8;
  --g444-white: #FFFFFF;
  --g444-black: #000000;
  --g444-gray: #666666;
  --g444-success: #4CAF50;
  --g444-warning: #FF9800;
  --g444-error: #F44336;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
  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(--g444-text);
  background-color: var(--g444-dark);
  min-width: 320px;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--g444-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.6rem; }
h5 { font-size: 1.4rem; }
h6 { font-size: 1.2rem; }

p {
  margin-bottom: 1rem;
  color: var(--g444-secondary);
}

a {
  color: var(--g444-highlight);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--g444-primary);
}

/* Container */
.g444-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1rem;
}

.g444-wrapper {
  padding: 1rem;
}

/* Header */
.g444-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--g444-dark);
  border-bottom: 2px solid var(--g444-primary);
  transition: all 0.3s ease;
}

.g444-header-scrolled {
  background-color: rgba(15, 15, 35, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.g444-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  max-width: 430px;
  margin: 0 auto;
}

.g444-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--g444-primary);
}

.g444-logo-icon {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
}

.g444-header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.g444-btn {
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--g444-highlight);
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--g444-highlight), #E6A15C);
  color: var(--g444-white);
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 4.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.g444-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(205, 133, 63, 0.4);
}

.g444-btn-secondary {
  background: transparent;
  border-color: var(--g444-primary);
  color: var(--g444-primary);
}

.g444-btn-secondary:hover {
  background: var(--g444-primary);
  color: var(--g444-dark);
}

.g444-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.g444-menu-toggle span {
  display: block;
  width: 2.5rem;
  height: 0.3rem;
  background-color: var(--g444-primary);
  transition: all 0.3s ease;
  border-radius: 0.2rem;
}

.g444-menu-toggle.g444-menu-open span:nth-child(1) {
  transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.g444-menu-toggle.g444-menu-open span:nth-child(2) {
  opacity: 0;
}

.g444-menu-toggle.g444-menu-open span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* Mobile Menu */
.g444-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--g444-dark);
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 6rem 2rem 2rem;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.g444-mobile-menu.g444-menu-active {
  right: 0;
}

.g444-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  display: none;
}

.g444-menu-active ~ .g444-menu-overlay {
  display: block;
}

.g444-nav-link {
  display: block;
  padding: 1rem 0;
  color: var(--g444-text);
  font-size: 1.6rem;
  border-bottom: 1px solid var(--g444-accent);
  transition: all 0.3s ease;
}

.g444-nav-link:hover {
  color: var(--g444-primary);
  padding-left: 1rem;
}

/* Main Content */
main {
  padding-top: 8rem;
  padding-bottom: 8rem;
  min-height: 100vh;
}

/* Hero Carousel */
.g444-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: 1rem;
}

.g444-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}

.g444-carousel-slide.g444-slide-active {
  opacity: 1;
}

.g444-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Game Grid */
.g444-game-category {
  margin-bottom: 3rem;
}

.g444-category-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--g444-accent), transparent);
  border-radius: 0.5rem;
  border-left: 4px solid var(--g444-highlight);
}

.g444-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.g444-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.g444-game-item:hover {
  transform: scale(1.05);
}

.g444-game-icon {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid var(--g444-accent);
  transition: border-color 0.3s ease;
}

.g444-game-item:hover .g444-game-icon {
  border-color: var(--g444-highlight);
}

.g444-game-name {
  font-size: 1rem;
  text-align: center;
  color: var(--g444-text);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Content Modules */
.g444-module {
  background: linear-gradient(135deg, rgba(175, 238, 238, 0.1), transparent);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--g444-accent);
}

.g444-module-title {
  color: var(--g444-highlight);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Bottom Navigation */
.g444-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6rem;
  background: linear-gradient(to top, var(--g444-dark), rgba(15, 15, 35, 0.95));
  border-top: 2px solid var(--g444-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  max-width: 430px;
  margin: 0 auto;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.g444-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 6rem;
  min-height: 6rem;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
}

.g444-nav-item:hover {
  transform: scale(1.1);
  background: rgba(175, 238, 238, 0.1);
  border-radius: 0.5rem;
}

.g444-nav-item i,
.g444-nav-item svg {
  font-size: 2.4rem;
  color: var(--g444-primary);
  transition: color 0.3s ease;
}

.g444-nav-item span {
  font-size: 1rem;
  color: var(--g444-text);
  text-align: center;
}

.g444-nav-item:hover i,
.g444-nav-item:hover span {
  color: var(--g444-highlight);
}

/* Footer */
.g444-footer {
  background: linear-gradient(to top, var(--g444-dark), rgba(175, 238, 238, 0.1));
  padding: 3rem 1rem 8rem;
  border-top: 2px solid var(--g444-primary);
}

.g444-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.g444-footer-link {
  padding: 0.5rem 1rem;
  background: var(--g444-accent);
  border-radius: 0.5rem;
  font-size: 1.4rem;
}

.g444-partners {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.g444-partner-logo {
  width: 100%;
  height: 3rem;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.g444-partner-logo:hover {
  opacity: 1;
}

.g444-copyright {
  text-align: center;
  color: var(--g444-gray);
  font-size: 1.2rem;
  padding: 1rem;
  border-top: 1px solid var(--g444-accent);
}

/* Utility Classes */
.g444-text-center {
  text-align: center;
}

.g444-mt-1 {
  margin-top: 1rem;
}

.g444-mb-1 {
  margin-bottom: 1rem;
}

.g444-mt-2 {
  margin-top: 2rem;
}

.g444-mb-2 {
  margin-bottom: 2rem;
}

/* Desktop Responsive */
@media (min-width: 769px) {
  .g444-bottom-nav {
    display: none;
  }

  main {
    padding-bottom: 2rem;
  }

  .g444-game-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .g444-menu-toggle {
    display: none;
  }
}

/* Touch Feedback */
.g444-touch-active {
  transform: scale(0.95);
}

/* Animations */
@keyframes g444-fadeIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.g444-animate-fade-in {
  animation: g444-fadeIn 0.5s ease forwards;
}

/* Accessibility */
.g444-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Styles */
a:focus,
button:focus {
  outline: 2px solid var(--g444-highlight);
  outline-offset: 2px;
}
