/* ═══════════════════════════════════════════════════════════
   🎪 سرزمین بازی رایگان آراد - استایل عمومی
   Mobile-First Design
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   🎨 متغیرهای اصلی
   ═══════════════════════════════════════════════════════════ */
:root {
    /* رنگ‌های اصلی */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #f093fb;
    --accent: #4facfe;
    --success: #43e97b;
    --warning: #fa709a;
    --gold: #ffd700;
    
    /* گرادیان‌ها */
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-button: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    
    /* سایه‌ها */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    /* فونت */
    --font-main: 'Vazir', Tahoma, sans-serif;
    
    /* گوشه‌ها */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* ═══════════════════════════════════════════════════════════
   🔄 ریست و پایه
   ═══════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--gradient-main);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   🎬 صفحه لودینگ
   ══════════════════════════════════════════════════════════ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.loading-title {
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-top-color: var(--gold);
    animation-duration: 1s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-top-color: var(--success);
    animation-duration: 0.75s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.loading-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    background: var(--gradient-button);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
    المان‌های تزئینی پس‌زمینه
   ═══════════════════════════════════════════════════════════ */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.balloon {
    position: absolute;
    font-size: 40px;
    animation: float-up 15s linear infinite;
    opacity: 0.6;
}

.balloon-1 { left: 10%; animation-delay: 0s; }
.balloon-2 { left: 30%; animation-delay: 3s; }
.balloon-3 { left: 50%; animation-delay: 6s; }
.balloon-4 { left: 70%; animation-delay: 9s; }
.balloon-5 { left: 90%; animation-delay: 12s; }

@keyframes float-up {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.star {
    position: absolute;
    font-size: 24px;
    animation: twinkle 3s ease-in-out infinite;
}

.star-1 { top: 10%; left: 15%; animation-delay: 0s; }
.star-2 { top: 20%; right: 20%; animation-delay: 0.5s; }
.star-3 { top: 40%; left: 25%; animation-delay: 1s; }
.star-4 { top: 60%; right: 15%; animation-delay: 1.5s; }
.star-5 { top: 75%; left: 10%; animation-delay: 2s; }
.star-6 { top: 85%; right: 25%; animation-delay: 2.5s; }

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(180deg);
    }
}

.confetti {
    position: absolute;
    font-size: 30px;
    animation: confetti-fall 8s linear infinite;
    opacity: 0.7;
}

.confetti-1 { left: 20%; animation-delay: 0s; }
.confetti-2 { left: 60%; animation-delay: 2.5s; }
.confetti-3 { left: 80%; animation-delay: 5s; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.7; }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   🏠 محتوای اصلی
   ══════════════════════════════════════════════════════════ */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 40px;
}

/* ═══════════════════════════════════════════════════════════
   🎯 هدر
   ═══════════════════════════════════════════════════════════ */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.logo-icon {
    font-size: 40px;
    animation: bounce 2s infinite;
}

.logo-text h1 {
    font-size: 18px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text p {
    font-size: 14px;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════════════
   🎉 بنر خوش‌آمدگویی
   ═══════════════════════════════════════════════════════════ */
.welcome-banner {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.welcome-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    color: white;
    box-shadow: var(--shadow-md);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.welcome-content h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.welcome-content p {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 15px;
}

.welcome-emojis {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 28px;
}

.welcome-emojis span {
    animation: bounce 2s infinite;
}

.welcome-emojis span:nth-child(2) { animation-delay: 0.2s; }
.welcome-emojis span:nth-child(3) { animation-delay: 0.4s; }
.welcome-emojis span:nth-child(4) { animation-delay: 0.6s; }
.welcome-emojis span:nth-child(5) { animation-delay: 0.8s; }

/* ═══════════════════════════════════════════════════════════
   🎮 بخش بازی‌ها
   ═══════════════════════════════════════════════════════════ */
.games-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.section-title {
    color: white;
    font-size: 24px;
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.title-icon {
    font-size: 32px;
    animation: bounce 2s infinite;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ═══════════════════════════════════════════════════════════
    کارت بازی
   ═══════════════════════════════════════════════════════════ */
.game-card {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
}

.game-card.game-active {
    border-color: var(--success);
}

.game-card.game-active:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-card.game-coming-soon {
    opacity: 0.7;
    filter: grayscale(0.3);
    cursor: not-allowed;
}

.card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.game-card.game-active:hover .card-shine {
    transform: translateX(100%);
}

.card-badge,
.card-badge-new,
.card-badge-soon {
    position: absolute;
    top: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.card-badge {
    right: 15px;
    background: var(--success);
    color: white;
}

.card-badge-new {
    left: 15px;
    background: var(--warning);
    color: white;
}

.card-badge-soon {
    right: 15px;
    background: #999;
    color: white;
}

.game-icon {
    font-size: 80px;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

.game-title {
    font-size: 22px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.game-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.game-features {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.feature {
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    color: var(--primary-dark);
}

.play-button {
    width: 100%;
    padding: 15px;
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-main);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.play-button:active {
    transform: scale(0.98);
}

.play-button-disabled {
    background: #ccc;
    cursor: not-allowed;
}

.play-button-disabled:hover {
    transform: none;
}

/* ═══════════════════════════════════════════════════════════
   🦶 فوتر
   ══════════════════════════════════════════════════════════ */
.footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 30px 20px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    margin-bottom: 20px;
    text-align: center;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.footer-section p {
    font-size: 14px;
    opacity: 0.9;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    opacity: 0.8;
}

.footer-emojis {
    margin-top: 10px;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
    Responsive - تبلت
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .loading-logo {
        font-size: 100px;
    }
    
    .loading-title {
        font-size: 32px;
    }
    
    .logo-text h1 {
        font-size: 24px;
    }
    
    .logo-text p {
        font-size: 16px;
    }
    
    .logo-icon {
        font-size: 50px;
    }
    
    .welcome-content h2 {
        font-size: 28px;
    }
    
    .welcome-content p {
        font-size: 17px;
    }
    
    .welcome-emojis {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .game-icon {
        font-size: 100px;
    }
    
    .game-title {
        font-size: 26px;
    }
    
    .game-description {
        font-size: 15px;
    }
}

/* ═══════════════════════════════════════════════════════════
   💻 Responsive - دسکتاپ
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .game-card {
        padding: 30px 25px;
    }
    
    .game-icon {
        font-size: 120px;
    }
    
    .game-title {
        font-size: 28px;
    }
    
    .welcome-content {
        padding: 40px 30px;
    }
    
    .welcome-content h2 {
        font-size: 36px;
    }
    
    .footer-section {
        display: inline-block;
        margin-right: 40px;
        text-align: right;
    }
}

/* ═══════════════════════════════════════════════════════════
   📱 موبایل کوچک
   ══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .logo-text h1 {
        font-size: 16px;
    }
    
    .logo-icon {
        font-size: 32px;
    }
}

/* ═══════════════════════════════════════════════════════════
   🌙 حالت تاریک سیستم
   ═══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    .game-card {
        background: linear-gradient(135deg, #2a2a4e 0%, #3a3a5e 100%);
    }
    
    .game-title {
        color: #fff;
    }
    
    .game-description {
        color: #ccc;
    }
    
    .feature {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
}

/* ═══════════════════════════════════════════════════════════
   🎯 بهینه‌سازی برای لمس
   ═══════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    .game-card.game-active:active {
        transform: scale(0.98);
    }
    
    .play-button:active {
        transform: scale(0.95);
    }
}

/* ═══════════════════════════════════════════════════════════
   ⚡ انیمیشن‌های کاهش حرکت
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}