/* CSS Variables */
:root {
  --bg-color: #0D1117;
  --bg-color-secondary: #161B22;
  --card-bg: rgba(22, 27, 34, 0.6);
  --border-color: rgba(240, 246, 252, 0.1);
  --accent-color: #58A6FF;
  --accent-color-hover: #79c0ff;
  --accent-glow: rgba(88, 166, 255, 0.3);
  --danger-color: #F85149;
  --success-color: #3FB950;
  --warning-color: #D29922;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --font-family: 'Vazirmatn', sans-serif;
}

/* Base and Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

.page-wrapper {
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.15), transparent);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-color-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* Hero Slider */
#hero {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 80px;
  /* Space for slider */
}

#bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.3);
  transform: scale(1.1);
  z-index: -1;
  transition: background-image 0.5s ease-in-out;
}

#mainGameBox {
  width: 280px;
  height: 300px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s ease;
}

#mainGameBox:hover {
  transform: scale(1.05);
}

#mainImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#gameTitle {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  margin-top: 35px;
  z-index: 2;
}

#sliderBox {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

#thumbContainer {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#thumbContainer::-webkit-scrollbar {
  display: none;
}

#thumbContainer img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

#thumbContainer img:hover {
  opacity: 1;
  transform: scale(1.05);
}

#thumbContainer img.active {
  border-color: var(--accent-color);
  opacity: 1;
  transform: scale(1.1);
}

#sliderBox button {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

#sliderBox button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Header */
.main-header {
  text-align: center;
  margin-bottom: 40px;
}

.main-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
}

.main-header p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Stats Container */
.stats-container {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 40px;
}

.stat {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-color);
  direction: ltr;
}

.stat-label {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Filters Panel */
.filters-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 40px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  outline: none;
  font-size: 16px;
  background: var(--bg-color-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search .icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.filter-controls select {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color-secondary);
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238B949E' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 15px center;
}

.filter-controls select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.categories button {
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.categories button:hover {
  background: var(--bg-color-secondary);
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.categories button.active {
  background: var(--accent-color);
  color: var(--bg-color);
  font-weight: 600;
  border-color: var(--accent-color);
}

/* Game Grid & Cards */
.grid {
  display: grid;
  gap: 25px;
  grid-template-columns: 1fr;
}

.list-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.list-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.list-card .thumb-box {
  position: relative;
  display: block;
  overflow: hidden;
  height: 300px;
  border-radius: var(--radius);
}

.list-card .thumb-box .bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px) brightness(0.6); /* سبک‌تر، شفاف */
  transform: scale(1.1);
  z-index: 0;
  border-radius: inherit;
}

.list-card .thumb-box .thumb {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.list-card:hover .thumb {
  transform: scale(1.05);
}

.info-box {
  padding: 20px;
}

.info-box .title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.info-box .title a {
  color: var(--text-primary);
}

.info-box .title a:hover {
  color: var(--accent-color);
}

.meta {
  font-size: 13px;
  margin: 8px 0;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta .pill {
  display: inline-block;
  background: var(--bg-color-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.meta .pill.new {
  background: var(--warning-color);
  border-color: var(--warning-color);
  color: #000;
  font-weight: 600;
}

mark {
  background: var(--accent-color);
  color: var(--bg-color);
  padding: 1px 4px;
  border-radius: 4px;
}

.empty {
  text-align: center;
  padding: 50px;
  font-size: 18px;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 30px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer-address a {
  font-weight: 500;
}

.footer-sep {
  margin: 0 10px;
}

/* Details Page */
.details-header {
  padding: 20px 0;
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.btn-back:hover {
  background: var(--bg-color-secondary);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.details-main,
.details-sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.details-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 25px;
  backdrop-filter: blur(10px);
}

.details-card h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.details-card h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.desc-justify {
  line-height: 1.8;
  font-size: 16px;
  color: var(--text-secondary);
  text-align: justify;
}

.release-date {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 15px;
}

.release-date span {
  color: var(--accent-color);
  font-weight: 600;
}

.price-box-details {
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  background: var(--bg-color-secondary);
  padding: 12px;
  border-radius: 8px;
}

.platform-label {
  background: var(--accent-color);
  color: var(--bg-color);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}

.old-price {
  color: var(--text-secondary);
  text-decoration: line-through;
}

.final-price {
  color: var(--success-color);
  font-weight: 700;
  font-size: 18px;
}

.discount {
  background: var(--danger-color);
  color: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 14px;
  margin-right: auto;
}

.size {
  color: var(--text-secondary);
  font-size: 14px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.gallery-img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
}

.lightbox img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* Responsive */
@media (min-width: 500px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .details-grid {
    grid-template-columns: 3fr 1fr;
  }
}

@media (max-width: 768px) {
  .main-header h1 {
    font-size: 28px;
  }

  .main-header p {
    font-size: 16px;
  }

  .filters-panel {
    padding: 15px;
  }

  .filter-controls {
    grid-template-columns: 1fr;
  }

  .details-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: 1fr 1fr;
  }

  .footer-address {
    flex-direction: column;
    gap: 5px;
  }

  .footer-sep {
    display: none;
  }
}

input,
select,
textarea,
button {
    font-family: var(--font-family) !important;
}

