/* =========================================
   کافه موج - استایل اصلی (Animated + Responsive + PWA)
   ========================================= */

/* ========== متغیرهای رنگی ========== */
:root {
    --primary-color: #083c20;
    --secondary-color: #f3d9ac;
    --text-dark: #083c20;
    --text-light: #f3d9ac;
    --bg-light: #f3d9ac;
    --bg-white: #ffffff;
    --bg-dark: #083c20;
    --border-color: rgba(8, 60, 32, 0.15);
    --font-family: 'Vazirmatn', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(8, 60, 32, 0.08);
    --shadow-md: 0 5px 20px rgba(8, 60, 32, 0.12);
    --shadow-lg: 0 15px 40px rgba(8, 60, 32, 0.18);
    --danger-color: #dc3545;
    --success-color: #28a745;
    --info-color: #1e6fb8;
    --warning-color: #c9770e;
    
    /* Fluid spacing */
    --container-padding: clamp(1rem, 4vw, 1.5rem);
    --section-spacing: clamp(2rem, 6vw, 4rem);
}

/* ========== ریست پایه ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.menu-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: var(--font-family);
    cursor: pointer;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* =========================================
   هدر (Header) - با منوی همبرگری
   ========================================= */
.main-header {
    background-color: var(--primary-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.main-header.scrolled {
    padding: 8px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    position: relative;
}

/* ========== منوی همبرگری ========== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: rgba(243, 217, 172, 0.1);
    border: 1px solid rgba(243, 217, 172, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1100;
    flex-shrink: 0;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(243, 217, 172, 0.2);
    outline: none;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== Overlay موبایل ========== */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 60, 32, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
}

/* ========== نوار جستجو ========== */
.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-white);
    border-radius: 25px;
    padding: 5px 15px;
    width: clamp(180px, 22vw, 260px);
    transition: var(--transition);
    flex-shrink: 0;
}

.search-box:focus-within {
    box-shadow: 0 0 0 3px rgba(243, 217, 172, 0.5);
    transform: scale(1.02);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: var(--font-family);
    color: var(--text-dark);
    padding: 6px;
    font-size: 0.9rem;
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1rem;
    padding: 5px;
    transition: var(--transition);
}

.search-box button:hover {
    transform: scale(1.15);
}

/* ========== لوگو ========== */
.site-logo {
    text-align: center;
    flex-shrink: 0;
}

.site-logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-light);
}

.logo-img {
    height: clamp(38px, 4vw, 50px);
    width: auto;
    transition: var(--transition);
}

.site-logo a:hover .logo-img {
    transform: rotate(-8deg) scale(1.08);
}

.logo-text h1 {
    font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-light);
    line-height: 1.2;
}

.logo-text span {
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    opacity: 0.8;
    display: block;
    margin-top: -3px;
    color: var(--text-light);
    white-space: nowrap;
}

/* ========== منوی ناوبری ========== */
.main-nav ul {
    display: flex;
    gap: clamp(12px, 1.8vw, 25px);
}

.main-nav a {
    color: var(--text-light);
    font-weight: 500;
    font-size: clamp(0.85rem, 1vw, 1rem);
    position: relative;
    padding: 8px 4px;
    white-space: nowrap;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a.active {
    color: #fff;
    font-weight: 700;
}

/* =========================================
   محتوای اصلی
   ========================================= */
.main-content {
    flex-grow: 1;
}

/* =========================================
   انیمیشن‌های ورود اسکرول
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* =========================================
   اسلایدر بنر (Hero Slider)
   ========================================= */
.hero-slider {
    position: relative;
    width: 100%;
    height: clamp(320px, 55vh, 550px);
    overflow: hidden;
    background-color: var(--primary-color);
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
    animation: kenBurns 8s ease-in-out;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 60, 32, 0.6) 0%, rgba(8, 60, 32, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-light);
    padding: 0 20px;
    animation: fadeInUp 1s ease 0.3s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content h2 {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    margin-bottom: clamp(8px, 1.5vw, 15px);
    font-weight: 900;
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.4);
    line-height: 1.3;
}

.hero-content p {
    font-size: clamp(0.95rem, 1.6vw, 1.3rem);
    opacity: 0.95;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.4);
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(243, 217, 172, 0.85);
    color: var(--primary-color);
    border: none;
    width: clamp(38px, 4vw, 50px);
    height: clamp(38px, 4vw, 50px);
    border-radius: 50%;
    cursor: pointer;
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.slider-prev:hover,
.slider-next:hover {
    background: var(--text-light);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.slider-prev { right: clamp(10px, 2vw, 20px); }
.slider-next { left: clamp(10px, 2vw, 20px); }

.slider-dots {
    position: absolute;
    bottom: clamp(15px, 2vw, 25px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(243, 217, 172, 0.5);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.slider-dot:hover {
    background: rgba(243, 217, 172, 0.8);
    transform: scale(1.2);
}

.slider-dot.active {
    background: var(--text-light);
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(243, 217, 172, 0.8);
}

/* =========================================
   هدر صفحات داخلی (Page Header)
   ========================================= */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a4d29 100%);
    color: var(--text-light);
    padding: clamp(40px, 7vw, 80px) 0;
    text-align: center;
    margin-bottom: var(--section-spacing);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(243, 217, 172, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

.page-header h1 {
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    margin-bottom: 10px;
    font-weight: 900;
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

/* =========================================
   بخش دسته‌بندی‌ها (Categories)
   ========================================= */
.categories-section {
    margin: var(--section-spacing) 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: clamp(12px, 2vw, 20px);
}

.category-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: clamp(18px, 2.5vw, 28px) 15px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-card i {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
    transition: var(--transition);
}

.category-card:hover i {
    transform: scale(1.15) rotate(-8deg);
    color: #0a4d29;
}

.category-card h3 {
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.category-card p {
    font-size: clamp(0.78rem, 1vw, 0.85rem);
    color: var(--text-dark);
    opacity: 0.7;
    line-height: 1.5;
}

/* =========================================
   بخش محصولات (Products)
   ========================================= */
.section-title {
    text-align: center;
    margin: clamp(35px, 5vw, 60px) 0 clamp(20px, 3vw, 35px);
    position: relative;
    color: var(--primary-color);
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    font-weight: 900;
    padding: 0 10px;
}

.section-title::before,
.section-title::after {
    content: '◆';
    margin: 0 12px;
    color: var(--primary-color);
    opacity: 0.5;
    font-size: clamp(0.7rem, 1vw, 1rem);
    display: inline-block;
    animation: rotateDiamond 4s linear infinite;
}

@keyframes rotateDiamond {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: clamp(15px, 2.5vw, 25px);
}

.product-card {
    background: var(--bg-white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 60%, rgba(243, 217, 172, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.product-card:hover::after {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: clamp(170px, 22vw, 220px);
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-info {
    padding: clamp(15px, 2vw, 22px);
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: var(--bg-white);
}

.product-info h3 {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.product-info p {
    font-size: clamp(0.82rem, 1.1vw, 0.92rem);
    color: var(--text-dark);
    opacity: 0.75;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.6;
}

.product-price {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 8px 22px;
    border-radius: 25px;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    margin-top: auto;
    align-self: center;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(8, 60, 32, 0.2);
}

.product-card:hover .product-price {
    background-color: #0a4d29;
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(8, 60, 32, 0.35);
}

/* =========================================
   کوییز بنر (Quiz Banner)
   ========================================= */
.quiz-banner {
    background: linear-gradient(135deg, var(--bg-white) 0%, #fef9f0 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 22px;
    padding: clamp(20px, 4vw, 35px);
    margin: var(--section-spacing) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(15px, 3vw, 30px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.quiz-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(243, 217, 172, 0.3) 0%, transparent 60%);
    animation: rotateBg 25s linear infinite;
    pointer-events: none;
}

.quiz-banner:hover {
    box-shadow: var(--shadow-md);
    border-color: #0a4d29;
}

.quiz-banner-content {
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.quiz-banner-content h3 {
    font-size: clamp(1.05rem, 2vw, 1.5rem);
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 900;
}

.quiz-banner-content p {
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    color: var(--text-dark);
    opacity: 0.8;
    margin-bottom: 20px;
    line-height: 1.7;
}

.quiz-banner-icon {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--primary-color);
    opacity: 0.25;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.quiz-banner:hover .quiz-banner-icon {
    opacity: 0.5;
    transform: scale(1.1) rotate(-10deg);
}

/* =========================================
   صفحه درباره ما (About)
   ========================================= */
.about-content {
    padding: 20px 0 var(--section-spacing);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(25px, 5vw, 55px);
    align-items: center;
}

.about-text h2 {
    font-size: clamp(1.4rem, 2.8vw, 1.9rem);
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 900;
}

.about-text p {
    margin-bottom: 15px;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.9;
    opacity: 0.9;
}

.about-image img {
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-slow);
}

.about-image:hover img {
    transform: scale(1.03) rotate(1deg);
}

.features-section {
    padding: 30px 0 var(--section-spacing);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: clamp(15px, 2.5vw, 25px);
    margin-top: 30px;
}

.feature-card {
    background: var(--bg-white);
    padding: clamp(22px, 3vw, 32px) clamp(15px, 2vw, 22px);
    border-radius: 18px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: clamp(2rem, 3.5vw, 2.7rem);
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: var(--transition);
    display: inline-block;
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(8deg);
}

.feature-card h3 {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 700;
}

.feature-card p {
    font-size: clamp(0.82rem, 1.1vw, 0.92rem);
    opacity: 0.8;
    line-height: 1.6;
}

/* =========================================
   صفحه منو (Menu)
   ========================================= */
.menu-section {
    padding: 20px 0 var(--section-spacing);
}

.menu-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: clamp(25px, 4vw, 45px);
    padding: 0 5px;
}

.menu-tab {
    padding: clamp(8px, 1vw, 11px) clamp(16px, 2.5vw, 26px);
    border-radius: 25px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.menu-tab::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s ease;
    z-index: -1;
}

.menu-tab:hover::before,
.menu-tab.active::before {
    transform: scaleX(1);
}

.menu-tab:hover,
.menu-tab.active {
    color: var(--text-light);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(8, 60, 32, 0.25);
}

/* ========== نوار جستجوی منو ========== */
.menu-search-bar {
    max-width: 600px;
    margin: 0 auto clamp(25px, 4vw, 45px);
    padding: 0 5px;
}

.menu-search-bar .search-form {
    display: flex;
    background: var(--bg-white);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.menu-search-bar .search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 8px 28px rgba(8, 60, 32, 0.18);
    transform: translateY(-2px);
}

.menu-search-bar .search-form input {
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: clamp(0.88rem, 1.1vw, 1rem);
    color: var(--text-dark);
    padding: 10px;
    min-width: 0;
}

.menu-search-bar .search-form button {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    width: clamp(40px, 4.5vw, 48px);
    height: clamp(40px, 4.5vw, 48px);
    border-radius: 50%;
    cursor: pointer;
    font-size: clamp(0.85rem, 1vw, 1rem);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-search-bar .search-form button:hover {
    background-color: #0a4d29;
    transform: scale(1.1) rotate(15deg);
}

/* ========== حالت خالی ========== */
.empty-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: clamp(40px, 6vw, 70px) 20px;
    background: var(--bg-white);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
    border: 2px dashed var(--border-color);
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.empty-products i {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--primary-color);
    opacity: 0.25;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-products h3 {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--primary-color);
    margin-bottom: 10px;
}

.empty-products p {
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    opacity: 0.7;
    margin-bottom: 25px;
}

/* =========================================
   صفحه‌بندی (Pagination)
   ========================================= */
.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: clamp(30px, 5vw, 55px);
    gap: 15px;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(4px, 0.8vw, 8px);
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.pagination li { display: inline-block; }

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: clamp(36px, 4vw, 45px);
    height: clamp(36px, 4vw, 45px);
    padding: 0 clamp(10px, 1.2vw, 15px);
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-weight: 700;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.page-link:hover:not(.disabled):not(.active):not(.dots) {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(8, 60, 32, 0.25);
}

.page-link.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
    cursor: default;
    box-shadow: 0 6px 18px rgba(8, 60, 32, 0.25);
}

.page-link.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.page-link.dots {
    background: transparent;
    border: none;
    cursor: default;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 20px;
    padding: 0 4px;
}

.page-link i { font-size: 0.75rem; }

.pagination-info {
    font-size: clamp(0.78rem, 1vw, 0.9rem);
    color: var(--text-dark);
    opacity: 0.7;
    margin: 0;
    text-align: center;
    padding: 0 10px;
}

/* =========================================
   صفحه تماس با ما (Contact)
   ========================================= */
.contact-section {
    padding: 20px 0 var(--section-spacing);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(25px, 4vw, 55px);
}

.contact-form-container {
    background: var(--bg-white);
    padding: clamp(20px, 4vw, 42px);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.contact-form-container:hover {
    box-shadow: var(--shadow-lg);
}

.contact-form-container h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    font-weight: 900;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: clamp(0.83rem, 1vw, 0.92rem);
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: clamp(11px, 1.3vw, 14px) clamp(12px, 1.5vw, 16px);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: var(--font-family);
    background: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
    font-size: clamp(0.88rem, 1.05vw, 0.98rem);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(8, 60, 32, 0.1);
    background: #fff;
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info-container {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a4d29 100%);
    padding: clamp(20px, 4vw, 42px);
    border-radius: 22px;
    color: var(--text-light);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.contact-info-container::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(243, 217, 172, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 5s ease-in-out infinite;
}

.contact-info-container h2 {
    margin-bottom: 25px;
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    font-weight: 900;
    position: relative;
    z-index: 1;
}

.contact-info-list {
    position: relative;
    z-index: 1;
}

.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    transition: var(--transition);
}

.contact-info-list li:hover {
    transform: translateX(-5px);
}

.contact-info-list i {
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    margin-top: 5px;
    color: var(--secondary-color);
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-info-list li:hover i {
    transform: scale(1.15);
}

.contact-info-list div h4 {
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    margin-bottom: 5px;
    font-weight: 700;
}

.contact-info-list div p {
    font-size: clamp(0.82rem, 1vw, 0.92rem);
    opacity: 0.9;
    line-height: 1.6;
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.05vw, 0.95rem);
    animation: slideDown 0.4s ease;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =========================================
   صفحه سودوکو
   ========================================= */
.sudoku-section {
    padding: 20px 0 var(--section-spacing);
}

.sudoku-game-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(8px, 1.5vw, 15px);
    max-width: 850px;
    margin: 0 auto clamp(15px, 2.5vw, 25px);
    padding: 0 5px;
}

.game-info-item {
    background: var(--bg-white);
    padding: clamp(10px, 1.6vw, 16px);
    border-radius: 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: var(--transition);
}

.game-info-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.game-info-item i {
    font-size: clamp(0.95rem, 1.3vw, 1.2rem);
    color: var(--primary-color);
    margin-bottom: 4px;
}

.game-info-item span {
    font-size: clamp(0.7rem, 0.9vw, 0.82rem);
    opacity: 0.7;
}

.game-info-item strong {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--primary-color);
    font-weight: 700;
}

.sudoku-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(10px, 1.5vw, 15px);
    max-width: 850px;
    margin: 0 auto clamp(15px, 2.5vw, 25px);
    padding: clamp(12px, 2vw, 18px) clamp(14px, 2.2vw, 22px);
    background: var(--bg-white);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 10px);
    flex-wrap: wrap;
}

.difficulty-selector > span {
    font-size: clamp(0.82rem, 1vw, 0.92rem);
    font-weight: 700;
    color: var(--primary-color);
}

.diff-btn {
    padding: clamp(6px, 0.9vw, 9px) clamp(12px, 1.8vw, 19px);
    border-radius: 22px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: clamp(0.75rem, 0.95vw, 0.88rem);
    transition: var(--transition);
}

.diff-btn:hover {
    background: rgba(8, 60, 32, 0.06);
    transform: translateY(-2px);
}

.diff-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(8, 60, 32, 0.3);
}

.game-actions {
    display: flex;
    gap: clamp(6px, 1vw, 10px);
    flex-wrap: wrap;
}

.game-actions .btn {
    padding: clamp(7px, 1vw, 10px) clamp(14px, 1.8vw, 19px);
    font-size: clamp(0.75rem, 0.95vw, 0.88rem);
    border-radius: 22px;
}

.sudoku-board-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    width: 100%;
    max-width: 500px;
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background-color: var(--primary-color);
    animation: fadeIn 0.6s ease;
}

.sudoku-cell {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-family: var(--font-family);
    font-weight: 700;
    border: 1px solid rgba(8, 60, 32, 0.15);
    background-color: var(--bg-white);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
    padding: 0;
    cursor: text;
    -webkit-appearance: none;
    border-radius: 0;
}

.sudoku-cell:focus {
    background-color: rgba(243, 217, 172, 0.6);
    border-color: var(--primary-color);
    z-index: 2;
    transform: scale(1.05);
}

.sudoku-cell.fixed {
    background-color: rgba(8, 60, 32, 0.08);
    color: var(--primary-color);
    cursor: not-allowed;
    font-weight: 900;
}

.sudoku-cell.editable { color: #1e6fb8; }

.sudoku-cell.hinted {
    background-color: rgba(40, 167, 69, 0.15);
    color: #155724;
    animation: hintPulse 1.5s ease;
}

@keyframes hintPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.sudoku-cell.invalid {
    background-color: rgba(220, 53, 69, 0.15);
    color: var(--danger-color);
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.sudoku-cell:nth-child(3n):not(:nth-child(9n)) {
    border-left: 3px solid var(--primary-color);
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid var(--primary-color);
}

.sudoku-message {
    text-align: center;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    min-height: 30px;
    color: var(--primary-color);
    margin: 20px 0;
    padding: 10px;
    border-radius: 10px;
    transition: var(--transition);
}

.sudoku-message.info {
    background-color: rgba(30, 111, 184, 0.1);
    color: var(--info-color);
}

.sudoku-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.sudoku-message.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

/* ========== مودال برد ========== */
.win-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 60, 32, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.win-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.win-modal {
    background: var(--bg-white);
    border-radius: 25px;
    padding: clamp(25px, 4vw, 40px) clamp(20px, 3vw, 30px);
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(30px) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px solid var(--secondary-color);
    max-height: 90vh;
    overflow-y: auto;
}

.win-modal-overlay.show .win-modal {
    transform: translateY(0) scale(1);
}

.win-icon {
    width: clamp(65px, 10vw, 90px);
    height: clamp(65px, 10vw, 90px);
    background: linear-gradient(135deg, var(--secondary-color), #e8cfa0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--primary-color);
    animation: trophyBounce 1s ease;
    box-shadow: 0 10px 25px rgba(243, 217, 172, 0.5);
}

@keyframes trophyBounce {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.15) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.win-modal h2 {
    color: var(--primary-color);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    margin-bottom: 10px;
}

.win-modal > p {
    color: var(--text-dark);
    opacity: 0.75;
    margin-bottom: 25px;
    font-size: clamp(0.85rem, 1.1vw, 0.95rem);
}

.win-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.win-stat {
    background: rgba(8, 60, 32, 0.05);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.win-stat span {
    display: block;
    font-size: clamp(0.72rem, 0.9vw, 0.82rem);
    opacity: 0.7;
    margin-bottom: 5px;
}

.win-stat strong {
    color: var(--primary-color);
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}

.win-stat.final-score {
    grid-column: 1 / -1;
    background: var(--primary-color);
}

.win-stat.final-score span {
    color: var(--text-light);
    opacity: 0.9;
}

.win-stat.final-score strong {
    color: var(--text-light);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.new-record {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #7a5c00;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: clamp(0.82rem, 1vw, 0.95rem);
    animation: recordGlow 1.5s ease infinite alternate;
}

@keyframes recordGlow {
    from { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
    to { box-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
}

.win-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.win-actions .btn {
    flex: 1;
    min-width: 130px;
}

/* ========== راهنمای سودوکو ========== */
.sudoku-help {
    max-width: 700px;
    margin: clamp(30px, 5vw, 55px) auto 0;
    background: var(--bg-white);
    padding: clamp(20px, 3vw, 30px);
    border-radius: 18px;
    border-right: 5px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.sudoku-help:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.sudoku-help h3 {
    color: var(--primary-color);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sudoku-help ul {
    padding-right: 20px;
    list-style: none;
}

.sudoku-help li {
    position: relative;
    padding-right: 20px;
    margin-bottom: 10px;
    font-size: clamp(0.82rem, 1.05vw, 0.92rem);
    line-height: 1.7;
    color: var(--text-dark);
    opacity: 0.85;
    transition: var(--transition);
}

.sudoku-help li:hover {
    opacity: 1;
    padding-right: 25px;
}

.sudoku-help li::before {
    content: '◆';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--primary-color);
    font-size: 0.7rem;
    opacity: 0.6;
}

.sudoku-help strong { color: var(--primary-color); }

/* =========================================
   صفحه رکوردها (Records)
   ========================================= */
.records-section {
    padding: 20px 0 var(--section-spacing);
}

.top-players-block {
    margin-bottom: clamp(40px, 6vw, 70px);
}

.top-players-block .section-title {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    margin: clamp(30px, 4vw, 45px) 0 clamp(20px, 3vw, 30px);
}

.top-players-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(12px, 2.5vw, 25px);
    align-items: end;
    max-width: 900px;
    margin: 0 auto;
}

.top-player-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: clamp(20px, 3vw, 32px) clamp(12px, 1.8vw, 20px);
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.top-player-card:nth-child(1) { animation-delay: 0.2s; }
.top-player-card:nth-child(2) { animation-delay: 0s; }
.top-player-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes popIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.top-player-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.top-player-card.rank-gold {
    background: linear-gradient(180deg, #fffbeb 0%, #fff8dc 100%);
    border-color: #ffd700;
    padding-top: clamp(35px, 5vw, 55px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.3);
}

.top-player-card.rank-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 100%;
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.crown-icon {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    color: #ffd700;
    animation: crownFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(255, 215, 0, 0.6));
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

.top-player-card.rank-silver {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #c0c0c0;
}

.top-player-card.rank-silver::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #a8a8a8, #e8e8e8, #a8a8a8);
}

.top-player-card.rank-bronze {
    background: linear-gradient(180deg, #fdf6f0 0%, #f5e6d3 100%);
    border-color: #cd7f32;
}

.top-player-card.rank-bronze::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #a0522d, #cd7f32, #a0522d);
}

.player-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: clamp(40px, 5vw, 52px);
    height: clamp(40px, 5vw, 52px);
    border-radius: 50%;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.2vw, 1.15rem);
    margin-bottom: 12px;
    color: #fff;
    transition: var(--transition);
}

.top-player-card:hover .player-rank-badge {
    transform: scale(1.1) rotate(-10deg);
}

.rank-gold .player-rank-badge {
    background: linear-gradient(135deg, #ffd700, #f0b400);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
    color: #7a5c00;
}

.rank-silver .player-rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    box-shadow: 0 5px 15px rgba(192, 192, 192, 0.5);
    color: #4a4a4a;
}

.rank-bronze .player-rank-badge {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    box-shadow: 0 5px 15px rgba(205, 127, 50, 0.5);
}

.player-avatar {
    width: clamp(50px, 7vw, 72px);
    height: clamp(50px, 7vw, 72px);
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    color: var(--text-light);
    box-shadow: 0 8px 20px rgba(8, 60, 32, 0.2);
    transition: var(--transition);
}

.top-player-card:hover .player-avatar {
    transform: scale(1.08);
}

.rank-gold .player-avatar {
    background: linear-gradient(135deg, #ffd700, #f0b400);
    color: #7a5c00;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.rank-silver .player-avatar {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    color: #fff;
    border: 3px solid #fff;
}

.rank-bronze .player-avatar {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
    border: 3px solid #fff;
}

.player-name {
    font-size: clamp(0.9rem, 1.4vw, 1.2rem);
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-score {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.player-score span {
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    font-weight: 400;
    opacity: 0.6;
}

.rank-gold .player-score {
    color: #b8860b;
    font-size: clamp(1.4rem, 2.3vw, 1.9rem);
}

.player-time {
    font-size: clamp(0.78rem, 1vw, 0.9rem);
    opacity: 0.7;
    color: var(--text-dark);
}

.player-time i {
    margin-left: 3px;
    color: var(--primary-color);
}

.leaderboard-block {
    background: var(--bg-white);
    border-radius: 22px;
    padding: clamp(20px, 3vw, 35px);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--section-spacing);
}

.leaderboard-block .section-title {
    margin-top: 0;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.records-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(6px, 1vw, 10px);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.records-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: clamp(7px, 1vw, 10px) clamp(13px, 1.8vw, 21px);
    border-radius: 25px;
    background: var(--bg-light);
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(0.75rem, 0.95vw, 0.88rem);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.records-filter-btn:hover {
    background: rgba(8, 60, 32, 0.1);
    transform: translateY(-2px);
}

.records-filter-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(8, 60, 32, 0.3);
}

.records-filter-btn i {
    font-size: 0.9rem;
}

.records-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.records-table th,
.records-table td {
    padding: clamp(10px, 1.2vw, 15px) clamp(8px, 1vw, 15px);
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    font-size: clamp(0.8rem, 1vw, 0.92rem);
    vertical-align: middle;
}

.records-table th {
    background-color: rgba(8, 60, 32, 0.05);
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    position: sticky;
    top: 0;
    z-index: 1;
}

.records-table tbody tr {
    transition: var(--transition);
}

.records-table tbody tr:hover {
    background-color: rgba(243, 217, 172, 0.3);
    transform: scale(1.005);
}

.records-table tr.row-gold {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
}

.records-table tr.row-silver {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent);
}

.records-table tr.row-bronze {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.rank-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: clamp(0.85rem, 1vw, 1rem);
}

.rank-number {
    min-width: 24px;
    text-align: center;
    color: var(--primary-color);
}

.rank-icon { font-size: 0.85rem; }

.row-gold .rank-icon { color: #ffd700; }
.row-silver .rank-icon { color: #a8a8a8; }
.row-bronze .rank-icon { color: #cd7f32; }

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: clamp(0.7rem, 0.85vw, 0.78rem);
    font-weight: 700;
    white-space: nowrap;
}

.difficulty-badge.diff-easy {
    background: #d4edda;
    color: #155724;
}

.difficulty-badge.diff-medium {
    background: #fff3cd;
    color: #856404;
}

.difficulty-badge.diff-hard {
    background: #f8d7da;
    color: #721c24;
}

.score-value {
    color: var(--primary-color);
    font-size: clamp(0.9rem, 1.15vw, 1.05rem);
    font-weight: 700;
}

.records-empty {
    text-align: center;
    padding: clamp(40px, 6vw, 70px) 20px;
}

.records-empty i {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--primary-color);
    opacity: 0.2;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.records-empty h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.records-empty p {
    opacity: 0.7;
    font-size: clamp(0.85rem, 1.1vw, 0.95rem);
}

.play-invite {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a4d29 100%);
    color: var(--text-light);
    border-radius: 22px;
    padding: clamp(20px, 3.5vw, 40px) clamp(20px, 3vw, 35px);
    display: flex;
    align-items: center;
    gap: clamp(15px, 2.5vw, 25px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.play-invite::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(243, 217, 172, 0.12) 0%, transparent 70%);
    animation: rotateBg 20s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.play-invite-icon {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    background: rgba(243, 217, 172, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--text-light);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.play-invite:hover .play-invite-icon {
    transform: rotate(-15deg) scale(1.1);
    background: rgba(243, 217, 172, 0.3);
}

.play-invite-content {
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.play-invite-content h3 {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 700;
}

.play-invite-content p {
    font-size: clamp(0.82rem, 1.1vw, 0.95rem);
    opacity: 0.85;
    margin: 0;
}

.play-invite .btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 12px 25px;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.play-invite .btn-primary:hover {
    background: #fff;
    color: var(--primary-color);
    transform: scale(1.08);
}

/* =========================================
   فوتر (Footer)
   ========================================= */
.main-footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding-top: var(--section-spacing);
    margin-top: var(--section-spacing);
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 4s ease infinite;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(25px, 3vw, 35px);
    padding-bottom: 40px;
}

.footer-col h3 {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: var(--text-light);
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--text-light);
    opacity: 0.5;
    transition: width 0.4s ease;
}

.footer-col:hover h3::after {
    width: 70px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background-color: rgba(243, 217, 172, 0.1);
    border-radius: 50%;
    font-size: 1.15rem;
    color: var(--text-light);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
    transform: translateY(-4px) rotate(-8deg);
    box-shadow: 0 8px 20px rgba(243, 217, 172, 0.3);
}

.social-desc {
    font-size: clamp(0.78rem, 1vw, 0.88rem);
    opacity: 0.7;
}

.footer-links li {
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-links a {
    opacity: 0.8;
    font-size: clamp(0.85rem, 1.05vw, 0.95rem);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a::before {
    content: '◆';
    font-size: 0.55rem;
    opacity: 0;
    transition: var(--transition);
    transform: translateX(5px);
}

.footer-links a:hover {
    opacity: 1;
    color: #fff;
    padding-right: 6px;
}

.footer-links a:hover::before {
    opacity: 0.7;
    transform: translateX(0);
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    font-size: clamp(0.82rem, 1vw, 0.95rem);
    opacity: 0.9;
    color: var(--text-light);
    transition: var(--transition);
}

.contact-info li:hover {
    transform: translateX(-5px);
    opacity: 1;
}

.contact-info i {
    margin-top: 5px;
    color: var(--text-light);
    flex-shrink: 0;
    transition: var(--transition);
}

.contact-info li:hover i {
    color: var(--secondary-color);
    transform: scale(1.15);
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    text-align: center;
    font-size: clamp(0.78rem, 1vw, 0.9rem);
    opacity: 0.8;
    color: var(--text-light);
}

/* =========================================
   دکمه‌ها
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: clamp(10px, 1.2vw, 13px) clamp(20px, 2.5vw, 28px);
    border-radius: 25px;
    font-family: var(--font-family);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
    font-size: clamp(0.85rem, 1.05vw, 0.98rem);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #0a4d29;
    color: #fff;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 25px rgba(8, 60, 32, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: #e8cfa0;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 25px rgba(243, 217, 172, 0.4);
}

/* =========================================
   انیمیشن‌های عمومی
   ========================================= */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s ease infinite;
}

/* =========================================
   دکمه نصب PWA
   ========================================= */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary-color), #0a4d29);
    color: var(--text-light);
    border: none;
    padding: 12px 22px;
    border-radius: 50px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(8, 60, 32, 0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInLeft 0.5s ease, pulseSoft 2s ease-in-out infinite 0.5s;
    transition: var(--transition);
}

.pwa-install-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(8, 60, 32, 0.5);
}

.pwa-install-btn:active {
    transform: translateY(0) scale(0.98);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseSoft {
    0%, 100% { box-shadow: 0 10px 25px rgba(8, 60, 32, 0.35); }
    50% { box-shadow: 0 10px 30px rgba(8, 60, 32, 0.55); }
}

/* مخفی کردن در حالت standalone (وقتی نصب شده) */
.pwa-standalone .pwa-install-btn {
    display: none !important;
}

/* =========================================
   RTL و accessibility
   ========================================= */
::selection {
    background-color: var(--primary-color);
    color: var(--text-light);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a4d29;
}

/* =========================================
   ریسپانسیو - Breakpoints
   ========================================= */

/* تبلت بزرگ و دسکتاپ کوچک */
@media (max-width: 1024px) {
    .top-players-grid {
        gap: 15px;
    }
}

/* تبلت */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(85vw, 340px);
        height: 100vh;
        background: linear-gradient(180deg, var(--primary-color) 0%, #0a4d29 100%);
        padding: 90px 25px 40px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        overflow-y: auto;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .main-nav li {
        width: 100%;
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    
    .main-nav.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .main-nav.active li:nth-child(1) { transition-delay: 0.1s; }
    .main-nav.active li:nth-child(2) { transition-delay: 0.15s; }
    .main-nav.active li:nth-child(3) { transition-delay: 0.2s; }
    .main-nav.active li:nth-child(4) { transition-delay: 0.25s; }
    .main-nav.active li:nth-child(5) { transition-delay: 0.3s; }
    .main-nav.active li:nth-child(6) { transition-delay: 0.35s; }
    
    .main-nav a {
        display: block;
        padding: 14px 20px;
        font-size: 1.05rem;
        border-radius: 10px;
        background: rgba(243, 217, 172, 0.05);
    }
    
    .main-nav a::after {
        display: none;
    }
    
    .main-nav a:hover,
    .main-nav a.active {
        background: var(--secondary-color);
        color: var(--primary-color);
        padding-right: 25px;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin-top: 5px;
    }
    
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-col:nth-child(1) {
        grid-column: 1 / -1;
        text-align: center;
    }
    
    .footer-col:nth-child(1) .social-links {
        justify-content: center;
    }
    
    .footer-col:nth-child(1) h3::after,
    .footer-col:nth-child(2) h3::after,
    .footer-col:nth-child(3) h3::after {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-col:nth-child(1) h3,
    .footer-col:nth-child(2) h3,
    .footer-col:nth-child(3) h3 {
        text-align: center;
    }
    
    .footer-col:nth-child(2),
    .footer-col:nth-child(3) {
        text-align: center;
    }
    
    .footer-links a::before {
        display: none;
    }
    
    .contact-info li {
        justify-content: center;
    }
    
    .sudoku-game-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* موبایل بزرگ */
@media (max-width: 768px) {
    .logo-text span {
        display: none;
    }
    
    .site-logo a {
        gap: 8px;
    }
    
    .hero-slider {
        height: 60vh;
        min-height: 340px;
    }
    
    .slider-prev,
    .slider-next {
        width: 38px;
        height: 38px;
    }
    
    .menu-tabs {
        gap: 8px;
    }
    
    .sudoku-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .difficulty-selector {
        justify-content: center;
    }
    
    .game-actions {
        justify-content: center;
    }
    
    .game-actions .btn {
        flex: 1;
        min-width: 0;
    }
    
    .top-players-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 340px;
    }
    
    .top-player-card.rank-gold {
        order: -1;
    }
    
    .play-invite {
        flex-direction: column;
        text-align: center;
    }
    
    .play-invite .btn-primary {
        width: 100%;
    }
    
    .leaderboard-block {
        padding: 20px 15px;
    }
    
    .records-table {
        min-width: 560px;
    }
    
    .quiz-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-banner .btn {
        width: 100%;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    /* دکمه PWA در موبایل */
    .pwa-install-btn {
        bottom: 15px;
        left: 15px;
        right: 15px;
        justify-content: center;
        font-size: 0.85rem;
        padding: 11px 18px;
    }
}

/* موبایل کوچک */
@media (max-width: 480px) {
    :root {
        --container-padding: 0.85rem;
        --section-spacing: 2rem;
    }
    
    .hero-slider {
        height: 55vh;
        min-height: 300px;
    }
    
    .hero-content h2 {
        font-size: 1.4rem;
    }
    
    .slider-dots {
        bottom: 12px;
        gap: 7px;
    }
    
    .slider-dot {
        width: 10px;
        height: 10px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-col:nth-child(1) {
        grid-column: auto;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-search-bar .search-form {
        padding: 4px 4px 4px 14px;
    }
    
    .menu-search-bar .search-form button {
        width: 38px;
        height: 38px;
    }
    
    .sudoku-game-bar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .game-info-item {
        padding: 10px 6px;
    }
    
    .game-info-item strong {
        font-size: 0.9rem;
    }
    
    .game-info-item span {
        font-size: 0.68rem;
    }
    
    .difficulty-selector > span {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .diff-btn {
        flex: 1;
        text-align: center;
        padding: 7px 10px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .game-actions .btn {
        width: 100%;
    }
    
    .sudoku-cell {
        font-size: 0.85rem;
    }
    
    .win-stats {
        grid-template-columns: 1fr;
    }
    
    .win-actions {
        flex-direction: column;
    }
    
    .win-actions .btn {
        width: 100%;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .page-link i {
        font-size: 0.6rem;
    }
    
    .records-table {
        min-width: 520px;
    }
    
    .records-filter-btn {
        padding: 6px 12px;
        font-size: 0.72rem;
    }
    
    .records-filter-btn i {
        font-size: 0.75rem;
    }
}

/* موبایل خیلی کوچک */
@media (max-width: 360px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-text h1 {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 34px;
    }
    
    .search-box {
        padding: 4px 12px;
    }
}

/* حالت افقی موبایل */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 100vh;
        min-height: 260px;
    }
    
    .main-nav {
        padding: 70px 20px 30px;
    }
    
    .main-nav a {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

/* کاهش انیمیشن برای کاربرانی که ترجیح می‌دهند */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* حالت چاپ */
@media print {
    .main-header,
    .main-footer,
    .menu-toggle,
    .search-box,
    .slider-prev,
    .slider-next,
    .slider-dots,
    .pwa-install-btn {
        display: none !important;
    }
}