/* PHFiery Click Design System */
:root {
  --pg4d-primary: #0E1621;
  --pg4d-secondary: #9370DB;
  --pg4d-accent: #E6E6FA;
  --pg4d-neutral: #ADB5BD;
  --pg4d-highlight: #EE82EE;
  --pg4d-text: #0E1621;
  --pg4d-text-light: #6C757D;
  --pg4d-bg: #FFFFFF;
  --pg4d-bg-alt: #F8F9FA;
  --pg4d-border: #DEE2E6;
  --pg4d-shadow: 0 2px 10px rgba(14, 22, 33, 0.1);
  --pg4d-shadow-hover: 0 4px 20px rgba(147, 112, 219, 0.2);
  --pg4d-radius: 12px;
  --pg4d-radius-sm: 8px;
  --pg4d-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--pg4d-font-family);
  line-height: 1.6;
  color: var(--pg4d-text);
  background-color: var(--pg4d-bg);
  font-size: 16px;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

/* Layout Components */
.pg4d-wrapper {
  max-width: 430px;
  margin: 0 auto;
  background: var(--pg4d-bg);
  min-height: 100vh;
  position: relative;
}

.pg4d-container {
  padding: 0 1rem;
}

/* Header Styles */
.pg4d-header {
  background: linear-gradient(135deg, var(--pg4d-primary) 0%, var(--pg4d-secondary) 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--pg4d-shadow);
}

.pg4d-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.pg4d-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.pg4d-logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--pg4d-radius-sm);
}

.pg4d-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg4d-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.5rem;
  border-radius: var(--pg4d-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.pg4d-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Menu Overlay */
.pg4d-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.pg4d-menu-overlay.pg4d-active {
  opacity: 1;
  visibility: visible;
}

/* Navigation Menu */
.pg4d-nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  box-shadow: var(--pg4d-shadow);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.pg4d-nav-menu.pg4d-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.pg4d-nav-links {
  padding: 1rem 0;
}

.pg4d-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--pg4d-text);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.pg4d-nav-link:hover {
  background: var(--pg4d-bg-alt);
  border-left-color: var(--pg4d-secondary);
  color: var(--pg4d-secondary);
}

/* Button Styles */
.pg4d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--pg4d-secondary);
  color: white;
  border-radius: var(--pg4d-radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-align: center;
  border: 2px solid var(--pg4d-secondary);
}

.pg4d-btn:hover {
  background: var(--pg4d-highlight);
  border-color: var(--pg4d-highlight);
  transform: translateY(-2px);
  box-shadow: var(--pg4d-shadow-hover);
}

.pg4d-btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.pg4d-btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.pg4d-btn-outline {
  background: transparent;
  color: var(--pg4d-secondary);
}

.pg4d-btn-outline:hover {
  background: var(--pg4d-secondary);
  color: white;
}

/* Carousel Styles */
.pg4d-carousel {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--pg4d-radius);
  overflow: hidden;
  box-shadow: var(--pg4d-shadow);
}

.pg4d-slide {
  display: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pg4d-slide.pg4d-active {
  display: block;
}

.pg4d-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.pg4d-carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.pg4d-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.pg4d-dot.pg4d-active {
  background: var(--pg4d-highlight);
  transform: scale(1.2);
}

/* Main Content */
.pg4d-main {
  padding: 1rem 0 6rem;
}

.pg4d-section {
  margin: 2rem 0;
}

.pg4d-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pg4d-primary);
  text-align: center;
  margin: 1.5rem 0;
  line-height: 1.3;
}

/* Card Styles */
.pg4d-card {
  background: white;
  border-radius: var(--pg4d-radius);
  box-shadow: var(--pg4d-shadow);
  margin: 1rem 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pg4d-card:hover {
  box-shadow: var(--pg4d-shadow-hover);
  transform: translateY(-2px);
}

.pg4d-card-title {
  background: linear-gradient(135deg, var(--pg4d-secondary) 0%, var(--pg4d-highlight) 100%);
  color: white;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pg4d-card-content {
  padding: 1.5rem;
}

.pg4d-card-content p {
  margin: 1rem 0;
  color: var(--pg4d-text-light);
  line-height: 1.7;
}

.pg4d-card-content h3,
.pg4d-card-content h4 {
  color: var(--pg4d-primary);
  margin: 1rem 0 0.5rem;
}

.pg4d-card-content ul,
.pg4d-card-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.pg4d-card-content li {
  margin: 0.5rem 0;
  color: var(--pg4d-text-light);
}

/* Game Grid */
.pg4d-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.pg4d-game-item {
  background: white;
  border-radius: var(--pg4d-radius);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--pg4d-shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.pg4d-game-item:hover {
  border-color: var(--pg4d-secondary);
  transform: translateY(-3px);
  box-shadow: var(--pg4d-shadow-hover);
}

.pg4d-game-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--pg4d-radius-sm);
  margin-bottom: 0.5rem;
  object-fit: cover;
}

.pg4d-game-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pg4d-primary);
  line-height: 1.3;
}

/* Footer */
.pg4d-footer {
  background: var(--pg4d-bg-alt);
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid var(--pg4d-border);
}

.pg4d-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pg4d-footer-link {
  color: var(--pg4d-text-light);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.pg4d-footer-link:hover {
  color: var(--pg4d-secondary);
}

.pg4d-copyright {
  font-size: 0.8rem;
  color: var(--pg4d-text-light);
  line-height: 1.5;
}

/* Bottom Navigation */
.pg4d-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 430px;
  background: white;
  border-top: 1px solid var(--pg4d-border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 90;
}

.pg4d-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  color: var(--pg4d-text-light);
  transition: all 0.3s ease;
  border-radius: var(--pg4d-radius-sm);
  min-width: 60px;
}

.pg4d-nav-item:hover,
.pg4d-nav-item.pg4d-active {
  color: var(--pg4d-secondary);
  background: var(--pg4d-accent);
}

.pg4d-nav-icon {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.pg4d-nav-label {
  font-size: 0.7rem;
  font-weight: 500;
}

/* Filter Buttons */
.pg4d-filter-container {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.pg4d-filter-btn {
  background: var(--pg4d-bg-alt);
  color: var(--pg4d-text-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.3s ease;
  border: 1px solid var(--pg4d-border);
}

.pg4d-filter-btn.pg4d-active,
.pg4d-filter-btn:hover {
  background: var(--pg4d-secondary);
  color: white;
  border-color: var(--pg4d-secondary);
}

/* Responsive Design */
@media (max-width: 430px) {
  .pg4d-wrapper {
    max-width: 100vw;
  }
  
  .pg4d-bottom-nav {
    width: 100vw;
  }
  
  .pg4d-container {
    padding: 0 0.75rem;
  }
  
  .pg4d-game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  
  .pg4d-nav-actions {
    gap: 0.25rem;
  }
  
  .pg4d-btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Animations */
@keyframes pg4d-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pg4d-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pg4d-animate-fade {
  animation: pg4d-fadeIn 0.6s ease-out;
}

.pg4d-animate-pulse {
  animation: pg4d-pulse 2s infinite;
}

/* Utility Classes */
.pg4d-text-center {
  text-align: center;
}

.pg4d-text-left {
  text-align: left;
}

.pg4d-text-right {
  text-align: right;
}

.pg4d-hidden {
  display: none;
}

.pg4d-visible {
  display: block;
}

.pg4d-flex {
  display: flex;
}

.pg4d-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg4d-mb-1 {
  margin-bottom: 1rem;
}

.pg4d-mt-1 {
  margin-top: 1rem;
}

.pg4d-p-1 {
  padding: 1rem;
}

/* Special Elements */
.pg4d-highlight-box {
  background: linear-gradient(135deg, var(--pg4d-accent) 0%, var(--pg4d-highlight) 20%);
  padding: 1.5rem;
  border-radius: var(--pg4d-radius);
  border: 2px solid var(--pg4d-secondary);
  margin: 1rem 0;
}

.pg4d-gradient-text {
  background: linear-gradient(135deg, var(--pg4d-secondary) 0%, var(--pg4d-highlight) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pg4d-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading States */
.pg4d-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(147, 112, 219, 0.3);
  border-radius: 50%;
  border-top-color: var(--pg4d-secondary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}