/* متغیرهای رنگی و تم */
:root {
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #1a1a1a;
    --gold: #ffd700;
    --blue: #1e5c8b;
    --gradient: linear-gradient(135deg, #ffffff, #ffd700);
    --red: #b22222;
    --emerald-green: #2e7d32;
    --table-header-bg: linear-gradient(90deg, #1e5c8b, #4fc3f7);
}

/* انیمیشن‌ها */
@keyframes alirzshop-game-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes alirzshop-game-shadowPulse {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
    50% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
}

@keyframes alirzshop-game-scaleHover {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

@keyframes alirzshop-game-logoHover {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* استایل‌های اصلی بخش بازی */
.alirzshop-game-section {
    max-width: 1200px;
    margin: 40px auto 20px;
    padding: 0 20px;
    animation: alirzshop-game-fadeIn 0.8s ease-out;
    box-sizing: border-box;
}

.alirzshop-game-container {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: alirzshop-game-shadowPulse 3.5s infinite ease-in-out;
    box-sizing: border-box;
}

.alirzshop-game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 2.5rem;
    color: var(--blue);
    margin-bottom: 25px;
    font-weight: 700;
}

.alirzshop-game-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alirzshop-game-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.alirzshop-game-logo:hover {
    animation: alirzshop-game-logoHover 0.3s forwards;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.alirzshop-total-players {
    font-size: 1.2rem;
    color: var(--dark-gray);
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.alirzshop-total-players span {
    color: var(--emerald-green);
    font-weight: 700;
}

.alirzshop-leaderboards {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.alirzshop-leaderboard {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alirzshop-leaderboard-title {
    font-size: 1.5rem;
    color: var(--dark-gray);
    margin-bottom: 15px;
    text-align: center;
}

.alirzshop-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alirzshop-leaderboard-table thead {
    background: var(--table-header-bg);
    color: var(--white);
}

.alirzshop-leaderboard-table th {
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

.alirzshop-leaderboard-table tbody tr {
    border-bottom: 1px solid var(--light-gray);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alirzshop-leaderboard-table tbody tr:hover {
    animation: alirzshop-game-scaleHover 0.2s forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alirzshop-leaderboard-table td {
    padding: 10px;
    font-size: 0.95rem;
    text-align: center;
    color: var(--dark-gray);
}

.alirzshop-leaderboard-table td.level {
    font-weight: 600;
    color: var(--emerald-green);
}

.alirzshop-leaderboard-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--emerald-green);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.alirzshop-leaderboard-icon:hover {
    transform: scale(1.1);
}

.alirzshop-game-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient);
    color: var(--dark-gray);
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.alirzshop-game-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* استایل‌های مودال پروفایل */
.profile-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    padding: 10px;
    animation: alirzshop-game-fadeIn 0.3s ease-out;
}

.profile-modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: alirzshop-game-scaleHover 0.3s ease-out;
    border: 2px solid var(--gold);
}

.profile-modal-close {
    position: absolute;
    top: -30px;
    right: -10px;
    color: var(--red);
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    background: var(--white);
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-modal-close:hover {
    transform: scale(1.2);
    color: var(--dark-gray);
}

.profile-modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.profile-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--emerald-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-modal-header h3 {
    font-size: 1.8rem;
    color: var(--dark-gray);
    font-weight: 700;
    margin: 0;
}

.profile-modal-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-modal-stats p {
    font-size: 1.1rem;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.profile-modal-stats p i {
    color: var(--blue);
    font-size: 1.2rem;
}

.profile-modal-stats p span {
    font-weight: 600;
    color: var(--emerald-green);
}

/* پیام خطا */
.alirzshop-game-error {
    color: var(--red);
    font-size: 1rem;
    text-align: center;
    margin: 20px auto;
    padding: 12px;
    border-radius: 10px;
    background: rgba(178, 34, 34, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* واکنش‌گرایی برای تبلت */
@media (max-width: 768px) {
    .alirzshop-game-section {
        margin: 30px auto 15px;
        padding: 0 15px;
    }

    .alirzshop-game-container {
        padding: 20px;
    }

    .alirzshop-game-title {
        font-size: 2rem;
    }

    .alirzshop-game-logo {
        width: 40px;
        height: 40px;
    }

    .alirzshop-total-players {
        font-size: 1.1rem;
    }

    .alirzshop-leaderboards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .alirzshop-leaderboard-title {
        font-size: 1.3rem;
    }

    .alirzshop-leaderboard-table th {
        font-size: 0.95rem;
        padding: 10px;
    }

    .alirzshop-leaderboard-table td {
        font-size: 0.9rem;
        padding: 8px;
    }

    .alirzshop-leaderboard-icon {
        width: 35px;
        height: 35px;
    }

    .alirzshop-game-play-btn {
        font-size: 0.95rem;
    }

    .profile-modal-content {
        max-width: 95%;
        padding: 15px;
    }

    .profile-modal-icon {
        width: 60px;
        height: 60px;
    }

    .profile-modal-header h3 {
        font-size: 1.5rem;
    }

    .profile-modal-stats p {
        font-size: 1rem;
    }

    .profile-modal-close {
        top: -25px;
        right: -5px;
        font-size: 1.5rem;
    }
}

/* واکنش‌گرایی برای موبایل */
@media (max-width: 480px) {
    .alirzshop-game-section {
        margin: 20px auto 10px;
    }

    .alirzshop-game-container {
        padding: 15px;
    }

    .alirzshop-game-title {
        font-size: 1.8rem;
    }

    .alirzshop-game-logo {
        width: 35px;
        height: 35px;
    }

    .alirzshop-total-players {
        font-size: 1rem;
    }

    .alirzshop-leaderboard-title {
        font-size: 1.2rem;
    }

    .alirzshop-leaderboard-table th {
        font-size: 0.9rem;
        padding: 8px;
    }

    .alirzshop-leaderboard-table td {
        font-size: 0.85rem;
        padding: 6px;
    }

    .alirzshop-leaderboard-icon {
        width: 30px;
        height: 30px;
    }

    .alirzshop-game-play-btn {
        font-size: 0.9rem;
    }

    .profile-modal-content {
        max-width: 90%;
        padding: 12px;
    }

    .profile-modal-icon {
        width: 50px;
        height: 50px;
    }

    .profile-modal-header h3 {
        font-size: 1.3rem;
    }

    .profile-modal-stats p {
        font-size: 0.9rem;
    }

    .profile-modal-close {
        top: -20px;
        right: -5px;
        font-size: 1.3rem;
    }
}