/**
 * PHPGames Theme CSS - Mobile-First Responsive Design
 * Author: phpgames.click
 * Color Palette: #141414 (Background) | #0097A7 (Primary)
 */

/* CSS Variables */
:root {
  --s014-primary: #0097A7;
  --s014-primary-dark: #006064;
  --s014-primary-light: #00BCD4;
  --s014-bg: #141414;
  --s014-bg-light: #1e1e1e;
  --s014-bg-card: #252525;
  --s014-text: #ffffff;
  --s014-text-muted: #b0b0b0;
  --s014-text-dim: #808080;
  --s014-border: #333333;
  --s014-shadow: rgba(0, 0, 0, 0.5);
  --s014-success: #4CAF50;
  --s014-warning: #FF9800;
  --s014-error: #F44336;
  --s014-gradient: linear-gradient(135deg, var(--s014-primary), var(--s014-primary-dark));
  --s014-border-radius: 8px;
  --s014-transition: all 0.3s ease;
  --s014-box-shadow: 0 4px 12px var(--s014-shadow);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--s014-text);
  background-color: var(--s014-bg);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--s014-text);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 2.0rem; }
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(--s014-text-muted);
}

a {
  color: var(--s014-primary);
  text-decoration: none;
  transition: var(--s014-transition);
}

a:hover {
  color: var(--s014-primary-light);
}

/* Container and Layout */
.s014-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.6rem;
  width: 100%;
}

.s014-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.s014-main {
  flex: 1;
  padding-top: 6rem;
  padding-bottom: 7rem;
}

/* Grid System */
.s014-grid {
  display: grid;
  gap: 1.6rem;
}

.s014-grid-2 { grid-template-columns: repeat(2, 1fr); }
.s014-grid-3 { grid-template-columns: repeat(3, 1fr); }
.s014-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Header Styles */
.s014-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--s014-bg);
  border-bottom: 1px solid var(--s014-border);
  z-index: 1000;
  padding: 1rem 0;
  backdrop-filter: blur(10px);
}

.s014-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.8rem;
}

.s014-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--s014-text);
}

.s014-logo img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
}

.s014-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Button Styles */
.s014-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1.4rem;
  font-weight: 600;
  border: none;
  border-radius: var(--s014-border-radius);
  cursor: pointer;
  transition: var(--s014-transition);
  text-decoration: none;
  min-height: 4.4rem;
  gap: 0.8rem;
}

.s014-btn-primary {
  background: var(--s014-gradient);
  color: var(--s014-text);
  box-shadow: var(--s014-box-shadow);
}

.s014-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--s014-shadow);
}

.s014-btn-secondary {
  background: transparent;
  color: var(--s014-primary);
  border: 2px solid var(--s014-primary);
}

.s014-btn-secondary:hover {
  background: var(--s014-primary);
  color: var(--s014-text);
}

.s014-btn-small {
  padding: 0.8rem 1.6rem;
  font-size: 1.2rem;
  min-height: 3.6rem;
}

/* Menu Toggle Button */
.s014-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  padding: 0.4rem;
}

.s014-menu-line {
  width: 100%;
  height: 2px;
  background: var(--s014-text);
  margin: 2px 0;
  transition: var(--s014-transition);
}

.s014-menu-open .s014-menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.s014-menu-open .s014-menu-line:nth-child(2) {
  opacity: 0;
}

.s014-menu-open .s014-menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.s014-mobile-menu {
  position: fixed;
  top: 6.8rem;
  right: -100%;
  width: 28rem;
  height: calc(100vh - 6.8rem);
  background: var(--s014-bg-card);
  border-left: 1px solid var(--s014-border);
  transition: var(--s014-transition);
  z-index: 999;
  overflow-y: auto;
}

.s014-menu-active {
  right: 0;
}

.s014-menu-overlay {
  position: fixed;
  top: 6.8rem;
  left: 0;
  width: 100%;
  height: calc(100vh - 6.8rem);
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: var(--s014-transition);
  z-index: 998;
}

.s014-overlay-active {
  opacity: 1;
  visibility: visible;
}

.s014-menu-nav {
  padding: 2rem;
}

.s014-menu-nav ul {
  list-style: none;
}

.s014-menu-nav li {
  margin-bottom: 1rem;
}

.s014-menu-nav a {
  display: block;
  padding: 1.2rem 0;
  font-size: 1.6rem;
  color: var(--s014-text);
  border-bottom: 1px solid var(--s014-border);
}

.s014-menu-nav a:hover {
  color: var(--s014-primary);
}

/* No Scroll Class */
.s014-no-scroll {
  overflow: hidden;
}

/* Carousel Styles */
.s014-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--s014-border-radius);
  margin-bottom: 2rem;
}

.s014-slides {
  position: relative;
  height: 20rem;
}

.s014-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.s014-slide-active {
  opacity: 1;
}

.s014-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s014-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1rem;
}

.s014-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--s014-text-dim);
  cursor: pointer;
  transition: var(--s014-transition);
}

.s014-dot-active {
  background: var(--s014-primary);
}

/* Game Grid Styles */
.s014-games-section {
  margin: 2rem 0;
}

.s014-section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--s014-primary);
}

.s014-section-title i {
  font-size: 2rem;
  color: var(--s014-primary);
}

.s014-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.s014-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--s014-bg-card);
  border-radius: var(--s014-border-radius);
  cursor: pointer;
  transition: var(--s014-transition);
  text-align: center;
}

.s014-game-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--s014-box-shadow);
  background: var(--s014-bg-light);
}

.s014-game-icon {
  width: 4rem;
  height: 4rem;
  border-radius: var(--s014-border-radius);
  margin-bottom: 0.8rem;
  object-fit: cover;
}

.s014-game-name {
  font-size: 1.1rem;
  color: var(--s014-text);
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Card Styles */
.s014-card {
  background: var(--s014-bg-card);
  border-radius: var(--s014-border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--s014-border);
}

.s014-card-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--s014-primary);
}

.s014-card-content {
  color: var(--s014-text-muted);
  line-height: 1.6;
}

/* Feature Section */
.s014-feature {
  text-align: center;
  padding: 2rem 0;
}

.s014-feature-icon {
  font-size: 4rem;
  color: var(--s014-primary);
  margin-bottom: 1rem;
}

.s014-feature-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.s014-feature-desc {
  color: var(--s014-text-muted);
}

/* Bottom Navigation */
.s014-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--s014-bg-card);
  border-top: 1px solid var(--s014-border);
  display: flex;
  justify-content: space-around;
  padding: 0.8rem 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.s014-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem;
  min-width: 6rem;
  cursor: pointer;
  transition: var(--s014-transition);
  text-decoration: none;
  color: var(--s014-text-dim);
}

.s014-bottom-nav-item:hover,
.s014-nav-active {
  color: var(--s014-primary);
  transform: scale(1.05);
}

.s014-nav-clicked {
  animation: s014-navClick 0.2s ease;
}

.s014-bottom-nav-icon {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.s014-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
}

/* Footer Styles */
.s014-footer {
  background: var(--s014-bg-light);
  padding: 3rem 0 8rem;
  border-top: 1px solid var(--s014-border);
}

.s014-footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.s014-footer-links a {
  padding: 1rem;
  background: var(--s014-bg-card);
  border-radius: var(--s014-border-radius);
  text-align: center;
  font-size: 1.2rem;
  color: var(--s014-text);
  transition: var(--s014-transition);
}

.s014-footer-links a:hover {
  background: var(--s014-primary);
  color: var(--s014-text);
}

.s014-partners {
  margin: 2rem 0;
}

.s014-partners-title {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--s014-text-muted);
  font-size: 1.2rem;
}

.s014-partners-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  justify-items: center;
}

.s014-partner-icon {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  opacity: 0.6;
  transition: var(--s014-transition);
}

.s014-partner-icon:hover {
  opacity: 1;
}

.s014-copyright {
  text-align: center;
  color: var(--s014-text-dim);
  font-size: 1.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--s014-border);
}

/* Loading Styles */
.s014-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--s014-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.s014-loader-hidden {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.s014-spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid var(--s014-border);
  border-top: 4px solid var(--s014-primary);
  border-radius: 50%;
  animation: s014-spin 1s linear infinite;
}

/* Animations */
@keyframes s014-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes s014-navClick {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1.05); }
}

@keyframes s014-fadeIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s014-fade-in {
  animation: s014-fadeIn 0.6s ease forwards;
}

/* Utility Classes */
.s014-text-center { text-align: center; }
.s014-text-left { text-align: left; }
.s014-text-right { text-align: right; }

.s014-hidden { display: none !important; }
.s014-visible { display: block !important; }

.s014-mt-1 { margin-top: 1rem; }
.s014-mt-2 { margin-top: 2rem; }
.s014-mb-1 { margin-bottom: 1rem; }
.s014-mb-2 { margin-bottom: 2rem; }

.s014-p-1 { padding: 1rem; }
.s014-p-2 { padding: 2rem; }

.s014-border-primary { border: 2px solid var(--s014-primary); }
.s014-bg-primary { background: var(--s014-primary); }
.s014-text-primary { color: var(--s014-primary); }

/* Responsive Design */
@media (min-width: 480px) {
  .s014-container {
    max-width: 480px;
  }
  .s014-games-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 768px) {
  .s014-container {
    max-width: 768px;
    padding: 0 2rem;
  }
  
  .s014-menu-toggle {
    display: none;
  }
  
  .s014-header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  
  .s014-header-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
  }
  
  .s014-header-nav a {
    color: var(--s014-text);
    font-weight: 500;
  }
  
  .s014-header-nav a:hover {
    color: var(--s014-primary);
  }
  
  .s014-bottom-nav {
    display: none;
  }
  
  .s014-main {
    padding-bottom: 2rem;
  }
  
  .s014-footer {
    padding-bottom: 3rem;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .s014-game-icon,
  .s014-partner-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  /* Colors are already optimized for dark theme */
}

/* Focus Styles for Accessibility */
.s014-btn:focus,
.s014-game-item:focus,
.s014-bottom-nav-item:focus {
  outline: 2px solid var(--s014-primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .s014-header,
  .s014-bottom-nav,
  .s014-carousel,
  .s014-mobile-menu {
    display: none !important;
  }
  
  .s014-main {
    padding-top: 0;
    padding-bottom: 0;
  }
  
  body {
    background: white;
    color: black;
  }
}