@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* پالت رنگی مدرن */
  --primary: #20478a;
  --primary-dark: #20478a;
  --primary-light: #eff6ff6e;     /* پس‌زمینه آیکون‌ها */
  --bg-body: #f1f5f9;           /* رنگ پس‌زمینه کلی صفحه */
  --bg-card: #ffffff;           /* رنگ کارت‌ها */
  --text-main: #112548;         /* رنگ متن اصلی (Slate-800) */
  --text-muted: #64748b;        /* رنگ متن فرعی */
  --border-color: #e2e8f0;      /* رنگ حاشیه */
  
  /* افکت‌ها */
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: #dae0e261 !important;
  font-family: "Baloo Bhaijaan 2", sans-serif;
  font-size: 16px; /* اصلاح سایز فونت */
  color: var(--text-main);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background-color: #20478a;
  color: white;
}

.main-content {
  flex-grow: 1;
  padding: clamp(0.5rem, 0.031rem + 1.5vw, 1.25rem);
  width: 100%;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

a { text-decoration: none; color: inherit; }

/* --- لی‌اوت اصلی --- */
.main-container {
  display: flex;
}

#sidebar {
  flex-shrink: 0;
  /* تنظیمات سایدبار بسته به محتوای include شده */
}

/* --- سکشن‌های ابزار (Tools) --- */
.tools-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: white;
    border-radius: 20px;
    padding: clamp(0.75rem, 0.438rem + 1vw, 1.25rem);
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    text-align: center;
    flex-direction: column;
}

.section-header h3 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-line {
    height: 2px;
    background: #2e62ba;
    width: 11%;
    border-radius: 10px;
}

/* --- گرید ابزارها --- */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
}

/* --- کارت ابزار مدرن --- */
.tool-card {
  display: block;
  position: relative;
  /* جلوگیری از آبی شدن در موبایل */
  -webkit-tap-highlight-color: transparent; 
}

.card-inner {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  height: 100%;
  min-height: 160px;
  transition: var(--transition);
  cursor: pointer;
}

/* آیکون داخل دایره */
.icon-wrapper {
  width: 60px;
  height: 60px;
  background-color: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-wrapper img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(21%) sepia(34%) saturate(2928%) hue-rotate(198deg) brightness(120%) contrast(89%);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.3s;
}

/* --- افکت‌های هاور کارت --- */
.tool-card:hover .card-inner {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.tool-card:hover .icon-wrapper {
  transform: scale(1.1) rotate(-5deg);
  background-color: #dbeafe; /* کمی تیره‌تر از حالت عادی */
}

.tool-card:hover .card-title {
  color: var(--primary-dark);
}

/* حالت غیرفعال */
.tool-card.disabled {
  pointer-events: none;
  opacity: 0.7;
}
.icon-wrapper.grayscale {
  filter: grayscale(1);
  background-color: #f1f5f9;
}

/* --- بخش بازی‌ها --- */
.games-section {
  background: #1e293b; /* رنگ تیره برای تمایز */
  padding: 20px;
  border-radius: var(--radius-lg);
  color: white;
  background-image: radial-gradient(#334155 1px, transparent 1px);
  background-size: 20px 20px;
  direction: rtl;
}

.games-section .section-header h3 {
  color: #fff;
}
.games-section .header-line {
  background: linear-gradient(90deg, #475569, transparent);
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  font-size: 0.9rem;
}

.game-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  border-radius: 12px;
  font-weight: bold;
  color: white;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.1);
  box-shadow: 0 10px 15px rgba(0,0,0,0.3);
}

/* رنگ‌بندی بازی‌ها */
.card-wordle { background: linear-gradient(135deg, #9f1239, #be123c); }
.card-wordchin { background: linear-gradient(135deg, #15803d, #16a34a); }
.card-sum10 { background: linear-gradient(135deg, #6b21a8, #7e22ce); }
.card-soon { background: #334155; cursor: not-allowed; }

/* --- بنر وبلاگ --- */
.blog-link {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}
.blog-content {
  display: flex;
  align-items: center;
  gap: 20px;
}
.blog-content img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
}
.blog-text h3 {
  color: var(--primary-dark);
  margin-bottom: 5px;
}
.blog-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.arrow-icon {
  font-size: 1.5rem;
  color: var(--primary);
  transform: translateX(0);
  transition: transform 0.3s;
}

.blog-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.blog-link:hover .arrow-icon {
  transform: translateX(-5px);
}

/* --- توضیحات SEO --- */
.seo-description {
  background: white;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-align: right;
  direction: rtl;
}
.seo-description h1 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-align: center;
}
.seo-description p {
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 15px;
}

/* --- ریسپانسیو (موبایل) --- */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .tools-grid {
    grid-template-columns: repeat(2, 1fr); /* دو ستون در موبایل */
    gap: 12px;
  }
  
  .card-inner {
    min-height: 140px;
    padding: 15px 10px;
  }
  
  .icon-wrapper {
    width: 50px;
    height: 50px;
  }
  
  .blog-link {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  .blog-content {
    flex-direction: column;
    gap: 10px;
  }
  .arrow-icon {
    display: none;
  }
}


.tool-section {
    border: 2px solid #e2e8f0;
    padding: 13px;
    border-radius: 20px;
}
h2 {
    font-size: 1.5em;
}

p {
    font-size: 15px;
}

.blog-banner {
    direction: rtl;
    font-size: 14px;
}
























        /* استایل بازی‌ها (سرگرمی) */
        .games-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .game-card {
            padding: 12px;
            border-radius: 18px;
            text-align: center;
            text-decoration: none;
            color: white;
            font-weight: 800;
            background: var(--primary);
            box-shadow: 0 10px 20px rgba(51, 144, 236, 0.2);
        }



:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Light Theme */
    --app-bg: #ebf0f4c7;
    --header-bg: rgba(255, 255, 255, 0.45);
    --nav-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);

    --ink: #0f172a;
    --ink-muted: #64748b;

    --primary: #3390ec;

    --pill-bg: rgba(255, 255, 255, 0.6);
    --search-bg: rgba(255, 255, 255, 0.5);
    --search-active-bg: rgba(255, 255, 255, 0.95);

    --icon-wrapper-bg: rgba(255, 255, 255, 0.65);

    --shadow-color: rgba(0, 0, 0, 0.05);

    --icon-color: #3390ec;
}


/* =========================
   TOOLS GRID
========================= */
.tool-card {
    transition: transform .28s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
}

.tool-card:active {
    transform: scale(.88);
}


.icon-wrapper {
    position: relative;
    width: 65px;
    height: 65px;
    place-items: center;
    border-radius: 20px;
    box-shadow: 0 8px 20px var(--shadow-color);
    border: solid 1px #e2e8f0;
    transition:
        box-shadow .3s ease,
        border-color .3s ease,
        transform .3s ease,
    	border .3s ease;
}


.tool-card:hover .icon-wrapper {
    box-shadow: 0px 0px 10px 2px rgba(51, 144, 236, 0.2);
    background: white;
    border: solid 1px white;
        transition:
        box-shadow .3s ease,
        border-color .3s ease,
        transform .3s ease,
    	border .3s ease;
}

.icon-wrapper i {
    font-size: 32px;
    color: var(--icon-color);
    transition: transform .3s ease;
}

.tool-card:hover .icon-wrapper i {
    transform: scale(1.1) rotate(5deg);
}


/* =========================
   BADGES
========================= */

.item-badge {
    position: absolute;
    top: -6px;
    right: -6px;

    z-index: 5;

    padding: 3px 6px;

    border-radius: 10px;

    color: white;

    font-size: 9px;
    font-weight: 800;
}

.badge-new {
    background: linear-gradient(135deg, #ff872d, #ff0000);
}

.badge-beta {
    background: linear-gradient(135deg, #f25aee, #9752de);
}

.badge-update {
    background: linear-gradient(135deg, #3effa7, #0072ff);
}

.badge-online {
    background:
        linear-gradient(
            135deg,
            #34c759,
            #30b0c7
        );
}
/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
