/**
 * PH828 Gaming Website CSS Design
 * All classes use prefix 'g53f-' for namespace isolation
 * Mobile-first responsive design with professional gaming aesthetics
 */

/* ===== CSS Variables and Root Configuration ===== */
:root {
  /* Color Palette - Professional gaming theme */
  --g53f-primary: #D2691E;        /* Rich brown - primary brand color */
  --g53f-secondary: #FFDEAD;      /* Warm cream - secondary accent */
  --g53f-accent: #FF4500;         /* Vibrant orange - call-to-action */
  --g53f-dark: #1B263B;           /* Deep navy - backgrounds */
  --g53f-muted: #BC8F8F;          /* Soft rose - muted elements */
  --g53f-white: #FFFFFF;          /* Pure white - text contrast */
  --g53f-gray-100: #F8F9FA;       /* Light gray - backgrounds */
  --g53f-gray-200: #E9ECEF;       /* Medium light gray */
  --g53f-gray-300: #DEE2E6;       /* Medium gray - borders */
  --g53f-gray-600: #6C757D;       /* Dark gray - secondary text */
  --g53f-gray-800: #343A40;       /* Very dark gray - headings */
  --g53f-gray-900: #212529;       /* Near black - primary text */

  /* Typography */
  --g53f-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --g53f-font-mono: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Spacing Scale */
  --g53f-spacer: 1rem;
  --g53f-spacer-xs: 0.25rem;
  --g53f-spacer-sm: 0.5rem;
  --g53f-spacer-md: 1rem;
  --g53f-spacer-lg: 1.5rem;
  --g53f-spacer-xl: 2rem;
  --g53f-spacer-xxl: 3rem;

  /* Border Radius */
  --g53f-radius-sm: 0.25rem;
  --g53f-radius-md: 0.5rem;
  --g53f-radius-lg: 0.75rem;
  --g53f-radius-xl: 1rem;
  --g53f-radius-circle: 50%;

  /* Shadows */
  --g53f-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --g53f-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --g53f-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --g53f-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --g53f-transition-fast: 0.15s ease-in-out;
  --g53f-transition-normal: 0.3s ease-in-out;
  --g53f-transition-slow: 0.5s ease-in-out;
}

/* ===== Reset and Base Styles ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* Base font size for easy rem calculations */
  scroll-behavior: smooth;
}

body {
  font-family: var(--g53f-font-primary);
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--g53f-gray-900);
  background-color: var(--g53f-dark);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile-first approach - ensure no horizontal scroll */
@media (max-width: 768px) {
  body {
    padding-bottom: 80px; /* Space for fixed bottom navigation */
  }
}

/* ===== Typography ===== */
.g53f-h1,
.g53f-h2,
.g53f-h3,
.g53f-h4,
.g53f-h5,
.g53f-h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--g53f-spacer-md);
  color: var(--g53f-white);
}

.g53f-h1 { font-size: 2.8rem; }
.g53f-h2 { font-size: 2.4rem; }
.g53f-h3 { font-size: 2rem; }
.g53f-h4 { font-size: 1.8rem; }
.g53f-h5 { font-size: 1.6rem; }
.g53f-h6 { font-size: 1.4rem; }

.g53f-text-xs { font-size: 1.2rem; }
.g53f-text-sm { font-size: 1.4rem; }
.g53f-text-base { font-size: 1.6rem; }
.g53f-text-lg { font-size: 1.8rem; }
.g53f-text-xl { font-size: 2rem; }

/* ===== Layout Components ===== */
.g53f-container {
  width: 100%;
  max-width: 430px; /* Mobile-first constraint */
  margin: 0 auto;
  padding: 0 var(--g53f-spacer-md);
}

.g53f-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.g53f-main {
  flex: 1;
  padding-top: 80px; /* Account for fixed header */
}

.g53f-grid {
  display: grid;
  gap: var(--g53f-spacer-md);
}

.g53f-grid-2 { grid-template-columns: repeat(2, 1fr); }
.g53f-grid-3 { grid-template-columns: repeat(3, 1fr); }
.g53f-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Header and Navigation ===== */
.g53f-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--g53f-dark) 0%, var(--g53f-primary) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.g53f-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--g53f-spacer-md) var(--g53f-spacer-md);
  max-width: 430px;
  margin: 0 auto;
}

.g53f-logo {
  display: flex;
  align-items: center;
  gap: var(--g53f-spacer-sm);
  text-decoration: none;
  color: var(--g53f-white);
  font-weight: 700;
  font-size: 1.8rem;
}

.g53f-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--g53f-accent);
  border-radius: var(--g53f-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.g53f-header-actions {
  display: flex;
  align-items: center;
  gap: var(--g53f-spacer-sm);
}

.g53f-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--g53f-spacer-sm) var(--g53f-spacer-md);
  border: none;
  border-radius: var(--g53f-radius-md);
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--g53f-transition-fast);
  min-height: 44px; /* Touch-friendly minimum */
  min-width: 60px;
}

.g53f-btn-primary {
  background: linear-gradient(135deg, var(--g53f-accent) 0%, #FF6B35 100%);
  color: var(--g53f-white);
  box-shadow: var(--g53f-shadow-sm);
}

.g53f-btn-primary:hover,
.g53f-btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: var(--g53f-shadow-md);
}

.g53f-btn-secondary {
  background: transparent;
  color: var(--g53f-secondary);
  border: 2px solid var(--g53f-secondary);
}

.g53f-btn-secondary:hover,
.g53f-btn-secondary:focus {
  background: var(--g53f-secondary);
  color: var(--g53f-dark);
}

.g53f-menu-button {
  background: none;
  border: none;
  color: var(--g53f-white);
  font-size: 2.4rem;
  cursor: pointer;
  padding: var(--g53f-spacer-sm);
  border-radius: var(--g53f-radius-sm);
  transition: all var(--g53f-transition-fast);
  min-width: 44px;
  min-height: 44px;
}

.g53f-menu-button:hover,
.g53f-menu-button:focus {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu */
.g53f-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--g53f-dark);
  backdrop-filter: blur(20px);
  z-index: 9999;
  transition: right var(--g53f-transition-normal);
  overflow-y: auto;
  padding-top: 80px;
}

.g53f-mobile-menu.active {
  right: 0;
}

.g53f-mobile-menu-content {
  padding: var(--g53f-spacer-lg);
}

.g53f-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.g53f-nav-item {
  margin-bottom: var(--g53f-spacer-sm);
}

.g53f-nav-link {
  display: block;
  padding: var(--g53f-spacer-md);
  color: var(--g53f-white);
  text-decoration: none;
  border-radius: var(--g53f-radius-md);
  transition: all var(--g53f-transition-fast);
  font-weight: 500;
}

.g53f-nav-link:hover,
.g53f-nav-link:focus,
.g53f-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--g53f-accent);
}

/* ===== Carousel ===== */
.g53f-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--g53f-radius-lg);
  margin-bottom: var(--g53f-spacer-xl);
  box-shadow: var(--g53f-shadow-lg);
}

.g53f-carousel-inner {
  display: flex;
  transition: transform var(--g53f-transition-normal);
}

.g53f-carousel-slide {
  min-width: 100%;
  position: relative;
}

.g53f-carousel-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.g53f-carousel-indicators {
  position: absolute;
  bottom: var(--g53f-spacer-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--g53f-spacer-xs);
}

.g53f-carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--g53f-radius-circle);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--g53f-transition-fast);
}

.g53f-carousel-indicator.active {
  background: var(--g53f-accent);
  transform: scale(1.2);
}

/* ===== Game Grid ===== */
.g53f-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--g53f-spacer-sm);
  margin-bottom: var(--g53f-spacer-xl);
}

.g53f-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--g53f-transition-fast);
  text-decoration: none;
  color: var(--g53f-white);
}

.g53f-game-item:hover {
  transform: translateY(-4px);
}

.g53f-game-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--g53f-radius-lg);
  overflow: hidden;
  margin-bottom: var(--g53f-spacer-xs);
  box-shadow: var(--g53f-shadow-sm);
  transition: all var(--g53f-transition-fast);
}

.g53f-game-item:hover .g53f-game-icon {
  box-shadow: var(--g53f-shadow-md);
  transform: scale(1.05);
}

.g53f-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g53f-game-name {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== Content Sections ===== */
.g53f-section {
  margin-bottom: var(--g53f-spacer-xxl);
}

.g53f-section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--g53f-white);
  margin-bottom: var(--g53f-spacer-lg);
  text-align: center;
}

.g53f-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: var(--g53f-radius-lg);
  padding: var(--g53f-spacer-lg);
  margin-bottom: var(--g53f-spacer-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--g53f-shadow-md);
}

.g53f-card-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--g53f-accent);
  margin-bottom: var(--g53f-spacer-md);
}

.g53f-card-text {
  color: var(--g53f-gray-200);
  line-height: 1.6;
  margin-bottom: var(--g53f-spacer-md);
}

/* ===== Footer ===== */
.g53f-footer {
  background: linear-gradient(135deg, var(--g53f-dark) 0%, #0F172A 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--g53f-spacer-xxl) 0 var(--g53f-spacer-lg);
  margin-top: var(--g53f-spacer-xxl);
}

.g53f-footer-content {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--g53f-spacer-md);
}

.g53f-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--g53f-spacer-md);
  margin-bottom: var(--g53f-spacer-xl);
}

.g53f-partner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--g53f-radius-sm);
  overflow: hidden;
  opacity: 0.8;
  transition: opacity var(--g53f-transition-fast);
}

.g53f-partner-icon:hover {
  opacity: 1;
}

.g53f-partner-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.g53f-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--g53f-spacer-md);
  margin-bottom: var(--g53f-spacer-lg);
}

.g53f-footer-link {
  color: var(--g53f-gray-300);
  text-decoration: none;
  font-size: 1.4rem;
  transition: color var(--g53f-transition-fast);
}

.g53f-footer-link:hover {
  color: var(--g53f-accent);
}

.g53f-footer-text {
  text-align: center;
  color: var(--g53f-gray-400);
  font-size: 1.2rem;
  margin-top: var(--g53f-spacer-lg);
}

/* ===== Bottom Mobile Navigation ===== */
.g53f-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--g53f-dark) 0%, var(--g53f-primary) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--g53f-spacer-sm) 0;
  height: 64px;
}

.g53f-bottom-nav-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 430px;
  margin: 0 auto;
  height: 100%;
}

.g53f-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  text-decoration: none;
  color: var(--g53f-gray-300);
  transition: all var(--g53f-transition-fast);
  border-radius: var(--g53f-radius-md);
  cursor: pointer;
}

.g53f-bottom-nav-item:hover,
.g53f-bottom-nav-item:focus {
  color: var(--g53f-accent);
  transform: translateY(-2px);
}

.g53f-bottom-nav-item.active {
  color: var(--g53f-accent);
  background: rgba(255, 69, 0, 0.1);
}

.g53f-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: var(--g53f-spacer-xs);
  transition: all var(--g53f-transition-fast);
}

.g53f-bottom-nav-item:hover .g53f-bottom-nav-icon {
  transform: scale(1.1);
}

.g53f-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1;
}

/* ===== Responsive Design ===== */
@media (min-width: 769px) {
  .g53f-bottom-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* ===== Touch States ===== */
.g53f-btn.touch-active,
.g53f-bottom-nav-item.touch-active {
  transform: scale(0.95) !important;
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Scroll to Top Button ===== */
.g53f-scroll-top {
  position: fixed;
  bottom: 80px;
  right: var(--g53f-spacer-md);
  width: 50px;
  height: 50px;
  background: var(--g53f-accent);
  color: var(--g53f-white);
  border: none;
  border-radius: var(--g53f-radius-circle);
  font-size: 2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--g53f-transition-normal);
  z-index: 999;
  box-shadow: var(--g53f-shadow-lg);
}

.g53f-scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.g53f-scroll-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--g53f-shadow-xl);
}

/* ===== Utility Classes ===== */
.g53f-text-center { text-align: center; }
.g53f-text-left { text-align: left; }
.g53f-text-right { text-align: right; }

.g53f-mb-0 { margin-bottom: 0; }
.g53f-mb-sm { margin-bottom: var(--g53f-spacer-sm); }
.g53f-mb-md { margin-bottom: var(--g53f-spacer-md); }
.g53f-mb-lg { margin-bottom: var(--g53f-spacer-lg); }
.g53f-mb-xl { margin-bottom: var(--g53f-spacer-xl); }

.g53f-mt-0 { margin-top: 0; }
.g53f-mt-sm { margin-top: var(--g53f-spacer-sm); }
.g53f-mt-md { margin-top: var(--g53f-spacer-md); }
.g53f-mt-lg { margin-top: var(--g53f-spacer-lg); }
.g53f-mt-xl { margin-top: var(--g53f-spacer-xl); }

.g53f-p-0 { padding: 0; }
.g53f-p-sm { padding: var(--g53f-spacer-sm); }
.g53f-p-md { padding: var(--g53f-spacer-md); }
.g53f-p-lg { padding: var(--g53f-spacer-lg); }

.g53f-hidden { display: none; }
.g53f-visible { display: block; }

/* ===== Loading States ===== */
.g53f-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--g53f-radius-circle);
  border-top-color: var(--g53f-accent);
  animation: g53f-spin 1s ease-in-out infinite;
}

@keyframes g53f-spin {
  to { transform: rotate(360deg); }
}

/* ===== Error States ===== */
.g53f-error {
  color: #FF4444;
  border-color: #FF4444;
  background-color: rgba(255, 68, 68, 0.1);
}

/* ===== Success States ===== */
.g53f-success {
  color: #00C851;
  border-color: #00C851;
  background-color: rgba(0, 200, 81, 0.1);
}