@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-arabic-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;

}

@font-face {
  font-family: 'Baloo Bhaijaan 2';
  src: url('https://quamtex.ir/fonts/webfonts/baloo-bhaijaan-2-latin-500-normal.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
    --primary: #112548;
    --primary-gradient: linear-gradient(135deg, #112548 0%, #2c4a85 100%);
    --accent: #3b82f6;
    --bg-body: #f1f5f9;
    --card-bg: #ffffff;
    --border-light: #e2e8f0;
    --text-main: #1e293b;
    --success: #10b981;
}

body {
    margin: 0;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
}

.main-container {
  display: flex;
  flex-direction: row;
}

.main-content {
  padding: clamp(0.2rem, 2vw, 2rem);
  margin: clamp(0.5rem, 1.5vw, 1.5rem);
  background-color: #ffffff;
  border-radius: 24px;
  font-size: clamp(0.938rem, 0.842rem + 0.426vw, 1.188rem);
  text-align: center;
  /* مدرن‌سازی سایه کانتینر اصلی */
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--primary);
  width: 100%;
  direction: rtl;
}

/* Layout Grid */
.game-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  margin-top: 20px;
  margin: 20px 0;
  border-radius: 20px;
  /* حذف سایه سیاه و جایگزینی با افکت کارت مدرن */
  background: #ffffff;
  border: 2px solid var(--border-light);
  padding: clamp(0.8rem, 0.5vw, 1.6rem);
  width: 100%;
  box-sizing:
}

@media (max-width: 768px) {
    .game-layout { grid-template-columns: 1fr; }
    .game-info-panel { order: -1; }
}

/* Game Board */
#game {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 20px;
    border: 2px solid var(--border-light);
}

.cell {
    aspect-ratio: 1;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.cell:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.cell.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(0.95);
}

.cell.empty {
    background: #f1f5f9;
    border: 2px dashed var(--border-light);
    color: transparent;
    cursor: default;
}

/* Info Panel & Cards */
.game-info-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

/* Buttons */
.pop {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.pop:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(17, 37, 72, 0.2);
}

/* Notification & Progress */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none;
    font-size: large;
    text-align: center;
    direction: rtl;
}

.notification.show { display: block; animation: slideDown 0.4s ease; }

@keyframes slideDown {
    from { transform: translate(-50%, -100%); }
    to { transform: translate(-50%, 0); }
}

.description {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 20px;
  margin-bottom: 16px;
  /* سایه نرم‌تر */
  text-align: right;
  font-size: clamp(0.875rem, 0.731rem + 0.638vw, 1.25rem);
  border: 2px solid var(--border-light);
}














/* نگهدارنده اصلی برای مدیریت موقعیت‌ها */
.game-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden; /* جلوگیری از بیرون زدن بلور */
}

/* افکت تار شدن صفحه بازی */
#game.blurred {
    filter: blur(10px) grayscale(50%);
    pointer-events: none; /* جلوگیری از کلیک وقتی تار است */
    transform: scale(0.98);
}

#game {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* لایه رویی (Overlay) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.3); /* کمی سفید برای کنتراست */
    z-index: 10;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* دکمه شروع اختصاصی */
.start-button {
    background: #112548;
    color: white;
    font-size: 1.5rem;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(17, 37, 72, 0.4);
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(17, 37, 72, 0.5);
    background: #1e3a6e;
}

/* رنگ‌بندی نوتیفیکیشن‌ها */
.notification.win {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.notification.lose {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* انیمیشن لرزش برای انتخاب اشتباه */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
    border-color: #ef4444 !important; /* قرمز شدن مرز */
}





/* --- ریسپانسیو سازی برای موبایل و تبلت (زیر 850 پیکسل) --- */
@media (max-width: 850px) {

    /* 1. تغییر چیدمان کلی */
    .game-layout {
        grid-template-columns: 1fr; /* تبدیل به یک ستون */
        gap: 15px;
    }

    /* 2. پنل اطلاعات (امتیاز و تایمر) برود بالا */
    .game-info-panel {
        order: -1; /* اولویت نمایش بالاتر از بازی */
        display: grid;
        grid-template-columns: 1fr 1fr auto; /* چیدمان افقی: امتیاز | تایمر | دکمه */
        gap: 10px;
        align-items: center;
    }

    /* 3. کارت‌های آمار کوچک‌تر شوند */
    .stat-card {
        padding: 10px;
        border-radius: 12px;
    }

    .stat-label {
        font-size: 0.7rem;
        margin-bottom: 0;
    }

    .stat-value {
        font-size: 1.2rem; /* فونت عدد کوچک‌تر */
    }

    /* 4. دکمه شروع مجدد جمع‌وجور شود */
    .pop {
        padding: 10px;
        font-size: 0.9rem;
        height: 100%; /* هم‌ارتفاع با کارت‌ها */
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap; /* متن دکمه نشکند */
    }

    /* 5. تنظیمات صفحه بازی (گرید) */
    #game {
        gap: 6px; /* فاصله بین خانه‌ها کمتر شود */
        padding: 10px;
    }

    .cell {
        font-size: 1.2rem; /* عدد داخل خانه کوچک‌تر */
        border-radius: 8px; /* گردی گوشه‌ها کمتر */
    }
}

/* --- تنظیمات مخصوص موبایل‌های خیلی کوچک (زیر 400 پیکسل) --- */
@media (max-width: 400px) {
    .main-content {
        padding: 15px; /* پدینگ کلی کمتر */
        margin: 10px;
    }
    
    .game-info-panel {
        grid-template-columns: 1fr 1fr; /* دکمه برود سطر بعدی */
    }
    
    .pop {
        grid-column: span 2; /* دکمه کل عرض را بگیرد */
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
}

/* --- بهبود لمس در موبایل --- */
.cell {
    /* جلوگیری از زوم شدن ناخواسته با دابل کلیک */
    touch-action: manipulation; 
}

.notification {
    width: 80%; /* نوتیفیکیشن در موبایل کل عرض را نگیرد اما بزرگ باشد */
    text-align: center;
}







.description h3 {
    font-size: 1.2rem;
    color: #444; /* یا رنگ اصلی تم سایت */
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.description ul {
    list-style-type: none; /* حذف بولت‌های پیش‌فرض */
    padding-right: 0;
}

.description li {
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border-right: 4px solid #4CAF50; /* خط رنگی کنار آیتم‌ها */
    font-size: 0.95rem;
    line-height: 1.6;
}

.game-rules-list li:nth-child(2) {
    border-right-color: #2196F3; /* رنگ متفاوت برای قانون دوم */
}










/* اضافه کردن این کد به فایل sum10.css */
#random-pages {
    min-height: 150px; /* این عدد را بر اساس ارتفاع تقریبی بخش صفحات پیشنهادی تنظیم کنید */
    display: block;
    contain: layout; /* به مرورگر کمک می‌کند تا محدوده المان را بشناسد */
}

#wee {
    margin-top: 0; /* جلوگیری از پرش به دلیل مارجین‌های پیش‌فرض */
}