/* ==================== فونت‌ها ==================== */
@font-face {
  font-family: 'Vazirmatn-Regular';
  src: url(font/vazirmatn/Vazirmatn-Regular.ttf);
}

@font-face {
  font-family: 'Vazirmatn-Bold';
  src: url(font/vazirmatn/Vazirmatn-Bold.ttf);
}

@font-face {
  font-family: 'Vazirmatn-ExtraBold';
  src: url(font/vazirmatn/Vazirmatn-ExtraBold.ttf);
}

@font-face {
  font-family: 'PlaywriteDESAS';
  src: url(font/Playwrite_DE_SAS/PlaywriteDESAS-VariableFont_wght.ttf);
}

/* ==================== استایل کلی ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn-Regular', sans-serif;
  text-align: right;
}

body {
  background: linear-gradient(135deg, #f3e5d8 0%, #e6cfb5 100%);
  min-height: 100vh;
  padding: 20px 16px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.game-page {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  position: relative; /* برای دکمه position absolute */
}

/* ==================== دکمه برگشت به منو ==================== */
.back-to-menu {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  padding: 10px 18px 10px 14px;
  text-decoration: none;
  color: #452810;
  font-family: 'Vazirmatn-Bold';
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  z-index: 10;
}

.back-to-menu:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.back-to-menu:active {
  transform: scale(0.95);
}

.back-to-menu svg {
  stroke: #452810;
  flex-shrink: 0;
}

/* ==================== هدر ==================== */
.game-header {
  display: flex;
  justify-content: center;
  margin: 55px 0 20px;
}

.game-title {
  font-family: 'Vazirmatn-Bold', cursive;
  font-size: 36px;
  font-weight: 800;
  color: #452810;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

/* ==================== پیام خوش‌آمد شیشه‌ای ==================== */
.game-welcome-glass {
  margin: 10px 0 35px;
  padding: 8px;
  border-radius: 30px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0.1)
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(69, 40, 16, 0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  animation: welcomeFadeIn 1s ease-out;
}

.game-welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  text-align: center;
  gap: 12px;
}

.game-welcome-icon {
  color: #cf9e76;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.game-welcome-text {
  font-family: 'Vazirmatn-Bold';
  font-size: 17px;
  color: #452810;
  line-height: 1.7;
  text-shadow: 0 1px 3px rgba(255,255,255,0.4);
}

.game-welcome-subtext {
  font-family: 'Vazirmatn-Regular';
  font-size: 13px;
  color: #846f5d;
  opacity: 0.85;
  margin-top: -4px;
  border-top: 1px dashed rgba(69,40,16,0.2);
  padding-top: 12px;
  width: 85%;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== لیست بازی‌ها ==================== */
.games-category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.game-category-item {
  width: 100%;
  border-radius: 30px;
  background-image: linear-gradient(
    45deg,
    #452810,
    #6D4C41,
    #A1887F,
    #cf9e76
  );
  background-size: 300% 300%;
  animation: bgMove 8s ease infinite;
  box-shadow: 0 10px 20px rgba(69, 40, 16, 0.25), 0 0 0 1px rgba(255,255,255,0.2) inset;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.game-category-item:active {
  transform: scale(0.97);
}

.game-link {
  display: block;
  width: 100%;
  padding: 20px 25px;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Vazirmatn-Bold';
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  background: transparent;
  transition: background 0.3s;
}

.game-link:hover {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}

@keyframes bgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==================== واکنشگرایی ==================== */
@media (max-width: 400px) {
  .game-title {
    font-size: 28px;
  }
  .game-link {
    font-size: 18px;
    padding: 16px 18px;
  }
  .game-welcome-text {
    font-size: 15px;
  }
  .back-to-menu {
    padding: 8px 14px;
    font-size: 14px;
    top: 8px;
    left: 8px;
  }
  .back-to-menu svg {
    width: 22px;
    height: 22px;
  }
}