/* ====== Design System ====== */
:root {
  /* Purple Theme Palette from Image */
  --p-deep: #34117E;
  --p-dark: #491AB1;
  --p-primary: #6631DB;
  --p-accent: #7B45F0;
  --p-light: #A981FF;
  --p-soft: #B796FE;
  --p-pale: #D0BCFC;

  /* Primary Colors */
  --primary: var(--p-primary);
  --primary-dark: var(--p-dark);
  --primary-light: var(--p-light);
  --primary-white: #FFFFFF;
  
  --primary-gradient: linear-gradient(135deg, var(--p-primary) 0%, var(--p-accent) 100%);
  --hero-gradient: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
  --purple-gradient: linear-gradient(135deg, var(--p-deep) 0%, var(--p-primary) 100%);
  
  /* Neutral Colors */
  --bg-body: #F8F9FD;
  --bg-card: #FFFFFF;
  --text-main: #2D2D2D;
  --text-muted: #6B7280;
  --border-light: #E5E7EB;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-purple: 0 10px 20px -5px rgba(102, 49, 219, 0.3);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
}

/* ====== Header Styles ====== */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--p-deep);
  font-weight: 800;
  font-size: 1.25rem;
  z-index: 1001;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--p-deep);
  border-radius: 3px;
  transition: var(--transition);
}

/* Hamburger Animation */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

nav a:hover, nav a.active {
  color: var(--p-primary);
}

@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    padding: 80px 2rem 2rem;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: 0.4s ease-in-out;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  nav a {
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 0;
    color: var(--p-deep);
  }
}

/* ====== Hero Section ====== */
.hero {
  padding: 4rem 1rem 2rem;
  text-align: center;
  background: var(--hero-gradient);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--p-deep);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn-play {
  padding: 0.875rem 2rem;
  background: var(--primary-gradient);
  color: white;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow-purple);
  transition: var(--transition);
}

.btn-browse {
  padding: 0.875rem 2rem;
  background: white;
  color: var(--p-primary);
  border: 2px solid var(--p-primary);
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
}

.btn-play:hover, .btn-browse:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Stats Section */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-val {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--p-deep);
}

.stat-lab {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ====== Apps Section ====== */
.apps-section {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.apps-header {
  margin-bottom: 2rem;
}

.apps-title h2 {
  font-size: 1.5rem;
  color: var(--p-deep);
  font-weight: 800;
}

/* App Type Switcher (Toggle) */
.type-switcher {
  display: flex;
  background: #EEEBFF;
  padding: 4px;
  border-radius: 99px;
  width: fit-content;
  margin: 1.5rem 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.type-switcher::-webkit-scrollbar {
  display: none;
}

.type-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--p-primary);
  font-weight: 700;
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.type-btn.active {
  background: var(--p-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Apps Grid - Default (Desktop) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.app-card-new {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.app-card-new:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--p-soft);
  transform: translateY(-2px);
}

.app-card-left {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.app-card-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-info {
  flex: 1;
}

.app-name-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--p-deep);
  margin-bottom: 0.15rem;
}

.players-count {
  font-size: 0.8rem;
  color: #8B8B8B;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.bonus-tag {
  font-size: 0.8rem;
  color: #10B981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-card-right .download-button {
  padding: 0.5rem 1rem;
  background: var(--p-primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}

.download-button:hover {
  filter: brightness(1.1);
}

/* ====== Game Detail Page ====== */
.page-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 600;
  transition: var(--transition);
}

.back-button:hover {
  color: var(--p-primary);
}

.game-hero-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.game-icon-wrapper {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.game-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info-main {
  flex: 1;
}

.game-category-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #EEEBFF;
  color: var(--p-primary);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.game-title-main {
  font-size: 2rem;
  color: var(--p-deep);
  margin-bottom: 1rem;
  font-weight: 800;
}

.game-meta-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meta-value {
  font-weight: 700;
  color: var(--text-main);
}

.meta-value.star {
  color: #FBBF24;
}

.meta-value.bonus {
  color: #10B981;
}

.btn-primary {
  padding: 0.8rem 2.5rem;
  background: var(--primary-gradient);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-purple);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

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

.stat-card {
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-align: center;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--p-deep);
}

.content-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.content-section h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--p-deep);
  font-weight: 800;
}

.content-section p {
  color: var(--text-muted);
  line-height: 1.8;
}

.related-games {
  margin-top: 3rem;
}

.related-games h2 {
  font-size: 1.5rem;
  color: var(--p-deep);
  margin-bottom: 1.5rem;
  font-weight: 800;
}

@media (max-width: 768px) {
  .game-hero-section {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .game-icon-wrapper {
    width: 120px;
    height: 120px;
  }

  .game-title-main {
    font-size: 1.5rem;
  }
  
  .game-meta-row {
    justify-content: center;
    gap: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .hero-btns {
    padding: 0;
  }
}

/* Mobile Responsive (Image 1 Style) */
@media (max-width: 768px) {
  .hero { padding: 0rem 1rem; }
  .hero-stats { gap: 1.5rem; padding: 1.5rem; }
  .stat-val { font-size: 1.25rem; }
  
  .apps-grid {
    grid-template-columns: 1fr; /* Single column as requested */
    gap: 1rem;
  }
  
  .app-card-new {
    padding: 1.25rem;
    border-radius: 20px; /* More rounded like image */
  }

  .app-card-left {
    width: 70px;
    height: 70px;
    border-radius: 18px;
  }

  .app-name-text { font-size: 1.1rem; }
  
  .hero-btns {
    flex-direction: column;
    padding: 0 1rem;
  }
  
  .hero-btns a { width: 100%; }
}

/* ====== Footer ====== */
footer {
  background: white;
  border-top: 1px solid var(--border-light);
  padding: 4rem 1rem 2rem;
  margin-top: 4rem;
}

/* ====== Admin Styles ====== */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-size: 1.5rem;
  color: var(--p-deep);
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: #f9fafb;
  font-weight: 700;
  color: var(--p-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.btn {
  padding: 0.6rem 1.2rem;
  background: var(--p-primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  filter: brightness(1.1);
}

.action-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.action-btn.delete {
  background: #fee2e2;
  color: #dc2626;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--p-deep);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--p-primary);
  box-shadow: 0 0 0 3px rgba(102, 49, 219, 0.1);
}

@media (max-width: 600px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-col h4 {
  margin-bottom: 1.5rem;
  color: var(--p-deep);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--p-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 3rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.9rem;
}

